/* , fillString = ' ' */

/* , start = 0, end = @length */

/* WEBPACK VAR INJECTION */

/* harmony default export */

/* harmony export (binding) */

/* harmony import */

/* import() */

/* impossible */

/* unused */

/* unused harmony export AcroForm */

/* unused harmony export AcroFormAppearance */

/* unused harmony export AcroFormButton */

/* unused harmony export AcroFormCheckBox */

/* unused harmony export AcroFormChoiceField */

/* unused harmony export AcroFormComboBox */

/* unused harmony export AcroFormEditBox */

/* unused harmony export AcroFormListBox */

/* unused harmony export AcroFormPasswordField */

/* unused harmony export AcroFormPushButton */

/* unused harmony export AcroFormRadioButton */

/* unused harmony export AcroFormTextField */

/* unused harmony export AsyncCompress */

/* unused harmony export AsyncDecompress */

/* unused harmony export AsyncDeflate */

/* unused harmony export AsyncGunzip */

/* unused harmony export AsyncGzip */

/* unused harmony export AsyncInflate */

/* unused harmony export AsyncUnzipInflate */

/* unused harmony export AsyncUnzlib */

/* unused harmony export AsyncZipDeflate */

/* unused harmony export AsyncZlib */

/* unused harmony export Compress */

/* unused harmony export DecodeUTF8 */

/* unused harmony export Decompress */

/* unused harmony export Deflate */

/* unused harmony export EncodeUTF8 */

/* unused harmony export FlateErrorCode */

/* unused harmony export GState */

/* unused harmony export Gunzip */

/* unused harmony export Gzip */

/* unused harmony export Inflate */

/* unused harmony export ShadingPattern */

/* unused harmony export TilingPattern */

/* unused harmony export Unzip */

/* unused harmony export UnzipInflate */

/* unused harmony export UnzipPassThrough */

/* unused harmony export Unzlib */

/* unused harmony export Zip */

/* unused harmony export ZipDeflate */

/* unused harmony export ZipPassThrough */

/* unused harmony export Zlib */

/* unused harmony export compress */

/* unused harmony export compressSync */

/* unused harmony export decompress */

/* unused harmony export decompressSync */

/* unused harmony export deflate */

/* unused harmony export deflateSync */

/* unused harmony export gunzip */

/* unused harmony export gunzipSync */

/* unused harmony export gzip */

/* unused harmony export gzipSync */

/* unused harmony export inflate */

/* unused harmony export inflateSync */

/* unused harmony export jsPDF */

/* unused harmony export strFromU8 */

/* unused harmony export strToU8 */

/* unused harmony export unzip */

/* unused harmony export unzipSync */

/* unused harmony export unzlib */

/* unused harmony export zip */

/* unused harmony export zipSync */

/* unused harmony export zlib */

/*#__PURE__*/

/**
 * @license
  Copyright (c) 2008, Adobe Systems Incorporated
  All rights reserved.

  Redistribution and use in source and binary forms, with or without 
  modification, are permitted provided that the following conditions are
  met:

  * Redistributions of source code must retain the above copyright notice, 
    this list of conditions and the following disclaimer.
  
  * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the 
    documentation and/or other materials provided with the distribution.
  
  * Neither the name of Adobe Systems Incorporated nor the names of its 
    contributors may be used to endorse or promote products derived from 
    this software without specific prior written permission.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/**
 * @license
 *
 * Copyright (c) 2014 James Robb, https://github.com/jamesbrobb
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 * ====================================================================
 */

/**
 * @license
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */

/**
 * @license
 * (c) Dean McNamee <dean@gmail.com>, 2013.
 *
 * https://github.com/deanm/omggif
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to
 * deal in the Software without restriction, including without limitation the
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 * sell copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 *
 * omggif is a JavaScript implementation of a GIF 89a encoder and decoder,
 * including animation and compression.  It does not rely on any specific
 * underlying system, so should run in the browser, Node, or Plask.
 */

/**
 * @license
 * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */

/**
 * @license
 * Copyright (c) 2017 Aras Abbasi
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */

/**
 * @license
 * Copyright (c) 2018 Aras Abbasi
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */

/**
 * @license
 * Copyright (c) 2019 Aras Abbasi
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */

/**
 * @license
 * FPDF is released under a permissive license: there is no usage restriction.
 * You may embed it freely in your application (commercial or not), with or
 * without modifications.
 *
 * Reference: http://www.fpdf.org/en/script/script37.php
 */

/**
 * @license
 * Joseph Myers does not specify a particular license for his work.
 *
 * Author: Joseph Myers
 * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
 *
 * Modified by: Owen Leong
 */

/**
 * @license
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 * Author: Owen Leong (@owenl131)
 * Date: 15 Oct 2020
 * References:
 * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
 * https://github.com/foliojs/pdfkit/blob/master/lib/security.js
 * http://www.fpdf.org/en/script/script37.php
 */

/**
 * @license
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */

/**
 * @license
 * Unicode Bidi Engine based on the work of Alex Shensis (@asthensis)
 * MIT License
 */

/**
 * @license
 * jsPDF fileloading PlugIn
 * Copyright (c) 2018 Aras Abbasi (aras.abbasi@gmail.com)
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */

/**
 * @license
 * jsPDF filters PlugIn
 * Copyright (c) 2014 Aras Abbasi
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */

/**
 * @license
 * jsPDF virtual FileSystem functionality
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */

/**
 * A class to parse color values
 * @author Stoyan Stefanov <sstoo@gmail.com>
 * {@link   http://www.phpied.com/rgb-color-parser-in-javascript/}
 * @license Use it if you like it
 */

/**
 * Compress data with Zlib
 * @param data The data to compress
 * @param opts The compression options
 * @returns The zlib-compressed version of the data
 */

/**
 * Expands Zlib data
 * @param data The data to decompress
 * @param opts The decompression options
 * @returns The decompressed version of the data
 */

/**
 * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for
 * better performance.
 */

/**
 * Streaming GZIP, Zlib, or raw DEFLATE decompression
 */

/**
 * Streaming Zlib decompression
 */

/**
 * Streaming pass-through decompression for ZIP archives
 */

/** ====================================================================
 * @license
 * jsPDF XMP metadata plugin
 * Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 * ====================================================================
 */

/** @license
   * Copyright (c) 2017 Dominik Homberger
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  https://webpjs.appspot.com
  WebPRiffParser dominikhlbg@gmail.com
  */

/** @license
 * Copyright (c) 2012 Willow Systems Corporation, https://github.com/willowsystems
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 * ====================================================================
 */

/***/

//    left            cost

//    length tree                 distance tree

//  copy   count

//  ind      num         streak

//  ind    debt

//  last chunk         bitpos           bytes

//  len    dist   chain

//  literal                            lengths

// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)

// Assumes roughly 33% compression ratio average

// BFINAL - this is only 1 when last chunk is next

// Copy over uncompressed data

// DEFLATE is a complex format; to read this code, you should probably check the RFC first:

// Default algorithm for compression (used because having a known output size allows faster decompression)

// Double or set to necessary, whichever is greater

// Get new bitpos, update byte count

// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.

// Make sure the buffer can hold this + the largest possible addition

// Make sure this is recognized as a len/dist with 28th bit (2^28)

// Maximum chunk size (practically, theoretically infinite) is 2^17

// Much faster than just using the start

// Need extra info to make a tree

// Note that the semicolon was intentional

// Some of the following code is similar to that of UZIP.js:

// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint

// TODO: find out how this code works (debt)

// TODO: optimize/split up?

// We always should modify head and prev, but only add symbols if

// You may also wish to take a look at the guide I made about this program:

// after i2 reaches last ind, will be stopped

// bits read

// bits read, code

// bits to remove for reverser

// break out early when we reach "nice" (we are satisfied enough)

// bytes remaining

// can't use .constructor in case user-supplied

// check the previous match

// closures have awful performance

// code length to copy

// code length tree

// code lengths

// code lengths bits

// code lengths map

// create huffman tree from u8 "map": index -> code length for code index

// d will be nonzero only when a match was found

// decode UTF8

// dist

// don't reallocate for streams or user buffers

// efficient algorithm from UZIP.js

// end

// ensure buffer can fit at least l elements

// ensure size

// every 16 bit value starting with the code yields the same result

// fixed distance map

// fixed distance tree

// fixed length map

// fixed length tree

// flatten a directory structure

// free bits

// freq must be greater than largest possible number of symbols

// go to end of byte boundary

// hash value

// have to estimate size

// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad

// https://github.com/photopea/UZIP.js

// https://github.com/tc39/proposal-string-pad-start-end

// https://tools.ietf.org/html/rfc1951

// i0 is lookbehind, i2 is lookahead - after processing two low-freq

// ignore 0 lengths

// index

// index mod 32768    previous index mod

// is better for memory in most engines (I *think*).

// length of cd must be 288 (total # of codes)

// length of literals and search for that instead.

// length+distance tree

// m is end value

// map of value to reverse (assuming 16 bits)

// max bits in tree

// max dist bits

// max length bits

// mb (max bits) must be at most 15

// more algorithms from UZIP.js

// need to increase size to fit

// no extra bits needed if less

// no need to write 00 as type: TypedArray defaults to 0

// non-composite) symbols instead

// now, find the rarest 2-byte sequence within this

// num encoding both symbol and bits read

// numbers here are at max 18 bits

// reverse table algorithm from SO

// see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/

// shft(pos) now 1 less if pos & 7 != 0

// source length       dict length

// store both dist and len data in one int32

// symbols that combined have high freq, will start processing i2 (high-freq,

// text encoder

// this data is not yet processed ("wait" for wait index)

// type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman

// u16 "map": index -> minimum code for bit length = index

// u16 "map": index -> number of actual bits, symbol for code

// use index map to get real code

// we can ignore the fact that the other numbers are wrong; they never happen anyway

// write final block
