{"version":3,"sources":["webpack:///./node_modules/react-dropdown-select/lib/components/NoData.js","webpack:///./node_modules/pdf-lib/es/utils/strings.js","webpack:///./node_modules/pako/index.js","webpack:///./src/assets/pdf/contract-package-1.pdf","webpack:///./node_modules/warning/warning.js","webpack:///./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","webpack:///./node_modules/exenv/index.js","webpack:///./src/components/NotFound.js","webpack:///./node_modules/react-modal/lib/helpers/safeHTMLElement.js","webpack:///./node_modules/react-dropdown-select/lib/models/SelectPropsModel.js","webpack:///./node_modules/pdf-lib/es/index.js","webpack:///./node_modules/uuid/dist/esm-browser/rng.js","webpack:///./node_modules/uuid/dist/esm-browser/regex.js","webpack:///./node_modules/uuid/dist/esm-browser/stringify.js","webpack:///./node_modules/uuid/dist/esm-browser/validate.js","webpack:///./node_modules/uuid/dist/esm-browser/v4.js","webpack:///./node_modules/pako/lib/zlib/crc32.js","webpack:///./node_modules/react-dropdown-select/lib/components/Loading.js","webpack:///./node_modules/react-modal/lib/index.js","webpack:///./node_modules/pdf-lib/es/core/objects/PDFObject.js","webpack:///./node_modules/react-dropdown-select/lib/components/Clear.js","webpack:///./node_modules/pako/lib/zlib/trees.js","webpack:///./node_modules/react-dropdown-select/lib/components/Item.js","webpack:///./node_modules/react-dropdown-select/lib/models/SelectMethodsModel.js","webpack:///./node_modules/react-dropdown-select/lib/components/Dropdown.js","webpack:///./node_modules/react-dropdown-select/lib/components/Option.js","webpack:///./node_modules/react-dropdown-select/lib/models/SelectStateModel.js","webpack:///./node_modules/pako/lib/zlib/constants.js","webpack:///./node_modules/react-dropdown-select/lib/constants.js","webpack:///./node_modules/react-modal/lib/components/ModalPortal.js","webpack:///./node_modules/pako/lib/deflate.js","webpack:///./src/assets/pdf/insurance-doc.pdf","webpack:///./node_modules/react-modal/lib/helpers/scopeTab.js","webpack:///./node_modules/react-is/index.js","webpack:///./node_modules/pako/lib/zlib/messages.js","webpack:///./node_modules/react-modal/lib/helpers/portalOpenInstances.js","webpack:///./node_modules/react-modal/lib/helpers/focusManager.js","webpack:///./node_modules/pdf-lib/es/core/objects/PDFHexString.js","webpack:///./src/assets/pdf/contract-package-3.pdf","webpack:///./node_modules/react-dropdown-select/lib/components/Content.js","webpack:///./node_modules/react-modal/lib/helpers/bodyTrap.js","webpack:///./node_modules/react-dropdown-select/lib/components/Separator.js","webpack:///./node_modules/react-dropdown-select/lib/components/DropdownHandle.js","webpack:///./node_modules/react-modal/lib/helpers/ariaAppHider.js","webpack:///./node_modules/react-modal/lib/helpers/tabbable.js","webpack:///./src/assets/pdf/credit-approval.pdf","webpack:///./node_modules/pako/lib/zlib/inftrees.js","webpack:///./node_modules/pdf-lib/es/api/rotations.js","webpack:///./node_modules/pdf-lib/es/api/objects.js","webpack:///./node_modules/pdf-lib/es/api/operators.js","webpack:///./node_modules/pdf-lib/es/api/colors.js","webpack:///./node_modules/pdf-lib/es/api/text/alignment.js","webpack:///./node_modules/pdf-lib/es/api/svgPath.js","webpack:///./node_modules/pdf-lib/es/api/operations.js","webpack:///./node_modules/pdf-lib/es/api/errors.js","webpack:///./node_modules/pdf-lib/es/api/text/layout.js","webpack:///./node_modules/pdf-lib/es/api/image/alignment.js","webpack:///./node_modules/pdf-lib/es/api/form/appearances.js","webpack:///./node_modules/pdf-lib/es/api/PDFEmbeddedPage.js","webpack:///./node_modules/pdf-lib/es/api/PDFFont.js","webpack:///./node_modules/pdf-lib/es/api/PDFImage.js","webpack:///./node_modules/pdf-lib/es/api/form/PDFField.js","webpack:///./node_modules/pdf-lib/es/api/StandardFonts.js","webpack:///./node_modules/pdf-lib/es/api/form/PDFCheckBox.js","webpack:///./node_modules/pdf-lib/es/api/form/PDFDropdown.js","webpack:///./node_modules/pdf-lib/es/api/form/PDFOptionList.js","webpack:///./node_modules/pdf-lib/es/api/form/PDFRadioGroup.js","webpack:///./node_modules/pdf-lib/es/api/form/PDFSignature.js","webpack:///./node_modules/pdf-lib/es/api/form/PDFTextField.js","webpack:///./node_modules/pdf-lib/es/api/form/PDFForm.js","webpack:///./node_modules/pdf-lib/es/api/PDFDocumentOptions.js","webpack:///./node_modules/pdf-lib/es/api/sizes.js","webpack:///./node_modules/pdf-lib/es/api/PDFPageOptions.js","webpack:///./node_modules/pdf-lib/es/api/PDFEmbeddedFile.js","webpack:///./node_modules/pdf-lib/es/api/PDFJavaScript.js","webpack:///./node_modules/pdf-lib/es/core/embedders/JavaScriptEmbedder.js","webpack:///./node_modules/pdf-lib/es/api/PDFDocument.js","webpack:///./node_modules/pdf-lib/es/api/PDFPage.js","webpack:///./node_modules/pdf-lib/es/api/form/PDFButton.js","webpack:///./node_modules/pako/lib/inflate.js","webpack:///./node_modules/pako/lib/utils/strings.js","webpack:///./node_modules/pdf-lib/es/core/objects/PDFString.js","webpack:///./node_modules/react-modal/lib/helpers/classList.js","webpack:///./node_modules/pako/lib/zlib/inffast.js","webpack:///./node_modules/pako/lib/zlib/gzheader.js","webpack:///./node_modules/react-dropdown-select/lib/util.js","webpack:///./node_modules/react-transition-group/esm/config.js","webpack:///./node_modules/react-transition-group/esm/TransitionGroupContext.js","webpack:///./node_modules/react-transition-group/esm/Transition.js","webpack:///./node_modules/react-transition-group/esm/utils/reflow.js","webpack:///./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack:///./node_modules/clsx/dist/clsx.m.js","webpack:///./node_modules/react-toastify/dist/react-toastify.esm.js","webpack:///./src/util/helpers.js","webpack:///./src/components/PrivateRoute.js","webpack:///./src/components/ResetPassword.js","webpack:///./src/components/Login.js","webpack:///./src/components/PortalPage.js","webpack:///./src/components/LeaseSquare.js","webpack:///./src/components/BrokerDropdown.js","webpack:///./src/components/BrokerHome.js","webpack:///./src/components/CoLessees.js","webpack:///./src/util/reactHelpers.js","webpack:///./src/util/SignEasy.js","webpack:///./src/components/LeaseToggle.js","webpack:///./src/util/currency/constants.js","webpack:///./src/components/LeaseMainInfo.js","webpack:///./src/components/FileUpload.js","webpack:///./src/components/LeaseFiles.js","webpack:///./src/components/LeaseAdminReview.js","webpack:///./src/components/LeaseNeedsInfo.js","webpack:///./src/components/LeaseDenied.js","webpack:///./src/components/LeaseCreditForm.js","webpack:///./src/components/ESignatureStatus.js","webpack:///./src/util/docusign/DocusignActions.js","webpack:///./src/util/docusign/BuildAndSendEnvelope.js","webpack:///./src/components/LeaseContractForm.js","webpack:///./src/components/Lease.js","webpack:///./src/components/LeaseForm.js","webpack:///./src/components/NewLease.js","webpack:///./src/components/LeaseBar.js","webpack:///./src/components/SearchBar.js","webpack:///./src/components/LeaseOverview.js","webpack:///./src/pages/portal/index.js","webpack:///./node_modules/pako/lib/zlib/zstream.js","webpack:///./node_modules/react-dropdown-select/lib/components/ClickOutside.js","webpack:///./node_modules/pdf-lib/es/core/errors.js","webpack:///./node_modules/pdf-lib/es/utils/unicode.js","webpack:///./src/assets/pdf/contract-package-4.pdf","webpack:///./node_modules/@pdf-lib/standard-fonts/es/utils.js","webpack:///./node_modules/@pdf-lib/standard-fonts/es/Font.js","webpack:///./node_modules/@pdf-lib/standard-fonts/es/Encoding.js","webpack:///./src/assets/pdf/contract-package-2.pdf","webpack:///./node_modules/pako/lib/zlib/inflate.js","webpack:///./node_modules/pako/lib/zlib/deflate.js","webpack:///./node_modules/react-dropdown-select/lib/components/Input.js","webpack:///./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js","webpack:///./node_modules/react-dropdown-select/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js","webpack:///./node_modules/@emotion/react/node_modules/@emotion/sheet/dist/emotion-sheet.esm.js","webpack:///./node_modules/stylis/dist/stylis.mjs","webpack:///./node_modules/@emotion/react/node_modules/@emotion/cache/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js","webpack:///./node_modules/@emotion/react/node_modules/@emotion/cache/dist/emotion-cache.esm.js","webpack:///./node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.esm.js","webpack:///./node_modules/@emotion/react/dist/emotion-element-c39617d8.browser.esm.js","webpack:///./node_modules/react-dropdown-select/node_modules/@emotion/utils/dist/emotion-utils.esm.js","webpack:///./node_modules/react-dropdown-select/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js","webpack:///./node_modules/react-dropdown-select/node_modules/@emotion/serialize/dist/emotion-serialize.esm.js","webpack:///./node_modules/react-dropdown-select/node_modules/@emotion/hash/dist/emotion-hash.esm.js","webpack:///./node_modules/react-dropdown-select/node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js","webpack:///./node_modules/react-modal/lib/components/Modal.js","webpack:///./node_modules/pdf-lib/es/core/embedders/FileEmbedder.js","webpack:///./node_modules/react-is/cjs/react-is.production.min.js","webpack:///./node_modules/pdf-lib/es/core/syntax/CharCodes.js","webpack:///./src/assets/pdf/credit-decision.pdf","webpack:///./node_modules/pdf-lib/es/core/document/PDFHeader.js","webpack:///./node_modules/pdf-lib/es/core/objects/PDFNumber.js","webpack:///./node_modules/pdf-lib/es/core/objects/PDFArray.js","webpack:///./node_modules/pdf-lib/es/core/objects/PDFBool.js","webpack:///./node_modules/pdf-lib/es/core/syntax/Delimiters.js","webpack:///./node_modules/pdf-lib/es/core/syntax/Whitespace.js","webpack:///./node_modules/pdf-lib/es/core/syntax/Irregular.js","webpack:///./node_modules/pdf-lib/es/core/objects/PDFName.js","webpack:///./node_modules/pdf-lib/es/core/operators/PDFOperatorNames.js","webpack:///./node_modules/pdf-lib/es/core/objects/PDFNull.js","webpack:///./node_modules/pdf-lib/es/core/objects/PDFDict.js","webpack:///./node_modules/pdf-lib/es/core/objects/PDFStream.js","webpack:///./node_modules/pdf-lib/es/core/objects/PDFRawStream.js","webpack:///./node_modules/pdf-lib/es/core/objects/PDFRef.js","webpack:///./node_modules/pdf-lib/es/core/operators/PDFOperator.js","webpack:///./node_modules/pdf-lib/es/core/structures/PDFCrossRefStream.js","webpack:///./node_modules/pdf-lib/es/core/structures/PDFFlateStream.js","webpack:///./node_modules/pdf-lib/es/core/structures/PDFContentStream.js","webpack:///./node_modules/pdf-lib/es/utils/rng.js","webpack:///./node_modules/pdf-lib/es/core/PDFContext.js","webpack:///./node_modules/pdf-lib/es/core/structures/PDFPageLeaf.js","webpack:///./node_modules/pdf-lib/es/core/PDFObjectCopier.js","webpack:///./node_modules/pdf-lib/es/core/document/PDFCrossRefSection.js","webpack:///./node_modules/pdf-lib/es/core/document/PDFTrailer.js","webpack:///./node_modules/pdf-lib/es/core/document/PDFTrailerDict.js","webpack:///./node_modules/pdf-lib/es/core/structures/PDFObjectStream.js","webpack:///./node_modules/pdf-lib/es/core/writers/PDFWriter.js","webpack:///./node_modules/pdf-lib/es/core/objects/PDFInvalidObject.js","webpack:///./node_modules/pdf-lib/es/core/embedders/JpegEmbedder.js","webpack:///./node_modules/pdf-lib/es/core/writers/PDFStreamWriter.js","webpack:///./node_modules/pdf-lib/es/core/embedders/StandardFontEmbedder.js","webpack:///./node_modules/pdf-lib/es/core/embedders/CMap.js","webpack:///./node_modules/pdf-lib/es/core/embedders/CustomFontEmbedder.js","webpack:///./node_modules/pdf-lib/es/core/embedders/FontFlags.js","webpack:///./node_modules/pdf-lib/es/core/embedders/CustomFontSubsetEmbedder.js","webpack:///./node_modules/@pdf-lib/upng/UPNG.js","webpack:///./node_modules/pdf-lib/es/utils/png.js","webpack:///./node_modules/pdf-lib/es/core/interactive/ViewerPreferences.js","webpack:///./node_modules/pdf-lib/es/core/embedders/PngEmbedder.js","webpack:///./node_modules/pdf-lib/es/core/streams/Stream.js","webpack:///./node_modules/pdf-lib/es/core/streams/DecodeStream.js","webpack:///./node_modules/pdf-lib/es/core/streams/Ascii85Stream.js","webpack:///./node_modules/pdf-lib/es/core/streams/AsciiHexStream.js","webpack:///./node_modules/pdf-lib/es/core/streams/FlateStream.js","webpack:///./node_modules/pdf-lib/es/core/streams/LZWStream.js","webpack:///./node_modules/pdf-lib/es/core/streams/RunLengthStream.js","webpack:///./node_modules/pdf-lib/es/core/streams/decode.js","webpack:///./node_modules/pdf-lib/es/core/embedders/PDFPageEmbedder.js","webpack:///./node_modules/pdf-lib/es/core/acroform/flags.js","webpack:///./node_modules/pdf-lib/es/core/acroform/PDFAcroField.js","webpack:///./node_modules/pdf-lib/es/core/annotation/BorderStyle.js","webpack:///./node_modules/pdf-lib/es/core/annotation/PDFAnnotation.js","webpack:///./node_modules/pdf-lib/es/core/annotation/AppearanceCharacteristics.js","webpack:///./node_modules/pdf-lib/es/core/annotation/PDFWidgetAnnotation.js","webpack:///./node_modules/pdf-lib/es/core/acroform/PDFAcroTerminal.js","webpack:///./node_modules/pdf-lib/es/core/acroform/PDFAcroButton.js","webpack:///./node_modules/pdf-lib/es/core/acroform/PDFAcroCheckBox.js","webpack:///./node_modules/pdf-lib/es/core/acroform/PDFAcroChoice.js","webpack:///./node_modules/pdf-lib/es/core/acroform/PDFAcroComboBox.js","webpack:///./node_modules/pdf-lib/es/core/acroform/PDFAcroNonTerminal.js","webpack:///./node_modules/pdf-lib/es/core/acroform/PDFAcroSignature.js","webpack:///./node_modules/pdf-lib/es/core/acroform/PDFAcroText.js","webpack:///./node_modules/pdf-lib/es/core/acroform/PDFAcroPushButton.js","webpack:///./node_modules/pdf-lib/es/core/acroform/PDFAcroRadioButton.js","webpack:///./node_modules/pdf-lib/es/core/acroform/PDFAcroListBox.js","webpack:///./node_modules/pdf-lib/es/core/acroform/utils.js","webpack:///./node_modules/pdf-lib/es/core/acroform/PDFAcroForm.js","webpack:///./node_modules/pdf-lib/es/core/structures/PDFCatalog.js","webpack:///./node_modules/pdf-lib/es/core/structures/PDFPageTree.js","webpack:///./node_modules/pdf-lib/es/core/syntax/Numeric.js","webpack:///./node_modules/pdf-lib/es/core/parser/BaseParser.js","webpack:///./node_modules/pdf-lib/es/core/annotation/flags.js","webpack:///./node_modules/pdf-lib/es/core/parser/ByteStream.js","webpack:///./node_modules/pdf-lib/es/core/syntax/Keywords.js","webpack:///./node_modules/pdf-lib/es/core/parser/PDFObjectParser.js","webpack:///./node_modules/pdf-lib/es/core/parser/PDFObjectStreamParser.js","webpack:///./node_modules/pdf-lib/es/core/parser/PDFXRefStreamParser.js","webpack:///./node_modules/pdf-lib/es/core/parser/PDFParser.js","webpack:///./node_modules/react-dropdown-select/lib/index.js","webpack:///./node_modules/pdf-lib/es/utils/base64.js","webpack:///./node_modules/pdf-lib/es/utils/pdfDocEncoding.js","webpack:///./node_modules/pdf-lib/es/utils/arrays.js","webpack:///./node_modules/pdf-lib/es/utils/async.js","webpack:///./node_modules/pdf-lib/es/utils/numbers.js","webpack:///./node_modules/pdf-lib/es/utils/errors.js","webpack:///./node_modules/pdf-lib/es/utils/objects.js","webpack:///./node_modules/pdf-lib/es/utils/validators.js","webpack:///./node_modules/pdf-lib/es/utils/Cache.js","webpack:///./node_modules/pako/lib/utils/common.js","webpack:///./node_modules/moment/moment.js","webpack:///./node_modules/pako/lib/zlib/adler32.js"],"names":["exports","__esModule","default","_base","_interopRequireDefault","_react","_constants","a","NoDataComponent","target","color","_default","b","props","c","state","d","methods","noDataRenderer","createElement","className","LIB_NAME","noDataLabel","toCharCode","character","charCodeAt","toCodePoint","codePointAt","toHexStringOfMinLength","num","minLength","padStart","toString","toUpperCase","toHexString","charFromCode","code","String","fromCharCode","charFromHexCode","hex","parseInt","value","length","padChar","padding","idx","len","copyStringIntoBuffer","str","buffer","offset","cleanText","text","replace","escapedNewlineChars","isNewlineChar","test","lineSplit","split","mergeLines","charAtIndex","index","cuSecond","cuFirst","nextIndex","slice","charSplit","chars","_a","cLen","push","breakTextIntoLines","wordBreaks","maxWidth","computeWidthOfText","regex","newlineCharUnion","join","escapedRules","wordBreak","TypeError","breakRules","RegExp","buildWordBreakRegex","words","match","currLine","currWidth","lines","pushCurrLine","word","width","dateRegex","parseDate","dateStr","year","month","_b","day","_c","hours","_d","mins","_e","secs","_f","offsetSign","_g","offsetHours","_h","Date","findLastMatch","lastMatch","position","substring","pos","pako","assign","module","warning","reactIs","REACT_STATICS","childContextTypes","contextType","contextTypes","defaultProps","displayName","getDefaultProps","getDerivedStateFromError","getDerivedStateFromProps","mixins","propTypes","type","KNOWN_STATICS","name","prototype","caller","callee","arguments","arity","MEMO_STATICS","compare","TYPE_STATICS","getStatics","component","isMemo","ForwardRef","render","Memo","defineProperty","Object","getOwnPropertyNames","getOwnPropertySymbols","getOwnPropertyDescriptor","getPrototypeOf","objectPrototype","hoistNonReactStatics","targetComponent","sourceComponent","blacklist","inheritedComponent","keys","concat","targetStatics","sourceStatics","i","key","descriptor","e","canUseDOM","window","document","ExecutionEnvironment","canUseWorkers","Worker","canUseEventListeners","addEventListener","attachEvent","canUseViewport","screen","NotFound","_React$Component","apply","_inheritsLoose","___EmotionJSX","React","Fragment","Component","SafeNodeList","SafeHTMLCollection","undefined","obj","_exenv","EE","SafeHTMLElement","HTMLElement","HTMLCollection","NodeList","_propTypes","freeze","addPlaceholder","string","additionalProps","object","autoFocus","bool","backspaceDelete","clearAllLabel","clearOnBlur","clearOnSelect","clearRenderer","func","clearable","closeOnScroll","closeOnSelect","closeOnClickInput","compareValuesFunc","contentRenderer","create","createNewLabel","debounceDelay","number","direction","disabled","disabledLabel","dropdownGap","dropdownHandle","dropdownHandleRenderer","dropdownHeight","dropdownPosition","oneOf","dropdownRenderer","handleKeyDownFn","inputRenderer","itemRenderer","keepOpen","keepSelectedInList","labelField","loading","loadingRenderer","multi","onChange","isRequired","onClearAll","onCreateNew","onDropdownClose","onDropdownCloseRequest","onDropdownOpen","onSelectAll","optionRenderer","options","array","pattern","placeholder","portal","element","required","searchBy","searchFn","searchable","selectAll","selectAllLabel","separator","separatorRenderer","sortBy","style","valueField","values","defaultMenuIsOpen","getRandomValues","rnds8","Uint8Array","rng","crypto","bind","msCrypto","Error","uuid","byteToHex","substr","arr","toLowerCase","buf","rnds","random","crcTable","table","n","k","makeTable","crc","t","end","LoadingComponent","_Modal","_Modal2","PDFObject","clone","_context","this","constructor","sizeInBytes","copyBytesInto","_buffer","_offset","ClearComponent","styles","tabIndex","onClick","clearAll","onKeyPress","utils","zero","extra_lbits","extra_dbits","extra_blbits","bl_order","static_ltree","Array","static_dtree","D_CODES","_dist_code","_length_code","MAX_MATCH","base_length","static_l_desc","static_d_desc","static_bl_desc","base_dist","StaticTreeDesc","static_tree","extra_bits","extra_base","elems","max_length","has_stree","TreeDesc","dyn_tree","stat_desc","max_code","d_code","dist","put_short","s","w","pending_buf","pending","send_bits","bi_valid","bi_buf","send_code","tree","bi_reverse","res","gen_codes","bl_count","bits","next_code","MAX_BITS","init_block","LITERALS","dyn_ltree","dyn_dtree","bl_tree","END_BLOCK","opt_len","static_len","last_lit","matches","bi_windup","smaller","m","depth","_n2","_m2","pqdownheap","v","heap","j","heap_len","compress_block","ltree","dtree","lc","extra","lx","d_buf","l_buf","build_tree","desc","node","stree","heap_max","h","xbits","f","base","overflow","gen_bitlen","scan_tree","curlen","prevlen","nextlen","count","max_count","min_count","REP_3_6","REPZ_3_10","REPZ_11_138","send_tree","static_init_done","_tr_stored_block","stored_len","last","header","arraySet","copy_block","_tr_init","LENGTH_CODES","L_CODES","tr_static_init","l_desc","d_desc","bl_desc","_tr_flush_block","opt_lenb","static_lenb","max_blindex","level","strm","data_type","black_mask","detect_data_type","BL_CODES","build_bl_tree","strategy","lcodes","dcodes","blcodes","rank","send_all_trees","_tr_tally","lit_bufsize","_tr_align","STATIC_TREES","bi_flush","_getRequireWildcardCache","has","get","hasOwnProperty","call","g","set","_interopRequireWildcard","_util","WeakMap","_setPrototypeOf","setPrototypeOf","__proto__","Item","item","createRef","componentDidMount","current","isSelected","scrollIntoView","block","inline","componentDidUpdate","cursor","itemIndex","behavior","ItemComponent","role","ref","getByPath","addItem","hexToRGBA","activeCursorItem","areAllSelected","createNew","dropDown","getInputSize","getSelectBounds","getSelectRef","handleKeyDown","removeItem","safeString","searchResults","setSearch","toggleSelectAll","_NoData","_Item","getBoundingClientRect","bottom","isomorphicWindow","innerHeight","top","DropDown","selectBounds","height","left","AddNew","SelectAll","search","valueExistInSelected","map","OptionComponent","dropdown","arrayOf","shape","Z_NO_FLUSH","Z_PARTIAL_FLUSH","Z_SYNC_FLUSH","Z_FULL_FLUSH","Z_FINISH","Z_BLOCK","Z_TREES","Z_OK","Z_STREAM_END","Z_NEED_DICT","Z_ERRNO","Z_STREAM_ERROR","Z_DATA_ERROR","Z_BUF_ERROR","Z_NO_COMPRESSION","Z_BEST_SPEED","Z_BEST_COMPRESSION","Z_DEFAULT_COMPRESSION","Z_FILTERED","Z_HUFFMAN_ONLY","Z_RLE","Z_FIXED","Z_DEFAULT_STRATEGY","Z_BINARY","Z_TEXT","Z_UNKNOWN","Z_DEFLATED","_extends","source","_typeof","Symbol","iterator","_createClass","defineProperties","enumerable","configurable","writable","Constructor","protoProps","staticProps","_propTypes2","focusManager","_scopeTab2","ariaAppHider","classList","_safeHTMLElement","_safeHTMLElement2","_portalOpenInstances2","newObj","CLASS_NAMES","overlay","content","ariaHiddenInstances","ModalPortal","_Component","instance","_classCallCheck","_this","self","ReferenceError","_possibleConstructorReturn","setOverlayRef","overlayRef","setContentRef","contentRef","afterClose","_this$props","appElement","ariaHideApp","htmlOpenClassName","bodyOpenClassName","parentSelector","parentDocument","ownerDocument","remove","body","getElementsByTagName","show","shouldFocusAfterRender","shouldReturnFocusAfterClose","returnFocus","preventScroll","teardownScopedFocus","popWithoutFocus","onAfterClose","deregister","open","beforeOpen","afterOpen","beforeClose","clearTimeout","closeTimer","setState","setupScopedFocus","markForFocusLater","isOpen","openAnimationFrame","requestAnimationFrame","onAfterOpen","overlayEl","contentEl","close","closeTimeoutMS","closeWithTimeout","closeWithoutTimeout","focusContent","contentHasFocus","focus","closesAt","now","setTimeout","event","keyCode","isTabKey","shouldCloseOnEsc","isEscKey","stopPropagation","requestClose","handleOverlayOnClick","shouldClose","shouldCloseOnOverlayClick","ownerHandlesClose","handleContentOnMouseUp","handleOverlayOnMouseDown","preventDefault","handleContentOnClick","handleContentOnMouseDown","onRequestClose","shouldBeClosed","activeElement","contains","buildClassName","which","additional","classNames","attributesFromObject","prefix","items","reduce","acc","moveFromContentToOverlay","subClass","superClass","_inherits","prevProps","prevState","cancelAnimationFrame","_props","add","hide","register","_props2","id","overlayClassName","defaultStyles","children","contentStyles","overlayStyles","overlayProps","onMouseDown","contentProps","onKeyDown","onMouseUp","contentLabel","modal","aria","data","testId","contentElement","overlayElement","oneOfType","instanceOf","zlib_deflate","strings","msg","ZStream","Deflate","method","chunkSize","windowBits","memLevel","to","opt","raw","gzip","err","ended","chunks","avail_out","status","deflateInit2","deflateSetHeader","dictionary","dict","string2buf","deflateSetDictionary","_dict_set","deflate","input","deflator","result","mode","_mode","next_in","avail_in","output","Buf8","next_out","onEnd","onData","buf2binstring","shrinkBuf","deflateEnd","chunk","flattenChunks","deflateRaw","tabbable","_tabbable2","shiftKey","head","tail","getActiveElement","el","shadowRoot","checkSafari","exec","navigator","userAgent","x","indexOf","_tabbable","2","1","0","log","console","portalOpenInstances","openInstances","forEach","p","resetState","PortalOpenInstances","openInstance","emit","splice","subscribe","callback","subscribers","eventType","subscriber","focusLaterElements","handleBlur","handleFocus","toFocus","pop","warn","modalElement","removeEventListener","detachEvent","needToFocus","PDFHexString","_super","asBytes","hexLength","bytes","hexOffset","bytesOffset","byte","decodeText","decodeDate","date","asString","of","LessThan","GreaterThan","fromText","encoded","_Option","_Input","ContentComponent","_arr","before","after","_i","parentNode","removeChild","instances","_arr2","_i2","check","nodeName","_portalOpenInstances","setAttribute","opacity","cloneNode","firstChild","insertBefore","lastChild","appendChild","parentElement","SeparatorComponent","DropdownHandleComponent","dropdownOpen","rotate","fill","viewBox","globalElement","removeAttribute","querySelectorAll","assertNodeList","setElement","useElement","validateElement","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","next","done","return","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_step2","_iterator2","documentNotReadyOrSSRTesting","_warning","_warning2","nodeList","selector","isArray","findTabbableDescendants","finished","filter","tabbableNode","hidesContents","zeroSize","offsetWidth","offsetHeight","innerHTML","getComputedStyle","displayValue","getPropertyValue","scrollWidth","scrollHeight","isNotOverflowing","exception","focusable","isTabIndexNotNaN","href","rootNode","getRootNode","host","visible","getAttribute","isTabIndexNaN","isNaN","lbase","lext","dbase","dext","lens","lens_index","codes","table_index","work","opts","incr","low","mask","here_bits","here_op","here_val","sym","min","max","root","curr","drop","used","huff","base_index","Buf16","MAXBITS","offs","extra_index","RotationTypes","asPDFName","asPDFNumber","asNumber","LineCapStyle","degrees","degreeAngle","Degrees","angle","Radians","degreesToRadians","degree","Math","PI","toRadians","rotation","JSON","stringify","toDegrees","reduceRotation","quadrants","adjustDimsForRotation","dims","clip","ClipNonZero","cos","sin","tan","concatTransformationMatrix","ConcatTransformationMatrix","translate","xPos","yPos","rotateRadians","rotateDegrees","skewRadians","xSkewAngle","ySkewAngle","setDashPattern","dashArray","dashPhase","SetLineDashPattern","LineJoinStyle","setLineCap","SetLineCapStyle","TextRenderingMode","setGraphicsState","SetGraphicsStateParams","pushGraphicsState","PushGraphicsState","popGraphicsState","PopGraphicsState","setLineWidth","SetLineWidth","appendBezierCurve","x1","y1","x2","y2","x3","y3","AppendBezierCurve","appendQuadraticCurve","CurveToReplicateInitialPoint","closePath","ClosePath","moveTo","MoveTo","lineTo","LineTo","stroke","StrokePath","FillNonZero","fillAndStroke","FillNonZeroAndStroke","endPath","EndPath","showText","ShowText","beginText","BeginText","endText","EndText","setFontAndSize","size","SetFontAndSize","ColorTypes","rotateAndSkewTextRadiansAndTranslate","rotationAngle","y","SetTextMatrix","drawObject","DrawObject","beginMarkedContent","tag","BeginMarkedContent","endMarkedContent","EndMarkedContent","TextAlignment","grayscale","gray","Grayscale","rgb","red","green","blue","RGB","cmyk","cyan","magenta","yellow","CMYK","setFillingColor","NonStrokingColorGray","NonStrokingColorRgb","NonStrokingColorCmyk","setStrokingColor","StrokingColorGray","StrokingColorRgb","StrokingColorCmyk","componentsToColor","comps","scale","colorToComponents","cx","cy","px","py","sx","sy","parameters","Map","runners","M","C","cmd","S","Q","q","T","A","cmds","solveArc","L","l","H","V","Z","z","coords","rx","ry","rot","large","sweep","ex","ey","segs_1","arcToSegments","seg","bez","segmentToBezier","rotateX","ox","oy","th","sinTh","cosTh","abs","pl","sqrt","a00","a01","a10","a11","x0","y0","sfactorSq","sfactor","xc","yc","th0","atan2","thArc","segments","ceil","th2","th3","cx1","cy1","th1","thHalf","svgPathToOperators","path","commands","args","ret","curArg","foundDecimal","params","path_1","includes","parse","drawImage","graphicsState","xSkew","ySkew","Boolean","drawRectangle","borderColor","borderWidth","borderLineCap","borderDashArray","borderDashPhase","KAPPA","drawEllipse","config","xScale","yScale","xe","ye","xm","ym","centerX","centerY","drawEllipseCurves","rotateInPlace","drawCheckBox","outline","filled","checkMark","thickness","drawCheckMark","markColor","drawRadioButton","outlineScale","dot","dotColor","drawButton","background","drawTextLines","textLines","textColor","font","fontSize","operators","drawTextField","clipX","clipY","clipWidth","clipHeight","clippingArea","markedContent","EncryptedPDFError","FontkitNotRegisteredError","ForeignPageError","RemovePageFromEmptyDocumentError","NoSuchFieldError","UnexpectedFieldTypeError","expected","actual","MissingOnValueCheckError","onValue","FieldAlreadyExistsError","InvalidFieldNamePartError","namePart","FieldExistsAsNonTerminalError","RichTextFieldReadError","fieldName","CombedTextLayoutError","lineLength","cellCount","ExceededMaxLengthError","textLength","maxLength","InvalidMaxLengthError","ImageAlignment","computeFontSize","bounds","multiline","linesUsed","lineIdx","lineLen","spaceInLineRemaining","widthOfWord","widthOfTextAtSize","heightAtSize","lastIndexOfWhitespace","line","splitOutLines","lastWhitespaceIdx","encodeText","remainder","layoutMultilineText","alignment","lineHeight","minX","minY","maxX","maxY","prevRemainder","Left","Center","Right","trim","layoutCombedText","cellWidth","cellHeight","descender","computeCombedFontSize","cells","cellOffset","charOffset","char","charLength","layoutSinglelineText","normalizeAppearance","appearance","normal","tfRegex","getDefaultFontSize","field","da","getDefaultAppearance","daMatch","defaultFontSize","Number","isFinite","colorRegex","getDefaultColor","c1","c2","c3","c4","colorSpace","updateDefaultAppearance","setDefaultAppearance","defaultCheckBoxAppearanceProvider","checkBox","widget","widgetColor","fieldColor","acroField","rectangle","getRectangle","ap","getAppearanceCharacteristics","bs","getBorderStyle","getWidth","getRotation","black","getBorderColor","normalBackgroundColor","getBackgroundColor","downBackgroundColor","on","off","down","defaultRadioGroupAppearanceProvider","radioGroup","defaultButtonAppearanceProvider","button","widgetFontSize","fieldFontSize","captions","getCaptions","normalText","downText","normalLayout","downLayout","defaultTextFieldAppearanceProvider","textField","getText","isCombed","isMultiline","layout","getAlignment","getMaxLength","defaultDropdownAppearanceProvider","getSelected","defaultOptionListAppearanceProvider","optionList","getOptions","selected","isSorted","sort","selectedLines","highlights","selectedColor","drawOptionList","PDFEmbeddedPage","doc","embedder","alreadyEmbedded","factor","embed","label","embedIntoContext","context","sent","PDFFont","modified","fontName","heightOfFontAtSize","sizeAtHeight","sizeOfFontAtHeight","getCharacterSet","encoding","supportedCodePoints","characterSet","PDFImage","scaleToFit","imgWidthScale","imgHeightScale","embedTask","StandardFonts","assertFieldAppearanceOptions","backgroundColor","PDFField","getName","getFullyQualifiedName","isReadOnly","hasFlag","ReadOnly","enableReadOnly","setFlagTo","disableReadOnly","Required","enableRequired","disableRequired","isExported","NoExport","enableExporting","disableExporting","needsAppearancesUpdate","defaultUpdateAppearances","_font","markAsDirty","getForm","markFieldAsDirty","markAsClean","markFieldAsClean","isDirty","fieldIsDirty","createWidget","degreesAngle","caption","hidden","pageRef","page","rect","r","rotateRectangle","setRectangle","setP","ac","getOrCreateAppearanceCharacteristics","setBackgroundColor","setRotation","setCaptions","setBorderColor","getOrCreateBorderStyle","setWidth","Print","Hidden","Invisible","newDa","updateWidgetAppearanceWithFont","rollover","updateWidgetAppearances","createAppearanceStream","updateOnOffWidgetAppearance","createAppearanceDict","setNormalAppearance","setRolloverAppearance","removeRolloverAppearance","setDownAppearance","removeDownAppearance","Resources","Font","stream","formXObject","BBox","Matrix","createImageAppearanceStream","image","adj","imageDims","imageName","addRandomSuffix","XObject","onStreamRef","offStreamRef","appearanceDict","PDFCheckBox","acroCheckBox","getOnValue","setValue","uncheck","isChecked","getValue","addToPage","widgetRef","addWidget","setAppearanceState","updateWidgetAppearance","addAnnot","widgets","getWidgets","getAppearanceState","getAppearances","updateAppearances","provider","Function","appearances","PDFDropdown","acroComboBox","rawOptions","display","getValues","setOptions","optionObjects","addOptions","optionsArr","existingOptions","newOptions","select","merge","validOptions","find","option","enableEditing","enableMultiselect","existingValues","setValues","clear","setFontSize","isEditable","Edit","disableEditing","Sort","enableSorting","disableSorting","isMultiselect","MultiSelect","disableMultiselect","isSpellChecked","DoNotSpellCheck","enableSpellChecking","disableSpellChecking","isSelectOnClick","CommitOnSelChange","enableSelectOnClick","disableSelectOnClick","getDefaultFont","PDFOptionList","acroListBox","PDFRadioGroup","acroRadioButton","exportValues","getExportValues","exportOptions","onValues","getOnValues","onOptions","isOffToggleable","NoToggleToOff","enableOffToggling","disableOffToggling","isMutuallyExclusive","RadiosInUnison","enableMutualExclusion","disableMutualExclusion","addOptionToPage","_j","apStateValue","addWidgetWithOpt","PDFSignature","acroSignature","PDFTextField","acroText","isRichFormatted","setText","disableRichFormatting","removeValue","quadding","getQuadding","setAlignment","setQuadding","setMaxLength","MAX_SAFE_INTEGER","removeMaxLength","setImage","fieldAlignment","streamRef","Multiline","enableMultiline","disableMultiline","isPassword","Password","enablePassword","disablePassword","isFileSelector","FileSelect","enableFileSelection","disableFileSelection","isScrollable","DoNotScroll","enableScrolling","disableScrolling","Comb","enableCombing","disableCombing","RichText","enableRichFormatting","ParseSpeeds","PDFForm","acroForm","embedDefaultFont","embedStandardFont","Helvetica","dirtyFields","Set","defaultFontCache","populatedBy","hasXFA","deleteXFA","delete","getFields","allFields","getAllFields","fields","convertToPDFField","getFieldMaybe","getField","getButton","getCheckBox","getDropdown","getOptionList","getRadioGroup","getSignature","getTextField","createButton","nameParts","splitFieldName","parent","findOrCreateNonTerminals","nonTerminal","setPartialName","terminal","addFieldToParent","createCheckBox","createDropdown","comboBox","createOptionList","listBox","createRadioGroup","radioButton","createTextField","flatten","updateFieldAppearances","lenFields","lenWidgets","findWidgetPage","findWidgetAppearanceRef","xObjectKey","newXObject","pushOperators","removeField","pages","removeAnnot","fieldKids","normalizedEntries","Kids","kidsCount","childIndex","child","fieldRef","access","P","getPages","getObjectRef","findPageForAnnotationRef","refOrDict","getNormalAppearance","name_1","partialNames","parent_1","parentRef","findNonTerminal","setParent","nodeRef","addField","partialName","getPartialName","fullyQualifiedName","parts","entries","Fields","PageSizes","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","A10","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","B10","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","C10","RA0","RA1","RA2","RA3","RA4","SRA0","SRA1","SRA2","SRA3","SRA4","Executive","Folio","Legal","Letter","Tabloid","Infinity","BlendMode","PDFEmbeddedFile","Names","EmbeddedFiles","EFNames","catalog","lookup","fileName","PDFJavaScript","Javascript","JSNames","scriptName","JavaScriptEmbedder","script","for","jsActionDict","Type","JS","PDFDocument","ignoreEncryption","updateMetadata","defaultWordBreaks","computePages","Pages","traverse","pageMap","getOrCreateForm","getOrCreateAcroForm","trailerInfo","Root","isEncrypted","Encrypt","pageCache","formCache","fonts","images","embeddedPages","embeddedFiles","javaScripts","updateInfoDict","load","pdf","parseSpeed","throwOnInvalidObject","capNumbers","Slow","ArrayBuffer","forBytesWithOptions","parseDocument","pageTree","pageTreeRef","withContext","withContextAndPages","registerFontkit","fontkit","form","getTitle","title","getInfoDict","Title","assertIsLiteralOrHexString","getAuthor","author","Author","getSubject","subject","Subject","getKeywords","keywords","Keywords","getCreator","creator","Creator","getProducer","producer","Producer","getCreationDate","creationDate","CreationDate","getModificationDate","modificationDate","ModDate","setTitle","showInWindowTitleBar","getOrCreateViewerPreferences","setDisplayDocTitle","setAuthor","setSubject","setKeywords","setCreator","setProducer","setLanguage","language","setCreationDate","fromDate","setModificationDate","getPageCount","pageCount","getPage","getPageIndices","removePage","removeLeafNode","addPage","insertPage","setSize","insertLeafNode","invalidate","copyPages","srcDoc","indices","copier","srcPages","copiedPages","srcPage","copiedPage","flush","copy","pdfCopy","contentPages","addJavaScript","nextRef","javaScript","attach","attachment","embeddedFile","mimeType","description","afRelationship","FileEmbedder","embedFont","subset","customName","features","pdfFont","assertFontkit","embedJpg","jpg","pdfImage","embedPng","png","embedPdf","embedPages","embedPage","boundingBox","transformationMatrix","boundingBoxes","transformationMatrices","currPage","nextPage","maybeCopyPage","box","matrix","embedAll","save","useObjectStreams","addDefaultPage","objectsPerTick","forContext","serializeToBuffer","saveAsBase64","dataUri","otherOptions","base64","annotations","Annots","embeddables","pdfLib","info","existingInfo","Info","newInfo","pdfObject","PDFPage","leafNode","fontColor","Rotate","mediaBox","getMediaBox","setMediaBox","cropBox","getCropBox","bleedBox","getBleedBox","trimBox","getTrimBox","artBox","getArtBox","hasCropBox","CropBox","hasBleedBox","BleedBox","hasTrimBox","TrimBox","hasArtBox","ArtBox","setCropBox","setBleedBox","setTrimBox","setArtBox","getSize","setHeight","MediaBox","getHeight","asRectangle","translateContent","normalize","getContentStream","start","createContentStream","startRef","endRef","wrapContentStreams","scaleContent","scaleAnnotations","annots","annot","scaleAnnot","resetPosition","setFont","fontKey","newFontDictionary","setFontColor","setLineHeight","getPosition","getX","getY","moveDown","yDecrease","moveUp","yIncrease","moveLeft","xDecrease","moveRight","xIncrease","operator","contentStream","drawText","blendMode","setOrEmbedFont","oldFont","newFont","newFontKey","encodedLines","graphicsStateKey","maybeEmbedGraphicsState","SetTextLineHeight","NextLine","drawLinesOfText","resetFont","drawPage","embeddedPage","drawSvgPath","borderOpacity","drawLine","lineCap","_k","_l","_m","_o","drawSquare","drawCircle","oldFontKey","getFont","useExisting","contentStreamRef","addContentStream","ca","CA","BM","newExtGState","selectors","list","scalePDFNumbers","inkLists","dummyRef","pageLeaf","withContextAndParent","PDFButton","acroPushButton","zlib_inflate","GZheader","Inflate","inflateInit2","inflateGetHeader","inflateSetDictionary","inflate","inflator","next_out_utf8","utf8str","allowBufError","binstring2buf","utf8border","buf2string","inflateEnd","inflateRaw","ungzip","STR_APPLY_OK","STR_APPLY_UIA_OK","__","_utf8len","subarray","m_pos","str_len","buf_len","out","c_len","utf16buf","PDFString","octal","escaped","pushByte","nextChar","Newline","CarriageReturn","Tab","Backspace","FormFeed","LeftParen","RightParen","BackSlash","Zero","Seven","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","htmlElement","cls","htmlClassList","removeClass","_cls","docBodyClassList","at","classString","classListRef","poll","incrementReference","decrementReference","_in","_out","beg","dmax","wsize","whave","wnext","s_window","hold","lcode","dcode","lmask","dmask","here","op","from","from_source","lencode","distcode","lenbits","distbits","dolen","dodist","sane","time","xflags","os","extra_len","comment","hcrc","isEqual","getProp","debounce","shift","global","createContext","Transition","initialStatus","appear","isMounting","enter","appearStatus","in","unmountOnExit","mountOnEnter","nextCallback","_ref","_proto","updateStatus","nextStatus","componentWillUnmount","cancelNextCallback","getTimeouts","exit","timeout","mounting","findDOMNode","scrollTop","forceReflow","performEnter","performExit","_this2","appearing","_ref2","maybeNode","maybeAppearing","timeouts","enterTimeout","safeSetState","onEntered","onEnter","onEntering","onTransitionEnd","_this3","onExit","onExiting","onExited","cancel","nextState","setNextCallback","_this4","active","handler","doesNotHaveTimeoutOrListener","addEndListener","_ref3","maybeNextCallback","childProps","_objectWithoutPropertiesLoose","TransitionGroupContext","Provider","cloneElement","Children","only","noop","UNMOUNTED","EXITED","ENTERING","ENTERED","EXITING","excluded","sourceKeys","isNum","isBool","isStr","isFn","parseClassName","hasToastId","toastId","canUseDom","canBeRendered","POSITION","TOP_LEFT","TOP_RIGHT","TOP_CENTER","BOTTOM_LEFT","BOTTOM_RIGHT","BOTTOM_CENTER","TYPE","INFO","SUCCESS","WARNING","ERROR","DEFAULT","DARK","cssTransition","enterDuration","exitDuration","_ref$duration","duration","_ref$appendPosition","appendPosition","_ref$collapse","collapse","_ref$collapseDuration","collapseDuration","preventExitTransition","enterClassName","exitClassName","minHeight","transition","margin","collapseToast","animationFillMode","animationDuration","removeProperty","eventManager","emitQueue","cb","cancelEmit","timers","timer","_len","_key","useKeeper","arg","refresh","reducer","action","staleId","useToastContainer","forceUpdate","_useReducer2","toast","dispatch","containerRef","toastCount","queue","collection","toastKey","displayedToast","containerId","isToastActive","getToast","clearWaitingQueue","_instance$props","limit","enableMultiContainer","removeToast","queueLen","freeSlot","dequeueToast","toDequeue","_queue$shift","toastContent","toastProps","appendToast","buildToast","delay","updateId","isNotValid","closeToast","isNotAnUpdate","toastAutoClose","containerAutoClose","closeButton","rtl","toastClassName","bodyClassName","toastStyle","bodyStyle","pauseOnHover","pauseOnFocusLoss","draggable","draggablePercent","closeOnClick","progressClassName","progressStyle","autoClose","hideProgressBar","progress","deleteToast","removeFromCollection","onOpen","onClose","getToastToRender","toastToRender","toastList","newestOnTop","reverse","_toast","targetTouches","clientX","useToast","_useState","isRunning","setIsRunning","_useState2","setPreventExitTransition","toastRef","drag","deltaX","removalDistance","canCloseOnClick","canDrag","boundingRect","syncProps","onDragStart","nativeEvent","onDragTransitionEnd","_drag$boundingRect","right","pauseToast","playToast","onDragMove","clientY","transform","onDragEnd","eventHandlers","onTouchStart","onTouchEnd","onMouseEnter","onMouseLeave","CloseButton","_ref$ariaLabel","ariaLabel","fillRule","ProgressBar","_animationEvent","userStyle","controlledProgress","isIn","animationPlayState","defaultClassArr","defaultClassName","animationEvent","_useToast","cssClasses","renderCloseButton","Bounce","rest","_useToastContainer","_cx","_cx2","swag","pointerEvents","latestInstance","containerDomNode","containerConfig","containers","lazy","isAnyContainerMounted","container","getContainer","generateToastId","getToastId","dispatchToast","mergeOptions","success","error","dark","dismiss","isActive","update","oldOptions","oldContent","nextOptions","configure","containerInstance","parseLeaseFiles","leaseFiles","file","fileType","credit","creditLog","generatedContract","contract","splitMultiLineText","addSerial","asset","formatNumber","numFloat","numString","parsedNum","toNumber","toLocaleString","minimumFractionDigits","breakpoints","sm","md","lg","xl","isMobile","breakpoint","IS_BROWSER","_isMobile","_setIsMobile","useState","checkBreakpoint","innerWidth","useEffect","getFieldSetTextMaybe","useSmallerFont","truncate","charLimit","PrivateRoute","location","isLoggedIn","pathname","navigate","ResetPassword","refreshAuthStatus","resetPasswordCredentials","setResetPasswordCredentials","username","newPassword","verificationCode","resetPasswordStatus","setResetPasswordStatus","message","successful","verificationCodeSent","onResetPasswordInputChange","Text","fontStyle","Input","prepend","password","ClipLoader","textAlign","Button","async","forgotPasswordSubmitResponse","Auth","forgotPasswordSubmit","forgotPasswordResponse","forgotPassword","_forgotPasswordRespon","CodeDeliveryDetails","Destination","LoginForm","loginCredentials","setLoginCredentials","loginStatus","setLoginStatus","onLoginInputChange","onSubmit","loginResponse","login","buttonClass","PortalPage","_user$attributes","_user$attributes2","headerLinks","user","SHOW_BACK_BUTTON","attributes","Link","LeaseSquare","leases","leaseCount","BrokerDropdown","IS_ADMIN","brokerList","selectedBrokerFilter","onDropdownChange","Select","BrokerHome","setSelectedBrokerFilter","setData","leaseCounts","fetchLeaseCounts","leaseResponse","API","getLeaseCounts","Util","LogError","LEASE_STATUS","url","logout","CoLessees","mainLeaseInputHandler","coLesseesRenderData","setCoLesseesRenderData","coLesseesData","setCoLesseesData","co_lessees","deserializedRawCoLessees","numCoLessees","newCoLesseesRenderData","onCoLesseeChange","coLesseeDataUpdated","onCoLesseeDelete","_data$co_lessees","_data$co_lessees2","tempCoLessees","_toConsumableArray","_","coLesseeName","coLesseeEmail","showName","showEmail","fullBorderStyles","append","renderForm","schema","labelType","IS_MOBILE","inputProps","inputSchema","leaseCreditFormSchema","leaseCreditLogSchema","leaseContractFormSchema","flat","row","_inputProps$data","_inputProps$data2","_inputProps$data3","_inputProps$data4","_inputProps$data5","_inputProps$data6","inputStyles","labels","edit","view","_inputProps$data13","_inputProps$data14","_inputProps$data15","_inputProps$data16","_inputProps$data17","_inputProps$data18","_inputProps$data7","_inputProps$data8","_inputProps$data9","_inputProps$data10","_inputProps$data11","_inputProps$data12","flexBasis","createToast","borderRadius","fontFamily","Modal","setAppElement","createModal","modalData","setModalData","zIndex","maxHeight","noMarginTop","marginTop","isNode","overflowY","submitText","submitHandler","formatDocusignAuditData","auditData","parsedEventItems","auditEvents","eventItemsArr","eventFields","envelopeStatus","ip","marginBottom","moment","format","textDecoration","signEasyConfig","additionalConfig","headers","Authorization","SignEasy","getPendingDocumentStatus","axios","getSignedDocumentStatus","downloadDocument","responseType","sendContract","template_file_id","post","remindSigners","downloadAuditTrail","generateMergeFields","lease","coLessees","coLesseeNames","coLesseeNumber","font_size","coLesseesCombined","main_lessee_name","colessee","assets","asset_description","serialNumbers","serial_number","main_lessee_address","main_lessee_city","main_lessee_province","main_lessee_postal_code","main_lessee_phone","main_lessee_cell","main_lessee_email","main_lessee_contact","equipment_location","sales_rep","vendor_phone_number","term_okd","number_of_payments_1","rental_amount_1","pst_1","gst_1","total_1","number_of_payments_2","rental_amount_2","pst_2","gst_2","total_2","vendor","purchase_option_month","purchase_price","commencement_date","LeaseToggle","leaseToggleState","setLeaseToggleState","CURRENCY_ACTIONS","CURRENCY_DECLINE_REASONS","LeaseMainInfo","_data$lease","createdAt","broker","reference_number","FileUpload","leaseMetaData","noStartingInput","disableAdding","constantFileName","fileActionHook","files","setFiles","fileLoading","setFileLoading","cleanupFiles","getElementsByName","accept","multiple","persist","iterableFiles","filePromises","Storage","uploadDocument","Promise","all","border","overflowX","removeFilesPromises","deleteDocument","LeaseFiles","isDisabled","IS_ALLOWED_TO_ADD_FILES","typeOfFile","charAt","renderDeleteButton","sortedFiles","listDocuments","removeExistingFile","fileAdded","lastModified","fileURL","getDocumentURL","viewExistingFile","aria-label","LeaseAdminReview","adminReview","setAdminReview","submitAdminReview","formType","isFromCurrency","showFeedbackTextArea","showFeedbackDeclineDropdown","checked","textarea","feedback","LeaseNeedsInfo","needsInfoUpdate","submitNeedsInfoUpdate","infoType","admin_credit_feedback","admin_contract_feedback","rows","boldLabel","LeaseDenied","LeaseCreditForm","onLeaseInputChange","didSubmitReview","setDidSubmitReview","DOLLAR_FIELDS","setNeedsInfoUpdate","response","adminCreditReview","setAdminCreditReview","creditLogUpdate","setCreditLogUpdate","generateApprovalDocResponse","generateDecisionDocResponse","adminUpdateLoading","setAdminUpdateLoading","generateCreditDoc","blankCreditDoc","docType","blankPdfBytes","fetch","then","arrayBuffer","pdfDoc","brokerNameField","referenceNumber","coLesseesString","coLesseeString","parseCoLessees","net","equipment_cost","dp_final","trade_in_value","trade_u_value","netField","pdfBytes","blob","Blob","IS_GENERAL_INFO_EDITABLE","IS_CREDIT_LOG_EDITABLE","renderCreditMessage","_data$lease3","updateLease","_data$lease2","creditApprovalDoc","creditDecisionDoc","notificationStatus","ccAddContract","docURL","generatedCreditApprovalDoc","admin_review_name","Lambda","currency","applicationID","currency_application_id","reason","approvedAmount","approvedTerm","emailTo","email","leaseNextSteps","sendEmail","IS_NOTIFICATION","TO","FROM","CONTRACT_CC","CREDIT_APPROVAL_DOC_URL","clientName","leaseName","leaseStatus","leaseID","_data$lease4","ESignatureStatus","_lease$co_lessees","_lease$co_lessees2","_lease$co_lessees3","documentInfo","viewContractAuditTrail","viewContractCertificate","signReminderData","remindLessees","isDocusign","lesseeMap","main_lessee","co_lessee_1","co_lessee_name_1","co_lessee_2","co_lessee_name_2","co_lessee_3","co_lessee_name_3","sentDate","sentDateTime","getTime","created_time","docName","envelopeDocuments","isCompleted","recipientMarkup","recipients","signers","recipient","recipientIdGuid","last_modified_time","dateFinalized","signedDateTime","docusignLesseeName","roleName","first_name","unix","paddingTop","fontWeight","DOCUSIGN_ACTIONS","templateMap","3","populateDraftEnvelope","envelopeId","populatedLeaseFields","parsedCoLessees","tabLabel","generateTabData","getTabsResponse","docusign","documentId","newTabData","addLeaseDataToDocusignTabs","leaseFieldValues","docusignTabs","tab","correspondingLeaseField","leaseField","tabId","prefillTabs","textTabs","updateTabsResponse","tabs","buildAndSendEnvelope","draftEnvelopeData","contractData","templateId","templateRoles","emailNotification","emailSubject","createEnvelopeResponse","createDraftEnvelope","sendEnvelopeResponse","sendDraftEnvelope","LeaseContractForm","DOCUMENT_SENT","contract_document_id","DOCUMENT_ACTIONS","ON_SIGNATURE_DECISION","assuming_contract_responsibility","IS_CONTRACT_EDITABLE","CONTRACT_NAME","USE_REGULAR_FONT_SIZE_FIELDS","setDocumentInfo","catch","contractInfo","setContractInfo","adminContractReview","setAdminContractReview","setSignReminderData","updateContractLoading","setUpdateContractLoading","documentActions","setDocumentActions","saveAndPreviewLoading","setSaveAndPreviewLoading","contractComplete","setContractComplete","uploadCompletedDocusignDocument","uploadCompletedSignEasyDocument","submitContract","approvalType","updatedLease","generateESignatureRequest","envelopeData","createDocusignEnvelope","noSignatureContractHandler","contractBlob","generateNoSignatureContract","contractPackage1","contractPackage2","contractPackage3","contractPackage4","blankContractDoc","isInsuranceDoc","shouldUseDocusignFonts","insuranceValue","fileBlob","updatedFiles","docInfo","signedFile","rawFile","validateRequiredFields","val","renderContractMessage","_data$lease5","insuranceDocBlob","insuranceDoc","URL","createObjectURL","_error$response","_error$response$data","Lease","_setData","newData","coLesseeKeys","updatedCoLessees","coLesseeNum","main_lessee_country","updateFormulaFields","setUpdateFormulaFields","getBrokerId","calculatedFields","dp_percentage","toFixed","clbo_value","collateral_exposure","equipment_value","security_deposit","additional_coll_value","total_exposure","exist_value","inputFieldValue","_await$API$getLeaseBr","_response$getLease","getLeaseBroker","getLease","broker_id","getLeaseAndBroker","leaseBrokerId","getUser","LeaseForm","onLeaseSubmit","leaseInputs","setLeaseInputs","NewLease","_selectedBroker$","LEASE_ID","SET_LEASE_ID","setLeaseStatus","submitSuccessful","setSubmitSuccessful","selectedBroker","setSelectedBroker","sub","LEASE_PENDING_CREDIT","paginationToken","totalLeaseCount","listLeases","nextToken","scannedCount","getTotalLeaseCounts","createLease","cased_lessee_name","LeaseBar","fetchLeaseData","archiveLease","renderAssetDescription","SearchBar","handleChange","fetchSearchedLeases","LeaseOverview","_selectedBrokerFilter","URL_LEASE_STATUS","brokers","baseQuery","sortDirection","baseFilter","eq","searchFilter","leaseQuery","_userResponse","_userResponse$data","_userResponse$data$li","_userResponse$data$li2","listSortedLeases","listLeasesSortedByCreated","dedupedUsers","userResponse","listUsers","or","userMap","userObj","pluralDisplay","justifyContent","Portal","isLoading","setIsLoading","setUser","setBrokerList","setIsLoggedIn","_authUser$attributes","authUser","authStatus","ne","fetchBrokers","Layout","bodyClass","SEO","ToastContainer","Router","basepath","total_in","total_out","adler","handleClick","onClickOutside","MethodNotImplementedError","methodName","PrivateConstructorError","UnexpectedObjectTypeError","UnsupportedEncodingError","ReparseError","MissingPageContentsEmbeddingError","MissingCatalogError","UnrecognizedStreamTypeError","contructor","PageEmbeddingMismatchedContextError","PDFArrayIsNotRectangleError","InvalidPDFDateStringError","InvalidTargetIndexError","targetIndex","Count","CorruptPageTreeError","operation","IndexOutOfBoundsError","InvalidAcroFieldValueError","MultiSelectValueError","MissingDAEntryError","MissingTfOperatorError","NumberParsingError","column","PDFParsingError","details","NextByteAssertionError","expectedByte","actualByte","PDFObjectParsingError","PDFInvalidObjectParsingError","PDFStreamParsingError","UnbalancedParenthesisError","StalledParserError","MissingPDFHeaderError","MissingKeywordError","keyword","ByteOrder","utf16Encode","byteOrderMark","codePoint","highSurrogate","lowSurrogate","Uint16Array","isWithinBMP","hasSurrogates","floor","REPLACEMENT","utf16Decode","fromCodePoint","byteOrder","readBOM","BigEndian","codePoints","first","decodeValues","isHighSurrogate","second","isLowSurrogate","LittleEndian","hasUtf16BigEndianBOM","hasUtf16LittleEndianBOM","hasUtf16BOM","FontNames","decompressJson","compressedJson","arrayToString","encoded1","encoded2","encoded3","encoded4","bufferLength","decodeFromBase64","compressedJsonForFontName","fontCache","getWidthOfGlyph","glyphName","CharWidths","getXAxisKerningForPair","leftGlyphName","rightGlyphName","KernPairXAmounts","cachedFont","json","CharMetrics","metric","N","WX","KernPairs","name1","name2","decompressedEncodings","allUnicodeMappings","unicodeMappings","canEncodeUnicodeCodePoint","encodeUnicodeCodePoint","mapped","hexCode","Encodings","symbol","ZapfDingbats","zapfdingbats","WinAnsi","win1252","adler32","crc32","inflate_fast","inflate_table","zswap32","InflateState","wrap","havedict","flags","total","wbits","ncode","nlen","ndist","have","lendyn","distdyn","back","was","inflateResetKeep","Buf32","inflateReset","inflateReset2","lenfix","distfix","virgin","fixedtables","updatewindow","src","inflateInit","put","last_bits","last_op","last_val","hbuf","order","inf_leave","dictLength","inflateInfo","configuration_table","trees","errorCode","flush_pending","pending_out","flush_block_only","block_start","strstart","put_byte","putShortMSB","longest_match","cur_match","chain_length","max_chain_length","scan","best_len","prev_length","nice_match","w_size","_win","wmask","w_mask","prev","strend","scan_end1","scan_end","good_match","lookahead","match_start","fill_window","more","_w_size","window_size","hash_size","insert","ins_h","hash_shift","hash_mask","deflate_fast","hash_head","bflush","match_length","max_lazy_match","MIN_MATCH","deflate_slow","max_insert","prev_match","match_available","Config","good_length","max_lazy","nice_length","max_chain","DeflateState","pending_buf_size","gzhead","gzindex","last_flush","w_bits","hash_bits","HEAP_SIZE","deflateResetKeep","deflateReset","max_block_size","max_start","deflateInit","old_flush","bstate","deflate_huff","deflate_rle","avail","tmpDict","deflateInfo","handlePlaceHolder","onBlur","blur","handleKeyPress","inputRef","InputComponent","onFocus","readOnly","memoize","fn","cache","reactPropsRegex","isPropValid","prop","StyleSheet","_insertTag","tags","insertionPoint","nextSibling","isSpeedy","speedy","ctr","nonce","hydrate","nodes","rule","createTextNode","createStyleElement","sheet","styleSheets","ownerNode","sheetForTag","insertRule","cssRules","_tag$parentNode","O","B","D","E","F","G","I","J","K","R","U","W","X","re","ee","ae","ce","se","u","o","$","ue","ie","te","oe","le","ve","pe","isBrowser","begin","points","previous","parsed","fixedElements","compat","isImplicitRule","rules","parentRules","removeLabel","getServerStylisCache","defaultStylisPlugins","ssrStyles","_insert","stylisPlugins","inserted","nodesToHydrate","attrib","omnipresentPlugins","currentSheet","finalizingPlugins","serializer","serialized","shouldCache","_finalizingPlugins","_serializer","serverStylisCache","getRules","registered","syncFallback","useInsertionEffect","useInsertionEffectAlwaysWithSyncFallback","EmotionCacheContext","ThemeContext","registeredStyles","rawClassName","isStringTag","animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridRow","gridRowEnd","gridRowSpan","gridRowStart","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","msGridRow","msGridRowSpan","msGridColumn","msGridColumnSpan","orphans","tabSize","widows","zoom","WebkitLineClamp","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","property","styleName","p1","p2","mergedProps","interpolation","componentSelector","__emotion_styles","keyframes","anim","serializedStyles","interpolated","previousCursor","cached","stringMode","lastIndex","identifierName","testOmitPropsOnStringTag","testOmitPropsOnComponent","getDefaultShouldForwardProp","composeShouldForwardProps","isReal","shouldForwardProp","optionsShouldForwardProp","__emotion_forwardProp","propName","stylesForSSR","maybeStyles","createStyled","targetClassName","__emotion_real","baseTag","__emotion_base","defaultShouldForwardProp","shouldUseAs","Styled","FinalTag","as","classInterpolations","theme","finalShouldForwardProp","newProps","withComponent","nextTag","portalClassName","_react2","_reactDom2","_ModalPortal2","_reactLifecyclesCompat","isReact16","createPortal","createHTMLElement","getCreatePortal","unstable_renderSubtreeIntoContainer","getParentElement","_temp","removePortal","unmountComponentAtNode","portalRef","renderPortal","prevParent","nextParent","snapshot","WebkitOverflowScrolling","polyfill","AFRelationship","fileData","embeddedFileStream","embeddedFileStreamRef","fileSpecDict","flateStream","Subtype","Params","Size","UF","EF","Desc","$$typeof","AsyncMode","ConcurrentMode","ContextConsumer","ContextProvider","Element","Lazy","Profiler","StrictMode","Suspense","isAsyncMode","isConcurrentMode","isContextConsumer","isContextProvider","isElement","isForwardRef","isFragment","isLazy","isPortal","isProfiler","isStrictMode","isSuspense","isValidElementType","typeOf","CharCodes","PDFHeader","major","minor","bc","initialOffset","Percent","Dash","Period","forVersion","PDFNumber","numberValue","stringValue","PDFArray","lookupMaybe","types","lowerLeftX","lowerLeftY","asArray","arrayString","LeftSquareBracket","Space","RightSquareBracket","ENFORCER","PDFBool","enforcer","asBoolean","True","False","IsDelimiter","LeftCurly","RightCurly","ForwardSlash","IsWhitespace","Null","IsIrregular","Hash","PDFOperatorNames","pool","PDFName","charCode","encodedName","ExclamationPoint","Tilde","Nine","decodedValue","decodeName","Length","FlateDecode","ExtGState","Contents","Parent","Page","PDFNull","asNull","PDFDict","preservePDFNull","asMap","uniqueKey","existingKeys","dictString","fromMapWithContext","PDFStream","getContentsString","getContents","getContentsSize","updateDict","contentsSize","streamString","contents","PDFRawStream","asUint8Array","PDFRef","objectNumber","generationNumber","PDFOperator","EntryType","PDFFlateStream","encode","computeContents","unencodedContents","getUnencodedContents","contentsCache","PDFContentStream","getUnencodedContentsSize","SimpleRNG","seed","nextInt","withSeed","byAscendingObjectNumber","PDFContext","largestObjectNumber","indirectObjects","enumerateIndirectObjects","literal","Filter","getPushGraphicsStateContentStream","pushGraphicsStateContentStreamRef","getPopGraphicsStateContentStream","popGraphicsStateContentStreamRef","suffixLength","pow","PDFPageLeaf","autoNormalizeCTM","normalized","dictOrRef","getInheritableAttribute","arrayOrRef","numberOrRef","attribute","ascend","startStream","endStream","annotRef","setFontDictionary","fontDictRef","newFontDictionaryKey","setXObject","xObjectRef","newXObjectKey","setExtGState","extGStateRef","newExtGStateKey","visitor","contentsRef","InheritableEntries","PDFObjectCopier","dest","traversedObjects","copyPDFPage","copyPDFDict","copyPDFArray","copyPDFStream","copyPDFIndirectObject","originalPage","clonedPage","originalDict","clonedDict","originalArray","clonedArray","originalStream","clonedStream","newRef","dereferencedValue","cloned","PDFCrossRefSection","firstEntry","subsections","chunkIdx","chunkLength","addEntry","deleted","addDeletedEntry","nextFreeObjectNumber","section","rangeIdx","rangeLen","range","entryIdx","entryLen","entry","subsection","subsectionLength","copySubsectionsIntoBuffer","firstObjectNumber","rangeLength","copyEntriesIntoBuffer","entryOffset","entryGen","currEntry","prevEntry","createEmpty","PDFTrailer","lastXRefOffset","forLastCrossRefSectionOffset","PDFTrailerDict","PDFObjectStream","objects","offsets","computeObjectOffsets","offsetsString","computeOffsetsString","getObjectsCount","withContextAndObjects","PDFWriter","parsedObjects","shouldWaitForTick","xref","trailerDict","trailer","computeBufferSize","computeIndirectObjectSize","createTrailerDict","ID","indirectObject","xrefOffset","PDFInvalidObject","ColorSpace","PDFCrossRefStream","computeIndex","computeEntryTuples","entryTuples","Deleted","Uncompressed","Compressed","objectStreamRef","computeMaxEntryByteWidths","entryTuplesCache","widths","third","firstSize","secondSize","thirdSize","maxByteWidthsCache","indexCache","addUncompressedEntry","addCompressedEntry","byteWidths","entriesLen","firstBytes","secondBytes","thirdBytes","PDFStreamWriter","encodeStreams","objectsPerStream","xrefStream","uncompressedObjects","compressedObjects","objectStreamRefs","objectStream","xrefStreamRef","StandardFontEmbedder","FontName","glyphs","encodeTextAsGlyphs","hexCodes","totalWidth","kernAmount","widthOfGlyph","Ascender","Descender","FontBBox","fontDict","BaseFont","Encoding","fillCmapTemplate","bfChars","cmapHexFormat","cmapHexString","cmapCodePointFormat","hs","ls","CustomFontEmbedder","fontData","fontFeatures","allGlyphsInFontSortedById","glyphForCodePoint","unitsPerEm","postscriptName","baseFontName","glyphCache","advanceWidth","ascent","descent","bbox","embedFontDict","cidFontDictRef","unicodeCMapRef","embedCIDFontDict","embedUnicodeCmap","DescendantFonts","ToUnicode","isCFF","cff","fontDescriptorRef","cidFontDict","embedFontDescriptor","CIDToGIDMap","CIDSystemInfo","Registry","Ordering","Supplement","FontDescriptor","computeWidths","fontStreamRef","italicAngle","capHeight","xHeight","fontDescriptor","embedFontStream","Flags","familyClass","sFamilyClass","fixedPitch","isFixedPitch","serif","symbolic","italic","macStyle","flipBit","bit","nonsymbolic","allCap","smallCap","forceBold","ItalicAngle","Ascent","Descent","CapHeight","XHeight","StemV","serializeFont","fontStream","cmap","glyphId","glyph","unicode","createCmap","cmapStream","currSection","currGlyph","prevGlyph","currGlyphId","prevGlyphId","CustomFontSubsetEmbedder","customFontName","createSubset","glyphIdMap","subsetGlyphId","includeGlyph","resolve","reject","encodeStream","MARKERS","ChannelToColorSpace","DeviceGray","DeviceRGB","4","DeviceCMYK","JpegEmbedder","imageData","bitsPerComponent","dataView","marker","channelByte","channelName","DataView","getUint16","byteLength","getUint8","xObject","BitsPerComponent","Width","Height","Decode","UPNG","toRGBA8","acTL","decodeImage","frms","frames","img","empty","frm","fx","fy","fw","fh","fdata","blend","_copyTile","dispose","area","bpp","decode","_getBPP","bpl","bf","bf32","Uint32Array","ctype","rs","_bin","readUshort","qarea","ts","ti","tr","tg","tb","qi","tl","s0","t0","cj","gr","di","al","buff","fd","bin","rUs","rUi","readUint","dd","doff","foff","mgck","readASCII","_IHDR","num_frames","num_plays","fr","_decompress","rct","del","round","nz","nextZero","keyw","readUTF8","readBytes","compress","interlace","_inflate","_filterZero","_readInterlace","Y","byteOffset","cbpp","starting_row","starting_col","row_increment","col_increment","pass","ri","ci","sw","sh","cr","cc","bpll","col","cdi","ii","paeth","_paeth","pa","pb","pc","writeUshort","writeUint","writeASCII","pad","ns","decodeURIComponent","sb","tw","xoff","yoff","si","fa","fg","fb","ba","br","bg","bb","ifa","oa","ioa","bufs","ps","dels","forbidPlte","nimg","compressPNG","_main","encodeLL","bipp","bipl","wUi","wUs","wAs","pltAlpha","leng","dl","plte","cimg","wr","fi","imgd","ioff","levelZero","nh","prms","onlyBlend","evenCrd","forbidPrev","minBits","alphaAnd","ilen","gotAlpha","framize","inds","nbufs","abuf","concatRGBA","qres","quantize","cof","bln","est","rgba","img32","nw","ind","cmc","inj","alwaysBlend","cimg32","nx","ny","tlim","tstp","tarea","it","pimg","p32","mix","miy","may","sarea","_prepareDiff","r0","r1","miX","miY","_updateFrame","U8","U32","pimg32","rec","fls","ftry","CMPR","UZIP","_filterLine","tsize","oimg","nimg32","KD","getKDtree","leafs","planeDst","nd","getNearest","i0","i1","bst","tdst","stats","estats","maxL","mi","splitPixels","eMq255","ln","rn","node0","node1","eMq","d0","d1","d2","d3","vecDot","m0","m1","m2","m3","iN","Rj","M4","tmi","multVec","sml","Cov","tlen","noff","il","PngType","NonFullScreenPageMode","ReadingDirection","PrintScaling","Duplex","PNG","pngData","upng","rgbaChannel","pixelCount","rgbChannel","alphaChannel","rgbaOffset","rgbOffset","alphaOffset","splitAlphaChannel","some","Greyscale","Truecolour","IndexedColour","GreyscaleWithAlpha","TruecolourWithAlpha","getImageType","PngEmbedder","SMask","embedAlphaChannel","Stream","getByte","b0","b1","getInt32","getBytes","forceClamped","strEnd","Uint8ClampedArray","peekByte","peekedByte","peekBytes","skip","reset","moveStart","makeSubStream","emptyBuffer","DecodeStream","maybeMinBufferLength","eof","minBufferLength","readBlock","ensureBuffer","bufEnd","requested","buffer2","isSpace","ch","Ascii85Stream","maybeLength","AsciiHexStream","firstDigit","maxDecodeLength","digit","codeLenCodeMap","Int32Array","lengthDecode","distDecode","fixedLitCodeTab","fixedDistCodeTab","FlateStream","cmf","flg","codeSize","codeBuf","hdr","getBits","litCodeTable","distCodeTable","numLitCodes","numDistCodes","numCodeLenCodes","codeLenCodeLengths","codeLenCodeTab","generateHuffmanTable","codeLengths","bitsLength","bitsOffset","what","getCode","repeatLength","code1","code2","blockLen","maxLen","codeLen","codeVal","lengths","LZWStream","earlyChange","cachedData","bitsCached","lzwState","codeLength","nextCode","dictionaryValues","dictionaryLengths","dictionaryPrevCodes","currentSequence","currentSequenceLength","estimatedDecodedSize","blockSize","prevCode","decodedLength","currentBufferLength","readBits","hasPrev","RunLengthStream","repeatHeader","decodeStream","EarlyChange","decodePDFRawStream","DecodeParms","PDFPageEmbedder","fullPageBoundingBox","boundingBoxAdjustedMatrix","decodedContents","decodeContents","FormType","newline","asEnum","rawValue","enumType","AcroFieldFlags","AcroButtonFlags","AcroTextFlags","AcroChoiceFlags","ViewerPreferences","lookupBool","returnObj","lookupName","HideToolbar","HideMenubar","HideWindowUI","FitWindow","CenterWindow","DisplayDocTitle","Direction","PickTrayByPDFSize","PrintPageRange","NumCopies","getHideToolbar","getHideMenubar","getHideWindowUI","getFitWindow","getCenterWindow","getDisplayDocTitle","getNonFullScreenPageMode","UseNone","getReadingDirection","L2R","getPrintScaling","scaling","AppDefault","getDuplex","duplex","getPickTrayByPDFSize","getPrintPageRange","pageRanges","getNumCopies","setHideToolbar","hideToolbar","setHideMenubar","hideMenubar","setHideWindowUI","hideWindowUI","setFitWindow","fitWindow","setCenterWindow","centerWindow","displayTitle","setNonFullScreenPageMode","nonFullScreenPageMode","setReadingDirection","readingDirection","setPrintScaling","printScaling","setDuplex","dup","setPickTrayByPDFSize","pickTrayByPDFSize","setPrintPageRange","printPageRange","flatRange","setNumCopies","numCopies","MAX_VALUE","fromDict","PDFAcroField","Ff","valueOrRef","DA","setKids","kids","getParent","daStart","daEnd","modifiedDa","getFlags","setFlags","flag","setFlag","clearFlag","enable","BorderStyle","PDFAnnotation","Rect","AP","AS","setAppearances","ensureAP","AppearanceCharacteristics","BC","BG","RC","AC","components","PDFWidgetAnnotation","MK","BS","PDFAcroTerminal","FT","nameOrRef","kidDicts","removeWidget","PDFAcroButton","Opt","setOpt","removeExportValue","normalizeExportValues","exportVal","addOpt","useExistingOptIdx","existingIdx","optText","optIdx","PDFAcroCheckBox","bitIndex","PDFAcroChoice","Combo","valuesAreValid","updateSelectedIndices","_loop_1","state_1","_loop_2","findIndex","newOpt","PDFAcroComboBox","PDFAcroNonTerminal","PDFAcroSignature","PDFAcroText","MaxLen","PDFAcroPushButton","PushButton","PDFAcroRadioButton","Radio","PDFAcroListBox","createPDFAcroFields","createPDFAcroField","isNonTerminalAcroField","createPDFAcroTerminal","kid","ftNameOrRef","createPDFAcroButton","createPDFAcroChoice","ffNumberOrRef","ffNumber","flagIsSet","startNode","PDFAcroForm","pushFields","fieldModel","PDFCatalog","AcroForm","getAcroForm","acroFormRef","getViewerPreferences","viewerPrefs","viewerPrefsRef","leafRef","pagesRef","PDFPageTree","pushTreeNode","treeRef","pushLeafNode","insertLeafKid","leafsRemainingUntilTarget","kidRef","prune","removeKid","kidIdx","newCount","IsDigit","One","Two","Three","Four","Five","Six","Eight","IsNumericPrefix","Plus","Minus","IsNumeric","AnnotationFlags","BaseParser","parseRawInt","peek","parseRawNumber","skipWhitespace","skipLine","skipComment","skipWhitespaceAndComments","matchKeyword","ByteStream","assertNext","peekAhead","steps","peekAt","fromPDFRawStream","rawStream","endstream","endobj","startxref","true","false","null","streamEOF1","streamEOF2","streamEOF3","streamEOF4","EOF1endstream","EOF2endstream","EOF3endstream","PDFObjectParser","byteStream","parseObject","parseDictOrStream","parseHexString","parseString","parseName","parseArray","parseNumberOrRef","firstNum","lookaheadStart","secondNum","nestingLvl","isEscaped","pdfArray","parseDict","startPos","findEndOfStreamFallback","forBytes","forByteStream","PDFObjectStreamParser","alreadyParsed","firstOffset","objectCount","parseIntoContext","offsetsAndObjectNumbers","parseOffsetsAndObjectNumbers","forStream","PDFXRefStreamParser","Index","length_1","parseEntries","typeFieldWidth","offsetFieldWidth","genFieldWidth","subsectionIdx","subsectionLen","length_2","objIdx","inObjectStream","PDFParser","prevOffset","parseHeader","parseDocumentSection","maybeRecoverRoot","isValidCatalog","skipBinaryHeaderComment","parseIndirectObjectHeader","matchIndirectObjectHeader","parseIndirectObject","tryToParseInvalidIndirectObject","failed","parseIndirectObjects","trys","skipJibberish","maybeParseCrossRefSection","firstInt","secondInt","maybeParseTrailerDict","maybeParseTrailer","_reactDom","_ClickOutside","_Content","_Dropdown","_Loading","_Clear","_Separator","_DropdownHandle","_assertThisInitialized","onScroll","updateSelectBounds","srcElement","offsetParent","renderDropdown","dropdownRoot","ReactDropdownSelect","defaultValue","encodeToBase64","DATA_URI_PREFIX_REGEX","typedArrayFor","typedArray","mergeIntoTypedArray","arrays","arrayCount","typedArrays","totalSize","merged","arrIdx","byteIdx","arrLen","mergeUint8Arrays","mergedBuffer","arrayAsString","byAscendingId","sortedUniq","indexer","uniq","reverseArray","arrayLen","leftIdx","rightIdx","temp","sum","pluckIndices","plucked","canBeConvertedToUint8Array","toUint8Array","trimmedUri","fullMatch","decodeFromBase64DataUri","waitForTick","numberToString","numStr","negative","bytesFor","StandardFontValues","isStandardFont","rectanglesAreEqual","backtick","formatValue","assertIsOneOf","valueName","allowedValues","joinedValues","createValueErrorMsg","assertIsOneOfOrUndefined","assertIsSubset","isType","createTypeErrorMsg","allowedTypes","joinedTypes","assertIs","assertOrUndefined","assertEachIs","assertRange","assertRangeOrUndefined","assertMultiple","multiplier","assertInteger","isInteger","assertPositive","sign","pdfDocEncodingToUnicode","pdfDocEncodingDecode","Cache","populate","TYPED_OK","_has","sources","fnTyped","src_offs","dest_offs","fnUntyped","setTyped","hookCallback","hooks","isObject","hasOwnProp","isObjectEmpty","isUndefined","isNumber","isDate","extend","valueOf","createUTC","locale","strict","createLocalOrUTC","utc","getParsingFlags","_pf","unusedTokens","unusedInput","charsLeftOver","nullInput","invalidEra","invalidMonth","invalidFormat","userInvalidated","iso","parsedDateParts","era","meridiem","rfc2822","weekdayMismatch","isValid","parsedParts","isNowValid","invalidWeekday","_strict","bigHour","isFrozen","_isValid","createInvalid","NaN","fun","momentProperties","updateInProgress","copyConfig","momentPropertiesLen","_isAMomentObject","_tzm","_isUTC","_locale","Moment","updateOffset","isMoment","suppressDeprecationWarnings","deprecate","firstTime","deprecationHandler","argLen","stack","deprecations","deprecateSimple","isFunction","mergeConfigs","parentConfig","childConfig","Locale","zeroFill","targetLength","forceSign","absNumber","zerosToFill","formattingTokens","localFormattingTokens","formatFunctions","formatTokenFunctions","addFormatToken","token","padded","ordinal","localeData","formatMoment","expandFormat","mom","makeFormatFunction","invalidDate","replaceLongDateFormatTokens","longDateFormat","aliases","dates","days","weekdays","weekday","isoweekdays","isoweekday","DDD","dayofyears","dayofyear","hour","ms","milliseconds","millisecond","minutes","minute","months","quarters","quarter","seconds","gg","weekyears","weekyear","GG","isoweekyears","isoweekyear","weeks","week","isoweeks","isoweek","years","normalizeUnits","units","normalizeObjectUnits","inputObject","normalizedProp","normalizedInput","regexes","priorities","isoWeekday","dayOfYear","weekYear","isoWeekYear","isoWeek","match1","match2","match3","match4","match6","match1to2","match3to4","match5to6","match1to3","match1to4","match1to6","matchUnsigned","matchSigned","matchOffset","matchShortOffset","matchWord","match1to2NoLeadingZero","match1to2HasZero","addRegexToken","strictRegex","isStrict","getParseRegexForToken","regexEscape","matched","p3","p4","absFloor","toInt","argumentForCoercion","coercedNumber","tokens","addParseToken","tokenLen","addWeekParseToken","_w","addTimeToArrayFromToken","isLeapYear","daysInYear","parseTwoDigitYear","getSetYear","makeGetSet","unit","keepTime","set$1","isUTC","getUTCMilliseconds","getMilliseconds","getSeconds","getMinutes","getHours","getDate","getUTCDay","getDay","getMonth","getFullYear","setUTCMilliseconds","setMilliseconds","setUTCSeconds","setSeconds","setUTCMinutes","setMinutes","setUTCHours","setHours","setUTCDate","setDate","setUTCFullYear","setFullYear","daysInMonth","modMonth","monthsShort","monthsShortRegex","monthsRegex","monthsParse","defaultLocaleMonths","defaultLocaleMonthsShort","MONTHS_IN_FORMAT","defaultMonthsShortRegex","defaultMonthsRegex","handleStrictParse","monthName","llc","toLocaleLowerCase","_monthsParse","_longMonthsParse","_shortMonthsParse","setMonth","setUTCMonth","getSetMonth","computeMonthsParse","cmpLenRev","shortP","longP","shortPieces","longPieces","mixedPieces","_monthsRegex","_monthsShortRegex","_monthsStrictRegex","_monthsShortStrictRegex","createDate","createUTCDate","UTC","firstWeekOffset","dow","doy","fwd","dayOfYearFromWeeks","resYear","resDayOfYear","weekOfYear","resWeek","weekOffset","weeksInYear","weekOffsetNext","shiftWeekdays","ws","weekdaysMin","weekdaysShort","weekdaysMinRegex","weekdaysShortRegex","weekdaysRegex","weekdaysParse","defaultLocaleWeekdays","defaultLocaleWeekdaysShort","defaultLocaleWeekdaysMin","defaultWeekdaysRegex","defaultWeekdaysShortRegex","defaultWeekdaysMinRegex","handleStrictParse$1","weekdayName","_weekdaysParse","_shortWeekdaysParse","_minWeekdaysParse","computeWeekdaysParse","minp","shortp","longp","minPieces","_weekdaysRegex","_weekdaysShortRegex","_weekdaysMinRegex","_weekdaysStrictRegex","_weekdaysShortStrictRegex","_weekdaysMinStrictRegex","hFormat","lowercase","matchMeridiem","_meridiemParse","kInput","_isPm","isPM","_meridiem","pos1","pos2","globalLocale","getSetHour","baseConfig","calendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","LTS","LT","LL","LLL","LLLL","dayOfMonthOrdinalParse","relativeTime","future","past","ss","mm","hh","ww","MM","yy","meridiemParse","locales","localeFamilies","commonPrefix","arr1","arr2","minl","normalizeLocale","loadLocale","oldLocale","isLocaleNameSane","_abbr","getSetGlobalLocale","getLocale","defineLocale","abbr","_config","parentLocale","names","chooseLocale","checkOverflow","_overflowDayOfYear","_overflowWeeks","_overflowWeekday","extendedIsoRegex","basicIsoRegex","tzRegex","isoDates","isoTimes","aspNetJsonRegex","obsOffsets","UT","GMT","EDT","EST","CDT","CST","MDT","MST","PDT","PST","configFromISO","allowTime","dateFormat","timeFormat","tzFormat","isoDatesLen","isoTimesLen","configFromStringAndFormat","untruncateYear","yearStr","configFromRFC2822","parsedArray","monthStr","dayStr","hourStr","minuteStr","secondStr","weekdayStr","parsedInput","checkWeekday","obsOffset","militaryOffset","numOffset","hm","calculateOffset","defaults","configFromArray","currentDate","expectedWeekday","yearToUse","nowValue","_useUTC","currentDateArray","weekdayOverflow","curWeek","createLocal","_week","_dayOfYear","dayOfYearFromWeekInfo","_nextDay","ISO_8601","RFC_2822","skipped","stringLength","totalParsedInputLength","isPm","meridiemHour","meridiemFixWrap","erasConvertYear","prepareConfig","preparse","tempConfig","bestMoment","scoreToBeat","currentScore","validFormatFound","bestFormatIsValid","configfLen","score","configFromStringAndArray","createFromInputFallback","configFromString","dayOrDate","configFromObject","configFromInput","prototypeMin","other","prototypeMax","pickBy","moments","ordering","Duration","unitHasDecimal","orderLen","parseFloat","isDurationValid","_milliseconds","_days","_months","_data","_bubble","isDuration","absRound","utcOffset","offsetFromString","chunkOffset","matcher","cloneWithOffset","model","diff","setTime","local","getDateOffset","getTimezoneOffset","isUtc","aspNetRegex","isoRegex","createDuration","diffRes","parseIso","isBefore","positiveMomentsDifference","inp","isAfter","createAdder","period","tmp","addSubtract","isAdding","invalid","subtract","isString","isMomentInput","arrayTest","dataTypeTest","isNumberOrStringArray","objectTest","propertyTest","properties","propertyLen","isMomentInputObject","isCalendarSpec","monthDiff","wholeMonthDiff","anchor","newLocaleData","defaultFormat","defaultFormatUtc","lang","mod$1","dividend","divisor","localStartOfDate","utcStartOfDate","matchEraAbbr","erasAbbrRegex","computeErasParse","erasName","erasAbbr","erasNarrow","abbrPieces","namePieces","narrowPieces","eras","narrow","_erasRegex","_erasNameRegex","_erasAbbrRegex","_erasNarrowRegex","addWeekYearFormatToken","getter","getSetWeekYearHelper","weeksTarget","setWeekAll","dayOfYearData","erasNameRegex","erasNarrowRegex","erasParse","_eraYearOrdinalRegex","eraYearOrdinalParse","_dayOfMonthOrdinalParse","_ordinalParse","_dayOfMonthOrdinalParseLenient","getSetDayOfMonth","getSetMinute","getSetMillisecond","getSetSecond","parseMs","proto","preParsePostFormat","formats","sod","startOf","calendarFormat","asFloat","that","zoneDelta","endOf","startOfDate","inputString","postformat","withoutSuffix","humanize","fromNow","toNow","invalidAt","localInput","isBetween","inclusivity","localFrom","localTo","isSame","inputMs","isSameOrAfter","isSameOrBefore","parsingFlags","prioritized","unitsObj","priority","getPrioritizedUnits","prioritizedLen","toArray","toObject","toDate","toISOString","keepOffset","inspect","suffix","zone","isLocal","toJSON","creationData","eraName","since","until","eraNarrow","eraAbbr","eraYear","dir","isoWeeks","weekInfo","weeksInWeekYear","isoWeeksInYear","isoWeeksInISOWeekYear","parseWeekday","parseIsoWeekday","keepLocalTime","keepMinutes","localAdjust","_changeInProgress","parseZone","tZone","hasAlignedHourOffset","isDST","isUtcOffset","zoneAbbr","zoneName","isDSTShifted","_isDSTShifted","array1","array2","dontConvert","lengthDiff","diffs","compareArrays","proto$1","get$1","setter","listMonthsImpl","listWeekdaysImpl","localeSorted","_calendar","_longDateFormat","formatUpper","tok","_invalidDate","_ordinal","isFuture","_relativeTime","pastFuture","_eras","isFormat","_monthsShort","_monthsParseExact","firstDayOfYear","firstDayOfWeek","_weekdays","_weekdaysMin","_weekdaysShort","_weekdaysParseExact","_fullWeekdaysParse","isLower","langData","mathAbs","addSubtract$1","absCeil","daysToMonths","monthsToDays","makeAs","alias","asMilliseconds","asSeconds","asMinutes","asHours","asDays","asWeeks","asMonths","asQuarters","asYears","valueOf$1","makeGetter","thresholds","substituteTimeAgo","abs$1","toISOString$1","totalSign","ymSign","daysSign","hmsSign","proto$2","monthsFromDays","argWithSuffix","argThresholds","withSuffix","posNegDuration","relativeTime$1","toIsoString","version","updateLocale","tmpLocale","relativeTimeRounding","roundingFunction","relativeTimeThreshold","threshold","myMoment","HTML5_FMT","DATETIME_LOCAL","DATETIME_LOCAL_SECONDS","DATETIME_LOCAL_MS","DATE","TIME","TIME_SECONDS","TIME_MS","WEEK","MONTH","factory","s1","s2"],"mappings":";8FAEAA,EAAQC,YAAa,EAAID,EAAQE,aAAU,EAC3C,IAAIC,EAAQC,EAAuB,EAAQ,SACzCC,EAASD,EAAuB,EAAQ,SACxCE,EAAa,EAAQ,QACvB,SAASF,EAAuBG,GAC9B,OAAOA,GAAKA,EAAEN,WAAaM,EAAI,CAC7BL,QAASK,GAGb,IAaEC,GAA+B,EAAIL,EAAMD,SAAS,MAA+C,CAC/FO,OAAQ,aADqB,CAK5B,yCAAyC,SAAUF,GAEpD,OADQA,EAAEG,QAET,KACHC,EAtBW,SAAUJ,GACnB,IAAIK,EAAIL,EAAEM,MACRC,EAAIP,EAAEQ,MACNC,EAAIT,EAAEU,QACR,OAAOL,EAAEM,eAAiBN,E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QmzC,GACD,IAkLXrpB,EAAMspB,sBA5KN,SAAqCC,EAAWj5F,GAC9C,YAA8Bt7D,IAA1BizJ,GAAWsB,UAGDv0J,IAAVs7D,EACK23F,GAAWsB,IAEpBtB,GAAWsB,GAAaj5F,EACN,MAAdi5F,IACFtB,GAAWlV,GAAKziF,EAAQ,IAEnB,KAkKT0vE,EAAM2gB,eAt+CN,SAA2B6I,EAAU15I,GACnC,IAAIyrI,EAAOiO,EAASjO,KAAKzrI,EAAK,QAAQ,GACtC,OAAOyrI,GAAQ,EAAI,WAAaA,GAAQ,EAAI,WAAaA,EAAO,EAAI,UAAYA,EAAO,EAAI,UAAYA,EAAO,EAAI,UAAYA,EAAO,EAAI,WAAa,YAq+CxJvb,EAAMvuI,UAAY6uJ,GAGlBtgB,EAAMypB,UAAY,CAChBC,eAAgB,mBAEhBC,uBAAwB,sBAExBC,kBAAmB,0BAEnBC,KAAM,aAENC,KAAM,QAENC,aAAc,WAEdC,QAAS,eAETC,KAAM,aAENC,MAAO,WAEFlqB,EA/6IyEmqB,K,2DCmClF35J,EAAOvH,QAnBP,SAAiBk2F,EAAOvkF,EAAK5O,EAAKqE,GAIhC,IAHA,IAAI+5J,EAAa,MAARjrE,EAAiB,EACxBkrE,EAAKlrE,IAAU,GAAK,MAAS,EAC7BlkF,EAAI,EACS,IAARjP,GAAW,CAKhBA,GADAiP,EAAIjP,EAAM,IAAO,IAAOA,EAExB,GAEEq+J,EAAKA,GADLD,EAAKA,EAAKxvJ,EAAIvK,KAAS,GACR,UACN4K,GACXmvJ,GAAM,MACNC,GAAM,MAER,OAAOD,EAAKC,GAAM,GAAK","file":"component---src-pages-portal-index-js-819a72fb9369c271d46d.js","sourcesContent":["\"use strict\";\n\nexports.__esModule = !0, exports.default = void 0;\nvar _base = _interopRequireDefault(require(\"@emotion/styled/base\")),\n _react = _interopRequireDefault(require(\"react\")),\n _constants = require(\"../constants\");\nfunction _interopRequireDefault(a) {\n return a && a.__esModule ? a : {\n default: a\n };\n}\nvar NoData = function (a) {\n var b = a.props,\n c = a.state,\n d = a.methods;\n return b.noDataRenderer ? b.noDataRenderer({\n props: b,\n state: c,\n methods: d\n }) : /*#__PURE__*/_react.default.createElement(NoDataComponent, {\n className: _constants.LIB_NAME + \"-no-data\",\n color: b.color\n }, b.noDataLabel);\n },\n NoDataComponent = /*#__PURE__*/(0, _base.default)(\"div\", \"production\" === process.env.NODE_ENV ? {\n target: \"e1l5ho1t0\"\n } : {\n target: \"e1l5ho1t0\",\n label: \"NoDataComponent\"\n })(\"padding:10px;text-align:center;color:\", function (a) {\n var b = a.color;\n return b;\n }, \";\" + (\"production\" === process.env.NODE_ENV ? \"\" : \"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL05vRGF0YS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFha0MiLCJmaWxlIjoiLi4vLi4vc3JjL2NvbXBvbmVudHMvTm9EYXRhLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0JztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IExJQl9OQU1FIH0gZnJvbSAnLi4vY29uc3RhbnRzJztcblxuY29uc3QgTm9EYXRhID0gKHsgcHJvcHMsIHN0YXRlLCBtZXRob2RzIH0pID0+XG4gIHByb3BzLm5vRGF0YVJlbmRlcmVyID8gKFxuICAgIHByb3BzLm5vRGF0YVJlbmRlcmVyKHsgcHJvcHMsIHN0YXRlLCBtZXRob2RzIH0pXG4gICkgOiAoXG4gICAgPE5vRGF0YUNvbXBvbmVudCBjbGFzc05hbWU9e2Ake0xJQl9OQU1FfS1uby1kYXRhYH0gY29sb3I9e3Byb3BzLmNvbG9yfT5cbiAgICAgIHtwcm9wcy5ub0RhdGFMYWJlbH1cbiAgICA8L05vRGF0YUNvbXBvbmVudD5cbiAgKTtcblxuY29uc3QgTm9EYXRhQ29tcG9uZW50ID0gc3R5bGVkLmRpdmBcbiAgcGFkZGluZzogMTBweDtcbiAgdGV4dC1hbGlnbjogY2VudGVyO1xuICBjb2xvcjogJHsoeyBjb2xvciB9KSA9PiBjb2xvcn07XG5gO1xuXG5leHBvcnQgZGVmYXVsdCBOb0RhdGE7XG4iXX0= */\")),\n _default = NoData;\nexports.default = _default;","export var toCharCode = function (character) {\n return character.charCodeAt(0);\n};\nexport var toCodePoint = function (character) {\n return character.codePointAt(0);\n};\nexport var toHexStringOfMinLength = function (num, minLength) {\n return padStart(num.toString(16), minLength, '0').toUpperCase();\n};\nexport var toHexString = function (num) {\n return toHexStringOfMinLength(num, 2);\n};\nexport var charFromCode = function (code) {\n return String.fromCharCode(code);\n};\nexport var charFromHexCode = function (hex) {\n return charFromCode(parseInt(hex, 16));\n};\nexport var padStart = function (value, length, padChar) {\n var padding = '';\n for (var idx = 0, len = length - value.length; idx < len; idx++) {\n padding += padChar;\n }\n return padding + value;\n};\nexport var copyStringIntoBuffer = function (str, buffer, offset) {\n var length = str.length;\n for (var idx = 0; idx < length; idx++) {\n buffer[offset++] = str.charCodeAt(idx);\n }\n return length;\n};\nexport var addRandomSuffix = function (prefix, suffixLength) {\n if (suffixLength === void 0) {\n suffixLength = 4;\n }\n return prefix + \"-\" + Math.floor(Math.random() * Math.pow(10, suffixLength));\n};\nexport var escapeRegExp = function (str) {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n};\nexport var cleanText = function (text) {\n return text.replace(/\\t|\\u0085|\\u2028|\\u2029/g, ' ').replace(/[\\b\\v]/g, '');\n};\nexport var escapedNewlineChars = ['\\\\n', '\\\\f', '\\\\r', '\\\\u000B'];\nexport var newlineChars = ['\\n', '\\f', '\\r', '\\u000B'];\nexport var isNewlineChar = function (text) {\n return /^[\\n\\f\\r\\u000B]$/.test(text);\n};\nexport var lineSplit = function (text) {\n return text.split(/[\\n\\f\\r\\u000B]/);\n};\nexport var mergeLines = function (text) {\n return text.replace(/[\\n\\f\\r\\u000B]/g, ' ');\n};\n// JavaScript's String.charAt() method doesn work on strings containing UTF-16\n// characters (with high and low surrogate pairs), such as 💩 (poo emoji). This\n// `charAtIndex()` function does.\n//\n// Credit: https://github.com/mathiasbynens/String.prototype.at/blob/master/at.js#L14-L48\nexport var charAtIndex = function (text, index) {\n // Get the first code unit and code unit value\n var cuFirst = text.charCodeAt(index);\n var cuSecond;\n var nextIndex = index + 1;\n var length = 1;\n if (\n // Check if it's the start of a surrogate pair.\n cuFirst >= 0xd800 && cuFirst <= 0xdbff &&\n // high surrogate\n text.length > nextIndex // there is a next code unit\n ) {\n cuSecond = text.charCodeAt(nextIndex);\n if (cuSecond >= 0xdc00 && cuSecond <= 0xdfff) length = 2; // low surrogate\n }\n return [text.slice(index, index + length), length];\n};\nexport var charSplit = function (text) {\n var chars = [];\n for (var idx = 0, len = text.length; idx < len;) {\n var _a = charAtIndex(text, idx),\n c = _a[0],\n cLen = _a[1];\n chars.push(c);\n idx += cLen;\n }\n return chars;\n};\nvar buildWordBreakRegex = function (wordBreaks) {\n var newlineCharUnion = escapedNewlineChars.join('|');\n var escapedRules = ['$'];\n for (var idx = 0, len = wordBreaks.length; idx < len; idx++) {\n var wordBreak = wordBreaks[idx];\n if (isNewlineChar(wordBreak)) {\n throw new TypeError(\"`wordBreak` must not include \" + newlineCharUnion);\n }\n escapedRules.push(wordBreak === '' ? '.' : escapeRegExp(wordBreak));\n }\n var breakRules = escapedRules.join('|');\n return new RegExp(\"(\" + newlineCharUnion + \")|((.*?)(\" + breakRules + \"))\", 'gm');\n};\nexport var breakTextIntoLines = function (text, wordBreaks, maxWidth, computeWidthOfText) {\n var regex = buildWordBreakRegex(wordBreaks);\n var words = cleanText(text).match(regex);\n var currLine = '';\n var currWidth = 0;\n var lines = [];\n var pushCurrLine = function () {\n if (currLine !== '') lines.push(currLine);\n currLine = '';\n currWidth = 0;\n };\n for (var idx = 0, len = words.length; idx < len; idx++) {\n var word = words[idx];\n if (isNewlineChar(word)) {\n pushCurrLine();\n } else {\n var width = computeWidthOfText(word);\n if (currWidth + width > maxWidth) pushCurrLine();\n currLine += word;\n currWidth += width;\n }\n }\n pushCurrLine();\n return lines;\n};\n// See section \"7.9.4 Dates\" of the PDF specification\nvar dateRegex = /^D:(\\d\\d\\d\\d)(\\d\\d)?(\\d\\d)?(\\d\\d)?(\\d\\d)?(\\d\\d)?([+\\-Z])?(\\d\\d)?'?(\\d\\d)?'?$/;\nexport var parseDate = function (dateStr) {\n var match = dateStr.match(dateRegex);\n if (!match) return undefined;\n var year = match[1],\n _a = match[2],\n month = _a === void 0 ? '01' : _a,\n _b = match[3],\n day = _b === void 0 ? '01' : _b,\n _c = match[4],\n hours = _c === void 0 ? '00' : _c,\n _d = match[5],\n mins = _d === void 0 ? '00' : _d,\n _e = match[6],\n secs = _e === void 0 ? '00' : _e,\n _f = match[7],\n offsetSign = _f === void 0 ? 'Z' : _f,\n _g = match[8],\n offsetHours = _g === void 0 ? '00' : _g,\n _h = match[9],\n offsetMins = _h === void 0 ? '00' : _h;\n // http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15\n var tzOffset = offsetSign === 'Z' ? 'Z' : \"\" + offsetSign + offsetHours + \":\" + offsetMins;\n var date = new Date(year + \"-\" + month + \"-\" + day + \"T\" + hours + \":\" + mins + \":\" + secs + tzOffset);\n return date;\n};\nexport var findLastMatch = function (value, regex) {\n var _a;\n var position = 0;\n var lastMatch;\n while (position < value.length) {\n var match = value.substring(position).match(regex);\n if (!match) return {\n match: lastMatch,\n pos: position\n };\n lastMatch = match;\n position += ((_a = match.index) !== null && _a !== void 0 ? _a : 0) + match[0].length;\n }\n return {\n match: lastMatch,\n pos: position\n };\n};","// Top level file is just a mixin of submodules & constants\n'use strict';\n\nvar assign = require('./lib/utils/common').assign;\nvar deflate = require('./lib/deflate');\nvar inflate = require('./lib/inflate');\nvar constants = require('./lib/zlib/constants');\nvar pako = {};\nassign(pako, deflate, inflate, constants);\nmodule.exports = pako;","module.exports = __webpack_public_path__ + \"static/contract-package-1-7912f518ab1da707554d6fe2e6cf1592.pdf\";","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar __DEV__ = process.env.NODE_ENV !== 'production';\n\nvar warning = function() {};\n\nif (__DEV__) {\n var printWarning = function printWarning(format, args) {\n var len = arguments.length;\n args = new Array(len > 1 ? len - 1 : 0);\n for (var key = 1; key < len; key++) {\n args[key - 1] = arguments[key];\n }\n var argIndex = 0;\n var message = 'Warning: ' +\n format.replace(/%s/g, function() {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n }\n\n warning = function(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n if (format === undefined) {\n throw new Error(\n '`warning(condition, format, ...args)` requires a warning ' +\n 'message argument'\n );\n }\n if (!condition) {\n printWarning.apply(null, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n var keys = getOwnPropertyNames(sourceComponent);\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n return targetComponent;\n}\nmodule.exports = hoistNonReactStatics;","/*!\n Copyright (c) 2015 Jed Watson.\n Based on code that is Copyright 2013-2015, Facebook, Inc.\n All rights reserved.\n*/\n/* global define */\n\n(function () {\n 'use strict';\n\n var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n var ExecutionEnvironment = {\n canUseDOM: canUseDOM,\n canUseWorkers: typeof Worker !== 'undefined',\n canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),\n canUseViewport: canUseDOM && !!window.screen\n };\n if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n define(function () {\n return ExecutionEnvironment;\n });\n } else if (typeof module !== 'undefined' && module.exports) {\n module.exports = ExecutionEnvironment;\n } else {\n window.ExecutionEnvironment = ExecutionEnvironment;\n }\n})();","import React from 'react'\n\nclass NotFound extends React.Component {\n render() {\n return (\n <>\n

Not Found

\n

You just hit a page that doesn't exist...

\n \n )\n }\n}\n\nexport default NotFound\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.canUseDOM = exports.SafeNodeList = exports.SafeHTMLCollection = undefined;\nvar _exenv = require(\"exenv\");\nvar _exenv2 = _interopRequireDefault(_exenv);\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nvar EE = _exenv2.default;\nvar SafeHTMLElement = EE.canUseDOM ? window.HTMLElement : {};\nvar SafeHTMLCollection = exports.SafeHTMLCollection = EE.canUseDOM ? window.HTMLCollection : {};\nvar SafeNodeList = exports.SafeNodeList = EE.canUseDOM ? window.NodeList : {};\nvar canUseDOM = exports.canUseDOM = EE.canUseDOM;\nexports.default = SafeHTMLElement;","\"use strict\";\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nexports.__esModule = !0, exports.default = void 0;\nfunction _interopRequireDefault(a) {\n return a && a.__esModule ? a : {\n default: a\n };\n}\nvar SelectPropsModel = Object.freeze({\n /**\n * Secondary placeholder on search field if any value selected\n */\n addPlaceholder: _propTypes.default.string,\n /**\n * Additional props to pass to Select\n */\n additionalProps: _propTypes.default.object,\n /**\n * If true, and searchable, dropdown will autofocus\n */\n autoFocus: _propTypes.default.bool,\n /**\n * If true, backspace key will delete last value\n */\n backspaceDelete: _propTypes.default.bool,\n /**\n * CSS class attribute to pass to select\n */\n className: _propTypes.default.string,\n /**\n * Label for \"Clear all\"\n */\n clearAllLabel: _propTypes.default.string,\n /**\n * If true, and searchable, search value will be cleared on blur\n */\n clearOnBlur: _propTypes.default.bool,\n /**\n * If true, and searchable, search value will be cleared upon value select/de-select\n */\n clearOnSelect: _propTypes.default.bool,\n /**\n * Overrides internal clear button\n */\n clearRenderer: _propTypes.default.func,\n /**\n * Clear all indicator\n */\n clearable: _propTypes.default.bool,\n /**\n * If true, scrolling the page will close the dropdown\n */\n closeOnScroll: _propTypes.default.bool,\n /**\n * If true, selecting option will close the dropdown\n */\n closeOnSelect: _propTypes.default.bool,\n /**\n * If true, clicking input will close the dropdown if you are not searching.\n */\n closeOnClickInput: _propTypes.default.bool,\n /**\n * Base color (any CSS compatible) to use in component, also can be overwritten via CSS\n */\n color: _propTypes.default.string,\n /**\n * Compare values override function\n */\n compareValuesFunc: _propTypes.default.func,\n /**\n * Overrides internal content component (the contents of the select component)\n * | example\n */\n contentRenderer: _propTypes.default.func,\n /**\n * If true, select will create value from search string and fire onCreateNew callback prop\n */\n create: _propTypes.default.bool,\n /**\n * If create set to true, this will be the label of the \"add new\" component. {search} will be replaced by search value\n */\n createNewLabel: _propTypes.default.string,\n /**\n * Debounce Delay for updates upon component interactions\n */\n debounceDelay: _propTypes.default.number,\n /**\n * Direction of a dropdown \"ltr\", \"rtl\" or \"auto\"\n */\n direction: _propTypes.default.string,\n /**\n * Disable select and all interactions\n */\n disabled: _propTypes.default.bool,\n /**\n * Label shown on disabled field (after) the text\n */\n disabledLabel: _propTypes.default.string,\n /**\n * Gap between select element and dropdown\n */\n dropdownGap: _propTypes.default.number,\n /**\n * Show or hide dropdown handle to open/close dropdown\n */\n dropdownHandle: _propTypes.default.bool,\n /**\n * Overrides internal dropdown handle\n */\n dropdownHandleRenderer: _propTypes.default.func,\n /**\n * Minimum height of a dropdown\n */\n dropdownHeight: _propTypes.default.string,\n /**\n * Available options are \"auto\", \"top\" and \"bottom\" defaults to \"bottom\". Auto will adjust itself according Select's position on the page\n * | example\n */\n dropdownPosition: _propTypes.default.oneOf([\"top\", \"bottom\", \"auto\"]),\n /**\n * Overrides internal dropdown handle\n */\n dropdownRenderer: _propTypes.default.func,\n /**\n * Overrides internal keyDown function\n */\n handleKeyDownFn: _propTypes.default.func,\n /**\n * Overrides internal input text\n */\n inputRenderer: _propTypes.default.func,\n /**\n * Overrides internal item in a dropdown\n */\n itemRenderer: _propTypes.default.func,\n /**\n * If true, dropdown will always stay open (good for debugging)\n */\n keepOpen: _propTypes.default.bool,\n /**\n * If false, selected item will not appear in a list\n */\n keepSelectedInList: _propTypes.default.bool,\n /**\n * Field in data to use for label\n */\n labelField: _propTypes.default.string,\n /**\n * Loading indicator\n */\n loading: _propTypes.default.bool,\n /**\n * Overrides internal loading\n */\n loadingRenderer: _propTypes.default.func,\n /**\n * If true - will act as multi-select, if false - only one option will be selected at the time\n */\n multi: _propTypes.default.bool,\n /**\n * If set, input type hidden would be added in the component with the value of the `name` prop as `name` and select's `values` as `value`\n * Useful for HTML forms\n */\n name: _propTypes.default.string,\n /**\n * Label for \"No data\"\n */\n noDataLabel: _propTypes.default.string,\n /**\n * Overrides internal \"no data\" (shown where search has no results)\n */\n noDataRenderer: _propTypes.default.func,\n /**\n * onChange callback handler\n */\n onChange: _propTypes.default.func.isRequired,\n /**\n * Fires upon clearing all values (via custom renderers)\n */\n onClearAll: _propTypes.default.func,\n /**\n * Fires upon creation of new item if create prop set to true\n */\n onCreateNew: _propTypes.default.func,\n /**\n * Fires upon dropdown close\n */\n onDropdownClose: _propTypes.default.func,\n /**\n * Fires upon dropdown closing state, stops the closing and provides own method close()\n * @return undefined\n */\n onDropdownCloseRequest: _propTypes.default.func,\n /**\n * Fires upon dropdown open\n */\n onDropdownOpen: _propTypes.default.func,\n /**\n * Fires upon selecting all values (via custom renderers)\n */\n onSelectAll: _propTypes.default.func,\n /**\n * Overrides internal option (the pillow with an \"x\") on the select content\n */\n optionRenderer: _propTypes.default.func,\n /**\n * Available options, (option with key disabled: true will be disabled)\n */\n options: _propTypes.default.array.isRequired,\n /**\n * If set, input type hidden would be added in the component with pattern prop as regex\n */\n pattern: _propTypes.default.string,\n /**\n * Placeholder shown where there are no selected values\n */\n placeholder: _propTypes.default.string,\n /**\n * If valid DOM element specified - dropdown will break out to render inside the specified element\n */\n portal: _propTypes.default.element,\n /**\n * If set, input type hidden would be added in the component with required prop as true/false\n */\n required: _propTypes.default.bool,\n /**\n * Search by object property in values\n */\n searchBy: _propTypes.default.string,\n /**\n * Overrides internal search function\n */\n searchFn: _propTypes.default.func,\n /**\n * If true, select will have search input text\n */\n searchable: _propTypes.default.bool,\n /**\n * Allow to select all (if select is multi-select)\n */\n selectAll: _propTypes.default.bool,\n /**\n * Label for \"Select all\"\n */\n selectAllLabel: _propTypes.default.string,\n /**\n * Separator line between close all and dropdown handle\n */\n separator: _propTypes.default.bool,\n /**\n * Overrides internal separator\n */\n separatorRenderer: _propTypes.default.func,\n /**\n * Sort by object property in values\n */\n sortBy: _propTypes.default.string,\n /**\n * Style object to pass to select\n */\n style: _propTypes.default.object,\n /**\n * Field in data to use for value\n */\n valueField: _propTypes.default.string,\n /**\n * Selected values\n */\n values: _propTypes.default.array,\n /**\n * If true, dropdown will be open by default\n */\n defaultMenuIsOpen: _propTypes.default.bool\n }),\n _default = SelectPropsModel;\nexports.default = _default;","export * from \"./api/index\";\nexport * from \"./core/index\";\nexport * from \"./types/index\";\nexport * from \"./utils/index\";","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n // find the complete implementation of crypto (msCrypto) on IE11.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n return getRandomValues(rnds8);\n}","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n return uuid;\n}\nexport default stringify;","import REGEX from './regex.js';\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\nexport default validate;","import rng from './rng.js';\nimport stringify from './stringify.js';\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n return buf;\n }\n return stringify(rnds);\n}\nexport default v4;","'use strict';\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// Use ordinary array, since untyped makes no boost here\nfunction makeTable() {\n var c,\n table = [];\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = c & 1 ? 0xEDB88320 ^ c >>> 1 : c >>> 1;\n }\n table[n] = c;\n }\n return table;\n}\n\n// Create table on load. Just 255 signed longs. Not a problem.\nvar crcTable = makeTable();\nfunction crc32(crc, buf, len, pos) {\n var t = crcTable,\n end = pos + len;\n crc ^= -1;\n for (var i = pos; i < end; i++) {\n crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 0xFF];\n }\n return crc ^ -1; // >>> 0;\n}\nmodule.exports = crc32;","\"use strict\";\n\nexports.__esModule = !0, exports.default = void 0;\nvar _base = _interopRequireDefault(require(\"@emotion/styled/base\")),\n _react = _interopRequireDefault(require(\"react\")),\n _constants = require(\"../constants\");\nfunction _interopRequireDefault(a) {\n return a && a.__esModule ? a : {\n default: a\n };\n}\nvar Loading = function (a) {\n var b = a.props;\n return b.loadingRenderer ? b.loadingRenderer({\n props: b\n }) : /*#__PURE__*/_react.default.createElement(LoadingComponent, {\n className: _constants.LIB_NAME + \"-loading\",\n color: b.color\n });\n },\n LoadingComponent = /*#__PURE__*/(0, _base.default)(\"div\", \"production\" === process.env.NODE_ENV ? {\n target: \"e1l5cpc30\"\n } : {\n target: \"e1l5cpc30\",\n label: \"LoadingComponent\"\n })(\"@keyframes dual-ring-spin{0%{transform:rotate(0deg);}100%{transform:rotate(180deg);}}padding:0 5px;display:block;width:auto;height:auto;:after{content:' ';display:block;width:16px;height:16px;border-radius:50%;border-width:1px;border-style:solid;border-color:\", function (a) {\n var b = a.color;\n return b;\n }, \" transparent;animation:dual-ring-spin 0.7s ease-in-out infinite;margin:0 0 0 -10px;}\" + (\"production\" === process.env.NODE_ENV ? \"\" : \"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL0xvYWRpbmcuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBV21DIiwiZmlsZSI6Ii4uLy4uL3NyYy9jb21wb25lbnRzL0xvYWRpbmcuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1w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FkaW5nO1xuIl19 */\")),\n _default = Loading;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _Modal = require(\"./components/Modal\");\nvar _Modal2 = _interopRequireDefault(_Modal);\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nexports.default = _Modal2.default;\nmodule.exports = exports[\"default\"];","import { MethodNotImplementedError } from \"../errors\";\nvar PDFObject = /** @class */function () {\n function PDFObject() {}\n PDFObject.prototype.clone = function (_context) {\n throw new MethodNotImplementedError(this.constructor.name, 'clone');\n };\n PDFObject.prototype.toString = function () {\n throw new MethodNotImplementedError(this.constructor.name, 'toString');\n };\n PDFObject.prototype.sizeInBytes = function () {\n throw new MethodNotImplementedError(this.constructor.name, 'sizeInBytes');\n };\n PDFObject.prototype.copyBytesInto = function (_buffer, _offset) {\n throw new MethodNotImplementedError(this.constructor.name, 'copyBytesInto');\n };\n return PDFObject;\n}();\nexport default PDFObject;","\"use strict\";\n\nexports.__esModule = !0, exports.default = void 0;\nvar _base = _interopRequireDefault(require(\"@emotion/styled/base\")),\n _react = _interopRequireDefault(require(\"react\")),\n _constants = require(\"../constants\");\nfunction _interopRequireDefault(a) {\n return a && a.__esModule ? a : {\n default: a\n };\n}\nfunction _EMOTION_STRINGIFIED_CSS_ERROR__() {\n return \"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).\";\n}\nvar Clear = function (a) {\n var b = a.props,\n c = a.state,\n d = a.methods;\n return b.clearRenderer ? b.clearRenderer({\n props: b,\n state: c,\n methods: d\n }) : /*#__PURE__*/_react.default.createElement(ClearComponent, {\n className: _constants.LIB_NAME + \"-clear\",\n tabIndex: \"-1\",\n onClick: function onClick() {\n return d.clearAll();\n },\n onKeyPress: function onKeyPress() {\n return d.clearAll();\n }\n }, \"\\xD7\");\n },\n ClearComponent = /*#__PURE__*/(0, _base.default)(\"div\", \"production\" === process.env.NODE_ENV ? {\n target: \"e11qlq5e0\"\n } : {\n target: \"e11qlq5e0\",\n label: \"ClearComponent\"\n })(\"production\" === process.env.NODE_ENV ? {\n name: \"992gsg\",\n styles: \"line-height:25px;margin:0 10px;cursor:pointer;:focus{outline:none;}:hover{color:tomato;}\"\n } : {\n name: \"992gsg\",\n styles: \"line-height:25px;margin:0 10px;cursor:pointer;:focus{outline:none;}:hover{color:tomato;}\",\n map: \"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL0NsZWFyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWlCaUMiLCJmaWxlIjoiLi4vLi4vc3JjL2NvbXBvbmVudHMvQ2xlYXIuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IHsgTElCX05BTUUgfSBmcm9tICcuLi9jb25zdGFudHMnO1xuXG5jb25zdCBDbGVhciA9ICh7IHByb3BzLCBzdGF0ZSwgbWV0aG9kcyB9KSA9PlxuICBwcm9wcy5jbGVhclJlbmRlcmVyID8gKFxuICAgIHByb3BzLmNsZWFyUmVuZGVyZXIoeyBwcm9wcywgc3RhdGUsIG1ldGhvZHMgfSlcbiAgKSA6IChcbiAgICA8Q2xlYXJDb21wb25lbnRcbiAgICAgIGNsYXNzTmFtZT17YCR7TElCX05BTUV9LWNsZWFyYH1cbiAgICAgIHRhYkluZGV4PVwiLTFcIlxuICAgICAgb25DbGljaz17KCkgPT4gbWV0aG9kcy5jbGVhckFsbCgpfVxuICAgICAgb25LZXlQcmVzcz17KCkgPT4gbWV0aG9kcy5jbGVhckFsbCgpfT5cbiAgICAgICZ0aW1lcztcbiAgICA8L0NsZWFyQ29tcG9uZW50PlxuICApO1xuXG5jb25zdCBDbGVhckNvbXBvbmVudCA9IHN0eWxlZC5kaXZgXG4gIGxpbmUtaGVpZ2h0OiAyNXB4O1xuICBtYXJnaW46IDAgMTBweDtcbiAgY3Vyc29yOiBwb2ludGVyO1xuXG4gIDpmb2N1cyB7XG4gICAgb3V0bGluZTogbm9uZTtcbiAgfVxuXG4gIDpob3ZlciB7XG4gICAgY29sb3I6IHRvbWF0bztcbiAgfVxuYDtcblxuZXhwb3J0IGRlZmF1bHQgQ2xlYXI7XG4iXX0= */\",\n toString: _EMOTION_STRINGIFIED_CSS_ERROR__\n }),\n _default = Clear;\nexports.default = _default;","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n/* eslint-disable space-unary-ops */\nvar utils = require('../utils/common');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n//var Z_FILTERED = 1;\n//var Z_HUFFMAN_ONLY = 2;\n//var Z_RLE = 3;\nvar Z_FIXED = 4;\n//var Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\nvar Z_BINARY = 0;\nvar Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n/*============================================================================*/\n\nfunction zero(buf) {\n var len = buf.length;\n while (--len >= 0) {\n buf[len] = 0;\n }\n}\n\n// From zutil.h\n\nvar STORED_BLOCK = 0;\nvar STATIC_TREES = 1;\nvar DYN_TREES = 2;\n/* The three kinds of block type */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\n\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nvar D_CODES = 30;\n/* number of distance codes */\n\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\n\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\n\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar Buf_size = 16;\n/* size of bit buffer in bi_buf */\n\n/* ===========================================================================\n * Constants\n */\n\nvar MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nvar END_BLOCK = 256;\n/* end of block literal code */\n\nvar REP_3_6 = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nvar REPZ_3_10 = 17;\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\nvar REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nvar extra_lbits = /* extra bits for each length code */\n[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0];\nvar extra_dbits = /* extra bits for each distance code */\n[0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13];\nvar extra_blbits = /* extra bits for each bit length code */\n[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7];\nvar bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n/* eslint-enable comma-spacing,array-bracket-spacing */\n\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n\n/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nvar DIST_CODE_LEN = 512; /* see definition of array dist_code below */\n\n// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1\nvar static_ltree = new Array((L_CODES + 2) * 2);\nzero(static_ltree);\n/* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n\nvar static_dtree = new Array(D_CODES * 2);\nzero(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nvar _dist_code = new Array(DIST_CODE_LEN);\nzero(_dist_code);\n/* Distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n\nvar _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\nzero(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nvar base_length = new Array(LENGTH_CODES);\nzero(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nvar base_dist = new Array(D_CODES);\nzero(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n this.static_tree = static_tree; /* static tree or NULL */\n this.extra_bits = extra_bits; /* extra bits for each code or NULL */\n this.extra_base = extra_base; /* base index for extra_bits */\n this.elems = elems; /* max number of elements in the tree */\n this.max_length = max_length; /* max bit length for the codes */\n\n // show if `static_tree` has data or dummy - needed for monomorphic objects\n this.has_stree = static_tree && static_tree.length;\n}\nvar static_l_desc;\nvar static_d_desc;\nvar static_bl_desc;\nfunction TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree; /* the dynamic tree */\n this.max_code = 0; /* largest code with non zero frequency */\n this.stat_desc = stat_desc; /* the corresponding static tree */\n}\nfunction d_code(dist) {\n return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n}\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\nfunction put_short(s, w) {\n // put_byte(s, (uch)((w) & 0xff));\n // put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = w & 0xff;\n s.pending_buf[s.pending++] = w >>> 8 & 0xff;\n}\n\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\nfunction send_bits(s, value, length) {\n if (s.bi_valid > Buf_size - length) {\n s.bi_buf |= value << s.bi_valid & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> Buf_size - s.bi_valid;\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= value << s.bi_valid & 0xffff;\n s.bi_valid += length;\n }\n}\nfunction send_code(s, c, tree) {\n send_bits(s, tree[c * 2] /*.Code*/, tree[c * 2 + 1] /*.Len*/);\n}\n\n/* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\nfunction bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}\n\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nfunction bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}\n\n/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n * above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n * array bl_count contains the frequencies for each bit length.\n * The length opt_len is updated; static_len is also updated if stree is\n * not null.\n */\nfunction gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1] /*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1] /*.Dad*/ * 2 + 1] /*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1] /*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) {\n continue;\n } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2] /*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1] /*.Len*/ + xbits);\n }\n }\n if (overflow === 0) {\n return;\n }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) {\n bits--;\n }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) {\n continue;\n }\n if (tree[m * 2 + 1] /*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1] /*.Len*/) * tree[m * 2] /*.Freq*/;\n tree[m * 2 + 1] /*.Len*/ = bits;\n }\n n--;\n }\n }\n}\n\n/* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n * zero code length.\n */\nfunction gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = code + bl_count[bits - 1] << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1< length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < 1 << extra_lbits[code]; n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < 1 << extra_dbits[code]; n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < 1 << extra_dbits[code] - 7; n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1] /*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1] /*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1] /*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1] /*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1] /*.Len*/ = 5;\n static_dtree[n * 2] /*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}\n\n/* ===========================================================================\n * Initialize a new block.\n */\nfunction init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) {\n s.dyn_ltree[n * 2] /*.Freq*/ = 0;\n }\n for (n = 0; n < D_CODES; n++) {\n s.dyn_dtree[n * 2] /*.Freq*/ = 0;\n }\n for (n = 0; n < BL_CODES; n++) {\n s.bl_tree[n * 2] /*.Freq*/ = 0;\n }\n s.dyn_ltree[END_BLOCK * 2] /*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nfunction bi_windup(s) {\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}\n\n/* ===========================================================================\n * Copy a stored block, storing first the length and its\n * one's complement if requested.\n */\nfunction copy_block(s, buf, len, header)\n//DeflateState *s;\n//charf *buf; /* the input data */\n//unsigned len; /* its length */\n//int header; /* true if block header must be written */\n{\n bi_windup(s); /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n }\n // while (len--) {\n // put_byte(s, *buf++);\n // }\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n}\n\n/* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\nfunction smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return tree[_n2] /*.Freq*/ < tree[_m2] /*.Freq*/ || tree[_n2] /*.Freq*/ === tree[_m2] /*.Freq*/ && depth[n] <= depth[m];\n}\n\n/* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\nfunction pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) {\n break;\n }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}\n\n// inlined manually\n// var SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nfunction compress_block(s, ltree, dtree)\n// deflate_state *s;\n// const ct_data *ltree; /* literal tree */\n// const ct_data *dtree; /* distance tree */\n{\n var dist; /* distance of matched string */\n var lc; /* match length or unmatched char (if dist == 0) */\n var lx = 0; /* running index in l_buf */\n var code; /* the code to send */\n var extra; /* number of extra bits to send */\n\n if (s.last_lit !== 0) {\n do {\n dist = s.pending_buf[s.d_buf + lx * 2] << 8 | s.pending_buf[s.d_buf + lx * 2 + 1];\n lc = s.pending_buf[s.l_buf + lx];\n lx++;\n if (dist === 0) {\n send_code(s, lc, ltree); /* send a literal byte */\n //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n /* Here, lc is the match length - MIN_MATCH */\n code = _length_code[lc];\n send_code(s, code + LITERALS + 1, ltree); /* send the length code */\n extra = extra_lbits[code];\n if (extra !== 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra); /* send the extra length bits */\n }\n dist--; /* dist is now the match distance - 1 */\n code = d_code(dist);\n //Assert (code < D_CODES, \"bad d_code\");\n\n send_code(s, code, dtree); /* send the distance code */\n extra = extra_dbits[code];\n if (extra !== 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra); /* send the extra distance bits */\n }\n } /* literal or match pair ? */\n\n /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */\n //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,\n // \"pendingBuf overflow\");\n } while (lx < s.last_lit);\n }\n send_code(s, END_BLOCK, ltree);\n}\n\n/* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n * and corresponding code. The length opt_len is updated; static_len is\n * also updated if stree is not null. The field max_code is set.\n */\nfunction build_tree(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var elems = desc.stat_desc.elems;\n var n, m; /* iterate over heap elements */\n var max_code = -1; /* largest code with non zero frequency */\n var node; /* new node being created */\n\n /* Construct the initial heap, with least frequent element in\n * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n * heap[0] is not used.\n */\n s.heap_len = 0;\n s.heap_max = HEAP_SIZE;\n for (n = 0; n < elems; n++) {\n if (tree[n * 2] /*.Freq*/ !== 0) {\n s.heap[++s.heap_len] = max_code = n;\n s.depth[n] = 0;\n } else {\n tree[n * 2 + 1] /*.Len*/ = 0;\n }\n }\n\n /* The pkzip format requires that at least one distance code exists,\n * and that at least one bit should be sent even if there is only one\n * possible code. So to avoid special checks later on we force at least\n * two codes of non zero frequency.\n */\n while (s.heap_len < 2) {\n node = s.heap[++s.heap_len] = max_code < 2 ? ++max_code : 0;\n tree[node * 2] /*.Freq*/ = 1;\n s.depth[node] = 0;\n s.opt_len--;\n if (has_stree) {\n s.static_len -= stree[node * 2 + 1] /*.Len*/;\n }\n /* node is 0 or 1 so it does not have extra bits */\n }\n desc.max_code = max_code;\n\n /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n * establish sub-heaps of increasing lengths:\n */\n for (n = s.heap_len >> 1 /*int /2*/; n >= 1; n--) {\n pqdownheap(s, tree, n);\n }\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n node = elems; /* next internal node of the tree */\n do {\n //pqremove(s, tree, n); /* n = node of least frequency */\n /*** pqremove ***/\n n = s.heap[1 /*SMALLEST*/];\n s.heap[1 /*SMALLEST*/] = s.heap[s.heap_len--];\n pqdownheap(s, tree, 1 /*SMALLEST*/);\n /***/\n\n m = s.heap[1 /*SMALLEST*/]; /* m = node of next least frequency */\n\n s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */\n s.heap[--s.heap_max] = m;\n\n /* Create a new node father of n and m */\n tree[node * 2] /*.Freq*/ = tree[n * 2] /*.Freq*/ + tree[m * 2] /*.Freq*/;\n s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n tree[n * 2 + 1] /*.Dad*/ = tree[m * 2 + 1] /*.Dad*/ = node;\n\n /* and insert the new node in the heap */\n s.heap[1 /*SMALLEST*/] = node++;\n pqdownheap(s, tree, 1 /*SMALLEST*/);\n } while (s.heap_len >= 2);\n s.heap[--s.heap_max] = s.heap[1 /*SMALLEST*/];\n\n /* At this point, the fields freq and dad are set. We can now\n * generate the bit lengths.\n */\n gen_bitlen(s, desc);\n\n /* The field len is now set, we can generate the bit codes */\n gen_codes(tree, max_code, s.bl_count);\n}\n\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nfunction scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1] /*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1] /*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1] /*.Len*/;\n if (++count < max_count && curlen === nextlen) {\n continue;\n } else if (count < min_count) {\n s.bl_tree[curlen * 2] /*.Freq*/ += count;\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n s.bl_tree[curlen * 2] /*.Freq*/++;\n }\n s.bl_tree[REP_3_6 * 2] /*.Freq*/++;\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2] /*.Freq*/++;\n } else {\n s.bl_tree[REPZ_11_138 * 2] /*.Freq*/++;\n }\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nfunction send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1] /*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1] /*.Len*/;\n if (++count < max_count && curlen === nextlen) {\n continue;\n } else if (count < min_count) {\n do {\n send_code(s, curlen, s.bl_tree);\n } while (--count !== 0);\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n\n/* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\nfunction build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1] /*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}\n\n/* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\nfunction send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1] /*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}\n\n/* ===========================================================================\n * Check if the data type is TEXT or BINARY, using the following algorithm:\n * - TEXT if the two conditions below are satisfied:\n * a) There are no non-portable control characters belonging to the\n * \"black list\" (0..6, 14..25, 28..31).\n * b) There is at least one printable character belonging to the\n * \"white list\" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).\n * - BINARY otherwise.\n * - The following partially-portable control characters form a\n * \"gray list\" that is ignored in this detection algorithm:\n * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).\n * IN assertion: the fields Freq of dyn_ltree are set.\n */\nfunction detect_data_type(s) {\n /* black_mask is the bit mask of black-listed bytes\n * set bits 0..6, 14..25, and 28..31\n * 0xf3ffc07f = binary 11110011111111111100000001111111\n */\n var black_mask = 0xf3ffc07f;\n var n;\n\n /* Check for non-textual (\"black-listed\") bytes. */\n for (n = 0; n <= 31; n++, black_mask >>>= 1) {\n if (black_mask & 1 && s.dyn_ltree[n * 2] /*.Freq*/ !== 0) {\n return Z_BINARY;\n }\n }\n\n /* Check for textual (\"white-listed\") bytes. */\n if (s.dyn_ltree[9 * 2] /*.Freq*/ !== 0 || s.dyn_ltree[10 * 2] /*.Freq*/ !== 0 || s.dyn_ltree[13 * 2] /*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n for (n = 32; n < LITERALS; n++) {\n if (s.dyn_ltree[n * 2] /*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n }\n\n /* There are no \"black-listed\" or \"white-listed\" bytes:\n * this stream either is empty or has tolerated (\"gray-listed\") bytes only.\n */\n return Z_BINARY;\n}\nvar static_init_done = false;\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nfunction _tr_init(s) {\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n /* Initialize the first block of the first file: */\n init_block(s);\n}\n\n/* ===========================================================================\n * Send a stored block\n */\nfunction _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}\n\n/* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n */\nfunction _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3);\n send_code(s, END_BLOCK, static_ltree);\n bi_flush(s);\n}\n\n/* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and output the encoded block to the zip file.\n */\nfunction _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = s.opt_len + 3 + 7 >>> 3;\n static_lenb = s.static_len + 3 + 7 >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) {\n opt_lenb = static_lenb;\n }\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n if (stored_len + 4 <= opt_lenb && buf !== -1) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nfunction _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = dist >>> 8 & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2] /*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2] /*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2] /*.Freq*/++;\n }\n\n // (!) This block is disabled in zlib defaults,\n // don't enable it for binary compatibility\n\n //#ifdef TRUNCATE_BLOCK\n // /* Try to guess if it is profitable to stop the current block here */\n // if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n // /* Compute an upper bound for the compressed length */\n // out_length = s.last_lit*8;\n // in_length = s.strstart - s.block_start;\n //\n // for (dcode = 0; dcode < D_CODES; dcode++) {\n // out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n // }\n // out_length >>>= 3;\n // //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n // // s->last_lit, in_length, out_length,\n // // 100L - out_length*100L/in_length));\n // if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n // return true;\n // }\n // }\n //#endif\n\n return s.last_lit === s.lit_bufsize - 1;\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}\nexports._tr_init = _tr_init;\nexports._tr_stored_block = _tr_stored_block;\nexports._tr_flush_block = _tr_flush_block;\nexports._tr_tally = _tr_tally;\nexports._tr_align = _tr_align;","\"use strict\";\n\nexports.__esModule = !0, exports.default = void 0;\nvar _base = _interopRequireDefault(require(\"@emotion/styled/base\")),\n _react = _interopRequireWildcard(require(\"react\")),\n _util = require(\"../util\"),\n _constants = require(\"../constants\");\nfunction _getRequireWildcardCache(a) {\n if (\"function\" != typeof WeakMap) return null;\n var b = new WeakMap(),\n c = new WeakMap();\n return (_getRequireWildcardCache = function (a) {\n return a ? c : b;\n })(a);\n}\nfunction _interopRequireWildcard(a, b) {\n if (!b && a && a.__esModule) return a;\n if (null === a || \"object\" != typeof a && \"function\" != typeof a) return {\n default: a\n };\n var c = _getRequireWildcardCache(b);\n if (c && c.has(a)) return c.get(a);\n var d = {},\n e = Object.defineProperty && Object.getOwnPropertyDescriptor;\n for (var f in a) if (\"default\" != f && Object.prototype.hasOwnProperty.call(a, f)) {\n var g = e ? Object.getOwnPropertyDescriptor(a, f) : null;\n g && (g.get || g.set) ? Object.defineProperty(d, f, g) : d[f] = a[f];\n }\n return d.default = a, c && c.set(a, d), d;\n}\nfunction _interopRequireDefault(a) {\n return a && a.__esModule ? a : {\n default: a\n };\n}\nfunction _inheritsLoose(a, b) {\n a.prototype = Object.create(b.prototype), a.prototype.constructor = a, _setPrototypeOf(a, b);\n}\nfunction _setPrototypeOf(a, b) {\n return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (a, b) {\n return a.__proto__ = b, a;\n }, _setPrototypeOf(a, b);\n}\nvar Item = /*#__PURE__*/function (a) {\n function b() {\n for (var b, c = arguments.length, d = Array(c), e = 0; e < c; e++) d[e] = arguments[e];\n return b = a.call.apply(a, [this].concat(d)) || this, b.item = /*#__PURE__*/_react.default.createRef(), b;\n }\n _inheritsLoose(b, a);\n var c = b.prototype;\n return c.componentDidMount = function componentDidMount() {\n var a = this.props,\n b = a.props,\n c = a.methods;\n this.item.current && !b.multi && b.keepSelectedInList && c.isSelected(this.props.item) && this.item.current.scrollIntoView({\n block: \"nearest\",\n inline: \"start\"\n });\n }, c.componentDidUpdate = function componentDidUpdate() {\n this.props.state.cursor === this.props.itemIndex && this.item.current && this.item.current.scrollIntoView({\n behavior: \"smooth\",\n block: \"nearest\",\n inline: \"start\"\n });\n }, c.render = function render() {\n var a = this.props,\n b = a.props,\n c = a.state,\n d = a.methods,\n e = a.item,\n f = a.itemIndex;\n return b.itemRenderer ? b.itemRenderer({\n item: e,\n itemIndex: f,\n props: b,\n state: c,\n methods: d\n }) : !b.keepSelectedInList && d.isSelected(e) ? null : /*#__PURE__*/_react.default.createElement(ItemComponent, {\n role: \"option\",\n ref: this.item,\n \"aria-selected\": d.isSelected(e),\n \"aria-disabled\": e.disabled,\n \"aria-label\": (0, _util.getByPath)(e, b.labelField),\n disabled: e.disabled,\n key: \"\" + (0, _util.getByPath)(e, b.valueField) + (0, _util.getByPath)(e, b.labelField),\n tabIndex: \"-1\",\n className: _constants.LIB_NAME + \"-item \" + (d.isSelected(e) ? _constants.LIB_NAME + \"-item-selected\" : \"\") + \" \" + (c.cursor === f ? _constants.LIB_NAME + \"-item-active\" : \"\") + \" \" + (e.disabled ? _constants.LIB_NAME + \"-item-disabled\" : \"\"),\n onClick: e.disabled ? void 0 : function () {\n return d.addItem(e);\n },\n onKeyPress: e.disabled ? void 0 : function () {\n return d.addItem(e);\n },\n color: b.color\n }, (0, _util.getByPath)(e, b.labelField), \" \", e.disabled && /*#__PURE__*/_react.default.createElement(\"ins\", null, b.disabledLabel));\n }, b;\n }(_react.Component),\n ItemComponent = /*#__PURE__*/(0, _base.default)(\"span\", \"production\" === process.env.NODE_ENV ? {\n target: \"evc32pp0\"\n } : {\n target: \"evc32pp0\",\n label: \"ItemComponent\"\n })(\"padding:5px 10px;cursor:pointer;border-bottom:1px solid #fff;&.\", _constants.LIB_NAME, \"-item-active{border-bottom:1px solid #fff;\", function (a) {\n var b = a.disabled,\n c = a.color;\n return !b && c && \"background: \" + (0, _util.hexToRGBA)(c, .1) + \";\";\n }, \";}:hover,:focus{background:\", function (a) {\n var b = a.color;\n return b && (0, _util.hexToRGBA)(b, .1);\n }, \";outline:none;}&.\", _constants.LIB_NAME, \"-item-selected{\", function (a) {\n var b = a.disabled,\n c = a.color;\n return b ? \"\\n background: #f2f2f2;\\n color: #ccc;\\n \" : \"\\n background: \" + c + \";\\n color: #fff;\\n border-bottom: 1px solid #fff;\\n \";\n }, \";}\", function (a) {\n var b = a.disabled;\n return b ? \"\\n background: #f2f2f2;\\n color: #ccc;\\n\\n ins {\\n text-decoration: none;\\n border:1px solid #ccc;\\n border-radius: 2px;\\n padding: 0px 3px;\\n font-size: x-small;\\n text-transform: uppercase;\\n }\\n \" : \"\";\n }, \";\" + (\"production\" === process.env.NODE_ENV ? \"\" : \"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL0l0ZW0uanMiXSwibmFtZXMiOltdLCJtYXBwaW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IEl0ZW07XG4iXX0= */\")),\n _default = Item;\nexports.default = _default;","\"use strict\";\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nexports.__esModule = !0, exports.default = void 0;\nfunction _interopRequireDefault(a) {\n return a && a.__esModule ? a : {\n default: a\n };\n}\nvar SelectMethodsModel = Object.freeze({\n activeCursorItem: _propTypes.default.func,\n /**\n * Add a new item\n */\n addItem: _propTypes.default.func.isRequired,\n /**\n * Check if all items are selected\n */\n areAllSelected: _propTypes.default.func.isRequired,\n /**\n * Clear all selected items\n */\n clearAll: _propTypes.default.func.isRequired,\n /**\n * Create a new item\n */\n createNew: _propTypes.default.func.isRequired,\n /**\n * Close/Toggle/Open\n */\n dropDown: _propTypes.default.func.isRequired,\n /**\n * Get the input size\n */\n getInputSize: _propTypes.default.func.isRequired,\n /**\n * Get the bounds of the select component\n */\n getSelectBounds: _propTypes.default.func.isRequired,\n /**\n * Get the reference to the select component\n */\n getSelectRef: _propTypes.default.func.isRequired,\n /**\n * Handle key down event\n */\n handleKeyDown: _propTypes.default.func.isRequired,\n /**\n * Check if an item is selected\n */\n isSelected: _propTypes.default.func.isRequired,\n /**\n * Remove an item\n */\n removeItem: _propTypes.default.func.isRequired,\n /**\n * Make a string safe\n */\n safeString: _propTypes.default.func.isRequired,\n /**\n * Get search results\n */\n searchResults: _propTypes.default.func.isRequired,\n /**\n * Select all items\n */\n selectAll: _propTypes.default.func.isRequired,\n /**\n * Set the search string\n */\n setSearch: _propTypes.default.func.isRequired,\n /**\n * Sort items\n */\n sortBy: _propTypes.default.func.isRequired,\n /**\n * Toggle select all\n */\n toggleSelectAll: _propTypes.default.func.isRequired\n }),\n _default = SelectMethodsModel;\nexports.default = _default;","\"use strict\";\n\nexports.__esModule = !0, exports.default = void 0;\nvar _base = _interopRequireDefault(require(\"@emotion/styled/base\")),\n _react = _interopRequireDefault(require(\"react\")),\n _constants = require(\"../constants\"),\n _NoData = _interopRequireDefault(require(\"../components/NoData\")),\n _Item = _interopRequireDefault(require(\"../components/Item\")),\n _util = require(\"../util\");\nfunction _interopRequireDefault(a) {\n return a && a.__esModule ? a : {\n default: a\n };\n}\nvar dropdownPosition = function (a, b) {\n var c = b.getSelectRef().getBoundingClientRect(),\n d = c.bottom + parseInt(a.dropdownHeight, 10) + parseInt(a.dropdownGap, 10);\n return \"auto\" === a.dropdownPosition ? d > (0, _util.isomorphicWindow)().innerHeight && d > c.top ? \"top\" : \"bottom\" : a.dropdownPosition;\n },\n Dropdown = function (a) {\n var b = a.props,\n c = a.state,\n d = a.methods;\n return /*#__PURE__*/_react.default.createElement(DropDown, {\n tabIndex: \"-1\",\n \"aria-expanded\": \"true\",\n role: \"list\",\n dropdownPosition: dropdownPosition(b, d),\n selectBounds: c.selectBounds,\n portal: b.portal,\n dropdownGap: b.dropdownGap,\n dropdownHeight: b.dropdownHeight,\n className: _constants.LIB_NAME + \"-dropdown \" + _constants.LIB_NAME + \"-dropdown-position-\" + dropdownPosition(b, d)\n }, b.dropdownRenderer ? b.dropdownRenderer({\n props: b,\n state: c,\n methods: d\n }) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, b.create && c.search && !(0, _util.valueExistInSelected)(c.search, [].concat(c.values, b.options), b) && /*#__PURE__*/_react.default.createElement(AddNew, {\n role: \"button\",\n className: _constants.LIB_NAME + \"-dropdown-add-new\",\n color: b.color,\n onClick: function onClick() {\n return d.createNew(c.search);\n }\n }, b.createNewLabel.replace(\"{search}\", \"\\\"\" + c.search + \"\\\"\")), 0 === c.searchResults.length ? /*#__PURE__*/_react.default.createElement(_NoData.default, {\n className: _constants.LIB_NAME + \"-no-data\",\n state: c,\n props: b,\n methods: d\n }) : c.searchResults.map(function (a, e) {\n return /*#__PURE__*/_react.default.createElement(_Item.default, {\n key: a[b.valueField].toString(),\n item: a,\n itemIndex: e,\n state: c,\n props: b,\n methods: d\n });\n }), b.selectAll && b.options && b.multi && /*#__PURE__*/_react.default.createElement(SelectAll, {\n role: \"button\",\n className: _constants.LIB_NAME + \"-dropdown-select-all\",\n color: b.color,\n onClick: function onClick() {\n return d.areAllSelected() ? d.clearAll() : d.selectAll();\n }\n }, d.areAllSelected() ? b.clearAllLabel : b.selectAllLabel)));\n },\n DropDown = /*#__PURE__*/(0, _base.default)(\"div\", \"production\" === process.env.NODE_ENV ? {\n target: \"e1qjn9k92\"\n } : {\n target: \"e1qjn9k92\",\n label: \"DropDown\"\n })(\"position:absolute;\", function (a) {\n var b = a.selectBounds,\n c = a.dropdownGap,\n d = a.dropdownPosition;\n return \"top\" === d ? \"bottom: \" + (b.height + 2 + c) + \"px\" : \"top: \" + (b.height + 2 + c) + \"px\";\n }, \";\", function (a) {\n var b = a.selectBounds,\n c = a.dropdownGap,\n d = a.dropdownPosition,\n e = a.portal;\n return e ? \"\\n position: fixed;\\n \" + (\"bottom\" === d ? \"top: \" + (b.bottom + c) + \"px;\" : \"bottom: \" + ((0, _util.isomorphicWindow)().innerHeight - b.top + c) + \"px;\") + \"\\n left: \" + (b.left - 1) + \"px;\" : \"left: -1px;\";\n }, \";border:1px solid #ccc;width:\", function (a) {\n var b = a.selectBounds;\n return b.width;\n }, \"px;padding:0;display:flex;flex-direction:column;background:#fff;border-radius:2px;box-shadow:0 0 10px 0 \", function () {\n return (0, _util.hexToRGBA)(\"#000000\", .2);\n }, \";max-height:\", function (a) {\n var b = a.dropdownHeight;\n return b;\n }, \";overflow:auto;z-index:9;:focus{outline:none;}\" + (\"production\" === process.env.NODE_ENV ? \"\" : \"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL0Ryb3Bkb3duLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXdGMkIiLCJmaWxlIjoiLi4vLi4vc3JjL2NvbXBvbmVudHMvRHJvcGRvd24uanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xua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ZWxlY3RBbGwgPSBzdHlsZWQuZGl2YFxuICBjb2xvcjogJHsoeyBjb2xvciB9KSA9PiBjb2xvcn07XG4gIHBhZGRpbmc6IDVweCAxMHB4O1xuICBwb3NpdGlvbjogc3RpY2t5O1xuICBib3R0b206IDA7XG4gIG1hcmdpbjogMDtcbiAgb3BhY2l0eTogMTtcbiAgYmFja2dyb3VuZDogI2ZmZjtcbiAgYm94LXNoYWRvdzogMCAwIDEwcHggMCAkeygpID0+IGhleFRvUkdCQSgnIzAwMDAwMCcsIDAuMil9O1xuXG4gIDpob3ZlciB7XG4gICAgb3V0bGluZTogbm9uZTtcbiAgICBjdXJzb3I6IHBvaW50ZXI7XG4gIH1cbmA7XG5cbmV4cG9ydCBkZWZhdWx0IERyb3Bkb3duO1xuIl19 */\")),\n AddNew = /*#__PURE__*/(0, _base.default)(\"div\", \"production\" === process.env.NODE_ENV ? {\n target: \"e1qjn9k91\"\n } : {\n target: \"e1qjn9k91\",\n label: \"AddNew\"\n })(\"color:\", function (a) {\n var b = a.color;\n return b;\n }, \";padding:5px 10px;:hover{background:\", function (a) {\n var b = a.color;\n return b && (0, _util.hexToRGBA)(b, .1);\n }, \";outline:none;cursor:pointer;}\" + (\"production\" === process.env.NODE_ENV ? \"\" : \"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL0Ryb3Bkb3duLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTRIeUIiLCJmaWxlIjoiLi4vLi4vc3JjL2NvbXBvbmVudHMvRHJvcGRvd24uanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuXG5pbXBvcnQgeyBMSUJfTkFNRSB9IGZyb20gJy4uL2NvbnN0YW50cyc7XG5pbXB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Glvbjogc3RpY2t5O1xuICBib3R0b206IDA7XG4gIG1hcmdpbjogMDtcbiAgb3BhY2l0eTogMTtcbiAgYmFja2dyb3VuZDogI2ZmZjtcbiAgYm94LXNoYWRvdzogMCAwIDEwcHggMCAkeygpID0+IGhleFRvUkdCQSgnIzAwMDAwMCcsIDAuMil9O1xuXG4gIDpob3ZlciB7XG4gICAgb3V0bGluZTogbm9uZTtcbiAgICBjdXJzb3I6IHBvaW50ZXI7XG4gIH1cbmA7XG5cbmV4cG9ydCBkZWZhdWx0IERyb3Bkb3duO1xuIl19 */\")),\n SelectAll = /*#__PURE__*/(0, _base.default)(\"div\", \"production\" === process.env.NODE_ENV ? {\n target: \"e1qjn9k90\"\n } : {\n target: \"e1qjn9k90\",\n label: \"SelectAll\"\n })(\"color:\", function (a) {\n var b = a.color;\n return b;\n }, \";padding:5px 10px;position:sticky;bottom:0;margin:0;opacity:1;background:#fff;box-shadow:0 0 10px 0 \", function () {\n return (0, _util.hexToRGBA)(\"#000000\", .2);\n }, \";:hover{outline:none;cursor:pointer;}\" + (\"production\" === process.env.NODE_ENV ? \"\" : \"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL0Ryb3Bkb3duLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVJNEIiLCJmaWxlIjoiLi4vLi4vc3JjL2NvbXBvbmVudHMvRHJvcGRvd24uanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuXG5pbXBvcnQgeyBMSUJfTkFNRSB9IGZyb20gJy4uL2NvbnN0YW50cyc7XG5pbXBvcnQgTm9EYXRhIGZyb20gJy4uL2NvbXBvbmVudHMvTm9EYXRhJztcbmltcG9ydCBJdGVtIGZyb20gJy4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ja2dyb3VuZDogI2ZmZjtcbiAgYm94LXNoYWRvdzogMCAwIDEwcHggMCAkeygpID0+IGhleFRvUkdCQSgnIzAwMDAwMCcsIDAuMil9O1xuXG4gIDpob3ZlciB7XG4gICAgb3V0bGluZTogbm9uZTtcbiAgICBjdXJzb3I6IHBvaW50ZXI7XG4gIH1cbmA7XG5cbmV4cG9ydCBkZWZhdWx0IERyb3Bkb3duO1xuIl19 */\")),\n _default = Dropdown;\nexports.default = _default;","\"use strict\";\n\nexports.__esModule = !0, exports.default = void 0;\nvar _base = _interopRequireDefault(require(\"@emotion/styled/base\")),\n _react = _interopRequireDefault(require(\"react\")),\n _util = require(\"../util\"),\n _constants = require(\"../constants\");\nfunction _interopRequireDefault(a) {\n return a && a.__esModule ? a : {\n default: a\n };\n}\nvar Option = function (a) {\n var b = a.item,\n c = a.props,\n d = a.state,\n e = a.methods;\n return b && c.optionRenderer ? c.optionRenderer({\n item: b,\n props: c,\n state: d,\n methods: e\n }) : /*#__PURE__*/_react.default.createElement(OptionComponent, {\n role: \"listitem\",\n disabled: c.disabled,\n direction: c.direction,\n className: _constants.LIB_NAME + \"-option\",\n color: c.color\n }, /*#__PURE__*/_react.default.createElement(\"span\", {\n className: _constants.LIB_NAME + \"-option-label\"\n }, (0, _util.getByPath)(b, c.labelField)), /*#__PURE__*/_react.default.createElement(\"span\", {\n className: _constants.LIB_NAME + \"-option-remove\",\n onClick: function onClick(a) {\n return e.removeItem(a, b, c.closeOnSelect);\n }\n }, \"\\xD7\"));\n },\n OptionComponent = /*#__PURE__*/(0, _base.default)(\"span\", \"production\" === process.env.NODE_ENV ? {\n target: \"e1l4eby50\"\n } : {\n target: \"e1l4eby50\",\n label: \"OptionComponent\"\n })(\"padding:0 5px;border-radius:2px;line-height:21px;margin:3px 0 3px 5px;background:\", function (a) {\n var b = a.color;\n return b;\n }, \";color:#fff;display:flex;flex-direction:\", function (a) {\n var b = a.direction;\n return \"rtl\" === b ? \"row-reverse\" : \"row\";\n }, \";.\", _constants.LIB_NAME, \"-option-remove{cursor:pointer;width:22px;height:22px;display:inline-block;text-align:center;margin:0 -5px 0 0px;border-radius:0 3px 3px 0;:hover{color:tomato;}}:hover,:hover>span{opacity:0.9;}\" + (\"production\" === process.env.NODE_ENV ? \"\" : \"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL09wdGlvbi5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF3Qm1DIiwiZmlsZSI6Ii4uLy4uL3NyYy9jb21wb25lbnRzL09wdGlvbi5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCc7XG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQge2dldEJ5UGF0aH0gZnJvbSAnLi4vdXRpbCc7XG5pbXBvcnQgeyBMSUJfTkFNRSB9IGZyb20gJy4uL2NvbnN0YW50cyc7XG5cbmNvbnN0IE9wdGlvbiA9ICh7IGl0ZW0sIHByb3BzLCBzdGF0ZSwgbWV0aG9kcyB9KSA9PlxuICBpdGVtICYmIHByb3BzLm9wdGlvblJlbmRlcmVyID8gKFxuICAgIHByb3BzLm9wdGlvblJlbmRlcmVyKHsgaXRlbSwgcHJvcHMsIHN0YXRlLCBtZXRob2RzIH0pXG4gICkgOiAoXG4gICAgPE9wdGlvbkNvbXBvbmVudFxuICAgICAgcm9sZT1cImxpc3RpdGVtXCJcbiAgICAgIGRpc2FibGVkPXtwcm9wcy5kaXNhYmxlZH1cbiAgICAgIGRpcmVjdGlvbj17cHJvcHMuZGlyZWN0aW9ufVxuICAgICAgY2xhc3NOYW1lPXtgJHtMSUJfTkFNRX0tb3B0aW9uYH1cbiAgICAgIGNvbG9yPXtwcm9wcy5jb2xvcn0+XG4gICAgICA8c3BhbiBjbGFzc05hbWU9e2Ake0xJQl9OQU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G4gIDpob3ZlcixcbiAgOmhvdmVyID4gc3BhbiB7XG4gICAgb3BhY2l0eTogMC45O1xuICB9XG5gO1xuXG5leHBvcnQgZGVmYXVsdCBPcHRpb247XG4iXX0= */\")),\n _default = Option;\nexports.default = _default;","\"use strict\";\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nexports.__esModule = !0, exports.default = void 0;\nfunction _interopRequireDefault(a) {\n return a && a.__esModule ? a : {\n default: a\n };\n}\nvar SelectStateModel = Object.freeze({\n /**\n * Flag indicating whether the dropdown is open or closed\n */\n dropdown: _propTypes.default.bool.isRequired,\n /**\n * Array of selected values\n */\n values: _propTypes.default.arrayOf(_propTypes.default.shape({})),\n /**\n * Search string\n */\n search: _propTypes.default.string.isRequired,\n /**\n * Array of bounds for the select component\n */\n selectBounds: _propTypes.default.shape({}),\n /**\n * Cursor position\n */\n cursor: _propTypes.default.number,\n /**\n * Array of search results\n */\n searchResults: _propTypes.default.arrayOf(_propTypes.default.shape({}))\n }),\n _default = SelectStateModel;\nexports.default = _default;","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\nmodule.exports = {\n /* Allowed flush values; see deflate() and inflate() below for details */\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n /* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n //Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n //Z_VERSION_ERROR: -6,\n\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n /* Possible values of the data_type field (though see inflate()) */\n Z_BINARY: 0,\n Z_TEXT: 1,\n //Z_ASCII: 1, // = Z_TEXT (deprecated)\n Z_UNKNOWN: 2,\n /* The deflate compression method */\n Z_DEFLATED: 8\n //Z_NULL: null // Use -1 or null inline, depending on var type\n};","\"use strict\";\n\nexports.__esModule = !0, exports.LIB_NAME = void 0;\nvar LIB_NAME = \"react-dropdown-select\";\nexports.LIB_NAME = \"react-dropdown-select\";","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n};\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\nvar _react = require(\"react\");\nvar _propTypes = require(\"prop-types\");\nvar _propTypes2 = _interopRequireDefault(_propTypes);\nvar _focusManager = require(\"../helpers/focusManager\");\nvar focusManager = _interopRequireWildcard(_focusManager);\nvar _scopeTab = require(\"../helpers/scopeTab\");\nvar _scopeTab2 = _interopRequireDefault(_scopeTab);\nvar _ariaAppHider = require(\"../helpers/ariaAppHider\");\nvar ariaAppHider = _interopRequireWildcard(_ariaAppHider);\nvar _classList = require(\"../helpers/classList\");\nvar classList = _interopRequireWildcard(_classList);\nvar _safeHTMLElement = require(\"../helpers/safeHTMLElement\");\nvar _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement);\nvar _portalOpenInstances = require(\"../helpers/portalOpenInstances\");\nvar _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances);\nrequire(\"../helpers/bodyTrap\");\nfunction _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n } else {\n var newObj = {};\n if (obj != null) {\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];\n }\n }\n newObj.default = obj;\n return newObj;\n }\n}\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n}\n\n// so that our CSS is statically analyzable\nvar CLASS_NAMES = {\n overlay: \"ReactModal__Overlay\",\n content: \"ReactModal__Content\"\n};\n\n/**\n * We need to support the deprecated `KeyboardEvent.keyCode` in addition to\n * `KeyboardEvent.code` for apps that still support IE11. Can be removed when\n * `react-modal` only supports React >18 (which dropped IE support).\n */\nvar isTabKey = function isTabKey(event) {\n return event.code === \"Tab\" || event.keyCode === 9;\n};\nvar isEscKey = function isEscKey(event) {\n return event.code === \"Escape\" || event.keyCode === 27;\n};\nvar ariaHiddenInstances = 0;\nvar ModalPortal = function (_Component) {\n _inherits(ModalPortal, _Component);\n function ModalPortal(props) {\n _classCallCheck(this, ModalPortal);\n var _this = _possibleConstructorReturn(this, (ModalPortal.__proto__ || Object.getPrototypeOf(ModalPortal)).call(this, props));\n _this.setOverlayRef = function (overlay) {\n _this.overlay = overlay;\n _this.props.overlayRef && _this.props.overlayRef(overlay);\n };\n _this.setContentRef = function (content) {\n _this.content = content;\n _this.props.contentRef && _this.props.contentRef(content);\n };\n _this.afterClose = function () {\n var _this$props = _this.props,\n appElement = _this$props.appElement,\n ariaHideApp = _this$props.ariaHideApp,\n htmlOpenClassName = _this$props.htmlOpenClassName,\n bodyOpenClassName = _this$props.bodyOpenClassName,\n parentSelector = _this$props.parentSelector;\n var parentDocument = parentSelector && parentSelector().ownerDocument || document;\n\n // Remove classes.\n bodyOpenClassName && classList.remove(parentDocument.body, bodyOpenClassName);\n htmlOpenClassName && classList.remove(parentDocument.getElementsByTagName(\"html\")[0], htmlOpenClassName);\n\n // Reset aria-hidden attribute if all modals have been removed\n if (ariaHideApp && ariaHiddenInstances > 0) {\n ariaHiddenInstances -= 1;\n if (ariaHiddenInstances === 0) {\n ariaAppHider.show(appElement);\n }\n }\n if (_this.props.shouldFocusAfterRender) {\n if (_this.props.shouldReturnFocusAfterClose) {\n focusManager.returnFocus(_this.props.preventScroll);\n focusManager.teardownScopedFocus();\n } else {\n focusManager.popWithoutFocus();\n }\n }\n if (_this.props.onAfterClose) {\n _this.props.onAfterClose();\n }\n _portalOpenInstances2.default.deregister(_this);\n };\n _this.open = function () {\n _this.beforeOpen();\n if (_this.state.afterOpen && _this.state.beforeClose) {\n clearTimeout(_this.closeTimer);\n _this.setState({\n beforeClose: false\n });\n } else {\n if (_this.props.shouldFocusAfterRender) {\n focusManager.setupScopedFocus(_this.node);\n focusManager.markForFocusLater();\n }\n _this.setState({\n isOpen: true\n }, function () {\n _this.openAnimationFrame = requestAnimationFrame(function () {\n _this.setState({\n afterOpen: true\n });\n if (_this.props.isOpen && _this.props.onAfterOpen) {\n _this.props.onAfterOpen({\n overlayEl: _this.overlay,\n contentEl: _this.content\n });\n }\n });\n });\n }\n };\n _this.close = function () {\n if (_this.props.closeTimeoutMS > 0) {\n _this.closeWithTimeout();\n } else {\n _this.closeWithoutTimeout();\n }\n };\n _this.focusContent = function () {\n return _this.content && !_this.contentHasFocus() && _this.content.focus({\n preventScroll: true\n });\n };\n _this.closeWithTimeout = function () {\n var closesAt = Date.now() + _this.props.closeTimeoutMS;\n _this.setState({\n beforeClose: true,\n closesAt: closesAt\n }, function () {\n _this.closeTimer = setTimeout(_this.closeWithoutTimeout, _this.state.closesAt - Date.now());\n });\n };\n _this.closeWithoutTimeout = function () {\n _this.setState({\n beforeClose: false,\n isOpen: false,\n afterOpen: false,\n closesAt: null\n }, _this.afterClose);\n };\n _this.handleKeyDown = function (event) {\n if (isTabKey(event)) {\n (0, _scopeTab2.default)(_this.content, event);\n }\n if (_this.props.shouldCloseOnEsc && isEscKey(event)) {\n event.stopPropagation();\n _this.requestClose(event);\n }\n };\n _this.handleOverlayOnClick = function (event) {\n if (_this.shouldClose === null) {\n _this.shouldClose = true;\n }\n if (_this.shouldClose && _this.props.shouldCloseOnOverlayClick) {\n if (_this.ownerHandlesClose()) {\n _this.requestClose(event);\n } else {\n _this.focusContent();\n }\n }\n _this.shouldClose = null;\n };\n _this.handleContentOnMouseUp = function () {\n _this.shouldClose = false;\n };\n _this.handleOverlayOnMouseDown = function (event) {\n if (!_this.props.shouldCloseOnOverlayClick && event.target == _this.overlay) {\n event.preventDefault();\n }\n };\n _this.handleContentOnClick = function () {\n _this.shouldClose = false;\n };\n _this.handleContentOnMouseDown = function () {\n _this.shouldClose = false;\n };\n _this.requestClose = function (event) {\n return _this.ownerHandlesClose() && _this.props.onRequestClose(event);\n };\n _this.ownerHandlesClose = function () {\n return _this.props.onRequestClose;\n };\n _this.shouldBeClosed = function () {\n return !_this.state.isOpen && !_this.state.beforeClose;\n };\n _this.contentHasFocus = function () {\n return document.activeElement === _this.content || _this.content.contains(document.activeElement);\n };\n _this.buildClassName = function (which, additional) {\n var classNames = (typeof additional === \"undefined\" ? \"undefined\" : _typeof(additional)) === \"object\" ? additional : {\n base: CLASS_NAMES[which],\n afterOpen: CLASS_NAMES[which] + \"--after-open\",\n beforeClose: CLASS_NAMES[which] + \"--before-close\"\n };\n var className = classNames.base;\n if (_this.state.afterOpen) {\n className = className + \" \" + classNames.afterOpen;\n }\n if (_this.state.beforeClose) {\n className = className + \" \" + classNames.beforeClose;\n }\n return typeof additional === \"string\" && additional ? className + \" \" + additional : className;\n };\n _this.attributesFromObject = function (prefix, items) {\n return Object.keys(items).reduce(function (acc, name) {\n acc[prefix + \"-\" + name] = items[name];\n return acc;\n }, {});\n };\n _this.state = {\n afterOpen: false,\n beforeClose: false\n };\n _this.shouldClose = null;\n _this.moveFromContentToOverlay = null;\n return _this;\n }\n _createClass(ModalPortal, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (this.props.isOpen) {\n this.open();\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, prevState) {\n if (process.env.NODE_ENV !== \"production\") {\n if (prevProps.bodyOpenClassName !== this.props.bodyOpenClassName) {\n // eslint-disable-next-line no-console\n console.warn('React-Modal: \"bodyOpenClassName\" prop has been modified. ' + \"This may cause unexpected behavior when multiple modals are open.\");\n }\n if (prevProps.htmlOpenClassName !== this.props.htmlOpenClassName) {\n // eslint-disable-next-line no-console\n console.warn('React-Modal: \"htmlOpenClassName\" prop has been modified. ' + \"This may cause unexpected behavior when multiple modals are open.\");\n }\n }\n if (this.props.isOpen && !prevProps.isOpen) {\n this.open();\n } else if (!this.props.isOpen && prevProps.isOpen) {\n this.close();\n }\n\n // Focus only needs to be set once when the modal is being opened\n if (this.props.shouldFocusAfterRender && this.state.isOpen && !prevState.isOpen) {\n this.focusContent();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (this.state.isOpen) {\n this.afterClose();\n }\n clearTimeout(this.closeTimer);\n cancelAnimationFrame(this.openAnimationFrame);\n }\n }, {\n key: \"beforeOpen\",\n value: function beforeOpen() {\n var _props = this.props,\n appElement = _props.appElement,\n ariaHideApp = _props.ariaHideApp,\n htmlOpenClassName = _props.htmlOpenClassName,\n bodyOpenClassName = _props.bodyOpenClassName,\n parentSelector = _props.parentSelector;\n var parentDocument = parentSelector && parentSelector().ownerDocument || document;\n\n // Add classes.\n bodyOpenClassName && classList.add(parentDocument.body, bodyOpenClassName);\n htmlOpenClassName && classList.add(parentDocument.getElementsByTagName(\"html\")[0], htmlOpenClassName);\n if (ariaHideApp) {\n ariaHiddenInstances += 1;\n ariaAppHider.hide(appElement);\n }\n _portalOpenInstances2.default.register(this);\n }\n\n // Don't steal focus from inner elements\n }, {\n key: \"render\",\n value: function render() {\n var _props2 = this.props,\n id = _props2.id,\n className = _props2.className,\n overlayClassName = _props2.overlayClassName,\n defaultStyles = _props2.defaultStyles,\n children = _props2.children;\n var contentStyles = className ? {} : defaultStyles.content;\n var overlayStyles = overlayClassName ? {} : defaultStyles.overlay;\n if (this.shouldBeClosed()) {\n return null;\n }\n var overlayProps = {\n ref: this.setOverlayRef,\n className: this.buildClassName(\"overlay\", overlayClassName),\n style: _extends({}, overlayStyles, this.props.style.overlay),\n onClick: this.handleOverlayOnClick,\n onMouseDown: this.handleOverlayOnMouseDown\n };\n var contentProps = _extends({\n id: id,\n ref: this.setContentRef,\n style: _extends({}, contentStyles, this.props.style.content),\n className: this.buildClassName(\"content\", className),\n tabIndex: \"-1\",\n onKeyDown: this.handleKeyDown,\n onMouseDown: this.handleContentOnMouseDown,\n onMouseUp: this.handleContentOnMouseUp,\n onClick: this.handleContentOnClick,\n role: this.props.role,\n \"aria-label\": this.props.contentLabel\n }, this.attributesFromObject(\"aria\", _extends({\n modal: true\n }, this.props.aria)), this.attributesFromObject(\"data\", this.props.data || {}), {\n \"data-testid\": this.props.testId\n });\n var contentElement = this.props.contentElement(contentProps, children);\n return this.props.overlayElement(overlayProps, contentElement);\n }\n }]);\n return ModalPortal;\n}(_react.Component);\nModalPortal.defaultProps = {\n style: {\n overlay: {},\n content: {}\n },\n defaultStyles: {}\n};\nModalPortal.propTypes = {\n isOpen: _propTypes2.default.bool.isRequired,\n defaultStyles: _propTypes2.default.shape({\n content: _propTypes2.default.object,\n overlay: _propTypes2.default.object\n }),\n style: _propTypes2.default.shape({\n content: _propTypes2.default.object,\n overlay: _propTypes2.default.object\n }),\n className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),\n overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),\n parentSelector: _propTypes2.default.func,\n bodyOpenClassName: _propTypes2.default.string,\n htmlOpenClassName: _propTypes2.default.string,\n ariaHideApp: _propTypes2.default.bool,\n appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(_safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(_safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),\n onAfterOpen: _propTypes2.default.func,\n onAfterClose: _propTypes2.default.func,\n onRequestClose: _propTypes2.default.func,\n closeTimeoutMS: _propTypes2.default.number,\n shouldFocusAfterRender: _propTypes2.default.bool,\n shouldCloseOnOverlayClick: _propTypes2.default.bool,\n shouldReturnFocusAfterClose: _propTypes2.default.bool,\n preventScroll: _propTypes2.default.bool,\n role: _propTypes2.default.string,\n contentLabel: _propTypes2.default.string,\n aria: _propTypes2.default.object,\n data: _propTypes2.default.object,\n children: _propTypes2.default.node,\n shouldCloseOnEsc: _propTypes2.default.bool,\n overlayRef: _propTypes2.default.func,\n contentRef: _propTypes2.default.func,\n id: _propTypes2.default.string,\n overlayElement: _propTypes2.default.func,\n contentElement: _propTypes2.default.func,\n testId: _propTypes2.default.string\n};\nexports.default = ModalPortal;\nmodule.exports = exports[\"default\"];","'use strict';\n\nvar zlib_deflate = require('./zlib/deflate');\nvar utils = require('./utils/common');\nvar strings = require('./utils/strings');\nvar msg = require('./zlib/messages');\nvar ZStream = require('./zlib/zstream');\nvar toString = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nvar Z_NO_FLUSH = 0;\nvar Z_FINISH = 4;\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\nvar Z_SYNC_FLUSH = 2;\nvar Z_DEFAULT_COMPRESSION = -1;\nvar Z_DEFAULT_STRATEGY = 0;\nvar Z_DEFLATED = 8;\n\n/* ===========================================================================*/\n\n/**\n * class Deflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[deflate]],\n * [[deflateRaw]] and [[gzip]].\n **/\n\n/* internal\n * Deflate.chunks -> Array\n *\n * Chunks of output data, if [[Deflate#onData]] not overridden.\n **/\n\n/**\n * Deflate.result -> Uint8Array|Array\n *\n * Compressed result, generated by default [[Deflate#onData]]\n * and [[Deflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you\n * push a chunk with explicit flush (call [[Deflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\n\n/**\n * Deflate.err -> Number\n *\n * Error code after deflate finished. 0 (Z_OK) on success.\n * You will not need it in real life, because deflate errors\n * are possible only on wrong options or bad `onData` / `onEnd`\n * custom handlers.\n **/\n\n/**\n * Deflate.msg -> String\n *\n * Error message, if [[Deflate.err]] != 0\n **/\n\n/**\n * new Deflate(options)\n * - options (Object): zlib deflate options.\n *\n * Creates new deflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `level`\n * - `windowBits`\n * - `memLevel`\n * - `strategy`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw deflate\n * - `gzip` (Boolean) - create gzip wrapper\n * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n * (each char code [0..255])\n * - `header` (Object) - custom header for gzip\n * - `text` (Boolean) - true if compressed data believed to be text\n * - `time` (Number) - modification time, unix timestamp\n * - `os` (Number) - operation system code\n * - `extra` (Array) - array of bytes with extra data (max 65536)\n * - `name` (String) - file name (binary string)\n * - `comment` (String) - comment (binary string)\n * - `hcrc` (Boolean) - true if header crc should be added\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var deflate = new pako.Deflate({ level: 3});\n *\n * deflate.push(chunk1, false);\n * deflate.push(chunk2, true); // true -> last chunk\n *\n * if (deflate.err) { throw new Error(deflate.err); }\n *\n * console.log(deflate.result);\n * ```\n **/\nfunction Deflate(options) {\n if (!(this instanceof Deflate)) return new Deflate(options);\n this.options = utils.assign({\n level: Z_DEFAULT_COMPRESSION,\n method: Z_DEFLATED,\n chunkSize: 16384,\n windowBits: 15,\n memLevel: 8,\n strategy: Z_DEFAULT_STRATEGY,\n to: ''\n }, options || {});\n var opt = this.options;\n if (opt.raw && opt.windowBits > 0) {\n opt.windowBits = -opt.windowBits;\n } else if (opt.gzip && opt.windowBits > 0 && opt.windowBits < 16) {\n opt.windowBits += 16;\n }\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n var status = zlib_deflate.deflateInit2(this.strm, opt.level, opt.method, opt.windowBits, opt.memLevel, opt.strategy);\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n if (opt.header) {\n zlib_deflate.deflateSetHeader(this.strm, opt.header);\n }\n if (opt.dictionary) {\n var dict;\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n // If we need to compress text, change encoding to utf8.\n dict = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n dict = new Uint8Array(opt.dictionary);\n } else {\n dict = opt.dictionary;\n }\n status = zlib_deflate.deflateSetDictionary(this.strm, dict);\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n this._dict_set = true;\n }\n}\n\n/**\n * Deflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be\n * converted to utf8 byte sequence.\n * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with\n * new compressed chunks. Returns `true` on success. The last data block must have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the compression context.\n *\n * On fail call [[Deflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * array format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nDeflate.prototype.push = function (data, mode) {\n var strm = this.strm;\n var chunkSize = this.options.chunkSize;\n var status, _mode;\n if (this.ended) {\n return false;\n }\n _mode = mode === ~~mode ? mode : mode === true ? Z_FINISH : Z_NO_FLUSH;\n\n // Convert data if needed\n if (typeof data === 'string') {\n // If we need to compress text, change encoding to utf8.\n strm.input = strings.string2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n do {\n if (strm.avail_out === 0) {\n strm.output = new utils.Buf8(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n status = zlib_deflate.deflate(strm, _mode); /* no bad return value */\n\n if (status !== Z_STREAM_END && status !== Z_OK) {\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n if (strm.avail_out === 0 || strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH)) {\n if (this.options.to === 'string') {\n this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));\n } else {\n this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n }\n }\n } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);\n\n // Finalize on the last chunk.\n if (_mode === Z_FINISH) {\n status = zlib_deflate.deflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === Z_OK;\n }\n\n // callback interim results if Z_SYNC_FLUSH.\n if (_mode === Z_SYNC_FLUSH) {\n this.onEnd(Z_OK);\n strm.avail_out = 0;\n return true;\n }\n return true;\n};\n\n/**\n * Deflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): output data. Type of array depends\n * on js engine support. When string output requested, each chunk\n * will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nDeflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n/**\n * Deflate#onEnd(status) -> Void\n * - status (Number): deflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called once after you tell deflate that the input stream is\n * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nDeflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK) {\n if (this.options.to === 'string') {\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n/**\n * deflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * Compress `data` with deflate algorithm and `options`.\n *\n * Supported options are:\n *\n * - level\n * - windowBits\n * - memLevel\n * - strategy\n * - dictionary\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n * (each char code [0..255])\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , data = Uint8Array([1,2,3,4,5,6,7,8,9]);\n *\n * console.log(pako.deflate(data));\n * ```\n **/\nfunction deflate(input, options) {\n var deflator = new Deflate(options);\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) {\n throw deflator.msg || msg[deflator.err];\n }\n return deflator.result;\n}\n\n/**\n * deflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}\n\n/**\n * gzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but create gzip wrapper instead of\n * deflate one.\n **/\nfunction gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}\nexports.Deflate = Deflate;\nexports.deflate = deflate;\nexports.deflateRaw = deflateRaw;\nexports.gzip = gzip;","module.exports = __webpack_public_path__ + \"static/insurance-doc-1bf3bcaeac39c6660a5c98fe4e89b328.pdf\";","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = scopeTab;\nvar _tabbable = require(\"./tabbable\");\nvar _tabbable2 = _interopRequireDefault(_tabbable);\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nfunction getActiveElement() {\n var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;\n return el.activeElement.shadowRoot ? getActiveElement(el.activeElement.shadowRoot) : el.activeElement;\n}\nfunction scopeTab(node, event) {\n var tabbable = (0, _tabbable2.default)(node);\n if (!tabbable.length) {\n // Do nothing, since there are no elements that can receive focus.\n event.preventDefault();\n return;\n }\n var target = void 0;\n var shiftKey = event.shiftKey;\n var head = tabbable[0];\n var tail = tabbable[tabbable.length - 1];\n var activeElement = getActiveElement();\n\n // proceed with default browser behavior on tab.\n // Focus on last element on shift + tab.\n if (node === activeElement) {\n if (!shiftKey) return;\n target = tail;\n }\n if (tail === activeElement && !shiftKey) {\n target = head;\n }\n if (head === activeElement && shiftKey) {\n target = tail;\n }\n if (target) {\n event.preventDefault();\n target.focus();\n return;\n }\n\n // Safari radio issue.\n //\n // Safari does not move the focus to the radio button,\n // so we need to force it to really walk through all elements.\n //\n // This is very error prone, since we are trying to guess\n // if it is a safari browser from the first occurence between\n // chrome or safari.\n //\n // The chrome user agent contains the first ocurrence\n // as the 'chrome/version' and later the 'safari/version'.\n var checkSafari = /(\\bChrome\\b|\\bSafari\\b)\\//.exec(navigator.userAgent);\n var isSafariDesktop = checkSafari != null && checkSafari[1] != \"Chrome\" && /\\biPod\\b|\\biPad\\b/g.exec(navigator.userAgent) == null;\n\n // If we are not in safari desktop, let the browser control\n // the focus\n if (!isSafariDesktop) return;\n var x = tabbable.indexOf(activeElement);\n if (x > -1) {\n x += shiftKey ? -1 : 1;\n }\n target = tabbable[x];\n\n // If the tabbable element does not exist,\n // focus head/tail based on shiftKey\n if (typeof target === \"undefined\") {\n event.preventDefault();\n target = shiftKey ? tail : head;\n target.focus();\n return;\n }\n event.preventDefault();\n target.focus();\n}\nmodule.exports = exports[\"default\"];","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\nmodule.exports = {\n 2: 'need dictionary',\n /* Z_NEED_DICT 2 */\n 1: 'stream end',\n /* Z_STREAM_END 1 */\n 0: '',\n /* Z_OK 0 */\n '-1': 'file error',\n /* Z_ERRNO (-1) */\n '-2': 'stream error',\n /* Z_STREAM_ERROR (-2) */\n '-3': 'data error',\n /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory',\n /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error',\n /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.log = log;\nexports.resetState = resetState;\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\n// Tracks portals that are open and emits events to subscribers\n\nvar PortalOpenInstances = function PortalOpenInstances() {\n var _this = this;\n _classCallCheck(this, PortalOpenInstances);\n this.register = function (openInstance) {\n if (_this.openInstances.indexOf(openInstance) !== -1) {\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.warn(\"React-Modal: Cannot register modal instance that's already open\");\n }\n return;\n }\n _this.openInstances.push(openInstance);\n _this.emit(\"register\");\n };\n this.deregister = function (openInstance) {\n var index = _this.openInstances.indexOf(openInstance);\n if (index === -1) {\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.warn(\"React-Modal: Unable to deregister \" + openInstance + \" as \" + \"it was never registered\");\n }\n return;\n }\n _this.openInstances.splice(index, 1);\n _this.emit(\"deregister\");\n };\n this.subscribe = function (callback) {\n _this.subscribers.push(callback);\n };\n this.emit = function (eventType) {\n _this.subscribers.forEach(function (subscriber) {\n return subscriber(eventType,\n // shallow copy to avoid accidental mutation\n _this.openInstances.slice());\n });\n };\n this.openInstances = [];\n this.subscribers = [];\n};\nvar portalOpenInstances = new PortalOpenInstances();\n\n/* eslint-disable no-console */\n/* istanbul ignore next */\nfunction log() {\n console.log(\"portalOpenInstances ----------\");\n console.log(portalOpenInstances.openInstances.length);\n portalOpenInstances.openInstances.forEach(function (p) {\n return console.log(p);\n });\n console.log(\"end portalOpenInstances ----------\");\n}\n\n/* istanbul ignore next */\nfunction resetState() {\n portalOpenInstances = new PortalOpenInstances();\n}\n/* eslint-enable no-console */\n\nexports.default = portalOpenInstances;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.resetState = resetState;\nexports.log = log;\nexports.handleBlur = handleBlur;\nexports.handleFocus = handleFocus;\nexports.markForFocusLater = markForFocusLater;\nexports.returnFocus = returnFocus;\nexports.popWithoutFocus = popWithoutFocus;\nexports.setupScopedFocus = setupScopedFocus;\nexports.teardownScopedFocus = teardownScopedFocus;\nvar _tabbable = require(\"../helpers/tabbable\");\nvar _tabbable2 = _interopRequireDefault(_tabbable);\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nvar focusLaterElements = [];\nvar modalElement = null;\nvar needToFocus = false;\n\n/* eslint-disable no-console */\n/* istanbul ignore next */\nfunction resetState() {\n focusLaterElements = [];\n}\n\n/* istanbul ignore next */\nfunction log() {\n if (process.env.NODE_ENV !== \"production\") {\n console.log(\"focusManager ----------\");\n focusLaterElements.forEach(function (f) {\n var check = f || {};\n console.log(check.nodeName, check.className, check.id);\n });\n console.log(\"end focusManager ----------\");\n }\n}\n/* eslint-enable no-console */\n\nfunction handleBlur() {\n needToFocus = true;\n}\nfunction handleFocus() {\n if (needToFocus) {\n needToFocus = false;\n if (!modalElement) {\n return;\n }\n // need to see how jQuery shims document.on('focusin') so we don't need the\n // setTimeout, firefox doesn't support focusin, if it did, we could focus\n // the element outside of a setTimeout. Side-effect of this implementation\n // is that the document.body gets focus, and then we focus our element right\n // after, seems fine.\n setTimeout(function () {\n if (modalElement.contains(document.activeElement)) {\n return;\n }\n var el = (0, _tabbable2.default)(modalElement)[0] || modalElement;\n el.focus();\n }, 0);\n }\n}\nfunction markForFocusLater() {\n focusLaterElements.push(document.activeElement);\n}\n\n/* eslint-disable no-console */\nfunction returnFocus() {\n var preventScroll = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var toFocus = null;\n try {\n if (focusLaterElements.length !== 0) {\n toFocus = focusLaterElements.pop();\n toFocus.focus({\n preventScroll: preventScroll\n });\n }\n return;\n } catch (e) {\n console.warn([\"You tried to return focus to\", toFocus, \"but it is not in the DOM anymore\"].join(\" \"));\n }\n}\n/* eslint-enable no-console */\n\nfunction popWithoutFocus() {\n focusLaterElements.length > 0 && focusLaterElements.pop();\n}\nfunction setupScopedFocus(element) {\n modalElement = element;\n if (window.addEventListener) {\n window.addEventListener(\"blur\", handleBlur, false);\n document.addEventListener(\"focus\", handleFocus, true);\n } else {\n window.attachEvent(\"onBlur\", handleBlur);\n document.attachEvent(\"onFocus\", handleFocus);\n }\n}\nfunction teardownScopedFocus() {\n modalElement = null;\n if (window.addEventListener) {\n window.removeEventListener(\"blur\", handleBlur);\n document.removeEventListener(\"focus\", handleFocus);\n } else {\n window.detachEvent(\"onBlur\", handleBlur);\n document.detachEvent(\"onFocus\", handleFocus);\n }\n}","import { __extends } from \"tslib\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { copyStringIntoBuffer, toHexStringOfMinLength, utf16Decode, utf16Encode, pdfDocEncodingDecode, parseDate, hasUtf16BOM } from \"../../utils\";\nimport { InvalidPDFDateStringError } from \"../errors\";\nvar PDFHexString = /** @class */function (_super) {\n __extends(PDFHexString, _super);\n function PDFHexString(value) {\n var _this = _super.call(this) || this;\n _this.value = value;\n return _this;\n }\n PDFHexString.prototype.asBytes = function () {\n // Append a zero if the number of digits is odd. See PDF spec 7.3.4.3\n var hex = this.value + (this.value.length % 2 === 1 ? '0' : '');\n var hexLength = hex.length;\n var bytes = new Uint8Array(hex.length / 2);\n var hexOffset = 0;\n var bytesOffset = 0;\n // Interpret each pair of hex digits as a single byte\n while (hexOffset < hexLength) {\n var byte = parseInt(hex.substring(hexOffset, hexOffset + 2), 16);\n bytes[bytesOffset] = byte;\n hexOffset += 2;\n bytesOffset += 1;\n }\n return bytes;\n };\n PDFHexString.prototype.decodeText = function () {\n var bytes = this.asBytes();\n if (hasUtf16BOM(bytes)) return utf16Decode(bytes);\n return pdfDocEncodingDecode(bytes);\n };\n PDFHexString.prototype.decodeDate = function () {\n var text = this.decodeText();\n var date = parseDate(text);\n if (!date) throw new InvalidPDFDateStringError(text);\n return date;\n };\n PDFHexString.prototype.asString = function () {\n return this.value;\n };\n PDFHexString.prototype.clone = function () {\n return PDFHexString.of(this.value);\n };\n PDFHexString.prototype.toString = function () {\n return \"<\" + this.value + \">\";\n };\n PDFHexString.prototype.sizeInBytes = function () {\n return this.value.length + 2;\n };\n PDFHexString.prototype.copyBytesInto = function (buffer, offset) {\n buffer[offset++] = CharCodes.LessThan;\n offset += copyStringIntoBuffer(this.value, buffer, offset);\n buffer[offset++] = CharCodes.GreaterThan;\n return this.value.length + 2;\n };\n PDFHexString.of = function (value) {\n return new PDFHexString(value);\n };\n PDFHexString.fromText = function (value) {\n var encoded = utf16Encode(value);\n var hex = '';\n for (var idx = 0, len = encoded.length; idx < len; idx++) {\n hex += toHexStringOfMinLength(encoded[idx], 4);\n }\n return new PDFHexString(hex);\n };\n return PDFHexString;\n}(PDFObject);\nexport default PDFHexString;","module.exports = __webpack_public_path__ + \"static/contract-package-3-d8068c3b1e0827addc0d2e6aa51928fd.pdf\";","\"use strict\";\n\nexports.__esModule = !0, exports.default = void 0;\nvar _base = _interopRequireDefault(require(\"@emotion/styled/base\")),\n _react = _interopRequireDefault(require(\"react\")),\n _propTypes = _interopRequireDefault(require(\"prop-types\")),\n _Option = _interopRequireDefault(require(\"./Option\")),\n _Input = _interopRequireDefault(require(\"./Input\")),\n _constants = require(\"../constants\"),\n _util = require(\"../util\"),\n _SelectPropsModel = _interopRequireDefault(require(\"../models/SelectPropsModel\")),\n _SelectMethodsModel = _interopRequireDefault(require(\"../models/SelectMethodsModel\")),\n _SelectStateModel = _interopRequireDefault(require(\"../models/SelectStateModel\"));\nfunction _interopRequireDefault(a) {\n return a && a.__esModule ? a : {\n default: a\n };\n}\nfunction _EMOTION_STRINGIFIED_CSS_ERROR__() {\n return \"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).\";\n}\nvar Content = function (a) {\n var b = a.props,\n c = a.state,\n d = a.methods;\n return /*#__PURE__*/_react.default.createElement(ContentComponent, {\n className: _constants.LIB_NAME + \"-content \" + (b.multi ? _constants.LIB_NAME + \"-type-multi\" : _constants.LIB_NAME + \"-type-single\"),\n onClick: function onClick(a) {\n return a.stopPropagation(), !0 === c.dropdown && b.closeOnClickInput && !c.search ? d.dropDown(\"close\") : d.dropDown(\"open\");\n }\n }, b.contentRenderer ? b.contentRenderer({\n props: b,\n state: c,\n methods: d\n }) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, b.multi ? c.values && c.values.map(function (a) {\n return /*#__PURE__*/_react.default.createElement(_Option.default, {\n key: \"\" + (0, _util.getByPath)(a, b.valueField) + (0, _util.getByPath)(a, b.labelField),\n item: a,\n state: c,\n props: b,\n methods: d\n });\n }) : c.values && 0 < c.values.length && /*#__PURE__*/_react.default.createElement(\"span\", null, (0, _util.getByPath)(c.values[0], b.labelField)), /*#__PURE__*/_react.default.createElement(_Input.default, {\n props: b,\n methods: d,\n state: c\n })));\n },\n ContentComponent = /*#__PURE__*/(0, _base.default)(\"div\", \"production\" === process.env.NODE_ENV ? {\n target: \"e1gn6jc30\"\n } : {\n target: \"e1gn6jc30\",\n label: \"ContentComponent\"\n })(\"production\" === process.env.NODE_ENV ? {\n name: \"1m5113o\",\n styles: \"display:flex;flex:1;flex-wrap:wrap\"\n } : {\n name: \"1m5113o\",\n styles: \"display:flex;flex:1;flex-wrap:wrap\",\n map: \"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL0NvbnRlbnQuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBdURtQyIsImZpbGUiOiIuLi8uLi9zcmMvY29tcG9uZW50cy9Db250ZW50LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0JztcbmltcG9ydCBzdHlsZWQgZnJvb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R1cm4gbWV0aG9kcy5kcm9wRG93bignb3BlbicpO1xuICAgICAgICB9XG4gICAgICB9fT5cbiAgICAgIHtwcm9wcy5jb250ZW50UmVuZGVyZXIgPyAoXG4gICAgICAgIHByb3BzLmNvbnRlbnRSZW5kZXJlcih7IHByb3BzLCBzdGF0ZSwgbWV0aG9kcyB9KVxuICAgICAgKSA6IChcbiAgICAgICAgPFJlYWN0LkZyYWdtZW50PlxuICAgICAgICAgIHtwcm9wcy5tdWx0aVxuICAgICAgICAgICAgPyBzdGF0ZS52YWx1ZXMgJiZcbiAgICAgICAgICAgICAgc3RhdGUudmFsdWVzLm1hcCgoaXRlbSkgPT4gKFxuICAgICAgICAgICAgICAgIDxPcHRpb25cbiAgICAgICAgICAgICAgICAgIGtleT17YCR7Z2V0QnlQYXRoKGl0ZW0sIHByb3BzLnZhbHVlRmllbGQpfSR7Z2V0QnlQYXRoKGl0ZW0sIHByb3BzLmxhYmVsRmllbGQpfWB9XG4gICAgICAgICAgICAgICAgICBpdGVtPXtpdGVtfVxuICAgICAgICAgICAgICAgICAgc3RhdGU9e3N0YXRlfVxuICAgICAgICAgICAgICAgICAgcHJvcHM9e3Byb3BzfVxuICAgICAgICAgICAgICAgICAgbWV0aG9kcz17bWV0aG9kc31cbiAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICApKVxuICAgICAgICAgICAgOiBzdGF0ZS52YWx1ZXMgJiZcbiAgICAgICAgICAgICAgc3RhdGUudmFsdWVzLmxlbmd0aCA+IDAgJiYgPHNwYW4+e2dldEJ5UGF0aChzdGF0ZS52YWx1ZXNbMF0sIHByb3BzLmxhYmVsRmllbGQpfTwvc3Bhbj59XG4gICAgICAgICAgPElucHV0IHByb3BzPXtwcm9wc30gbWV0aG9kcz17bWV0aG9kc30gc3RhdGU9e3N0YXRlfSAvPlxuICAgICAgICA8L1JlYWN0LkZyYWdtZW50PlxuICAgICAgKX1cbiAgICA8L0NvbnRlbnRDb21wb25lbnQ+XG4gICk7XG59O1xuXG5Db250ZW50LnByb3BUeXBlcyA9IHtcbiAgcHJvcHM6IFByb3BUeXBlcy5zaGFwZShTZWxlY3RQcm9wc01vZGVsKSxcbiAgc3RhdGU6IFByb3BUeXBlcy5zaGFwZShTZWxlY3RTdGF0ZU1vZGVsKSxcbiAgbWV0aG9kczogUHJvcFR5cGVzLnNoYXBlKFNlbGVjdE1ldGhvZHNNb2RlbCksXG59O1xuY29uc3QgQ29udGVudENvbXBvbmVudCA9IHN0eWxlZC5kaXZgXG4gIGRpc3BsYXk6IGZsZXg7XG4gIGZsZXg6IDE7XG4gIGZsZXgtd3JhcDogd3JhcDtcbmA7XG5cbmV4cG9ydCBkZWZhdWx0IENvbnRlbnQ7XG4iXX0= */\",\n toString: _EMOTION_STRINGIFIED_CSS_ERROR__\n }),\n _default = Content;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.resetState = resetState;\nexports.log = log;\nvar _portalOpenInstances = require(\"./portalOpenInstances\");\nvar _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances);\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\n// Body focus trap see Issue #742\n\nvar before = void 0,\n after = void 0,\n instances = [];\n\n/* eslint-disable no-console */\n/* istanbul ignore next */\nfunction resetState() {\n var _arr = [before, after];\n for (var _i = 0; _i < _arr.length; _i++) {\n var item = _arr[_i];\n if (!item) continue;\n item.parentNode && item.parentNode.removeChild(item);\n }\n before = after = null;\n instances = [];\n}\n\n/* istanbul ignore next */\nfunction log() {\n console.log(\"bodyTrap ----------\");\n console.log(instances.length);\n var _arr2 = [before, after];\n for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n var item = _arr2[_i2];\n var check = item || {};\n console.log(check.nodeName, check.className, check.id);\n }\n console.log(\"edn bodyTrap ----------\");\n}\n/* eslint-enable no-console */\n\nfunction focusContent() {\n if (instances.length === 0) {\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.warn(\"React-Modal: Open instances > 0 expected\");\n }\n return;\n }\n instances[instances.length - 1].focusContent();\n}\nfunction bodyTrap(eventType, openInstances) {\n if (!before && !after) {\n before = document.createElement(\"div\");\n before.setAttribute(\"data-react-modal-body-trap\", \"\");\n before.style.position = \"absolute\";\n before.style.opacity = \"0\";\n before.setAttribute(\"tabindex\", \"0\");\n before.addEventListener(\"focus\", focusContent);\n after = before.cloneNode();\n after.addEventListener(\"focus\", focusContent);\n }\n instances = openInstances;\n if (instances.length > 0) {\n // Add focus trap\n if (document.body.firstChild !== before) {\n document.body.insertBefore(before, document.body.firstChild);\n }\n if (document.body.lastChild !== after) {\n document.body.appendChild(after);\n }\n } else {\n // Remove focus trap\n if (before.parentElement) {\n before.parentElement.removeChild(before);\n }\n if (after.parentElement) {\n after.parentElement.removeChild(after);\n }\n }\n}\n_portalOpenInstances2.default.subscribe(bodyTrap);","\"use strict\";\n\nexports.__esModule = !0, exports.default = void 0;\nvar _base = _interopRequireDefault(require(\"@emotion/styled/base\")),\n _react = _interopRequireDefault(require(\"react\")),\n _constants = require(\"../constants\");\nfunction _interopRequireDefault(a) {\n return a && a.__esModule ? a : {\n default: a\n };\n}\nfunction _EMOTION_STRINGIFIED_CSS_ERROR__() {\n return \"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).\";\n}\nvar Separator = function (a) {\n var b = a.props,\n c = a.state,\n d = a.methods;\n return b.separatorRenderer ? b.separatorRenderer({\n props: b,\n state: c,\n methods: d\n }) : /*#__PURE__*/_react.default.createElement(SeparatorComponent, {\n className: _constants.LIB_NAME + \"-separator\"\n });\n },\n SeparatorComponent = /*#__PURE__*/(0, _base.default)(\"div\", \"production\" === process.env.NODE_ENV ? {\n target: \"e19h5j1v0\"\n } : {\n target: \"e19h5j1v0\",\n label: \"SeparatorComponent\"\n })(\"production\" === process.env.NODE_ENV ? {\n name: \"cmi1n0\",\n styles: \"border-left:1px solid #ccc;width:1px;height:25px;display:block\"\n } : {\n name: \"cmi1n0\",\n styles: \"border-left:1px solid #ccc;width:1px;height:25px;display:block\",\n map: \"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL1NlcGFyYXRvci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFXcUMiLCJmaWxlIjoiLi4vLi4vc3JjL2NvbXBvbmVudHMvU2VwYXJhdG9yLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0JztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IExJQl9OQU1FIH0gZnJvbSAnLi4vY29uc3RhbnRzJztcblxuY29uc3QgU2VwYXJhdG9yID0gKHsgcHJvcHMsIHN0YXRlLCBtZXRob2RzIH0pID0+XG4gIHByb3BzLnNlcGFyYXRvclJlbmRlcmVyID8gKFxuICAgIHByb3BzLnNlcGFyYXRvclJlbmRlcmVyKHsgcHJvcHMsIHN0YXRlLCBtZXRob2RzIH0pXG4gICkgOiAoXG4gICAgPFNlcGFyYXRvckNvbXBvbmVudCBjbGFzc05hbWU9e2Ake0xJQl9OQU1FfS1zZXBhcmF0b3JgfSAvPlxuICApO1xuXG5jb25zdCBTZXBhcmF0b3JDb21wb25lbnQgPSBzdHlsZWQuZGl2YFxuICBib3JkZXItbGVmdDogMXB4IHNvbGlkICNjY2M7XG4gIHdpZHRoOiAxcHg7XG4gIGhlaWdodDogMjVweDtcbiAgZGlzcGxheTogYmxvY2s7XG5gO1xuXG5leHBvcnQgZGVmYXVsdCBTZXBhcmF0b3I7XG4iXX0= */\",\n toString: _EMOTION_STRINGIFIED_CSS_ERROR__\n }),\n _default = Separator;\nexports.default = _default;","\"use strict\";\n\nexports.__esModule = !0, exports.default = void 0;\nvar _base = _interopRequireDefault(require(\"@emotion/styled/base\")),\n _react = _interopRequireDefault(require(\"react\")),\n _constants = require(\"../constants\");\nfunction _interopRequireDefault(a) {\n return a && a.__esModule ? a : {\n default: a\n };\n}\nvar DropdownHandle = function (a) {\n var b = a.props,\n c = a.state,\n d = a.methods;\n return /*#__PURE__*/_react.default.createElement(DropdownHandleComponent, {\n tabIndex: \"-1\",\n onClick: function onClick(a) {\n return d.dropDown(c.dropdown ? \"close\" : \"open\", a);\n },\n dropdownOpen: c.dropdown,\n onKeyPress: function onKeyPress(a) {\n return d.dropDown(\"toggle\", a);\n },\n onKeyDown: function onKeyDown(a) {\n return d.dropDown(\"toggle\", a);\n },\n className: _constants.LIB_NAME + \"-dropdown-handle\",\n rotate: b.dropdownHandleRenderer ? 0 : 1,\n color: b.color\n }, b.dropdownHandleRenderer ? b.dropdownHandleRenderer({\n props: b,\n state: c,\n methods: d\n }) : /*#__PURE__*/_react.default.createElement(\"svg\", {\n fill: \"currentColor\",\n viewBox: \"0 0 40 40\"\n }, /*#__PURE__*/_react.default.createElement(\"path\", {\n d: \"M31 26.4q0 .3-.2.5l-1.1 1.2q-.3.2-.6.2t-.5-.2l-8.7-8.8-8.8 8.8q-.2.2-.5.2t-.5-.2l-1.2-1.2q-.2-.2-.2-.5t.2-.5l10.4-10.4q.3-.2.6-.2t.5.2l10.4 10.4q.2.2.2.5z\"\n })));\n },\n DropdownHandleComponent = /*#__PURE__*/(0, _base.default)(\"div\", \"production\" === process.env.NODE_ENV ? {\n target: \"e1vudypg0\"\n } : {\n target: \"e1vudypg0\",\n label: \"DropdownHandleComponent\"\n })(\"text-align:center;\", function (a) {\n var b = a.dropdownOpen,\n c = a.rotate;\n return b ? \"\\n pointer-events: all;\\n \" + (c ? \"transform: rotate(0deg);margin: 0px 0 -3px 5px;\" : \"\") + \"\\n \" : \"\\n pointer-events: none;\\n \" + (c ? \"margin: 0 0 0 5px;transform: rotate(180deg);\" : \"\") + \"\\n \";\n }, \";cursor:pointer;svg{width:16px;height:16px;}:hover{path{stroke:\", function (a) {\n var b = a.color;\n return b;\n }, \";}}:focus{outline:none;path{stroke:\", function (a) {\n var b = a.color;\n return b;\n }, \";}}\" + (\"production\" === process.env.NODE_ENV ? \"\" : \"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL0Ryb3Bkb3duSGFuZGxlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXdCMEMiLCJmaWxlIjoiLi4vLi4vc3JjL2NvbXBvbmVudHMvRHJvcGRvd25IYW5kbGUuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IHsgTElCX05BTUUgfSBmcm9tICcuLi9jb25zdGFudHMnO1xuXG5jb25zdCBEcm9wZG93bkhhbmRsZSA9ICh7IHByb3BzLCBzdGF0ZSwgbWV0aG9kcyB9KSA9PiAoXG4gIDxEcm9wZG93bkhhbmRsZUNvbXBvbmVudFxuICAgIHRhYkluZGV4PVwiLTFcIlxuICAgIG9uQ2xpY2s9eyhldmVudCkgPT4gbWV0aG9kcy5kcm9wRG93bihzdGF0ZS5kcm9wZG93biA/ICdjbG9zZScgOiAnb3BlbicsIGV2ZW50KX1cbiAgICBkcm9wZG93bk9wZW49e3N0YXRlLmRyb3Bkb3dufVxuICAgIG9uS2V5UHJlc3M9eyhldmVudCkgPT4gbWV0aG9kcy5kcm9wRG93bigndG9nZ2xlJywgZXZlbnQpfVxuICAgIG9uS2V5RG93bj17KGV2ZW50KSA9PiBtZXRob2RzLmRyb3BEb3duKCd0b2dnbGUnLCBldmVudCl9XG4gICAgY2xhc3NOYW1lPXtgJHtMSUJfTkFNRX0tZHJvcGRvd24taGFuZGxlYH1cbiAgICBy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UoMTgwZGVnKTsnIDogJyd9XG4gICAgICBgfTtcbiAgY3Vyc29yOiBwb2ludGVyO1xuXG4gIHN2ZyB7XG4gICAgd2lkdGg6IDE2cHg7XG4gICAgaGVpZ2h0OiAxNnB4O1xuICB9XG5cbiAgOmhvdmVyIHtcbiAgICBwYXRoIHtcbiAgICAgIHN0cm9rZTogJHsoeyBjb2xvciB9KSA9PiBjb2xvcn07XG4gICAgfVxuICB9XG5cbiAgOmZvY3VzIHtcbiAgICBvdXRsaW5lOiBub25lO1xuXG4gICAgcGF0aCB7XG4gICAgICBzdHJva2U6ICR7KHsgY29sb3IgfSkgPT4gY29sb3J9O1xuICAgIH1cbiAgfVxuYDtcblxuZXhwb3J0IGRlZmF1bHQgRHJvcGRvd25IYW5kbGU7XG4iXX0= */\")),\n _default = DropdownHandle;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.resetState = resetState;\nexports.log = log;\nexports.assertNodeList = assertNodeList;\nexports.setElement = setElement;\nexports.validateElement = validateElement;\nexports.hide = hide;\nexports.show = show;\nexports.documentNotReadyOrSSRTesting = documentNotReadyOrSSRTesting;\nvar _warning = require(\"warning\");\nvar _warning2 = _interopRequireDefault(_warning);\nvar _safeHTMLElement = require(\"./safeHTMLElement\");\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nvar globalElement = null;\n\n/* eslint-disable no-console */\n/* istanbul ignore next */\nfunction resetState() {\n if (globalElement) {\n if (globalElement.removeAttribute) {\n globalElement.removeAttribute(\"aria-hidden\");\n } else if (globalElement.length != null) {\n globalElement.forEach(function (element) {\n return element.removeAttribute(\"aria-hidden\");\n });\n } else {\n document.querySelectorAll(globalElement).forEach(function (element) {\n return element.removeAttribute(\"aria-hidden\");\n });\n }\n }\n globalElement = null;\n}\n\n/* istanbul ignore next */\nfunction log() {\n if (process.env.NODE_ENV !== \"production\") {\n var check = globalElement || {};\n console.log(\"ariaAppHider ----------\");\n console.log(check.nodeName, check.className, check.id);\n console.log(\"end ariaAppHider ----------\");\n }\n}\n/* eslint-enable no-console */\n\nfunction assertNodeList(nodeList, selector) {\n if (!nodeList || !nodeList.length) {\n throw new Error(\"react-modal: No elements were found for selector \" + selector + \".\");\n }\n}\nfunction setElement(element) {\n var useElement = element;\n if (typeof useElement === \"string\" && _safeHTMLElement.canUseDOM) {\n var el = document.querySelectorAll(useElement);\n assertNodeList(el, useElement);\n useElement = el;\n }\n globalElement = useElement || globalElement;\n return globalElement;\n}\nfunction validateElement(appElement) {\n var el = appElement || globalElement;\n if (el) {\n return Array.isArray(el) || el instanceof HTMLCollection || el instanceof NodeList ? el : [el];\n } else {\n (0, _warning2.default)(false, [\"react-modal: App element is not defined.\", \"Please use `Modal.setAppElement(el)` or set `appElement={el}`.\", \"This is needed so screen readers don't see main content\", \"when modal is opened. It is not recommended, but you can opt-out\", \"by setting `ariaHideApp={false}`.\"].join(\" \"));\n return [];\n }\n}\nfunction hide(appElement) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n try {\n for (var _iterator = validateElement(appElement)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var el = _step.value;\n el.setAttribute(\"aria-hidden\", \"true\");\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}\nfunction show(appElement) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n try {\n for (var _iterator2 = validateElement(appElement)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var el = _step2.value;\n el.removeAttribute(\"aria-hidden\");\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n}\nfunction documentNotReadyOrSSRTesting() {\n globalElement = null;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = findTabbableDescendants;\n/*!\n * Adapted from jQuery UI core\n *\n * http://jqueryui.com\n *\n * Copyright 2014 jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n *\n * http://api.jqueryui.com/category/ui-core/\n */\n\nvar DISPLAY_NONE = \"none\";\nvar DISPLAY_CONTENTS = \"contents\";\nvar tabbableNode = /input|select|textarea|button|object|iframe/;\nfunction isNotOverflowing(element, style) {\n return style.getPropertyValue(\"overflow\") !== \"visible\" ||\n // if 'overflow: visible' set, check if there is actually any overflow\n element.scrollWidth <= 0 && element.scrollHeight <= 0;\n}\nfunction hidesContents(element) {\n var zeroSize = element.offsetWidth <= 0 && element.offsetHeight <= 0;\n\n // If the node is empty, this is good enough\n if (zeroSize && !element.innerHTML) return true;\n try {\n // Otherwise we need to check some styles\n var style = window.getComputedStyle(element);\n var displayValue = style.getPropertyValue(\"display\");\n return zeroSize ? displayValue !== DISPLAY_CONTENTS && isNotOverflowing(element, style) : displayValue === DISPLAY_NONE;\n } catch (exception) {\n // eslint-disable-next-line no-console\n console.warn(\"Failed to inspect element style\");\n return false;\n }\n}\nfunction visible(element) {\n var parentElement = element;\n var rootNode = element.getRootNode && element.getRootNode();\n while (parentElement) {\n if (parentElement === document.body) break;\n\n // if we are not hidden yet, skip to checking outside the Web Component\n if (rootNode && parentElement === rootNode) parentElement = rootNode.host.parentNode;\n if (hidesContents(parentElement)) return false;\n parentElement = parentElement.parentNode;\n }\n return true;\n}\nfunction focusable(element, isTabIndexNotNaN) {\n var nodeName = element.nodeName.toLowerCase();\n var res = tabbableNode.test(nodeName) && !element.disabled || (nodeName === \"a\" ? element.href || isTabIndexNotNaN : isTabIndexNotNaN);\n return res && visible(element);\n}\nfunction tabbable(element) {\n var tabIndex = element.getAttribute(\"tabindex\");\n if (tabIndex === null) tabIndex = undefined;\n var isTabIndexNaN = isNaN(tabIndex);\n return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN);\n}\nfunction findTabbableDescendants(element) {\n var descendants = [].slice.call(element.querySelectorAll(\"*\"), 0).reduce(function (finished, el) {\n return finished.concat(!el.shadowRoot ? [el] : findTabbableDescendants(el.shadowRoot));\n }, []);\n return descendants.filter(tabbable);\n}\nmodule.exports = exports[\"default\"];","module.exports = __webpack_public_path__ + \"static/credit-approval-ad5a15de6bba52e44e2c9442063a1edb.pdf\";","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\nvar utils = require('../utils/common');\nvar MAXBITS = 15;\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\nvar lbase = [/* Length codes 257..285 base */\n3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0];\nvar lext = [/* Length codes 257..285 extra */\n16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78];\nvar dbase = [/* Distance codes 0..29 base */\n1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0];\nvar dext = [/* Distance codes 0..29 extra */\n16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64];\nmodule.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) {\n var bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n var len = 0; /* a code's length in bits */\n var sym = 0; /* index of code symbols */\n var min = 0,\n max = 0; /* minimum and maximum code lengths */\n var root = 0; /* number of index bits for root table */\n var curr = 0; /* number of index bits for current table */\n var drop = 0; /* code bits to drop for sub-table */\n var left = 0; /* number of prefix codes available */\n var used = 0; /* code entries in table used */\n var huff = 0; /* Huffman code */\n var incr; /* for incrementing code, index */\n var fill; /* index for replicating entries */\n var low; /* low bits for current root entry */\n var mask; /* mask for low root bits */\n var next; /* next available space in table */\n var base = null; /* base value table to use */\n var base_index = 0;\n // var shoextra; /* extra bits table to use */\n var end; /* use base and extra for symbol > end */\n var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n var extra = null;\n var extra_index = 0;\n var here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) {\n break;\n }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) {\n /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = 1 << 24 | 64 << 16 | 0;\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = 1 << 24 | 64 << 16 | 0;\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) {\n break;\n }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES) {\n base = extra = work; /* dummy value--not used */\n end = 19;\n } else if (type === LENS) {\n base = lbase;\n base_index -= 257;\n extra = lext;\n extra_index -= 257;\n end = 256;\n } else {\n /* DISTS */\n base = dbase;\n extra = dext;\n end = -1;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] < end) {\n here_op = 0;\n here_val = work[sym];\n } else if (work[sym] > end) {\n here_op = extra[extra_index + work[sym]];\n here_val = base[base_index + work[sym]];\n } else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << len - drop;\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << len - 1;\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) {\n break;\n }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) {\n break;\n }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = root << 24 | curr << 16 | next - table_index | 0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = len - drop << 24 | 64 << 16 | 0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n};","import { assertIs, error } from \"../utils\";\nexport var RotationTypes;\n(function (RotationTypes) {\n RotationTypes[\"Degrees\"] = \"degrees\";\n RotationTypes[\"Radians\"] = \"radians\";\n})(RotationTypes || (RotationTypes = {}));\nexport var radians = function (radianAngle) {\n assertIs(radianAngle, 'radianAngle', ['number']);\n return {\n type: RotationTypes.Radians,\n angle: radianAngle\n };\n};\nexport var degrees = function (degreeAngle) {\n assertIs(degreeAngle, 'degreeAngle', ['number']);\n return {\n type: RotationTypes.Degrees,\n angle: degreeAngle\n };\n};\nvar Radians = RotationTypes.Radians,\n Degrees = RotationTypes.Degrees;\nexport var degreesToRadians = function (degree) {\n return degree * Math.PI / 180;\n};\nexport var radiansToDegrees = function (radian) {\n return radian * 180 / Math.PI;\n};\n// prettier-ignore\nexport var toRadians = function (rotation) {\n return rotation.type === Radians ? rotation.angle : rotation.type === Degrees ? degreesToRadians(rotation.angle) : error(\"Invalid rotation: \" + JSON.stringify(rotation));\n};\n// prettier-ignore\nexport var toDegrees = function (rotation) {\n return rotation.type === Radians ? radiansToDegrees(rotation.angle) : rotation.type === Degrees ? rotation.angle : error(\"Invalid rotation: \" + JSON.stringify(rotation));\n};\nexport var reduceRotation = function (degreeAngle) {\n if (degreeAngle === void 0) {\n degreeAngle = 0;\n }\n var quadrants = degreeAngle / 90 % 4;\n if (quadrants === 0) return 0;\n if (quadrants === 1) return 90;\n if (quadrants === 2) return 180;\n if (quadrants === 3) return 270;\n return 0; // `degreeAngle` is not a multiple of 90\n};\nexport var adjustDimsForRotation = function (dims, degreeAngle) {\n if (degreeAngle === void 0) {\n degreeAngle = 0;\n }\n var rotation = reduceRotation(degreeAngle);\n return rotation === 90 || rotation === 270 ? {\n width: dims.height,\n height: dims.width\n } : {\n width: dims.width,\n height: dims.height\n };\n};\nexport var rotateRectangle = function (rectangle, borderWidth, degreeAngle) {\n if (borderWidth === void 0) {\n borderWidth = 0;\n }\n if (degreeAngle === void 0) {\n degreeAngle = 0;\n }\n var x = rectangle.x,\n y = rectangle.y,\n w = rectangle.width,\n h = rectangle.height;\n var r = reduceRotation(degreeAngle);\n var b = borderWidth / 2;\n // prettier-ignore\n if (r === 0) return {\n x: x - b,\n y: y - b,\n width: w,\n height: h\n };else if (r === 90) return {\n x: x - h + b,\n y: y - b,\n width: h,\n height: w\n };else if (r === 180) return {\n x: x - w + b,\n y: y - h + b,\n width: w,\n height: h\n };else if (r === 270) return {\n x: x - b,\n y: y - w + b,\n width: h,\n height: w\n };else return {\n x: x - b,\n y: y - b,\n width: w,\n height: h\n };\n};","import { PDFName, PDFNumber } from \"../core\";\nexport var asPDFName = function (name) {\n return name instanceof PDFName ? name : PDFName.of(name);\n};\nexport var asPDFNumber = function (num) {\n return num instanceof PDFNumber ? num : PDFNumber.of(num);\n};\nexport var asNumber = function (num) {\n return num instanceof PDFNumber ? num.asNumber() : num;\n};","import { asNumber, asPDFName, asPDFNumber } from \"./objects\";\nimport { degreesToRadians } from \"./rotations\";\nimport { PDFOperator, PDFOperatorNames as Ops } from \"../core\";\n/* ==================== Clipping Path Operators ==================== */\nexport var clip = function () {\n return PDFOperator.of(Ops.ClipNonZero);\n};\nexport var clipEvenOdd = function () {\n return PDFOperator.of(Ops.ClipEvenOdd);\n};\n/* ==================== Graphics State Operators ==================== */\nvar cos = Math.cos,\n sin = Math.sin,\n tan = Math.tan;\nexport var concatTransformationMatrix = function (a, b, c, d, e, f) {\n return PDFOperator.of(Ops.ConcatTransformationMatrix, [asPDFNumber(a), asPDFNumber(b), asPDFNumber(c), asPDFNumber(d), asPDFNumber(e), asPDFNumber(f)]);\n};\nexport var translate = function (xPos, yPos) {\n return concatTransformationMatrix(1, 0, 0, 1, xPos, yPos);\n};\nexport var scale = function (xPos, yPos) {\n return concatTransformationMatrix(xPos, 0, 0, yPos, 0, 0);\n};\nexport var rotateRadians = function (angle) {\n return concatTransformationMatrix(cos(asNumber(angle)), sin(asNumber(angle)), -sin(asNumber(angle)), cos(asNumber(angle)), 0, 0);\n};\nexport var rotateDegrees = function (angle) {\n return rotateRadians(degreesToRadians(asNumber(angle)));\n};\nexport var skewRadians = function (xSkewAngle, ySkewAngle) {\n return concatTransformationMatrix(1, tan(asNumber(xSkewAngle)), tan(asNumber(ySkewAngle)), 1, 0, 0);\n};\nexport var skewDegrees = function (xSkewAngle, ySkewAngle) {\n return skewRadians(degreesToRadians(asNumber(xSkewAngle)), degreesToRadians(asNumber(ySkewAngle)));\n};\nexport var setDashPattern = function (dashArray, dashPhase) {\n return PDFOperator.of(Ops.SetLineDashPattern, [\"[\" + dashArray.map(asPDFNumber).join(' ') + \"]\", asPDFNumber(dashPhase)]);\n};\nexport var restoreDashPattern = function () {\n return setDashPattern([], 0);\n};\nexport var LineCapStyle;\n(function (LineCapStyle) {\n LineCapStyle[LineCapStyle[\"Butt\"] = 0] = \"Butt\";\n LineCapStyle[LineCapStyle[\"Round\"] = 1] = \"Round\";\n LineCapStyle[LineCapStyle[\"Projecting\"] = 2] = \"Projecting\";\n})(LineCapStyle || (LineCapStyle = {}));\nexport var setLineCap = function (style) {\n return PDFOperator.of(Ops.SetLineCapStyle, [asPDFNumber(style)]);\n};\nexport var LineJoinStyle;\n(function (LineJoinStyle) {\n LineJoinStyle[LineJoinStyle[\"Miter\"] = 0] = \"Miter\";\n LineJoinStyle[LineJoinStyle[\"Round\"] = 1] = \"Round\";\n LineJoinStyle[LineJoinStyle[\"Bevel\"] = 2] = \"Bevel\";\n})(LineJoinStyle || (LineJoinStyle = {}));\nexport var setLineJoin = function (style) {\n return PDFOperator.of(Ops.SetLineJoinStyle, [asPDFNumber(style)]);\n};\nexport var setGraphicsState = function (state) {\n return PDFOperator.of(Ops.SetGraphicsStateParams, [asPDFName(state)]);\n};\nexport var pushGraphicsState = function () {\n return PDFOperator.of(Ops.PushGraphicsState);\n};\nexport var popGraphicsState = function () {\n return PDFOperator.of(Ops.PopGraphicsState);\n};\nexport var setLineWidth = function (width) {\n return PDFOperator.of(Ops.SetLineWidth, [asPDFNumber(width)]);\n};\n/* ==================== Path Construction Operators ==================== */\nexport var appendBezierCurve = function (x1, y1, x2, y2, x3, y3) {\n return PDFOperator.of(Ops.AppendBezierCurve, [asPDFNumber(x1), asPDFNumber(y1), asPDFNumber(x2), asPDFNumber(y2), asPDFNumber(x3), asPDFNumber(y3)]);\n};\nexport var appendQuadraticCurve = function (x1, y1, x2, y2) {\n return PDFOperator.of(Ops.CurveToReplicateInitialPoint, [asPDFNumber(x1), asPDFNumber(y1), asPDFNumber(x2), asPDFNumber(y2)]);\n};\nexport var closePath = function () {\n return PDFOperator.of(Ops.ClosePath);\n};\nexport var moveTo = function (xPos, yPos) {\n return PDFOperator.of(Ops.MoveTo, [asPDFNumber(xPos), asPDFNumber(yPos)]);\n};\nexport var lineTo = function (xPos, yPos) {\n return PDFOperator.of(Ops.LineTo, [asPDFNumber(xPos), asPDFNumber(yPos)]);\n};\n/**\n * @param xPos x coordinate for the lower left corner of the rectangle\n * @param yPos y coordinate for the lower left corner of the rectangle\n * @param width width of the rectangle\n * @param height height of the rectangle\n */\nexport var rectangle = function (xPos, yPos, width, height) {\n return PDFOperator.of(Ops.AppendRectangle, [asPDFNumber(xPos), asPDFNumber(yPos), asPDFNumber(width), asPDFNumber(height)]);\n};\n/**\n * @param xPos x coordinate for the lower left corner of the square\n * @param yPos y coordinate for the lower left corner of the square\n * @param size width and height of the square\n */\nexport var square = function (xPos, yPos, size) {\n return rectangle(xPos, yPos, size, size);\n};\n/* ==================== Path Painting Operators ==================== */\nexport var stroke = function () {\n return PDFOperator.of(Ops.StrokePath);\n};\nexport var fill = function () {\n return PDFOperator.of(Ops.FillNonZero);\n};\nexport var fillAndStroke = function () {\n return PDFOperator.of(Ops.FillNonZeroAndStroke);\n};\nexport var endPath = function () {\n return PDFOperator.of(Ops.EndPath);\n};\n/* ==================== Text Positioning Operators ==================== */\nexport var nextLine = function () {\n return PDFOperator.of(Ops.NextLine);\n};\nexport var moveText = function (x, y) {\n return PDFOperator.of(Ops.MoveText, [asPDFNumber(x), asPDFNumber(y)]);\n};\n/* ==================== Text Showing Operators ==================== */\nexport var showText = function (text) {\n return PDFOperator.of(Ops.ShowText, [text]);\n};\n/* ==================== Text State Operators ==================== */\nexport var beginText = function () {\n return PDFOperator.of(Ops.BeginText);\n};\nexport var endText = function () {\n return PDFOperator.of(Ops.EndText);\n};\nexport var setFontAndSize = function (name, size) {\n return PDFOperator.of(Ops.SetFontAndSize, [asPDFName(name), asPDFNumber(size)]);\n};\nexport var setCharacterSpacing = function (spacing) {\n return PDFOperator.of(Ops.SetCharacterSpacing, [asPDFNumber(spacing)]);\n};\nexport var setWordSpacing = function (spacing) {\n return PDFOperator.of(Ops.SetWordSpacing, [asPDFNumber(spacing)]);\n};\n/** @param squeeze horizontal character spacing */\nexport var setCharacterSqueeze = function (squeeze) {\n return PDFOperator.of(Ops.SetTextHorizontalScaling, [asPDFNumber(squeeze)]);\n};\nexport var setLineHeight = function (lineHeight) {\n return PDFOperator.of(Ops.SetTextLineHeight, [asPDFNumber(lineHeight)]);\n};\nexport var setTextRise = function (rise) {\n return PDFOperator.of(Ops.SetTextRise, [asPDFNumber(rise)]);\n};\nexport var TextRenderingMode;\n(function (TextRenderingMode) {\n TextRenderingMode[TextRenderingMode[\"Fill\"] = 0] = \"Fill\";\n TextRenderingMode[TextRenderingMode[\"Outline\"] = 1] = \"Outline\";\n TextRenderingMode[TextRenderingMode[\"FillAndOutline\"] = 2] = \"FillAndOutline\";\n TextRenderingMode[TextRenderingMode[\"Invisible\"] = 3] = \"Invisible\";\n TextRenderingMode[TextRenderingMode[\"FillAndClip\"] = 4] = \"FillAndClip\";\n TextRenderingMode[TextRenderingMode[\"OutlineAndClip\"] = 5] = \"OutlineAndClip\";\n TextRenderingMode[TextRenderingMode[\"FillAndOutlineAndClip\"] = 6] = \"FillAndOutlineAndClip\";\n TextRenderingMode[TextRenderingMode[\"Clip\"] = 7] = \"Clip\";\n})(TextRenderingMode || (TextRenderingMode = {}));\nexport var setTextRenderingMode = function (mode) {\n return PDFOperator.of(Ops.SetTextRenderingMode, [asPDFNumber(mode)]);\n};\nexport var setTextMatrix = function (a, b, c, d, e, f) {\n return PDFOperator.of(Ops.SetTextMatrix, [asPDFNumber(a), asPDFNumber(b), asPDFNumber(c), asPDFNumber(d), asPDFNumber(e), asPDFNumber(f)]);\n};\nexport var rotateAndSkewTextRadiansAndTranslate = function (rotationAngle, xSkewAngle, ySkewAngle, x, y) {\n return setTextMatrix(cos(asNumber(rotationAngle)), sin(asNumber(rotationAngle)) + tan(asNumber(xSkewAngle)), -sin(asNumber(rotationAngle)) + tan(asNumber(ySkewAngle)), cos(asNumber(rotationAngle)), x, y);\n};\nexport var rotateAndSkewTextDegreesAndTranslate = function (rotationAngle, xSkewAngle, ySkewAngle, x, y) {\n return rotateAndSkewTextRadiansAndTranslate(degreesToRadians(asNumber(rotationAngle)), degreesToRadians(asNumber(xSkewAngle)), degreesToRadians(asNumber(ySkewAngle)), x, y);\n};\n/* ==================== XObject Operator ==================== */\nexport var drawObject = function (name) {\n return PDFOperator.of(Ops.DrawObject, [asPDFName(name)]);\n};\n/* ==================== Color Operators ==================== */\nexport var setFillingGrayscaleColor = function (gray) {\n return PDFOperator.of(Ops.NonStrokingColorGray, [asPDFNumber(gray)]);\n};\nexport var setStrokingGrayscaleColor = function (gray) {\n return PDFOperator.of(Ops.StrokingColorGray, [asPDFNumber(gray)]);\n};\nexport var setFillingRgbColor = function (red, green, blue) {\n return PDFOperator.of(Ops.NonStrokingColorRgb, [asPDFNumber(red), asPDFNumber(green), asPDFNumber(blue)]);\n};\nexport var setStrokingRgbColor = function (red, green, blue) {\n return PDFOperator.of(Ops.StrokingColorRgb, [asPDFNumber(red), asPDFNumber(green), asPDFNumber(blue)]);\n};\nexport var setFillingCmykColor = function (cyan, magenta, yellow, key) {\n return PDFOperator.of(Ops.NonStrokingColorCmyk, [asPDFNumber(cyan), asPDFNumber(magenta), asPDFNumber(yellow), asPDFNumber(key)]);\n};\nexport var setStrokingCmykColor = function (cyan, magenta, yellow, key) {\n return PDFOperator.of(Ops.StrokingColorCmyk, [asPDFNumber(cyan), asPDFNumber(magenta), asPDFNumber(yellow), asPDFNumber(key)]);\n};\n/* ==================== Marked Content Operators ==================== */\nexport var beginMarkedContent = function (tag) {\n return PDFOperator.of(Ops.BeginMarkedContent, [asPDFName(tag)]);\n};\nexport var endMarkedContent = function () {\n return PDFOperator.of(Ops.EndMarkedContent);\n};","import { setFillingCmykColor, setFillingGrayscaleColor, setFillingRgbColor, setStrokingCmykColor, setStrokingGrayscaleColor, setStrokingRgbColor } from \"./operators\";\nimport { assertRange, error } from \"../utils\";\nexport var ColorTypes;\n(function (ColorTypes) {\n ColorTypes[\"Grayscale\"] = \"Grayscale\";\n ColorTypes[\"RGB\"] = \"RGB\";\n ColorTypes[\"CMYK\"] = \"CMYK\";\n})(ColorTypes || (ColorTypes = {}));\nexport var grayscale = function (gray) {\n assertRange(gray, 'gray', 0.0, 1.0);\n return {\n type: ColorTypes.Grayscale,\n gray: gray\n };\n};\nexport var rgb = function (red, green, blue) {\n assertRange(red, 'red', 0, 1);\n assertRange(green, 'green', 0, 1);\n assertRange(blue, 'blue', 0, 1);\n return {\n type: ColorTypes.RGB,\n red: red,\n green: green,\n blue: blue\n };\n};\nexport var cmyk = function (cyan, magenta, yellow, key) {\n assertRange(cyan, 'cyan', 0, 1);\n assertRange(magenta, 'magenta', 0, 1);\n assertRange(yellow, 'yellow', 0, 1);\n assertRange(key, 'key', 0, 1);\n return {\n type: ColorTypes.CMYK,\n cyan: cyan,\n magenta: magenta,\n yellow: yellow,\n key: key\n };\n};\nvar Grayscale = ColorTypes.Grayscale,\n RGB = ColorTypes.RGB,\n CMYK = ColorTypes.CMYK;\n// prettier-ignore\nexport var setFillingColor = function (color) {\n return color.type === Grayscale ? setFillingGrayscaleColor(color.gray) : color.type === RGB ? setFillingRgbColor(color.red, color.green, color.blue) : color.type === CMYK ? setFillingCmykColor(color.cyan, color.magenta, color.yellow, color.key) : error(\"Invalid color: \" + JSON.stringify(color));\n};\n// prettier-ignore\nexport var setStrokingColor = function (color) {\n return color.type === Grayscale ? setStrokingGrayscaleColor(color.gray) : color.type === RGB ? setStrokingRgbColor(color.red, color.green, color.blue) : color.type === CMYK ? setStrokingCmykColor(color.cyan, color.magenta, color.yellow, color.key) : error(\"Invalid color: \" + JSON.stringify(color));\n};\n// prettier-ignore\nexport var componentsToColor = function (comps, scale) {\n if (scale === void 0) {\n scale = 1;\n }\n return (comps === null || comps === void 0 ? void 0 : comps.length) === 1 ? grayscale(comps[0] * scale) : (comps === null || comps === void 0 ? void 0 : comps.length) === 3 ? rgb(comps[0] * scale, comps[1] * scale, comps[2] * scale) : (comps === null || comps === void 0 ? void 0 : comps.length) === 4 ? cmyk(comps[0] * scale, comps[1] * scale, comps[2] * scale, comps[3] * scale) : undefined;\n};\n// prettier-ignore\nexport var colorToComponents = function (color) {\n return color.type === Grayscale ? [color.gray] : color.type === RGB ? [color.red, color.green, color.blue] : color.type === CMYK ? [color.cyan, color.magenta, color.yellow, color.key] : error(\"Invalid color: \" + JSON.stringify(color));\n};","export var TextAlignment;\n(function (TextAlignment) {\n TextAlignment[TextAlignment[\"Left\"] = 0] = \"Left\";\n TextAlignment[TextAlignment[\"Center\"] = 1] = \"Center\";\n TextAlignment[TextAlignment[\"Right\"] = 2] = \"Right\";\n})(TextAlignment || (TextAlignment = {}));","// Originated from pdfkit Copyright (c) 2014 Devon Govett\n// https://github.com/foliojs/pdfkit/blob/1e62e6ffe24b378eb890df507a47610f4c4a7b24/lib/path.js\n// MIT LICENSE\n// Updated for pdf-lib & TypeScript by Jeremy Messenger\nimport { appendBezierCurve, appendQuadraticCurve, closePath, lineTo, moveTo } from \"./operators\";\nvar cx = 0;\nvar cy = 0;\nvar px = 0;\nvar py = 0;\nvar sx = 0;\nvar sy = 0;\nvar parameters = new Map([['A', 7], ['a', 7], ['C', 6], ['c', 6], ['H', 1], ['h', 1], ['L', 2], ['l', 2], ['M', 2], ['m', 2], ['Q', 4], ['q', 4], ['S', 4], ['s', 4], ['T', 2], ['t', 2], ['V', 1], ['v', 1], ['Z', 0], ['z', 0]]);\nvar parse = function (path) {\n var cmd;\n var ret = [];\n var args = [];\n var curArg = '';\n var foundDecimal = false;\n var params = 0;\n for (var _i = 0, path_1 = path; _i < path_1.length; _i++) {\n var c = path_1[_i];\n if (parameters.has(c)) {\n params = parameters.get(c);\n if (cmd) {\n // save existing command\n if (curArg.length > 0) {\n args[args.length] = +curArg;\n }\n ret[ret.length] = {\n cmd: cmd,\n args: args\n };\n args = [];\n curArg = '';\n foundDecimal = false;\n }\n cmd = c;\n } else if ([' ', ','].includes(c) || c === '-' && curArg.length > 0 && curArg[curArg.length - 1] !== 'e' || c === '.' && foundDecimal) {\n if (curArg.length === 0) {\n continue;\n }\n if (args.length === params) {\n // handle reused commands\n ret[ret.length] = {\n cmd: cmd,\n args: args\n };\n args = [+curArg];\n // handle assumed commands\n if (cmd === 'M') {\n cmd = 'L';\n }\n if (cmd === 'm') {\n cmd = 'l';\n }\n } else {\n args[args.length] = +curArg;\n }\n foundDecimal = c === '.';\n // fix for negative numbers or repeated decimals with no delimeter between commands\n curArg = ['-', '.'].includes(c) ? c : '';\n } else {\n curArg += c;\n if (c === '.') {\n foundDecimal = true;\n }\n }\n }\n // add the last command\n if (curArg.length > 0) {\n if (args.length === params) {\n // handle reused commands\n ret[ret.length] = {\n cmd: cmd,\n args: args\n };\n args = [+curArg];\n // handle assumed commands\n if (cmd === 'M') {\n cmd = 'L';\n }\n if (cmd === 'm') {\n cmd = 'l';\n }\n } else {\n args[args.length] = +curArg;\n }\n }\n ret[ret.length] = {\n cmd: cmd,\n args: args\n };\n return ret;\n};\nvar apply = function (commands) {\n // current point, control point, and subpath starting point\n cx = cy = px = py = sx = sy = 0;\n // run the commands\n var cmds = [];\n for (var i = 0; i < commands.length; i++) {\n var c = commands[i];\n if (c.cmd && typeof runners[c.cmd] === 'function') {\n var cmd = runners[c.cmd](c.args);\n if (Array.isArray(cmd)) {\n cmds = cmds.concat(cmd);\n } else {\n cmds.push(cmd);\n }\n }\n }\n return cmds;\n};\nvar runners = {\n M: function (a) {\n cx = a[0];\n cy = a[1];\n px = py = null;\n sx = cx;\n sy = cy;\n return moveTo(cx, cy);\n },\n m: function (a) {\n cx += a[0];\n cy += a[1];\n px = py = null;\n sx = cx;\n sy = cy;\n return moveTo(cx, cy);\n },\n C: function (a) {\n cx = a[4];\n cy = a[5];\n px = a[2];\n py = a[3];\n return appendBezierCurve(a[0], a[1], a[2], a[3], a[4], a[5]);\n },\n c: function (a) {\n var cmd = appendBezierCurve(a[0] + cx, a[1] + cy, a[2] + cx, a[3] + cy, a[4] + cx, a[5] + cy);\n px = cx + a[2];\n py = cy + a[3];\n cx += a[4];\n cy += a[5];\n return cmd;\n },\n S: function (a) {\n if (px === null || py === null) {\n px = cx;\n py = cy;\n }\n var cmd = appendBezierCurve(cx - (px - cx), cy - (py - cy), a[0], a[1], a[2], a[3]);\n px = a[0];\n py = a[1];\n cx = a[2];\n cy = a[3];\n return cmd;\n },\n s: function (a) {\n if (px === null || py === null) {\n px = cx;\n py = cy;\n }\n var cmd = appendBezierCurve(cx - (px - cx), cy - (py - cy), cx + a[0], cy + a[1], cx + a[2], cy + a[3]);\n px = cx + a[0];\n py = cy + a[1];\n cx += a[2];\n cy += a[3];\n return cmd;\n },\n Q: function (a) {\n px = a[0];\n py = a[1];\n cx = a[2];\n cy = a[3];\n return appendQuadraticCurve(a[0], a[1], cx, cy);\n },\n q: function (a) {\n var cmd = appendQuadraticCurve(a[0] + cx, a[1] + cy, a[2] + cx, a[3] + cy);\n px = cx + a[0];\n py = cy + a[1];\n cx += a[2];\n cy += a[3];\n return cmd;\n },\n T: function (a) {\n if (px === null || py === null) {\n px = cx;\n py = cy;\n } else {\n px = cx - (px - cx);\n py = cy - (py - cy);\n }\n var cmd = appendQuadraticCurve(px, py, a[0], a[1]);\n px = cx - (px - cx);\n py = cy - (py - cy);\n cx = a[0];\n cy = a[1];\n return cmd;\n },\n t: function (a) {\n if (px === null || py === null) {\n px = cx;\n py = cy;\n } else {\n px = cx - (px - cx);\n py = cy - (py - cy);\n }\n var cmd = appendQuadraticCurve(px, py, cx + a[0], cy + a[1]);\n cx += a[0];\n cy += a[1];\n return cmd;\n },\n A: function (a) {\n var cmds = solveArc(cx, cy, a);\n cx = a[5];\n cy = a[6];\n return cmds;\n },\n a: function (a) {\n a[5] += cx;\n a[6] += cy;\n var cmds = solveArc(cx, cy, a);\n cx = a[5];\n cy = a[6];\n return cmds;\n },\n L: function (a) {\n cx = a[0];\n cy = a[1];\n px = py = null;\n return lineTo(cx, cy);\n },\n l: function (a) {\n cx += a[0];\n cy += a[1];\n px = py = null;\n return lineTo(cx, cy);\n },\n H: function (a) {\n cx = a[0];\n px = py = null;\n return lineTo(cx, cy);\n },\n h: function (a) {\n cx += a[0];\n px = py = null;\n return lineTo(cx, cy);\n },\n V: function (a) {\n cy = a[0];\n px = py = null;\n return lineTo(cx, cy);\n },\n v: function (a) {\n cy += a[0];\n px = py = null;\n return lineTo(cx, cy);\n },\n Z: function () {\n var cmd = closePath();\n cx = sx;\n cy = sy;\n return cmd;\n },\n z: function () {\n var cmd = closePath();\n cx = sx;\n cy = sy;\n return cmd;\n }\n};\nvar solveArc = function (x, y, coords) {\n var rx = coords[0],\n ry = coords[1],\n rot = coords[2],\n large = coords[3],\n sweep = coords[4],\n ex = coords[5],\n ey = coords[6];\n var segs = arcToSegments(ex, ey, rx, ry, large, sweep, rot, x, y);\n var cmds = [];\n for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {\n var seg = segs_1[_i];\n var bez = segmentToBezier.apply(void 0, seg);\n cmds.push(appendBezierCurve.apply(void 0, bez));\n }\n return cmds;\n};\n// from Inkscape svgtopdf, thanks!\nvar arcToSegments = function (x, y, rx, ry, large, sweep, rotateX, ox, oy) {\n var th = rotateX * (Math.PI / 180);\n var sinTh = Math.sin(th);\n var cosTh = Math.cos(th);\n rx = Math.abs(rx);\n ry = Math.abs(ry);\n px = cosTh * (ox - x) * 0.5 + sinTh * (oy - y) * 0.5;\n py = cosTh * (oy - y) * 0.5 - sinTh * (ox - x) * 0.5;\n var pl = px * px / (rx * rx) + py * py / (ry * ry);\n if (pl > 1) {\n pl = Math.sqrt(pl);\n rx *= pl;\n ry *= pl;\n }\n var a00 = cosTh / rx;\n var a01 = sinTh / rx;\n var a10 = -sinTh / ry;\n var a11 = cosTh / ry;\n var x0 = a00 * ox + a01 * oy;\n var y0 = a10 * ox + a11 * oy;\n var x1 = a00 * x + a01 * y;\n var y1 = a10 * x + a11 * y;\n var d = (x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0);\n var sfactorSq = 1 / d - 0.25;\n if (sfactorSq < 0) {\n sfactorSq = 0;\n }\n var sfactor = Math.sqrt(sfactorSq);\n if (sweep === large) {\n sfactor = -sfactor;\n }\n var xc = 0.5 * (x0 + x1) - sfactor * (y1 - y0);\n var yc = 0.5 * (y0 + y1) + sfactor * (x1 - x0);\n var th0 = Math.atan2(y0 - yc, x0 - xc);\n var th1 = Math.atan2(y1 - yc, x1 - xc);\n var thArc = th1 - th0;\n if (thArc < 0 && sweep === 1) {\n thArc += 2 * Math.PI;\n } else if (thArc > 0 && sweep === 0) {\n thArc -= 2 * Math.PI;\n }\n var segments = Math.ceil(Math.abs(thArc / (Math.PI * 0.5 + 0.001)));\n var result = [];\n for (var i = 0; i < segments; i++) {\n var th2 = th0 + i * thArc / segments;\n var th3 = th0 + (i + 1) * thArc / segments;\n result[i] = [xc, yc, th2, th3, rx, ry, sinTh, cosTh];\n }\n return result;\n};\nvar segmentToBezier = function (cx1, cy1, th0, th1, rx, ry, sinTh, cosTh) {\n var a00 = cosTh * rx;\n var a01 = -sinTh * ry;\n var a10 = sinTh * rx;\n var a11 = cosTh * ry;\n var thHalf = 0.5 * (th1 - th0);\n var t = 8 / 3 * Math.sin(thHalf * 0.5) * Math.sin(thHalf * 0.5) / Math.sin(thHalf);\n var x1 = cx1 + Math.cos(th0) - t * Math.sin(th0);\n var y1 = cy1 + Math.sin(th0) + t * Math.cos(th0);\n var x3 = cx1 + Math.cos(th1);\n var y3 = cy1 + Math.sin(th1);\n var x2 = x3 + t * Math.sin(th1);\n var y2 = y3 - t * Math.cos(th1);\n var result = [a00 * x1 + a01 * y1, a10 * x1 + a11 * y1, a00 * x2 + a01 * y2, a10 * x2 + a11 * y2, a00 * x3 + a01 * y3, a10 * x3 + a11 * y3];\n return result;\n};\nexport var svgPathToOperators = function (path) {\n return apply(parse(path));\n};","import { __spreadArrays } from \"tslib\";\nimport { setFillingColor, setStrokingColor } from \"./colors\";\nimport { beginText, closePath, drawObject, endText, fill, fillAndStroke, lineTo, moveTo, nextLine, popGraphicsState, pushGraphicsState, rotateAndSkewTextRadiansAndTranslate, rotateRadians, scale, setFontAndSize, setLineHeight, setLineWidth, showText, skewRadians, stroke, translate, setLineCap, rotateDegrees, setGraphicsState, setDashPattern, beginMarkedContent, endMarkedContent, clip, endPath, appendBezierCurve } from \"./operators\";\nimport { degrees, toRadians } from \"./rotations\";\nimport { svgPathToOperators } from \"./svgPath\";\nimport { asNumber } from \"./objects\";\nexport var drawText = function (line, options) {\n return [pushGraphicsState(), options.graphicsState && setGraphicsState(options.graphicsState), beginText(), setFillingColor(options.color), setFontAndSize(options.font, options.size), rotateAndSkewTextRadiansAndTranslate(toRadians(options.rotate), toRadians(options.xSkew), toRadians(options.ySkew), options.x, options.y), showText(line), endText(), popGraphicsState()].filter(Boolean);\n};\nexport var drawLinesOfText = function (lines, options) {\n var operators = [pushGraphicsState(), options.graphicsState && setGraphicsState(options.graphicsState), beginText(), setFillingColor(options.color), setFontAndSize(options.font, options.size), setLineHeight(options.lineHeight), rotateAndSkewTextRadiansAndTranslate(toRadians(options.rotate), toRadians(options.xSkew), toRadians(options.ySkew), options.x, options.y)].filter(Boolean);\n for (var idx = 0, len = lines.length; idx < len; idx++) {\n operators.push(showText(lines[idx]), nextLine());\n }\n operators.push(endText(), popGraphicsState());\n return operators;\n};\nexport var drawImage = function (name, options) {\n return [pushGraphicsState(), options.graphicsState && setGraphicsState(options.graphicsState), translate(options.x, options.y), rotateRadians(toRadians(options.rotate)), scale(options.width, options.height), skewRadians(toRadians(options.xSkew), toRadians(options.ySkew)), drawObject(name), popGraphicsState()].filter(Boolean);\n};\nexport var drawPage = function (name, options) {\n return [pushGraphicsState(), options.graphicsState && setGraphicsState(options.graphicsState), translate(options.x, options.y), rotateRadians(toRadians(options.rotate)), scale(options.xScale, options.yScale), skewRadians(toRadians(options.xSkew), toRadians(options.ySkew)), drawObject(name), popGraphicsState()].filter(Boolean);\n};\nexport var drawLine = function (options) {\n var _a, _b;\n return [pushGraphicsState(), options.graphicsState && setGraphicsState(options.graphicsState), options.color && setStrokingColor(options.color), setLineWidth(options.thickness), setDashPattern((_a = options.dashArray) !== null && _a !== void 0 ? _a : [], (_b = options.dashPhase) !== null && _b !== void 0 ? _b : 0), moveTo(options.start.x, options.start.y), options.lineCap && setLineCap(options.lineCap), moveTo(options.start.x, options.start.y), lineTo(options.end.x, options.end.y), stroke(), popGraphicsState()].filter(Boolean);\n};\nexport var drawRectangle = function (options) {\n var _a, _b;\n return [pushGraphicsState(), options.graphicsState && setGraphicsState(options.graphicsState), options.color && setFillingColor(options.color), options.borderColor && setStrokingColor(options.borderColor), setLineWidth(options.borderWidth), options.borderLineCap && setLineCap(options.borderLineCap), setDashPattern((_a = options.borderDashArray) !== null && _a !== void 0 ? _a : [], (_b = options.borderDashPhase) !== null && _b !== void 0 ? _b : 0), translate(options.x, options.y), rotateRadians(toRadians(options.rotate)), skewRadians(toRadians(options.xSkew), toRadians(options.ySkew)), moveTo(0, 0), lineTo(0, options.height), lineTo(options.width, options.height), lineTo(options.width, 0), closePath(),\n // prettier-ignore\n options.color && options.borderWidth ? fillAndStroke() : options.color ? fill() : options.borderColor ? stroke() : closePath(), popGraphicsState()].filter(Boolean);\n};\nvar KAPPA = 4.0 * ((Math.sqrt(2) - 1.0) / 3.0);\n/** @deprecated */\nexport var drawEllipsePath = function (config) {\n var x = asNumber(config.x);\n var y = asNumber(config.y);\n var xScale = asNumber(config.xScale);\n var yScale = asNumber(config.yScale);\n x -= xScale;\n y -= yScale;\n var ox = xScale * KAPPA;\n var oy = yScale * KAPPA;\n var xe = x + xScale * 2;\n var ye = y + yScale * 2;\n var xm = x + xScale;\n var ym = y + yScale;\n return [pushGraphicsState(), moveTo(x, ym), appendBezierCurve(x, ym - oy, xm - ox, y, xm, y), appendBezierCurve(xm + ox, y, xe, ym - oy, xe, ym), appendBezierCurve(xe, ym + oy, xm + ox, ye, xm, ye), appendBezierCurve(xm - ox, ye, x, ym + oy, x, ym), popGraphicsState()];\n};\nvar drawEllipseCurves = function (config) {\n var centerX = asNumber(config.x);\n var centerY = asNumber(config.y);\n var xScale = asNumber(config.xScale);\n var yScale = asNumber(config.yScale);\n var x = -xScale;\n var y = -yScale;\n var ox = xScale * KAPPA;\n var oy = yScale * KAPPA;\n var xe = x + xScale * 2;\n var ye = y + yScale * 2;\n var xm = x + xScale;\n var ym = y + yScale;\n return [translate(centerX, centerY), rotateRadians(toRadians(config.rotate)), moveTo(x, ym), appendBezierCurve(x, ym - oy, xm - ox, y, xm, y), appendBezierCurve(xm + ox, y, xe, ym - oy, xe, ym), appendBezierCurve(xe, ym + oy, xm + ox, ye, xm, ye), appendBezierCurve(xm - ox, ye, x, ym + oy, x, ym)];\n};\nexport var drawEllipse = function (options) {\n var _a, _b, _c;\n return __spreadArrays([pushGraphicsState(), options.graphicsState && setGraphicsState(options.graphicsState), options.color && setFillingColor(options.color), options.borderColor && setStrokingColor(options.borderColor), setLineWidth(options.borderWidth), options.borderLineCap && setLineCap(options.borderLineCap), setDashPattern((_a = options.borderDashArray) !== null && _a !== void 0 ? _a : [], (_b = options.borderDashPhase) !== null && _b !== void 0 ? _b : 0)], options.rotate === undefined ? drawEllipsePath({\n x: options.x,\n y: options.y,\n xScale: options.xScale,\n yScale: options.yScale\n }) : drawEllipseCurves({\n x: options.x,\n y: options.y,\n xScale: options.xScale,\n yScale: options.yScale,\n rotate: (_c = options.rotate) !== null && _c !== void 0 ? _c : degrees(0)\n }), [\n // prettier-ignore\n options.color && options.borderWidth ? fillAndStroke() : options.color ? fill() : options.borderColor ? stroke() : closePath(), popGraphicsState()]).filter(Boolean);\n};\nexport var drawSvgPath = function (path, options) {\n var _a, _b, _c;\n return __spreadArrays([pushGraphicsState(), options.graphicsState && setGraphicsState(options.graphicsState), translate(options.x, options.y), rotateRadians(toRadians((_a = options.rotate) !== null && _a !== void 0 ? _a : degrees(0))),\n // SVG path Y axis is opposite pdf-lib's\n options.scale ? scale(options.scale, -options.scale) : scale(1, -1), options.color && setFillingColor(options.color), options.borderColor && setStrokingColor(options.borderColor), options.borderWidth && setLineWidth(options.borderWidth), options.borderLineCap && setLineCap(options.borderLineCap), setDashPattern((_b = options.borderDashArray) !== null && _b !== void 0 ? _b : [], (_c = options.borderDashPhase) !== null && _c !== void 0 ? _c : 0)], svgPathToOperators(path), [\n // prettier-ignore\n options.color && options.borderWidth ? fillAndStroke() : options.color ? fill() : options.borderColor ? stroke() : closePath(), popGraphicsState()]).filter(Boolean);\n};\nexport var drawCheckMark = function (options) {\n var size = asNumber(options.size);\n /*********************** Define Check Mark Points ***************************/\n // A check mark is defined by three points in some coordinate space. Here, we\n // define these points in a unit coordinate system, where the range of the x\n // and y axis are both [-1, 1].\n //\n // Note that we do not hard code `p1y` in case we wish to change the\n // size/shape of the check mark in the future. We want the check mark to\n // always form a right angle. This means that the dot product between (p1-p2)\n // and (p3-p2) should be zero:\n //\n // (p1x-p2x) * (p3x-p2x) + (p1y-p2y) * (p3y-p2y) = 0\n //\n // We can now rejigger this equation to solve for `p1y`:\n //\n // (p1y-p2y) * (p3y-p2y) = -((p1x-p2x) * (p3x-p2x))\n // (p1y-p2y) = -((p1x-p2x) * (p3x-p2x)) / (p3y-p2y)\n // p1y = -((p1x-p2x) * (p3x-p2x)) / (p3y-p2y) + p2y\n //\n // Thanks to my friend Joel Walker (https://github.com/JWalker1995) for\n // devising the above equation and unit coordinate system approach!\n // (x, y) coords of the check mark's bottommost point\n var p2x = -1 + 0.75;\n var p2y = -1 + 0.51;\n // (x, y) coords of the check mark's topmost point\n var p3y = 1 - 0.525;\n var p3x = 1 - 0.31;\n // (x, y) coords of the check mark's center (vertically) point\n var p1x = -1 + 0.325;\n var p1y = -((p1x - p2x) * (p3x - p2x)) / (p3y - p2y) + p2y;\n /****************************************************************************/\n return [pushGraphicsState(), options.color && setStrokingColor(options.color), setLineWidth(options.thickness), translate(options.x, options.y), moveTo(p1x * size, p1y * size), lineTo(p2x * size, p2y * size), lineTo(p3x * size, p3y * size), stroke(), popGraphicsState()].filter(Boolean);\n};\n// prettier-ignore\nexport var rotateInPlace = function (options) {\n return options.rotation === 0 ? [translate(0, 0), rotateDegrees(0)] : options.rotation === 90 ? [translate(options.width, 0), rotateDegrees(90)] : options.rotation === 180 ? [translate(options.width, options.height), rotateDegrees(180)] : options.rotation === 270 ? [translate(0, options.height), rotateDegrees(270)] : [];\n}; // Invalid rotation - noop\nexport var drawCheckBox = function (options) {\n var outline = drawRectangle({\n x: options.x,\n y: options.y,\n width: options.width,\n height: options.height,\n borderWidth: options.borderWidth,\n color: options.color,\n borderColor: options.borderColor,\n rotate: degrees(0),\n xSkew: degrees(0),\n ySkew: degrees(0)\n });\n if (!options.filled) return outline;\n var width = asNumber(options.width);\n var height = asNumber(options.height);\n var checkMarkSize = Math.min(width, height) / 2;\n var checkMark = drawCheckMark({\n x: width / 2,\n y: height / 2,\n size: checkMarkSize,\n thickness: options.thickness,\n color: options.markColor\n });\n return __spreadArrays([pushGraphicsState()], outline, checkMark, [popGraphicsState()]);\n};\nexport var drawRadioButton = function (options) {\n var width = asNumber(options.width);\n var height = asNumber(options.height);\n var outlineScale = Math.min(width, height) / 2;\n var outline = drawEllipse({\n x: options.x,\n y: options.y,\n xScale: outlineScale,\n yScale: outlineScale,\n color: options.color,\n borderColor: options.borderColor,\n borderWidth: options.borderWidth\n });\n if (!options.filled) return outline;\n var dot = drawEllipse({\n x: options.x,\n y: options.y,\n xScale: outlineScale * 0.45,\n yScale: outlineScale * 0.45,\n color: options.dotColor,\n borderColor: undefined,\n borderWidth: 0\n });\n return __spreadArrays([pushGraphicsState()], outline, dot, [popGraphicsState()]);\n};\nexport var drawButton = function (options) {\n var x = asNumber(options.x);\n var y = asNumber(options.y);\n var width = asNumber(options.width);\n var height = asNumber(options.height);\n var background = drawRectangle({\n x: x,\n y: y,\n width: width,\n height: height,\n borderWidth: options.borderWidth,\n color: options.color,\n borderColor: options.borderColor,\n rotate: degrees(0),\n xSkew: degrees(0),\n ySkew: degrees(0)\n });\n var lines = drawTextLines(options.textLines, {\n color: options.textColor,\n font: options.font,\n size: options.fontSize,\n rotate: degrees(0),\n xSkew: degrees(0),\n ySkew: degrees(0)\n });\n return __spreadArrays([pushGraphicsState()], background, lines, [popGraphicsState()]);\n};\nexport var drawTextLines = function (lines, options) {\n var operators = [beginText(), setFillingColor(options.color), setFontAndSize(options.font, options.size)];\n for (var idx = 0, len = lines.length; idx < len; idx++) {\n var _a = lines[idx],\n encoded = _a.encoded,\n x = _a.x,\n y = _a.y;\n operators.push(rotateAndSkewTextRadiansAndTranslate(toRadians(options.rotate), toRadians(options.xSkew), toRadians(options.ySkew), x, y), showText(encoded));\n }\n operators.push(endText());\n return operators;\n};\nexport var drawTextField = function (options) {\n var x = asNumber(options.x);\n var y = asNumber(options.y);\n var width = asNumber(options.width);\n var height = asNumber(options.height);\n var borderWidth = asNumber(options.borderWidth);\n var padding = asNumber(options.padding);\n var clipX = x + borderWidth / 2 + padding;\n var clipY = y + borderWidth / 2 + padding;\n var clipWidth = width - (borderWidth / 2 + padding) * 2;\n var clipHeight = height - (borderWidth / 2 + padding) * 2;\n var clippingArea = [moveTo(clipX, clipY), lineTo(clipX, clipY + clipHeight), lineTo(clipX + clipWidth, clipY + clipHeight), lineTo(clipX + clipWidth, clipY), closePath(), clip(), endPath()];\n var background = drawRectangle({\n x: x,\n y: y,\n width: width,\n height: height,\n borderWidth: options.borderWidth,\n color: options.color,\n borderColor: options.borderColor,\n rotate: degrees(0),\n xSkew: degrees(0),\n ySkew: degrees(0)\n });\n var lines = drawTextLines(options.textLines, {\n color: options.textColor,\n font: options.font,\n size: options.fontSize,\n rotate: degrees(0),\n xSkew: degrees(0),\n ySkew: degrees(0)\n });\n var markedContent = __spreadArrays([beginMarkedContent('Tx'), pushGraphicsState()], lines, [popGraphicsState(), endMarkedContent()]);\n return __spreadArrays([pushGraphicsState()], background, clippingArea, markedContent, [popGraphicsState()]);\n};\nexport var drawOptionList = function (options) {\n var x = asNumber(options.x);\n var y = asNumber(options.y);\n var width = asNumber(options.width);\n var height = asNumber(options.height);\n var lineHeight = asNumber(options.lineHeight);\n var borderWidth = asNumber(options.borderWidth);\n var padding = asNumber(options.padding);\n var clipX = x + borderWidth / 2 + padding;\n var clipY = y + borderWidth / 2 + padding;\n var clipWidth = width - (borderWidth / 2 + padding) * 2;\n var clipHeight = height - (borderWidth / 2 + padding) * 2;\n var clippingArea = [moveTo(clipX, clipY), lineTo(clipX, clipY + clipHeight), lineTo(clipX + clipWidth, clipY + clipHeight), lineTo(clipX + clipWidth, clipY), closePath(), clip(), endPath()];\n var background = drawRectangle({\n x: x,\n y: y,\n width: width,\n height: height,\n borderWidth: options.borderWidth,\n color: options.color,\n borderColor: options.borderColor,\n rotate: degrees(0),\n xSkew: degrees(0),\n ySkew: degrees(0)\n });\n var highlights = [];\n for (var idx = 0, len = options.selectedLines.length; idx < len; idx++) {\n var line = options.textLines[options.selectedLines[idx]];\n highlights.push.apply(highlights, drawRectangle({\n x: line.x - padding,\n y: line.y - (lineHeight - line.height) / 2,\n width: width - borderWidth,\n height: line.height + (lineHeight - line.height) / 2,\n borderWidth: 0,\n color: options.selectedColor,\n borderColor: undefined,\n rotate: degrees(0),\n xSkew: degrees(0),\n ySkew: degrees(0)\n }));\n }\n var lines = drawTextLines(options.textLines, {\n color: options.textColor,\n font: options.font,\n size: options.fontSize,\n rotate: degrees(0),\n xSkew: degrees(0),\n ySkew: degrees(0)\n });\n var markedContent = __spreadArrays([beginMarkedContent('Tx'), pushGraphicsState()], lines, [popGraphicsState(), endMarkedContent()]);\n return __spreadArrays([pushGraphicsState()], background, highlights, clippingArea, markedContent, [popGraphicsState()]);\n};","// tslint:disable: max-classes-per-file\nimport { __extends } from \"tslib\";\n// TODO: Include link to documentation with example\nvar EncryptedPDFError = /** @class */function (_super) {\n __extends(EncryptedPDFError, _super);\n function EncryptedPDFError() {\n var _this = this;\n var msg = 'Input document to `PDFDocument.load` is encrypted. You can use `PDFDocument.load(..., { ignoreEncryption: true })` if you wish to load the document anyways.';\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return EncryptedPDFError;\n}(Error);\nexport { EncryptedPDFError };\n// TODO: Include link to documentation with example\nvar FontkitNotRegisteredError = /** @class */function (_super) {\n __extends(FontkitNotRegisteredError, _super);\n function FontkitNotRegisteredError() {\n var _this = this;\n var msg = 'Input to `PDFDocument.embedFont` was a custom font, but no `fontkit` instance was found. You must register a `fontkit` instance with `PDFDocument.registerFontkit(...)` before embedding custom fonts.';\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return FontkitNotRegisteredError;\n}(Error);\nexport { FontkitNotRegisteredError };\n// TODO: Include link to documentation with example\nvar ForeignPageError = /** @class */function (_super) {\n __extends(ForeignPageError, _super);\n function ForeignPageError() {\n var _this = this;\n var msg = 'A `page` passed to `PDFDocument.addPage` or `PDFDocument.insertPage` was from a different (foreign) PDF document. If you want to copy pages from one PDFDocument to another, you must use `PDFDocument.copyPages(...)` to copy the pages before adding or inserting them.';\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return ForeignPageError;\n}(Error);\nexport { ForeignPageError };\n// TODO: Include link to documentation with example\nvar RemovePageFromEmptyDocumentError = /** @class */function (_super) {\n __extends(RemovePageFromEmptyDocumentError, _super);\n function RemovePageFromEmptyDocumentError() {\n var _this = this;\n var msg = 'PDFDocument has no pages so `PDFDocument.removePage` cannot be called';\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return RemovePageFromEmptyDocumentError;\n}(Error);\nexport { RemovePageFromEmptyDocumentError };\nvar NoSuchFieldError = /** @class */function (_super) {\n __extends(NoSuchFieldError, _super);\n function NoSuchFieldError(name) {\n var _this = this;\n var msg = \"PDFDocument has no form field with the name \\\"\" + name + \"\\\"\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return NoSuchFieldError;\n}(Error);\nexport { NoSuchFieldError };\nvar UnexpectedFieldTypeError = /** @class */function (_super) {\n __extends(UnexpectedFieldTypeError, _super);\n function UnexpectedFieldTypeError(name, expected, actual) {\n var _a, _b;\n var _this = this;\n var expectedType = expected === null || expected === void 0 ? void 0 : expected.name;\n var actualType = (_b = (_a = actual === null || actual === void 0 ? void 0 : actual.constructor) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : actual;\n var msg = \"Expected field \\\"\" + name + \"\\\" to be of type \" + expectedType + \", \" + (\"but it is actually of type \" + actualType);\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return UnexpectedFieldTypeError;\n}(Error);\nexport { UnexpectedFieldTypeError };\nvar MissingOnValueCheckError = /** @class */function (_super) {\n __extends(MissingOnValueCheckError, _super);\n function MissingOnValueCheckError(onValue) {\n var _this = this;\n var msg = \"Failed to select check box due to missing onValue: \\\"\" + onValue + \"\\\"\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return MissingOnValueCheckError;\n}(Error);\nexport { MissingOnValueCheckError };\nvar FieldAlreadyExistsError = /** @class */function (_super) {\n __extends(FieldAlreadyExistsError, _super);\n function FieldAlreadyExistsError(name) {\n var _this = this;\n var msg = \"A field already exists with the specified name: \\\"\" + name + \"\\\"\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return FieldAlreadyExistsError;\n}(Error);\nexport { FieldAlreadyExistsError };\nvar InvalidFieldNamePartError = /** @class */function (_super) {\n __extends(InvalidFieldNamePartError, _super);\n function InvalidFieldNamePartError(namePart) {\n var _this = this;\n var msg = \"Field name contains invalid component: \\\"\" + namePart + \"\\\"\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return InvalidFieldNamePartError;\n}(Error);\nexport { InvalidFieldNamePartError };\nvar FieldExistsAsNonTerminalError = /** @class */function (_super) {\n __extends(FieldExistsAsNonTerminalError, _super);\n function FieldExistsAsNonTerminalError(name) {\n var _this = this;\n var msg = \"A non-terminal field already exists with the specified name: \\\"\" + name + \"\\\"\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return FieldExistsAsNonTerminalError;\n}(Error);\nexport { FieldExistsAsNonTerminalError };\nvar RichTextFieldReadError = /** @class */function (_super) {\n __extends(RichTextFieldReadError, _super);\n function RichTextFieldReadError(fieldName) {\n var _this = this;\n var msg = \"Reading rich text fields is not supported: Attempted to read rich text field: \" + fieldName;\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return RichTextFieldReadError;\n}(Error);\nexport { RichTextFieldReadError };\nvar CombedTextLayoutError = /** @class */function (_super) {\n __extends(CombedTextLayoutError, _super);\n function CombedTextLayoutError(lineLength, cellCount) {\n var _this = this;\n var msg = \"Failed to layout combed text as lineLength=\" + lineLength + \" is greater than cellCount=\" + cellCount;\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return CombedTextLayoutError;\n}(Error);\nexport { CombedTextLayoutError };\nvar ExceededMaxLengthError = /** @class */function (_super) {\n __extends(ExceededMaxLengthError, _super);\n function ExceededMaxLengthError(textLength, maxLength, name) {\n var _this = this;\n var msg = \"Attempted to set text with length=\" + textLength + \" for TextField with maxLength=\" + maxLength + \" and name=\" + name;\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return ExceededMaxLengthError;\n}(Error);\nexport { ExceededMaxLengthError };\nvar InvalidMaxLengthError = /** @class */function (_super) {\n __extends(InvalidMaxLengthError, _super);\n function InvalidMaxLengthError(textLength, maxLength, name) {\n var _this = this;\n var msg = \"Attempted to set maxLength=\" + maxLength + \", which is less than \" + textLength + \", the length of this field's current value (name=\" + name + \")\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return InvalidMaxLengthError;\n}(Error);\nexport { InvalidMaxLengthError };","import { CombedTextLayoutError } from \"../errors\";\nimport { TextAlignment } from \"./alignment\";\nimport { cleanText, lineSplit, mergeLines, charAtIndex, charSplit } from \"../../utils\";\nvar MIN_FONT_SIZE = 4;\nvar MAX_FONT_SIZE = 500;\nvar computeFontSize = function (lines, font, bounds, multiline) {\n if (multiline === void 0) {\n multiline = false;\n }\n var fontSize = MIN_FONT_SIZE;\n while (fontSize < MAX_FONT_SIZE) {\n var linesUsed = 0;\n for (var lineIdx = 0, lineLen = lines.length; lineIdx < lineLen; lineIdx++) {\n linesUsed += 1;\n var line = lines[lineIdx];\n var words = line.split(' ');\n // Layout the words using the current `fontSize`, line wrapping\n // whenever we reach the end of the current line.\n var spaceInLineRemaining = bounds.width;\n for (var idx = 0, len = words.length; idx < len; idx++) {\n var isLastWord = idx === len - 1;\n var word = isLastWord ? words[idx] : words[idx] + ' ';\n var widthOfWord = font.widthOfTextAtSize(word, fontSize);\n spaceInLineRemaining -= widthOfWord;\n if (spaceInLineRemaining <= 0) {\n linesUsed += 1;\n spaceInLineRemaining = bounds.width - widthOfWord;\n }\n }\n }\n // Return if we exceeded the allowed width\n if (!multiline && linesUsed > lines.length) return fontSize - 1;\n var height = font.heightAtSize(fontSize);\n var lineHeight = height + height * 0.2;\n var totalHeight = lineHeight * linesUsed;\n // Return if we exceeded the allowed height\n if (totalHeight > Math.abs(bounds.height)) return fontSize - 1;\n fontSize += 1;\n }\n return fontSize;\n};\nvar computeCombedFontSize = function (line, font, bounds, cellCount) {\n var cellWidth = bounds.width / cellCount;\n var cellHeight = bounds.height;\n var fontSize = MIN_FONT_SIZE;\n var chars = charSplit(line);\n while (fontSize < MAX_FONT_SIZE) {\n for (var idx = 0, len = chars.length; idx < len; idx++) {\n var c = chars[idx];\n var tooLong = font.widthOfTextAtSize(c, fontSize) > cellWidth * 0.75;\n if (tooLong) return fontSize - 1;\n }\n var height = font.heightAtSize(fontSize, {\n descender: false\n });\n if (height > cellHeight) return fontSize - 1;\n fontSize += 1;\n }\n return fontSize;\n};\nvar lastIndexOfWhitespace = function (line) {\n for (var idx = line.length; idx > 0; idx--) {\n if (/\\s/.test(line[idx])) return idx;\n }\n return undefined;\n};\nvar splitOutLines = function (input, maxWidth, font, fontSize) {\n var _a;\n var lastWhitespaceIdx = input.length;\n while (lastWhitespaceIdx > 0) {\n var line = input.substring(0, lastWhitespaceIdx);\n var encoded = font.encodeText(line);\n var width = font.widthOfTextAtSize(line, fontSize);\n if (width < maxWidth) {\n var remainder = input.substring(lastWhitespaceIdx) || undefined;\n return {\n line: line,\n encoded: encoded,\n width: width,\n remainder: remainder\n };\n }\n lastWhitespaceIdx = (_a = lastIndexOfWhitespace(line)) !== null && _a !== void 0 ? _a : 0;\n }\n // We were unable to split the input enough to get a chunk that would fit\n // within the specified `maxWidth` so we'll just return everything\n return {\n line: input,\n encoded: font.encodeText(input),\n width: font.widthOfTextAtSize(input, fontSize),\n remainder: undefined\n };\n};\nexport var layoutMultilineText = function (text, _a) {\n var alignment = _a.alignment,\n fontSize = _a.fontSize,\n font = _a.font,\n bounds = _a.bounds;\n var lines = lineSplit(cleanText(text));\n if (fontSize === undefined || fontSize === 0) {\n fontSize = computeFontSize(lines, font, bounds, true);\n }\n var height = font.heightAtSize(fontSize);\n var lineHeight = height + height * 0.2;\n var textLines = [];\n var minX = bounds.x;\n var minY = bounds.y;\n var maxX = bounds.x + bounds.width;\n var maxY = bounds.y + bounds.height;\n var y = bounds.y + bounds.height;\n for (var idx = 0, len = lines.length; idx < len; idx++) {\n var prevRemainder = lines[idx];\n while (prevRemainder !== undefined) {\n var _b = splitOutLines(prevRemainder, bounds.width, font, fontSize),\n line = _b.line,\n encoded = _b.encoded,\n width = _b.width,\n remainder = _b.remainder;\n // prettier-ignore\n var x = alignment === TextAlignment.Left ? bounds.x : alignment === TextAlignment.Center ? bounds.x + bounds.width / 2 - width / 2 : alignment === TextAlignment.Right ? bounds.x + bounds.width - width : bounds.x;\n y -= lineHeight;\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x + width > maxX) maxX = x + width;\n if (y + height > maxY) maxY = y + height;\n textLines.push({\n text: line,\n encoded: encoded,\n width: width,\n height: height,\n x: x,\n y: y\n });\n // Only trim lines that we had to split ourselves. So we won't trim lines\n // that the user provided themselves with whitespace.\n prevRemainder = remainder === null || remainder === void 0 ? void 0 : remainder.trim();\n }\n }\n return {\n fontSize: fontSize,\n lineHeight: lineHeight,\n lines: textLines,\n bounds: {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n }\n };\n};\nexport var layoutCombedText = function (text, _a) {\n var fontSize = _a.fontSize,\n font = _a.font,\n bounds = _a.bounds,\n cellCount = _a.cellCount;\n var line = mergeLines(cleanText(text));\n if (line.length > cellCount) {\n throw new CombedTextLayoutError(line.length, cellCount);\n }\n if (fontSize === undefined || fontSize === 0) {\n fontSize = computeCombedFontSize(line, font, bounds, cellCount);\n }\n var cellWidth = bounds.width / cellCount;\n var height = font.heightAtSize(fontSize, {\n descender: false\n });\n var y = bounds.y + (bounds.height / 2 - height / 2);\n var cells = [];\n var minX = bounds.x;\n var minY = bounds.y;\n var maxX = bounds.x + bounds.width;\n var maxY = bounds.y + bounds.height;\n var cellOffset = 0;\n var charOffset = 0;\n while (cellOffset < cellCount) {\n var _b = charAtIndex(line, charOffset),\n char = _b[0],\n charLength = _b[1];\n var encoded = font.encodeText(char);\n var width = font.widthOfTextAtSize(char, fontSize);\n var cellCenter = bounds.x + (cellWidth * cellOffset + cellWidth / 2);\n var x = cellCenter - width / 2;\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x + width > maxX) maxX = x + width;\n if (y + height > maxY) maxY = y + height;\n cells.push({\n text: line,\n encoded: encoded,\n width: width,\n height: height,\n x: x,\n y: y\n });\n cellOffset += 1;\n charOffset += charLength;\n }\n return {\n fontSize: fontSize,\n cells: cells,\n bounds: {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n }\n };\n};\nexport var layoutSinglelineText = function (text, _a) {\n var alignment = _a.alignment,\n fontSize = _a.fontSize,\n font = _a.font,\n bounds = _a.bounds;\n var line = mergeLines(cleanText(text));\n if (fontSize === undefined || fontSize === 0) {\n fontSize = computeFontSize([line], font, bounds);\n }\n var encoded = font.encodeText(line);\n var width = font.widthOfTextAtSize(line, fontSize);\n var height = font.heightAtSize(fontSize, {\n descender: false\n });\n // prettier-ignore\n var x = alignment === TextAlignment.Left ? bounds.x : alignment === TextAlignment.Center ? bounds.x + bounds.width / 2 - width / 2 : alignment === TextAlignment.Right ? bounds.x + bounds.width - width : bounds.x;\n var y = bounds.y + (bounds.height / 2 - height / 2);\n return {\n fontSize: fontSize,\n line: {\n text: line,\n encoded: encoded,\n width: width,\n height: height,\n x: x,\n y: y\n },\n bounds: {\n x: x,\n y: y,\n width: width,\n height: height\n }\n };\n};","export var ImageAlignment;\n(function (ImageAlignment) {\n ImageAlignment[ImageAlignment[\"Left\"] = 0] = \"Left\";\n ImageAlignment[ImageAlignment[\"Center\"] = 1] = \"Center\";\n ImageAlignment[ImageAlignment[\"Right\"] = 2] = \"Right\";\n})(ImageAlignment || (ImageAlignment = {}));","import { __assign, __spreadArrays } from \"tslib\";\nimport { drawCheckBox, rotateInPlace, drawRadioButton, drawButton, drawTextField, drawOptionList } from \"../operations\";\nimport { rgb, componentsToColor, setFillingColor, grayscale, cmyk } from \"../colors\";\nimport { reduceRotation, adjustDimsForRotation } from \"../rotations\";\nimport { layoutMultilineText, layoutCombedText, layoutSinglelineText } from \"../text/layout\";\nimport { TextAlignment } from \"../text/alignment\";\nimport { setFontAndSize } from \"../operators\";\nimport { findLastMatch } from \"../../utils\";\n/********************* Appearance Provider Functions **************************/\nexport var normalizeAppearance = function (appearance) {\n if ('normal' in appearance) return appearance;\n return {\n normal: appearance\n };\n};\n// Examples:\n// `/Helv 12 Tf` -> ['/Helv 12 Tf', 'Helv', '12']\n// `/HeBo 8.00 Tf` -> ['/HeBo 8 Tf', 'HeBo', '8.00']\nvar tfRegex = /\\/([^\\0\\t\\n\\f\\r\\ ]+)[\\0\\t\\n\\f\\r\\ ]+(\\d*\\.\\d+|\\d+)[\\0\\t\\n\\f\\r\\ ]+Tf/;\nvar getDefaultFontSize = function (field) {\n var _a, _b;\n var da = (_a = field.getDefaultAppearance()) !== null && _a !== void 0 ? _a : '';\n var daMatch = (_b = findLastMatch(da, tfRegex).match) !== null && _b !== void 0 ? _b : [];\n var defaultFontSize = Number(daMatch[2]);\n return isFinite(defaultFontSize) ? defaultFontSize : undefined;\n};\n// Examples:\n// `0.3 g` -> ['0.3', 'g']\n// `0.3 1 .3 rg` -> ['0.3', '1', '.3', 'rg']\n// `0.3 1 .3 0 k` -> ['0.3', '1', '.3', '0', 'k']\nvar colorRegex = /(\\d*\\.\\d+|\\d+)[\\0\\t\\n\\f\\r\\ ]*(\\d*\\.\\d+|\\d+)?[\\0\\t\\n\\f\\r\\ ]*(\\d*\\.\\d+|\\d+)?[\\0\\t\\n\\f\\r\\ ]*(\\d*\\.\\d+|\\d+)?[\\0\\t\\n\\f\\r\\ ]+(g|rg|k)/;\nvar getDefaultColor = function (field) {\n var _a;\n var da = (_a = field.getDefaultAppearance()) !== null && _a !== void 0 ? _a : '';\n var daMatch = findLastMatch(da, colorRegex).match;\n var _b = daMatch !== null && daMatch !== void 0 ? daMatch : [],\n c1 = _b[1],\n c2 = _b[2],\n c3 = _b[3],\n c4 = _b[4],\n colorSpace = _b[5];\n if (colorSpace === 'g' && c1) {\n return grayscale(Number(c1));\n }\n if (colorSpace === 'rg' && c1 && c2 && c3) {\n return rgb(Number(c1), Number(c2), Number(c3));\n }\n if (colorSpace === 'k' && c1 && c2 && c3 && c4) {\n return cmyk(Number(c1), Number(c2), Number(c3), Number(c4));\n }\n return undefined;\n};\nvar updateDefaultAppearance = function (field, color, font, fontSize) {\n var _a;\n if (fontSize === void 0) {\n fontSize = 0;\n }\n var da = [setFillingColor(color).toString(), setFontAndSize((_a = font === null || font === void 0 ? void 0 : font.name) !== null && _a !== void 0 ? _a : 'dummy__noop', fontSize).toString()].join('\\n');\n field.setDefaultAppearance(da);\n};\nexport var defaultCheckBoxAppearanceProvider = function (checkBox, widget) {\n var _a, _b, _c;\n // The `/DA` entry can be at the widget or field level - so we handle both\n var widgetColor = getDefaultColor(widget);\n var fieldColor = getDefaultColor(checkBox.acroField);\n var rectangle = widget.getRectangle();\n var ap = widget.getAppearanceCharacteristics();\n var bs = widget.getBorderStyle();\n var borderWidth = (_a = bs === null || bs === void 0 ? void 0 : bs.getWidth()) !== null && _a !== void 0 ? _a : 0;\n var rotation = reduceRotation(ap === null || ap === void 0 ? void 0 : ap.getRotation());\n var _d = adjustDimsForRotation(rectangle, rotation),\n width = _d.width,\n height = _d.height;\n var rotate = rotateInPlace(__assign(__assign({}, rectangle), {\n rotation: rotation\n }));\n var black = rgb(0, 0, 0);\n var borderColor = (_b = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBorderColor())) !== null && _b !== void 0 ? _b : black;\n var normalBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor());\n var downBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor(), 0.8);\n // Update color\n var textColor = (_c = widgetColor !== null && widgetColor !== void 0 ? widgetColor : fieldColor) !== null && _c !== void 0 ? _c : black;\n if (widgetColor) {\n updateDefaultAppearance(widget, textColor);\n } else {\n updateDefaultAppearance(checkBox.acroField, textColor);\n }\n var options = {\n x: 0 + borderWidth / 2,\n y: 0 + borderWidth / 2,\n width: width - borderWidth,\n height: height - borderWidth,\n thickness: 1.5,\n borderWidth: borderWidth,\n borderColor: borderColor,\n markColor: textColor\n };\n return {\n normal: {\n on: __spreadArrays(rotate, drawCheckBox(__assign(__assign({}, options), {\n color: normalBackgroundColor,\n filled: true\n }))),\n off: __spreadArrays(rotate, drawCheckBox(__assign(__assign({}, options), {\n color: normalBackgroundColor,\n filled: false\n })))\n },\n down: {\n on: __spreadArrays(rotate, drawCheckBox(__assign(__assign({}, options), {\n color: downBackgroundColor,\n filled: true\n }))),\n off: __spreadArrays(rotate, drawCheckBox(__assign(__assign({}, options), {\n color: downBackgroundColor,\n filled: false\n })))\n }\n };\n};\nexport var defaultRadioGroupAppearanceProvider = function (radioGroup, widget) {\n var _a, _b, _c;\n // The `/DA` entry can be at the widget or field level - so we handle both\n var widgetColor = getDefaultColor(widget);\n var fieldColor = getDefaultColor(radioGroup.acroField);\n var rectangle = widget.getRectangle();\n var ap = widget.getAppearanceCharacteristics();\n var bs = widget.getBorderStyle();\n var borderWidth = (_a = bs === null || bs === void 0 ? void 0 : bs.getWidth()) !== null && _a !== void 0 ? _a : 0;\n var rotation = reduceRotation(ap === null || ap === void 0 ? void 0 : ap.getRotation());\n var _d = adjustDimsForRotation(rectangle, rotation),\n width = _d.width,\n height = _d.height;\n var rotate = rotateInPlace(__assign(__assign({}, rectangle), {\n rotation: rotation\n }));\n var black = rgb(0, 0, 0);\n var borderColor = (_b = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBorderColor())) !== null && _b !== void 0 ? _b : black;\n var normalBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor());\n var downBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor(), 0.8);\n // Update color\n var textColor = (_c = widgetColor !== null && widgetColor !== void 0 ? widgetColor : fieldColor) !== null && _c !== void 0 ? _c : black;\n if (widgetColor) {\n updateDefaultAppearance(widget, textColor);\n } else {\n updateDefaultAppearance(radioGroup.acroField, textColor);\n }\n var options = {\n x: width / 2,\n y: height / 2,\n width: width - borderWidth,\n height: height - borderWidth,\n borderWidth: borderWidth,\n borderColor: borderColor,\n dotColor: textColor\n };\n return {\n normal: {\n on: __spreadArrays(rotate, drawRadioButton(__assign(__assign({}, options), {\n color: normalBackgroundColor,\n filled: true\n }))),\n off: __spreadArrays(rotate, drawRadioButton(__assign(__assign({}, options), {\n color: normalBackgroundColor,\n filled: false\n })))\n },\n down: {\n on: __spreadArrays(rotate, drawRadioButton(__assign(__assign({}, options), {\n color: downBackgroundColor,\n filled: true\n }))),\n off: __spreadArrays(rotate, drawRadioButton(__assign(__assign({}, options), {\n color: downBackgroundColor,\n filled: false\n })))\n }\n };\n};\nexport var defaultButtonAppearanceProvider = function (button, widget, font) {\n var _a, _b, _c, _d, _e;\n // The `/DA` entry can be at the widget or field level - so we handle both\n var widgetColor = getDefaultColor(widget);\n var fieldColor = getDefaultColor(button.acroField);\n var widgetFontSize = getDefaultFontSize(widget);\n var fieldFontSize = getDefaultFontSize(button.acroField);\n var rectangle = widget.getRectangle();\n var ap = widget.getAppearanceCharacteristics();\n var bs = widget.getBorderStyle();\n var captions = ap === null || ap === void 0 ? void 0 : ap.getCaptions();\n var normalText = (_a = captions === null || captions === void 0 ? void 0 : captions.normal) !== null && _a !== void 0 ? _a : '';\n var downText = (_c = (_b = captions === null || captions === void 0 ? void 0 : captions.down) !== null && _b !== void 0 ? _b : normalText) !== null && _c !== void 0 ? _c : '';\n var borderWidth = (_d = bs === null || bs === void 0 ? void 0 : bs.getWidth()) !== null && _d !== void 0 ? _d : 0;\n var rotation = reduceRotation(ap === null || ap === void 0 ? void 0 : ap.getRotation());\n var _f = adjustDimsForRotation(rectangle, rotation),\n width = _f.width,\n height = _f.height;\n var rotate = rotateInPlace(__assign(__assign({}, rectangle), {\n rotation: rotation\n }));\n var black = rgb(0, 0, 0);\n var borderColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBorderColor());\n var normalBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor());\n var downBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor(), 0.8);\n var bounds = {\n x: borderWidth,\n y: borderWidth,\n width: width - borderWidth * 2,\n height: height - borderWidth * 2\n };\n var normalLayout = layoutSinglelineText(normalText, {\n alignment: TextAlignment.Center,\n fontSize: widgetFontSize !== null && widgetFontSize !== void 0 ? widgetFontSize : fieldFontSize,\n font: font,\n bounds: bounds\n });\n var downLayout = layoutSinglelineText(downText, {\n alignment: TextAlignment.Center,\n fontSize: widgetFontSize !== null && widgetFontSize !== void 0 ? widgetFontSize : fieldFontSize,\n font: font,\n bounds: bounds\n });\n // Update font size and color\n var fontSize = Math.min(normalLayout.fontSize, downLayout.fontSize);\n var textColor = (_e = widgetColor !== null && widgetColor !== void 0 ? widgetColor : fieldColor) !== null && _e !== void 0 ? _e : black;\n if (widgetColor || widgetFontSize !== undefined) {\n updateDefaultAppearance(widget, textColor, font, fontSize);\n } else {\n updateDefaultAppearance(button.acroField, textColor, font, fontSize);\n }\n var options = {\n x: 0 + borderWidth / 2,\n y: 0 + borderWidth / 2,\n width: width - borderWidth,\n height: height - borderWidth,\n borderWidth: borderWidth,\n borderColor: borderColor,\n textColor: textColor,\n font: font.name,\n fontSize: fontSize\n };\n return {\n normal: __spreadArrays(rotate, drawButton(__assign(__assign({}, options), {\n color: normalBackgroundColor,\n textLines: [normalLayout.line]\n }))),\n down: __spreadArrays(rotate, drawButton(__assign(__assign({}, options), {\n color: downBackgroundColor,\n textLines: [downLayout.line]\n })))\n };\n};\nexport var defaultTextFieldAppearanceProvider = function (textField, widget, font) {\n var _a, _b, _c, _d;\n // The `/DA` entry can be at the widget or field level - so we handle both\n var widgetColor = getDefaultColor(widget);\n var fieldColor = getDefaultColor(textField.acroField);\n var widgetFontSize = getDefaultFontSize(widget);\n var fieldFontSize = getDefaultFontSize(textField.acroField);\n var rectangle = widget.getRectangle();\n var ap = widget.getAppearanceCharacteristics();\n var bs = widget.getBorderStyle();\n var text = (_a = textField.getText()) !== null && _a !== void 0 ? _a : '';\n var borderWidth = (_b = bs === null || bs === void 0 ? void 0 : bs.getWidth()) !== null && _b !== void 0 ? _b : 0;\n var rotation = reduceRotation(ap === null || ap === void 0 ? void 0 : ap.getRotation());\n var _e = adjustDimsForRotation(rectangle, rotation),\n width = _e.width,\n height = _e.height;\n var rotate = rotateInPlace(__assign(__assign({}, rectangle), {\n rotation: rotation\n }));\n var black = rgb(0, 0, 0);\n var borderColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBorderColor());\n var normalBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor());\n var textLines;\n var fontSize;\n var padding = textField.isCombed() ? 0 : 1;\n var bounds = {\n x: borderWidth + padding,\n y: borderWidth + padding,\n width: width - (borderWidth + padding) * 2,\n height: height - (borderWidth + padding) * 2\n };\n if (textField.isMultiline()) {\n var layout = layoutMultilineText(text, {\n alignment: textField.getAlignment(),\n fontSize: widgetFontSize !== null && widgetFontSize !== void 0 ? widgetFontSize : fieldFontSize,\n font: font,\n bounds: bounds\n });\n textLines = layout.lines;\n fontSize = layout.fontSize;\n } else if (textField.isCombed()) {\n var layout = layoutCombedText(text, {\n fontSize: widgetFontSize !== null && widgetFontSize !== void 0 ? widgetFontSize : fieldFontSize,\n font: font,\n bounds: bounds,\n cellCount: (_c = textField.getMaxLength()) !== null && _c !== void 0 ? _c : 0\n });\n textLines = layout.cells;\n fontSize = layout.fontSize;\n } else {\n var layout = layoutSinglelineText(text, {\n alignment: textField.getAlignment(),\n fontSize: widgetFontSize !== null && widgetFontSize !== void 0 ? widgetFontSize : fieldFontSize,\n font: font,\n bounds: bounds\n });\n textLines = [layout.line];\n fontSize = layout.fontSize;\n }\n // Update font size and color\n var textColor = (_d = widgetColor !== null && widgetColor !== void 0 ? widgetColor : fieldColor) !== null && _d !== void 0 ? _d : black;\n if (widgetColor || widgetFontSize !== undefined) {\n updateDefaultAppearance(widget, textColor, font, fontSize);\n } else {\n updateDefaultAppearance(textField.acroField, textColor, font, fontSize);\n }\n var options = {\n x: 0 + borderWidth / 2,\n y: 0 + borderWidth / 2,\n width: width - borderWidth,\n height: height - borderWidth,\n borderWidth: borderWidth !== null && borderWidth !== void 0 ? borderWidth : 0,\n borderColor: borderColor,\n textColor: textColor,\n font: font.name,\n fontSize: fontSize,\n color: normalBackgroundColor,\n textLines: textLines,\n padding: padding\n };\n return __spreadArrays(rotate, drawTextField(options));\n};\nexport var defaultDropdownAppearanceProvider = function (dropdown, widget, font) {\n var _a, _b, _c;\n // The `/DA` entry can be at the widget or field level - so we handle both\n var widgetColor = getDefaultColor(widget);\n var fieldColor = getDefaultColor(dropdown.acroField);\n var widgetFontSize = getDefaultFontSize(widget);\n var fieldFontSize = getDefaultFontSize(dropdown.acroField);\n var rectangle = widget.getRectangle();\n var ap = widget.getAppearanceCharacteristics();\n var bs = widget.getBorderStyle();\n var text = (_a = dropdown.getSelected()[0]) !== null && _a !== void 0 ? _a : '';\n var borderWidth = (_b = bs === null || bs === void 0 ? void 0 : bs.getWidth()) !== null && _b !== void 0 ? _b : 0;\n var rotation = reduceRotation(ap === null || ap === void 0 ? void 0 : ap.getRotation());\n var _d = adjustDimsForRotation(rectangle, rotation),\n width = _d.width,\n height = _d.height;\n var rotate = rotateInPlace(__assign(__assign({}, rectangle), {\n rotation: rotation\n }));\n var black = rgb(0, 0, 0);\n var borderColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBorderColor());\n var normalBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor());\n var padding = 1;\n var bounds = {\n x: borderWidth + padding,\n y: borderWidth + padding,\n width: width - (borderWidth + padding) * 2,\n height: height - (borderWidth + padding) * 2\n };\n var _e = layoutSinglelineText(text, {\n alignment: TextAlignment.Left,\n fontSize: widgetFontSize !== null && widgetFontSize !== void 0 ? widgetFontSize : fieldFontSize,\n font: font,\n bounds: bounds\n }),\n line = _e.line,\n fontSize = _e.fontSize;\n // Update font size and color\n var textColor = (_c = widgetColor !== null && widgetColor !== void 0 ? widgetColor : fieldColor) !== null && _c !== void 0 ? _c : black;\n if (widgetColor || widgetFontSize !== undefined) {\n updateDefaultAppearance(widget, textColor, font, fontSize);\n } else {\n updateDefaultAppearance(dropdown.acroField, textColor, font, fontSize);\n }\n var options = {\n x: 0 + borderWidth / 2,\n y: 0 + borderWidth / 2,\n width: width - borderWidth,\n height: height - borderWidth,\n borderWidth: borderWidth !== null && borderWidth !== void 0 ? borderWidth : 0,\n borderColor: borderColor,\n textColor: textColor,\n font: font.name,\n fontSize: fontSize,\n color: normalBackgroundColor,\n textLines: [line],\n padding: padding\n };\n return __spreadArrays(rotate, drawTextField(options));\n};\nexport var defaultOptionListAppearanceProvider = function (optionList, widget, font) {\n var _a, _b;\n // The `/DA` entry can be at the widget or field level - so we handle both\n var widgetColor = getDefaultColor(widget);\n var fieldColor = getDefaultColor(optionList.acroField);\n var widgetFontSize = getDefaultFontSize(widget);\n var fieldFontSize = getDefaultFontSize(optionList.acroField);\n var rectangle = widget.getRectangle();\n var ap = widget.getAppearanceCharacteristics();\n var bs = widget.getBorderStyle();\n var borderWidth = (_a = bs === null || bs === void 0 ? void 0 : bs.getWidth()) !== null && _a !== void 0 ? _a : 0;\n var rotation = reduceRotation(ap === null || ap === void 0 ? void 0 : ap.getRotation());\n var _c = adjustDimsForRotation(rectangle, rotation),\n width = _c.width,\n height = _c.height;\n var rotate = rotateInPlace(__assign(__assign({}, rectangle), {\n rotation: rotation\n }));\n var black = rgb(0, 0, 0);\n var borderColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBorderColor());\n var normalBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor());\n var options = optionList.getOptions();\n var selected = optionList.getSelected();\n if (optionList.isSorted()) options.sort();\n var text = '';\n for (var idx = 0, len = options.length; idx < len; idx++) {\n text += options[idx];\n if (idx < len - 1) text += '\\n';\n }\n var padding = 1;\n var bounds = {\n x: borderWidth + padding,\n y: borderWidth + padding,\n width: width - (borderWidth + padding) * 2,\n height: height - (borderWidth + padding) * 2\n };\n var _d = layoutMultilineText(text, {\n alignment: TextAlignment.Left,\n fontSize: widgetFontSize !== null && widgetFontSize !== void 0 ? widgetFontSize : fieldFontSize,\n font: font,\n bounds: bounds\n }),\n lines = _d.lines,\n fontSize = _d.fontSize,\n lineHeight = _d.lineHeight;\n var selectedLines = [];\n for (var idx = 0, len = lines.length; idx < len; idx++) {\n var line = lines[idx];\n if (selected.includes(line.text)) selectedLines.push(idx);\n }\n var blue = rgb(153 / 255, 193 / 255, 218 / 255);\n // Update font size and color\n var textColor = (_b = widgetColor !== null && widgetColor !== void 0 ? widgetColor : fieldColor) !== null && _b !== void 0 ? _b : black;\n if (widgetColor || widgetFontSize !== undefined) {\n updateDefaultAppearance(widget, textColor, font, fontSize);\n } else {\n updateDefaultAppearance(optionList.acroField, textColor, font, fontSize);\n }\n return __spreadArrays(rotate, drawOptionList({\n x: 0 + borderWidth / 2,\n y: 0 + borderWidth / 2,\n width: width - borderWidth,\n height: height - borderWidth,\n borderWidth: borderWidth !== null && borderWidth !== void 0 ? borderWidth : 0,\n borderColor: borderColor,\n textColor: textColor,\n font: font.name,\n fontSize: fontSize,\n color: normalBackgroundColor,\n textLines: lines,\n lineHeight: lineHeight,\n selectedColor: blue,\n selectedLines: selectedLines,\n padding: padding\n }));\n};","import { __awaiter, __generator } from \"tslib\";\nimport PDFDocument from \"./PDFDocument\";\nimport { PDFPageEmbedder, PDFRef } from \"../core\";\nimport { assertIs } from \"../utils\";\n/**\n * Represents a PDF page that has been embedded in a [[PDFDocument]].\n */\nvar PDFEmbeddedPage = /** @class */function () {\n function PDFEmbeddedPage(ref, doc, embedder) {\n this.alreadyEmbedded = false;\n assertIs(ref, 'ref', [[PDFRef, 'PDFRef']]);\n assertIs(doc, 'doc', [[PDFDocument, 'PDFDocument']]);\n assertIs(embedder, 'embedder', [[PDFPageEmbedder, 'PDFPageEmbedder']]);\n this.ref = ref;\n this.doc = doc;\n this.width = embedder.width;\n this.height = embedder.height;\n this.embedder = embedder;\n }\n /**\n * Compute the width and height of this page after being scaled by the\n * given `factor`. For example:\n * ```js\n * embeddedPage.width // => 500\n * embeddedPage.height // => 250\n *\n * const scaled = embeddedPage.scale(0.5)\n * scaled.width // => 250\n * scaled.height // => 125\n * ```\n * This operation is often useful before drawing a page with\n * [[PDFPage.drawPage]] to compute the `width` and `height` options.\n * @param factor The factor by which this page should be scaled.\n * @returns The width and height of the page after being scaled.\n */\n PDFEmbeddedPage.prototype.scale = function (factor) {\n assertIs(factor, 'factor', ['number']);\n return {\n width: this.width * factor,\n height: this.height * factor\n };\n };\n /**\n * Get the width and height of this page. For example:\n * ```js\n * const { width, height } = embeddedPage.size()\n * ```\n * @returns The width and height of the page.\n */\n PDFEmbeddedPage.prototype.size = function () {\n return this.scale(1);\n };\n /**\n * > **NOTE:** You probably don't need to call this method directly. The\n * > [[PDFDocument.save]] and [[PDFDocument.saveAsBase64]] methods will\n * > automatically ensure all embeddable pages get embedded.\n *\n * Embed this embeddable page in its document.\n *\n * @returns Resolves when the embedding is complete.\n */\n PDFEmbeddedPage.prototype.embed = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!!this.alreadyEmbedded) return [3 /*break*/, 2];\n return [4 /*yield*/, this.embedder.embedIntoContext(this.doc.context, this.ref)];\n case 1:\n _a.sent();\n this.alreadyEmbedded = true;\n _a.label = 2;\n case 2:\n return [2 /*return*/];\n }\n });\n });\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFDocument.embedPdf]] and\n * > [[PDFDocument.embedPage]] methods, which will create instances of\n * > [[PDFEmbeddedPage]] for you.\n *\n * Create an instance of [[PDFEmbeddedPage]] from an existing ref and embedder\n *\n * @param ref The unique reference for this embedded page.\n * @param doc The document to which the embedded page will belong.\n * @param embedder The embedder that will be used to embed the page.\n */\n PDFEmbeddedPage.of = function (ref, doc, embedder) {\n return new PDFEmbeddedPage(ref, doc, embedder);\n };\n return PDFEmbeddedPage;\n}();\nexport default PDFEmbeddedPage;","import { __awaiter, __generator } from \"tslib\";\nimport PDFDocument from \"./PDFDocument\";\nimport { CustomFontEmbedder, PDFRef, StandardFontEmbedder } from \"../core\";\nimport { assertIs, assertOrUndefined } from \"../utils\";\n/**\n * Represents a font that has been embedded in a [[PDFDocument]].\n */\nvar PDFFont = /** @class */function () {\n function PDFFont(ref, doc, embedder) {\n this.modified = true;\n assertIs(ref, 'ref', [[PDFRef, 'PDFRef']]);\n assertIs(doc, 'doc', [[PDFDocument, 'PDFDocument']]);\n assertIs(embedder, 'embedder', [[CustomFontEmbedder, 'CustomFontEmbedder'], [StandardFontEmbedder, 'StandardFontEmbedder']]);\n this.ref = ref;\n this.doc = doc;\n this.name = embedder.fontName;\n this.embedder = embedder;\n }\n /**\n * > **NOTE:** You probably don't need to call this method directly. The\n * > [[PDFPage.drawText]] method will automatically encode the text it is\n * > given.\n *\n * Encodes a string of text in this font.\n *\n * @param text The text to be encoded.\n * @returns The encoded text as a hex string.\n */\n PDFFont.prototype.encodeText = function (text) {\n assertIs(text, 'text', ['string']);\n this.modified = true;\n return this.embedder.encodeText(text);\n };\n /**\n * Measure the width of a string of text drawn in this font at a given size.\n * For example:\n * ```js\n * const width = font.widthOfTextAtSize('Foo Bar Qux Baz', 36)\n * ```\n * @param text The string of text to be measured.\n * @param size The font size to be used for this measurement.\n * @returns The width of the string of text when drawn in this font at the\n * given size.\n */\n PDFFont.prototype.widthOfTextAtSize = function (text, size) {\n assertIs(text, 'text', ['string']);\n assertIs(size, 'size', ['number']);\n return this.embedder.widthOfTextAtSize(text, size);\n };\n /**\n * Measure the height of this font at a given size. For example:\n * ```js\n * const height = font.heightAtSize(24)\n * ```\n *\n * The `options.descender` value controls whether or not the font's\n * descender is included in the height calculation.\n *\n * @param size The font size to be used for this measurement.\n * @param options The options to be used when computing this measurement.\n * @returns The height of this font at the given size.\n */\n PDFFont.prototype.heightAtSize = function (size, options) {\n var _a;\n assertIs(size, 'size', ['number']);\n assertOrUndefined(options === null || options === void 0 ? void 0 : options.descender, 'options.descender', ['boolean']);\n return this.embedder.heightOfFontAtSize(size, {\n descender: (_a = options === null || options === void 0 ? void 0 : options.descender) !== null && _a !== void 0 ? _a : true\n });\n };\n /**\n * Compute the font size at which this font is a given height. For example:\n * ```js\n * const fontSize = font.sizeAtHeight(12)\n * ```\n * @param height The height to be used for this calculation.\n * @returns The font size at which this font is the given height.\n */\n PDFFont.prototype.sizeAtHeight = function (height) {\n assertIs(height, 'height', ['number']);\n return this.embedder.sizeOfFontAtHeight(height);\n };\n /**\n * Get the set of unicode code points that can be represented by this font.\n * @returns The set of unicode code points supported by this font.\n */\n PDFFont.prototype.getCharacterSet = function () {\n if (this.embedder instanceof StandardFontEmbedder) {\n return this.embedder.encoding.supportedCodePoints;\n } else {\n return this.embedder.font.characterSet;\n }\n };\n /**\n * > **NOTE:** You probably don't need to call this method directly. The\n * > [[PDFDocument.save]] and [[PDFDocument.saveAsBase64]] methods will\n * > automatically ensure all fonts get embedded.\n *\n * Embed this font in its document.\n *\n * @returns Resolves when the embedding is complete.\n */\n PDFFont.prototype.embed = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!this.modified) return [3 /*break*/, 2];\n return [4 /*yield*/, this.embedder.embedIntoContext(this.doc.context, this.ref)];\n case 1:\n _a.sent();\n this.modified = false;\n _a.label = 2;\n case 2:\n return [2 /*return*/];\n }\n });\n });\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFDocument.embedFont]] and\n * > [[PDFDocument.embedStandardFont]] methods, which will create instances\n * > of [[PDFFont]] for you.\n *\n * Create an instance of [[PDFFont]] from an existing ref and embedder\n *\n * @param ref The unique reference for this font.\n * @param doc The document to which the font will belong.\n * @param embedder The embedder that will be used to embed the font.\n */\n PDFFont.of = function (ref, doc, embedder) {\n return new PDFFont(ref, doc, embedder);\n };\n return PDFFont;\n}();\nexport default PDFFont;","import { __awaiter, __generator } from \"tslib\";\nimport PDFDocument from \"./PDFDocument\";\nimport { JpegEmbedder, PDFRef, PngEmbedder } from \"../core\";\nimport { assertIs } from \"../utils\";\n/**\n * Represents an image that has been embedded in a [[PDFDocument]].\n */\nvar PDFImage = /** @class */function () {\n function PDFImage(ref, doc, embedder) {\n assertIs(ref, 'ref', [[PDFRef, 'PDFRef']]);\n assertIs(doc, 'doc', [[PDFDocument, 'PDFDocument']]);\n assertIs(embedder, 'embedder', [[JpegEmbedder, 'JpegEmbedder'], [PngEmbedder, 'PngEmbedder']]);\n this.ref = ref;\n this.doc = doc;\n this.width = embedder.width;\n this.height = embedder.height;\n this.embedder = embedder;\n }\n /**\n * Compute the width and height of this image after being scaled by the\n * given `factor`. For example:\n * ```js\n * image.width // => 500\n * image.height // => 250\n *\n * const scaled = image.scale(0.5)\n * scaled.width // => 250\n * scaled.height // => 125\n * ```\n * This operation is often useful before drawing an image with\n * [[PDFPage.drawImage]] to compute the `width` and `height` options.\n * @param factor The factor by which this image should be scaled.\n * @returns The width and height of the image after being scaled.\n */\n PDFImage.prototype.scale = function (factor) {\n assertIs(factor, 'factor', ['number']);\n return {\n width: this.width * factor,\n height: this.height * factor\n };\n };\n /**\n * Get the width and height of this image after scaling it as large as\n * possible while maintaining its aspect ratio and not exceeding the\n * specified `width` and `height`. For example:\n * ```\n * image.width // => 500\n * image.height // => 250\n *\n * const scaled = image.scaleToFit(750, 1000)\n * scaled.width // => 750\n * scaled.height // => 375\n * ```\n * The `width` and `height` parameters can also be thought of as the width\n * and height of a box that the scaled image must fit within.\n * @param width The bounding box's width.\n * @param height The bounding box's height.\n * @returns The width and height of the image after being scaled.\n */\n PDFImage.prototype.scaleToFit = function (width, height) {\n assertIs(width, 'width', ['number']);\n assertIs(height, 'height', ['number']);\n var imgWidthScale = width / this.width;\n var imgHeightScale = height / this.height;\n var scale = Math.min(imgWidthScale, imgHeightScale);\n return this.scale(scale);\n };\n /**\n * Get the width and height of this image. For example:\n * ```js\n * const { width, height } = image.size()\n * ```\n * @returns The width and height of the image.\n */\n PDFImage.prototype.size = function () {\n return this.scale(1);\n };\n /**\n * > **NOTE:** You probably don't need to call this method directly. The\n * > [[PDFDocument.save]] and [[PDFDocument.saveAsBase64]] methods will\n * > automatically ensure all images get embedded.\n *\n * Embed this image in its document.\n *\n * @returns Resolves when the embedding is complete.\n */\n PDFImage.prototype.embed = function () {\n return __awaiter(this, void 0, void 0, function () {\n var _a, doc, ref;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (!this.embedder) return [2 /*return*/];\n // The image should only be embedded once. If there's a pending embed\n // operation then wait on it. Otherwise we need to start the embed.\n if (!this.embedTask) {\n _a = this, doc = _a.doc, ref = _a.ref;\n this.embedTask = this.embedder.embedIntoContext(doc.context, ref);\n }\n return [4 /*yield*/, this.embedTask];\n case 1:\n _b.sent();\n // We clear `this.embedder` so that the indirectly referenced image data\n // can be garbage collected, thus avoiding a memory leak.\n // See https://github.com/Hopding/pdf-lib/pull/1032/files.\n this.embedder = undefined;\n return [2 /*return*/];\n }\n });\n });\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFDocument.embedPng]] and [[PDFDocument.embedJpg]]\n * > methods, which will create instances of [[PDFImage]] for you.\n *\n * Create an instance of [[PDFImage]] from an existing ref and embedder\n *\n * @param ref The unique reference for this image.\n * @param doc The document to which the image will belong.\n * @param embedder The embedder that will be used to embed the image.\n */\n PDFImage.of = function (ref, doc, embedder) {\n return new PDFImage(ref, doc, embedder);\n };\n return PDFImage;\n}();\nexport default PDFImage;","import { __assign, __spreadArrays } from \"tslib\";\nimport PDFDocument from \"../PDFDocument\";\nimport { colorToComponents, setFillingColor } from \"../colors\";\nimport { toDegrees, rotateRectangle, reduceRotation, adjustDimsForRotation, degrees } from \"../rotations\";\nimport { PDFRef, PDFWidgetAnnotation, PDFName, MethodNotImplementedError, AcroFieldFlags, PDFAcroTerminal, AnnotationFlags } from \"../../core\";\nimport { assertIs, assertMultiple, assertOrUndefined } from \"../../utils\";\nimport { ImageAlignment } from '../image';\nimport { drawImage, rotateInPlace } from '../operations';\nexport var assertFieldAppearanceOptions = function (options) {\n assertOrUndefined(options === null || options === void 0 ? void 0 : options.x, 'options.x', ['number']);\n assertOrUndefined(options === null || options === void 0 ? void 0 : options.y, 'options.y', ['number']);\n assertOrUndefined(options === null || options === void 0 ? void 0 : options.width, 'options.width', ['number']);\n assertOrUndefined(options === null || options === void 0 ? void 0 : options.height, 'options.height', ['number']);\n assertOrUndefined(options === null || options === void 0 ? void 0 : options.textColor, 'options.textColor', [[Object, 'Color']]);\n assertOrUndefined(options === null || options === void 0 ? void 0 : options.backgroundColor, 'options.backgroundColor', [[Object, 'Color']]);\n assertOrUndefined(options === null || options === void 0 ? void 0 : options.borderColor, 'options.borderColor', [[Object, 'Color']]);\n assertOrUndefined(options === null || options === void 0 ? void 0 : options.borderWidth, 'options.borderWidth', ['number']);\n assertOrUndefined(options === null || options === void 0 ? void 0 : options.rotate, 'options.rotate', [[Object, 'Rotation']]);\n};\n/**\n * Represents a field of a [[PDFForm]].\n *\n * This class is effectively abstract. All fields in a [[PDFForm]] will\n * actually be an instance of a subclass of this class.\n *\n * Note that each field in a PDF is represented by a single field object.\n * However, a given field object may be rendered at multiple locations within\n * the document (across one or more pages). The rendering of a field is\n * controlled by its widgets. Each widget causes its field to be displayed at a\n * particular location in the document.\n *\n * Most of the time each field in a PDF has only a single widget, and thus is\n * only rendered once. However, if a field is rendered multiple times, it will\n * have multiple widgets - one for each location it is rendered.\n *\n * This abstraction of field objects and widgets is defined in the PDF\n * specification and dictates how PDF files store fields and where they are\n * to be rendered.\n */\nvar PDFField = /** @class */function () {\n function PDFField(acroField, ref, doc) {\n assertIs(acroField, 'acroField', [[PDFAcroTerminal, 'PDFAcroTerminal']]);\n assertIs(ref, 'ref', [[PDFRef, 'PDFRef']]);\n assertIs(doc, 'doc', [[PDFDocument, 'PDFDocument']]);\n this.acroField = acroField;\n this.ref = ref;\n this.doc = doc;\n }\n /**\n * Get the fully qualified name of this field. For example:\n * ```js\n * const fields = form.getFields()\n * fields.forEach(field => {\n * const name = field.getName()\n * console.log('Field name:', name)\n * })\n * ```\n * Note that PDF fields are structured as a tree. Each field is the\n * descendent of a series of ancestor nodes all the way up to the form node,\n * which is always the root of the tree. Each node in the tree (except for\n * the form node) has a partial name. Partial names can be composed of any\n * unicode characters except a period (`.`). The fully qualified name of a\n * field is composed of the partial names of all its ancestors joined\n * with periods. This means that splitting the fully qualified name on\n * periods and taking the last element of the resulting array will give you\n * the partial name of a specific field.\n * @returns The fully qualified name of this field.\n */\n PDFField.prototype.getName = function () {\n var _a;\n return (_a = this.acroField.getFullyQualifiedName()) !== null && _a !== void 0 ? _a : '';\n };\n /**\n * Returns `true` if this field is read only. This means that PDF readers\n * will not allow users to interact with the field or change its value. See\n * [[PDFField.enableReadOnly]] and [[PDFField.disableReadOnly]].\n * For example:\n * ```js\n * const field = form.getField('some.field')\n * if (field.isReadOnly()) console.log('Read only is enabled')\n * ```\n * @returns Whether or not this is a read only field.\n */\n PDFField.prototype.isReadOnly = function () {\n return this.acroField.hasFlag(AcroFieldFlags.ReadOnly);\n };\n /**\n * Prevent PDF readers from allowing users to interact with this field or\n * change its value. The field will not respond to mouse or keyboard input.\n * For example:\n * ```js\n * const field = form.getField('some.field')\n * field.enableReadOnly()\n * ```\n * Useful for fields whose values are computed, imported from a database, or\n * prefilled by software before being displayed to the user.\n */\n PDFField.prototype.enableReadOnly = function () {\n this.acroField.setFlagTo(AcroFieldFlags.ReadOnly, true);\n };\n /**\n * Allow users to interact with this field and change its value in PDF\n * readers via mouse and keyboard input. For example:\n * ```js\n * const field = form.getField('some.field')\n * field.disableReadOnly()\n * ```\n */\n PDFField.prototype.disableReadOnly = function () {\n this.acroField.setFlagTo(AcroFieldFlags.ReadOnly, false);\n };\n /**\n * Returns `true` if this field must have a value when the form is submitted.\n * See [[PDFField.enableRequired]] and [[PDFField.disableRequired]].\n * For example:\n * ```js\n * const field = form.getField('some.field')\n * if (field.isRequired()) console.log('Field is required')\n * ```\n * @returns Whether or not this field is required.\n */\n PDFField.prototype.isRequired = function () {\n return this.acroField.hasFlag(AcroFieldFlags.Required);\n };\n /**\n * Require this field to have a value when the form is submitted.\n * For example:\n * ```js\n * const field = form.getField('some.field')\n * field.enableRequired()\n * ```\n */\n PDFField.prototype.enableRequired = function () {\n this.acroField.setFlagTo(AcroFieldFlags.Required, true);\n };\n /**\n * Do not require this field to have a value when the form is submitted.\n * For example:\n * ```js\n * const field = form.getField('some.field')\n * field.disableRequired()\n * ```\n */\n PDFField.prototype.disableRequired = function () {\n this.acroField.setFlagTo(AcroFieldFlags.Required, false);\n };\n /**\n * Returns `true` if this field's value should be exported when the form is\n * submitted. See [[PDFField.enableExporting]] and\n * [[PDFField.disableExporting]].\n * For example:\n * ```js\n * const field = form.getField('some.field')\n * if (field.isExported()) console.log('Exporting is enabled')\n * ```\n * @returns Whether or not this field's value should be exported.\n */\n PDFField.prototype.isExported = function () {\n return !this.acroField.hasFlag(AcroFieldFlags.NoExport);\n };\n /**\n * Indicate that this field's value should be exported when the form is\n * submitted in a PDF reader. For example:\n * ```js\n * const field = form.getField('some.field')\n * field.enableExporting()\n * ```\n */\n PDFField.prototype.enableExporting = function () {\n this.acroField.setFlagTo(AcroFieldFlags.NoExport, false);\n };\n /**\n * Indicate that this field's value should **not** be exported when the form\n * is submitted in a PDF reader. For example:\n * ```js\n * const field = form.getField('some.field')\n * field.disableExporting()\n * ```\n */\n PDFField.prototype.disableExporting = function () {\n this.acroField.setFlagTo(AcroFieldFlags.NoExport, true);\n };\n /** @ignore */\n PDFField.prototype.needsAppearancesUpdate = function () {\n throw new MethodNotImplementedError(this.constructor.name, 'needsAppearancesUpdate');\n };\n /** @ignore */\n PDFField.prototype.defaultUpdateAppearances = function (_font) {\n throw new MethodNotImplementedError(this.constructor.name, 'defaultUpdateAppearances');\n };\n PDFField.prototype.markAsDirty = function () {\n this.doc.getForm().markFieldAsDirty(this.ref);\n };\n PDFField.prototype.markAsClean = function () {\n this.doc.getForm().markFieldAsClean(this.ref);\n };\n PDFField.prototype.isDirty = function () {\n return this.doc.getForm().fieldIsDirty(this.ref);\n };\n PDFField.prototype.createWidget = function (options) {\n var _a;\n var textColor = options.textColor;\n var backgroundColor = options.backgroundColor;\n var borderColor = options.borderColor;\n var borderWidth = options.borderWidth;\n var degreesAngle = toDegrees(options.rotate);\n var caption = options.caption;\n var x = options.x;\n var y = options.y;\n var width = options.width + borderWidth;\n var height = options.height + borderWidth;\n var hidden = Boolean(options.hidden);\n var pageRef = options.page;\n assertMultiple(degreesAngle, 'degreesAngle', 90);\n // Create a widget for this field\n var widget = PDFWidgetAnnotation.create(this.doc.context, this.ref);\n // Set widget properties\n var rect = rotateRectangle({\n x: x,\n y: y,\n width: width,\n height: height\n }, borderWidth, degreesAngle);\n widget.setRectangle(rect);\n if (pageRef) widget.setP(pageRef);\n var ac = widget.getOrCreateAppearanceCharacteristics();\n if (backgroundColor) {\n ac.setBackgroundColor(colorToComponents(backgroundColor));\n }\n ac.setRotation(degreesAngle);\n if (caption) ac.setCaptions({\n normal: caption\n });\n if (borderColor) ac.setBorderColor(colorToComponents(borderColor));\n var bs = widget.getOrCreateBorderStyle();\n if (borderWidth !== undefined) bs.setWidth(borderWidth);\n widget.setFlagTo(AnnotationFlags.Print, true);\n widget.setFlagTo(AnnotationFlags.Hidden, hidden);\n widget.setFlagTo(AnnotationFlags.Invisible, false);\n // Set acrofield properties\n if (textColor) {\n var da = (_a = this.acroField.getDefaultAppearance()) !== null && _a !== void 0 ? _a : '';\n var newDa = da + '\\n' + setFillingColor(textColor).toString();\n this.acroField.setDefaultAppearance(newDa);\n }\n return widget;\n };\n PDFField.prototype.updateWidgetAppearanceWithFont = function (widget, font, _a) {\n var normal = _a.normal,\n rollover = _a.rollover,\n down = _a.down;\n this.updateWidgetAppearances(widget, {\n normal: this.createAppearanceStream(widget, normal, font),\n rollover: rollover && this.createAppearanceStream(widget, rollover, font),\n down: down && this.createAppearanceStream(widget, down, font)\n });\n };\n PDFField.prototype.updateOnOffWidgetAppearance = function (widget, onValue, _a) {\n var normal = _a.normal,\n rollover = _a.rollover,\n down = _a.down;\n this.updateWidgetAppearances(widget, {\n normal: this.createAppearanceDict(widget, normal, onValue),\n rollover: rollover && this.createAppearanceDict(widget, rollover, onValue),\n down: down && this.createAppearanceDict(widget, down, onValue)\n });\n };\n PDFField.prototype.updateWidgetAppearances = function (widget, _a) {\n var normal = _a.normal,\n rollover = _a.rollover,\n down = _a.down;\n widget.setNormalAppearance(normal);\n if (rollover) {\n widget.setRolloverAppearance(rollover);\n } else {\n widget.removeRolloverAppearance();\n }\n if (down) {\n widget.setDownAppearance(down);\n } else {\n widget.removeDownAppearance();\n }\n };\n // // TODO: Do we need to do this...?\n // private foo(font: PDFFont, dict: PDFDict) {\n // if (!dict.lookup(PDFName.of('DR'))) {\n // dict.set(PDFName.of('DR'), dict.context.obj({}));\n // }\n // const DR = dict.lookup(PDFName.of('DR'), PDFDict);\n // if (!DR.lookup(PDFName.of('Font'))) {\n // DR.set(PDFName.of('Font'), dict.context.obj({}));\n // }\n // const Font = DR.lookup(PDFName.of('Font'), PDFDict);\n // Font.set(PDFName.of(font.name), font.ref);\n // }\n PDFField.prototype.createAppearanceStream = function (widget, appearance, font) {\n var _a;\n var context = this.acroField.dict.context;\n var _b = widget.getRectangle(),\n width = _b.width,\n height = _b.height;\n // TODO: Do we need to do this...?\n // if (font) {\n // this.foo(font, widget.dict);\n // this.foo(font, this.doc.getForm().acroForm.dict);\n // }\n // END TODO\n var Resources = font && {\n Font: (_a = {}, _a[font.name] = font.ref, _a)\n };\n var stream = context.formXObject(appearance, {\n Resources: Resources,\n BBox: context.obj([0, 0, width, height]),\n Matrix: context.obj([1, 0, 0, 1, 0, 0])\n });\n var streamRef = context.register(stream);\n return streamRef;\n };\n /**\n * Create a FormXObject of the supplied image and add it to context.\n * The FormXObject size is calculated based on the widget (including\n * the alignment).\n * @param widget The widget that should display the image.\n * @param alignment The alignment of the image.\n * @param image The image that should be displayed.\n * @returns The ref for the FormXObject that was added to the context.\n */\n PDFField.prototype.createImageAppearanceStream = function (widget, image, alignment) {\n // NOTE: This implementation doesn't handle image borders.\n // NOTE: Acrobat seems to resize the image (maybe even skewing its aspect\n // ratio) to fit perfectly within the widget's rectangle. This method\n // does not currently do that. Should there be an option for that?\n var _a;\n var _b;\n var context = this.acroField.dict.context;\n var rectangle = widget.getRectangle();\n var ap = widget.getAppearanceCharacteristics();\n var bs = widget.getBorderStyle();\n var borderWidth = (_b = bs === null || bs === void 0 ? void 0 : bs.getWidth()) !== null && _b !== void 0 ? _b : 0;\n var rotation = reduceRotation(ap === null || ap === void 0 ? void 0 : ap.getRotation());\n var rotate = rotateInPlace(__assign(__assign({}, rectangle), {\n rotation: rotation\n }));\n var adj = adjustDimsForRotation(rectangle, rotation);\n var imageDims = image.scaleToFit(adj.width - borderWidth * 2, adj.height - borderWidth * 2);\n // Support borders on images and maybe other properties\n var options = {\n x: borderWidth,\n y: borderWidth,\n width: imageDims.width,\n height: imageDims.height,\n //\n rotate: degrees(0),\n xSkew: degrees(0),\n ySkew: degrees(0)\n };\n if (alignment === ImageAlignment.Center) {\n options.x += (adj.width - borderWidth * 2) / 2 - imageDims.width / 2;\n options.y += (adj.height - borderWidth * 2) / 2 - imageDims.height / 2;\n } else if (alignment === ImageAlignment.Right) {\n options.x = adj.width - borderWidth - imageDims.width;\n options.y = adj.height - borderWidth - imageDims.height;\n }\n var imageName = this.doc.context.addRandomSuffix('Image', 10);\n var appearance = __spreadArrays(rotate, drawImage(imageName, options));\n ////////////\n var Resources = {\n XObject: (_a = {}, _a[imageName] = image.ref, _a)\n };\n var stream = context.formXObject(appearance, {\n Resources: Resources,\n BBox: context.obj([0, 0, rectangle.width, rectangle.height]),\n Matrix: context.obj([1, 0, 0, 1, 0, 0])\n });\n return context.register(stream);\n };\n PDFField.prototype.createAppearanceDict = function (widget, appearance, onValue) {\n var context = this.acroField.dict.context;\n var onStreamRef = this.createAppearanceStream(widget, appearance.on);\n var offStreamRef = this.createAppearanceStream(widget, appearance.off);\n var appearanceDict = context.obj({});\n appearanceDict.set(onValue, onStreamRef);\n appearanceDict.set(PDFName.of('Off'), offStreamRef);\n return appearanceDict;\n };\n return PDFField;\n}();\nexport default PDFField;","export var StandardFonts;\n(function (StandardFonts) {\n StandardFonts[\"Courier\"] = \"Courier\";\n StandardFonts[\"CourierBold\"] = \"Courier-Bold\";\n StandardFonts[\"CourierOblique\"] = \"Courier-Oblique\";\n StandardFonts[\"CourierBoldOblique\"] = \"Courier-BoldOblique\";\n StandardFonts[\"Helvetica\"] = \"Helvetica\";\n StandardFonts[\"HelveticaBold\"] = \"Helvetica-Bold\";\n StandardFonts[\"HelveticaOblique\"] = \"Helvetica-Oblique\";\n StandardFonts[\"HelveticaBoldOblique\"] = \"Helvetica-BoldOblique\";\n StandardFonts[\"TimesRoman\"] = \"Times-Roman\";\n StandardFonts[\"TimesRomanBold\"] = \"Times-Bold\";\n StandardFonts[\"TimesRomanItalic\"] = \"Times-Italic\";\n StandardFonts[\"TimesRomanBoldItalic\"] = \"Times-BoldItalic\";\n StandardFonts[\"Symbol\"] = \"Symbol\";\n StandardFonts[\"ZapfDingbats\"] = \"ZapfDingbats\";\n})(StandardFonts || (StandardFonts = {}));","import { __extends } from \"tslib\";\nimport PDFPage from \"../PDFPage\";\nimport { normalizeAppearance, defaultCheckBoxAppearanceProvider } from \"./appearances\";\nimport { rgb } from \"../colors\";\nimport { degrees } from \"../rotations\";\nimport PDFField, { assertFieldAppearanceOptions } from \"./PDFField\";\nimport { PDFName, PDFDict, PDFAcroCheckBox } from \"../../core\";\nimport { assertIs, assertOrUndefined } from \"../../utils\";\n/**\n * Represents a check box field of a [[PDFForm]].\n *\n * [[PDFCheckBox]] fields are interactive boxes that users can click with their\n * mouse. This type of [[PDFField]] has two states: `on` and `off`. The purpose\n * of a check box is to enable users to select from one or more options, where\n * each option is represented by a single check box. Check boxes are typically\n * square in shape and display a check mark when they are in the `on` state.\n */\nvar PDFCheckBox = /** @class */function (_super) {\n __extends(PDFCheckBox, _super);\n function PDFCheckBox(acroCheckBox, ref, doc) {\n var _this = _super.call(this, acroCheckBox, ref, doc) || this;\n assertIs(acroCheckBox, 'acroCheckBox', [[PDFAcroCheckBox, 'PDFAcroCheckBox']]);\n _this.acroField = acroCheckBox;\n return _this;\n }\n /**\n * Mark this check box. This operation is analogous to a human user clicking\n * a check box to fill it in a PDF reader. This method will update the\n * underlying state of the check box field to indicate it has been selected.\n * PDF libraries and readers will be able to extract this value from the\n * saved document and determine that it was selected.\n *\n * For example:\n * ```js\n * const checkBox = form.getCheckBox('some.checkBox.field')\n * checkBox.check()\n * ```\n *\n * This method will mark this check box as dirty, causing its appearance\n * streams to be updated when either [[PDFDocument.save]] or\n * [[PDFForm.updateFieldAppearances]] is called. The updated appearance\n * streams will display a check mark inside the widgets of this check box\n * field.\n */\n PDFCheckBox.prototype.check = function () {\n var _a;\n var onValue = (_a = this.acroField.getOnValue()) !== null && _a !== void 0 ? _a : PDFName.of('Yes');\n this.markAsDirty();\n this.acroField.setValue(onValue);\n };\n /**\n * Clears this check box. This operation is analogous to a human user clicking\n * a check box to unmark it in a PDF reader. This method will update the\n * underlying state of the check box field to indicate it has been deselected.\n * PDF libraries and readers will be able to extract this value from the\n * saved document and determine that it was not selected.\n *\n * For example:\n * ```js\n * const checkBox = form.getCheckBox('some.checkBox.field')\n * checkBox.uncheck()\n * ```\n *\n * This method will mark this check box as dirty. See [[PDFCheckBox.check]]\n * for more details about what this means.\n */\n PDFCheckBox.prototype.uncheck = function () {\n this.markAsDirty();\n this.acroField.setValue(PDFName.of('Off'));\n };\n /**\n * Returns `true` if this check box is selected (either by a human user via\n * a PDF reader, or else programmatically via software). For example:\n * ```js\n * const checkBox = form.getCheckBox('some.checkBox.field')\n * if (checkBox.isChecked()) console.log('check box is selected')\n * ```\n * @returns Whether or not this check box is selected.\n */\n PDFCheckBox.prototype.isChecked = function () {\n var onValue = this.acroField.getOnValue();\n return !!onValue && onValue === this.acroField.getValue();\n };\n /**\n * Show this check box on the specified page. For example:\n * ```js\n * const helvetica = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const checkBox = form.createCheckBox('some.checkBox.field')\n *\n * checkBox.addToPage(page, {\n * x: 50,\n * y: 75,\n * width: 25,\n * height: 25,\n * textColor: rgb(1, 0, 0),\n * backgroundColor: rgb(0, 1, 0),\n * borderColor: rgb(0, 0, 1),\n * borderWidth: 2,\n * rotate: degrees(90),\n * })\n * ```\n * This will create a new widget for this check box field.\n * @param page The page to which this check box widget should be added.\n * @param options The options to be used when adding this check box widget.\n */\n PDFCheckBox.prototype.addToPage = function (page, options) {\n var _a, _b, _c, _d, _e, _f;\n assertIs(page, 'page', [[PDFPage, 'PDFPage']]);\n assertFieldAppearanceOptions(options);\n if (!options) options = {};\n if (!('textColor' in options)) options.textColor = rgb(0, 0, 0);\n if (!('backgroundColor' in options)) options.backgroundColor = rgb(1, 1, 1);\n if (!('borderColor' in options)) options.borderColor = rgb(0, 0, 0);\n if (!('borderWidth' in options)) options.borderWidth = 1;\n // Create a widget for this check box\n var widget = this.createWidget({\n x: (_a = options.x) !== null && _a !== void 0 ? _a : 0,\n y: (_b = options.y) !== null && _b !== void 0 ? _b : 0,\n width: (_c = options.width) !== null && _c !== void 0 ? _c : 50,\n height: (_d = options.height) !== null && _d !== void 0 ? _d : 50,\n textColor: options.textColor,\n backgroundColor: options.backgroundColor,\n borderColor: options.borderColor,\n borderWidth: (_e = options.borderWidth) !== null && _e !== void 0 ? _e : 0,\n rotate: (_f = options.rotate) !== null && _f !== void 0 ? _f : degrees(0),\n hidden: options.hidden,\n page: page.ref\n });\n var widgetRef = this.doc.context.register(widget.dict);\n // Add widget to this field\n this.acroField.addWidget(widgetRef);\n // Set appearance streams for widget\n widget.setAppearanceState(PDFName.of('Off'));\n this.updateWidgetAppearance(widget, PDFName.of('Yes'));\n // Add widget to the given page\n page.node.addAnnot(widgetRef);\n };\n /**\n * Returns `true` if any of this check box's widgets do not have an\n * appearance stream for its current state. For example:\n * ```js\n * const checkBox = form.getCheckBox('some.checkBox.field')\n * if (checkBox.needsAppearancesUpdate()) console.log('Needs update')\n * ```\n * @returns Whether or not this check box needs an appearance update.\n */\n PDFCheckBox.prototype.needsAppearancesUpdate = function () {\n var _a;\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var state = widget.getAppearanceState();\n var normal = (_a = widget.getAppearances()) === null || _a === void 0 ? void 0 : _a.normal;\n if (!(normal instanceof PDFDict)) return true;\n if (state && !normal.has(state)) return true;\n }\n return false;\n };\n /**\n * Update the appearance streams for each of this check box's widgets using\n * the default appearance provider for check boxes. For example:\n * ```js\n * const checkBox = form.getCheckBox('some.checkBox.field')\n * checkBox.defaultUpdateAppearances()\n * ```\n */\n PDFCheckBox.prototype.defaultUpdateAppearances = function () {\n this.updateAppearances();\n };\n /**\n * Update the appearance streams for each of this check box's widgets using\n * the given appearance provider. If no `provider` is passed, the default\n * appearance provider for check boxs will be used. For example:\n * ```js\n * const checkBox = form.getCheckBox('some.checkBox.field')\n * checkBox.updateAppearances((field, widget) => {\n * ...\n * return {\n * normal: { on: drawCheckBox(...), off: drawCheckBox(...) },\n * down: { on: drawCheckBox(...), off: drawCheckBox(...) },\n * }\n * })\n * ```\n * @param provider Optionally, the appearance provider to be used for\n * generating the contents of the appearance streams.\n */\n PDFCheckBox.prototype.updateAppearances = function (provider) {\n var _a;\n assertOrUndefined(provider, 'provider', [Function]);\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var onValue = (_a = widget.getOnValue()) !== null && _a !== void 0 ? _a : PDFName.of('Yes');\n if (!onValue) continue;\n this.updateWidgetAppearance(widget, onValue, provider);\n }\n this.markAsClean();\n };\n PDFCheckBox.prototype.updateWidgetAppearance = function (widget, onValue, provider) {\n var apProvider = provider !== null && provider !== void 0 ? provider : defaultCheckBoxAppearanceProvider;\n var appearances = normalizeAppearance(apProvider(this, widget));\n this.updateOnOffWidgetAppearance(widget, onValue, appearances);\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFForm.getCheckBox]] method, which will create an\n * > instance of [[PDFCheckBox]] for you.\n *\n * Create an instance of [[PDFCheckBox]] from an existing acroCheckBox and ref\n *\n * @param acroCheckBox The underlying `PDFAcroCheckBox` for this check box.\n * @param ref The unique reference for this check box.\n * @param doc The document to which this check box will belong.\n */\n PDFCheckBox.of = function (acroCheckBox, ref, doc) {\n return new PDFCheckBox(acroCheckBox, ref, doc);\n };\n return PDFCheckBox;\n}(PDFField);\nexport default PDFCheckBox;","import { __extends } from \"tslib\";\nimport PDFPage from \"../PDFPage\";\nimport PDFFont from \"../PDFFont\";\nimport PDFField, { assertFieldAppearanceOptions } from \"./PDFField\";\nimport { normalizeAppearance, defaultDropdownAppearanceProvider } from \"./appearances\";\nimport { rgb } from \"../colors\";\nimport { degrees } from \"../rotations\";\nimport { PDFHexString, PDFStream, PDFAcroComboBox, AcroChoiceFlags } from \"../../core\";\nimport { assertIs, assertOrUndefined, assertPositive } from \"../../utils\";\n/**\n * Represents a dropdown field of a [[PDFForm]].\n *\n * [[PDFDropdown]] fields are interactive text boxes that display a single\n * element (the currently selected value). The purpose of a dropdown is to\n * enable users to select a single option from a set of possible options. Users\n * can click on a dropdown to view the full list of options it provides.\n * Clicking on an option in the list will cause it to be selected and displayed\n * in the dropdown's text box. Some dropdowns allow users to enter text\n * directly into the box from their keyboard, rather than only being allowed to\n * choose an option from the list (see [[PDFDropdown.isEditable]]).\n */\nvar PDFDropdown = /** @class */function (_super) {\n __extends(PDFDropdown, _super);\n function PDFDropdown(acroComboBox, ref, doc) {\n var _this = _super.call(this, acroComboBox, ref, doc) || this;\n assertIs(acroComboBox, 'acroComboBox', [[PDFAcroComboBox, 'PDFAcroComboBox']]);\n _this.acroField = acroComboBox;\n return _this;\n }\n /**\n * Get the list of available options for this dropdown. These options will be\n * displayed to users who click on this dropdown in a PDF reader.\n * For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * const options = dropdown.getOptions()\n * console.log('Dropdown options:', options)\n * ```\n * @returns The options for this dropdown.\n */\n PDFDropdown.prototype.getOptions = function () {\n var rawOptions = this.acroField.getOptions();\n var options = new Array(rawOptions.length);\n for (var idx = 0, len = options.length; idx < len; idx++) {\n var _a = rawOptions[idx],\n display = _a.display,\n value = _a.value;\n options[idx] = (display !== null && display !== void 0 ? display : value).decodeText();\n }\n return options;\n };\n /**\n * Get the selected options for this dropdown. These are the values that were\n * selected by a human user via a PDF reader, or programatically via\n * software.\n * For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * const selections = dropdown.getSelected()\n * console.log('Dropdown selections:', selections)\n * ```\n * > **NOTE:** Note that PDF readers only display one selected option when\n * > rendering dropdowns. However, the PDF specification does allow for\n * > multiple values to be selected in a dropdown. As such, the `pdf-lib`\n * > API supports this. However, in most cases the array returned by this\n * > method will contain only a single element (or no elements).\n * @returns The selected options in this dropdown.\n */\n PDFDropdown.prototype.getSelected = function () {\n var values = this.acroField.getValues();\n var selected = new Array(values.length);\n for (var idx = 0, len = values.length; idx < len; idx++) {\n selected[idx] = values[idx].decodeText();\n }\n return selected;\n };\n /**\n * Set the list of options that are available for this dropdown. These are\n * the values that will be available for users to select when they view this\n * dropdown in a PDF reader. Note that preexisting options for this dropdown\n * will be removed. Only the values passed as `options` will be available to\n * select.\n * For example:\n * ```js\n * const dropdown = form.getDropdown('planets.dropdown')\n * dropdown.setOptions(['Earth', 'Mars', 'Pluto', 'Venus'])\n * ```\n * @param options The options that should be available in this dropdown.\n */\n PDFDropdown.prototype.setOptions = function (options) {\n assertIs(options, 'options', [Array]);\n var optionObjects = new Array(options.length);\n for (var idx = 0, len = options.length; idx < len; idx++) {\n optionObjects[idx] = {\n value: PDFHexString.fromText(options[idx])\n };\n }\n this.acroField.setOptions(optionObjects);\n };\n /**\n * Add to the list of options that are available for this dropdown. Users\n * will be able to select these values in a PDF reader. In addition to the\n * values passed as `options`, any preexisting options for this dropdown will\n * still be available for users to select.\n * For example:\n * ```js\n * const dropdown = form.getDropdown('rockets.dropdown')\n * dropdown.addOptions(['Saturn IV', 'Falcon Heavy'])\n * ```\n * @param options New options that should be available in this dropdown.\n */\n PDFDropdown.prototype.addOptions = function (options) {\n assertIs(options, 'options', ['string', Array]);\n var optionsArr = Array.isArray(options) ? options : [options];\n var existingOptions = this.acroField.getOptions();\n var newOptions = new Array(optionsArr.length);\n for (var idx = 0, len = optionsArr.length; idx < len; idx++) {\n newOptions[idx] = {\n value: PDFHexString.fromText(optionsArr[idx])\n };\n }\n this.acroField.setOptions(existingOptions.concat(newOptions));\n };\n /**\n * Select one or more values for this dropdown. This operation is analogous\n * to a human user opening the dropdown in a PDF reader and clicking on a\n * value to select it. This method will update the underlying state of the\n * dropdown to indicate which values have been selected. PDF libraries and\n * readers will be able to extract these values from the saved document and\n * determine which values were selected.\n *\n * For example:\n * ```js\n * const dropdown = form.getDropdown('best.superhero.dropdown')\n * dropdown.select('One Punch Man')\n * ```\n *\n * This method will mark this dropdown as dirty, causing its appearance\n * streams to be updated when either [[PDFDocument.save]] or\n * [[PDFForm.updateFieldAppearances]] is called. The updated streams will\n * display the selected option inside the widgets of this dropdown.\n *\n * **IMPORTANT:** The default font used to update appearance streams is\n * [[StandardFonts.Helvetica]]. Note that this is a WinAnsi font. This means\n * that encoding errors will be thrown if the selected option for this field\n * contains characters outside the WinAnsi character set (the latin alphabet).\n *\n * Embedding a custom font and passing it to\n * [[PDFForm.updateFieldAppearances]] or [[PDFDropdown.updateAppearances]]\n * allows you to generate appearance streams with characters outside the\n * latin alphabet (assuming the custom font supports them).\n *\n * Selecting an option that does not exist in this dropdown's option list\n * (see [[PDFDropdown.getOptions]]) will enable editing on this dropdown\n * (see [[PDFDropdown.enableEditing]]).\n *\n * > **NOTE:** PDF readers only display one selected option when rendering\n * > dropdowns. However, the PDF specification does allow for multiple values\n * > to be selected in a dropdown. As such, the `pdf-lib` API supports this.\n * > However, it is not recommended to select more than one value with this\n * > method, as only one will be visible. [[PDFOptionList]] fields are better\n * > suited for displaying multiple selected values.\n *\n * @param options The options to be selected.\n * @param merge Whether or not existing selections should be preserved.\n */\n PDFDropdown.prototype.select = function (options, merge) {\n if (merge === void 0) {\n merge = false;\n }\n assertIs(options, 'options', ['string', Array]);\n assertIs(merge, 'merge', ['boolean']);\n var optionsArr = Array.isArray(options) ? options : [options];\n var validOptions = this.getOptions();\n var hasCustomOption = optionsArr.find(function (option) {\n return !validOptions.includes(option);\n });\n if (hasCustomOption) this.enableEditing();\n this.markAsDirty();\n if (optionsArr.length > 1 || optionsArr.length === 1 && merge) {\n this.enableMultiselect();\n }\n var values = new Array(optionsArr.length);\n for (var idx = 0, len = optionsArr.length; idx < len; idx++) {\n values[idx] = PDFHexString.fromText(optionsArr[idx]);\n }\n if (merge) {\n var existingValues = this.acroField.getValues();\n this.acroField.setValues(existingValues.concat(values));\n } else {\n this.acroField.setValues(values);\n }\n };\n /**\n * Clear all selected values for this dropdown. This operation is equivalent\n * to selecting an empty list. This method will update the underlying state\n * of the dropdown to indicate that no values have been selected.\n * For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.clear()\n * ```\n * This method will mark this text field as dirty. See [[PDFDropdown.select]]\n * for more details about what this means.\n */\n PDFDropdown.prototype.clear = function () {\n this.markAsDirty();\n this.acroField.setValues([]);\n };\n /**\n * Set the font size for this field. Larger font sizes will result in larger\n * text being displayed when PDF readers render this dropdown. Font sizes may\n * be integer or floating point numbers. Supplying a negative font size will\n * cause this method to throw an error.\n *\n * For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.setFontSize(4)\n * dropdown.setFontSize(15.7)\n * ```\n *\n * > This method depends upon the existence of a default appearance\n * > (`/DA`) string. If this field does not have a default appearance string,\n * > or that string does not contain a font size (via the `Tf` operator),\n * > then this method will throw an error.\n *\n * @param fontSize The font size to be used when rendering text in this field.\n */\n PDFDropdown.prototype.setFontSize = function (fontSize) {\n assertPositive(fontSize, 'fontSize');\n this.acroField.setFontSize(fontSize);\n this.markAsDirty();\n };\n /**\n * Returns `true` if users are allowed to edit the selected value of this\n * dropdown directly and are not constrained by the list of available\n * options. See [[PDFDropdown.enableEditing]] and\n * [[PDFDropdown.disableEditing]]. For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * if (dropdown.isEditable()) console.log('Editing is enabled')\n * ```\n * @returns Whether or not this dropdown is editable.\n */\n PDFDropdown.prototype.isEditable = function () {\n return this.acroField.hasFlag(AcroChoiceFlags.Edit);\n };\n /**\n * Allow users to edit the selected value of this dropdown in PDF readers\n * with their keyboard. This means that the selected value of this dropdown\n * will not be constrained by the list of available options. However, if this\n * dropdown has any available options, users will still be allowed to select\n * from that list.\n * For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.enableEditing()\n * ```\n */\n PDFDropdown.prototype.enableEditing = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.Edit, true);\n };\n /**\n * Do not allow users to edit the selected value of this dropdown in PDF\n * readers with their keyboard. This will constrain the selected value of\n * this dropdown to the list of available options. Users will only be able\n * to select an option from that list.\n * For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.disableEditing()\n * ```\n */\n PDFDropdown.prototype.disableEditing = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.Edit, false);\n };\n /**\n * Returns `true` if the option list of this dropdown is always displayed\n * in alphabetical order, irrespective of the order in which the options\n * were added to the dropdown. See [[PDFDropdown.enableSorting]] and\n * [[PDFDropdown.disableSorting]]. For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * if (dropdown.isSorted()) console.log('Sorting is enabled')\n * ```\n * @returns Whether or not this dropdown's options are sorted.\n */\n PDFDropdown.prototype.isSorted = function () {\n return this.acroField.hasFlag(AcroChoiceFlags.Sort);\n };\n /**\n * Always display the option list of this dropdown in alphabetical order,\n * irrespective of the order in which the options were added to this dropdown.\n * For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.enableSorting()\n * ```\n */\n PDFDropdown.prototype.enableSorting = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.Sort, true);\n };\n /**\n * Do not always display the option list of this dropdown in alphabetical\n * order. Instead, display the options in whichever order they were added\n * to the list. For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.disableSorting()\n * ```\n */\n PDFDropdown.prototype.disableSorting = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.Sort, false);\n };\n /**\n * Returns `true` if multiple options can be selected from this dropdown's\n * option list. See [[PDFDropdown.enableMultiselect]] and\n * [[PDFDropdown.disableMultiselect]]. For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * if (dropdown.isMultiselect()) console.log('Multiselect is enabled')\n * ```\n * @returns Whether or not multiple options can be selected.\n */\n PDFDropdown.prototype.isMultiselect = function () {\n return this.acroField.hasFlag(AcroChoiceFlags.MultiSelect);\n };\n /**\n * Allow users to select more than one option from this dropdown's option\n * list. For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.enableMultiselect()\n * ```\n */\n PDFDropdown.prototype.enableMultiselect = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.MultiSelect, true);\n };\n /**\n * Do not allow users to select more than one option from this dropdown's\n * option list. For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.disableMultiselect()\n * ```\n */\n PDFDropdown.prototype.disableMultiselect = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.MultiSelect, false);\n };\n /**\n * Returns `true` if the selected option should be spell checked by PDF\n * readers. Spell checking will only be performed if this dropdown allows\n * editing (see [[PDFDropdown.isEditable]]). See\n * [[PDFDropdown.enableSpellChecking]] and\n * [[PDFDropdown.disableSpellChecking]]. For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * if (dropdown.isSpellChecked()) console.log('Spell checking is enabled')\n * ```\n * @returns Whether or not this dropdown can be spell checked.\n */\n PDFDropdown.prototype.isSpellChecked = function () {\n return !this.acroField.hasFlag(AcroChoiceFlags.DoNotSpellCheck);\n };\n /**\n * Allow PDF readers to spell check the selected option of this dropdown.\n * For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.enableSpellChecking()\n * ```\n */\n PDFDropdown.prototype.enableSpellChecking = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.DoNotSpellCheck, false);\n };\n /**\n * Do not allow PDF readers to spell check the selected option of this\n * dropdown. For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.disableSpellChecking()\n * ```\n */\n PDFDropdown.prototype.disableSpellChecking = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.DoNotSpellCheck, true);\n };\n /**\n * Returns `true` if the option selected by a user is stored, or \"committed\",\n * when the user clicks the option. The alternative is that the user's\n * selection is stored when the user leaves this dropdown field (by clicking\n * outside of it - on another field, for example). See\n * [[PDFDropdown.enableSelectOnClick]] and\n * [[PDFDropdown.disableSelectOnClick]]. For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * if (dropdown.isSelectOnClick()) console.log('Select on click is enabled')\n * ```\n * @returns Whether or not options are selected immediately after they are\n * clicked.\n */\n PDFDropdown.prototype.isSelectOnClick = function () {\n return this.acroField.hasFlag(AcroChoiceFlags.CommitOnSelChange);\n };\n /**\n * Store the option selected by a user immediately after the user clicks the\n * option. Do not wait for the user to leave this dropdown field (by clicking\n * outside of it - on another field, for example). For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.enableSelectOnClick()\n * ```\n */\n PDFDropdown.prototype.enableSelectOnClick = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.CommitOnSelChange, true);\n };\n /**\n * Wait to store the option selected by a user until they leave this dropdown\n * field (by clicking outside of it - on another field, for example).\n * For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.disableSelectOnClick()\n * ```\n */\n PDFDropdown.prototype.disableSelectOnClick = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.CommitOnSelChange, false);\n };\n /**\n * Show this dropdown on the specified page. For example:\n * ```js\n * const ubuntuFont = await pdfDoc.embedFont(ubuntuFontBytes)\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const dropdown = form.createDropdown('best.gundam')\n * dropdown.setOptions(['Exia', 'Dynames'])\n * dropdown.select('Exia')\n *\n * dropdown.addToPage(page, {\n * x: 50,\n * y: 75,\n * width: 200,\n * height: 100,\n * textColor: rgb(1, 0, 0),\n * backgroundColor: rgb(0, 1, 0),\n * borderColor: rgb(0, 0, 1),\n * borderWidth: 2,\n * rotate: degrees(90),\n * font: ubuntuFont,\n * })\n * ```\n * This will create a new widget for this dropdown field.\n * @param page The page to which this dropdown widget should be added.\n * @param options The options to be used when adding this dropdown widget.\n */\n PDFDropdown.prototype.addToPage = function (page, options) {\n var _a, _b, _c, _d, _e, _f, _g;\n assertIs(page, 'page', [[PDFPage, 'PDFPage']]);\n assertFieldAppearanceOptions(options);\n if (!options) options = {};\n if (!('textColor' in options)) options.textColor = rgb(0, 0, 0);\n if (!('backgroundColor' in options)) options.backgroundColor = rgb(1, 1, 1);\n if (!('borderColor' in options)) options.borderColor = rgb(0, 0, 0);\n if (!('borderWidth' in options)) options.borderWidth = 1;\n // Create a widget for this dropdown\n var widget = this.createWidget({\n x: (_a = options.x) !== null && _a !== void 0 ? _a : 0,\n y: (_b = options.y) !== null && _b !== void 0 ? _b : 0,\n width: (_c = options.width) !== null && _c !== void 0 ? _c : 200,\n height: (_d = options.height) !== null && _d !== void 0 ? _d : 50,\n textColor: options.textColor,\n backgroundColor: options.backgroundColor,\n borderColor: options.borderColor,\n borderWidth: (_e = options.borderWidth) !== null && _e !== void 0 ? _e : 0,\n rotate: (_f = options.rotate) !== null && _f !== void 0 ? _f : degrees(0),\n hidden: options.hidden,\n page: page.ref\n });\n var widgetRef = this.doc.context.register(widget.dict);\n // Add widget to this field\n this.acroField.addWidget(widgetRef);\n // Set appearance streams for widget\n var font = (_g = options.font) !== null && _g !== void 0 ? _g : this.doc.getForm().getDefaultFont();\n this.updateWidgetAppearance(widget, font);\n // Add widget to the given page\n page.node.addAnnot(widgetRef);\n };\n /**\n * Returns `true` if this dropdown has been marked as dirty, or if any of\n * this dropdown's widgets do not have an appearance stream. For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * if (dropdown.needsAppearancesUpdate()) console.log('Needs update')\n * ```\n * @returns Whether or not this dropdown needs an appearance update.\n */\n PDFDropdown.prototype.needsAppearancesUpdate = function () {\n var _a;\n if (this.isDirty()) return true;\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var hasAppearances = ((_a = widget.getAppearances()) === null || _a === void 0 ? void 0 : _a.normal) instanceof PDFStream;\n if (!hasAppearances) return true;\n }\n return false;\n };\n /**\n * Update the appearance streams for each of this dropdown's widgets using\n * the default appearance provider for dropdowns. For example:\n * ```js\n * const helvetica = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.defaultUpdateAppearances(helvetica)\n * ```\n * @param font The font to be used for creating the appearance streams.\n */\n PDFDropdown.prototype.defaultUpdateAppearances = function (font) {\n assertIs(font, 'font', [[PDFFont, 'PDFFont']]);\n this.updateAppearances(font);\n };\n /**\n * Update the appearance streams for each of this dropdown's widgets using\n * the given appearance provider. If no `provider` is passed, the default\n * appearance provider for dropdowns will be used. For example:\n * ```js\n * const helvetica = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.updateAppearances(helvetica, (field, widget, font) => {\n * ...\n * return drawTextField(...)\n * })\n * ```\n * @param font The font to be used for creating the appearance streams.\n * @param provider Optionally, the appearance provider to be used for\n * generating the contents of the appearance streams.\n */\n PDFDropdown.prototype.updateAppearances = function (font, provider) {\n assertIs(font, 'font', [[PDFFont, 'PDFFont']]);\n assertOrUndefined(provider, 'provider', [Function]);\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n this.updateWidgetAppearance(widget, font, provider);\n }\n this.markAsClean();\n };\n // getOption(index: number): string {}\n // getSelectedIndices(): number[] {}\n // removeOptions(option: string | string[]) {}\n // removeIndices(option: number[]) {}\n // deselect(options: string | string[]) {}\n // deselectIndices(optionIndices: number[]) {}\n PDFDropdown.prototype.updateWidgetAppearance = function (widget, font, provider) {\n var apProvider = provider !== null && provider !== void 0 ? provider : defaultDropdownAppearanceProvider;\n var appearances = normalizeAppearance(apProvider(this, widget, font));\n this.updateWidgetAppearanceWithFont(widget, font, appearances);\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFForm.getDropdown]] method, which will create an\n * > instance of [[PDFDropdown]] for you.\n *\n * Create an instance of [[PDFDropdown]] from an existing acroComboBox and ref\n *\n * @param acroComboBox The underlying `PDFAcroComboBox` for this dropdown.\n * @param ref The unique reference for this dropdown.\n * @param doc The document to which this dropdown will belong.\n */\n PDFDropdown.of = function (acroComboBox, ref, doc) {\n return new PDFDropdown(acroComboBox, ref, doc);\n };\n return PDFDropdown;\n}(PDFField);\nexport default PDFDropdown;","import { __extends } from \"tslib\";\nimport PDFPage from \"../PDFPage\";\nimport PDFFont from \"../PDFFont\";\nimport PDFField, { assertFieldAppearanceOptions } from \"./PDFField\";\nimport { normalizeAppearance, defaultOptionListAppearanceProvider } from \"./appearances\";\nimport { rgb } from \"../colors\";\nimport { degrees } from \"../rotations\";\nimport { PDFHexString, PDFStream, PDFAcroListBox, AcroChoiceFlags } from \"../../core\";\nimport { assertIs, assertIsSubset, assertOrUndefined, assertPositive } from \"../../utils\";\n/**\n * Represents an option list field of a [[PDFForm]].\n *\n * [[PDFOptionList]] fields are interactive lists of options. The purpose of an\n * option list is to enable users to select one or more options from a set of\n * possible options. Users are able to see the full set of options without\n * first having to click on the field (though scrolling may be necessary).\n * Clicking an option in the list will cause it to be selected and displayed\n * with a highlighted background. Some option lists allow users to select\n * more than one option (see [[PDFOptionList.isMultiselect]]).\n */\nvar PDFOptionList = /** @class */function (_super) {\n __extends(PDFOptionList, _super);\n function PDFOptionList(acroListBox, ref, doc) {\n var _this = _super.call(this, acroListBox, ref, doc) || this;\n assertIs(acroListBox, 'acroListBox', [[PDFAcroListBox, 'PDFAcroListBox']]);\n _this.acroField = acroListBox;\n return _this;\n }\n /**\n * Get the list of available options for this option list. These options will\n * be displayed to users who view this option list in a PDF reader.\n * For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * const options = optionList.getOptions()\n * console.log('Option List options:', options)\n * ```\n * @returns The options for this option list.\n */\n PDFOptionList.prototype.getOptions = function () {\n var rawOptions = this.acroField.getOptions();\n var options = new Array(rawOptions.length);\n for (var idx = 0, len = options.length; idx < len; idx++) {\n var _a = rawOptions[idx],\n display = _a.display,\n value = _a.value;\n options[idx] = (display !== null && display !== void 0 ? display : value).decodeText();\n }\n return options;\n };\n /**\n * Get the selected options for this option list. These are the values that\n * were selected by a human user via a PDF reader, or programatically via\n * software.\n * For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * const selections = optionList.getSelected()\n * console.log('Option List selections:', selections)\n * ```\n * @returns The selected options for this option list.\n */\n PDFOptionList.prototype.getSelected = function () {\n var values = this.acroField.getValues();\n var selected = new Array(values.length);\n for (var idx = 0, len = values.length; idx < len; idx++) {\n selected[idx] = values[idx].decodeText();\n }\n return selected;\n };\n /**\n * Set the list of options that are available for this option list. These are\n * the values that will be available for users to select when they view this\n * option list in a PDF reader. Note that preexisting options for this\n * option list will be removed. Only the values passed as `options` will be\n * available to select.\n *\n * For example:\n * ```js\n * const optionList = form.getOptionList('planets.optionList')\n * optionList.setOptions(['Earth', 'Mars', 'Pluto', 'Venus'])\n * ```\n *\n * This method will mark this option list as dirty, causing its appearance\n * streams to be updated when either [[PDFDocument.save]] or\n * [[PDFForm.updateFieldAppearances]] is called. The updated streams will\n * display the options this field contains inside the widgets of this text\n * field (with selected options highlighted).\n *\n * **IMPORTANT:** The default font used to update appearance streams is\n * [[StandardFonts.Helvetica]]. Note that this is a WinAnsi font. This means\n * that encoding errors will be thrown if this field contains any options\n * with characters outside the WinAnsi character set (the latin alphabet).\n *\n * Embedding a custom font and passing it to\n * [[PDFForm.updateFieldAppearances]] or [[PDFOptionList.updateAppearances]]\n * allows you to generate appearance streams with characters outside the\n * latin alphabet (assuming the custom font supports them).\n *\n * @param options The options that should be available in this option list.\n */\n PDFOptionList.prototype.setOptions = function (options) {\n assertIs(options, 'options', [Array]);\n this.markAsDirty();\n var optionObjects = new Array(options.length);\n for (var idx = 0, len = options.length; idx < len; idx++) {\n optionObjects[idx] = {\n value: PDFHexString.fromText(options[idx])\n };\n }\n this.acroField.setOptions(optionObjects);\n };\n /**\n * Add to the list of options that are available for this option list. Users\n * will be able to select these values in a PDF reader. In addition to the\n * values passed as `options`, any preexisting options for this option list\n * will still be available for users to select.\n * For example:\n * ```js\n * const optionList = form.getOptionList('rockets.optionList')\n * optionList.addOptions(['Saturn IV', 'Falcon Heavy'])\n * ```\n * This method will mark this option list as dirty. See\n * [[PDFOptionList.setOptions]] for more details about what this means.\n * @param options New options that should be available in this option list.\n */\n PDFOptionList.prototype.addOptions = function (options) {\n assertIs(options, 'options', ['string', Array]);\n this.markAsDirty();\n var optionsArr = Array.isArray(options) ? options : [options];\n var existingOptions = this.acroField.getOptions();\n var newOptions = new Array(optionsArr.length);\n for (var idx = 0, len = optionsArr.length; idx < len; idx++) {\n newOptions[idx] = {\n value: PDFHexString.fromText(optionsArr[idx])\n };\n }\n this.acroField.setOptions(existingOptions.concat(newOptions));\n };\n /**\n * Select one or more values for this option list. This operation is analogous\n * to a human user opening the option list in a PDF reader and clicking on one\n * or more values to select them. This method will update the underlying state\n * of the option list to indicate which values have been selected. PDF\n * libraries and readers will be able to extract these values from the saved\n * document and determine which values were selected.\n * For example:\n * ```js\n * const optionList = form.getOptionList('best.superheroes.optionList')\n * optionList.select(['One Punch Man', 'Iron Man'])\n * ```\n * This method will mark this option list as dirty. See\n * [[PDFOptionList.setOptions]] for more details about what this means.\n * @param options The options to be selected.\n * @param merge Whether or not existing selections should be preserved.\n */\n PDFOptionList.prototype.select = function (options, merge) {\n if (merge === void 0) {\n merge = false;\n }\n assertIs(options, 'options', ['string', Array]);\n assertIs(merge, 'merge', ['boolean']);\n var optionsArr = Array.isArray(options) ? options : [options];\n var validOptions = this.getOptions();\n assertIsSubset(optionsArr, 'option', validOptions);\n this.markAsDirty();\n if (optionsArr.length > 1 || optionsArr.length === 1 && merge) {\n this.enableMultiselect();\n }\n var values = new Array(optionsArr.length);\n for (var idx = 0, len = optionsArr.length; idx < len; idx++) {\n values[idx] = PDFHexString.fromText(optionsArr[idx]);\n }\n if (merge) {\n var existingValues = this.acroField.getValues();\n this.acroField.setValues(existingValues.concat(values));\n } else {\n this.acroField.setValues(values);\n }\n };\n /**\n * Clear all selected values for this option list. This operation is\n * equivalent to selecting an empty list. This method will update the\n * underlying state of the option list to indicate that no values have been\n * selected.\n * For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * optionList.clear()\n * ```\n * This method will mark this option list as dirty. See\n * [[PDFOptionList.setOptions]] for more details about what this means.\n */\n PDFOptionList.prototype.clear = function () {\n this.markAsDirty();\n this.acroField.setValues([]);\n };\n /**\n * Set the font size for the text in this field. There needs to be a\n * default appearance string (DA) set with a font value specified\n * for this to work. For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * optionList.setFontSize(4);\n * ```\n * @param fontSize The font size to set the font to.\n */\n /**\n * Set the font size for this field. Larger font sizes will result in larger\n * text being displayed when PDF readers render this option list. Font sizes\n * may be integer or floating point numbers. Supplying a negative font size\n * will cause this method to throw an error.\n *\n * For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * optionList.setFontSize(4)\n * optionList.setFontSize(15.7)\n * ```\n *\n * > This method depends upon the existence of a default appearance\n * > (`/DA`) string. If this field does not have a default appearance string,\n * > or that string does not contain a font size (via the `Tf` operator),\n * > then this method will throw an error.\n *\n * @param fontSize The font size to be used when rendering text in this field.\n */\n PDFOptionList.prototype.setFontSize = function (fontSize) {\n assertPositive(fontSize, 'fontSize');\n this.acroField.setFontSize(fontSize);\n this.markAsDirty();\n };\n /**\n * Returns `true` if the options of this option list are always displayed\n * in alphabetical order, irrespective of the order in which the options\n * were added to the option list. See [[PDFOptionList.enableSorting]] and\n * [[PDFOptionList.disableSorting]]. For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * if (optionList.isSorted()) console.log('Sorting is enabled')\n * ```\n * @returns Whether or not this option list is sorted.\n */\n PDFOptionList.prototype.isSorted = function () {\n return this.acroField.hasFlag(AcroChoiceFlags.Sort);\n };\n /**\n * Always display the options of this option list in alphabetical order,\n * irrespective of the order in which the options were added to this option\n * list.\n * For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * optionList.enableSorting()\n * ```\n */\n PDFOptionList.prototype.enableSorting = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.Sort, true);\n };\n /**\n * Do not always display the options of this option list in alphabetical\n * order. Instead, display the options in whichever order they were added\n * to this option list. For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * optionList.disableSorting()\n * ```\n */\n PDFOptionList.prototype.disableSorting = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.Sort, false);\n };\n /**\n * Returns `true` if multiple options can be selected from this option list.\n * See [[PDFOptionList.enableMultiselect]] and\n * [[PDFOptionList.disableMultiselect]]. For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * if (optionList.isMultiselect()) console.log('Multiselect is enabled')\n * ```\n * @returns Whether or not multiple options can be selected.\n */\n PDFOptionList.prototype.isMultiselect = function () {\n return this.acroField.hasFlag(AcroChoiceFlags.MultiSelect);\n };\n /**\n * Allow users to select more than one option from this option list.\n * For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * optionList.enableMultiselect()\n * ```\n */\n PDFOptionList.prototype.enableMultiselect = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.MultiSelect, true);\n };\n /**\n * Do not allow users to select more than one option from this option list.\n * For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * optionList.disableMultiselect()\n * ```\n */\n PDFOptionList.prototype.disableMultiselect = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.MultiSelect, false);\n };\n /**\n * Returns `true` if the option selected by a user is stored, or \"committed\",\n * when the user clicks the option. The alternative is that the user's\n * selection is stored when the user leaves this option list field (by\n * clicking outside of it - on another field, for example). See\n * [[PDFOptionList.enableSelectOnClick]] and\n * [[PDFOptionList.disableSelectOnClick]]. For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * if (optionList.isSelectOnClick()) console.log('Select on click is enabled')\n * ```\n * @returns Whether or not options are selected immediately after they are\n * clicked.\n */\n PDFOptionList.prototype.isSelectOnClick = function () {\n return this.acroField.hasFlag(AcroChoiceFlags.CommitOnSelChange);\n };\n /**\n * Store the option selected by a user immediately after the user clicks the\n * option. Do not wait for the user to leave this option list field (by\n * clicking outside of it - on another field, for example). For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * optionList.enableSelectOnClick()\n * ```\n */\n PDFOptionList.prototype.enableSelectOnClick = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.CommitOnSelChange, true);\n };\n /**\n * Wait to store the option selected by a user until they leave this option\n * list field (by clicking outside of it - on another field, for example).\n * For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * optionList.disableSelectOnClick()\n * ```\n */\n PDFOptionList.prototype.disableSelectOnClick = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.CommitOnSelChange, false);\n };\n /**\n * Show this option list on the specified page. For example:\n * ```js\n * const ubuntuFont = await pdfDoc.embedFont(ubuntuFontBytes)\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const optionList = form.createOptionList('best.gundams')\n * optionList.setOptions(['Exia', 'Dynames', 'Kyrios', 'Virtue'])\n * optionList.select(['Exia', 'Virtue'])\n *\n * optionList.addToPage(page, {\n * x: 50,\n * y: 75,\n * width: 200,\n * height: 100,\n * textColor: rgb(1, 0, 0),\n * backgroundColor: rgb(0, 1, 0),\n * borderColor: rgb(0, 0, 1),\n * borderWidth: 2,\n * rotate: degrees(90),\n * font: ubuntuFont,\n * })\n * ```\n * This will create a new widget for this option list field.\n * @param page The page to which this option list widget should be added.\n * @param options The options to be used when adding this option list widget.\n */\n PDFOptionList.prototype.addToPage = function (page, options) {\n var _a, _b, _c, _d, _e, _f, _g;\n assertIs(page, 'page', [[PDFPage, 'PDFPage']]);\n assertFieldAppearanceOptions(options);\n if (!options) options = {};\n if (!('textColor' in options)) options.textColor = rgb(0, 0, 0);\n if (!('backgroundColor' in options)) options.backgroundColor = rgb(1, 1, 1);\n if (!('borderColor' in options)) options.borderColor = rgb(0, 0, 0);\n if (!('borderWidth' in options)) options.borderWidth = 1;\n // Create a widget for this option list\n var widget = this.createWidget({\n x: (_a = options.x) !== null && _a !== void 0 ? _a : 0,\n y: (_b = options.y) !== null && _b !== void 0 ? _b : 0,\n width: (_c = options.width) !== null && _c !== void 0 ? _c : 200,\n height: (_d = options.height) !== null && _d !== void 0 ? _d : 100,\n textColor: options.textColor,\n backgroundColor: options.backgroundColor,\n borderColor: options.borderColor,\n borderWidth: (_e = options.borderWidth) !== null && _e !== void 0 ? _e : 0,\n rotate: (_f = options.rotate) !== null && _f !== void 0 ? _f : degrees(0),\n hidden: options.hidden,\n page: page.ref\n });\n var widgetRef = this.doc.context.register(widget.dict);\n // Add widget to this field\n this.acroField.addWidget(widgetRef);\n // Set appearance streams for widget\n var font = (_g = options.font) !== null && _g !== void 0 ? _g : this.doc.getForm().getDefaultFont();\n this.updateWidgetAppearance(widget, font);\n // Add widget to the given page\n page.node.addAnnot(widgetRef);\n };\n /**\n * Returns `true` if this option list has been marked as dirty, or if any of\n * this option list's widgets do not have an appearance stream. For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * if (optionList.needsAppearancesUpdate()) console.log('Needs update')\n * ```\n * @returns Whether or not this option list needs an appearance update.\n */\n PDFOptionList.prototype.needsAppearancesUpdate = function () {\n var _a;\n if (this.isDirty()) return true;\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var hasAppearances = ((_a = widget.getAppearances()) === null || _a === void 0 ? void 0 : _a.normal) instanceof PDFStream;\n if (!hasAppearances) return true;\n }\n return false;\n };\n /**\n * Update the appearance streams for each of this option list's widgets using\n * the default appearance provider for option lists. For example:\n * ```js\n * const helvetica = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const optionList = form.getOptionList('some.optionList.field')\n * optionList.defaultUpdateAppearances(helvetica)\n * ```\n * @param font The font to be used for creating the appearance streams.\n */\n PDFOptionList.prototype.defaultUpdateAppearances = function (font) {\n assertIs(font, 'font', [[PDFFont, 'PDFFont']]);\n this.updateAppearances(font);\n };\n /**\n * Update the appearance streams for each of this option list's widgets using\n * the given appearance provider. If no `provider` is passed, the default\n * appearance provider for option lists will be used. For example:\n * ```js\n * const helvetica = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const optionList = form.getOptionList('some.optionList.field')\n * optionList.updateAppearances(helvetica, (field, widget, font) => {\n * ...\n * return drawOptionList(...)\n * })\n * ```\n * @param font The font to be used for creating the appearance streams.\n * @param provider Optionally, the appearance provider to be used for\n * generating the contents of the appearance streams.\n */\n PDFOptionList.prototype.updateAppearances = function (font, provider) {\n assertIs(font, 'font', [[PDFFont, 'PDFFont']]);\n assertOrUndefined(provider, 'provider', [Function]);\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n this.updateWidgetAppearance(widget, font, provider);\n }\n this.markAsClean();\n };\n // getOption(index: number): string {}\n // getSelectedIndices(): number[] {}\n // removeOptions(option: string | string[]) {}\n // removeIndices(option: number[]) {}\n // deselect(options: string | string[]) {}\n // deselectIndices(optionIndices: number[]) {}\n PDFOptionList.prototype.updateWidgetAppearance = function (widget, font, provider) {\n var apProvider = provider !== null && provider !== void 0 ? provider : defaultOptionListAppearanceProvider;\n var appearances = normalizeAppearance(apProvider(this, widget, font));\n this.updateWidgetAppearanceWithFont(widget, font, appearances);\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFForm.getOptionList]] method, which will create\n * > an instance of [[PDFOptionList]] for you.\n *\n * Create an instance of [[PDFOptionList]] from an existing acroListBox and\n * ref\n *\n * @param acroComboBox The underlying `PDFAcroListBox` for this option list.\n * @param ref The unique reference for this option list.\n * @param doc The document to which this option list will belong.\n */\n PDFOptionList.of = function (acroListBox, ref, doc) {\n return new PDFOptionList(acroListBox, ref, doc);\n };\n return PDFOptionList;\n}(PDFField);\nexport default PDFOptionList;","import { __extends } from \"tslib\";\nimport PDFPage from \"../PDFPage\";\nimport PDFField, { assertFieldAppearanceOptions } from \"./PDFField\";\nimport { normalizeAppearance, defaultRadioGroupAppearanceProvider } from \"./appearances\";\nimport { rgb } from \"../colors\";\nimport { degrees } from \"../rotations\";\nimport { PDFName, PDFHexString, PDFDict, PDFAcroRadioButton, AcroButtonFlags } from \"../../core\";\nimport { assertIs, assertOrUndefined, assertIsOneOf } from \"../../utils\";\n/**\n * Represents a radio group field of a [[PDFForm]].\n *\n * [[PDFRadioGroup]] fields are collections of radio buttons. The purpose of a\n * radio group is to enable users to select one option from a set of mutually\n * exclusive choices. Each choice in a radio group is represented by a radio\n * button. Radio buttons each have two states: `on` and `off`. At most one\n * radio button in a group may be in the `on` state at any time. Users can\n * click on a radio button to select it (and thereby automatically deselect any\n * other radio button that might have already been selected). Some radio\n * groups allow users to toggle a selected radio button `off` by clicking on\n * it (see [[PDFRadioGroup.isOffToggleable]]).\n *\n * Note that some radio groups allow multiple radio buttons to be in the `on`\n * state at the same type **if** they represent the same underlying value (see\n * [[PDFRadioGroup.isMutuallyExclusive]]).\n */\nvar PDFRadioGroup = /** @class */function (_super) {\n __extends(PDFRadioGroup, _super);\n function PDFRadioGroup(acroRadioButton, ref, doc) {\n var _this = _super.call(this, acroRadioButton, ref, doc) || this;\n assertIs(acroRadioButton, 'acroRadioButton', [[PDFAcroRadioButton, 'PDFAcroRadioButton']]);\n _this.acroField = acroRadioButton;\n return _this;\n }\n /**\n * Get the list of available options for this radio group. Each option is\n * represented by a radio button. These radio buttons are displayed at\n * various locations in the document, potentially on different pages (though\n * typically they are stacked horizontally or vertically on the same page).\n * For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * const options = radioGroup.getOptions()\n * console.log('Radio Group options:', options)\n * ```\n * @returns The options for this radio group.\n */\n PDFRadioGroup.prototype.getOptions = function () {\n var exportValues = this.acroField.getExportValues();\n if (exportValues) {\n var exportOptions = new Array(exportValues.length);\n for (var idx = 0, len = exportValues.length; idx < len; idx++) {\n exportOptions[idx] = exportValues[idx].decodeText();\n }\n return exportOptions;\n }\n var onValues = this.acroField.getOnValues();\n var onOptions = new Array(onValues.length);\n for (var idx = 0, len = onOptions.length; idx < len; idx++) {\n onOptions[idx] = onValues[idx].decodeText();\n }\n return onOptions;\n };\n /**\n * Get the selected option for this radio group. The selected option is\n * represented by the radio button in this group that is turned on. At most\n * one radio button in a group can be selected. If no buttons in this group\n * are selected, `undefined` is returned.\n * For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * const selected = radioGroup.getSelected()\n * console.log('Selected radio button:', selected)\n * ```\n * @returns The selected option for this radio group.\n */\n PDFRadioGroup.prototype.getSelected = function () {\n var value = this.acroField.getValue();\n if (value === PDFName.of('Off')) return undefined;\n var exportValues = this.acroField.getExportValues();\n if (exportValues) {\n var onValues = this.acroField.getOnValues();\n for (var idx = 0, len = onValues.length; idx < len; idx++) {\n if (onValues[idx] === value) return exportValues[idx].decodeText();\n }\n }\n return value.decodeText();\n };\n // // TODO: Figure out why this seems to crash Acrobat. Maybe it's because we\n // // aren't removing the widget reference from the page's Annots?\n // removeOption(option: string) {\n // assertIs(option, 'option', ['string']);\n // // TODO: Assert is valid `option`!\n // const onValues = this.acroField.getOnValues();\n // const exportValues = this.acroField.getExportValues();\n // if (exportValues) {\n // for (let idx = 0, len = exportValues.length; idx < len; idx++) {\n // if (exportValues[idx].decodeText() === option) {\n // this.acroField.removeWidget(idx);\n // this.acroField.removeExportValue(idx);\n // }\n // }\n // } else {\n // for (let idx = 0, len = onValues.length; idx < len; idx++) {\n // const value = onValues[idx];\n // if (value.decodeText() === option) {\n // this.acroField.removeWidget(idx);\n // this.acroField.removeExportValue(idx);\n // }\n // }\n // }\n // }\n /**\n * Select an option for this radio group. This operation is analogous to a\n * human user clicking one of the radio buttons in this group via a PDF\n * reader to toggle it on. This method will update the underlying state of\n * the radio group to indicate which option has been selected. PDF libraries\n * and readers will be able to extract this value from the saved document and\n * determine which option was selected.\n *\n * For example:\n * ```js\n * const radioGroup = form.getRadioGroup('best.superhero.radioGroup')\n * radioGroup.select('One Punch Man')\n * ```\n *\n * This method will mark this radio group as dirty, causing its appearance\n * streams to be updated when either [[PDFDocument.save]] or\n * [[PDFForm.updateFieldAppearances]] is called. The updated appearance\n * streams will display a dot inside the widget of this check box field\n * that represents the selected option.\n *\n * @param option The option to be selected.\n */\n PDFRadioGroup.prototype.select = function (option) {\n assertIs(option, 'option', ['string']);\n var validOptions = this.getOptions();\n assertIsOneOf(option, 'option', validOptions);\n this.markAsDirty();\n var onValues = this.acroField.getOnValues();\n var exportValues = this.acroField.getExportValues();\n if (exportValues) {\n for (var idx = 0, len = exportValues.length; idx < len; idx++) {\n if (exportValues[idx].decodeText() === option) {\n this.acroField.setValue(onValues[idx]);\n }\n }\n } else {\n for (var idx = 0, len = onValues.length; idx < len; idx++) {\n var value = onValues[idx];\n if (value.decodeText() === option) this.acroField.setValue(value);\n }\n }\n };\n /**\n * Clear any selected option for this dropdown. This will result in all\n * radio buttons in this group being toggled off. This method will update\n * the underlying state of the dropdown to indicate that no radio buttons\n * have been selected.\n * For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * radioGroup.clear()\n * ```\n * This method will mark this radio group as dirty. See\n * [[PDFRadioGroup.select]] for more details about what this means.\n */\n PDFRadioGroup.prototype.clear = function () {\n this.markAsDirty();\n this.acroField.setValue(PDFName.of('Off'));\n };\n /**\n * Returns `true` if users can click on radio buttons in this group to toggle\n * them off. The alternative is that once a user clicks on a radio button\n * to select it, the only way to deselect it is by selecting on another radio\n * button in the group. See [[PDFRadioGroup.enableOffToggling]] and\n * [[PDFRadioGroup.disableOffToggling]]. For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * if (radioGroup.isOffToggleable()) console.log('Off toggling is enabled')\n * ```\n */\n PDFRadioGroup.prototype.isOffToggleable = function () {\n return !this.acroField.hasFlag(AcroButtonFlags.NoToggleToOff);\n };\n /**\n * Allow users to click on selected radio buttons in this group to toggle\n * them off. For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * radioGroup.enableOffToggling()\n * ```\n * > **NOTE:** This feature is documented in the PDF specification\n * > (Table 226). However, most PDF readers do not respect this option and\n * > prevent users from toggling radio buttons off even when it is enabled.\n * > At the time of this writing (9/6/2020) Mac's Preview software did\n * > respect the option. Adobe Acrobat, Foxit Reader, and Google Chrome did\n * > not.\n */\n PDFRadioGroup.prototype.enableOffToggling = function () {\n this.acroField.setFlagTo(AcroButtonFlags.NoToggleToOff, false);\n };\n /**\n * Prevent users from clicking on selected radio buttons in this group to\n * toggle them off. Clicking on a selected radio button will have no effect.\n * The only way to deselect a selected radio button is to click on a\n * different radio button in the group. For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * radioGroup.disableOffToggling()\n * ```\n */\n PDFRadioGroup.prototype.disableOffToggling = function () {\n this.acroField.setFlagTo(AcroButtonFlags.NoToggleToOff, true);\n };\n /**\n * Returns `true` if the radio buttons in this group are mutually exclusive.\n * This means that when the user selects a radio button, only that specific\n * button will be turned on. Even if other radio buttons in the group\n * represent the same value, they will not be enabled. The alternative to\n * this is that clicking a radio button will select that button along with\n * any other radio buttons in the group that share the same value. See\n * [[PDFRadioGroup.enableMutualExclusion]] and\n * [[PDFRadioGroup.disableMutualExclusion]].\n * For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * if (radioGroup.isMutuallyExclusive()) console.log('Mutual exclusion is enabled')\n * ```\n */\n PDFRadioGroup.prototype.isMutuallyExclusive = function () {\n return !this.acroField.hasFlag(AcroButtonFlags.RadiosInUnison);\n };\n /**\n * When the user clicks a radio button in this group it will be selected. In\n * addition, any other radio buttons in this group that share the same\n * underlying value will also be selected. For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * radioGroup.enableMutualExclusion()\n * ```\n * Note that this option must be enabled prior to adding options to the\n * radio group. It does not currently apply retroactively to existing\n * radio buttons in the group.\n */\n PDFRadioGroup.prototype.enableMutualExclusion = function () {\n this.acroField.setFlagTo(AcroButtonFlags.RadiosInUnison, false);\n };\n /**\n * When the user clicks a radio button in this group only it will be selected.\n * No other radio buttons in the group will be selected, even if they share\n * the same underlying value. For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * radioGroup.disableMutualExclusion()\n * ```\n * Note that this option must be disabled prior to adding options to the\n * radio group. It does not currently apply retroactively to existing\n * radio buttons in the group.\n */\n PDFRadioGroup.prototype.disableMutualExclusion = function () {\n this.acroField.setFlagTo(AcroButtonFlags.RadiosInUnison, true);\n };\n /**\n * Add a new radio button to this group on the specified page. For example:\n * ```js\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const radioGroup = form.createRadioGroup('best.gundam')\n *\n * const options = {\n * x: 50,\n * width: 25,\n * height: 25,\n * textColor: rgb(1, 0, 0),\n * backgroundColor: rgb(0, 1, 0),\n * borderColor: rgb(0, 0, 1),\n * borderWidth: 2,\n * rotate: degrees(90),\n * }\n *\n * radioGroup.addOptionToPage('Exia', page, { ...options, y: 50 })\n * radioGroup.addOptionToPage('Dynames', page, { ...options, y: 110 })\n * ```\n * This will create a new radio button widget for this radio group field.\n * @param option The option that the radio button widget represents.\n * @param page The page to which the radio button widget should be added.\n * @param options The options to be used when adding the radio button widget.\n */\n PDFRadioGroup.prototype.addOptionToPage = function (option, page, options) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\n assertIs(option, 'option', ['string']);\n assertIs(page, 'page', [[PDFPage, 'PDFPage']]);\n assertFieldAppearanceOptions(options);\n // Create a widget for this radio button\n var widget = this.createWidget({\n x: (_a = options === null || options === void 0 ? void 0 : options.x) !== null && _a !== void 0 ? _a : 0,\n y: (_b = options === null || options === void 0 ? void 0 : options.y) !== null && _b !== void 0 ? _b : 0,\n width: (_c = options === null || options === void 0 ? void 0 : options.width) !== null && _c !== void 0 ? _c : 50,\n height: (_d = options === null || options === void 0 ? void 0 : options.height) !== null && _d !== void 0 ? _d : 50,\n textColor: (_e = options === null || options === void 0 ? void 0 : options.textColor) !== null && _e !== void 0 ? _e : rgb(0, 0, 0),\n backgroundColor: (_f = options === null || options === void 0 ? void 0 : options.backgroundColor) !== null && _f !== void 0 ? _f : rgb(1, 1, 1),\n borderColor: (_g = options === null || options === void 0 ? void 0 : options.borderColor) !== null && _g !== void 0 ? _g : rgb(0, 0, 0),\n borderWidth: (_h = options === null || options === void 0 ? void 0 : options.borderWidth) !== null && _h !== void 0 ? _h : 1,\n rotate: (_j = options === null || options === void 0 ? void 0 : options.rotate) !== null && _j !== void 0 ? _j : degrees(0),\n hidden: options === null || options === void 0 ? void 0 : options.hidden,\n page: page.ref\n });\n var widgetRef = this.doc.context.register(widget.dict);\n // Add widget to this field\n var apStateValue = this.acroField.addWidgetWithOpt(widgetRef, PDFHexString.fromText(option), !this.isMutuallyExclusive());\n // Set appearance streams for widget\n widget.setAppearanceState(PDFName.of('Off'));\n this.updateWidgetAppearance(widget, apStateValue);\n // Add widget to the given page\n page.node.addAnnot(widgetRef);\n };\n /**\n * Returns `true` if any of this group's radio button widgets do not have an\n * appearance stream for their current state. For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * if (radioGroup.needsAppearancesUpdate()) console.log('Needs update')\n * ```\n * @returns Whether or not this radio group needs an appearance update.\n */\n PDFRadioGroup.prototype.needsAppearancesUpdate = function () {\n var _a;\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var state = widget.getAppearanceState();\n var normal = (_a = widget.getAppearances()) === null || _a === void 0 ? void 0 : _a.normal;\n if (!(normal instanceof PDFDict)) return true;\n if (state && !normal.has(state)) return true;\n }\n return false;\n };\n /**\n * Update the appearance streams for each of this group's radio button widgets\n * using the default appearance provider for radio groups. For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * radioGroup.defaultUpdateAppearances()\n * ```\n */\n PDFRadioGroup.prototype.defaultUpdateAppearances = function () {\n this.updateAppearances();\n };\n // rg.updateAppearances((field: any, widget: any) => {\n // assert(field === rg);\n // assert(widget instanceof PDFWidgetAnnotation);\n // return { on: [...rectangle, ...circle], off: [...rectangle, ...circle] };\n // });\n /**\n * Update the appearance streams for each of this group's radio button widgets\n * using the given appearance provider. If no `provider` is passed, the\n * default appearance provider for radio groups will be used. For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * radioGroup.updateAppearances((field, widget) => {\n * ...\n * return {\n * normal: { on: drawRadioButton(...), off: drawRadioButton(...) },\n * down: { on: drawRadioButton(...), off: drawRadioButton(...) },\n * }\n * })\n * ```\n * @param provider Optionally, the appearance provider to be used for\n * generating the contents of the appearance streams.\n */\n PDFRadioGroup.prototype.updateAppearances = function (provider) {\n assertOrUndefined(provider, 'provider', [Function]);\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var onValue = widget.getOnValue();\n if (!onValue) continue;\n this.updateWidgetAppearance(widget, onValue, provider);\n }\n };\n PDFRadioGroup.prototype.updateWidgetAppearance = function (widget, onValue, provider) {\n var apProvider = provider !== null && provider !== void 0 ? provider : defaultRadioGroupAppearanceProvider;\n var appearances = normalizeAppearance(apProvider(this, widget));\n this.updateOnOffWidgetAppearance(widget, onValue, appearances);\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFForm.getOptionList]] method, which will create an\n * > instance of [[PDFOptionList]] for you.\n *\n * Create an instance of [[PDFOptionList]] from an existing acroRadioButton\n * and ref\n *\n * @param acroRadioButton The underlying `PDFAcroRadioButton` for this\n * radio group.\n * @param ref The unique reference for this radio group.\n * @param doc The document to which this radio group will belong.\n */\n PDFRadioGroup.of = function (acroRadioButton, ref, doc) {\n return new PDFRadioGroup(acroRadioButton, ref, doc);\n };\n return PDFRadioGroup;\n}(PDFField);\nexport default PDFRadioGroup;","import { __extends } from \"tslib\";\nimport PDFField from \"./PDFField\";\nimport { PDFAcroSignature } from \"../../core\";\nimport { assertIs } from \"../../utils\";\n/**\n * Represents a signature field of a [[PDFForm]].\n *\n * [[PDFSignature]] fields are digital signatures. `pdf-lib` does not\n * currently provide any specialized APIs for creating digital signatures or\n * reading the contents of existing digital signatures.\n */\nvar PDFSignature = /** @class */function (_super) {\n __extends(PDFSignature, _super);\n function PDFSignature(acroSignature, ref, doc) {\n var _this = _super.call(this, acroSignature, ref, doc) || this;\n assertIs(acroSignature, 'acroSignature', [[PDFAcroSignature, 'PDFAcroSignature']]);\n _this.acroField = acroSignature;\n return _this;\n }\n PDFSignature.prototype.needsAppearancesUpdate = function () {\n return false;\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFForm.getSignature]] method, which will create an\n * > instance of [[PDFSignature]] for you.\n *\n * Create an instance of [[PDFSignature]] from an existing acroSignature and\n * ref\n *\n * @param acroSignature The underlying `PDFAcroSignature` for this signature.\n * @param ref The unique reference for this signature.\n * @param doc The document to which this signature will belong.\n */\n PDFSignature.of = function (acroSignature, ref, doc) {\n return new PDFSignature(acroSignature, ref, doc);\n };\n return PDFSignature;\n}(PDFField);\nexport default PDFSignature;","import { __extends } from \"tslib\";\nimport PDFPage from \"../PDFPage\";\nimport PDFFont from \"../PDFFont\";\nimport PDFField, { assertFieldAppearanceOptions } from \"./PDFField\";\nimport { normalizeAppearance, defaultTextFieldAppearanceProvider } from \"./appearances\";\nimport { rgb } from \"../colors\";\nimport { degrees } from \"../rotations\";\nimport { RichTextFieldReadError, ExceededMaxLengthError, InvalidMaxLengthError } from \"../errors\";\nimport { ImageAlignment } from \"../image/alignment\";\nimport { TextAlignment } from \"../text/alignment\";\nimport { PDFHexString, PDFStream, PDFAcroText, AcroTextFlags } from \"../../core\";\nimport { assertIs, assertIsOneOf, assertOrUndefined, assertPositive, assertRangeOrUndefined } from \"../../utils\";\n/**\n * Represents a text field of a [[PDFForm]].\n *\n * [[PDFTextField]] fields are boxes that display text entered by the user. The\n * purpose of a text field is to enable users to enter text or view text values\n * in the document prefilled by software. Users can click on a text field and\n * input text via their keyboard. Some text fields allow multiple lines of text\n * to be entered (see [[PDFTextField.isMultiline]]).\n */\nvar PDFTextField = /** @class */function (_super) {\n __extends(PDFTextField, _super);\n function PDFTextField(acroText, ref, doc) {\n var _this = _super.call(this, acroText, ref, doc) || this;\n assertIs(acroText, 'acroText', [[PDFAcroText, 'PDFAcroText']]);\n _this.acroField = acroText;\n return _this;\n }\n /**\n * Get the text that this field contains. This text is visible to users who\n * view this field in a PDF reader.\n *\n * For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * const text = textField.getText()\n * console.log('Text field contents:', text)\n * ```\n *\n * Note that if this text field contains no underlying value, `undefined`\n * will be returned. Text fields may also contain an underlying value that\n * is simply an empty string (`''`). This detail is largely irrelevant for\n * most applications. In general, you'll want to treat both cases the same\n * way and simply consider the text field to be empty. In either case, the\n * text field will appear empty to users when viewed in a PDF reader.\n *\n * An error will be thrown if this is a rich text field. `pdf-lib` does not\n * support reading rich text fields. Nor do most PDF readers and writers.\n * Rich text fields are based on XFA (XML Forms Architecture). Relatively few\n * PDFs use rich text fields or XFA. Unlike PDF itself, XFA is not an ISO\n * standard. XFA has been deprecated in PDF 2.0:\n * * https://en.wikipedia.org/wiki/XFA\n * * http://blog.pdfshareforms.com/pdf-2-0-release-bid-farewell-xfa-forms/\n *\n * @returns The text contained in this text field.\n */\n PDFTextField.prototype.getText = function () {\n var value = this.acroField.getValue();\n if (!value && this.isRichFormatted()) {\n throw new RichTextFieldReadError(this.getName());\n }\n return value === null || value === void 0 ? void 0 : value.decodeText();\n };\n /**\n * Set the text for this field. This operation is analogous to a human user\n * clicking on the text field in a PDF reader and typing in text via their\n * keyboard. This method will update the underlying state of the text field\n * to indicate what text has been set. PDF libraries and readers will be able\n * to extract these values from the saved document and determine what text\n * was set.\n *\n * For example:\n * ```js\n * const textField = form.getTextField('best.superhero.text.field')\n * textField.setText('One Punch Man')\n * ```\n *\n * This method will mark this text field as dirty, causing its appearance\n * streams to be updated when either [[PDFDocument.save]] or\n * [[PDFForm.updateFieldAppearances]] is called. The updated streams will\n * display the text this field contains inside the widgets of this text\n * field.\n *\n * **IMPORTANT:** The default font used to update appearance streams is\n * [[StandardFonts.Helvetica]]. Note that this is a WinAnsi font. This means\n * that encoding errors will be thrown if this field contains text outside\n * the WinAnsi character set (the latin alphabet).\n *\n * Embedding a custom font and passing it to\n * [[PDFForm.updateFieldAppearances]] or [[PDFTextField.updateAppearances]]\n * allows you to generate appearance streams with characters outside the\n * latin alphabet (assuming the custom font supports them).\n *\n * If this is a rich text field, it will be converted to a standard text\n * field in order to set the text. `pdf-lib` does not support writing rich\n * text strings. Nor do most PDF readers and writers. See\n * [[PDFTextField.getText]] for more information about rich text fields and\n * their deprecation in PDF 2.0.\n *\n * @param text The text this field should contain.\n */\n PDFTextField.prototype.setText = function (text) {\n assertOrUndefined(text, 'text', ['string']);\n var maxLength = this.getMaxLength();\n if (maxLength !== undefined && text && text.length > maxLength) {\n throw new ExceededMaxLengthError(text.length, maxLength, this.getName());\n }\n this.markAsDirty();\n this.disableRichFormatting();\n if (text) {\n this.acroField.setValue(PDFHexString.fromText(text));\n } else {\n this.acroField.removeValue();\n }\n };\n /**\n * Get the alignment for this text field. This value represents the\n * justification of the text when it is displayed to the user in PDF readers.\n * There are three possible alignments: left, center, and right. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * const alignment = textField.getAlignment()\n * if (alignment === TextAlignment.Left) console.log('Text is left justified')\n * if (alignment === TextAlignment.Center) console.log('Text is centered')\n * if (alignment === TextAlignment.Right) console.log('Text is right justified')\n * ```\n * @returns The alignment of this text field.\n */\n PDFTextField.prototype.getAlignment = function () {\n var quadding = this.acroField.getQuadding();\n // prettier-ignore\n return quadding === 0 ? TextAlignment.Left : quadding === 1 ? TextAlignment.Center : quadding === 2 ? TextAlignment.Right : TextAlignment.Left;\n };\n /**\n * Set the alignment for this text field. This will determine the\n * justification of the text when it is displayed to the user in PDF readers.\n * There are three possible alignments: left, center, and right. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n *\n * // Text will be left justified when displayed\n * textField.setAlignment(TextAlignment.Left)\n *\n * // Text will be centered when displayed\n * textField.setAlignment(TextAlignment.Center)\n *\n * // Text will be right justified when displayed\n * textField.setAlignment(TextAlignment.Right)\n * ```\n * This method will mark this text field as dirty. See\n * [[PDFTextField.setText]] for more details about what this means.\n * @param alignment The alignment for this text field.\n */\n PDFTextField.prototype.setAlignment = function (alignment) {\n assertIsOneOf(alignment, 'alignment', TextAlignment);\n this.markAsDirty();\n this.acroField.setQuadding(alignment);\n };\n /**\n * Get the maximum length of this field. This value represents the maximum\n * number of characters that can be typed into this field by the user. If\n * this field does not have a maximum length, `undefined` is returned.\n * For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * const maxLength = textField.getMaxLength()\n * if (maxLength === undefined) console.log('No max length')\n * else console.log(`Max length is ${maxLength}`)\n * ```\n * @returns The maximum number of characters allowed in this field, or\n * `undefined` if no limit exists.\n */\n PDFTextField.prototype.getMaxLength = function () {\n return this.acroField.getMaxLength();\n };\n /**\n * Set the maximum length of this field. This limits the number of characters\n * that can be typed into this field by the user. This also limits the length\n * of the string that can be passed to [[PDFTextField.setText]]. This limit\n * can be removed by passing `undefined` as `maxLength`. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n *\n * // Allow between 0 and 5 characters to be entered\n * textField.setMaxLength(5)\n *\n * // Allow any number of characters to be entered\n * textField.setMaxLength(undefined)\n * ```\n * This method will mark this text field as dirty. See\n * [[PDFTextField.setText]] for more details about what this means.\n * @param maxLength The maximum number of characters allowed in this field, or\n * `undefined` to remove the limit.\n */\n PDFTextField.prototype.setMaxLength = function (maxLength) {\n assertRangeOrUndefined(maxLength, 'maxLength', 0, Number.MAX_SAFE_INTEGER);\n this.markAsDirty();\n if (maxLength === undefined) {\n this.acroField.removeMaxLength();\n } else {\n var text = this.getText();\n if (text && text.length > maxLength) {\n throw new InvalidMaxLengthError(text.length, maxLength, this.getName());\n }\n this.acroField.setMaxLength(maxLength);\n }\n };\n /**\n * Remove the maximum length for this text field. This allows any number of\n * characters to be typed into this field by the user. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.removeMaxLength()\n * ```\n * Calling this method is equivalent to passing `undefined` to\n * [[PDFTextField.setMaxLength]].\n */\n PDFTextField.prototype.removeMaxLength = function () {\n this.markAsDirty();\n this.acroField.removeMaxLength();\n };\n /**\n * Display an image inside the bounds of this text field's widgets. For example:\n * ```js\n * const pngImage = await pdfDoc.embedPng(...)\n * const textField = form.getTextField('some.text.field')\n * textField.setImage(pngImage)\n * ```\n * This will update the appearances streams for each of this text field's widgets.\n * @param image The image that should be displayed.\n */\n PDFTextField.prototype.setImage = function (image) {\n var fieldAlignment = this.getAlignment();\n // prettier-ignore\n var alignment = fieldAlignment === TextAlignment.Center ? ImageAlignment.Center : fieldAlignment === TextAlignment.Right ? ImageAlignment.Right : ImageAlignment.Left;\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var streamRef = this.createImageAppearanceStream(widget, image, alignment);\n this.updateWidgetAppearances(widget, {\n normal: streamRef\n });\n }\n this.markAsClean();\n };\n /**\n * Set the font size for this field. Larger font sizes will result in larger\n * text being displayed when PDF readers render this text field. Font sizes\n * may be integer or floating point numbers. Supplying a negative font size\n * will cause this method to throw an error.\n *\n * For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.setFontSize(4)\n * textField.setFontSize(15.7)\n * ```\n *\n * > This method depends upon the existence of a default appearance\n * > (`/DA`) string. If this field does not have a default appearance string,\n * > or that string does not contain a font size (via the `Tf` operator),\n * > then this method will throw an error.\n *\n * @param fontSize The font size to be used when rendering text in this field.\n */\n PDFTextField.prototype.setFontSize = function (fontSize) {\n assertPositive(fontSize, 'fontSize');\n this.acroField.setFontSize(fontSize);\n this.markAsDirty();\n };\n /**\n * Returns `true` if each line of text is shown on a new line when this\n * field is displayed in a PDF reader. The alternative is that all lines of\n * text are merged onto a single line when displayed. See\n * [[PDFTextField.enableMultiline]] and [[PDFTextField.disableMultiline]].\n * For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * if (textField.isMultiline()) console.log('Multiline is enabled')\n * ```\n * @returns Whether or not this is a multiline text field.\n */\n PDFTextField.prototype.isMultiline = function () {\n return this.acroField.hasFlag(AcroTextFlags.Multiline);\n };\n /**\n * Display each line of text on a new line when this field is displayed in a\n * PDF reader. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.enableMultiline()\n * ```\n * This method will mark this text field as dirty. See\n * [[PDFTextField.setText]] for more details about what this means.\n */\n PDFTextField.prototype.enableMultiline = function () {\n this.markAsDirty();\n this.acroField.setFlagTo(AcroTextFlags.Multiline, true);\n };\n /**\n * Display each line of text on the same line when this field is displayed\n * in a PDF reader. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.disableMultiline()\n * ```\n * This method will mark this text field as dirty. See\n * [[PDFTextField.setText]] for more details about what this means.\n */\n PDFTextField.prototype.disableMultiline = function () {\n this.markAsDirty();\n this.acroField.setFlagTo(AcroTextFlags.Multiline, false);\n };\n /**\n * Returns `true` if this is a password text field. This means that the field\n * is intended for storing a secure password. See\n * [[PDFTextField.enablePassword]] and [[PDFTextField.disablePassword]].\n * For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * if (textField.isPassword()) console.log('Password is enabled')\n * ```\n * @returns Whether or not this is a password text field.\n */\n PDFTextField.prototype.isPassword = function () {\n return this.acroField.hasFlag(AcroTextFlags.Password);\n };\n /**\n * Indicate that this text field is intended for storing a secure password.\n * For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.enablePassword()\n * ```\n * Values entered into password text fields should not be displayed on the\n * screen by PDF readers. Most PDF readers will display the value as\n * asterisks or bullets. PDF readers should never store values entered by the\n * user into password text fields. Similarly, applications should not\n * write data to a password text field.\n *\n * **Please note that this method does not cause entered values to be\n * encrypted or secured in any way! It simply sets a flag that PDF software\n * and readers can access to determine the _purpose_ of this field.**\n */\n PDFTextField.prototype.enablePassword = function () {\n this.acroField.setFlagTo(AcroTextFlags.Password, true);\n };\n /**\n * Indicate that this text field is **not** intended for storing a secure\n * password. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.disablePassword()\n * ```\n */\n PDFTextField.prototype.disablePassword = function () {\n this.acroField.setFlagTo(AcroTextFlags.Password, false);\n };\n /**\n * Returns `true` if the contents of this text field represent a file path.\n * See [[PDFTextField.enableFileSelection]] and\n * [[PDFTextField.disableFileSelection]]. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * if (textField.isFileSelector()) console.log('Is a file selector')\n * ```\n * @returns Whether or not this field should contain file paths.\n */\n PDFTextField.prototype.isFileSelector = function () {\n return this.acroField.hasFlag(AcroTextFlags.FileSelect);\n };\n /**\n * Indicate that this text field is intended to store a file path. The\n * contents of the file stored at that path should be submitted as the value\n * of the field. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.enableFileSelection()\n * ```\n */\n PDFTextField.prototype.enableFileSelection = function () {\n this.acroField.setFlagTo(AcroTextFlags.FileSelect, true);\n };\n /**\n * Indicate that this text field is **not** intended to store a file path.\n * For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.disableFileSelection()\n * ```\n */\n PDFTextField.prototype.disableFileSelection = function () {\n this.acroField.setFlagTo(AcroTextFlags.FileSelect, false);\n };\n /**\n * Returns `true` if the text entered in this field should be spell checked\n * by PDF readers. See [[PDFTextField.enableSpellChecking]] and\n * [[PDFTextField.disableSpellChecking]]. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * if (textField.isSpellChecked()) console.log('Spell checking is enabled')\n * ```\n * @returns Whether or not this field should be spell checked.\n */\n PDFTextField.prototype.isSpellChecked = function () {\n return !this.acroField.hasFlag(AcroTextFlags.DoNotSpellCheck);\n };\n /**\n * Allow PDF readers to spell check the text entered in this field.\n * For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.enableSpellChecking()\n * ```\n */\n PDFTextField.prototype.enableSpellChecking = function () {\n this.acroField.setFlagTo(AcroTextFlags.DoNotSpellCheck, false);\n };\n /**\n * Do not allow PDF readers to spell check the text entered in this field.\n * For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.disableSpellChecking()\n * ```\n */\n PDFTextField.prototype.disableSpellChecking = function () {\n this.acroField.setFlagTo(AcroTextFlags.DoNotSpellCheck, true);\n };\n /**\n * Returns `true` if PDF readers should allow the user to scroll the text\n * field when its contents do not fit within the field's view bounds. See\n * [[PDFTextField.enableScrolling]] and [[PDFTextField.disableScrolling]].\n * For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * if (textField.isScrollable()) console.log('Scrolling is enabled')\n * ```\n * @returns Whether or not the field is scrollable in PDF readers.\n */\n PDFTextField.prototype.isScrollable = function () {\n return !this.acroField.hasFlag(AcroTextFlags.DoNotScroll);\n };\n /**\n * Allow PDF readers to present a scroll bar to the user when the contents\n * of this text field do not fit within its view bounds. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.enableScrolling()\n * ```\n * A horizontal scroll bar should be shown for singleline fields. A vertical\n * scroll bar should be shown for multiline fields.\n */\n PDFTextField.prototype.enableScrolling = function () {\n this.acroField.setFlagTo(AcroTextFlags.DoNotScroll, false);\n };\n /**\n * Do not allow PDF readers to present a scroll bar to the user when the\n * contents of this text field do not fit within its view bounds. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.disableScrolling()\n * ```\n */\n PDFTextField.prototype.disableScrolling = function () {\n this.acroField.setFlagTo(AcroTextFlags.DoNotScroll, true);\n };\n /**\n * Returns `true` if this is a combed text field. This means that the field\n * is split into `n` equal size cells with one character in each (where `n`\n * is equal to the max length of the text field). The result is that all\n * characters in this field are displayed an equal distance apart from one\n * another. See [[PDFTextField.enableCombing]] and\n * [[PDFTextField.disableCombing]]. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * if (textField.isCombed()) console.log('Combing is enabled')\n * ```\n * Note that in order for a text field to be combed, the following must be\n * true (in addition to enabling combing):\n * * It must not be a multiline field (see [[PDFTextField.isMultiline]])\n * * It must not be a password field (see [[PDFTextField.isPassword]])\n * * It must not be a file selector field (see [[PDFTextField.isFileSelector]])\n * * It must have a max length defined (see [[PDFTextField.setMaxLength]])\n * @returns Whether or not this field is combed.\n */\n PDFTextField.prototype.isCombed = function () {\n return this.acroField.hasFlag(AcroTextFlags.Comb) && !this.isMultiline() && !this.isPassword() && !this.isFileSelector() && this.getMaxLength() !== undefined;\n };\n /**\n * Split this field into `n` equal size cells with one character in each\n * (where `n` is equal to the max length of the text field). This will cause\n * all characters in the field to be displayed an equal distance apart from\n * one another. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.enableCombing()\n * ```\n *\n * In addition to calling this method, text fields must have a max length\n * defined in order to be combed (see [[PDFTextField.setMaxLength]]).\n *\n * This method will also call the following three methods internally:\n * * [[PDFTextField.disableMultiline]]\n * * [[PDFTextField.disablePassword]]\n * * [[PDFTextField.disableFileSelection]]\n *\n * This method will mark this text field as dirty. See\n * [[PDFTextField.setText]] for more details about what this means.\n */\n PDFTextField.prototype.enableCombing = function () {\n if (this.getMaxLength() === undefined) {\n var msg = \"PDFTextFields must have a max length in order to be combed\";\n console.warn(msg);\n }\n this.markAsDirty();\n this.disableMultiline();\n this.disablePassword();\n this.disableFileSelection();\n this.acroField.setFlagTo(AcroTextFlags.Comb, true);\n };\n /**\n * Turn off combing for this text field. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.disableCombing()\n * ```\n * See [[PDFTextField.isCombed]] and [[PDFTextField.enableCombing]] for more\n * information about what combing is.\n *\n * This method will mark this text field as dirty. See\n * [[PDFTextField.setText]] for more details about what this means.\n */\n PDFTextField.prototype.disableCombing = function () {\n this.markAsDirty();\n this.acroField.setFlagTo(AcroTextFlags.Comb, false);\n };\n /**\n * Returns `true` if this text field contains rich text. See\n * [[PDFTextField.enableRichFormatting]] and\n * [[PDFTextField.disableRichFormatting]]. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * if (textField.isRichFormatted()) console.log('Rich formatting enabled')\n * ```\n * @returns Whether or not this field contains rich text.\n */\n PDFTextField.prototype.isRichFormatted = function () {\n return this.acroField.hasFlag(AcroTextFlags.RichText);\n };\n /**\n * Indicate that this field contains XFA data - or rich text. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.enableRichFormatting()\n * ```\n * Note that `pdf-lib` does not support reading or writing rich text fields.\n * Nor do most PDF readers and writers. Rich text fields are based on XFA\n * (XML Forms Architecture). Relatively few PDFs use rich text fields or XFA.\n * Unlike PDF itself, XFA is not an ISO standard. XFA has been deprecated in\n * PDF 2.0:\n * * https://en.wikipedia.org/wiki/XFA\n * * http://blog.pdfshareforms.com/pdf-2-0-release-bid-farewell-xfa-forms/\n */\n PDFTextField.prototype.enableRichFormatting = function () {\n this.acroField.setFlagTo(AcroTextFlags.RichText, true);\n };\n /**\n * Indicate that this is a standard text field that does not XFA data (rich\n * text). For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.disableRichFormatting()\n * ```\n */\n PDFTextField.prototype.disableRichFormatting = function () {\n this.acroField.setFlagTo(AcroTextFlags.RichText, false);\n };\n /**\n * Show this text field on the specified page. For example:\n * ```js\n * const ubuntuFont = await pdfDoc.embedFont(ubuntuFontBytes)\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const textField = form.createTextField('best.gundam')\n * textField.setText('Exia')\n *\n * textField.addToPage(page, {\n * x: 50,\n * y: 75,\n * width: 200,\n * height: 100,\n * textColor: rgb(1, 0, 0),\n * backgroundColor: rgb(0, 1, 0),\n * borderColor: rgb(0, 0, 1),\n * borderWidth: 2,\n * rotate: degrees(90),\n * font: ubuntuFont,\n * })\n * ```\n * This will create a new widget for this text field.\n * @param page The page to which this text field widget should be added.\n * @param options The options to be used when adding this text field widget.\n */\n PDFTextField.prototype.addToPage = function (page, options) {\n var _a, _b, _c, _d, _e, _f, _g;\n assertIs(page, 'page', [[PDFPage, 'PDFPage']]);\n assertFieldAppearanceOptions(options);\n if (!options) options = {};\n if (!('textColor' in options)) options.textColor = rgb(0, 0, 0);\n if (!('backgroundColor' in options)) options.backgroundColor = rgb(1, 1, 1);\n if (!('borderColor' in options)) options.borderColor = rgb(0, 0, 0);\n if (!('borderWidth' in options)) options.borderWidth = 1;\n // Create a widget for this text field\n var widget = this.createWidget({\n x: (_a = options.x) !== null && _a !== void 0 ? _a : 0,\n y: (_b = options.y) !== null && _b !== void 0 ? _b : 0,\n width: (_c = options.width) !== null && _c !== void 0 ? _c : 200,\n height: (_d = options.height) !== null && _d !== void 0 ? _d : 50,\n textColor: options.textColor,\n backgroundColor: options.backgroundColor,\n borderColor: options.borderColor,\n borderWidth: (_e = options.borderWidth) !== null && _e !== void 0 ? _e : 0,\n rotate: (_f = options.rotate) !== null && _f !== void 0 ? _f : degrees(0),\n hidden: options.hidden,\n page: page.ref\n });\n var widgetRef = this.doc.context.register(widget.dict);\n // Add widget to this field\n this.acroField.addWidget(widgetRef);\n // Set appearance streams for widget\n var font = (_g = options.font) !== null && _g !== void 0 ? _g : this.doc.getForm().getDefaultFont();\n this.updateWidgetAppearance(widget, font);\n // Add widget to the given page\n page.node.addAnnot(widgetRef);\n };\n /**\n * Returns `true` if this text field has been marked as dirty, or if any of\n * this text field's widgets do not have an appearance stream. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * if (textField.needsAppearancesUpdate()) console.log('Needs update')\n * ```\n * @returns Whether or not this text field needs an appearance update.\n */\n PDFTextField.prototype.needsAppearancesUpdate = function () {\n var _a;\n if (this.isDirty()) return true;\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var hasAppearances = ((_a = widget.getAppearances()) === null || _a === void 0 ? void 0 : _a.normal) instanceof PDFStream;\n if (!hasAppearances) return true;\n }\n return false;\n };\n /**\n * Update the appearance streams for each of this text field's widgets using\n * the default appearance provider for text fields. For example:\n * ```js\n * const helvetica = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const textField = form.getTextField('some.text.field')\n * textField.defaultUpdateAppearances(helvetica)\n * ```\n * @param font The font to be used for creating the appearance streams.\n */\n PDFTextField.prototype.defaultUpdateAppearances = function (font) {\n assertIs(font, 'font', [[PDFFont, 'PDFFont']]);\n this.updateAppearances(font);\n };\n /**\n * Update the appearance streams for each of this text field's widgets using\n * the given appearance provider. If no `provider` is passed, the default\n * appearance provider for text fields will be used. For example:\n * ```js\n * const helvetica = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const textField = form.getTextField('some.text.field')\n * textField.updateAppearances(helvetica, (field, widget, font) => {\n * ...\n * return drawTextField(...)\n * })\n * ```\n * @param font The font to be used for creating the appearance streams.\n * @param provider Optionally, the appearance provider to be used for\n * generating the contents of the appearance streams.\n */\n PDFTextField.prototype.updateAppearances = function (font, provider) {\n assertIs(font, 'font', [[PDFFont, 'PDFFont']]);\n assertOrUndefined(provider, 'provider', [Function]);\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n this.updateWidgetAppearance(widget, font, provider);\n }\n this.markAsClean();\n };\n PDFTextField.prototype.updateWidgetAppearance = function (widget, font, provider) {\n var apProvider = provider !== null && provider !== void 0 ? provider : defaultTextFieldAppearanceProvider;\n var appearances = normalizeAppearance(apProvider(this, widget, font));\n this.updateWidgetAppearanceWithFont(widget, font, appearances);\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFForm.getTextField]] method, which will create an\n * > instance of [[PDFTextField]] for you.\n *\n * Create an instance of [[PDFTextField]] from an existing acroText and ref\n *\n * @param acroText The underlying `PDFAcroText` for this text field.\n * @param ref The unique reference for this text field.\n * @param doc The document to which this text field will belong.\n */\n PDFTextField.of = function (acroText, ref, doc) {\n return new PDFTextField(acroText, ref, doc);\n };\n return PDFTextField;\n}(PDFField);\nexport default PDFTextField;","import { __assign, __spreadArrays } from \"tslib\";\nimport PDFDocument from \"../PDFDocument\";\nimport PDFButton from \"./PDFButton\";\nimport PDFCheckBox from \"./PDFCheckBox\";\nimport PDFDropdown from \"./PDFDropdown\";\nimport PDFOptionList from \"./PDFOptionList\";\nimport PDFRadioGroup from \"./PDFRadioGroup\";\nimport PDFSignature from \"./PDFSignature\";\nimport PDFTextField from \"./PDFTextField\";\nimport { NoSuchFieldError, UnexpectedFieldTypeError, FieldAlreadyExistsError, InvalidFieldNamePartError } from \"../errors\";\nimport PDFFont from \"../PDFFont\";\nimport { StandardFonts } from \"../StandardFonts\";\nimport { rotateInPlace } from \"../operations\";\nimport { drawObject, popGraphicsState, pushGraphicsState, translate } from \"../operators\";\nimport { PDFAcroForm, PDFAcroCheckBox, PDFAcroComboBox, PDFAcroListBox, PDFAcroRadioButton, PDFAcroSignature, PDFAcroText, PDFAcroPushButton, PDFAcroNonTerminal, PDFDict, PDFRef, createPDFAcroFields, PDFName } from \"../../core\";\nimport { assertIs, Cache, assertOrUndefined } from \"../../utils\";\n/**\n * Represents the interactive form of a [[PDFDocument]].\n *\n * Interactive forms (sometimes called _AcroForms_) are collections of fields\n * designed to gather information from a user. A PDF document may contains any\n * number of fields that appear on various pages, all of which make up a single,\n * global interactive form spanning the entire document. This means that\n * instances of [[PDFDocument]] shall contain at most one [[PDFForm]].\n *\n * The fields of an interactive form are represented by [[PDFField]] instances.\n */\nvar PDFForm = /** @class */function () {\n function PDFForm(acroForm, doc) {\n var _this = this;\n this.embedDefaultFont = function () {\n return _this.doc.embedStandardFont(StandardFonts.Helvetica);\n };\n assertIs(acroForm, 'acroForm', [[PDFAcroForm, 'PDFAcroForm']]);\n assertIs(doc, 'doc', [[PDFDocument, 'PDFDocument']]);\n this.acroForm = acroForm;\n this.doc = doc;\n this.dirtyFields = new Set();\n this.defaultFontCache = Cache.populatedBy(this.embedDefaultFont);\n }\n /**\n * Returns `true` if this [[PDFForm]] has XFA data. Most PDFs with form\n * fields do not use XFA as it is not widely supported by PDF readers.\n *\n * > `pdf-lib` does not support creation, modification, or reading of XFA\n * > fields.\n *\n * For example:\n * ```js\n * const form = pdfDoc.getForm()\n * if (form.hasXFA()) console.log('PDF has XFA data')\n * ```\n * @returns Whether or not this form has XFA data.\n */\n PDFForm.prototype.hasXFA = function () {\n return this.acroForm.dict.has(PDFName.of('XFA'));\n };\n /**\n * Disconnect the XFA data from this [[PDFForm]] (if any exists). This will\n * force readers to fallback to standard fields if the [[PDFDocument]]\n * contains any. For example:\n *\n * For example:\n * ```js\n * const form = pdfDoc.getForm()\n * form.deleteXFA()\n * ```\n */\n PDFForm.prototype.deleteXFA = function () {\n this.acroForm.dict.delete(PDFName.of('XFA'));\n };\n /**\n * Get all fields contained in this [[PDFForm]]. For example:\n * ```js\n * const form = pdfDoc.getForm()\n * const fields = form.getFields()\n * fields.forEach(field => {\n * const type = field.constructor.name\n * const name = field.getName()\n * console.log(`${type}: ${name}`)\n * })\n * ```\n * @returns An array of all fields in this form.\n */\n PDFForm.prototype.getFields = function () {\n var allFields = this.acroForm.getAllFields();\n var fields = [];\n for (var idx = 0, len = allFields.length; idx < len; idx++) {\n var _a = allFields[idx],\n acroField = _a[0],\n ref = _a[1];\n var field = convertToPDFField(acroField, ref, this.doc);\n if (field) fields.push(field);\n }\n return fields;\n };\n /**\n * Get the field in this [[PDFForm]] with the given name. For example:\n * ```js\n * const form = pdfDoc.getForm()\n * const field = form.getFieldMaybe('Page1.Foo.Bar[0]')\n * if (field) console.log('Field exists!')\n * ```\n * @param name A fully qualified field name.\n * @returns The field with the specified name, if one exists.\n */\n PDFForm.prototype.getFieldMaybe = function (name) {\n assertIs(name, 'name', ['string']);\n var fields = this.getFields();\n for (var idx = 0, len = fields.length; idx < len; idx++) {\n var field = fields[idx];\n if (field.getName() === name) return field;\n }\n return undefined;\n };\n /**\n * Get the field in this [[PDFForm]] with the given name. For example:\n * ```js\n * const form = pdfDoc.getForm()\n * const field = form.getField('Page1.Foo.Bar[0]')\n * ```\n * If no field exists with the provided name, an error will be thrown.\n * @param name A fully qualified field name.\n * @returns The field with the specified name.\n */\n PDFForm.prototype.getField = function (name) {\n assertIs(name, 'name', ['string']);\n var field = this.getFieldMaybe(name);\n if (field) return field;\n throw new NoSuchFieldError(name);\n };\n /**\n * Get the button field in this [[PDFForm]] with the given name. For example:\n * ```js\n * const form = pdfDoc.getForm()\n * const button = form.getButton('Page1.Foo.Button[0]')\n * ```\n * An error will be thrown if no field exists with the provided name, or if\n * the field exists but is not a button.\n * @param name A fully qualified button name.\n * @returns The button with the specified name.\n */\n PDFForm.prototype.getButton = function (name) {\n assertIs(name, 'name', ['string']);\n var field = this.getField(name);\n if (field instanceof PDFButton) return field;\n throw new UnexpectedFieldTypeError(name, PDFButton, field);\n };\n /**\n * Get the check box field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const form = pdfDoc.getForm()\n * const checkBox = form.getCheckBox('Page1.Foo.CheckBox[0]')\n * checkBox.check()\n * ```\n * An error will be thrown if no field exists with the provided name, or if\n * the field exists but is not a check box.\n * @param name A fully qualified check box name.\n * @returns The check box with the specified name.\n */\n PDFForm.prototype.getCheckBox = function (name) {\n assertIs(name, 'name', ['string']);\n var field = this.getField(name);\n if (field instanceof PDFCheckBox) return field;\n throw new UnexpectedFieldTypeError(name, PDFCheckBox, field);\n };\n /**\n * Get the dropdown field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const form = pdfDoc.getForm()\n * const dropdown = form.getDropdown('Page1.Foo.Dropdown[0]')\n * const options = dropdown.getOptions()\n * dropdown.select(options[0])\n * ```\n * An error will be thrown if no field exists with the provided name, or if\n * the field exists but is not a dropdown.\n * @param name A fully qualified dropdown name.\n * @returns The dropdown with the specified name.\n */\n PDFForm.prototype.getDropdown = function (name) {\n assertIs(name, 'name', ['string']);\n var field = this.getField(name);\n if (field instanceof PDFDropdown) return field;\n throw new UnexpectedFieldTypeError(name, PDFDropdown, field);\n };\n /**\n * Get the option list field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const form = pdfDoc.getForm()\n * const optionList = form.getOptionList('Page1.Foo.OptionList[0]')\n * const options = optionList.getOptions()\n * optionList.select(options[0])\n * ```\n * An error will be thrown if no field exists with the provided name, or if\n * the field exists but is not an option list.\n * @param name A fully qualified option list name.\n * @returns The option list with the specified name.\n */\n PDFForm.prototype.getOptionList = function (name) {\n assertIs(name, 'name', ['string']);\n var field = this.getField(name);\n if (field instanceof PDFOptionList) return field;\n throw new UnexpectedFieldTypeError(name, PDFOptionList, field);\n };\n /**\n * Get the radio group field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const form = pdfDoc.getForm()\n * const radioGroup = form.getRadioGroup('Page1.Foo.RadioGroup[0]')\n * const options = radioGroup.getOptions()\n * radioGroup.select(options[0])\n * ```\n * An error will be thrown if no field exists with the provided name, or if\n * the field exists but is not a radio group.\n * @param name A fully qualified radio group name.\n * @returns The radio group with the specified name.\n */\n PDFForm.prototype.getRadioGroup = function (name) {\n assertIs(name, 'name', ['string']);\n var field = this.getField(name);\n if (field instanceof PDFRadioGroup) return field;\n throw new UnexpectedFieldTypeError(name, PDFRadioGroup, field);\n };\n /**\n * Get the signature field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const form = pdfDoc.getForm()\n * const signature = form.getSignature('Page1.Foo.Signature[0]')\n * ```\n * An error will be thrown if no field exists with the provided name, or if\n * the field exists but is not a signature.\n * @param name A fully qualified signature name.\n * @returns The signature with the specified name.\n */\n PDFForm.prototype.getSignature = function (name) {\n assertIs(name, 'name', ['string']);\n var field = this.getField(name);\n if (field instanceof PDFSignature) return field;\n throw new UnexpectedFieldTypeError(name, PDFSignature, field);\n };\n /**\n * Get the text field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const form = pdfDoc.getForm()\n * const textField = form.getTextField('Page1.Foo.TextField[0]')\n * textField.setText('Are you designed to act or to be acted upon?')\n * ```\n * An error will be thrown if no field exists with the provided name, or if\n * the field exists but is not a text field.\n * @param name A fully qualified text field name.\n * @returns The text field with the specified name.\n */\n PDFForm.prototype.getTextField = function (name) {\n assertIs(name, 'name', ['string']);\n var field = this.getField(name);\n if (field instanceof PDFTextField) return field;\n throw new UnexpectedFieldTypeError(name, PDFTextField, field);\n };\n /**\n * Create a new button field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const font = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const button = form.createButton('cool.new.button')\n *\n * button.addToPage('Do Stuff', font, page)\n * ```\n * An error will be thrown if a field already exists with the provided name.\n * @param name The fully qualified name for the new button.\n * @returns The new button field.\n */\n PDFForm.prototype.createButton = function (name) {\n assertIs(name, 'name', ['string']);\n var nameParts = splitFieldName(name);\n var parent = this.findOrCreateNonTerminals(nameParts.nonTerminal);\n var button = PDFAcroPushButton.create(this.doc.context);\n button.setPartialName(nameParts.terminal);\n addFieldToParent(parent, [button, button.ref], nameParts.terminal);\n return PDFButton.of(button, button.ref, this.doc);\n };\n /**\n * Create a new check box field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const font = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const checkBox = form.createCheckBox('cool.new.checkBox')\n *\n * checkBox.addToPage(page)\n * ```\n * An error will be thrown if a field already exists with the provided name.\n * @param name The fully qualified name for the new check box.\n * @returns The new check box field.\n */\n PDFForm.prototype.createCheckBox = function (name) {\n assertIs(name, 'name', ['string']);\n var nameParts = splitFieldName(name);\n var parent = this.findOrCreateNonTerminals(nameParts.nonTerminal);\n var checkBox = PDFAcroCheckBox.create(this.doc.context);\n checkBox.setPartialName(nameParts.terminal);\n addFieldToParent(parent, [checkBox, checkBox.ref], nameParts.terminal);\n return PDFCheckBox.of(checkBox, checkBox.ref, this.doc);\n };\n /**\n * Create a new dropdown field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const font = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const dropdown = form.createDropdown('cool.new.dropdown')\n *\n * dropdown.addToPage(font, page)\n * ```\n * An error will be thrown if a field already exists with the provided name.\n * @param name The fully qualified name for the new dropdown.\n * @returns The new dropdown field.\n */\n PDFForm.prototype.createDropdown = function (name) {\n assertIs(name, 'name', ['string']);\n var nameParts = splitFieldName(name);\n var parent = this.findOrCreateNonTerminals(nameParts.nonTerminal);\n var comboBox = PDFAcroComboBox.create(this.doc.context);\n comboBox.setPartialName(nameParts.terminal);\n addFieldToParent(parent, [comboBox, comboBox.ref], nameParts.terminal);\n return PDFDropdown.of(comboBox, comboBox.ref, this.doc);\n };\n /**\n * Create a new option list field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const font = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const optionList = form.createOptionList('cool.new.optionList')\n *\n * optionList.addToPage(font, page)\n * ```\n * An error will be thrown if a field already exists with the provided name.\n * @param name The fully qualified name for the new option list.\n * @returns The new option list field.\n */\n PDFForm.prototype.createOptionList = function (name) {\n assertIs(name, 'name', ['string']);\n var nameParts = splitFieldName(name);\n var parent = this.findOrCreateNonTerminals(nameParts.nonTerminal);\n var listBox = PDFAcroListBox.create(this.doc.context);\n listBox.setPartialName(nameParts.terminal);\n addFieldToParent(parent, [listBox, listBox.ref], nameParts.terminal);\n return PDFOptionList.of(listBox, listBox.ref, this.doc);\n };\n /**\n * Create a new radio group field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const font = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const radioGroup = form.createRadioGroup('cool.new.radioGroup')\n *\n * radioGroup.addOptionToPage('is-dog', page, { y: 0 })\n * radioGroup.addOptionToPage('is-cat', page, { y: 75 })\n * ```\n * An error will be thrown if a field already exists with the provided name.\n * @param name The fully qualified name for the new radio group.\n * @returns The new radio group field.\n */\n PDFForm.prototype.createRadioGroup = function (name) {\n assertIs(name, 'name', ['string']);\n var nameParts = splitFieldName(name);\n var parent = this.findOrCreateNonTerminals(nameParts.nonTerminal);\n var radioButton = PDFAcroRadioButton.create(this.doc.context);\n radioButton.setPartialName(nameParts.terminal);\n addFieldToParent(parent, [radioButton, radioButton.ref], nameParts.terminal);\n return PDFRadioGroup.of(radioButton, radioButton.ref, this.doc);\n };\n /**\n * Create a new text field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const font = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const textField = form.createTextField('cool.new.textField')\n *\n * textField.addToPage(font, page)\n * ```\n * An error will be thrown if a field already exists with the provided name.\n * @param name The fully qualified name for the new radio group.\n * @returns The new radio group field.\n */\n PDFForm.prototype.createTextField = function (name) {\n assertIs(name, 'name', ['string']);\n var nameParts = splitFieldName(name);\n var parent = this.findOrCreateNonTerminals(nameParts.nonTerminal);\n var text = PDFAcroText.create(this.doc.context);\n text.setPartialName(nameParts.terminal);\n addFieldToParent(parent, [text, text.ref], nameParts.terminal);\n return PDFTextField.of(text, text.ref, this.doc);\n };\n /**\n * Flatten all fields in this [[PDFForm]].\n *\n * Flattening a form field will take the current appearance for each of that\n * field's widgets and make them part of their page's content stream. All form\n * fields and annotations associated are then removed. Note that once a form\n * has been flattened its fields can no longer be accessed or edited.\n *\n * This operation is often used after filling form fields to ensure a\n * consistent appearance across different PDF readers and/or printers.\n * Another common use case is to copy a template document with form fields\n * into another document. In this scenario you would load the template\n * document, fill its fields, flatten it, and then copy its pages into the\n * recipient document - the filled fields will be copied over.\n *\n * For example:\n * ```js\n * const form = pdfDoc.getForm();\n * form.flatten();\n * ```\n */\n PDFForm.prototype.flatten = function (options) {\n if (options === void 0) {\n options = {\n updateFieldAppearances: true\n };\n }\n if (options.updateFieldAppearances) {\n this.updateFieldAppearances();\n }\n var fields = this.getFields();\n for (var i = 0, lenFields = fields.length; i < lenFields; i++) {\n var field = fields[i];\n var widgets = field.acroField.getWidgets();\n for (var j = 0, lenWidgets = widgets.length; j < lenWidgets; j++) {\n var widget = widgets[j];\n var page = this.findWidgetPage(widget);\n var widgetRef = this.findWidgetAppearanceRef(field, widget);\n var xObjectKey = page.node.newXObject('FlatWidget', widgetRef);\n var rectangle = widget.getRectangle();\n var operators = __spreadArrays([pushGraphicsState(), translate(rectangle.x, rectangle.y)], rotateInPlace(__assign(__assign({}, rectangle), {\n rotation: 0\n })), [drawObject(xObjectKey), popGraphicsState()]).filter(Boolean);\n page.pushOperators.apply(page, operators);\n }\n this.removeField(field);\n }\n };\n /**\n * Remove a field from this [[PDFForm]].\n *\n * For example:\n * ```js\n * const form = pdfDoc.getForm();\n * const ageField = form.getFields().find(x => x.getName() === 'Age');\n * form.removeField(ageField);\n * ```\n */\n PDFForm.prototype.removeField = function (field) {\n var widgets = field.acroField.getWidgets();\n var pages = new Set();\n for (var i = 0, len = widgets.length; i < len; i++) {\n var widget = widgets[i];\n var widgetRef = this.findWidgetAppearanceRef(field, widget);\n var page = this.findWidgetPage(widget);\n pages.add(page);\n page.node.removeAnnot(widgetRef);\n }\n pages.forEach(function (page) {\n return page.node.removeAnnot(field.ref);\n });\n this.acroForm.removeField(field.acroField);\n var fieldKids = field.acroField.normalizedEntries().Kids;\n var kidsCount = fieldKids.size();\n for (var childIndex = 0; childIndex < kidsCount; childIndex++) {\n var child = fieldKids.get(childIndex);\n if (child instanceof PDFRef) {\n this.doc.context.delete(child);\n }\n }\n this.doc.context.delete(field.ref);\n };\n /**\n * Update the appearance streams for all widgets of all fields in this\n * [[PDFForm]]. Appearance streams will only be created for a widget if it\n * does not have any existing appearance streams, or the field's value has\n * changed (e.g. by calling [[PDFTextField.setText]] or\n * [[PDFDropdown.select]]).\n *\n * For example:\n * ```js\n * const courier = await pdfDoc.embedFont(StandardFonts.Courier)\n * const form = pdfDoc.getForm()\n * form.updateFieldAppearances(courier)\n * ```\n *\n * **IMPORTANT:** The default value for the `font` parameter is\n * [[StandardFonts.Helvetica]]. Note that this is a WinAnsi font. This means\n * that encoding errors will be thrown if any fields contain text with\n * characters outside the WinAnsi character set (the latin alphabet).\n *\n * Embedding a custom font and passing that as the `font`\n * parameter allows you to generate appearance streams with non WinAnsi\n * characters (assuming your custom font supports them).\n *\n * > **NOTE:** The [[PDFDocument.save]] method will call this method to\n * > update appearances automatically if a form was accessed via the\n * > [[PDFDocument.getForm]] method prior to saving.\n *\n * @param font Optionally, the font to use when creating new appearances.\n */\n PDFForm.prototype.updateFieldAppearances = function (font) {\n assertOrUndefined(font, 'font', [[PDFFont, 'PDFFont']]);\n font = font !== null && font !== void 0 ? font : this.getDefaultFont();\n var fields = this.getFields();\n for (var idx = 0, len = fields.length; idx < len; idx++) {\n var field = fields[idx];\n if (field.needsAppearancesUpdate()) {\n field.defaultUpdateAppearances(font);\n }\n }\n };\n /**\n * Mark a field as dirty. This will cause its appearance streams to be\n * updated by [[PDFForm.updateFieldAppearances]].\n * ```js\n * const form = pdfDoc.getForm()\n * const field = form.getField('foo.bar')\n * form.markFieldAsDirty(field.ref)\n * ```\n * @param fieldRef The reference to the field that should be marked.\n */\n PDFForm.prototype.markFieldAsDirty = function (fieldRef) {\n assertOrUndefined(fieldRef, 'fieldRef', [[PDFRef, 'PDFRef']]);\n this.dirtyFields.add(fieldRef);\n };\n /**\n * Mark a field as dirty. This will cause its appearance streams to not be\n * updated by [[PDFForm.updateFieldAppearances]].\n * ```js\n * const form = pdfDoc.getForm()\n * const field = form.getField('foo.bar')\n * form.markFieldAsClean(field.ref)\n * ```\n * @param fieldRef The reference to the field that should be marked.\n */\n PDFForm.prototype.markFieldAsClean = function (fieldRef) {\n assertOrUndefined(fieldRef, 'fieldRef', [[PDFRef, 'PDFRef']]);\n this.dirtyFields.delete(fieldRef);\n };\n /**\n * Returns `true` is the specified field has been marked as dirty.\n * ```js\n * const form = pdfDoc.getForm()\n * const field = form.getField('foo.bar')\n * if (form.fieldIsDirty(field.ref)) console.log('Field is dirty')\n * ```\n * @param fieldRef The reference to the field that should be checked.\n * @returns Whether or not the specified field is dirty.\n */\n PDFForm.prototype.fieldIsDirty = function (fieldRef) {\n assertOrUndefined(fieldRef, 'fieldRef', [[PDFRef, 'PDFRef']]);\n return this.dirtyFields.has(fieldRef);\n };\n PDFForm.prototype.getDefaultFont = function () {\n return this.defaultFontCache.access();\n };\n PDFForm.prototype.findWidgetPage = function (widget) {\n var pageRef = widget.P();\n var page = this.doc.getPages().find(function (x) {\n return x.ref === pageRef;\n });\n if (page === undefined) {\n var widgetRef = this.doc.context.getObjectRef(widget.dict);\n if (widgetRef === undefined) {\n throw new Error('Could not find PDFRef for PDFObject');\n }\n page = this.doc.findPageForAnnotationRef(widgetRef);\n if (page === undefined) {\n throw new Error(\"Could not find page for PDFRef \" + widgetRef);\n }\n }\n return page;\n };\n PDFForm.prototype.findWidgetAppearanceRef = function (field, widget) {\n var _a;\n var refOrDict = widget.getNormalAppearance();\n if (refOrDict instanceof PDFDict && (field instanceof PDFCheckBox || field instanceof PDFRadioGroup)) {\n var value = field.acroField.getValue();\n var ref = (_a = refOrDict.get(value)) !== null && _a !== void 0 ? _a : refOrDict.get(PDFName.of('Off'));\n if (ref instanceof PDFRef) {\n refOrDict = ref;\n }\n }\n if (!(refOrDict instanceof PDFRef)) {\n var name_1 = field.getName();\n throw new Error(\"Failed to extract appearance ref for: \" + name_1);\n }\n return refOrDict;\n };\n PDFForm.prototype.findOrCreateNonTerminals = function (partialNames) {\n var nonTerminal = [this.acroForm];\n for (var idx = 0, len = partialNames.length; idx < len; idx++) {\n var namePart = partialNames[idx];\n if (!namePart) throw new InvalidFieldNamePartError(namePart);\n var parent_1 = nonTerminal[0],\n parentRef = nonTerminal[1];\n var res = this.findNonTerminal(namePart, parent_1);\n if (res) {\n nonTerminal = res;\n } else {\n var node = PDFAcroNonTerminal.create(this.doc.context);\n node.setPartialName(namePart);\n node.setParent(parentRef);\n var nodeRef = this.doc.context.register(node.dict);\n parent_1.addField(nodeRef);\n nonTerminal = [node, nodeRef];\n }\n }\n return nonTerminal;\n };\n PDFForm.prototype.findNonTerminal = function (partialName, parent) {\n var fields = parent instanceof PDFAcroForm ? this.acroForm.getFields() : createPDFAcroFields(parent.Kids());\n for (var idx = 0, len = fields.length; idx < len; idx++) {\n var _a = fields[idx],\n field = _a[0],\n ref = _a[1];\n if (field.getPartialName() === partialName) {\n if (field instanceof PDFAcroNonTerminal) return [field, ref];\n throw new FieldAlreadyExistsError(partialName);\n }\n }\n return undefined;\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFDocument.getForm]] method, which will create an\n * > instance of [[PDFForm]] for you.\n *\n * Create an instance of [[PDFForm]] from an existing acroForm and embedder\n *\n * @param acroForm The underlying `PDFAcroForm` for this form.\n * @param doc The document to which the form will belong.\n */\n PDFForm.of = function (acroForm, doc) {\n return new PDFForm(acroForm, doc);\n };\n return PDFForm;\n}();\nexport default PDFForm;\nvar convertToPDFField = function (field, ref, doc) {\n if (field instanceof PDFAcroPushButton) return PDFButton.of(field, ref, doc);\n if (field instanceof PDFAcroCheckBox) return PDFCheckBox.of(field, ref, doc);\n if (field instanceof PDFAcroComboBox) return PDFDropdown.of(field, ref, doc);\n if (field instanceof PDFAcroListBox) return PDFOptionList.of(field, ref, doc);\n if (field instanceof PDFAcroText) return PDFTextField.of(field, ref, doc);\n if (field instanceof PDFAcroRadioButton) {\n return PDFRadioGroup.of(field, ref, doc);\n }\n if (field instanceof PDFAcroSignature) {\n return PDFSignature.of(field, ref, doc);\n }\n return undefined;\n};\nvar splitFieldName = function (fullyQualifiedName) {\n if (fullyQualifiedName.length === 0) {\n throw new Error('PDF field names must not be empty strings');\n }\n var parts = fullyQualifiedName.split('.');\n for (var idx = 0, len = parts.length; idx < len; idx++) {\n if (parts[idx] === '') {\n throw new Error(\"Periods in PDF field names must be separated by at least one character: \\\"\" + fullyQualifiedName + \"\\\"\");\n }\n }\n if (parts.length === 1) return {\n nonTerminal: [],\n terminal: parts[0]\n };\n return {\n nonTerminal: parts.slice(0, parts.length - 1),\n terminal: parts[parts.length - 1]\n };\n};\nvar addFieldToParent = function (_a, _b, partialName) {\n var parent = _a[0],\n parentRef = _a[1];\n var field = _b[0],\n fieldRef = _b[1];\n var entries = parent.normalizedEntries();\n var fields = createPDFAcroFields('Kids' in entries ? entries.Kids : entries.Fields);\n for (var idx = 0, len = fields.length; idx < len; idx++) {\n if (fields[idx][0].getPartialName() === partialName) {\n throw new FieldAlreadyExistsError(partialName);\n }\n }\n parent.addField(fieldRef);\n field.setParent(parentRef);\n};","export var ParseSpeeds;\n(function (ParseSpeeds) {\n ParseSpeeds[ParseSpeeds[\"Fastest\"] = Infinity] = \"Fastest\";\n ParseSpeeds[ParseSpeeds[\"Fast\"] = 1500] = \"Fast\";\n ParseSpeeds[ParseSpeeds[\"Medium\"] = 500] = \"Medium\";\n ParseSpeeds[ParseSpeeds[\"Slow\"] = 100] = \"Slow\";\n})(ParseSpeeds || (ParseSpeeds = {}));","export var PageSizes = {\n '4A0': [4767.87, 6740.79],\n '2A0': [3370.39, 4767.87],\n A0: [2383.94, 3370.39],\n A1: [1683.78, 2383.94],\n A2: [1190.55, 1683.78],\n A3: [841.89, 1190.55],\n A4: [595.28, 841.89],\n A5: [419.53, 595.28],\n A6: [297.64, 419.53],\n A7: [209.76, 297.64],\n A8: [147.4, 209.76],\n A9: [104.88, 147.4],\n A10: [73.7, 104.88],\n B0: [2834.65, 4008.19],\n B1: [2004.09, 2834.65],\n B2: [1417.32, 2004.09],\n B3: [1000.63, 1417.32],\n B4: [708.66, 1000.63],\n B5: [498.9, 708.66],\n B6: [354.33, 498.9],\n B7: [249.45, 354.33],\n B8: [175.75, 249.45],\n B9: [124.72, 175.75],\n B10: [87.87, 124.72],\n C0: [2599.37, 3676.54],\n C1: [1836.85, 2599.37],\n C2: [1298.27, 1836.85],\n C3: [918.43, 1298.27],\n C4: [649.13, 918.43],\n C5: [459.21, 649.13],\n C6: [323.15, 459.21],\n C7: [229.61, 323.15],\n C8: [161.57, 229.61],\n C9: [113.39, 161.57],\n C10: [79.37, 113.39],\n RA0: [2437.8, 3458.27],\n RA1: [1729.13, 2437.8],\n RA2: [1218.9, 1729.13],\n RA3: [864.57, 1218.9],\n RA4: [609.45, 864.57],\n SRA0: [2551.18, 3628.35],\n SRA1: [1814.17, 2551.18],\n SRA2: [1275.59, 1814.17],\n SRA3: [907.09, 1275.59],\n SRA4: [637.8, 907.09],\n Executive: [521.86, 756.0],\n Folio: [612.0, 936.0],\n Legal: [612.0, 1008.0],\n Letter: [612.0, 792.0],\n Tabloid: [792.0, 1224.0]\n};","export var BlendMode;\n(function (BlendMode) {\n BlendMode[\"Normal\"] = \"Normal\";\n BlendMode[\"Multiply\"] = \"Multiply\";\n BlendMode[\"Screen\"] = \"Screen\";\n BlendMode[\"Overlay\"] = \"Overlay\";\n BlendMode[\"Darken\"] = \"Darken\";\n BlendMode[\"Lighten\"] = \"Lighten\";\n BlendMode[\"ColorDodge\"] = \"ColorDodge\";\n BlendMode[\"ColorBurn\"] = \"ColorBurn\";\n BlendMode[\"HardLight\"] = \"HardLight\";\n BlendMode[\"SoftLight\"] = \"SoftLight\";\n BlendMode[\"Difference\"] = \"Difference\";\n BlendMode[\"Exclusion\"] = \"Exclusion\";\n})(BlendMode || (BlendMode = {}));","import { __awaiter, __generator } from \"tslib\";\nimport { PDFName, PDFArray, PDFDict, PDFHexString } from \"../core\";\n/**\n * Represents a file that has been embedded in a [[PDFDocument]].\n */\nvar PDFEmbeddedFile = /** @class */function () {\n function PDFEmbeddedFile(ref, doc, embedder) {\n this.alreadyEmbedded = false;\n this.ref = ref;\n this.doc = doc;\n this.embedder = embedder;\n }\n /**\n * > **NOTE:** You probably don't need to call this method directly. The\n * > [[PDFDocument.save]] and [[PDFDocument.saveAsBase64]] methods will\n * > automatically ensure all embeddable files get embedded.\n *\n * Embed this embeddable file in its document.\n *\n * @returns Resolves when the embedding is complete.\n */\n PDFEmbeddedFile.prototype.embed = function () {\n return __awaiter(this, void 0, void 0, function () {\n var ref, Names, EmbeddedFiles, EFNames, AF;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!!this.alreadyEmbedded) return [3 /*break*/, 2];\n return [4 /*yield*/, this.embedder.embedIntoContext(this.doc.context, this.ref)];\n case 1:\n ref = _a.sent();\n if (!this.doc.catalog.has(PDFName.of('Names'))) {\n this.doc.catalog.set(PDFName.of('Names'), this.doc.context.obj({}));\n }\n Names = this.doc.catalog.lookup(PDFName.of('Names'), PDFDict);\n if (!Names.has(PDFName.of('EmbeddedFiles'))) {\n Names.set(PDFName.of('EmbeddedFiles'), this.doc.context.obj({}));\n }\n EmbeddedFiles = Names.lookup(PDFName.of('EmbeddedFiles'), PDFDict);\n if (!EmbeddedFiles.has(PDFName.of('Names'))) {\n EmbeddedFiles.set(PDFName.of('Names'), this.doc.context.obj([]));\n }\n EFNames = EmbeddedFiles.lookup(PDFName.of('Names'), PDFArray);\n EFNames.push(PDFHexString.fromText(this.embedder.fileName));\n EFNames.push(ref);\n /**\n * The AF-Tag is needed to achieve PDF-A3 compliance for embedded files\n *\n * The following document outlines the uses cases of the associated files (AF) tag.\n * See:\n * https://www.pdfa.org/wp-content/uploads/2018/10/PDF20_AN002-AF.pdf\n */\n if (!this.doc.catalog.has(PDFName.of('AF'))) {\n this.doc.catalog.set(PDFName.of('AF'), this.doc.context.obj([]));\n }\n AF = this.doc.catalog.lookup(PDFName.of('AF'), PDFArray);\n AF.push(ref);\n this.alreadyEmbedded = true;\n _a.label = 2;\n case 2:\n return [2 /*return*/];\n }\n });\n });\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFDocument.attach]] method, which will create\n * instances of [[PDFEmbeddedFile]] for you.\n *\n * Create an instance of [[PDFEmbeddedFile]] from an existing ref and embedder\n *\n * @param ref The unique reference for this file.\n * @param doc The document to which the file will belong.\n * @param embedder The embedder that will be used to embed the file.\n */\n PDFEmbeddedFile.of = function (ref, doc, embedder) {\n return new PDFEmbeddedFile(ref, doc, embedder);\n };\n return PDFEmbeddedFile;\n}();\nexport default PDFEmbeddedFile;","import { __awaiter, __generator } from \"tslib\";\nimport { PDFName, PDFArray, PDFDict, PDFHexString } from \"../core\";\n/**\n * Represents JavaScript that has been embedded in a [[PDFDocument]].\n */\nvar PDFJavaScript = /** @class */function () {\n function PDFJavaScript(ref, doc, embedder) {\n this.alreadyEmbedded = false;\n this.ref = ref;\n this.doc = doc;\n this.embedder = embedder;\n }\n /**\n * > **NOTE:** You probably don't need to call this method directly. The\n * > [[PDFDocument.save]] and [[PDFDocument.saveAsBase64]] methods will\n * > automatically ensure all JavaScripts get embedded.\n *\n * Embed this JavaScript in its document.\n *\n * @returns Resolves when the embedding is complete.\n */\n PDFJavaScript.prototype.embed = function () {\n return __awaiter(this, void 0, void 0, function () {\n var _a, catalog, context, ref, Names, Javascript, JSNames;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (!!this.alreadyEmbedded) return [3 /*break*/, 2];\n _a = this.doc, catalog = _a.catalog, context = _a.context;\n return [4 /*yield*/, this.embedder.embedIntoContext(this.doc.context, this.ref)];\n case 1:\n ref = _b.sent();\n if (!catalog.has(PDFName.of('Names'))) {\n catalog.set(PDFName.of('Names'), context.obj({}));\n }\n Names = catalog.lookup(PDFName.of('Names'), PDFDict);\n if (!Names.has(PDFName.of('JavaScript'))) {\n Names.set(PDFName.of('JavaScript'), context.obj({}));\n }\n Javascript = Names.lookup(PDFName.of('JavaScript'), PDFDict);\n if (!Javascript.has(PDFName.of('Names'))) {\n Javascript.set(PDFName.of('Names'), context.obj([]));\n }\n JSNames = Javascript.lookup(PDFName.of('Names'), PDFArray);\n JSNames.push(PDFHexString.fromText(this.embedder.scriptName));\n JSNames.push(ref);\n this.alreadyEmbedded = true;\n _b.label = 2;\n case 2:\n return [2 /*return*/];\n }\n });\n });\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFDocument.addJavaScript]] method, which will\n * create instances of [[PDFJavaScript]] for you.\n *\n * Create an instance of [[PDFJavaScript]] from an existing ref and script\n *\n * @param ref The unique reference for this script.\n * @param doc The document to which the script will belong.\n * @param embedder The embedder that will be used to embed the script.\n */\n PDFJavaScript.of = function (ref, doc, embedder) {\n return new PDFJavaScript(ref, doc, embedder);\n };\n return PDFJavaScript;\n}();\nexport default PDFJavaScript;","import { __awaiter, __generator } from \"tslib\";\nimport PDFHexString from \"../objects/PDFHexString\";\nvar JavaScriptEmbedder = /** @class */function () {\n function JavaScriptEmbedder(script, scriptName) {\n this.script = script;\n this.scriptName = scriptName;\n }\n JavaScriptEmbedder.for = function (script, scriptName) {\n return new JavaScriptEmbedder(script, scriptName);\n };\n JavaScriptEmbedder.prototype.embedIntoContext = function (context, ref) {\n return __awaiter(this, void 0, void 0, function () {\n var jsActionDict;\n return __generator(this, function (_a) {\n jsActionDict = context.obj({\n Type: 'Action',\n S: 'JavaScript',\n JS: PDFHexString.fromText(this.script)\n });\n if (ref) {\n context.assign(ref, jsActionDict);\n return [2 /*return*/, ref];\n } else {\n return [2 /*return*/, context.register(jsActionDict)];\n }\n return [2 /*return*/];\n });\n });\n };\n return JavaScriptEmbedder;\n}();\nexport default JavaScriptEmbedder;","import { __awaiter, __generator, __rest } from \"tslib\";\nimport { EncryptedPDFError, FontkitNotRegisteredError, ForeignPageError, RemovePageFromEmptyDocumentError } from \"./errors\";\nimport PDFEmbeddedPage from \"./PDFEmbeddedPage\";\nimport PDFFont from \"./PDFFont\";\nimport PDFImage from \"./PDFImage\";\nimport PDFPage from \"./PDFPage\";\nimport PDFForm from \"./form/PDFForm\";\nimport { PageSizes } from \"./sizes\";\nimport { CustomFontEmbedder, CustomFontSubsetEmbedder, JpegEmbedder, PageEmbeddingMismatchedContextError, PDFCatalog, PDFContext, PDFDict, PDFHexString, PDFName, PDFObjectCopier, PDFPageEmbedder, PDFPageLeaf, PDFPageTree, PDFParser, PDFStreamWriter, PDFString, PDFWriter, PngEmbedder, StandardFontEmbedder, UnexpectedObjectTypeError } from \"../core\";\nimport { ParseSpeeds } from \"./PDFDocumentOptions\";\nimport { assertIs, assertIsOneOfOrUndefined, assertOrUndefined, assertRange, Cache, canBeConvertedToUint8Array, encodeToBase64, isStandardFont, pluckIndices, range, toUint8Array } from \"../utils\";\nimport FileEmbedder, { AFRelationship } from \"../core/embedders/FileEmbedder\";\nimport PDFEmbeddedFile from \"./PDFEmbeddedFile\";\nimport PDFJavaScript from \"./PDFJavaScript\";\nimport JavaScriptEmbedder from \"../core/embedders/JavaScriptEmbedder\";\n/**\n * Represents a PDF document.\n */\nvar PDFDocument = /** @class */function () {\n function PDFDocument(context, ignoreEncryption, updateMetadata) {\n var _this = this;\n /** The default word breaks used in PDFPage.drawText */\n this.defaultWordBreaks = [' '];\n this.computePages = function () {\n var pages = [];\n _this.catalog.Pages().traverse(function (node, ref) {\n if (node instanceof PDFPageLeaf) {\n var page = _this.pageMap.get(node);\n if (!page) {\n page = PDFPage.of(node, ref, _this);\n _this.pageMap.set(node, page);\n }\n pages.push(page);\n }\n });\n return pages;\n };\n this.getOrCreateForm = function () {\n var acroForm = _this.catalog.getOrCreateAcroForm();\n return PDFForm.of(acroForm, _this);\n };\n assertIs(context, 'context', [[PDFContext, 'PDFContext']]);\n assertIs(ignoreEncryption, 'ignoreEncryption', ['boolean']);\n this.context = context;\n this.catalog = context.lookup(context.trailerInfo.Root);\n this.isEncrypted = !!context.lookup(context.trailerInfo.Encrypt);\n this.pageCache = Cache.populatedBy(this.computePages);\n this.pageMap = new Map();\n this.formCache = Cache.populatedBy(this.getOrCreateForm);\n this.fonts = [];\n this.images = [];\n this.embeddedPages = [];\n this.embeddedFiles = [];\n this.javaScripts = [];\n if (!ignoreEncryption && this.isEncrypted) throw new EncryptedPDFError();\n if (updateMetadata) this.updateInfoDict();\n }\n /**\n * Load an existing [[PDFDocument]]. The input data can be provided in\n * multiple formats:\n *\n * | Type | Contents |\n * | ------------- | ------------------------------------------------------ |\n * | `string` | A base64 encoded string (or data URI) containing a PDF |\n * | `Uint8Array` | The raw bytes of a PDF |\n * | `ArrayBuffer` | The raw bytes of a PDF |\n *\n * For example:\n * ```js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HhyZWYKNTEwCiUlRU9G'\n *\n * const dataUri = 'data:application/pdf;base64,' + base64\n *\n * const pdfDoc1 = await PDFDocument.load(base64)\n * const pdfDoc2 = await PDFDocument.load(dataUri)\n *\n * // pdf=Uint8Array\n * import fs from 'fs'\n * const uint8Array = fs.readFileSync('with_update_sections.pdf')\n * const pdfDoc3 = await PDFDocument.load(uint8Array)\n *\n * // pdf=ArrayBuffer\n * const url = 'https://pdf-lib.js.org/assets/with_update_sections.pdf'\n * const arrayBuffer = await fetch(url).then(res => res.arrayBuffer())\n * const pdfDoc4 = await PDFDocument.load(arrayBuffer)\n *\n * ```\n *\n * @param pdf The input data containing a PDF document.\n * @param options The options to be used when loading the document.\n * @returns Resolves with a document loaded from the input.\n */\n PDFDocument.load = function (pdf, options) {\n if (options === void 0) {\n options = {};\n }\n return __awaiter(this, void 0, void 0, function () {\n var _a, ignoreEncryption, _b, parseSpeed, _c, throwOnInvalidObject, _d, updateMetadata, _e, capNumbers, bytes, context;\n return __generator(this, function (_f) {\n switch (_f.label) {\n case 0:\n _a = options.ignoreEncryption, ignoreEncryption = _a === void 0 ? false : _a, _b = options.parseSpeed, parseSpeed = _b === void 0 ? ParseSpeeds.Slow : _b, _c = options.throwOnInvalidObject, throwOnInvalidObject = _c === void 0 ? false : _c, _d = options.updateMetadata, updateMetadata = _d === void 0 ? true : _d, _e = options.capNumbers, capNumbers = _e === void 0 ? false : _e;\n assertIs(pdf, 'pdf', ['string', Uint8Array, ArrayBuffer]);\n assertIs(ignoreEncryption, 'ignoreEncryption', ['boolean']);\n assertIs(parseSpeed, 'parseSpeed', ['number']);\n assertIs(throwOnInvalidObject, 'throwOnInvalidObject', ['boolean']);\n bytes = toUint8Array(pdf);\n return [4 /*yield*/, PDFParser.forBytesWithOptions(bytes, parseSpeed, throwOnInvalidObject, capNumbers).parseDocument()];\n case 1:\n context = _f.sent();\n return [2 /*return*/, new PDFDocument(context, ignoreEncryption, updateMetadata)];\n }\n });\n });\n };\n /**\n * Create a new [[PDFDocument]].\n * @returns Resolves with the newly created document.\n */\n PDFDocument.create = function (options) {\n if (options === void 0) {\n options = {};\n }\n return __awaiter(this, void 0, void 0, function () {\n var _a, updateMetadata, context, pageTree, pageTreeRef, catalog;\n return __generator(this, function (_b) {\n _a = options.updateMetadata, updateMetadata = _a === void 0 ? true : _a;\n context = PDFContext.create();\n pageTree = PDFPageTree.withContext(context);\n pageTreeRef = context.register(pageTree);\n catalog = PDFCatalog.withContextAndPages(context, pageTreeRef);\n context.trailerInfo.Root = context.register(catalog);\n return [2 /*return*/, new PDFDocument(context, false, updateMetadata)];\n });\n });\n };\n /**\n * Register a fontkit instance. This must be done before custom fonts can\n * be embedded. See [here](https://github.com/Hopding/pdf-lib/tree/master#fontkit-installation)\n * for instructions on how to install and register a fontkit instance.\n *\n * > You do **not** need to call this method to embed standard fonts.\n *\n * For example:\n * ```js\n * import { PDFDocument } from 'pdf-lib'\n * import fontkit from '@pdf-lib/fontkit'\n *\n * const pdfDoc = await PDFDocument.create()\n * pdfDoc.registerFontkit(fontkit)\n * ```\n *\n * @param fontkit The fontkit instance to be registered.\n */\n PDFDocument.prototype.registerFontkit = function (fontkit) {\n this.fontkit = fontkit;\n };\n /**\n * Get the [[PDFForm]] containing all interactive fields for this document.\n * For example:\n * ```js\n * const form = pdfDoc.getForm()\n * const fields = form.getFields()\n * fields.forEach(field => {\n * const type = field.constructor.name\n * const name = field.getName()\n * console.log(`${type}: ${name}`)\n * })\n * ```\n * @returns The form for this document.\n */\n PDFDocument.prototype.getForm = function () {\n var form = this.formCache.access();\n if (form.hasXFA()) {\n console.warn('Removing XFA form data as pdf-lib does not support reading or writing XFA');\n form.deleteXFA();\n }\n return form;\n };\n /**\n * Get this document's title metadata. The title appears in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * const title = pdfDoc.getTitle()\n * ```\n * @returns A string containing the title of this document, if it has one.\n */\n PDFDocument.prototype.getTitle = function () {\n var title = this.getInfoDict().lookup(PDFName.Title);\n if (!title) return undefined;\n assertIsLiteralOrHexString(title);\n return title.decodeText();\n };\n /**\n * Get this document's author metadata. The author appears in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * const author = pdfDoc.getAuthor()\n * ```\n * @returns A string containing the author of this document, if it has one.\n */\n PDFDocument.prototype.getAuthor = function () {\n var author = this.getInfoDict().lookup(PDFName.Author);\n if (!author) return undefined;\n assertIsLiteralOrHexString(author);\n return author.decodeText();\n };\n /**\n * Get this document's subject metadata. The subject appears in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * const subject = pdfDoc.getSubject()\n * ```\n * @returns A string containing the subject of this document, if it has one.\n */\n PDFDocument.prototype.getSubject = function () {\n var subject = this.getInfoDict().lookup(PDFName.Subject);\n if (!subject) return undefined;\n assertIsLiteralOrHexString(subject);\n return subject.decodeText();\n };\n /**\n * Get this document's keywords metadata. The keywords appear in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * const keywords = pdfDoc.getKeywords()\n * ```\n * @returns A string containing the keywords of this document, if it has any.\n */\n PDFDocument.prototype.getKeywords = function () {\n var keywords = this.getInfoDict().lookup(PDFName.Keywords);\n if (!keywords) return undefined;\n assertIsLiteralOrHexString(keywords);\n return keywords.decodeText();\n };\n /**\n * Get this document's creator metadata. The creator appears in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * const creator = pdfDoc.getCreator()\n * ```\n * @returns A string containing the creator of this document, if it has one.\n */\n PDFDocument.prototype.getCreator = function () {\n var creator = this.getInfoDict().lookup(PDFName.Creator);\n if (!creator) return undefined;\n assertIsLiteralOrHexString(creator);\n return creator.decodeText();\n };\n /**\n * Get this document's producer metadata. The producer appears in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * const producer = pdfDoc.getProducer()\n * ```\n * @returns A string containing the producer of this document, if it has one.\n */\n PDFDocument.prototype.getProducer = function () {\n var producer = this.getInfoDict().lookup(PDFName.Producer);\n if (!producer) return undefined;\n assertIsLiteralOrHexString(producer);\n return producer.decodeText();\n };\n /**\n * Get this document's creation date metadata. The creation date appears in\n * the \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * const creationDate = pdfDoc.getCreationDate()\n * ```\n * @returns A Date containing the creation date of this document,\n * if it has one.\n */\n PDFDocument.prototype.getCreationDate = function () {\n var creationDate = this.getInfoDict().lookup(PDFName.CreationDate);\n if (!creationDate) return undefined;\n assertIsLiteralOrHexString(creationDate);\n return creationDate.decodeDate();\n };\n /**\n * Get this document's modification date metadata. The modification date\n * appears in the \"Document Properties\" section of most PDF readers.\n * For example:\n * ```js\n * const modification = pdfDoc.getModificationDate()\n * ```\n * @returns A Date containing the modification date of this document,\n * if it has one.\n */\n PDFDocument.prototype.getModificationDate = function () {\n var modificationDate = this.getInfoDict().lookup(PDFName.ModDate);\n if (!modificationDate) return undefined;\n assertIsLiteralOrHexString(modificationDate);\n return modificationDate.decodeDate();\n };\n /**\n * Set this document's title metadata. The title will appear in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * pdfDoc.setTitle('🥚 The Life of an Egg 🍳')\n * ```\n *\n * To display the title in the window's title bar, set the\n * `showInWindowTitleBar` option to `true` (works for _most_ PDF readers).\n * For example:\n * ```js\n * pdfDoc.setTitle('🥚 The Life of an Egg 🍳', { showInWindowTitleBar: true })\n * ```\n *\n * @param title The title of this document.\n * @param options The options to be used when setting the title.\n */\n PDFDocument.prototype.setTitle = function (title, options) {\n assertIs(title, 'title', ['string']);\n var key = PDFName.of('Title');\n this.getInfoDict().set(key, PDFHexString.fromText(title));\n // Indicate that readers should display the title rather than the filename\n if (options === null || options === void 0 ? void 0 : options.showInWindowTitleBar) {\n var prefs = this.catalog.getOrCreateViewerPreferences();\n prefs.setDisplayDocTitle(true);\n }\n };\n /**\n * Set this document's author metadata. The author will appear in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * pdfDoc.setAuthor('Humpty Dumpty')\n * ```\n * @param author The author of this document.\n */\n PDFDocument.prototype.setAuthor = function (author) {\n assertIs(author, 'author', ['string']);\n var key = PDFName.of('Author');\n this.getInfoDict().set(key, PDFHexString.fromText(author));\n };\n /**\n * Set this document's subject metadata. The subject will appear in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * pdfDoc.setSubject('📘 An Epic Tale of Woe 📖')\n * ```\n * @param subject The subject of this document.\n */\n PDFDocument.prototype.setSubject = function (subject) {\n assertIs(subject, 'author', ['string']);\n var key = PDFName.of('Subject');\n this.getInfoDict().set(key, PDFHexString.fromText(subject));\n };\n /**\n * Set this document's keyword metadata. These keywords will appear in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * pdfDoc.setKeywords(['eggs', 'wall', 'fall', 'king', 'horses', 'men'])\n * ```\n * @param keywords An array of keywords associated with this document.\n */\n PDFDocument.prototype.setKeywords = function (keywords) {\n assertIs(keywords, 'keywords', [Array]);\n var key = PDFName.of('Keywords');\n this.getInfoDict().set(key, PDFHexString.fromText(keywords.join(' ')));\n };\n /**\n * Set this document's creator metadata. The creator will appear in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * pdfDoc.setCreator('PDF App 9000 🤖')\n * ```\n * @param creator The creator of this document.\n */\n PDFDocument.prototype.setCreator = function (creator) {\n assertIs(creator, 'creator', ['string']);\n var key = PDFName.of('Creator');\n this.getInfoDict().set(key, PDFHexString.fromText(creator));\n };\n /**\n * Set this document's producer metadata. The producer will appear in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * pdfDoc.setProducer('PDF App 9000 🤖')\n * ```\n * @param producer The producer of this document.\n */\n PDFDocument.prototype.setProducer = function (producer) {\n assertIs(producer, 'creator', ['string']);\n var key = PDFName.of('Producer');\n this.getInfoDict().set(key, PDFHexString.fromText(producer));\n };\n /**\n * Set this document's language metadata. The language will appear in the\n * \"Document Properties\" section of some PDF readers. For example:\n * ```js\n * pdfDoc.setLanguage('en-us')\n * ```\n *\n * @param language An RFC 3066 _Language-Tag_ denoting the language of this\n * document, or an empty string if the language is unknown.\n */\n PDFDocument.prototype.setLanguage = function (language) {\n assertIs(language, 'language', ['string']);\n var key = PDFName.of('Lang');\n this.catalog.set(key, PDFString.of(language));\n };\n /**\n * Set this document's creation date metadata. The creation date will appear\n * in the \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * pdfDoc.setCreationDate(new Date())\n * ```\n * @param creationDate The date this document was created.\n */\n PDFDocument.prototype.setCreationDate = function (creationDate) {\n assertIs(creationDate, 'creationDate', [[Date, 'Date']]);\n var key = PDFName.of('CreationDate');\n this.getInfoDict().set(key, PDFString.fromDate(creationDate));\n };\n /**\n * Set this document's modification date metadata. The modification date will\n * appear in the \"Document Properties\" section of most PDF readers. For\n * example:\n * ```js\n * pdfDoc.setModificationDate(new Date())\n * ```\n * @param modificationDate The date this document was last modified.\n */\n PDFDocument.prototype.setModificationDate = function (modificationDate) {\n assertIs(modificationDate, 'modificationDate', [[Date, 'Date']]);\n var key = PDFName.of('ModDate');\n this.getInfoDict().set(key, PDFString.fromDate(modificationDate));\n };\n /**\n * Get the number of pages contained in this document. For example:\n * ```js\n * const totalPages = pdfDoc.getPageCount()\n * ```\n * @returns The number of pages in this document.\n */\n PDFDocument.prototype.getPageCount = function () {\n if (this.pageCount === undefined) this.pageCount = this.getPages().length;\n return this.pageCount;\n };\n /**\n * Get an array of all the pages contained in this document. The pages are\n * stored in the array in the same order that they are rendered in the\n * document. For example:\n * ```js\n * const pages = pdfDoc.getPages()\n * pages[0] // The first page of the document\n * pages[2] // The third page of the document\n * pages[197] // The 198th page of the document\n * ```\n * @returns An array of all the pages contained in this document.\n */\n PDFDocument.prototype.getPages = function () {\n return this.pageCache.access();\n };\n /**\n * Get the page rendered at a particular `index` of the document. For example:\n * ```js\n * pdfDoc.getPage(0) // The first page of the document\n * pdfDoc.getPage(2) // The third page of the document\n * pdfDoc.getPage(197) // The 198th page of the document\n * ```\n * @returns The [[PDFPage]] rendered at the given `index` of the document.\n */\n PDFDocument.prototype.getPage = function (index) {\n var pages = this.getPages();\n assertRange(index, 'index', 0, pages.length - 1);\n return pages[index];\n };\n /**\n * Get an array of indices for all the pages contained in this document. The\n * array will contain a range of integers from\n * `0..pdfDoc.getPageCount() - 1`. For example:\n * ```js\n * const pdfDoc = await PDFDocument.create()\n * pdfDoc.addPage()\n * pdfDoc.addPage()\n * pdfDoc.addPage()\n *\n * const indices = pdfDoc.getPageIndices()\n * indices // => [0, 1, 2]\n * ```\n * @returns An array of indices for all pages contained in this document.\n */\n PDFDocument.prototype.getPageIndices = function () {\n return range(0, this.getPageCount());\n };\n /**\n * Remove the page at a given index from this document. For example:\n * ```js\n * pdfDoc.removePage(0) // Remove the first page of the document\n * pdfDoc.removePage(2) // Remove the third page of the document\n * pdfDoc.removePage(197) // Remove the 198th page of the document\n * ```\n * Once a page has been removed, it will no longer be rendered at that index\n * in the document.\n * @param index The index of the page to be removed.\n */\n PDFDocument.prototype.removePage = function (index) {\n var pageCount = this.getPageCount();\n if (this.pageCount === 0) throw new RemovePageFromEmptyDocumentError();\n assertRange(index, 'index', 0, pageCount - 1);\n this.catalog.removeLeafNode(index);\n this.pageCount = pageCount - 1;\n };\n /**\n * Add a page to the end of this document. This method accepts three\n * different value types for the `page` parameter:\n *\n * | Type | Behavior |\n * | ------------------ | ----------------------------------------------------------------------------------- |\n * | `undefined` | Create a new page and add it to the end of this document |\n * | `[number, number]` | Create a new page with the given dimensions and add it to the end of this document |\n * | `PDFPage` | Add the existing page to the end of this document |\n *\n * For example:\n * ```js\n * // page=undefined\n * const newPage = pdfDoc.addPage()\n *\n * // page=[number, number]\n * import { PageSizes } from 'pdf-lib'\n * const newPage1 = pdfDoc.addPage(PageSizes.A7)\n * const newPage2 = pdfDoc.addPage(PageSizes.Letter)\n * const newPage3 = pdfDoc.addPage([500, 750])\n *\n * // page=PDFPage\n * const pdfDoc1 = await PDFDocument.create()\n * const pdfDoc2 = await PDFDocument.load(...)\n * const [existingPage] = await pdfDoc1.copyPages(pdfDoc2, [0])\n * pdfDoc1.addPage(existingPage)\n * ```\n *\n * @param page Optionally, the desired dimensions or existing page.\n * @returns The newly created (or existing) page.\n */\n PDFDocument.prototype.addPage = function (page) {\n assertIs(page, 'page', ['undefined', [PDFPage, 'PDFPage'], Array]);\n return this.insertPage(this.getPageCount(), page);\n };\n /**\n * Insert a page at a given index within this document. This method accepts\n * three different value types for the `page` parameter:\n *\n * | Type | Behavior |\n * | ------------------ | ------------------------------------------------------------------------------ |\n * | `undefined` | Create a new page and insert it into this document |\n * | `[number, number]` | Create a new page with the given dimensions and insert it into this document |\n * | `PDFPage` | Insert the existing page into this document |\n *\n * For example:\n * ```js\n * // page=undefined\n * const newPage = pdfDoc.insertPage(2)\n *\n * // page=[number, number]\n * import { PageSizes } from 'pdf-lib'\n * const newPage1 = pdfDoc.insertPage(2, PageSizes.A7)\n * const newPage2 = pdfDoc.insertPage(0, PageSizes.Letter)\n * const newPage3 = pdfDoc.insertPage(198, [500, 750])\n *\n * // page=PDFPage\n * const pdfDoc1 = await PDFDocument.create()\n * const pdfDoc2 = await PDFDocument.load(...)\n * const [existingPage] = await pdfDoc1.copyPages(pdfDoc2, [0])\n * pdfDoc1.insertPage(0, existingPage)\n * ```\n *\n * @param index The index at which the page should be inserted (zero-based).\n * @param page Optionally, the desired dimensions or existing page.\n * @returns The newly created (or existing) page.\n */\n PDFDocument.prototype.insertPage = function (index, page) {\n var pageCount = this.getPageCount();\n assertRange(index, 'index', 0, pageCount);\n assertIs(page, 'page', ['undefined', [PDFPage, 'PDFPage'], Array]);\n if (!page || Array.isArray(page)) {\n var dims = Array.isArray(page) ? page : PageSizes.A4;\n page = PDFPage.create(this);\n page.setSize.apply(page, dims);\n } else if (page.doc !== this) {\n throw new ForeignPageError();\n }\n var parentRef = this.catalog.insertLeafNode(page.ref, index);\n page.node.setParent(parentRef);\n this.pageMap.set(page.node, page);\n this.pageCache.invalidate();\n this.pageCount = pageCount + 1;\n return page;\n };\n /**\n * Copy pages from a source document into this document. Allows pages to be\n * copied between different [[PDFDocument]] instances. For example:\n * ```js\n * const pdfDoc = await PDFDocument.create()\n * const srcDoc = await PDFDocument.load(...)\n *\n * const copiedPages = await pdfDoc.copyPages(srcDoc, [0, 3, 89])\n * const [firstPage, fourthPage, ninetiethPage] = copiedPages;\n *\n * pdfDoc.addPage(fourthPage)\n * pdfDoc.insertPage(0, ninetiethPage)\n * pdfDoc.addPage(firstPage)\n * ```\n * @param srcDoc The document from which pages should be copied.\n * @param indices The indices of the pages that should be copied.\n * @returns Resolves with an array of pages copied into this document.\n */\n PDFDocument.prototype.copyPages = function (srcDoc, indices) {\n return __awaiter(this, void 0, void 0, function () {\n var copier, srcPages, copiedPages, idx, len, srcPage, copiedPage, ref;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n assertIs(srcDoc, 'srcDoc', [[PDFDocument, 'PDFDocument']]);\n assertIs(indices, 'indices', [Array]);\n return [4 /*yield*/, srcDoc.flush()];\n case 1:\n _a.sent();\n copier = PDFObjectCopier.for(srcDoc.context, this.context);\n srcPages = srcDoc.getPages();\n copiedPages = new Array(indices.length);\n for (idx = 0, len = indices.length; idx < len; idx++) {\n srcPage = srcPages[indices[idx]];\n copiedPage = copier.copy(srcPage.node);\n ref = this.context.register(copiedPage);\n copiedPages[idx] = PDFPage.of(copiedPage, ref, this);\n }\n return [2 /*return*/, copiedPages];\n }\n });\n });\n };\n /**\n * Get a copy of this document.\n *\n * For example:\n * ```js\n * const srcDoc = await PDFDocument.load(...)\n * const pdfDoc = await srcDoc.copy()\n * ```\n *\n * > **NOTE:** This method won't copy all information over to the new\n * > document (acroforms, outlines, etc...).\n *\n * @returns Resolves with a copy this document.\n */\n PDFDocument.prototype.copy = function () {\n return __awaiter(this, void 0, void 0, function () {\n var pdfCopy, contentPages, idx, len;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n return [4 /*yield*/, PDFDocument.create()];\n case 1:\n pdfCopy = _a.sent();\n return [4 /*yield*/, pdfCopy.copyPages(this, this.getPageIndices())];\n case 2:\n contentPages = _a.sent();\n for (idx = 0, len = contentPages.length; idx < len; idx++) {\n pdfCopy.addPage(contentPages[idx]);\n }\n if (this.getAuthor() !== undefined) {\n pdfCopy.setAuthor(this.getAuthor());\n }\n if (this.getCreationDate() !== undefined) {\n pdfCopy.setCreationDate(this.getCreationDate());\n }\n if (this.getCreator() !== undefined) {\n pdfCopy.setCreator(this.getCreator());\n }\n if (this.getModificationDate() !== undefined) {\n pdfCopy.setModificationDate(this.getModificationDate());\n }\n if (this.getProducer() !== undefined) {\n pdfCopy.setProducer(this.getProducer());\n }\n if (this.getSubject() !== undefined) {\n pdfCopy.setSubject(this.getSubject());\n }\n if (this.getTitle() !== undefined) {\n pdfCopy.setTitle(this.getTitle());\n }\n pdfCopy.defaultWordBreaks = this.defaultWordBreaks;\n return [2 /*return*/, pdfCopy];\n }\n });\n });\n };\n /**\n * Add JavaScript to this document. The supplied `script` is executed when the\n * document is opened. The `script` can be used to perform some operation\n * when the document is opened (e.g. logging to the console), or it can be\n * used to define a function that can be referenced later in a JavaScript\n * action. For example:\n * ```js\n * // Show \"Hello World!\" in the console when the PDF is opened\n * pdfDoc.addJavaScript(\n * 'main',\n * 'console.show(); console.println(\"Hello World!\");'\n * );\n *\n * // Define a function named \"foo\" that can be called in JavaScript Actions\n * pdfDoc.addJavaScript(\n * 'foo',\n * 'function foo() { return \"foo\"; }'\n * );\n * ```\n * See the [JavaScript for Acrobat API Reference](https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/js_api_reference.pdf)\n * for details.\n * @param name The name of the script. Must be unique per document.\n * @param script The JavaScript to execute.\n */\n PDFDocument.prototype.addJavaScript = function (name, script) {\n assertIs(name, 'name', ['string']);\n assertIs(script, 'script', ['string']);\n var embedder = JavaScriptEmbedder.for(script, name);\n var ref = this.context.nextRef();\n var javaScript = PDFJavaScript.of(ref, this, embedder);\n this.javaScripts.push(javaScript);\n };\n /**\n * Add an attachment to this document. Attachments are visible in the\n * \"Attachments\" panel of Adobe Acrobat and some other PDF readers. Any\n * type of file can be added as an attachment. This includes, but is not\n * limited to, `.png`, `.jpg`, `.pdf`, `.csv`, `.docx`, and `.xlsx` files.\n *\n * The input data can be provided in multiple formats:\n *\n * | Type | Contents |\n * | ------------- | -------------------------------------------------------------- |\n * | `string` | A base64 encoded string (or data URI) containing an attachment |\n * | `Uint8Array` | The raw bytes of an attachment |\n * | `ArrayBuffer` | The raw bytes of an attachment |\n *\n * For example:\n * ```js\n * // attachment=string\n * await pdfDoc.attach('/9j/4AAQSkZJRgABAQAAAQABAAD/2wBD...', 'cat_riding_unicorn.jpg', {\n * mimeType: 'image/jpeg',\n * description: 'Cool cat riding a unicorn! 🦄🐈🕶️',\n * creationDate: new Date('2019/12/01'),\n * modificationDate: new Date('2020/04/19'),\n * })\n * await pdfDoc.attach('data:image/jpeg;base64,/9j/4AAQ...', 'cat_riding_unicorn.jpg', {\n * mimeType: 'image/jpeg',\n * description: 'Cool cat riding a unicorn! 🦄🐈🕶️',\n * creationDate: new Date('2019/12/01'),\n * modificationDate: new Date('2020/04/19'),\n * })\n *\n * // attachment=Uint8Array\n * import fs from 'fs'\n * const uint8Array = fs.readFileSync('cat_riding_unicorn.jpg')\n * await pdfDoc.attach(uint8Array, 'cat_riding_unicorn.jpg', {\n * mimeType: 'image/jpeg',\n * description: 'Cool cat riding a unicorn! 🦄🐈🕶️',\n * creationDate: new Date('2019/12/01'),\n * modificationDate: new Date('2020/04/19'),\n * })\n *\n * // attachment=ArrayBuffer\n * const url = 'https://pdf-lib.js.org/assets/cat_riding_unicorn.jpg'\n * const arrayBuffer = await fetch(url).then(res => res.arrayBuffer())\n * await pdfDoc.attach(arrayBuffer, 'cat_riding_unicorn.jpg', {\n * mimeType: 'image/jpeg',\n * description: 'Cool cat riding a unicorn! 🦄🐈🕶️',\n * creationDate: new Date('2019/12/01'),\n * modificationDate: new Date('2020/04/19'),\n * })\n * ```\n *\n * @param attachment The input data containing the file to be attached.\n * @param name The name of the file to be attached.\n * @returns Resolves when the attachment is complete.\n */\n PDFDocument.prototype.attach = function (attachment, name, options) {\n if (options === void 0) {\n options = {};\n }\n return __awaiter(this, void 0, void 0, function () {\n var bytes, embedder, ref, embeddedFile;\n return __generator(this, function (_a) {\n assertIs(attachment, 'attachment', ['string', Uint8Array, ArrayBuffer]);\n assertIs(name, 'name', ['string']);\n assertOrUndefined(options.mimeType, 'mimeType', ['string']);\n assertOrUndefined(options.description, 'description', ['string']);\n assertOrUndefined(options.creationDate, 'options.creationDate', [Date]);\n assertOrUndefined(options.modificationDate, 'options.modificationDate', [Date]);\n assertIsOneOfOrUndefined(options.afRelationship, 'options.afRelationship', AFRelationship);\n bytes = toUint8Array(attachment);\n embedder = FileEmbedder.for(bytes, name, options);\n ref = this.context.nextRef();\n embeddedFile = PDFEmbeddedFile.of(ref, this, embedder);\n this.embeddedFiles.push(embeddedFile);\n return [2 /*return*/];\n });\n });\n };\n /**\n * Embed a font into this document. The input data can be provided in multiple\n * formats:\n *\n * | Type | Contents |\n * | --------------- | ------------------------------------------------------- |\n * | `StandardFonts` | One of the standard 14 fonts |\n * | `string` | A base64 encoded string (or data URI) containing a font |\n * | `Uint8Array` | The raw bytes of a font |\n * | `ArrayBuffer` | The raw bytes of a font |\n *\n * For example:\n * ```js\n * // font=StandardFonts\n * import { StandardFonts } from 'pdf-lib'\n * const font1 = await pdfDoc.embedFont(StandardFonts.Helvetica)\n *\n * // font=string\n * const font2 = await pdfDoc.embedFont('AAEAAAAVAQAABABQRFNJRx/upe...')\n * const font3 = await pdfDoc.embedFont('data:font/opentype;base64,AAEAAA...')\n *\n * // font=Uint8Array\n * import fs from 'fs'\n * const font4 = await pdfDoc.embedFont(fs.readFileSync('Ubuntu-R.ttf'))\n *\n * // font=ArrayBuffer\n * const url = 'https://pdf-lib.js.org/assets/ubuntu/Ubuntu-R.ttf'\n * const ubuntuBytes = await fetch(url).then(res => res.arrayBuffer())\n * const font5 = await pdfDoc.embedFont(ubuntuBytes)\n * ```\n * See also: [[registerFontkit]]\n * @param font The input data for a font.\n * @param options The options to be used when embedding the font.\n * @returns Resolves with the embedded font.\n */\n PDFDocument.prototype.embedFont = function (font, options) {\n if (options === void 0) {\n options = {};\n }\n return __awaiter(this, void 0, void 0, function () {\n var _a, subset, customName, features, embedder, bytes, fontkit, _b, ref, pdfFont;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n _a = options.subset, subset = _a === void 0 ? false : _a, customName = options.customName, features = options.features;\n assertIs(font, 'font', ['string', Uint8Array, ArrayBuffer]);\n assertIs(subset, 'subset', ['boolean']);\n if (!isStandardFont(font)) return [3 /*break*/, 1];\n embedder = StandardFontEmbedder.for(font, customName);\n return [3 /*break*/, 7];\n case 1:\n if (!canBeConvertedToUint8Array(font)) return [3 /*break*/, 6];\n bytes = toUint8Array(font);\n fontkit = this.assertFontkit();\n if (!subset) return [3 /*break*/, 3];\n return [4 /*yield*/, CustomFontSubsetEmbedder.for(fontkit, bytes, customName, features)];\n case 2:\n _b = _c.sent();\n return [3 /*break*/, 5];\n case 3:\n return [4 /*yield*/, CustomFontEmbedder.for(fontkit, bytes, customName, features)];\n case 4:\n _b = _c.sent();\n _c.label = 5;\n case 5:\n embedder = _b;\n return [3 /*break*/, 7];\n case 6:\n throw new TypeError('`font` must be one of `StandardFonts | string | Uint8Array | ArrayBuffer`');\n case 7:\n ref = this.context.nextRef();\n pdfFont = PDFFont.of(ref, this, embedder);\n this.fonts.push(pdfFont);\n return [2 /*return*/, pdfFont];\n }\n });\n });\n };\n /**\n * Embed a standard font into this document.\n * For example:\n * ```js\n * import { StandardFonts } from 'pdf-lib'\n * const helveticaFont = pdfDoc.embedFont(StandardFonts.Helvetica)\n * ```\n * @param font The standard font to be embedded.\n * @param customName The name to be used when embedding the font.\n * @returns The embedded font.\n */\n PDFDocument.prototype.embedStandardFont = function (font, customName) {\n assertIs(font, 'font', ['string']);\n if (!isStandardFont(font)) {\n throw new TypeError('`font` must be one of type `StandardFonts`');\n }\n var embedder = StandardFontEmbedder.for(font, customName);\n var ref = this.context.nextRef();\n var pdfFont = PDFFont.of(ref, this, embedder);\n this.fonts.push(pdfFont);\n return pdfFont;\n };\n /**\n * Embed a JPEG image into this document. The input data can be provided in\n * multiple formats:\n *\n * | Type | Contents |\n * | ------------- | ------------------------------------------------------------- |\n * | `string` | A base64 encoded string (or data URI) containing a JPEG image |\n * | `Uint8Array` | The raw bytes of a JPEG image |\n * | `ArrayBuffer` | The raw bytes of a JPEG image |\n *\n * For example:\n * ```js\n * // jpg=string\n * const image1 = await pdfDoc.embedJpg('/9j/4AAQSkZJRgABAQAAAQABAAD/2wBD...')\n * const image2 = await pdfDoc.embedJpg('data:image/jpeg;base64,/9j/4AAQ...')\n *\n * // jpg=Uint8Array\n * import fs from 'fs'\n * const uint8Array = fs.readFileSync('cat_riding_unicorn.jpg')\n * const image3 = await pdfDoc.embedJpg(uint8Array)\n *\n * // jpg=ArrayBuffer\n * const url = 'https://pdf-lib.js.org/assets/cat_riding_unicorn.jpg'\n * const arrayBuffer = await fetch(url).then(res => res.arrayBuffer())\n * const image4 = await pdfDoc.embedJpg(arrayBuffer)\n * ```\n *\n * @param jpg The input data for a JPEG image.\n * @returns Resolves with the embedded image.\n */\n PDFDocument.prototype.embedJpg = function (jpg) {\n return __awaiter(this, void 0, void 0, function () {\n var bytes, embedder, ref, pdfImage;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n assertIs(jpg, 'jpg', ['string', Uint8Array, ArrayBuffer]);\n bytes = toUint8Array(jpg);\n return [4 /*yield*/, JpegEmbedder.for(bytes)];\n case 1:\n embedder = _a.sent();\n ref = this.context.nextRef();\n pdfImage = PDFImage.of(ref, this, embedder);\n this.images.push(pdfImage);\n return [2 /*return*/, pdfImage];\n }\n });\n });\n };\n /**\n * Embed a PNG image into this document. The input data can be provided in\n * multiple formats:\n *\n * | Type | Contents |\n * | ------------- | ------------------------------------------------------------ |\n * | `string` | A base64 encoded string (or data URI) containing a PNG image |\n * | `Uint8Array` | The raw bytes of a PNG image |\n * | `ArrayBuffer` | The raw bytes of a PNG image |\n *\n * For example:\n * ```js\n * // png=string\n * const image1 = await pdfDoc.embedPng('iVBORw0KGgoAAAANSUhEUgAAAlgAAAF3...')\n * const image2 = await pdfDoc.embedPng('data:image/png;base64,iVBORw0KGg...')\n *\n * // png=Uint8Array\n * import fs from 'fs'\n * const uint8Array = fs.readFileSync('small_mario.png')\n * const image3 = await pdfDoc.embedPng(uint8Array)\n *\n * // png=ArrayBuffer\n * const url = 'https://pdf-lib.js.org/assets/small_mario.png'\n * const arrayBuffer = await fetch(url).then(res => res.arrayBuffer())\n * const image4 = await pdfDoc.embedPng(arrayBuffer)\n * ```\n *\n * @param png The input data for a PNG image.\n * @returns Resolves with the embedded image.\n */\n PDFDocument.prototype.embedPng = function (png) {\n return __awaiter(this, void 0, void 0, function () {\n var bytes, embedder, ref, pdfImage;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n assertIs(png, 'png', ['string', Uint8Array, ArrayBuffer]);\n bytes = toUint8Array(png);\n return [4 /*yield*/, PngEmbedder.for(bytes)];\n case 1:\n embedder = _a.sent();\n ref = this.context.nextRef();\n pdfImage = PDFImage.of(ref, this, embedder);\n this.images.push(pdfImage);\n return [2 /*return*/, pdfImage];\n }\n });\n });\n };\n /**\n * Embed one or more PDF pages into this document.\n *\n * For example:\n * ```js\n * const pdfDoc = await PDFDocument.create()\n *\n * const sourcePdfUrl = 'https://pdf-lib.js.org/assets/with_large_page_count.pdf'\n * const sourcePdf = await fetch(sourcePdfUrl).then((res) => res.arrayBuffer())\n *\n * // Embed page 74 of `sourcePdf` into `pdfDoc`\n * const [embeddedPage] = await pdfDoc.embedPdf(sourcePdf, [73])\n * ```\n *\n * See [[PDFDocument.load]] for examples of the allowed input data formats.\n *\n * @param pdf The input data containing a PDF document.\n * @param indices The indices of the pages that should be embedded.\n * @returns Resolves with an array of the embedded pages.\n */\n PDFDocument.prototype.embedPdf = function (pdf, indices) {\n if (indices === void 0) {\n indices = [0];\n }\n return __awaiter(this, void 0, void 0, function () {\n var srcDoc, _a, srcPages;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n assertIs(pdf, 'pdf', ['string', Uint8Array, ArrayBuffer, [PDFDocument, 'PDFDocument']]);\n assertIs(indices, 'indices', [Array]);\n if (!(pdf instanceof PDFDocument)) return [3 /*break*/, 1];\n _a = pdf;\n return [3 /*break*/, 3];\n case 1:\n return [4 /*yield*/, PDFDocument.load(pdf)];\n case 2:\n _a = _b.sent();\n _b.label = 3;\n case 3:\n srcDoc = _a;\n srcPages = pluckIndices(srcDoc.getPages(), indices);\n return [2 /*return*/, this.embedPages(srcPages)];\n }\n });\n });\n };\n /**\n * Embed a single PDF page into this document.\n *\n * For example:\n * ```js\n * const pdfDoc = await PDFDocument.create()\n *\n * const sourcePdfUrl = 'https://pdf-lib.js.org/assets/with_large_page_count.pdf'\n * const sourceBuffer = await fetch(sourcePdfUrl).then((res) => res.arrayBuffer())\n * const sourcePdfDoc = await PDFDocument.load(sourceBuffer)\n * const sourcePdfPage = sourcePdfDoc.getPages()[73]\n *\n * const embeddedPage = await pdfDoc.embedPage(\n * sourcePdfPage,\n *\n * // Clip a section of the source page so that we only embed part of it\n * { left: 100, right: 450, bottom: 330, top: 570 },\n *\n * // Translate all drawings of the embedded page by (10, 200) units\n * [1, 0, 0, 1, 10, 200],\n * )\n * ```\n *\n * @param page The page to be embedded.\n * @param boundingBox\n * Optionally, an area of the source page that should be embedded\n * (defaults to entire page).\n * @param transformationMatrix\n * Optionally, a transformation matrix that is always applied to the embedded\n * page anywhere it is drawn.\n * @returns Resolves with the embedded pdf page.\n */\n PDFDocument.prototype.embedPage = function (page, boundingBox, transformationMatrix) {\n return __awaiter(this, void 0, void 0, function () {\n var embeddedPage;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n assertIs(page, 'page', [[PDFPage, 'PDFPage']]);\n return [4 /*yield*/, this.embedPages([page], [boundingBox], [transformationMatrix])];\n case 1:\n embeddedPage = _a.sent()[0];\n return [2 /*return*/, embeddedPage];\n }\n });\n });\n };\n /**\n * Embed one or more PDF pages into this document.\n *\n * For example:\n * ```js\n * const pdfDoc = await PDFDocument.create()\n *\n * const sourcePdfUrl = 'https://pdf-lib.js.org/assets/with_large_page_count.pdf'\n * const sourceBuffer = await fetch(sourcePdfUrl).then((res) => res.arrayBuffer())\n * const sourcePdfDoc = await PDFDocument.load(sourceBuffer)\n *\n * const page1 = sourcePdfDoc.getPages()[0]\n * const page2 = sourcePdfDoc.getPages()[52]\n * const page3 = sourcePdfDoc.getPages()[73]\n *\n * const embeddedPages = await pdfDoc.embedPages([page1, page2, page3])\n * ```\n *\n * @param page\n * The pages to be embedded (they must all share the same context).\n * @param boundingBoxes\n * Optionally, an array of clipping boundaries - one for each page\n * (defaults to entirety of each page).\n * @param transformationMatrices\n * Optionally, an array of transformation matrices - one for each page\n * (each page's transformation will apply anywhere it is drawn).\n * @returns Resolves with an array of the embedded pdf pages.\n */\n PDFDocument.prototype.embedPages = function (pages, boundingBoxes, transformationMatrices) {\n if (boundingBoxes === void 0) {\n boundingBoxes = [];\n }\n if (transformationMatrices === void 0) {\n transformationMatrices = [];\n }\n return __awaiter(this, void 0, void 0, function () {\n var idx, len, currPage, nextPage, context, maybeCopyPage, embeddedPages, idx, len, page, box, matrix, embedder, ref;\n var _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (pages.length === 0) return [2 /*return*/, []];\n // Assert all pages have the same context\n for (idx = 0, len = pages.length - 1; idx < len; idx++) {\n currPage = pages[idx];\n nextPage = pages[idx + 1];\n if (currPage.node.context !== nextPage.node.context) {\n throw new PageEmbeddingMismatchedContextError();\n }\n }\n context = pages[0].node.context;\n maybeCopyPage = context === this.context ? function (p) {\n return p;\n } : PDFObjectCopier.for(context, this.context).copy;\n embeddedPages = new Array(pages.length);\n idx = 0, len = pages.length;\n _b.label = 1;\n case 1:\n if (!(idx < len)) return [3 /*break*/, 4];\n page = maybeCopyPage(pages[idx].node);\n box = boundingBoxes[idx];\n matrix = transformationMatrices[idx];\n return [4 /*yield*/, PDFPageEmbedder.for(page, box, matrix)];\n case 2:\n embedder = _b.sent();\n ref = this.context.nextRef();\n embeddedPages[idx] = PDFEmbeddedPage.of(ref, this, embedder);\n _b.label = 3;\n case 3:\n idx++;\n return [3 /*break*/, 1];\n case 4:\n (_a = this.embeddedPages).push.apply(_a, embeddedPages);\n return [2 /*return*/, embeddedPages];\n }\n });\n });\n };\n /**\n * > **NOTE:** You shouldn't need to call this method directly. The [[save]]\n * > and [[saveAsBase64]] methods will automatically ensure that all embedded\n * > assets are flushed before serializing the document.\n *\n * Flush all embedded fonts, PDF pages, and images to this document's\n * [[context]].\n *\n * @returns Resolves when the flush is complete.\n */\n PDFDocument.prototype.flush = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n return [4 /*yield*/, this.embedAll(this.fonts)];\n case 1:\n _a.sent();\n return [4 /*yield*/, this.embedAll(this.images)];\n case 2:\n _a.sent();\n return [4 /*yield*/, this.embedAll(this.embeddedPages)];\n case 3:\n _a.sent();\n return [4 /*yield*/, this.embedAll(this.embeddedFiles)];\n case 4:\n _a.sent();\n return [4 /*yield*/, this.embedAll(this.javaScripts)];\n case 5:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n /**\n * Serialize this document to an array of bytes making up a PDF file.\n * For example:\n * ```js\n * const pdfBytes = await pdfDoc.save()\n * ```\n *\n * There are a number of things you can do with the serialized document,\n * depending on the JavaScript environment you're running in:\n * * Write it to a file in Node or React Native\n * * Download it as a Blob in the browser\n * * Render it in an `iframe`\n *\n * @param options The options to be used when saving the document.\n * @returns Resolves with the bytes of the serialized document.\n */\n PDFDocument.prototype.save = function (options) {\n if (options === void 0) {\n options = {};\n }\n return __awaiter(this, void 0, void 0, function () {\n var _a, useObjectStreams, _b, addDefaultPage, _c, objectsPerTick, _d, updateFieldAppearances, form, Writer;\n return __generator(this, function (_e) {\n switch (_e.label) {\n case 0:\n _a = options.useObjectStreams, useObjectStreams = _a === void 0 ? true : _a, _b = options.addDefaultPage, addDefaultPage = _b === void 0 ? true : _b, _c = options.objectsPerTick, objectsPerTick = _c === void 0 ? 50 : _c, _d = options.updateFieldAppearances, updateFieldAppearances = _d === void 0 ? true : _d;\n assertIs(useObjectStreams, 'useObjectStreams', ['boolean']);\n assertIs(addDefaultPage, 'addDefaultPage', ['boolean']);\n assertIs(objectsPerTick, 'objectsPerTick', ['number']);\n assertIs(updateFieldAppearances, 'updateFieldAppearances', ['boolean']);\n if (addDefaultPage && this.getPageCount() === 0) this.addPage();\n if (updateFieldAppearances) {\n form = this.formCache.getValue();\n if (form) form.updateFieldAppearances();\n }\n return [4 /*yield*/, this.flush()];\n case 1:\n _e.sent();\n Writer = useObjectStreams ? PDFStreamWriter : PDFWriter;\n return [2 /*return*/, Writer.forContext(this.context, objectsPerTick).serializeToBuffer()];\n }\n });\n });\n };\n /**\n * Serialize this document to a base64 encoded string or data URI making up a\n * PDF file. For example:\n * ```js\n * const base64String = await pdfDoc.saveAsBase64()\n * base64String // => 'JVBERi0xLjcKJYGBgYEKC...'\n *\n * const base64DataUri = await pdfDoc.saveAsBase64({ dataUri: true })\n * base64DataUri // => 'data:application/pdf;base64,JVBERi0xLjcKJYGBgYEKC...'\n * ```\n *\n * @param options The options to be used when saving the document.\n * @returns Resolves with a base64 encoded string or data URI of the\n * serialized document.\n */\n PDFDocument.prototype.saveAsBase64 = function (options) {\n if (options === void 0) {\n options = {};\n }\n return __awaiter(this, void 0, void 0, function () {\n var _a, dataUri, otherOptions, bytes, base64;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = options.dataUri, dataUri = _a === void 0 ? false : _a, otherOptions = __rest(options, [\"dataUri\"]);\n assertIs(dataUri, 'dataUri', ['boolean']);\n return [4 /*yield*/, this.save(otherOptions)];\n case 1:\n bytes = _b.sent();\n base64 = encodeToBase64(bytes);\n return [2 /*return*/, dataUri ? \"data:application/pdf;base64,\" + base64 : base64];\n }\n });\n });\n };\n PDFDocument.prototype.findPageForAnnotationRef = function (ref) {\n var pages = this.getPages();\n for (var idx = 0, len = pages.length; idx < len; idx++) {\n var page = pages[idx];\n var annotations = page.node.Annots();\n if ((annotations === null || annotations === void 0 ? void 0 : annotations.indexOf(ref)) !== undefined) {\n return page;\n }\n }\n return undefined;\n };\n PDFDocument.prototype.embedAll = function (embeddables) {\n return __awaiter(this, void 0, void 0, function () {\n var idx, len;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n idx = 0, len = embeddables.length;\n _a.label = 1;\n case 1:\n if (!(idx < len)) return [3 /*break*/, 4];\n return [4 /*yield*/, embeddables[idx].embed()];\n case 2:\n _a.sent();\n _a.label = 3;\n case 3:\n idx++;\n return [3 /*break*/, 1];\n case 4:\n return [2 /*return*/];\n }\n });\n });\n };\n PDFDocument.prototype.updateInfoDict = function () {\n var pdfLib = \"pdf-lib (https://github.com/Hopding/pdf-lib)\";\n var now = new Date();\n var info = this.getInfoDict();\n this.setProducer(pdfLib);\n this.setModificationDate(now);\n if (!info.get(PDFName.of('Creator'))) this.setCreator(pdfLib);\n if (!info.get(PDFName.of('CreationDate'))) this.setCreationDate(now);\n };\n PDFDocument.prototype.getInfoDict = function () {\n var existingInfo = this.context.lookup(this.context.trailerInfo.Info);\n if (existingInfo instanceof PDFDict) return existingInfo;\n var newInfo = this.context.obj({});\n this.context.trailerInfo.Info = this.context.register(newInfo);\n return newInfo;\n };\n PDFDocument.prototype.assertFontkit = function () {\n if (!this.fontkit) throw new FontkitNotRegisteredError();\n return this.fontkit;\n };\n return PDFDocument;\n}();\nexport default PDFDocument;\n/* tslint:disable-next-line only-arrow-functions */\nfunction assertIsLiteralOrHexString(pdfObject) {\n if (!(pdfObject instanceof PDFHexString) && !(pdfObject instanceof PDFString)) {\n throw new UnexpectedObjectTypeError([PDFHexString, PDFString], pdfObject);\n }\n}","import { __assign } from \"tslib\";\nimport { rgb } from \"./colors\";\nimport { drawImage, drawLine, drawLinesOfText, drawPage, drawRectangle, drawSvgPath, drawEllipse } from \"./operations\";\nimport { popGraphicsState, pushGraphicsState, translate, LineCapStyle, scale } from \"./operators\";\nimport PDFDocument from \"./PDFDocument\";\nimport PDFEmbeddedPage from \"./PDFEmbeddedPage\";\nimport PDFFont from \"./PDFFont\";\nimport PDFImage from \"./PDFImage\";\nimport { BlendMode } from \"./PDFPageOptions\";\nimport { degrees, toDegrees } from \"./rotations\";\nimport { StandardFonts } from \"./StandardFonts\";\nimport { PDFContentStream, PDFName, PDFOperator, PDFPageLeaf, PDFRef, PDFDict, PDFArray } from \"../core\";\nimport { assertEachIs, assertIs, assertMultiple, assertOrUndefined, breakTextIntoLines, cleanText, rectanglesAreEqual, lineSplit, assertRangeOrUndefined, assertIsOneOfOrUndefined } from \"../utils\";\n/**\n * Represents a single page of a [[PDFDocument]].\n */\nvar PDFPage = /** @class */function () {\n function PDFPage(leafNode, ref, doc) {\n this.fontSize = 24;\n this.fontColor = rgb(0, 0, 0);\n this.lineHeight = 24;\n this.x = 0;\n this.y = 0;\n assertIs(leafNode, 'leafNode', [[PDFPageLeaf, 'PDFPageLeaf']]);\n assertIs(ref, 'ref', [[PDFRef, 'PDFRef']]);\n assertIs(doc, 'doc', [[PDFDocument, 'PDFDocument']]);\n this.node = leafNode;\n this.ref = ref;\n this.doc = doc;\n }\n /**\n * Rotate this page by a multiple of 90 degrees. For example:\n * ```js\n * import { degrees } from 'pdf-lib'\n *\n * page.setRotation(degrees(-90))\n * page.setRotation(degrees(0))\n * page.setRotation(degrees(90))\n * page.setRotation(degrees(180))\n * page.setRotation(degrees(270))\n * ```\n * @param angle The angle to rotate this page.\n */\n PDFPage.prototype.setRotation = function (angle) {\n var degreesAngle = toDegrees(angle);\n assertMultiple(degreesAngle, 'degreesAngle', 90);\n this.node.set(PDFName.of('Rotate'), this.doc.context.obj(degreesAngle));\n };\n /**\n * Get this page's rotation angle in degrees. For example:\n * ```js\n * const rotationAngle = page.getRotation().angle;\n * ```\n * @returns The rotation angle of the page in degrees (always a multiple of\n * 90 degrees).\n */\n PDFPage.prototype.getRotation = function () {\n var Rotate = this.node.Rotate();\n return degrees(Rotate ? Rotate.asNumber() : 0);\n };\n /**\n * Resize this page by increasing or decreasing its width and height. For\n * example:\n * ```js\n * page.setSize(250, 500)\n * page.setSize(page.getWidth() + 50, page.getHeight() + 100)\n * page.setSize(page.getWidth() - 50, page.getHeight() - 100)\n * ```\n *\n * Note that the PDF specification does not allow for pages to have explicit\n * widths and heights. Instead it defines the \"size\" of a page in terms of\n * five rectangles: the MediaBox, CropBox, BleedBox, TrimBox, and ArtBox. As a\n * result, this method cannot directly change the width and height of a page.\n * Instead, it works by adjusting these five boxes.\n *\n * This method performs the following steps:\n * 1. Set width & height of MediaBox.\n * 2. Set width & height of CropBox, if it has same dimensions as MediaBox.\n * 3. Set width & height of BleedBox, if it has same dimensions as MediaBox.\n * 4. Set width & height of TrimBox, if it has same dimensions as MediaBox.\n * 5. Set width & height of ArtBox, if it has same dimensions as MediaBox.\n *\n * This approach works well for most PDF documents as all PDF pages must\n * have a MediaBox, but relatively few have a CropBox, BleedBox, TrimBox, or\n * ArtBox. And when they do have these additional boxes, they often have the\n * same dimensions as the MediaBox. However, if you find this method does not\n * work for your document, consider setting the boxes directly:\n * * [[PDFPage.setMediaBox]]\n * * [[PDFPage.setCropBox]]\n * * [[PDFPage.setBleedBox]]\n * * [[PDFPage.setTrimBox]]\n * * [[PDFPage.setArtBox]]\n *\n * @param width The new width of the page.\n * @param height The new height of the page.\n */\n PDFPage.prototype.setSize = function (width, height) {\n assertIs(width, 'width', ['number']);\n assertIs(height, 'height', ['number']);\n var mediaBox = this.getMediaBox();\n this.setMediaBox(mediaBox.x, mediaBox.y, width, height);\n var cropBox = this.getCropBox();\n var bleedBox = this.getBleedBox();\n var trimBox = this.getTrimBox();\n var artBox = this.getArtBox();\n var hasCropBox = this.node.CropBox();\n var hasBleedBox = this.node.BleedBox();\n var hasTrimBox = this.node.TrimBox();\n var hasArtBox = this.node.ArtBox();\n if (hasCropBox && rectanglesAreEqual(cropBox, mediaBox)) {\n this.setCropBox(mediaBox.x, mediaBox.y, width, height);\n }\n if (hasBleedBox && rectanglesAreEqual(bleedBox, mediaBox)) {\n this.setBleedBox(mediaBox.x, mediaBox.y, width, height);\n }\n if (hasTrimBox && rectanglesAreEqual(trimBox, mediaBox)) {\n this.setTrimBox(mediaBox.x, mediaBox.y, width, height);\n }\n if (hasArtBox && rectanglesAreEqual(artBox, mediaBox)) {\n this.setArtBox(mediaBox.x, mediaBox.y, width, height);\n }\n };\n /**\n * Resize this page by increasing or decreasing its width. For example:\n * ```js\n * page.setWidth(250)\n * page.setWidth(page.getWidth() + 50)\n * page.setWidth(page.getWidth() - 50)\n * ```\n *\n * This method uses [[PDFPage.setSize]] to set the page's width.\n *\n * @param width The new width of the page.\n */\n PDFPage.prototype.setWidth = function (width) {\n assertIs(width, 'width', ['number']);\n this.setSize(width, this.getSize().height);\n };\n /**\n * Resize this page by increasing or decreasing its height. For example:\n * ```js\n * page.setHeight(500)\n * page.setHeight(page.getWidth() + 100)\n * page.setHeight(page.getWidth() - 100)\n * ```\n *\n * This method uses [[PDFPage.setSize]] to set the page's height.\n *\n * @param height The new height of the page.\n */\n PDFPage.prototype.setHeight = function (height) {\n assertIs(height, 'height', ['number']);\n this.setSize(this.getSize().width, height);\n };\n /**\n * Set the MediaBox of this page. For example:\n * ```js\n * const mediaBox = page.getMediaBox()\n *\n * page.setMediaBox(0, 0, 250, 500)\n * page.setMediaBox(mediaBox.x, mediaBox.y, 50, 100)\n * page.setMediaBox(15, 5, mediaBox.width - 50, mediaBox.height - 100)\n * ```\n *\n * See [[PDFPage.getMediaBox]] for details about what the MediaBox represents.\n *\n * @param x The x coordinate of the lower left corner of the new MediaBox.\n * @param y The y coordinate of the lower left corner of the new MediaBox.\n * @param width The width of the new MediaBox.\n * @param height The height of the new MediaBox.\n */\n PDFPage.prototype.setMediaBox = function (x, y, width, height) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n assertIs(width, 'width', ['number']);\n assertIs(height, 'height', ['number']);\n var mediaBox = this.doc.context.obj([x, y, x + width, y + height]);\n this.node.set(PDFName.MediaBox, mediaBox);\n };\n /**\n * Set the CropBox of this page. For example:\n * ```js\n * const cropBox = page.getCropBox()\n *\n * page.setCropBox(0, 0, 250, 500)\n * page.setCropBox(cropBox.x, cropBox.y, 50, 100)\n * page.setCropBox(15, 5, cropBox.width - 50, cropBox.height - 100)\n * ```\n *\n * See [[PDFPage.getCropBox]] for details about what the CropBox represents.\n *\n * @param x The x coordinate of the lower left corner of the new CropBox.\n * @param y The y coordinate of the lower left corner of the new CropBox.\n * @param width The width of the new CropBox.\n * @param height The height of the new CropBox.\n */\n PDFPage.prototype.setCropBox = function (x, y, width, height) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n assertIs(width, 'width', ['number']);\n assertIs(height, 'height', ['number']);\n var cropBox = this.doc.context.obj([x, y, x + width, y + height]);\n this.node.set(PDFName.CropBox, cropBox);\n };\n /**\n * Set the BleedBox of this page. For example:\n * ```js\n * const bleedBox = page.getBleedBox()\n *\n * page.setBleedBox(0, 0, 250, 500)\n * page.setBleedBox(bleedBox.x, bleedBox.y, 50, 100)\n * page.setBleedBox(15, 5, bleedBox.width - 50, bleedBox.height - 100)\n * ```\n *\n * See [[PDFPage.getBleedBox]] for details about what the BleedBox represents.\n *\n * @param x The x coordinate of the lower left corner of the new BleedBox.\n * @param y The y coordinate of the lower left corner of the new BleedBox.\n * @param width The width of the new BleedBox.\n * @param height The height of the new BleedBox.\n */\n PDFPage.prototype.setBleedBox = function (x, y, width, height) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n assertIs(width, 'width', ['number']);\n assertIs(height, 'height', ['number']);\n var bleedBox = this.doc.context.obj([x, y, x + width, y + height]);\n this.node.set(PDFName.BleedBox, bleedBox);\n };\n /**\n * Set the TrimBox of this page. For example:\n * ```js\n * const trimBox = page.getTrimBox()\n *\n * page.setTrimBox(0, 0, 250, 500)\n * page.setTrimBox(trimBox.x, trimBox.y, 50, 100)\n * page.setTrimBox(15, 5, trimBox.width - 50, trimBox.height - 100)\n * ```\n *\n * See [[PDFPage.getTrimBox]] for details about what the TrimBox represents.\n *\n * @param x The x coordinate of the lower left corner of the new TrimBox.\n * @param y The y coordinate of the lower left corner of the new TrimBox.\n * @param width The width of the new TrimBox.\n * @param height The height of the new TrimBox.\n */\n PDFPage.prototype.setTrimBox = function (x, y, width, height) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n assertIs(width, 'width', ['number']);\n assertIs(height, 'height', ['number']);\n var trimBox = this.doc.context.obj([x, y, x + width, y + height]);\n this.node.set(PDFName.TrimBox, trimBox);\n };\n /**\n * Set the ArtBox of this page. For example:\n * ```js\n * const artBox = page.getArtBox()\n *\n * page.setArtBox(0, 0, 250, 500)\n * page.setArtBox(artBox.x, artBox.y, 50, 100)\n * page.setArtBox(15, 5, artBox.width - 50, artBox.height - 100)\n * ```\n *\n * See [[PDFPage.getArtBox]] for details about what the ArtBox represents.\n *\n * @param x The x coordinate of the lower left corner of the new ArtBox.\n * @param y The y coordinate of the lower left corner of the new ArtBox.\n * @param width The width of the new ArtBox.\n * @param height The height of the new ArtBox.\n */\n PDFPage.prototype.setArtBox = function (x, y, width, height) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n assertIs(width, 'width', ['number']);\n assertIs(height, 'height', ['number']);\n var artBox = this.doc.context.obj([x, y, x + width, y + height]);\n this.node.set(PDFName.ArtBox, artBox);\n };\n /**\n * Get this page's width and height. For example:\n * ```js\n * const { width, height } = page.getSize()\n * ```\n *\n * This method uses [[PDFPage.getMediaBox]] to obtain the page's\n * width and height.\n *\n * @returns The width and height of the page.\n */\n PDFPage.prototype.getSize = function () {\n var _a = this.getMediaBox(),\n width = _a.width,\n height = _a.height;\n return {\n width: width,\n height: height\n };\n };\n /**\n * Get this page's width. For example:\n * ```js\n * const width = page.getWidth()\n * ```\n *\n * This method uses [[PDFPage.getSize]] to obtain the page's size.\n *\n * @returns The width of the page.\n */\n PDFPage.prototype.getWidth = function () {\n return this.getSize().width;\n };\n /**\n * Get this page's height. For example:\n * ```js\n * const height = page.getHeight()\n * ```\n *\n * This method uses [[PDFPage.getSize]] to obtain the page's size.\n *\n * @returns The height of the page.\n */\n PDFPage.prototype.getHeight = function () {\n return this.getSize().height;\n };\n /**\n * Get the rectangle defining this page's MediaBox. For example:\n * ```js\n * const { x, y, width, height } = page.getMediaBox()\n * ```\n *\n * The MediaBox of a page defines the boundaries of the physical medium on\n * which the page is to be displayed/printed. It may include extended area\n * surrounding the page content for bleed marks, printing marks, etc...\n * It may also include areas close to the edges of the medium that cannot be\n * marked because of physical limitations of the output device. Content\n * falling outside this boundary may safely be discarded without affecting\n * the meaning of the PDF file.\n *\n * @returns An object defining the lower left corner of the MediaBox and its\n * width & height.\n */\n PDFPage.prototype.getMediaBox = function () {\n var mediaBox = this.node.MediaBox();\n return mediaBox.asRectangle();\n };\n /**\n * Get the rectangle defining this page's CropBox. For example:\n * ```js\n * const { x, y, width, height } = page.getCropBox()\n * ```\n *\n * The CropBox of a page defines the region to which the contents of the page\n * shall be clipped when displayed or printed. Unlike the other boxes, the\n * CropBox does not necessarily represent the physical page geometry. It\n * merely imposes clipping on the page contents.\n *\n * The CropBox's default value is the page's MediaBox.\n *\n * @returns An object defining the lower left corner of the CropBox and its\n * width & height.\n */\n PDFPage.prototype.getCropBox = function () {\n var _a;\n var cropBox = this.node.CropBox();\n return (_a = cropBox === null || cropBox === void 0 ? void 0 : cropBox.asRectangle()) !== null && _a !== void 0 ? _a : this.getMediaBox();\n };\n /**\n * Get the rectangle defining this page's BleedBox. For example:\n * ```js\n * const { x, y, width, height } = page.getBleedBox()\n * ```\n *\n * The BleedBox of a page defines the region to which the contents of the\n * page shall be clipped when output in a production environment. This may\n * include any extra bleed area needed to accommodate the physical\n * limitations of cutting, folding, and trimming equipment. The actual\n * printed page may include printing marks that fall outside the BleedBox.\n *\n * The BleedBox's default value is the page's CropBox.\n *\n * @returns An object defining the lower left corner of the BleedBox and its\n * width & height.\n */\n PDFPage.prototype.getBleedBox = function () {\n var _a;\n var bleedBox = this.node.BleedBox();\n return (_a = bleedBox === null || bleedBox === void 0 ? void 0 : bleedBox.asRectangle()) !== null && _a !== void 0 ? _a : this.getCropBox();\n };\n /**\n * Get the rectangle defining this page's TrimBox. For example:\n * ```js\n * const { x, y, width, height } = page.getTrimBox()\n * ```\n *\n * The TrimBox of a page defines the intended dimensions of the finished\n * page after trimming. It may be smaller than the MediaBox to allow for\n * production-related content, such as printing instructions, cut marks, or\n * color bars.\n *\n * The TrimBox's default value is the page's CropBox.\n *\n * @returns An object defining the lower left corner of the TrimBox and its\n * width & height.\n */\n PDFPage.prototype.getTrimBox = function () {\n var _a;\n var trimBox = this.node.TrimBox();\n return (_a = trimBox === null || trimBox === void 0 ? void 0 : trimBox.asRectangle()) !== null && _a !== void 0 ? _a : this.getCropBox();\n };\n /**\n * Get the rectangle defining this page's ArtBox. For example:\n * ```js\n * const { x, y, width, height } = page.getArtBox()\n * ```\n *\n * The ArtBox of a page defines the extent of the page's meaningful content\n * (including potential white space).\n *\n * The ArtBox's default value is the page's CropBox.\n *\n * @returns An object defining the lower left corner of the ArtBox and its\n * width & height.\n */\n PDFPage.prototype.getArtBox = function () {\n var _a;\n var artBox = this.node.ArtBox();\n return (_a = artBox === null || artBox === void 0 ? void 0 : artBox.asRectangle()) !== null && _a !== void 0 ? _a : this.getCropBox();\n };\n /**\n * Translate this page's content to a new location on the page. This operation\n * is often useful after resizing the page with [[setSize]]. For example:\n * ```js\n * // Add 50 units of whitespace to the top and right of the page\n * page.setSize(page.getWidth() + 50, page.getHeight() + 50)\n *\n * // Move the page's content from the lower-left corner of the page\n * // to the top-right corner.\n * page.translateContent(50, 50)\n *\n * // Now there are 50 units of whitespace to the left and bottom of the page\n * ```\n * See also: [[resetPosition]]\n * @param x The new position on the x-axis for this page's content.\n * @param y The new position on the y-axis for this page's content.\n */\n PDFPage.prototype.translateContent = function (x, y) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n this.node.normalize();\n this.getContentStream();\n var start = this.createContentStream(pushGraphicsState(), translate(x, y));\n var startRef = this.doc.context.register(start);\n var end = this.createContentStream(popGraphicsState());\n var endRef = this.doc.context.register(end);\n this.node.wrapContentStreams(startRef, endRef);\n };\n /**\n * Scale the size, content, and annotations of a page.\n *\n * For example:\n * ```js\n * page.scale(0.5, 0.5);\n * ```\n *\n * @param x The factor by which the width for the page should be scaled\n * (e.g. `0.5` is 50%).\n * @param y The factor by which the height for the page should be scaled\n * (e.g. `2.0` is 200%).\n */\n PDFPage.prototype.scale = function (x, y) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n this.setSize(this.getWidth() * x, this.getHeight() * y);\n this.scaleContent(x, y);\n this.scaleAnnotations(x, y);\n };\n /**\n * Scale the content of a page. This is useful after resizing an existing\n * page. This scales only the content, not the annotations.\n *\n * For example:\n * ```js\n * // Bisect the size of the page\n * page.setSize(page.getWidth() / 2, page.getHeight() / 2);\n *\n * // Scale the content of the page down by 50% in x and y\n * page.scaleContent(0.5, 0.5);\n * ```\n * See also: [[scaleAnnotations]]\n * @param x The factor by which the x-axis for the content should be scaled\n * (e.g. `0.5` is 50%).\n * @param y The factor by which the y-axis for the content should be scaled\n * (e.g. `2.0` is 200%).\n */\n PDFPage.prototype.scaleContent = function (x, y) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n this.node.normalize();\n this.getContentStream();\n var start = this.createContentStream(pushGraphicsState(), scale(x, y));\n var startRef = this.doc.context.register(start);\n var end = this.createContentStream(popGraphicsState());\n var endRef = this.doc.context.register(end);\n this.node.wrapContentStreams(startRef, endRef);\n };\n /**\n * Scale the annotations of a page. This is useful if you want to scale a\n * page with comments or other annotations.\n * ```js\n * // Scale the content of the page down by 50% in x and y\n * page.scaleContent(0.5, 0.5);\n *\n * // Scale the content of the page down by 50% in x and y\n * page.scaleAnnotations(0.5, 0.5);\n * ```\n * See also: [[scaleContent]]\n * @param x The factor by which the x-axis for the annotations should be\n * scaled (e.g. `0.5` is 50%).\n * @param y The factor by which the y-axis for the annotations should be\n * scaled (e.g. `2.0` is 200%).\n */\n PDFPage.prototype.scaleAnnotations = function (x, y) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n var annots = this.node.Annots();\n if (!annots) return;\n for (var idx = 0; idx < annots.size(); idx++) {\n var annot = annots.lookup(idx);\n if (annot instanceof PDFDict) this.scaleAnnot(annot, x, y);\n }\n };\n /**\n * Reset the x and y coordinates of this page to `(0, 0)`. This operation is\n * often useful after calling [[translateContent]]. For example:\n * ```js\n * // Shift the page's contents up and to the right by 50 units\n * page.translateContent(50, 50)\n *\n * // This text will shifted - it will be drawn at (50, 50)\n * page.drawText('I am shifted')\n *\n * // Move back to (0, 0)\n * page.resetPosition()\n *\n * // This text will not be shifted - it will be drawn at (0, 0)\n * page.drawText('I am not shifted')\n * ```\n */\n PDFPage.prototype.resetPosition = function () {\n this.getContentStream(false);\n this.x = 0;\n this.y = 0;\n };\n /**\n * Choose a default font for this page. The default font will be used whenever\n * text is drawn on this page and no font is specified. For example:\n * ```js\n * import { StandardFonts } from 'pdf-lib'\n *\n * const timesRomanFont = await pdfDoc.embedFont(StandardFonts.TimesRoman)\n * const helveticaFont = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const courierFont = await pdfDoc.embedFont(StandardFonts.Courier)\n *\n * const page = pdfDoc.addPage()\n *\n * page.setFont(helveticaFont)\n * page.drawText('I will be drawn in Helvetica')\n *\n * page.setFont(timesRomanFont)\n * page.drawText('I will be drawn in Courier', { font: courierFont })\n * ```\n * @param font The default font to be used when drawing text on this page.\n */\n PDFPage.prototype.setFont = function (font) {\n // TODO: Reuse image Font name if we've already added this image to Resources.Fonts\n assertIs(font, 'font', [[PDFFont, 'PDFFont']]);\n this.font = font;\n this.fontKey = this.node.newFontDictionary(this.font.name, this.font.ref);\n };\n /**\n * Choose a default font size for this page. The default font size will be\n * used whenever text is drawn on this page and no font size is specified.\n * For example:\n * ```js\n * page.setFontSize(12)\n * page.drawText('I will be drawn in size 12')\n *\n * page.setFontSize(36)\n * page.drawText('I will be drawn in size 24', { fontSize: 24 })\n * ```\n * @param fontSize The default font size to be used when drawing text on this\n * page.\n */\n PDFPage.prototype.setFontSize = function (fontSize) {\n assertIs(fontSize, 'fontSize', ['number']);\n this.fontSize = fontSize;\n };\n /**\n * Choose a default font color for this page. The default font color will be\n * used whenever text is drawn on this page and no font color is specified.\n * For example:\n * ```js\n * import { rgb, cmyk, grayscale } from 'pdf-lib'\n *\n * page.setFontColor(rgb(0.97, 0.02, 0.97))\n * page.drawText('I will be drawn in pink')\n *\n * page.setFontColor(cmyk(0.4, 0.7, 0.39, 0.15))\n * page.drawText('I will be drawn in gray', { color: grayscale(0.5) })\n * ```\n * @param fontColor The default font color to be used when drawing text on\n * this page.\n */\n PDFPage.prototype.setFontColor = function (fontColor) {\n assertIs(fontColor, 'fontColor', [[Object, 'Color']]);\n this.fontColor = fontColor;\n };\n /**\n * Choose a default line height for this page. The default line height will be\n * used whenever text is drawn on this page and no line height is specified.\n * For example:\n * ```js\n * page.setLineHeight(12);\n * page.drawText('These lines will be vertically \\n separated by 12 units')\n *\n * page.setLineHeight(36);\n * page.drawText('These lines will be vertically \\n separated by 24 units', {\n * lineHeight: 24\n * })\n * ```\n * @param lineHeight The default line height to be used when drawing text on\n * this page.\n */\n PDFPage.prototype.setLineHeight = function (lineHeight) {\n assertIs(lineHeight, 'lineHeight', ['number']);\n this.lineHeight = lineHeight;\n };\n /**\n * Get the default position of this page. For example:\n * ```js\n * const { x, y } = page.getPosition()\n * ```\n * @returns The default position of the page.\n */\n PDFPage.prototype.getPosition = function () {\n return {\n x: this.x,\n y: this.y\n };\n };\n /**\n * Get the default x coordinate of this page. For example:\n * ```js\n * const x = page.getX()\n * ```\n * @returns The default x coordinate of the page.\n */\n PDFPage.prototype.getX = function () {\n return this.x;\n };\n /**\n * Get the default y coordinate of this page. For example:\n * ```js\n * const y = page.getY()\n * ```\n * @returns The default y coordinate of the page.\n */\n PDFPage.prototype.getY = function () {\n return this.y;\n };\n /**\n * Change the default position of this page. For example:\n * ```js\n * page.moveTo(0, 0)\n * page.drawText('I will be drawn at the origin')\n *\n * page.moveTo(0, 25)\n * page.drawText('I will be drawn 25 units up')\n *\n * page.moveTo(25, 25)\n * page.drawText('I will be drawn 25 units up and 25 units to the right')\n * ```\n * @param x The new default position on the x-axis for this page.\n * @param y The new default position on the y-axis for this page.\n */\n PDFPage.prototype.moveTo = function (x, y) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n this.x = x;\n this.y = y;\n };\n /**\n * Change the default position of this page to be further down the y-axis.\n * For example:\n * ```js\n * page.moveTo(50, 50)\n * page.drawText('I will be drawn at (50, 50)')\n *\n * page.moveDown(10)\n * page.drawText('I will be drawn at (50, 40)')\n * ```\n * @param yDecrease The amount by which the page's default position along the\n * y-axis should be decreased.\n */\n PDFPage.prototype.moveDown = function (yDecrease) {\n assertIs(yDecrease, 'yDecrease', ['number']);\n this.y -= yDecrease;\n };\n /**\n * Change the default position of this page to be further up the y-axis.\n * For example:\n * ```js\n * page.moveTo(50, 50)\n * page.drawText('I will be drawn at (50, 50)')\n *\n * page.moveUp(10)\n * page.drawText('I will be drawn at (50, 60)')\n * ```\n * @param yIncrease The amount by which the page's default position along the\n * y-axis should be increased.\n */\n PDFPage.prototype.moveUp = function (yIncrease) {\n assertIs(yIncrease, 'yIncrease', ['number']);\n this.y += yIncrease;\n };\n /**\n * Change the default position of this page to be further left on the x-axis.\n * For example:\n * ```js\n * page.moveTo(50, 50)\n * page.drawText('I will be drawn at (50, 50)')\n *\n * page.moveLeft(10)\n * page.drawText('I will be drawn at (40, 50)')\n * ```\n * @param xDecrease The amount by which the page's default position along the\n * x-axis should be decreased.\n */\n PDFPage.prototype.moveLeft = function (xDecrease) {\n assertIs(xDecrease, 'xDecrease', ['number']);\n this.x -= xDecrease;\n };\n /**\n * Change the default position of this page to be further right on the y-axis.\n * For example:\n * ```js\n * page.moveTo(50, 50)\n * page.drawText('I will be drawn at (50, 50)')\n *\n * page.moveRight(10)\n * page.drawText('I will be drawn at (60, 50)')\n * ```\n * @param xIncrease The amount by which the page's default position along the\n * x-axis should be increased.\n */\n PDFPage.prototype.moveRight = function (xIncrease) {\n assertIs(xIncrease, 'xIncrease', ['number']);\n this.x += xIncrease;\n };\n /**\n * Push one or more operators to the end of this page's current content\n * stream. For example:\n * ```js\n * import {\n * pushGraphicsState,\n * moveTo,\n * lineTo,\n * closePath,\n * setFillingColor,\n * rgb,\n * fill,\n * popGraphicsState,\n * } from 'pdf-lib'\n *\n * // Draw a green triangle in the lower-left corner of the page\n * page.pushOperators(\n * pushGraphicsState(),\n * moveTo(0, 0),\n * lineTo(100, 0),\n * lineTo(50, 100),\n * closePath(),\n * setFillingColor(rgb(0.0, 1.0, 0.0)),\n * fill(),\n * popGraphicsState(),\n * )\n * ```\n * @param operator The operators to be pushed.\n */\n PDFPage.prototype.pushOperators = function () {\n var operator = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operator[_i] = arguments[_i];\n }\n assertEachIs(operator, 'operator', [[PDFOperator, 'PDFOperator']]);\n var contentStream = this.getContentStream();\n contentStream.push.apply(contentStream, operator);\n };\n /**\n * Draw one or more lines of text on this page. For example:\n * ```js\n * import { StandardFonts, rgb } from 'pdf-lib'\n *\n * const helveticaFont = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const timesRomanFont = await pdfDoc.embedFont(StandardFonts.TimesRoman)\n *\n * const page = pdfDoc.addPage()\n *\n * page.setFont(helveticaFont)\n *\n * page.moveTo(5, 200)\n * page.drawText('The Life of an Egg', { size: 36 })\n *\n * page.moveDown(36)\n * page.drawText('An Epic Tale of Woe', { size: 30 })\n *\n * page.drawText(\n * `Humpty Dumpty sat on a wall \\n` +\n * `Humpty Dumpty had a great fall; \\n` +\n * `All the king's horses and all the king's men \\n` +\n * `Couldn't put Humpty together again. \\n`,\n * {\n * x: 25,\n * y: 100,\n * font: timesRomanFont,\n * size: 24,\n * color: rgb(1, 0, 0),\n * lineHeight: 24,\n * opacity: 0.75,\n * },\n * )\n * ```\n * @param text The text to be drawn.\n * @param options The options to be used when drawing the text.\n */\n PDFPage.prototype.drawText = function (text, options) {\n var _a, _b, _c, _d, _e, _f, _g;\n if (options === void 0) {\n options = {};\n }\n assertIs(text, 'text', ['string']);\n assertOrUndefined(options.color, 'options.color', [[Object, 'Color']]);\n assertRangeOrUndefined(options.opacity, 'opacity.opacity', 0, 1);\n assertOrUndefined(options.font, 'options.font', [[PDFFont, 'PDFFont']]);\n assertOrUndefined(options.size, 'options.size', ['number']);\n assertOrUndefined(options.rotate, 'options.rotate', [[Object, 'Rotation']]);\n assertOrUndefined(options.xSkew, 'options.xSkew', [[Object, 'Rotation']]);\n assertOrUndefined(options.ySkew, 'options.ySkew', [[Object, 'Rotation']]);\n assertOrUndefined(options.x, 'options.x', ['number']);\n assertOrUndefined(options.y, 'options.y', ['number']);\n assertOrUndefined(options.lineHeight, 'options.lineHeight', ['number']);\n assertOrUndefined(options.maxWidth, 'options.maxWidth', ['number']);\n assertOrUndefined(options.wordBreaks, 'options.wordBreaks', [Array]);\n assertIsOneOfOrUndefined(options.blendMode, 'options.blendMode', BlendMode);\n var _h = this.setOrEmbedFont(options.font),\n oldFont = _h.oldFont,\n newFont = _h.newFont,\n newFontKey = _h.newFontKey;\n var fontSize = options.size || this.fontSize;\n var wordBreaks = options.wordBreaks || this.doc.defaultWordBreaks;\n var textWidth = function (t) {\n return newFont.widthOfTextAtSize(t, fontSize);\n };\n var lines = options.maxWidth === undefined ? lineSplit(cleanText(text)) : breakTextIntoLines(text, wordBreaks, options.maxWidth, textWidth);\n var encodedLines = new Array(lines.length);\n for (var idx = 0, len = lines.length; idx < len; idx++) {\n encodedLines[idx] = newFont.encodeText(lines[idx]);\n }\n var graphicsStateKey = this.maybeEmbedGraphicsState({\n opacity: options.opacity,\n blendMode: options.blendMode\n });\n var contentStream = this.getContentStream();\n contentStream.push.apply(contentStream, drawLinesOfText(encodedLines, {\n color: (_a = options.color) !== null && _a !== void 0 ? _a : this.fontColor,\n font: newFontKey,\n size: fontSize,\n rotate: (_b = options.rotate) !== null && _b !== void 0 ? _b : degrees(0),\n xSkew: (_c = options.xSkew) !== null && _c !== void 0 ? _c : degrees(0),\n ySkew: (_d = options.ySkew) !== null && _d !== void 0 ? _d : degrees(0),\n x: (_e = options.x) !== null && _e !== void 0 ? _e : this.x,\n y: (_f = options.y) !== null && _f !== void 0 ? _f : this.y,\n lineHeight: (_g = options.lineHeight) !== null && _g !== void 0 ? _g : this.lineHeight,\n graphicsState: graphicsStateKey\n }));\n if (options.font) {\n if (oldFont) this.setFont(oldFont);else this.resetFont();\n }\n };\n /**\n * Draw an image on this page. For example:\n * ```js\n * import { degrees } from 'pdf-lib'\n *\n * const jpgUrl = 'https://pdf-lib.js.org/assets/cat_riding_unicorn.jpg'\n * const jpgImageBytes = await fetch(jpgUrl).then((res) => res.arrayBuffer())\n *\n * const jpgImage = await pdfDoc.embedJpg(jpgImageBytes)\n * const jpgDims = jpgImage.scale(0.5)\n *\n * const page = pdfDoc.addPage()\n *\n * page.drawImage(jpgImage, {\n * x: 25,\n * y: 25,\n * width: jpgDims.width,\n * height: jpgDims.height,\n * rotate: degrees(30),\n * opacity: 0.75,\n * })\n * ```\n * @param image The image to be drawn.\n * @param options The options to be used when drawing the image.\n */\n PDFPage.prototype.drawImage = function (image, options) {\n var _a, _b, _c, _d, _e, _f, _g;\n if (options === void 0) {\n options = {};\n }\n // TODO: Reuse image XObject name if we've already added this image to Resources.XObjects\n assertIs(image, 'image', [[PDFImage, 'PDFImage']]);\n assertOrUndefined(options.x, 'options.x', ['number']);\n assertOrUndefined(options.y, 'options.y', ['number']);\n assertOrUndefined(options.width, 'options.width', ['number']);\n assertOrUndefined(options.height, 'options.height', ['number']);\n assertOrUndefined(options.rotate, 'options.rotate', [[Object, 'Rotation']]);\n assertOrUndefined(options.xSkew, 'options.xSkew', [[Object, 'Rotation']]);\n assertOrUndefined(options.ySkew, 'options.ySkew', [[Object, 'Rotation']]);\n assertRangeOrUndefined(options.opacity, 'opacity.opacity', 0, 1);\n assertIsOneOfOrUndefined(options.blendMode, 'options.blendMode', BlendMode);\n var xObjectKey = this.node.newXObject('Image', image.ref);\n var graphicsStateKey = this.maybeEmbedGraphicsState({\n opacity: options.opacity,\n blendMode: options.blendMode\n });\n var contentStream = this.getContentStream();\n contentStream.push.apply(contentStream, drawImage(xObjectKey, {\n x: (_a = options.x) !== null && _a !== void 0 ? _a : this.x,\n y: (_b = options.y) !== null && _b !== void 0 ? _b : this.y,\n width: (_c = options.width) !== null && _c !== void 0 ? _c : image.size().width,\n height: (_d = options.height) !== null && _d !== void 0 ? _d : image.size().height,\n rotate: (_e = options.rotate) !== null && _e !== void 0 ? _e : degrees(0),\n xSkew: (_f = options.xSkew) !== null && _f !== void 0 ? _f : degrees(0),\n ySkew: (_g = options.ySkew) !== null && _g !== void 0 ? _g : degrees(0),\n graphicsState: graphicsStateKey\n }));\n };\n /**\n * Draw an embedded PDF page on this page. For example:\n * ```js\n * import { degrees } from 'pdf-lib'\n *\n * const pdfDoc = await PDFDocument.create()\n * const page = pdfDoc.addPage()\n *\n * const sourcePdfUrl = 'https://pdf-lib.js.org/assets/with_large_page_count.pdf'\n * const sourcePdf = await fetch(sourcePdfUrl).then((res) => res.arrayBuffer())\n *\n * // Embed page 74 from the PDF\n * const [embeddedPage] = await pdfDoc.embedPdf(sourcePdf, 73)\n *\n * page.drawPage(embeddedPage, {\n * x: 250,\n * y: 200,\n * xScale: 0.5,\n * yScale: 0.5,\n * rotate: degrees(30),\n * opacity: 0.75,\n * })\n * ```\n *\n * The `options` argument accepts both `width`/`height` and `xScale`/`yScale`\n * as options. Since each of these options defines the size of the drawn page,\n * if both options are given, `width` and `height` take precedence and the\n * corresponding scale variants are ignored.\n *\n * @param embeddedPage The embedded page to be drawn.\n * @param options The options to be used when drawing the embedded page.\n */\n PDFPage.prototype.drawPage = function (embeddedPage, options) {\n var _a, _b, _c, _d, _e;\n if (options === void 0) {\n options = {};\n }\n // TODO: Reuse embeddedPage XObject name if we've already added this embeddedPage to Resources.XObjects\n assertIs(embeddedPage, 'embeddedPage', [[PDFEmbeddedPage, 'PDFEmbeddedPage']]);\n assertOrUndefined(options.x, 'options.x', ['number']);\n assertOrUndefined(options.y, 'options.y', ['number']);\n assertOrUndefined(options.xScale, 'options.xScale', ['number']);\n assertOrUndefined(options.yScale, 'options.yScale', ['number']);\n assertOrUndefined(options.width, 'options.width', ['number']);\n assertOrUndefined(options.height, 'options.height', ['number']);\n assertOrUndefined(options.rotate, 'options.rotate', [[Object, 'Rotation']]);\n assertOrUndefined(options.xSkew, 'options.xSkew', [[Object, 'Rotation']]);\n assertOrUndefined(options.ySkew, 'options.ySkew', [[Object, 'Rotation']]);\n assertRangeOrUndefined(options.opacity, 'opacity.opacity', 0, 1);\n assertIsOneOfOrUndefined(options.blendMode, 'options.blendMode', BlendMode);\n var xObjectKey = this.node.newXObject('EmbeddedPdfPage', embeddedPage.ref);\n var graphicsStateKey = this.maybeEmbedGraphicsState({\n opacity: options.opacity,\n blendMode: options.blendMode\n });\n // prettier-ignore\n var xScale = options.width !== undefined ? options.width / embeddedPage.width : options.xScale !== undefined ? options.xScale : 1;\n // prettier-ignore\n var yScale = options.height !== undefined ? options.height / embeddedPage.height : options.yScale !== undefined ? options.yScale : 1;\n var contentStream = this.getContentStream();\n contentStream.push.apply(contentStream, drawPage(xObjectKey, {\n x: (_a = options.x) !== null && _a !== void 0 ? _a : this.x,\n y: (_b = options.y) !== null && _b !== void 0 ? _b : this.y,\n xScale: xScale,\n yScale: yScale,\n rotate: (_c = options.rotate) !== null && _c !== void 0 ? _c : degrees(0),\n xSkew: (_d = options.xSkew) !== null && _d !== void 0 ? _d : degrees(0),\n ySkew: (_e = options.ySkew) !== null && _e !== void 0 ? _e : degrees(0),\n graphicsState: graphicsStateKey\n }));\n };\n /**\n * Draw an SVG path on this page. For example:\n * ```js\n * import { rgb } from 'pdf-lib'\n *\n * const svgPath = 'M 0,20 L 100,160 Q 130,200 150,120 C 190,-40 200,200 300,150 L 400,90'\n *\n * // Draw path as black line\n * page.drawSvgPath(svgPath, { x: 25, y: 75 })\n *\n * // Change border style and opacity\n * page.drawSvgPath(svgPath, {\n * x: 25,\n * y: 275,\n * borderColor: rgb(0.5, 0.5, 0.5),\n * borderWidth: 2,\n * borderOpacity: 0.75,\n * })\n *\n * // Set fill color and opacity\n * page.drawSvgPath(svgPath, {\n * x: 25,\n * y: 475,\n * color: rgb(1.0, 0, 0),\n * opacity: 0.75,\n * })\n *\n * // Draw 50% of original size\n * page.drawSvgPath(svgPath, {\n * x: 25,\n * y: 675,\n * scale: 0.5,\n * })\n * ```\n * @param path The SVG path to be drawn.\n * @param options The options to be used when drawing the SVG path.\n */\n PDFPage.prototype.drawSvgPath = function (path, options) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\n if (options === void 0) {\n options = {};\n }\n assertIs(path, 'path', ['string']);\n assertOrUndefined(options.x, 'options.x', ['number']);\n assertOrUndefined(options.y, 'options.y', ['number']);\n assertOrUndefined(options.scale, 'options.scale', ['number']);\n assertOrUndefined(options.rotate, 'options.rotate', [[Object, 'Rotation']]);\n assertOrUndefined(options.borderWidth, 'options.borderWidth', ['number']);\n assertOrUndefined(options.color, 'options.color', [[Object, 'Color']]);\n assertRangeOrUndefined(options.opacity, 'opacity.opacity', 0, 1);\n assertOrUndefined(options.borderColor, 'options.borderColor', [[Object, 'Color']]);\n assertOrUndefined(options.borderDashArray, 'options.borderDashArray', [Array]);\n assertOrUndefined(options.borderDashPhase, 'options.borderDashPhase', ['number']);\n assertIsOneOfOrUndefined(options.borderLineCap, 'options.borderLineCap', LineCapStyle);\n assertRangeOrUndefined(options.borderOpacity, 'options.borderOpacity', 0, 1);\n assertIsOneOfOrUndefined(options.blendMode, 'options.blendMode', BlendMode);\n var graphicsStateKey = this.maybeEmbedGraphicsState({\n opacity: options.opacity,\n borderOpacity: options.borderOpacity,\n blendMode: options.blendMode\n });\n if (!('color' in options) && !('borderColor' in options)) {\n options.borderColor = rgb(0, 0, 0);\n }\n var contentStream = this.getContentStream();\n contentStream.push.apply(contentStream, drawSvgPath(path, {\n x: (_a = options.x) !== null && _a !== void 0 ? _a : this.x,\n y: (_b = options.y) !== null && _b !== void 0 ? _b : this.y,\n scale: options.scale,\n rotate: (_c = options.rotate) !== null && _c !== void 0 ? _c : degrees(0),\n color: (_d = options.color) !== null && _d !== void 0 ? _d : undefined,\n borderColor: (_e = options.borderColor) !== null && _e !== void 0 ? _e : undefined,\n borderWidth: (_f = options.borderWidth) !== null && _f !== void 0 ? _f : 0,\n borderDashArray: (_g = options.borderDashArray) !== null && _g !== void 0 ? _g : undefined,\n borderDashPhase: (_h = options.borderDashPhase) !== null && _h !== void 0 ? _h : undefined,\n borderLineCap: (_j = options.borderLineCap) !== null && _j !== void 0 ? _j : undefined,\n graphicsState: graphicsStateKey\n }));\n };\n /**\n * Draw a line on this page. For example:\n * ```js\n * import { rgb } from 'pdf-lib'\n *\n * page.drawLine({\n * start: { x: 25, y: 75 },\n * end: { x: 125, y: 175 },\n * thickness: 2,\n * color: rgb(0.75, 0.2, 0.2),\n * opacity: 0.75,\n * })\n * ```\n * @param options The options to be used when drawing the line.\n */\n PDFPage.prototype.drawLine = function (options) {\n var _a, _b, _c, _d, _e;\n assertIs(options.start, 'options.start', [[Object, '{ x: number, y: number }']]);\n assertIs(options.end, 'options.end', [[Object, '{ x: number, y: number }']]);\n assertIs(options.start.x, 'options.start.x', ['number']);\n assertIs(options.start.y, 'options.start.y', ['number']);\n assertIs(options.end.x, 'options.end.x', ['number']);\n assertIs(options.end.y, 'options.end.y', ['number']);\n assertOrUndefined(options.thickness, 'options.thickness', ['number']);\n assertOrUndefined(options.color, 'options.color', [[Object, 'Color']]);\n assertOrUndefined(options.dashArray, 'options.dashArray', [Array]);\n assertOrUndefined(options.dashPhase, 'options.dashPhase', ['number']);\n assertIsOneOfOrUndefined(options.lineCap, 'options.lineCap', LineCapStyle);\n assertRangeOrUndefined(options.opacity, 'opacity.opacity', 0, 1);\n assertIsOneOfOrUndefined(options.blendMode, 'options.blendMode', BlendMode);\n var graphicsStateKey = this.maybeEmbedGraphicsState({\n borderOpacity: options.opacity,\n blendMode: options.blendMode\n });\n if (!('color' in options)) {\n options.color = rgb(0, 0, 0);\n }\n var contentStream = this.getContentStream();\n contentStream.push.apply(contentStream, drawLine({\n start: options.start,\n end: options.end,\n thickness: (_a = options.thickness) !== null && _a !== void 0 ? _a : 1,\n color: (_b = options.color) !== null && _b !== void 0 ? _b : undefined,\n dashArray: (_c = options.dashArray) !== null && _c !== void 0 ? _c : undefined,\n dashPhase: (_d = options.dashPhase) !== null && _d !== void 0 ? _d : undefined,\n lineCap: (_e = options.lineCap) !== null && _e !== void 0 ? _e : undefined,\n graphicsState: graphicsStateKey\n }));\n };\n /**\n * Draw a rectangle on this page. For example:\n * ```js\n * import { degrees, grayscale, rgb } from 'pdf-lib'\n *\n * page.drawRectangle({\n * x: 25,\n * y: 75,\n * width: 250,\n * height: 75,\n * rotate: degrees(-15),\n * borderWidth: 5,\n * borderColor: grayscale(0.5),\n * color: rgb(0.75, 0.2, 0.2),\n * opacity: 0.5,\n * borderOpacity: 0.75,\n * })\n * ```\n * @param options The options to be used when drawing the rectangle.\n */\n PDFPage.prototype.drawRectangle = function (options) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;\n if (options === void 0) {\n options = {};\n }\n assertOrUndefined(options.x, 'options.x', ['number']);\n assertOrUndefined(options.y, 'options.y', ['number']);\n assertOrUndefined(options.width, 'options.width', ['number']);\n assertOrUndefined(options.height, 'options.height', ['number']);\n assertOrUndefined(options.rotate, 'options.rotate', [[Object, 'Rotation']]);\n assertOrUndefined(options.xSkew, 'options.xSkew', [[Object, 'Rotation']]);\n assertOrUndefined(options.ySkew, 'options.ySkew', [[Object, 'Rotation']]);\n assertOrUndefined(options.borderWidth, 'options.borderWidth', ['number']);\n assertOrUndefined(options.color, 'options.color', [[Object, 'Color']]);\n assertRangeOrUndefined(options.opacity, 'opacity.opacity', 0, 1);\n assertOrUndefined(options.borderColor, 'options.borderColor', [[Object, 'Color']]);\n assertOrUndefined(options.borderDashArray, 'options.borderDashArray', [Array]);\n assertOrUndefined(options.borderDashPhase, 'options.borderDashPhase', ['number']);\n assertIsOneOfOrUndefined(options.borderLineCap, 'options.borderLineCap', LineCapStyle);\n assertRangeOrUndefined(options.borderOpacity, 'options.borderOpacity', 0, 1);\n assertIsOneOfOrUndefined(options.blendMode, 'options.blendMode', BlendMode);\n var graphicsStateKey = this.maybeEmbedGraphicsState({\n opacity: options.opacity,\n borderOpacity: options.borderOpacity,\n blendMode: options.blendMode\n });\n if (!('color' in options) && !('borderColor' in options)) {\n options.color = rgb(0, 0, 0);\n }\n var contentStream = this.getContentStream();\n contentStream.push.apply(contentStream, drawRectangle({\n x: (_a = options.x) !== null && _a !== void 0 ? _a : this.x,\n y: (_b = options.y) !== null && _b !== void 0 ? _b : this.y,\n width: (_c = options.width) !== null && _c !== void 0 ? _c : 150,\n height: (_d = options.height) !== null && _d !== void 0 ? _d : 100,\n rotate: (_e = options.rotate) !== null && _e !== void 0 ? _e : degrees(0),\n xSkew: (_f = options.xSkew) !== null && _f !== void 0 ? _f : degrees(0),\n ySkew: (_g = options.ySkew) !== null && _g !== void 0 ? _g : degrees(0),\n borderWidth: (_h = options.borderWidth) !== null && _h !== void 0 ? _h : 0,\n color: (_j = options.color) !== null && _j !== void 0 ? _j : undefined,\n borderColor: (_k = options.borderColor) !== null && _k !== void 0 ? _k : undefined,\n borderDashArray: (_l = options.borderDashArray) !== null && _l !== void 0 ? _l : undefined,\n borderDashPhase: (_m = options.borderDashPhase) !== null && _m !== void 0 ? _m : undefined,\n graphicsState: graphicsStateKey,\n borderLineCap: (_o = options.borderLineCap) !== null && _o !== void 0 ? _o : undefined\n }));\n };\n /**\n * Draw a square on this page. For example:\n * ```js\n * import { degrees, grayscale, rgb } from 'pdf-lib'\n *\n * page.drawSquare({\n * x: 25,\n * y: 75,\n * size: 100,\n * rotate: degrees(-15),\n * borderWidth: 5,\n * borderColor: grayscale(0.5),\n * color: rgb(0.75, 0.2, 0.2),\n * opacity: 0.5,\n * borderOpacity: 0.75,\n * })\n * ```\n * @param options The options to be used when drawing the square.\n */\n PDFPage.prototype.drawSquare = function (options) {\n if (options === void 0) {\n options = {};\n }\n var size = options.size;\n assertOrUndefined(size, 'size', ['number']);\n this.drawRectangle(__assign(__assign({}, options), {\n width: size,\n height: size\n }));\n };\n /**\n * Draw an ellipse on this page. For example:\n * ```js\n * import { grayscale, rgb } from 'pdf-lib'\n *\n * page.drawEllipse({\n * x: 200,\n * y: 75,\n * xScale: 100,\n * yScale: 50,\n * borderWidth: 5,\n * borderColor: grayscale(0.5),\n * color: rgb(0.75, 0.2, 0.2),\n * opacity: 0.5,\n * borderOpacity: 0.75,\n * })\n * ```\n * @param options The options to be used when drawing the ellipse.\n */\n PDFPage.prototype.drawEllipse = function (options) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;\n if (options === void 0) {\n options = {};\n }\n assertOrUndefined(options.x, 'options.x', ['number']);\n assertOrUndefined(options.y, 'options.y', ['number']);\n assertOrUndefined(options.xScale, 'options.xScale', ['number']);\n assertOrUndefined(options.yScale, 'options.yScale', ['number']);\n assertOrUndefined(options.rotate, 'options.rotate', [[Object, 'Rotation']]);\n assertOrUndefined(options.color, 'options.color', [[Object, 'Color']]);\n assertRangeOrUndefined(options.opacity, 'opacity.opacity', 0, 1);\n assertOrUndefined(options.borderColor, 'options.borderColor', [[Object, 'Color']]);\n assertRangeOrUndefined(options.borderOpacity, 'options.borderOpacity', 0, 1);\n assertOrUndefined(options.borderWidth, 'options.borderWidth', ['number']);\n assertOrUndefined(options.borderDashArray, 'options.borderDashArray', [Array]);\n assertOrUndefined(options.borderDashPhase, 'options.borderDashPhase', ['number']);\n assertIsOneOfOrUndefined(options.borderLineCap, 'options.borderLineCap', LineCapStyle);\n assertIsOneOfOrUndefined(options.blendMode, 'options.blendMode', BlendMode);\n var graphicsStateKey = this.maybeEmbedGraphicsState({\n opacity: options.opacity,\n borderOpacity: options.borderOpacity,\n blendMode: options.blendMode\n });\n if (!('color' in options) && !('borderColor' in options)) {\n options.color = rgb(0, 0, 0);\n }\n var contentStream = this.getContentStream();\n contentStream.push.apply(contentStream, drawEllipse({\n x: (_a = options.x) !== null && _a !== void 0 ? _a : this.x,\n y: (_b = options.y) !== null && _b !== void 0 ? _b : this.y,\n xScale: (_c = options.xScale) !== null && _c !== void 0 ? _c : 100,\n yScale: (_d = options.yScale) !== null && _d !== void 0 ? _d : 100,\n rotate: (_e = options.rotate) !== null && _e !== void 0 ? _e : undefined,\n color: (_f = options.color) !== null && _f !== void 0 ? _f : undefined,\n borderColor: (_g = options.borderColor) !== null && _g !== void 0 ? _g : undefined,\n borderWidth: (_h = options.borderWidth) !== null && _h !== void 0 ? _h : 0,\n borderDashArray: (_j = options.borderDashArray) !== null && _j !== void 0 ? _j : undefined,\n borderDashPhase: (_k = options.borderDashPhase) !== null && _k !== void 0 ? _k : undefined,\n borderLineCap: (_l = options.borderLineCap) !== null && _l !== void 0 ? _l : undefined,\n graphicsState: graphicsStateKey\n }));\n };\n /**\n * Draw a circle on this page. For example:\n * ```js\n * import { grayscale, rgb } from 'pdf-lib'\n *\n * page.drawCircle({\n * x: 200,\n * y: 150,\n * size: 100,\n * borderWidth: 5,\n * borderColor: grayscale(0.5),\n * color: rgb(0.75, 0.2, 0.2),\n * opacity: 0.5,\n * borderOpacity: 0.75,\n * })\n * ```\n * @param options The options to be used when drawing the ellipse.\n */\n PDFPage.prototype.drawCircle = function (options) {\n if (options === void 0) {\n options = {};\n }\n var _a = options.size,\n size = _a === void 0 ? 100 : _a;\n assertOrUndefined(size, 'size', ['number']);\n this.drawEllipse(__assign(__assign({}, options), {\n xScale: size,\n yScale: size\n }));\n };\n PDFPage.prototype.setOrEmbedFont = function (font) {\n var oldFont = this.font;\n var oldFontKey = this.fontKey;\n if (font) this.setFont(font);else this.getFont();\n var newFont = this.font;\n var newFontKey = this.fontKey;\n return {\n oldFont: oldFont,\n oldFontKey: oldFontKey,\n newFont: newFont,\n newFontKey: newFontKey\n };\n };\n PDFPage.prototype.getFont = function () {\n if (!this.font || !this.fontKey) {\n var font = this.doc.embedStandardFont(StandardFonts.Helvetica);\n this.setFont(font);\n }\n return [this.font, this.fontKey];\n };\n PDFPage.prototype.resetFont = function () {\n this.font = undefined;\n this.fontKey = undefined;\n };\n PDFPage.prototype.getContentStream = function (useExisting) {\n if (useExisting === void 0) {\n useExisting = true;\n }\n if (useExisting && this.contentStream) return this.contentStream;\n this.contentStream = this.createContentStream();\n this.contentStreamRef = this.doc.context.register(this.contentStream);\n this.node.addContentStream(this.contentStreamRef);\n return this.contentStream;\n };\n PDFPage.prototype.createContentStream = function () {\n var operators = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operators[_i] = arguments[_i];\n }\n var dict = this.doc.context.obj({});\n var contentStream = PDFContentStream.of(dict, operators);\n return contentStream;\n };\n PDFPage.prototype.maybeEmbedGraphicsState = function (options) {\n var opacity = options.opacity,\n borderOpacity = options.borderOpacity,\n blendMode = options.blendMode;\n if (opacity === undefined && borderOpacity === undefined && blendMode === undefined) {\n return undefined;\n }\n var graphicsState = this.doc.context.obj({\n Type: 'ExtGState',\n ca: opacity,\n CA: borderOpacity,\n BM: blendMode\n });\n var key = this.node.newExtGState('GS', graphicsState);\n return key;\n };\n PDFPage.prototype.scaleAnnot = function (annot, x, y) {\n var selectors = ['RD', 'CL', 'Vertices', 'QuadPoints', 'L', 'Rect'];\n for (var idx = 0, len = selectors.length; idx < len; idx++) {\n var list = annot.lookup(PDFName.of(selectors[idx]));\n if (list instanceof PDFArray) list.scalePDFNumbers(x, y);\n }\n var inkLists = annot.lookup(PDFName.of('InkList'));\n if (inkLists instanceof PDFArray) {\n for (var idx = 0, len = inkLists.size(); idx < len; idx++) {\n var arr = inkLists.lookup(idx);\n if (arr instanceof PDFArray) arr.scalePDFNumbers(x, y);\n }\n }\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFDocument.addPage]] and [[PDFDocument.insertPage]]\n * > methods, which can create instances of [[PDFPage]] for you.\n *\n * Create an instance of [[PDFPage]] from an existing leaf node.\n *\n * @param leafNode The leaf node to be wrapped.\n * @param ref The unique reference for the page.\n * @param doc The document to which the page will belong.\n */\n PDFPage.of = function (leafNode, ref, doc) {\n return new PDFPage(leafNode, ref, doc);\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFDocument.addPage]] and [[PDFDocument.insertPage]]\n * > methods, which can create instances of [[PDFPage]] for you.\n *\n * Create an instance of [[PDFPage]].\n *\n * @param doc The document to which the page will belong.\n */\n PDFPage.create = function (doc) {\n assertIs(doc, 'doc', [[PDFDocument, 'PDFDocument']]);\n var dummyRef = PDFRef.of(-1);\n var pageLeaf = PDFPageLeaf.withContextAndParent(doc.context, dummyRef);\n var pageRef = doc.context.register(pageLeaf);\n return new PDFPage(pageLeaf, pageRef, doc);\n };\n return PDFPage;\n}();\nexport default PDFPage;","import { __extends } from \"tslib\";\nimport PDFPage from \"../PDFPage\";\nimport PDFFont from \"../PDFFont\";\nimport { ImageAlignment } from \"../image/alignment\";\nimport { normalizeAppearance, defaultButtonAppearanceProvider } from \"./appearances\";\nimport PDFField, { assertFieldAppearanceOptions } from \"./PDFField\";\nimport { rgb } from \"../colors\";\nimport { degrees } from \"../rotations\";\nimport { PDFStream, PDFAcroPushButton } from \"../../core\";\nimport { assertIs, assertOrUndefined, assertPositive } from \"../../utils\";\n/**\n * Represents a button field of a [[PDFForm]].\n *\n * [[PDFButton]] fields are interactive controls that users can click with their\n * mouse. This type of [[PDFField]] is not stateful. The purpose of a button\n * is to perform an action when the user clicks on it, such as opening a print\n * modal or resetting the form. Buttons are typically rectangular in shape and\n * have a text label describing the action that they perform when clicked.\n */\nvar PDFButton = /** @class */function (_super) {\n __extends(PDFButton, _super);\n function PDFButton(acroPushButton, ref, doc) {\n var _this = _super.call(this, acroPushButton, ref, doc) || this;\n assertIs(acroPushButton, 'acroButton', [[PDFAcroPushButton, 'PDFAcroPushButton']]);\n _this.acroField = acroPushButton;\n return _this;\n }\n /**\n * Display an image inside the bounds of this button's widgets. For example:\n * ```js\n * const pngImage = await pdfDoc.embedPng(...)\n * const button = form.getButton('some.button.field')\n * button.setImage(pngImage, ImageAlignment.Center)\n * ```\n * This will update the appearances streams for each of this button's widgets.\n * @param image The image that should be displayed.\n * @param alignment The alignment of the image.\n */\n PDFButton.prototype.setImage = function (image, alignment) {\n if (alignment === void 0) {\n alignment = ImageAlignment.Center;\n }\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var streamRef = this.createImageAppearanceStream(widget, image, alignment);\n this.updateWidgetAppearances(widget, {\n normal: streamRef\n });\n }\n this.markAsClean();\n };\n /**\n * Set the font size for this field. Larger font sizes will result in larger\n * text being displayed when PDF readers render this button. Font sizes may\n * be integer or floating point numbers. Supplying a negative font size will\n * cause this method to throw an error.\n *\n * For example:\n * ```js\n * const button = form.getButton('some.button.field')\n * button.setFontSize(4)\n * button.setFontSize(15.7)\n * ```\n *\n * > This method depends upon the existence of a default appearance\n * > (`/DA`) string. If this field does not have a default appearance string,\n * > or that string does not contain a font size (via the `Tf` operator),\n * > then this method will throw an error.\n *\n * @param fontSize The font size to be used when rendering text in this field.\n */\n PDFButton.prototype.setFontSize = function (fontSize) {\n assertPositive(fontSize, 'fontSize');\n this.acroField.setFontSize(fontSize);\n this.markAsDirty();\n };\n /**\n * Show this button on the specified page with the given text. For example:\n * ```js\n * const ubuntuFont = await pdfDoc.embedFont(ubuntuFontBytes)\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const button = form.createButton('some.button.field')\n *\n * button.addToPage('Do Stuff', page, {\n * x: 50,\n * y: 75,\n * width: 200,\n * height: 100,\n * textColor: rgb(1, 0, 0),\n * backgroundColor: rgb(0, 1, 0),\n * borderColor: rgb(0, 0, 1),\n * borderWidth: 2,\n * rotate: degrees(90),\n * font: ubuntuFont,\n * })\n * ```\n * This will create a new widget for this button field.\n * @param text The text to be displayed for this button widget.\n * @param page The page to which this button widget should be added.\n * @param options The options to be used when adding this button widget.\n */\n PDFButton.prototype.addToPage = function (\n // TODO: This needs to be optional, e.g. for image buttons\n text, page, options) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;\n assertOrUndefined(text, 'text', ['string']);\n assertOrUndefined(page, 'page', [[PDFPage, 'PDFPage']]);\n assertFieldAppearanceOptions(options);\n // Create a widget for this button\n var widget = this.createWidget({\n x: ((_a = options === null || options === void 0 ? void 0 : options.x) !== null && _a !== void 0 ? _a : 0) - ((_b = options === null || options === void 0 ? void 0 : options.borderWidth) !== null && _b !== void 0 ? _b : 0) / 2,\n y: ((_c = options === null || options === void 0 ? void 0 : options.y) !== null && _c !== void 0 ? _c : 0) - ((_d = options === null || options === void 0 ? void 0 : options.borderWidth) !== null && _d !== void 0 ? _d : 0) / 2,\n width: (_e = options === null || options === void 0 ? void 0 : options.width) !== null && _e !== void 0 ? _e : 100,\n height: (_f = options === null || options === void 0 ? void 0 : options.height) !== null && _f !== void 0 ? _f : 50,\n textColor: (_g = options === null || options === void 0 ? void 0 : options.textColor) !== null && _g !== void 0 ? _g : rgb(0, 0, 0),\n backgroundColor: (_h = options === null || options === void 0 ? void 0 : options.backgroundColor) !== null && _h !== void 0 ? _h : rgb(0.75, 0.75, 0.75),\n borderColor: options === null || options === void 0 ? void 0 : options.borderColor,\n borderWidth: (_j = options === null || options === void 0 ? void 0 : options.borderWidth) !== null && _j !== void 0 ? _j : 0,\n rotate: (_k = options === null || options === void 0 ? void 0 : options.rotate) !== null && _k !== void 0 ? _k : degrees(0),\n caption: text,\n hidden: options === null || options === void 0 ? void 0 : options.hidden,\n page: page.ref\n });\n var widgetRef = this.doc.context.register(widget.dict);\n // Add widget to this field\n this.acroField.addWidget(widgetRef);\n // Set appearance streams for widget\n var font = (_l = options === null || options === void 0 ? void 0 : options.font) !== null && _l !== void 0 ? _l : this.doc.getForm().getDefaultFont();\n this.updateWidgetAppearance(widget, font);\n // Add widget to the given page\n page.node.addAnnot(widgetRef);\n };\n /**\n * Returns `true` if this button has been marked as dirty, or if any of this\n * button's widgets do not have an appearance stream. For example:\n * ```js\n * const button = form.getButton('some.button.field')\n * if (button.needsAppearancesUpdate()) console.log('Needs update')\n * ```\n * @returns Whether or not this button needs an appearance update.\n */\n PDFButton.prototype.needsAppearancesUpdate = function () {\n var _a;\n if (this.isDirty()) return true;\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var hasAppearances = ((_a = widget.getAppearances()) === null || _a === void 0 ? void 0 : _a.normal) instanceof PDFStream;\n if (!hasAppearances) return true;\n }\n return false;\n };\n /**\n * Update the appearance streams for each of this button's widgets using\n * the default appearance provider for buttons. For example:\n * ```js\n * const helvetica = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const button = form.getButton('some.button.field')\n * button.defaultUpdateAppearances(helvetica)\n * ```\n * @param font The font to be used for creating the appearance streams.\n */\n PDFButton.prototype.defaultUpdateAppearances = function (font) {\n assertIs(font, 'font', [[PDFFont, 'PDFFont']]);\n this.updateAppearances(font);\n };\n /**\n * Update the appearance streams for each of this button's widgets using\n * the given appearance provider. If no `provider` is passed, the default\n * appearance provider for buttons will be used. For example:\n * ```js\n * const helvetica = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const button = form.getButton('some.button.field')\n * button.updateAppearances(helvetica, (field, widget, font) => {\n * ...\n * return {\n * normal: drawButton(...),\n * down: drawButton(...),\n * }\n * })\n * ```\n * @param font The font to be used for creating the appearance streams.\n * @param provider Optionally, the appearance provider to be used for\n * generating the contents of the appearance streams.\n */\n PDFButton.prototype.updateAppearances = function (font, provider) {\n assertIs(font, 'font', [[PDFFont, 'PDFFont']]);\n assertOrUndefined(provider, 'provider', [Function]);\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n this.updateWidgetAppearance(widget, font, provider);\n }\n };\n PDFButton.prototype.updateWidgetAppearance = function (widget, font, provider) {\n var apProvider = provider !== null && provider !== void 0 ? provider : defaultButtonAppearanceProvider;\n var appearances = normalizeAppearance(apProvider(this, widget, font));\n this.updateWidgetAppearanceWithFont(widget, font, appearances);\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFForm.getButton]] method, which will create an\n * > instance of [[PDFButton]] for you.\n *\n * Create an instance of [[PDFButton]] from an existing acroPushButton and ref\n *\n * @param acroPushButton The underlying `PDFAcroPushButton` for this button.\n * @param ref The unique reference for this button.\n * @param doc The document to which this button will belong.\n */\n PDFButton.of = function (acroPushButton, ref, doc) {\n return new PDFButton(acroPushButton, ref, doc);\n };\n return PDFButton;\n}(PDFField);\nexport default PDFButton;","'use strict';\n\nvar zlib_inflate = require('./zlib/inflate');\nvar utils = require('./utils/common');\nvar strings = require('./utils/strings');\nvar c = require('./zlib/constants');\nvar msg = require('./zlib/messages');\nvar ZStream = require('./zlib/zstream');\nvar GZheader = require('./zlib/gzheader');\nvar toString = Object.prototype.toString;\n\n/**\n * class Inflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[inflate]]\n * and [[inflateRaw]].\n **/\n\n/* internal\n * inflate.chunks -> Array\n *\n * Chunks of output data, if [[Inflate#onData]] not overridden.\n **/\n\n/**\n * Inflate.result -> Uint8Array|Array|String\n *\n * Uncompressed result, generated by default [[Inflate#onData]]\n * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you\n * push a chunk with explicit flush (call [[Inflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\n\n/**\n * Inflate.err -> Number\n *\n * Error code after inflate finished. 0 (Z_OK) on success.\n * Should be checked if broken data possible.\n **/\n\n/**\n * Inflate.msg -> String\n *\n * Error message, if [[Inflate.err]] != 0\n **/\n\n/**\n * new Inflate(options)\n * - options (Object): zlib inflate options.\n *\n * Creates new inflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `windowBits`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw inflate\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n * By default, when no options set, autodetect deflate/gzip data format via\n * wrapper header.\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var inflate = new pako.Inflate({ level: 3});\n *\n * inflate.push(chunk1, false);\n * inflate.push(chunk2, true); // true -> last chunk\n *\n * if (inflate.err) { throw new Error(inflate.err); }\n *\n * console.log(inflate.result);\n * ```\n **/\nfunction Inflate(options) {\n if (!(this instanceof Inflate)) return new Inflate(options);\n this.options = utils.assign({\n chunkSize: 16384,\n windowBits: 0,\n to: ''\n }, options || {});\n var opt = this.options;\n\n // Force window size for `raw` data, if not set directly,\n // because we have no header for autodetect.\n if (opt.raw && opt.windowBits >= 0 && opt.windowBits < 16) {\n opt.windowBits = -opt.windowBits;\n if (opt.windowBits === 0) {\n opt.windowBits = -15;\n }\n }\n\n // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n if (opt.windowBits >= 0 && opt.windowBits < 16 && !(options && options.windowBits)) {\n opt.windowBits += 32;\n }\n\n // Gzip header has no info about windows size, we can do autodetect only\n // for deflate. So, if window size not set, force it to max when gzip possible\n if (opt.windowBits > 15 && opt.windowBits < 48) {\n // bit 3 (16) -> gzipped data\n // bit 4 (32) -> autodetect gzip/deflate\n if ((opt.windowBits & 15) === 0) {\n opt.windowBits |= 15;\n }\n }\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n var status = zlib_inflate.inflateInit2(this.strm, opt.windowBits);\n if (status !== c.Z_OK) {\n throw new Error(msg[status]);\n }\n this.header = new GZheader();\n zlib_inflate.inflateGetHeader(this.strm, this.header);\n\n // Setup dictionary\n if (opt.dictionary) {\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n opt.dictionary = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n opt.dictionary = new Uint8Array(opt.dictionary);\n }\n if (opt.raw) {\n //In raw mode we need to set the dictionary early\n status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);\n if (status !== c.Z_OK) {\n throw new Error(msg[status]);\n }\n }\n }\n}\n\n/**\n * Inflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data\n * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with\n * new output chunks. Returns `true` on success. The last data block must have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the decompression context.\n *\n * On fail call [[Inflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nInflate.prototype.push = function (data, mode) {\n var strm = this.strm;\n var chunkSize = this.options.chunkSize;\n var dictionary = this.options.dictionary;\n var status, _mode;\n var next_out_utf8, tail, utf8str;\n\n // Flag to properly process Z_BUF_ERROR on testing inflate call\n // when we check that all output data was flushed.\n var allowBufError = false;\n if (this.ended) {\n return false;\n }\n _mode = mode === ~~mode ? mode : mode === true ? c.Z_FINISH : c.Z_NO_FLUSH;\n\n // Convert data if needed\n if (typeof data === 'string') {\n // Only binary strings can be decompressed on practice\n strm.input = strings.binstring2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n do {\n if (strm.avail_out === 0) {\n strm.output = new utils.Buf8(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */\n\n if (status === c.Z_NEED_DICT && dictionary) {\n status = zlib_inflate.inflateSetDictionary(this.strm, dictionary);\n }\n if (status === c.Z_BUF_ERROR && allowBufError === true) {\n status = c.Z_OK;\n allowBufError = false;\n }\n if (status !== c.Z_STREAM_END && status !== c.Z_OK) {\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n if (strm.next_out) {\n if (strm.avail_out === 0 || status === c.Z_STREAM_END || strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH)) {\n if (this.options.to === 'string') {\n next_out_utf8 = strings.utf8border(strm.output, strm.next_out);\n tail = strm.next_out - next_out_utf8;\n utf8str = strings.buf2string(strm.output, next_out_utf8);\n\n // move tail\n strm.next_out = tail;\n strm.avail_out = chunkSize - tail;\n if (tail) {\n utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0);\n }\n this.onData(utf8str);\n } else {\n this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n }\n }\n }\n\n // When no more input data, we should check that internal inflate buffers\n // are flushed. The only way to do it when avail_out = 0 - run one more\n // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR.\n // Here we set flag to process this error properly.\n //\n // NOTE. Deflate does not return error in this case and does not needs such\n // logic.\n if (strm.avail_in === 0 && strm.avail_out === 0) {\n allowBufError = true;\n }\n } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);\n if (status === c.Z_STREAM_END) {\n _mode = c.Z_FINISH;\n }\n\n // Finalize on the last chunk.\n if (_mode === c.Z_FINISH) {\n status = zlib_inflate.inflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === c.Z_OK;\n }\n\n // callback interim results if Z_SYNC_FLUSH.\n if (_mode === c.Z_SYNC_FLUSH) {\n this.onEnd(c.Z_OK);\n strm.avail_out = 0;\n return true;\n }\n return true;\n};\n\n/**\n * Inflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): output data. Type of array depends\n * on js engine support. When string output requested, each chunk\n * will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nInflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n/**\n * Inflate#onEnd(status) -> Void\n * - status (Number): inflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called either after you tell inflate that the input stream is\n * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nInflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === c.Z_OK) {\n if (this.options.to === 'string') {\n // Glue & convert here, until we teach pako to send\n // utf8 aligned strings to onData\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n/**\n * inflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Decompress `data` with inflate/ungzip and `options`. Autodetect\n * format via wrapper header by default. That's why we don't provide\n * separate `ungzip` method.\n *\n * Supported options are:\n *\n * - windowBits\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , input = pako.deflate([1,2,3,4,5,6,7,8,9])\n * , output;\n *\n * try {\n * output = pako.inflate(input);\n * } catch (err)\n * console.log(err);\n * }\n * ```\n **/\nfunction inflate(input, options) {\n var inflator = new Inflate(options);\n inflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (inflator.err) {\n throw inflator.msg || msg[inflator.err];\n }\n return inflator.result;\n}\n\n/**\n * inflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * The same as [[inflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}\n\n/**\n * ungzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Just shortcut to [[inflate]], because it autodetects format\n * by header.content. Done for convenience.\n **/\n\nexports.Inflate = Inflate;\nexports.inflate = inflate;\nexports.inflateRaw = inflateRaw;\nexports.ungzip = inflate;","// String encode/decode helpers\n'use strict';\n\nvar utils = require('./common');\n\n// Quick check if we can use fast array to bin string conversion\n//\n// - apply(Array) can fail on Android 2.2\n// - apply(Uint8Array) can fail on iOS 5.1 Safari\n//\nvar STR_APPLY_OK = true;\nvar STR_APPLY_UIA_OK = true;\ntry {\n String.fromCharCode.apply(null, [0]);\n} catch (__) {\n STR_APPLY_OK = false;\n}\ntry {\n String.fromCharCode.apply(null, new Uint8Array(1));\n} catch (__) {\n STR_APPLY_UIA_OK = false;\n}\n\n// Table with utf8 lengths (calculated by first byte of sequence)\n// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n// because max possible codepoint is 0x10ffff\nvar _utf8len = new utils.Buf8(256);\nfor (var q = 0; q < 256; q++) {\n _utf8len[q] = q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1;\n}\n_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start\n\n// convert string to array (typed, when possible)\nexports.string2buf = function (str) {\n var buf,\n c,\n c2,\n m_pos,\n i,\n str_len = str.length,\n buf_len = 0;\n\n // count binary size\n for (m_pos = 0; m_pos < str_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && m_pos + 1 < str_len) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + (c - 0xd800 << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n }\n\n // allocate buffer\n buf = new utils.Buf8(buf_len);\n\n // convert\n for (i = 0, m_pos = 0; i < buf_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && m_pos + 1 < str_len) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + (c - 0xd800 << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n if (c < 0x80) {\n /* one byte */\n buf[i++] = c;\n } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | c >>> 6;\n buf[i++] = 0x80 | c & 0x3f;\n } else if (c < 0x10000) {\n /* three bytes */\n buf[i++] = 0xE0 | c >>> 12;\n buf[i++] = 0x80 | c >>> 6 & 0x3f;\n buf[i++] = 0x80 | c & 0x3f;\n } else {\n /* four bytes */\n buf[i++] = 0xf0 | c >>> 18;\n buf[i++] = 0x80 | c >>> 12 & 0x3f;\n buf[i++] = 0x80 | c >>> 6 & 0x3f;\n buf[i++] = 0x80 | c & 0x3f;\n }\n }\n return buf;\n};\n\n// Helper (used in 2 places)\nfunction buf2binstring(buf, len) {\n // On Chrome, the arguments in a function call that are allowed is `65534`.\n // If the length of the buffer is smaller than that, we can use this optimization,\n // otherwise we will take a slower path.\n if (len < 65534) {\n if (buf.subarray && STR_APPLY_UIA_OK || !buf.subarray && STR_APPLY_OK) {\n return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));\n }\n }\n var result = '';\n for (var i = 0; i < len; i++) {\n result += String.fromCharCode(buf[i]);\n }\n return result;\n}\n\n// Convert byte array to binary string\nexports.buf2binstring = function (buf) {\n return buf2binstring(buf, buf.length);\n};\n\n// Convert binary string (typed, when possible)\nexports.binstring2buf = function (str) {\n var buf = new utils.Buf8(str.length);\n for (var i = 0, len = buf.length; i < len; i++) {\n buf[i] = str.charCodeAt(i);\n }\n return buf;\n};\n\n// convert array to string\nexports.buf2string = function (buf, max) {\n var i, out, c, c_len;\n var len = max || buf.length;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n var utf16buf = new Array(len * 2);\n for (out = 0, i = 0; i < len;) {\n c = buf[i++];\n // quick process ascii\n if (c < 0x80) {\n utf16buf[out++] = c;\n continue;\n }\n c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) {\n utf16buf[out++] = 0xfffd;\n i += c_len - 1;\n continue;\n }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = c << 6 | buf[i++] & 0x3f;\n c_len--;\n }\n\n // terminated by end of string?\n if (c_len > 1) {\n utf16buf[out++] = 0xfffd;\n continue;\n }\n if (c < 0x10000) {\n utf16buf[out++] = c;\n } else {\n c -= 0x10000;\n utf16buf[out++] = 0xd800 | c >> 10 & 0x3ff;\n utf16buf[out++] = 0xdc00 | c & 0x3ff;\n }\n }\n return buf2binstring(utf16buf, out);\n};\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max - length limit (mandatory);\nexports.utf8border = function (buf, max) {\n var pos;\n max = max || buf.length;\n if (max > buf.length) {\n max = buf.length;\n }\n\n // go back from last position, until start of sequence found\n pos = max - 1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) {\n pos--;\n }\n\n // Very small and broken sequence,\n // return max, because we should return something anyway.\n if (pos < 0) {\n return max;\n }\n\n // If we came to start of buffer - that means buffer is too small,\n // return max too.\n if (pos === 0) {\n return max;\n }\n return pos + _utf8len[buf[pos]] > max ? pos : max;\n};","import { __extends } from \"tslib\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { copyStringIntoBuffer, padStart, utf16Decode, pdfDocEncodingDecode, toCharCode, parseDate, hasUtf16BOM } from \"../../utils\";\nimport { InvalidPDFDateStringError } from \"../errors\";\nvar PDFString = /** @class */function (_super) {\n __extends(PDFString, _super);\n function PDFString(value) {\n var _this = _super.call(this) || this;\n _this.value = value;\n return _this;\n }\n PDFString.prototype.asBytes = function () {\n var bytes = [];\n var octal = '';\n var escaped = false;\n var pushByte = function (byte) {\n if (byte !== undefined) bytes.push(byte);\n escaped = false;\n };\n for (var idx = 0, len = this.value.length; idx < len; idx++) {\n var char = this.value[idx];\n var byte = toCharCode(char);\n var nextChar = this.value[idx + 1];\n if (!escaped) {\n if (byte === CharCodes.BackSlash) escaped = true;else pushByte(byte);\n } else {\n if (byte === CharCodes.Newline) pushByte();else if (byte === CharCodes.CarriageReturn) pushByte();else if (byte === CharCodes.n) pushByte(CharCodes.Newline);else if (byte === CharCodes.r) pushByte(CharCodes.CarriageReturn);else if (byte === CharCodes.t) pushByte(CharCodes.Tab);else if (byte === CharCodes.b) pushByte(CharCodes.Backspace);else if (byte === CharCodes.f) pushByte(CharCodes.FormFeed);else if (byte === CharCodes.LeftParen) pushByte(CharCodes.LeftParen);else if (byte === CharCodes.RightParen) pushByte(CharCodes.RightParen);else if (byte === CharCodes.Backspace) pushByte(CharCodes.BackSlash);else if (byte >= CharCodes.Zero && byte <= CharCodes.Seven) {\n octal += char;\n if (octal.length === 3 || !(nextChar >= '0' && nextChar <= '7')) {\n pushByte(parseInt(octal, 8));\n octal = '';\n }\n } else {\n pushByte(byte);\n }\n }\n }\n return new Uint8Array(bytes);\n };\n PDFString.prototype.decodeText = function () {\n var bytes = this.asBytes();\n if (hasUtf16BOM(bytes)) return utf16Decode(bytes);\n return pdfDocEncodingDecode(bytes);\n };\n PDFString.prototype.decodeDate = function () {\n var text = this.decodeText();\n var date = parseDate(text);\n if (!date) throw new InvalidPDFDateStringError(text);\n return date;\n };\n PDFString.prototype.asString = function () {\n return this.value;\n };\n PDFString.prototype.clone = function () {\n return PDFString.of(this.value);\n };\n PDFString.prototype.toString = function () {\n return \"(\" + this.value + \")\";\n };\n PDFString.prototype.sizeInBytes = function () {\n return this.value.length + 2;\n };\n PDFString.prototype.copyBytesInto = function (buffer, offset) {\n buffer[offset++] = CharCodes.LeftParen;\n offset += copyStringIntoBuffer(this.value, buffer, offset);\n buffer[offset++] = CharCodes.RightParen;\n return this.value.length + 2;\n };\n // The PDF spec allows newlines and parens to appear directly within a literal\n // string. These character _may_ be escaped. But they do not _have_ to be. So\n // for simplicity, we will not bother escaping them.\n PDFString.of = function (value) {\n return new PDFString(value);\n };\n PDFString.fromDate = function (date) {\n var year = padStart(String(date.getUTCFullYear()), 4, '0');\n var month = padStart(String(date.getUTCMonth() + 1), 2, '0');\n var day = padStart(String(date.getUTCDate()), 2, '0');\n var hours = padStart(String(date.getUTCHours()), 2, '0');\n var mins = padStart(String(date.getUTCMinutes()), 2, '0');\n var secs = padStart(String(date.getUTCSeconds()), 2, '0');\n return new PDFString(\"D:\" + year + month + day + hours + mins + secs + \"Z\");\n };\n return PDFString;\n}(PDFObject);\nexport default PDFString;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.resetState = resetState;\nexports.log = log;\nvar htmlClassList = {};\nvar docBodyClassList = {};\n\n/* eslint-disable no-console */\n/* istanbul ignore next */\nfunction removeClass(at, cls) {\n at.classList.remove(cls);\n}\n\n/* istanbul ignore next */\nfunction resetState() {\n var htmlElement = document.getElementsByTagName(\"html\")[0];\n for (var cls in htmlClassList) {\n removeClass(htmlElement, htmlClassList[cls]);\n }\n var body = document.body;\n for (var _cls in docBodyClassList) {\n removeClass(body, docBodyClassList[_cls]);\n }\n htmlClassList = {};\n docBodyClassList = {};\n}\n\n/* istanbul ignore next */\nfunction log() {\n if (process.env.NODE_ENV !== \"production\") {\n var classes = document.getElementsByTagName(\"html\")[0].className;\n var buffer = \"Show tracked classes:\\n\\n\";\n buffer += \" (\" + classes + \"):\\n \";\n for (var x in htmlClassList) {\n buffer += \" \" + x + \" \" + htmlClassList[x] + \"\\n \";\n }\n classes = document.body.className;\n buffer += \"\\n\\ndoc.body (\" + classes + \"):\\n \";\n for (var _x in docBodyClassList) {\n buffer += \" \" + _x + \" \" + docBodyClassList[_x] + \"\\n \";\n }\n buffer += \"\\n\";\n console.log(buffer);\n }\n}\n/* eslint-enable no-console */\n\n/**\n * Track the number of reference of a class.\n * @param {object} poll The poll to receive the reference.\n * @param {string} className The class name.\n * @return {string}\n */\nvar incrementReference = function incrementReference(poll, className) {\n if (!poll[className]) {\n poll[className] = 0;\n }\n poll[className] += 1;\n return className;\n};\n\n/**\n * Drop the reference of a class.\n * @param {object} poll The poll to receive the reference.\n * @param {string} className The class name.\n * @return {string}\n */\nvar decrementReference = function decrementReference(poll, className) {\n if (poll[className]) {\n poll[className] -= 1;\n }\n return className;\n};\n\n/**\n * Track a class and add to the given class list.\n * @param {Object} classListRef A class list of an element.\n * @param {Object} poll The poll to be used.\n * @param {Array} classes The list of classes to be tracked.\n */\nvar trackClass = function trackClass(classListRef, poll, classes) {\n classes.forEach(function (className) {\n incrementReference(poll, className);\n classListRef.add(className);\n });\n};\n\n/**\n * Untrack a class and remove from the given class list if the reference\n * reaches 0.\n * @param {Object} classListRef A class list of an element.\n * @param {Object} poll The poll to be used.\n * @param {Array} classes The list of classes to be untracked.\n */\nvar untrackClass = function untrackClass(classListRef, poll, classes) {\n classes.forEach(function (className) {\n decrementReference(poll, className);\n poll[className] === 0 && classListRef.remove(className);\n });\n};\n\n/**\n * Public inferface to add classes to the document.body.\n * @param {string} bodyClass The class string to be added.\n * It may contain more then one class\n * with ' ' as separator.\n */\nvar add = exports.add = function add(element, classString) {\n return trackClass(element.classList, element.nodeName.toLowerCase() == \"html\" ? htmlClassList : docBodyClassList, classString.split(\" \"));\n};\n\n/**\n * Public inferface to remove classes from the document.body.\n * @param {string} bodyClass The class string to be added.\n * It may contain more then one class\n * with ' ' as separator.\n */\nvar remove = exports.remove = function remove(element, classString) {\n return untrackClass(element.classList, element.nodeName.toLowerCase() == \"html\" ? htmlClassList : docBodyClassList, classString.split(\" \"));\n};","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// See state defs from inflate.js\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nmodule.exports = function inflate_fast(strm, start) {\n var state;\n var _in; /* local strm.input */\n var last; /* have enough input while in < last */\n var _out; /* local strm.output */\n var beg; /* inflate()'s initial strm.output */\n var end; /* while out < end, enough space available */\n //#ifdef INFLATE_STRICT\n var dmax; /* maximum distance from zlib header */\n //#endif\n var wsize; /* window size or zero if not using window */\n var whave; /* valid bytes in the window */\n var wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n var s_window; /* allocated sliding window, if wsize != 0 */\n var hold; /* local strm.hold */\n var bits; /* local strm.bits */\n var lcode; /* local strm.lencode */\n var dcode; /* local strm.distcode */\n var lmask; /* mask for first level of length codes */\n var dmask; /* mask for first level of distance codes */\n var here; /* retrieved table entry */\n var op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n var len; /* match length, unused bytes */\n var dist; /* match distance */\n var from; /* where to copy match from */\n var from_source;\n var input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257);\n //#ifdef INFLATE_STRICT\n dmax = state.dmax;\n //#endif\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top: do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = lcode[hold & lmask];\n dolen: for (;;) {\n // Goto emulation\n op = here >>> 24 /*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = here >>> 16 & 0xff /*here.op*/;\n if (op === 0) {\n /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff /*here.val*/;\n } else if (op & 16) {\n /* length base */\n len = here & 0xffff /*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & (1 << op) - 1;\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n dodist: for (;;) {\n // goto emulation\n op = here >>> 24 /*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = here >>> 16 & 0xff /*here.op*/;\n if (op & 16) {\n /* distance base */\n dist = here & 0xffff /*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & (1 << op) - 1;\n //#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n //#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) {\n /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n\n // (!) This block is disabled in zlib defaults,\n // don't enable it for binary compatibility\n //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n // if (len <= op - whave) {\n // do {\n // output[_out++] = 0;\n // } while (--len);\n // continue top;\n // }\n // len -= op - whave;\n // do {\n // output[_out++] = 0;\n // } while (--op > whave);\n // if (op === 0) {\n // from = _out - dist;\n // do {\n // output[_out++] = output[from++];\n // } while (--len);\n // continue top;\n // }\n //#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) {\n /* very common case */\n from += wsize - op;\n if (op < len) {\n /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n } else if (wnext < op) {\n /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) {\n /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) {\n /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n } else {\n /* contiguous in window */\n from += wnext - op;\n if (op < len) {\n /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n } else {\n from = _out - dist; /* copy direct from output */\n do {\n /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n } else if ((op & 64) === 0) {\n /* 2nd level distance code */\n here = dcode[(here & 0xffff /*here.val*/) + (hold & (1 << op) - 1)];\n continue dodist;\n } else {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break top;\n }\n break; // need to emulate goto via \"continue\"\n }\n } else if ((op & 64) === 0) {\n /* 2nd level length code */\n here = lcode[(here & 0xffff /*here.val*/) + (hold & (1 << op) - 1)];\n continue dolen;\n } else if (op & 32) {\n /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE;\n break top;\n } else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break top;\n }\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = _in < last ? 5 + (last - _in) : 5 - (_in - last);\n strm.avail_out = _out < end ? 257 + (end - _out) : 257 - (_out - end);\n state.hold = hold;\n state.bits = bits;\n return;\n};","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\nfunction GZheader() {\n /* true if compressed data believed to be text */\n this.text = 0;\n /* modification time */\n this.time = 0;\n /* extra flags (not used when writing a gzip file) */\n this.xflags = 0;\n /* operating system */\n this.os = 0;\n /* pointer to extra field or Z_NULL if none */\n this.extra = null;\n /* extra field length (valid if extra != Z_NULL) */\n this.extra_len = 0; // Actually, we don't need it in JS,\n // but leave for few code modifications\n\n //\n // Setup limits is not necessary because in js we should not preallocate memory\n // for inflate use constant limit in 65536 bytes\n //\n\n /* space at extra (only when reading header) */\n // this.extra_max = 0;\n /* pointer to zero-terminated file name or Z_NULL */\n this.name = '';\n /* space at name (only when reading header) */\n // this.name_max = 0;\n /* pointer to zero-terminated comment or Z_NULL */\n this.comment = '';\n /* space at comment (only when reading header) */\n // this.comm_max = 0;\n /* true if there was or will be a header crc */\n this.hcrc = 0;\n /* true when done reading gzip header (not used when writing a gzip file) */\n this.done = false;\n}\nmodule.exports = GZheader;","\"use strict\";\n\nexports.__esModule = !0, exports.valueExistInSelected = exports.isomorphicWindow = exports.isEqual = exports.hexToRGBA = exports.getProp = exports.getByPath = exports.debounce = void 0;\nvar valueExistInSelected = function (a, b, c) {\n return !!b.find(function (b) {\n return getByPath(b, c.valueField) === a || getByPath(b, c.labelField) === a;\n });\n};\nexports.valueExistInSelected = valueExistInSelected;\nvar hexToRGBA = function (a, b) {\n 4 === a.length && (a = \"\" + a[1] + a[1] + a[2] + a[2] + a[3] + a[3] + \"}\");\n var c = parseInt(a.slice(1, 3), 16),\n d = parseInt(a.slice(3, 5), 16),\n e = parseInt(a.slice(5, 7), 16);\n return \"rgba(\" + c + \", \" + d + \", \" + e + (b && \", \" + b) + \")\";\n};\nexports.hexToRGBA = hexToRGBA;\nvar debounce = function (a, b) {\n void 0 === b && (b = 0);\n var c;\n return function () {\n for (var d = arguments.length, e = Array(d), f = 0; f < d; f++) e[f] = arguments[f];\n c && clearTimeout(c), c = setTimeout(function () {\n a.apply(void 0, e), c = null;\n }, b);\n };\n};\nexports.debounce = debounce;\nvar isEqual = function (c, a) {\n return JSON.stringify(c) === JSON.stringify(a);\n};\nexports.isEqual = isEqual;\nvar getByPath = function (a, b) {\n return b ? b.split(\".\").reduce(function (a, b) {\n return a[b];\n }, a) : void 0;\n};\nexports.getByPath = getByPath;\nvar getProp = function (a, b, c) {\n if (!b) return a;\n var d = Array.isArray(b) ? b : b.split(\".\").filter(function (a) {\n return a.length;\n });\n return d.length ? getProp(a[d.shift()], d, c) : void 0 === a ? c : a;\n};\nexports.getProp = getProp;\nvar isomorphicWindow = function () {\n return \"undefined\" == typeof window && (global.window = {}), window;\n};\nexports.isomorphicWindow = isomorphicWindow;","export default {\n disabled: false\n};","import React from 'react';\nexport default React.createContext(null);","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport config from './config';\nimport { timeoutsShape } from './utils/PropTypes';\nimport TransitionGroupContext from './TransitionGroupContext';\nimport { forceReflow } from './utils/reflow';\nexport var UNMOUNTED = 'unmounted';\nexport var EXITED = 'exited';\nexport var ENTERING = 'entering';\nexport var ENTERED = 'entered';\nexport var EXITING = 'exiting';\n/**\n * The Transition component lets you describe a transition from one component\n * state to another _over time_ with a simple declarative API. Most commonly\n * it's used to animate the mounting and unmounting of a component, but can also\n * be used to describe in-place transition states as well.\n *\n * ---\n *\n * **Note**: `Transition` is a platform-agnostic base component. If you're using\n * transitions in CSS, you'll probably want to use\n * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)\n * instead. It inherits all the features of `Transition`, but contains\n * additional features necessary to play nice with CSS transitions (hence the\n * name of the component).\n *\n * ---\n *\n * By default the `Transition` component does not alter the behavior of the\n * component it renders, it only tracks \"enter\" and \"exit\" states for the\n * components. It's up to you to give meaning and effect to those states. For\n * example we can add styles to a component when it enters or exits:\n *\n * ```jsx\n * import { Transition } from 'react-transition-group';\n *\n * const duration = 300;\n *\n * const defaultStyle = {\n * transition: `opacity ${duration}ms ease-in-out`,\n * opacity: 0,\n * }\n *\n * const transitionStyles = {\n * entering: { opacity: 1 },\n * entered: { opacity: 1 },\n * exiting: { opacity: 0 },\n * exited: { opacity: 0 },\n * };\n *\n * const Fade = ({ in: inProp }) => (\n * \n * {state => (\n *
\n * I'm a fade Transition!\n *
\n * )}\n *
\n * );\n * ```\n *\n * There are 4 main states a Transition can be in:\n * - `'entering'`\n * - `'entered'`\n * - `'exiting'`\n * - `'exited'`\n *\n * Transition state is toggled via the `in` prop. When `true` the component\n * begins the \"Enter\" stage. During this stage, the component will shift from\n * its current transition state, to `'entering'` for the duration of the\n * transition and then to the `'entered'` stage once it's complete. Let's take\n * the following example (we'll use the\n * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n *
\n * \n * {state => (\n * // ...\n * )}\n * \n * \n *
\n * );\n * }\n * ```\n *\n * When the button is clicked the component will shift to the `'entering'` state\n * and stay there for 500ms (the value of `timeout`) before it finally switches\n * to `'entered'`.\n *\n * When `in` is `false` the same thing happens except the state moves from\n * `'exiting'` to `'exited'`.\n */\n\nvar Transition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Transition, _React$Component);\n function Transition(props, context) {\n var _this;\n _this = _React$Component.call(this, props, context) || this;\n var parentGroup = context; // In the context of a TransitionGroup all enters are really appears\n\n var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;\n var initialStatus;\n _this.appearStatus = null;\n if (props.in) {\n if (appear) {\n initialStatus = EXITED;\n _this.appearStatus = ENTERING;\n } else {\n initialStatus = ENTERED;\n }\n } else {\n if (props.unmountOnExit || props.mountOnEnter) {\n initialStatus = UNMOUNTED;\n } else {\n initialStatus = EXITED;\n }\n }\n _this.state = {\n status: initialStatus\n };\n _this.nextCallback = null;\n return _this;\n }\n Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {\n var nextIn = _ref.in;\n if (nextIn && prevState.status === UNMOUNTED) {\n return {\n status: EXITED\n };\n }\n return null;\n } // getSnapshotBeforeUpdate(prevProps) {\n // let nextStatus = null\n // if (prevProps !== this.props) {\n // const { status } = this.state\n // if (this.props.in) {\n // if (status !== ENTERING && status !== ENTERED) {\n // nextStatus = ENTERING\n // }\n // } else {\n // if (status === ENTERING || status === ENTERED) {\n // nextStatus = EXITING\n // }\n // }\n // }\n // return { nextStatus }\n // }\n ;\n var _proto = Transition.prototype;\n _proto.componentDidMount = function componentDidMount() {\n this.updateStatus(true, this.appearStatus);\n };\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var nextStatus = null;\n if (prevProps !== this.props) {\n var status = this.state.status;\n if (this.props.in) {\n if (status !== ENTERING && status !== ENTERED) {\n nextStatus = ENTERING;\n }\n } else {\n if (status === ENTERING || status === ENTERED) {\n nextStatus = EXITING;\n }\n }\n }\n this.updateStatus(false, nextStatus);\n };\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.cancelNextCallback();\n };\n _proto.getTimeouts = function getTimeouts() {\n var timeout = this.props.timeout;\n var exit, enter, appear;\n exit = enter = appear = timeout;\n if (timeout != null && typeof timeout !== 'number') {\n exit = timeout.exit;\n enter = timeout.enter; // TODO: remove fallback for next major\n\n appear = timeout.appear !== undefined ? timeout.appear : enter;\n }\n return {\n exit: exit,\n enter: enter,\n appear: appear\n };\n };\n _proto.updateStatus = function updateStatus(mounting, nextStatus) {\n if (mounting === void 0) {\n mounting = false;\n }\n if (nextStatus !== null) {\n // nextStatus will always be ENTERING or EXITING.\n this.cancelNextCallback();\n if (nextStatus === ENTERING) {\n if (this.props.unmountOnExit || this.props.mountOnEnter) {\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this); // https://github.com/reactjs/react-transition-group/pull/749\n // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`.\n // To make the animation happen, we have to separate each rendering and avoid being processed as batched.\n\n if (node) forceReflow(node);\n }\n this.performEnter(mounting);\n } else {\n this.performExit();\n }\n } else if (this.props.unmountOnExit && this.state.status === EXITED) {\n this.setState({\n status: UNMOUNTED\n });\n }\n };\n _proto.performEnter = function performEnter(mounting) {\n var _this2 = this;\n var enter = this.props.enter;\n var appearing = this.context ? this.context.isMounting : mounting;\n var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing],\n maybeNode = _ref2[0],\n maybeAppearing = _ref2[1];\n var timeouts = this.getTimeouts();\n var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED\n // if we are mounting and running this it means appear _must_ be set\n\n if (!mounting && !enter || config.disabled) {\n this.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode);\n });\n return;\n }\n this.props.onEnter(maybeNode, maybeAppearing);\n this.safeSetState({\n status: ENTERING\n }, function () {\n _this2.props.onEntering(maybeNode, maybeAppearing);\n _this2.onTransitionEnd(enterTimeout, function () {\n _this2.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode, maybeAppearing);\n });\n });\n });\n };\n _proto.performExit = function performExit() {\n var _this3 = this;\n var exit = this.props.exit;\n var timeouts = this.getTimeouts();\n var maybeNode = this.props.nodeRef ? undefined : ReactDOM.findDOMNode(this); // no exit animation skip right to EXITED\n\n if (!exit || config.disabled) {\n this.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n return;\n }\n this.props.onExit(maybeNode);\n this.safeSetState({\n status: EXITING\n }, function () {\n _this3.props.onExiting(maybeNode);\n _this3.onTransitionEnd(timeouts.exit, function () {\n _this3.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n });\n });\n };\n _proto.cancelNextCallback = function cancelNextCallback() {\n if (this.nextCallback !== null) {\n this.nextCallback.cancel();\n this.nextCallback = null;\n }\n };\n _proto.safeSetState = function safeSetState(nextState, callback) {\n // This shouldn't be necessary, but there are weird race conditions with\n // setState callbacks and unmounting in testing, so always make sure that\n // we can cancel any pending setState callbacks after we unmount.\n callback = this.setNextCallback(callback);\n this.setState(nextState, callback);\n };\n _proto.setNextCallback = function setNextCallback(callback) {\n var _this4 = this;\n var active = true;\n this.nextCallback = function (event) {\n if (active) {\n active = false;\n _this4.nextCallback = null;\n callback(event);\n }\n };\n this.nextCallback.cancel = function () {\n active = false;\n };\n return this.nextCallback;\n };\n _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {\n this.setNextCallback(handler);\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);\n var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;\n if (!node || doesNotHaveTimeoutOrListener) {\n setTimeout(this.nextCallback, 0);\n return;\n }\n if (this.props.addEndListener) {\n var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],\n maybeNode = _ref3[0],\n maybeNextCallback = _ref3[1];\n this.props.addEndListener(maybeNode, maybeNextCallback);\n }\n if (timeout != null) {\n setTimeout(this.nextCallback, timeout);\n }\n };\n _proto.render = function render() {\n var status = this.state.status;\n if (status === UNMOUNTED) {\n return null;\n }\n var _this$props = this.props,\n children = _this$props.children,\n _in = _this$props.in,\n _mountOnEnter = _this$props.mountOnEnter,\n _unmountOnExit = _this$props.unmountOnExit,\n _appear = _this$props.appear,\n _enter = _this$props.enter,\n _exit = _this$props.exit,\n _timeout = _this$props.timeout,\n _addEndListener = _this$props.addEndListener,\n _onEnter = _this$props.onEnter,\n _onEntering = _this$props.onEntering,\n _onEntered = _this$props.onEntered,\n _onExit = _this$props.onExit,\n _onExiting = _this$props.onExiting,\n _onExited = _this$props.onExited,\n _nodeRef = _this$props.nodeRef,\n childProps = _objectWithoutPropertiesLoose(_this$props, [\"children\", \"in\", \"mountOnEnter\", \"unmountOnExit\", \"appear\", \"enter\", \"exit\", \"timeout\", \"addEndListener\", \"onEnter\", \"onEntering\", \"onEntered\", \"onExit\", \"onExiting\", \"onExited\", \"nodeRef\"]);\n return (/*#__PURE__*/\n // allows for nested Transitions\n React.createElement(TransitionGroupContext.Provider, {\n value: null\n }, typeof children === 'function' ? children(status, childProps) : React.cloneElement(React.Children.only(children), childProps))\n );\n };\n return Transition;\n}(React.Component);\nTransition.contextType = TransitionGroupContext;\n// Name the function so it is clearer in the documentation\n\nfunction noop() {}\nTransition.defaultProps = {\n in: false,\n mountOnEnter: false,\n unmountOnExit: false,\n appear: false,\n enter: true,\n exit: true,\n onEnter: noop,\n onEntering: noop,\n onEntered: noop,\n onExit: noop,\n onExiting: noop,\n onExited: noop\n};\nTransition.UNMOUNTED = UNMOUNTED;\nTransition.EXITED = EXITED;\nTransition.ENTERING = ENTERING;\nTransition.ENTERED = ENTERED;\nTransition.EXITING = EXITING;\nexport default Transition;","export var forceReflow = function forceReflow(node) {\n return node.scrollTop;\n};","function _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (e.includes(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nexport { _objectWithoutPropertiesLoose as default };","function r(e) {\n var t,\n f,\n n = \"\";\n if (\"string\" == typeof e || \"number\" == typeof e) n += e;else if (\"object\" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++) e[t] && (f = r(e[t])) && (n && (n += \" \"), n += f);else for (t in e) e[t] && (n && (n += \" \"), n += t);\n return n;\n}\nexport function clsx() {\n for (var e, t, f = 0, n = \"\"; f < arguments.length;) (e = arguments[f++]) && (t = r(e)) && (n && (n += \" \"), n += t);\n return n;\n}\nexport default clsx;","import { isValidElement, createElement, useRef, useEffect, useReducer, cloneElement, useState, Children } from 'react';\nimport { Transition } from 'react-transition-group';\nimport cx from 'clsx';\nimport PropTypes from 'prop-types';\nimport { render } from 'react-dom';\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nfunction isNum(v) {\n return typeof v === 'number' && !isNaN(v);\n}\nfunction isBool(v) {\n return typeof v === 'boolean';\n}\nfunction isStr(v) {\n return typeof v === 'string';\n}\nfunction isFn(v) {\n return typeof v === 'function';\n}\nfunction parseClassName(v) {\n return isStr(v) || isFn(v) ? v : null;\n}\nfunction objectValues(obj) {\n return Object.keys(obj).map(function (key) {\n return obj[key];\n });\n}\nfunction hasToastId(toastId) {\n return toastId === 0 || toastId;\n}\nfunction getAutoCloseDelay(toastAutoClose, containerAutoClose) {\n return toastAutoClose === false || isNum(toastAutoClose) && toastAutoClose > 0 ? toastAutoClose : containerAutoClose;\n}\nvar canUseDom = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\nfunction canBeRendered(content) {\n return isValidElement(content) || isStr(content) || isFn(content) || isNum(content);\n}\nvar POSITION = {\n TOP_LEFT: 'top-left',\n TOP_RIGHT: 'top-right',\n TOP_CENTER: 'top-center',\n BOTTOM_LEFT: 'bottom-left',\n BOTTOM_RIGHT: 'bottom-right',\n BOTTOM_CENTER: 'bottom-center'\n};\nvar TYPE = {\n INFO: 'info',\n SUCCESS: 'success',\n WARNING: 'warning',\n ERROR: 'error',\n DEFAULT: 'default',\n DARK: 'dark'\n};\n\n/**\r\n * Used to collapse toast after exit animation\r\n */\nfunction collapseToast(node, done, duration\n/* COLLAPSE_DURATION */) {\n if (duration === void 0) {\n duration = 300;\n }\n var height = node.scrollHeight;\n var style = node.style;\n requestAnimationFrame(function () {\n style.minHeight = 'initial';\n style.height = height + 'px';\n style.transition = \"all \" + duration + \"ms\";\n requestAnimationFrame(function () {\n style.height = '0';\n style.padding = '0';\n style.margin = '0';\n setTimeout(function () {\n return done();\n }, duration);\n });\n });\n}\nfunction cssTransition(_ref) {\n var enter = _ref.enter,\n exit = _ref.exit,\n _ref$duration = _ref.duration,\n duration = _ref$duration === void 0 ? 750 : _ref$duration,\n _ref$appendPosition = _ref.appendPosition,\n appendPosition = _ref$appendPosition === void 0 ? false : _ref$appendPosition,\n _ref$collapse = _ref.collapse,\n collapse = _ref$collapse === void 0 ? true : _ref$collapse,\n _ref$collapseDuration = _ref.collapseDuration,\n collapseDuration = _ref$collapseDuration === void 0 ? 300 : _ref$collapseDuration;\n var enterDuration, exitDuration;\n if (Array.isArray(duration) && duration.length === 2) {\n enterDuration = duration[0];\n exitDuration = duration[1];\n } else {\n enterDuration = exitDuration = duration;\n }\n return function ToastTransition(_ref2) {\n var children = _ref2.children,\n position = _ref2.position,\n preventExitTransition = _ref2.preventExitTransition,\n done = _ref2.done,\n props = _objectWithoutPropertiesLoose(_ref2, [\"children\", \"position\", \"preventExitTransition\", \"done\"]);\n var enterClassName = appendPosition ? enter + \"--\" + position : enter;\n var exitClassName = appendPosition ? exit + \"--\" + position : exit;\n var onEnter = function onEnter() {\n var node = props.nodeRef.current;\n if (node) {\n node.classList.add(enterClassName);\n node.style.animationFillMode = 'forwards';\n node.style.animationDuration = enterDuration + \"ms\";\n }\n };\n var onEntered = function onEntered() {\n var node = props.nodeRef.current;\n if (node) {\n node.classList.remove(enterClassName);\n node.style.removeProperty('animationFillMode');\n node.style.removeProperty('animationDuration');\n }\n };\n var onExited = function onExited() {\n var node = props.nodeRef.current;\n if (node) {\n node.removeEventListener('animationend', onExited);\n collapse ? collapseToast(node, done, collapseDuration) : done();\n }\n };\n var onExit = function onExit() {\n var node = props.nodeRef.current;\n if (node) {\n node.classList.add(exitClassName);\n node.style.animationFillMode = 'forwards';\n node.style.animationDuration = exitDuration + \"ms\";\n node.addEventListener('animationend', onExited);\n }\n };\n return createElement(Transition, Object.assign({}, props, {\n timeout: preventExitTransition ? collapse ? collapseDuration : 50\n /* DEBOUNCE_DURATION */ : {\n enter: enterDuration,\n exit: collapse ? exitDuration + collapseDuration : exitDuration + 50\n /* DEBOUNCE_DURATION */\n },\n onEnter: onEnter,\n onEntered: onEntered,\n onExit: preventExitTransition ? onExited : onExit,\n unmountOnExit: true\n }), children);\n };\n}\nvar eventManager = {\n list: /*#__PURE__*/new Map(),\n emitQueue: /*#__PURE__*/new Map(),\n on: function on(event, callback) {\n this.list.has(event) || this.list.set(event, []);\n this.list.get(event).push(callback);\n return this;\n },\n off: function off(event, callback) {\n if (callback) {\n var cb = this.list.get(event).filter(function (cb) {\n return cb !== callback;\n });\n this.list.set(event, cb);\n return this;\n }\n this.list[\"delete\"](event);\n return this;\n },\n cancelEmit: function cancelEmit(event) {\n var timers = this.emitQueue.get(event);\n if (timers) {\n timers.forEach(function (timer) {\n return clearTimeout(timer);\n });\n this.emitQueue[\"delete\"](event);\n }\n return this;\n },\n /**\r\n * Enqueue the event at the end of the call stack\r\n * Doing so let the user call toast as follow:\r\n * toast('1')\r\n * toast('2')\r\n * toast('3')\r\n * Without setTimemout the code above will not work\r\n */\n emit: function emit(event) {\n var _this = this;\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n this.list.has(event) && this.list.get(event).forEach(function (callback) {\n var timer = setTimeout(function () {\n // @ts-ignore\n callback.apply(void 0, args);\n }, 0);\n _this.emitQueue.has(event) || _this.emitQueue.set(event, []);\n _this.emitQueue.get(event).push(timer);\n });\n }\n};\n\n/**\r\n * `useKeeper` is a helper around `useRef`.\r\n *\r\n * You don't need to access the `.current`property to get the value\r\n * If refresh is set to true. The ref will be updated every render\r\n */\n\nfunction useKeeper(arg, refresh) {\n if (refresh === void 0) {\n refresh = false;\n }\n var ref = useRef(arg);\n useEffect(function () {\n if (refresh) ref.current = arg;\n });\n return ref.current;\n}\nfunction reducer(state, action) {\n switch (action.type) {\n case 'ADD':\n return [].concat(state, [action.toastId]).filter(function (id) {\n return id !== action.staleId;\n });\n case 'REMOVE':\n return hasToastId(action.toastId) ? state.filter(function (id) {\n return id !== action.toastId;\n }) : [];\n }\n}\nfunction useToastContainer(props) {\n var _useReducer = useReducer(function (x) {\n return x + 1;\n }, 0),\n forceUpdate = _useReducer[1];\n var _useReducer2 = useReducer(reducer, []),\n toast = _useReducer2[0],\n dispatch = _useReducer2[1];\n var containerRef = useRef(null);\n var toastCount = useKeeper(0);\n var queue = useKeeper([]);\n var collection = useKeeper({});\n var instance = useKeeper({\n toastKey: 1,\n displayedToast: 0,\n props: props,\n containerId: null,\n isToastActive: isToastActive,\n getToast: function getToast(id) {\n return collection[id] || null;\n }\n });\n useEffect(function () {\n instance.containerId = props.containerId;\n eventManager.cancelEmit(3\n /* WillUnmount */).on(0\n /* Show */, buildToast).on(1\n /* Clear */, function (toastId) {\n return containerRef.current && removeToast(toastId);\n }).on(5\n /* ClearWaitingQueue */, clearWaitingQueue).emit(2\n /* DidMount */, instance);\n return function () {\n return eventManager.emit(3\n /* WillUnmount */, instance);\n };\n }, []);\n useEffect(function () {\n instance.isToastActive = isToastActive;\n instance.displayedToast = toast.length;\n eventManager.emit(4\n /* Change */, toast.length, props.containerId);\n }, [toast]);\n useEffect(function () {\n instance.props = props;\n });\n function isToastActive(id) {\n return toast.indexOf(id) !== -1;\n }\n function clearWaitingQueue(_ref) {\n var containerId = _ref.containerId;\n var _instance$props = instance.props,\n limit = _instance$props.limit,\n enableMultiContainer = _instance$props.enableMultiContainer;\n if (limit && (!containerId || instance.containerId === containerId && enableMultiContainer)) {\n toastCount -= queue.length;\n queue = [];\n }\n }\n function removeToast(toastId) {\n var queueLen = queue.length;\n toastCount = hasToastId(toastId) ? toastCount - 1 : toastCount - instance.displayedToast;\n if (toastCount < 0) toastCount = 0;\n if (queueLen > 0) {\n var freeSlot = hasToastId(toastId) ? 1 : instance.props.limit;\n if (queueLen === 1 || freeSlot === 1) {\n instance.displayedToast++;\n dequeueToast();\n } else {\n var toDequeue = freeSlot > queueLen ? queueLen : freeSlot;\n instance.displayedToast = toDequeue;\n for (var i = 0; i < toDequeue; i++) {\n dequeueToast();\n }\n }\n }\n dispatch({\n type: 'REMOVE',\n toastId: toastId\n });\n }\n function dequeueToast() {\n var _queue$shift = queue.shift(),\n toastContent = _queue$shift.toastContent,\n toastProps = _queue$shift.toastProps,\n staleId = _queue$shift.staleId; // ensure that exit transition has been completed, hence the timeout\n\n setTimeout(function () {\n appendToast(toastContent, toastProps, staleId);\n }, 500);\n }\n /**\r\n * check if a container is attached to the dom\r\n * check for multi-container, build only if associated\r\n * check for duplicate toastId if no update\r\n */\n\n function isNotValid(_ref2) {\n var containerId = _ref2.containerId,\n toastId = _ref2.toastId,\n updateId = _ref2.updateId;\n return !containerRef.current || instance.props.enableMultiContainer && containerId !== instance.props.containerId || instance.isToastActive(toastId) && updateId == null ? true : false;\n } // this function and all the function called inside needs to rely on ref(`useKeeper`)\n\n function buildToast(content, _ref3) {\n var delay = _ref3.delay,\n staleId = _ref3.staleId,\n options = _objectWithoutPropertiesLoose(_ref3, [\"delay\", \"staleId\"]);\n if (!canBeRendered(content) || isNotValid(options)) return;\n var toastId = options.toastId,\n updateId = options.updateId;\n var props = instance.props,\n isToastActive = instance.isToastActive;\n var closeToast = function closeToast() {\n return removeToast(toastId);\n };\n var isNotAnUpdate = !isToastActive(toastId);\n if (isNotAnUpdate) toastCount++;\n var toastProps = {\n toastId: toastId,\n updateId: updateId,\n key: options.key || instance.toastKey++,\n type: options.type,\n closeToast: closeToast,\n closeButton: options.closeButton,\n rtl: props.rtl,\n position: options.position || props.position,\n transition: options.transition || props.transition,\n className: parseClassName(options.className || props.toastClassName),\n bodyClassName: parseClassName(options.bodyClassName || props.bodyClassName),\n style: options.style || props.toastStyle,\n bodyStyle: options.bodyStyle || props.bodyStyle,\n onClick: options.onClick || props.onClick,\n pauseOnHover: isBool(options.pauseOnHover) ? options.pauseOnHover : props.pauseOnHover,\n pauseOnFocusLoss: isBool(options.pauseOnFocusLoss) ? options.pauseOnFocusLoss : props.pauseOnFocusLoss,\n draggable: isBool(options.draggable) ? options.draggable : props.draggable,\n draggablePercent: isNum(options.draggablePercent) ? options.draggablePercent : props.draggablePercent,\n closeOnClick: isBool(options.closeOnClick) ? options.closeOnClick : props.closeOnClick,\n progressClassName: parseClassName(options.progressClassName || props.progressClassName),\n progressStyle: options.progressStyle || props.progressStyle,\n autoClose: getAutoCloseDelay(options.autoClose, props.autoClose),\n hideProgressBar: isBool(options.hideProgressBar) ? options.hideProgressBar : props.hideProgressBar,\n progress: options.progress,\n role: isStr(options.role) ? options.role : props.role,\n deleteToast: function deleteToast() {\n removeFromCollection(toastId);\n }\n };\n if (isFn(options.onOpen)) toastProps.onOpen = options.onOpen;\n if (isFn(options.onClose)) toastProps.onClose = options.onClose;\n var closeButton = props.closeButton;\n if (options.closeButton === false || canBeRendered(options.closeButton)) {\n closeButton = options.closeButton;\n } else if (options.closeButton === true) {\n closeButton = canBeRendered(props.closeButton) ? props.closeButton : true;\n }\n toastProps.closeButton = closeButton;\n var toastContent = content;\n if (isValidElement(content) && !isStr(content.type)) {\n toastContent = cloneElement(content, {\n closeToast: closeToast,\n toastProps: toastProps\n });\n } else if (isFn(content)) {\n toastContent = content({\n closeToast: closeToast,\n toastProps: toastProps\n });\n } // not handling limit + delay by design. Waiting for user feedback first\n\n if (props.limit && props.limit > 0 && toastCount > props.limit && isNotAnUpdate) {\n queue.push({\n toastContent: toastContent,\n toastProps: toastProps,\n staleId: staleId\n });\n } else if (isNum(delay) && delay > 0) {\n setTimeout(function () {\n appendToast(toastContent, toastProps, staleId);\n }, delay);\n } else {\n appendToast(toastContent, toastProps, staleId);\n }\n }\n function appendToast(content, toastProps, staleId) {\n var toastId = toastProps.toastId;\n collection[toastId] = {\n content: content,\n props: toastProps\n };\n dispatch({\n type: 'ADD',\n toastId: toastId,\n staleId: staleId\n });\n }\n function removeFromCollection(toastId) {\n delete collection[toastId];\n forceUpdate();\n }\n function getToastToRender(cb) {\n var toastToRender = {};\n var toastList = props.newestOnTop ? Object.keys(collection).reverse() : Object.keys(collection);\n for (var i = 0; i < toastList.length; i++) {\n var _toast = collection[toastList[i]];\n var position = _toast.props.position;\n toastToRender[position] || (toastToRender[position] = []);\n toastToRender[position].push(_toast);\n }\n return Object.keys(toastToRender).map(function (p) {\n return cb(p, toastToRender[p]);\n });\n }\n return {\n getToastToRender: getToastToRender,\n collection: collection,\n containerRef: containerRef,\n isToastActive: isToastActive\n };\n}\nfunction getX(e) {\n return e.targetTouches && e.targetTouches.length >= 1 ? e.targetTouches[0].clientX : e.clientX;\n}\nfunction getY(e) {\n return e.targetTouches && e.targetTouches.length >= 1 ? e.targetTouches[0].clientY : e.clientY;\n}\nfunction useToast(props) {\n var _useState = useState(true),\n isRunning = _useState[0],\n setIsRunning = _useState[1];\n var _useState2 = useState(false),\n preventExitTransition = _useState2[0],\n setPreventExitTransition = _useState2[1];\n var toastRef = useRef(null);\n var drag = useKeeper({\n start: 0,\n x: 0,\n y: 0,\n deltaX: 0,\n removalDistance: 0,\n canCloseOnClick: true,\n canDrag: false,\n boundingRect: null\n });\n var syncProps = useKeeper(props, true);\n var autoClose = props.autoClose,\n pauseOnHover = props.pauseOnHover,\n closeToast = props.closeToast,\n onClick = props.onClick,\n closeOnClick = props.closeOnClick;\n useEffect(function () {\n if (isFn(props.onOpen)) props.onOpen(isValidElement(props.children) && props.children.props);\n return function () {\n if (isFn(syncProps.onClose)) syncProps.onClose(isValidElement(syncProps.children) && syncProps.children.props);\n };\n }, []);\n useEffect(function () {\n props.draggable && bindDragEvents();\n return function () {\n props.draggable && unbindDragEvents();\n };\n }, [props.draggable]);\n useEffect(function () {\n props.pauseOnFocusLoss && bindFocusEvents();\n return function () {\n props.pauseOnFocusLoss && unbindFocusEvents();\n };\n }, [props.pauseOnFocusLoss]);\n function onDragStart(e) {\n var toast = toastRef.current;\n drag.canCloseOnClick = true;\n drag.canDrag = true;\n drag.boundingRect = toast.getBoundingClientRect();\n toast.style.transition = '';\n drag.start = drag.x = getX(e.nativeEvent);\n drag.removalDistance = toast.offsetWidth * (props.draggablePercent / 100);\n }\n function onDragTransitionEnd() {\n if (drag.boundingRect) {\n var _drag$boundingRect = drag.boundingRect,\n top = _drag$boundingRect.top,\n bottom = _drag$boundingRect.bottom,\n left = _drag$boundingRect.left,\n right = _drag$boundingRect.right;\n if (props.pauseOnHover && drag.x >= left && drag.x <= right && drag.y >= top && drag.y <= bottom) {\n pauseToast();\n } else {\n playToast();\n }\n }\n }\n function playToast() {\n setIsRunning(true);\n }\n function pauseToast() {\n setIsRunning(false);\n }\n function bindFocusEvents() {\n window.addEventListener('focus', playToast);\n window.addEventListener('blur', pauseToast);\n }\n function unbindFocusEvents() {\n window.removeEventListener('focus', playToast);\n window.removeEventListener('blur', pauseToast);\n }\n function bindDragEvents() {\n document.addEventListener('mousemove', onDragMove);\n document.addEventListener('mouseup', onDragEnd);\n document.addEventListener('touchmove', onDragMove);\n document.addEventListener('touchend', onDragEnd);\n }\n function unbindDragEvents() {\n document.removeEventListener('mousemove', onDragMove);\n document.removeEventListener('mouseup', onDragEnd);\n document.removeEventListener('touchmove', onDragMove);\n document.removeEventListener('touchend', onDragEnd);\n }\n function onDragMove(e) {\n e.preventDefault();\n var toast = toastRef.current;\n if (drag.canDrag) {\n if (isRunning) pauseToast();\n drag.x = getX(e);\n drag.deltaX = drag.x - drag.start;\n drag.y = getY(e); // prevent false positif during a toast click\n\n if (drag.start !== drag.x) drag.canCloseOnClick = false;\n toast.style.transform = \"translateX(\" + drag.deltaX + \"px)\";\n toast.style.opacity = \"\" + (1 - Math.abs(drag.deltaX / drag.removalDistance));\n }\n }\n function onDragEnd() {\n var toast = toastRef.current;\n if (drag.canDrag) {\n drag.canDrag = false;\n if (Math.abs(drag.deltaX) > drag.removalDistance) {\n setPreventExitTransition(true);\n props.closeToast();\n return;\n }\n toast.style.transition = 'transform 0.2s, opacity 0.2s';\n toast.style.transform = 'translateX(0)';\n toast.style.opacity = '1';\n }\n }\n var eventHandlers = {\n onMouseDown: onDragStart,\n onTouchStart: onDragStart,\n onMouseUp: onDragTransitionEnd,\n onTouchEnd: onDragTransitionEnd\n };\n if (autoClose && pauseOnHover) {\n eventHandlers.onMouseEnter = pauseToast;\n eventHandlers.onMouseLeave = playToast;\n } // prevent toast from closing when user drags the toast\n\n if (closeOnClick) {\n eventHandlers.onClick = function (e) {\n onClick && onClick(e);\n drag.canCloseOnClick && closeToast();\n };\n }\n return {\n playToast: playToast,\n pauseToast: pauseToast,\n isRunning: isRunning,\n preventExitTransition: preventExitTransition,\n toastRef: toastRef,\n eventHandlers: eventHandlers\n };\n}\nfunction CloseButton(_ref) {\n var closeToast = _ref.closeToast,\n type = _ref.type,\n _ref$ariaLabel = _ref.ariaLabel,\n ariaLabel = _ref$ariaLabel === void 0 ? 'close' : _ref$ariaLabel;\n return createElement(\"button\", {\n className: \"Toastify\"\n /* CSS_NAMESPACE */ + \"__close-button \" + \"Toastify\"\n /* CSS_NAMESPACE */ + \"__close-button--\" + type,\n type: \"button\",\n onClick: function onClick(e) {\n e.stopPropagation();\n closeToast(e);\n },\n \"aria-label\": ariaLabel\n }, createElement(\"svg\", {\n \"aria-hidden\": \"true\",\n viewBox: \"0 0 14 16\"\n }, createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z\"\n })));\n}\nfunction ProgressBar(_ref) {\n var _ref2, _animationEvent;\n var delay = _ref.delay,\n isRunning = _ref.isRunning,\n closeToast = _ref.closeToast,\n type = _ref.type,\n hide = _ref.hide,\n className = _ref.className,\n userStyle = _ref.style,\n controlledProgress = _ref.controlledProgress,\n progress = _ref.progress,\n rtl = _ref.rtl,\n isIn = _ref.isIn;\n var style = _extends({}, userStyle, {\n animationDuration: delay + \"ms\",\n animationPlayState: isRunning ? 'running' : 'paused',\n opacity: hide ? 0 : 1\n });\n if (controlledProgress) style.transform = \"scaleX(\" + progress + \")\";\n var defaultClassArr = [\"Toastify\"\n /* CSS_NAMESPACE */ + \"__progress-bar\", controlledProgress ? \"Toastify\"\n /* CSS_NAMESPACE */ + \"__progress-bar--controlled\" : \"Toastify\"\n /* CSS_NAMESPACE */ + \"__progress-bar--animated\", \"Toastify\"\n /* CSS_NAMESPACE */ + \"__progress-bar--\" + type, (_ref2 = {}, _ref2[\"Toastify\"\n /* CSS_NAMESPACE */ + \"__progress-bar--rtl\"] = rtl, _ref2)];\n var classNames = isFn(className) ? className({\n rtl: rtl,\n type: type,\n defaultClassName: cx.apply(void 0, defaultClassArr)\n }) : cx.apply(void 0, [].concat(defaultClassArr, [className])); // 🧐 controlledProgress is derived from progress\n // so if controlledProgress is set\n // it means that this is also the case for progress\n\n var animationEvent = (_animationEvent = {}, _animationEvent[controlledProgress && progress >= 1 ? 'onTransitionEnd' : 'onAnimationEnd'] = controlledProgress && progress < 1 ? null : function () {\n isIn && closeToast();\n }, _animationEvent);\n return createElement(\"div\", Object.assign({\n className: classNames,\n style: style\n }, animationEvent));\n}\nProgressBar.defaultProps = {\n type: TYPE.DEFAULT,\n hide: false\n};\nvar Toast = function Toast(props) {\n var _ref;\n var _useToast = useToast(props),\n isRunning = _useToast.isRunning,\n preventExitTransition = _useToast.preventExitTransition,\n toastRef = _useToast.toastRef,\n eventHandlers = _useToast.eventHandlers;\n var closeButton = props.closeButton,\n children = props.children,\n autoClose = props.autoClose,\n onClick = props.onClick,\n type = props.type,\n hideProgressBar = props.hideProgressBar,\n closeToast = props.closeToast,\n Transition = props.transition,\n position = props.position,\n className = props.className,\n style = props.style,\n bodyClassName = props.bodyClassName,\n bodyStyle = props.bodyStyle,\n progressClassName = props.progressClassName,\n progressStyle = props.progressStyle,\n updateId = props.updateId,\n role = props.role,\n progress = props.progress,\n rtl = props.rtl,\n toastId = props.toastId,\n deleteToast = props.deleteToast;\n var defaultClassArr = [\"Toastify\"\n /* CSS_NAMESPACE */ + \"__toast\", \"Toastify\"\n /* CSS_NAMESPACE */ + \"__toast--\" + type, (_ref = {}, _ref[\"Toastify\"\n /* CSS_NAMESPACE */ + \"__toast--rtl\"] = rtl, _ref)];\n var cssClasses = isFn(className) ? className({\n rtl: rtl,\n position: position,\n type: type,\n defaultClassName: cx.apply(void 0, defaultClassArr)\n }) : cx.apply(void 0, [].concat(defaultClassArr, [className]));\n var controlledProgress = !!progress;\n function renderCloseButton(closeButton) {\n if (!closeButton) return;\n var props = {\n closeToast: closeToast,\n type: type\n };\n if (isFn(closeButton)) return closeButton(props);\n if (isValidElement(closeButton)) return cloneElement(closeButton, props);\n }\n return createElement(Transition, {\n \"in\": props[\"in\"],\n appear: true,\n done: deleteToast,\n position: position,\n preventExitTransition: preventExitTransition,\n nodeRef: toastRef\n }, createElement(\"div\", Object.assign({\n id: toastId,\n onClick: onClick,\n className: cssClasses || undefined\n }, eventHandlers, {\n style: style,\n ref: toastRef\n }), createElement(\"div\", Object.assign({}, props[\"in\"] && {\n role: role\n }, {\n className: isFn(bodyClassName) ? bodyClassName({\n type: type\n }) : cx(\"Toastify\"\n /* CSS_NAMESPACE */ + \"__toast-body\", bodyClassName),\n style: bodyStyle\n }), children), renderCloseButton(closeButton), (autoClose || controlledProgress) && createElement(ProgressBar, Object.assign({}, updateId && !controlledProgress ? {\n key: \"pb-\" + updateId\n } : {}, {\n rtl: rtl,\n delay: autoClose,\n isRunning: isRunning,\n isIn: props[\"in\"],\n closeToast: closeToast,\n hide: hideProgressBar,\n type: type,\n style: progressStyle,\n className: progressClassName,\n controlledProgress: controlledProgress,\n progress: progress\n }))));\n};\nvar Bounce = /*#__PURE__*/cssTransition({\n enter: \"Toastify\"\n /* CSS_NAMESPACE */ + \"__bounce-enter\",\n exit: \"Toastify\"\n /* CSS_NAMESPACE */ + \"__bounce-exit\",\n appendPosition: true\n});\nvar Slide = /*#__PURE__*/cssTransition({\n enter: \"Toastify\"\n /* CSS_NAMESPACE */ + \"__slide-enter\",\n exit: \"Toastify\"\n /* CSS_NAMESPACE */ + \"__slide-exit\",\n duration: [450, 750],\n appendPosition: true\n});\nvar Zoom = /*#__PURE__*/cssTransition({\n enter: \"Toastify\"\n /* CSS_NAMESPACE */ + \"__zoom-enter\",\n exit: \"Toastify\"\n /* CSS_NAMESPACE */ + \"__zoom-exit\"\n});\nvar Flip = /*#__PURE__*/cssTransition({\n enter: \"Toastify\"\n /* CSS_NAMESPACE */ + \"__flip-enter\",\n exit: \"Toastify\"\n /* CSS_NAMESPACE */ + \"__flip-exit\"\n});\nvar ToastPositioner = function ToastPositioner(_ref) {\n var children = _ref.children,\n className = _ref.className,\n style = _ref.style,\n rest = _objectWithoutPropertiesLoose(_ref, [\"children\", \"className\", \"style\"]);\n\n // Monkey patch react-transition-group\n // As exit transition is broken with strict mode\n delete rest[\"in\"];\n return createElement(\"div\", {\n className: className,\n style: style\n }, Children.map(children, function (child) {\n return cloneElement(child, rest);\n }));\n};\nvar ToastContainer = function ToastContainer(props) {\n var _useToastContainer = useToastContainer(props),\n getToastToRender = _useToastContainer.getToastToRender,\n containerRef = _useToastContainer.containerRef,\n isToastActive = _useToastContainer.isToastActive;\n var className = props.className,\n style = props.style,\n rtl = props.rtl,\n containerId = props.containerId;\n return createElement(\"div\", {\n ref: containerRef,\n className: \"Toastify\"\n /* CSS_NAMESPACE */,\n\n id: containerId\n }, getToastToRender(function (position, toastList) {\n var _cx, _cx2;\n var swag = {\n className: isFn(className) ? className({\n position: position,\n rtl: rtl,\n defaultClassName: cx(\"Toastify\"\n /* CSS_NAMESPACE */ + \"__toast-container\", \"Toastify\"\n /* CSS_NAMESPACE */ + \"__toast-container--\" + position, (_cx = {}, _cx[\"Toastify\"\n /* CSS_NAMESPACE */ + \"__toast-container--rtl\"] = rtl, _cx))\n }) : cx(\"Toastify\"\n /* CSS_NAMESPACE */ + \"__toast-container\", \"Toastify\"\n /* CSS_NAMESPACE */ + \"__toast-container--\" + position, (_cx2 = {}, _cx2[\"Toastify\"\n /* CSS_NAMESPACE */ + \"__toast-container--rtl\"] = rtl, _cx2), parseClassName(className)),\n style: toastList.length === 0 ? _extends({}, style, {\n pointerEvents: 'none'\n }) : _extends({}, style)\n };\n return createElement(ToastPositioner, Object.assign({}, swag, {\n key: \"container-\" + position\n }), toastList.map(function (_ref) {\n var content = _ref.content,\n toastProps = _ref.props;\n return createElement(Toast, Object.assign({}, toastProps, {\n \"in\": isToastActive(toastProps.toastId),\n key: \"toast-\" + toastProps.key,\n closeButton: toastProps.closeButton === true ? CloseButton : toastProps.closeButton\n }), content);\n }));\n }));\n};\nif (process.env.NODE_ENV !== 'production') {\n // @ts-ignore\n ToastContainer.propTypes = {\n // @ts-ignore\n position: /*#__PURE__*/PropTypes.oneOf(/*#__PURE__*/objectValues(POSITION)),\n // @ts-ignore\n autoClose: /*#__PURE__*/PropTypes.oneOfType([PropTypes.bool, PropTypes.number]),\n // @ts-ignore\n closeButton: /*#__PURE__*/PropTypes.oneOfType([PropTypes.node, PropTypes.bool, PropTypes.func]),\n hideProgressBar: PropTypes.bool,\n pauseOnHover: PropTypes.bool,\n closeOnClick: PropTypes.bool,\n newestOnTop: PropTypes.bool,\n className: PropTypes.any,\n style: PropTypes.object,\n toastClassName: /*#__PURE__*/PropTypes.oneOfType([PropTypes.func, PropTypes.string]),\n bodyClassName: /*#__PURE__*/PropTypes.oneOfType([PropTypes.func, PropTypes.string]),\n progressClassName: /*#__PURE__*/PropTypes.oneOfType([PropTypes.func, PropTypes.string]),\n progressStyle: PropTypes.object,\n transition: PropTypes.func,\n rtl: PropTypes.bool,\n draggable: PropTypes.bool,\n draggablePercent: PropTypes.number,\n pauseOnFocusLoss: PropTypes.bool,\n enableMultiContainer: PropTypes.bool,\n containerId: /*#__PURE__*/PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n role: PropTypes.string,\n onClick: PropTypes.func\n };\n}\nToastContainer.defaultProps = {\n position: POSITION.TOP_RIGHT,\n transition: Bounce,\n rtl: false,\n autoClose: 5000,\n hideProgressBar: false,\n closeButton: CloseButton,\n pauseOnHover: true,\n pauseOnFocusLoss: true,\n closeOnClick: true,\n newestOnTop: false,\n draggable: true,\n draggablePercent: 80,\n role: 'alert'\n};\nvar containers = /*#__PURE__*/new Map();\nvar latestInstance;\nvar containerDomNode;\nvar containerConfig;\nvar queue = [];\nvar lazy = false;\n/**\r\n * Check whether any container is currently mounted in the DOM\r\n */\n\nfunction isAnyContainerMounted() {\n return containers.size > 0;\n}\n/**\r\n * Get the container by id. Returns the last container declared when no id is given.\r\n */\n\nfunction getContainer(containerId) {\n if (!isAnyContainerMounted()) return null;\n return containers.get(!containerId ? latestInstance : containerId);\n}\n/**\r\n * Get the toast by id, given it's in the DOM, otherwise returns null\r\n */\n\nfunction getToast(toastId, _ref) {\n var containerId = _ref.containerId;\n var container = getContainer(containerId);\n if (!container) return null;\n return container.getToast(toastId);\n}\n/**\r\n * Generate a random toastId\r\n */\n\nfunction generateToastId() {\n return (Math.random().toString(36) + Date.now().toString(36)).substr(2, 10);\n}\n/**\r\n * Generate a toastId or use the one provided\r\n */\n\nfunction getToastId(options) {\n if (options && (isStr(options.toastId) || isNum(options.toastId))) {\n return options.toastId;\n }\n return generateToastId();\n}\n/**\r\n * If the container is not mounted, the toast is enqueued and\r\n * the container lazy mounted\r\n */\n\nfunction dispatchToast(content, options) {\n if (isAnyContainerMounted()) {\n eventManager.emit(0\n /* Show */, content, options);\n } else {\n queue.push({\n content: content,\n options: options\n });\n if (lazy && canUseDom) {\n lazy = false;\n containerDomNode = document.createElement('div');\n document.body.appendChild(containerDomNode);\n render(createElement(ToastContainer, Object.assign({}, containerConfig)), containerDomNode);\n }\n }\n return options.toastId;\n}\n/**\r\n * Merge provided options with the defaults settings and generate the toastId\r\n */\n\nfunction mergeOptions(type, options) {\n return _extends({}, options, {\n type: options && options.type || type,\n toastId: getToastId(options)\n });\n}\nvar toast = function toast(content, options) {\n return dispatchToast(content, mergeOptions(TYPE.DEFAULT, options));\n};\ntoast.success = function (content, options) {\n return dispatchToast(content, mergeOptions(TYPE.SUCCESS, options));\n};\ntoast.info = function (content, options) {\n return dispatchToast(content, mergeOptions(TYPE.INFO, options));\n};\ntoast.error = function (content, options) {\n return dispatchToast(content, mergeOptions(TYPE.ERROR, options));\n};\ntoast.warning = function (content, options) {\n return dispatchToast(content, mergeOptions(TYPE.WARNING, options));\n};\ntoast.dark = function (content, options) {\n return dispatchToast(content, mergeOptions(TYPE.DARK, options));\n};\n/**\r\n * Maybe I should remove warning in favor of warn, I don't know\r\n */\n\ntoast.warn = toast.warning;\n/**\r\n * Remove toast programmaticaly\r\n */\n\ntoast.dismiss = function (id) {\n return isAnyContainerMounted() && eventManager.emit(1\n /* Clear */, id);\n};\n/**\r\n * Clear waiting queue when limit is used\r\n */\n\ntoast.clearWaitingQueue = function (params) {\n if (params === void 0) {\n params = {};\n }\n return isAnyContainerMounted() && eventManager.emit(5\n /* ClearWaitingQueue */, params);\n};\n/**\r\n * return true if one container is displaying the toast\r\n */\n\ntoast.isActive = function (id) {\n var isToastActive = false;\n containers.forEach(function (container) {\n if (container.isToastActive && container.isToastActive(id)) {\n isToastActive = true;\n }\n });\n return isToastActive;\n};\ntoast.update = function (toastId, options) {\n if (options === void 0) {\n options = {};\n }\n\n // if you call toast and toast.update directly nothing will be displayed\n // this is why I defered the update\n setTimeout(function () {\n var toast = getToast(toastId, options);\n if (toast) {\n var oldOptions = toast.props,\n oldContent = toast.content;\n var nextOptions = _extends({}, oldOptions, options, {\n toastId: options.toastId || toastId,\n updateId: generateToastId()\n });\n if (nextOptions.toastId !== toastId) nextOptions.staleId = toastId;\n var content = typeof nextOptions.render !== 'undefined' ? nextOptions.render : oldContent;\n delete nextOptions.render;\n dispatchToast(content, nextOptions);\n }\n }, 0);\n};\n/**\r\n * Used for controlled progress bar.\r\n */\n\ntoast.done = function (id) {\n toast.update(id, {\n progress: 1\n });\n};\n/**\r\n * Track changes. The callback get the number of toast displayed\r\n *\r\n */\n\ntoast.onChange = function (callback) {\n if (isFn(callback)) {\n eventManager.on(4\n /* Change */, callback);\n }\n return function () {\n isFn(callback) && eventManager.off(4\n /* Change */, callback);\n };\n};\n/**\r\n * Configure the ToastContainer when lazy mounted\r\n */\n\ntoast.configure = function (config) {\n if (config === void 0) {\n config = {};\n }\n lazy = true;\n containerConfig = config;\n};\ntoast.POSITION = POSITION;\ntoast.TYPE = TYPE;\n/**\r\n * Wait until the ToastContainer is mounted to dispatch the toast\r\n * and attach isActive method\r\n */\n\neventManager.on(2\n/* DidMount */, function (containerInstance) {\n latestInstance = containerInstance.containerId || containerInstance;\n containers.set(latestInstance, containerInstance);\n queue.forEach(function (item) {\n eventManager.emit(0\n /* Show */, item.content, item.options);\n });\n queue = [];\n}).on(3\n/* WillUnmount */, function (containerInstance) {\n containers[\"delete\"](containerInstance.containerId || containerInstance);\n if (containers.size === 0) {\n eventManager.off(0\n /* Show */).off(1\n /* Clear */).off(5\n /* ClearWaitingQueue */);\n }\n if (canUseDom && containerDomNode) {\n document.body.removeChild(containerDomNode);\n }\n});\nexport { Bounce, Flip, Slide, ToastContainer, Zoom, collapseToast, cssTransition, toast, useToast, useToastContainer };","import { useState, useEffect } from 'react'\n\nexport function parseQuery(queryString) {\n const queryMap = {}\n const pairs = (\n queryString[0] === '#' ? queryString.substr(1) : queryString\n ).split('&')\n\n for (let i = 0; i < pairs.length; i++) {\n const pair = pairs[i].split('=')\n queryMap[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1] || '')\n }\n\n return queryMap\n}\n\n// splits list of all lease files into contract, credit, generatedContract and creditLog files\nexport function parseLeaseFiles(leaseFiles) {\n return leaseFiles.reduce(\n (acc, file) => {\n const fileType = file.key.split('/')[2]\n if (fileType === 'credit') {\n acc.credit.push(file)\n } else if (fileType === 'creditLog') {\n acc.creditLog.push(file)\n } else if (fileType === 'generatedContract') {\n acc.generatedContract.push(file)\n } else {\n acc.contract.push(file)\n }\n\n return acc\n },\n {\n credit: [],\n creditLog: [],\n contract: [],\n generatedContract: [],\n },\n )\n}\n\n// returns string of collessee names and emails\nexport function parseCoLessees(coLessees) {\n let coLesseeString = ''\n if (coLessees) {\n for (let i = 0; i < Object.keys(coLessees).length / 2; i++) {\n coLesseeString = `${coLesseeString}${\n coLessees[`co_lessee_name_${i + 1}`]\n }\\n`\n }\n }\n return coLesseeString\n}\n\n// returns an array of all text separated by any amount newlines\nexport function splitMultiLineText(text, addSerial = false) {\n return (text || '')\n .split('\\n')\n .filter(asset => !!asset)\n .map(asset => (addSerial ? `S/N: ${asset}` : asset))\n}\n\n// Check if any lessee emails are the same\nexport function emailsDuplicated(lease) {\n let duplicateEmails = false\n\n if (lease.co_lessees) {\n duplicateEmails =\n lease.main_lessee_email === lease.co_lessees.co_lessee_email_1\n\n if (lease.co_lessees.co_lessee_email_2) {\n duplicateEmails =\n duplicateEmails ||\n lease.co_lessees.co_lessee_email_2 ===\n lease.co_lessees.co_lessee_email_1 ||\n lease.co_lessees.co_lessee_email_2 === lease.main_lessee_email\n\n if (lease.co_lessees.co_lessee_email_3) {\n duplicateEmails =\n duplicateEmails ||\n lease.co_lessees.co_lessee_email_3 ===\n lease.co_lessees.co_lessee_email_2 ||\n lease.co_lessees.co_lessee_email_3 ===\n lease.co_lessees.co_lessee_email_1 ||\n lease.co_lessees.co_lessee_email_3 === lease.main_lessee_email\n }\n }\n }\n\n return duplicateEmails\n}\n\n/**\n * Takes a string number that could be formatted and returns the numerical value\n * @example \"1,234,567.50\" => 1234567.50\n * @param {String} numString\n * @returns {Number}\n */\nexport function toNumber(numString) {\n let parsedNum = numString\n if (typeof numString !== 'string') {\n parsedNum = String(numString)\n }\n parsedNum = parsedNum.split(',').join('')\n\n // make sure parsedNum is a convertable string\n if (Number(parsedNum)) {\n return Number(parsedNum)\n }\n return parsedNum\n}\n\n/**\n * Takes a number and returns the formatted value as a string\n * @example 1234567.50 => \"1,234,567.50\"\n * @param {Number} numFloat\n * @returns {String}\n */\nexport function formatNumber(numFloat) {\n if (!numFloat) {\n return numFloat\n }\n\n if (typeof numFloat !== 'number') {\n numFloat = toNumber(numFloat)\n }\n\n return numFloat.toLocaleString(undefined, { minimumFractionDigits: 2 })\n}\n\n// hook that returns if the current device width is within the specified breakpoint\nconst breakpoints = { sm: 576, md: 768, lg: 992, xl: 1200 }\nexport function isMobile(breakpoint = null) {\n const IS_BROWSER = typeof window !== 'undefined'\n const [_isMobile, _setIsMobile] = useState(false)\n\n const checkBreakpoint = () => {\n const width = breakpoints[breakpoint]\n if (width) {\n return _setIsMobile(window.innerWidth <= width)\n }\n\n if (typeof breakpoint === 'number') {\n return _setIsMobile(window.innerWidth <= breakpoint)\n }\n\n return _setIsMobile(false)\n }\n\n useEffect(() => {\n if (IS_BROWSER) {\n checkBreakpoint()\n window.addEventListener('resize', checkBreakpoint)\n }\n return () => {\n if (IS_BROWSER) {\n return window.removeEventListener('resize', checkBreakpoint)\n }\n }\n }, [])\n\n return _isMobile\n}\n\n// regex helper that returns if the passed string is a UUID or not\n// mainly used to tell if a docusign or sign easy document ID. Docusign uses UUID\nexport function isUUID(str) {\n return /^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$/.test(\n str,\n )\n}\n\n// pdf form field helper that attempts to get the field, set text and update font\nexport function getFieldSetTextMaybe(\n fieldName,\n value = '',\n useSmallerFont = false,\n) {\n const field = this.getFieldMaybe(fieldName)\n\n if (field) {\n field.setText(value)\n\n if (useSmallerFont) {\n field.setFontSize(8)\n }\n }\n}\n\nexport function truncate(string, charLimit = 4000) {\n return String(string || '').substring(0, charLimit)\n}\n","import React from 'react'\nimport PropTypes from 'prop-types'\nimport { navigate } from 'gatsby'\n\nconst PrivateRoute = ({\n component: Component,\n location,\n isLoggedIn,\n ...rest\n}) => {\n if (!isLoggedIn && location.pathname !== '/portal/login') {\n navigate('/portal/login')\n return null\n }\n\n return \n}\n\nPrivateRoute.propTypes = {\n component: PropTypes.func,\n location: PropTypes.object,\n isLoggedIn: PropTypes.bool,\n}\n\nexport default PrivateRoute\n","import React, { useState } from 'react'\nimport PropTypes from 'prop-types'\nimport { ClipLoader } from 'react-spinners'\nimport { navigate } from 'gatsby'\n\nimport { Auth } from '../amplify'\n\nimport Text from './Text'\nimport Input from './Input'\nimport Button from './Button'\n\nconst ResetPassword = ({ refreshAuthStatus }) => {\n const [resetPasswordCredentials, setResetPasswordCredentials] = useState({\n username: '', // actually an email, just named username\n newPassword: '',\n verificationCode: null,\n })\n const [resetPasswordStatus, setResetPasswordStatus] = useState({\n message: '',\n error: false,\n loading: false,\n successful: false,\n verificationCodeSent: false,\n })\n\n const onResetPasswordInputChange = e =>\n setResetPasswordCredentials({\n ...resetPasswordCredentials,\n [e.target.name]: e.target.value,\n })\n\n const sendForgotPasswordCode = async () => {\n setResetPasswordStatus({ ...resetPasswordStatus, loading: true })\n const forgotPasswordResponse = await Auth.forgotPassword(\n resetPasswordCredentials.username.toLowerCase(),\n )\n\n if (forgotPasswordResponse?.CodeDeliveryDetails) {\n setResetPasswordStatus({\n message: `A verfication code has been sent to ${\n forgotPasswordResponse?.CodeDeliveryDetails?.Destination ||\n 'your registered phone number'\n }`,\n error: false,\n loading: false,\n successful: false,\n verificationCodeSent: true,\n })\n } else {\n setResetPasswordStatus({\n message:\n forgotPasswordResponse?.message ||\n 'An unknown error occured. Please try again later.',\n error: true,\n loading: false,\n successful: false,\n verificationCodeSent: false,\n })\n }\n }\n\n const submitNewPassword = async () => {\n setResetPasswordStatus({ ...resetPasswordStatus, loading: true })\n const forgotPasswordSubmitResponse = await Auth.forgotPasswordSubmit(\n resetPasswordCredentials.username.toLowerCase(),\n resetPasswordCredentials.verificationCode,\n resetPasswordCredentials.newPassword,\n )\n\n // This request returns nothing when successful\n if (!forgotPasswordSubmitResponse) {\n setResetPasswordStatus({\n message: 'Successfully Updated Password',\n error: false,\n loading: false,\n successful: true,\n verificationCodeSent: true,\n })\n setResetPasswordCredentials({\n username: '',\n newPassword: '',\n verificationCode: null,\n })\n setTimeout(() => {\n refreshAuthStatus()\n navigate('/portal')\n }, 2500)\n } else {\n setResetPasswordStatus({\n message:\n forgotPasswordSubmitResponse?.message ||\n 'An unknown error occured. Please try again later.',\n error: false,\n loading: false,\n successful: false,\n verificationCodeSent: true,\n })\n }\n }\n\n return (\n
\n
\n
\n

Reset Password

\n
\n\n {resetPasswordStatus.verificationCodeSent ? (\n <>\n \n {resetPasswordStatus.message}\n \n \n \n \n <>\n {resetPasswordStatus.loading ? (\n \n ) : (\n
\n \n
\n )}\n \n \n ) : (\n <>\n \n {resetPasswordStatus.message}\n \n \n {resetPasswordStatus.loading ? (\n \n ) : (\n
\n \n
\n )}\n \n )}\n
\n
\n )\n}\n\nResetPassword.propTypes = {\n refreshAuthStatus: PropTypes.func,\n}\n\nexport default ResetPassword\n","import React, { useState, useEffect } from 'react'\nimport PropTypes from 'prop-types'\nimport { ClipLoader } from 'react-spinners'\nimport { navigate } from 'gatsby'\n\nimport { Auth } from '../amplify'\n\nimport Text from './Text'\nimport Input from './Input'\nimport Button from './Button'\nimport ResetPassword from './ResetPassword'\n\nconst LoginForm = ({ refreshAuthStatus, isLoggedIn }) => {\n const [loginCredentials, setLoginCredentials] = useState({\n username: '', // actually an email, just named username\n password: '',\n })\n const [loginStatus, setLoginStatus] = useState({\n message: '',\n error: false,\n loading: false,\n successful: false,\n forgotPassword: false,\n })\n\n // if user is already authenticated\n if (isLoggedIn) {\n navigate('/portal')\n }\n\n const onLoginInputChange = e =>\n setLoginCredentials({\n ...loginCredentials,\n [e.target.name]: e.target.value,\n })\n\n const loginUser = async e => {\n e.preventDefault()\n\n setLoginStatus({\n ...loginStatus,\n loading: true,\n })\n\n const loginResponse = await Auth.login(\n loginCredentials.username.toLowerCase(),\n loginCredentials.password,\n )\n\n // if initial registration was successful and we want to confirm SMS\n if (loginResponse?.username) {\n setLoginStatus({\n message: 'You have been successfully logged in.',\n error: false,\n loading: false,\n successful: true,\n })\n setLoginCredentials({\n username: '',\n password: '',\n })\n setTimeout(() => {\n refreshAuthStatus()\n navigate('/portal')\n }, 2000)\n } else {\n // if some other error happens\n setLoginStatus({\n message:\n loginResponse?.message ||\n 'An unknown error has occured. Please try again!',\n error: true,\n loading: false,\n successful: false,\n })\n }\n }\n\n return (\n <>\n {loginStatus.forgotPassword ? (\n \n ) : (\n
\n
\n
\n

Broker Login

\n
\n
\n \n {loginStatus.message}\n \n {!loginStatus.successful && (\n <>\n \n \n <>\n {loginStatus.loading ? (\n \n ) : (\n
\n \n
\n )}\n \n \n )}\n \n setLoginStatus({ forgotPassword: true })}\n >\n Forgot your password?\n \n
\n
\n )}\n \n )\n}\n\nLoginForm.propTypes = {\n refreshAuthStatus: PropTypes.func,\n isLoggedIn: PropTypes.bool,\n}\n\nexport default LoginForm\n","import React from 'react'\nimport PropTypes from 'prop-types'\nimport { Link } from 'gatsby'\n\nconst PortalPage = ({ headerLinks, user, children }) => {\n const path = window.location.pathname\n const SHOW_BACK_BUTTON = path !== '/portal' && path !== '/portal/'\n\n return (\n <>\n {/* Header */}\n
\n

Broker Portal

\n

{user?.attributes?.name && `Welcome, ${user?.attributes?.name}`}

\n
\n {/* Admin Nav */}\n
{headerLinks}
\n {/* Content */}\n
\n
{children}
\n
\n {SHOW_BACK_BUTTON && (\n
\n \n Back to Applications\n \n
\n )}\n \n )\n}\n\nPortalPage.propTypes = {\n headerLinks: PropTypes.array,\n user: PropTypes.object,\n children: PropTypes.node,\n}\n\nexport default PortalPage\n","import React from 'react'\nimport PropTypes from 'prop-types'\nimport { navigate } from 'gatsby'\n\nconst LeaseSquare = ({ status, location, leases }) => {\n const leaseCount = leases\n ? leases.items.length >= 1000\n ? '1000+'\n : leases.items.length\n : '-'\n\n return (\n navigate(`/portal/leases/${location}`)}\n >\n
{status}
\n
{leaseCount}
\n \n )\n}\n\nLeaseSquare.propTypes = {\n status: PropTypes.string,\n location: PropTypes.string,\n leases: PropTypes.object,\n}\n\nexport default LeaseSquare\n","/* eslint-disable react/function-component-definition */\nimport React from 'react'\nimport PropTypes from 'prop-types'\nimport Select from 'react-dropdown-select'\n\nconst BrokerDropdown = ({\n IS_ADMIN,\n brokerList = [],\n selectedBrokerFilter = [],\n onDropdownChange,\n placeholder = 'Select a Broker Filter...',\n}) => {\n return IS_ADMIN ? (\n \n ) : null\n}\n\nBrokerDropdown.propTypes = {\n IS_ADMIN: PropTypes.bool,\n brokerList: PropTypes.array,\n onDropdownChange: PropTypes.func,\n selectedBrokerFilter: PropTypes.array,\n placeholder: PropTypes.string,\n}\n\nexport default BrokerDropdown\n","/* eslint-disable react/function-component-definition */\nimport React, { useState, useEffect } from 'react'\nimport PropTypes from 'prop-types'\nimport { Link, navigate } from 'gatsby'\n\nimport { Auth, API, Util } from '../amplify'\nimport * as LEASE_STATUS from '../data/leaseStatus'\n\nimport PortalPage from './PortalPage'\nimport Button from './Button'\nimport LeaseSquare from './LeaseSquare'\nimport BrokerDropdown from './BrokerDropdown'\n\nconst BrokerHome = ({\n refreshAuthStatus,\n user,\n brokerList,\n selectedBrokerFilter,\n setSelectedBrokerFilter,\n}) => {\n const IS_ADMIN = user.attributes?.['custom:type'] === 'admin'\n\n const [data, setData] = useState({\n loading: true,\n leaseCounts: {},\n })\n\n useEffect(() => {\n fetchLeaseCounts()\n }, [selectedBrokerFilter])\n\n const fetchLeaseCounts = async () => {\n try {\n const leaseResponse = await API.getLeaseCounts(\n user.attributes['custom:type'] === 'broker'\n ? user.username\n : selectedBrokerFilter[0].value,\n )\n\n setData({\n ...data,\n loading: false,\n leaseCounts: leaseResponse,\n })\n } catch (error) {\n Util.LogError(\n 'ERROR_FETCHING_LEASE_COUNTS',\n error,\n user.attributes['custom:type'] === 'broker'\n ? user.username\n : selectedBrokerFilter[0].value,\n )\n }\n }\n\n const onDropdownChange = option => {\n const value = option.length ? option : [{ label: 'No Filter', value: '' }]\n setSelectedBrokerFilter(value)\n }\n\n return (\n \n + New Lease Application\n ,\n IS_ADMIN ? (\n \n navigate(`/portal/leases/${LEASE_STATUS.LEASE_ARCHIVED.url}`)\n }\n >\n View Archived\n \n ) : null,\n ,\n {\n await Auth.logout()\n refreshAuthStatus()\n }}\n key='logoutLink'\n >\n Logout\n ,\n ]}\n >\n
\n
VIEW APPLICATIONS IN CREDIT STAGE
\n
\n \n \n \n \n
\n\n
\n\n
\n VIEW APPLICATIONS IN CONTRACT STAGE\n
\n
\n \n \n \n \n
\n
\n \n )\n}\n\nBrokerHome.propTypes = {\n user: PropTypes.object,\n refreshAuthStatus: PropTypes.func,\n brokerList: PropTypes.array,\n selectedBrokerFilter: PropTypes.array,\n setSelectedBrokerFilter: PropTypes.func,\n}\n\nexport default BrokerHome\n","import React, { useState, useEffect } from 'react'\nimport PropTypes from 'prop-types'\n\nimport Input from './Input'\nimport Button from './Button'\n\nconst CoLessees = ({\n mainLeaseInputHandler,\n data,\n disabled,\n options,\n IS_ADMIN,\n}) => {\n const [coLesseesRenderData, setCoLesseesRenderData] = useState([])\n const [coLesseesData, setCoLesseesData] = useState({})\n\n useEffect(() => {\n // lessees stored as JSON in DB show them on the form requested\n if (data?.co_lessees) {\n const deserializedRawCoLessees = data.co_lessees\n const numCoLessees = Object.keys(deserializedRawCoLessees).length / 2\n const newCoLesseesRenderData = Array(numCoLessees).fill('co-lessee')\n setCoLesseesData(deserializedRawCoLessees)\n setCoLesseesRenderData(newCoLesseesRenderData)\n }\n }, [])\n\n const onCoLesseeChange = e => {\n const coLesseeDataUpdated = {\n ...coLesseesData,\n [e.target.name]: e.target.value,\n }\n\n // for internal state\n setCoLesseesData(coLesseeDataUpdated)\n\n // for main lease state\n mainLeaseInputHandler({\n target: {\n name: 'co_lessees',\n value: coLesseeDataUpdated,\n },\n })\n }\n\n const onCoLesseeDelete = index => {\n // remove from internal state\n const tempCoLessees = [...coLesseesRenderData]\n tempCoLessees.pop()\n setCoLesseesRenderData(tempCoLessees)\n delete coLesseesData[`co_lessee_name_${index}`]\n delete coLesseesData[`co_lessee_email_${index}`]\n setCoLesseesData(coLesseesData)\n\n // remove from main lease state if present\n if (\n data?.co_lessees?.[`co_lessee_name_${index}`] &&\n data?.co_lessees?.[`co_lessee_email_${index}`]\n ) {\n delete data?.co_lessees[`co_lessee_name_${index}`]\n delete data?.co_lessees[`co_lessee_email_${index}`]\n }\n }\n\n const renderCoLessees = () =>\n coLesseesRenderData.map((_, i) => {\n const coLesseeName = `co_lessee_name_${i + 1}`\n const coLesseeEmail = `co_lessee_email_${i + 1}`\n\n return (\n
\n {options.showName && (\n onCoLesseeDelete(i + 1)}\n disabled={disabled}\n >\n X\n \n )\n }\n />\n )}\n {options.showEmail && (\n onCoLesseeDelete(i + 1)}\n disabled={disabled}\n >\n X\n \n )\n }\n />\n )}\n
\n )\n })\n\n return (\n
\n {renderCoLessees()}\n {!disabled && coLesseesRenderData.length !== 3 && !options.showEmail && (\n \n setCoLesseesRenderData([...coLesseesRenderData, 'co-lessee'])\n }\n >\n Add Co-Lessee\n \n )}\n
\n )\n}\n\nCoLessees.propTypes = {\n mainLeaseInputHandler: PropTypes.func,\n data: PropTypes.object,\n disabled: PropTypes.bool,\n options: PropTypes.object,\n IS_ADMIN: PropTypes.bool,\n}\n\nexport default CoLessees\n","import React from 'react'\nimport { toast } from 'react-toastify'\nimport Modal from 'react-modal'\nimport moment from 'moment'\n\nimport leaseCreditFormSchema from '../data/leaseCreditFormSchema.json'\nimport leaseCreditLogSchema from '../data/leaseCreditLogSchema.json'\nimport leaseContractFormSchema from '../data/leaseContractFormSchema.json'\n\nimport Input from '../components/Input'\nimport CoLessees from '../components/CoLessees'\nimport Button from '../components/Button'\n\n/* @param schema: 'credit' | 'contract'\n @param labelType: 'edit' | 'view'\n @param inputProps: {\n disabled: Bool,\n onChange: func,\n leaseData: object\n }\n\n @return []\n*/\nexport const renderForm = ({\n schema,\n labelType,\n IS_ADMIN,\n IS_MOBILE,\n inputProps,\n}) => {\n let inputSchema = []\n\n switch (schema) {\n case 'creditGeneral':\n inputSchema = leaseCreditFormSchema\n break\n case 'creditLog':\n inputSchema = leaseCreditLogSchema\n break\n case 'contract':\n inputSchema = leaseContractFormSchema\n break\n default:\n console.log('Unknown schema. Please Try again.')\n }\n\n if (IS_MOBILE) {\n return inputSchema.flat().map(row => {\n // if single input per row\n const { inputStyles, labels, ...field } = row\n\n // for co-lessee field\n if (field.name === 'co_lessees') {\n return (\n \n )\n }\n return (\n \n )\n })\n }\n\n return inputSchema.map((row, i) => {\n // if multiple inputs per row\n if (row.length > 1) {\n return (\n
\n {row.map(({ inputStyles, labels, ...field }) => (\n 6 ? 1 : 2)}%`,\n }}\n value={\n inputSchema === leaseCreditLogSchema\n ? inputProps.data?.[field.name]\n ? inputProps.data?.[field.name]\n : inputProps.data[field.name] === 0\n ? 0\n : undefined\n : inputSchema === leaseContractFormSchema\n ? inputProps.data?.[field.name]\n ? inputProps.data?.[field.name]\n : ''\n : inputProps.data?.[field.name]\n ? inputProps.data?.[field.name]\n : undefined\n }\n {...field}\n />\n ))}\n
\n )\n }\n\n // if single input per row\n const { inputStyles, labels, ...field } = row[0]\n\n // for co-lessee field\n if (field.name === 'co_lessees') {\n return (\n \n )\n }\n return (\n \n )\n })\n}\n\nexport const createToast = (content, type = 'success') => {\n const toastProps = {\n position: 'bottom-center',\n autoClose: 5000,\n hideProgressBar: false,\n closeOnClick: true,\n pauseOnHover: true,\n draggable: true,\n progress: undefined,\n style: {\n borderRadius: 5,\n textAlign: 'center',\n fontFamily:\n '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"',\n },\n }\n\n if (type === 'success') {\n return toast.success(content, {\n ...toastProps,\n style: { ...toastProps.style, background: '#3b9453' },\n })\n }\n\n if (type === 'error') {\n return toast.error(content, {\n ...toastProps,\n })\n }\n\n console.log('INVALID TOAST')\n}\n\nModal.setAppElement('#___gatsby')\nexport const createModal = (modalData, setModalData) => {\n return (\n setModalData({ ...modalData, isOpen: false })}\n className='modal-content'\n contentLabel={modalData?.contentLabel || 'ADD Confirm Modal'}\n style={{\n overlay: { zIndex: 10 },\n content: {\n maxHeight: '100%',\n ...(modalData?.noMarginTop ? { marginTop: 0 } : {}),\n },\n }}\n >\n

{modalData.title}

\n {modalData?.isNode ? (\n
\n {modalData.description}\n
\n ) : (\n

\n {modalData.description}\n

\n )}\n
\n setModalData({ ...modalData, isOpen: false })}\n >\n Close\n \n {modalData.submitText && (\n \n )}\n
\n \n )\n}\n\nexport const formatDocusignAuditData = auditData => {\n const parsedEventItems = auditData.auditEvents.map(event => {\n const eventItemsArr = event.eventFields\n\n const time = eventItemsArr.find(item => item.name === 'logTime').value\n const source = eventItemsArr.find(item => item.name === 'Source').value\n const name = eventItemsArr.find(item => item.name === 'UserName').value\n const id = eventItemsArr.find(item => item.name === 'UserId').value\n const action = eventItemsArr.find(item => item.name === 'Action').value\n const message = eventItemsArr.find(item => item.name === 'Message').value\n const envelopeStatus = eventItemsArr.find(\n item => item.name === 'EnvelopeStatus',\n ).value\n const ip = eventItemsArr.find(item => item.name === 'ClientIPAddress').value\n\n return {\n time,\n source,\n name,\n id,\n action,\n message,\n envelopeStatus,\n ip,\n }\n })\n\n return (\n
\n {parsedEventItems.map(({ message, time, ...rest }) => (\n
\n \n \n {message}\n
({moment(time).format('MMMM DD, YYYY h:mm A')})\n
\n
\n {Object.keys(rest).map(key => (\n
  • \n {key}:{' '}\n {rest[key]}\n
  • \n ))}\n
    \n ))}\n
    \n )\n}\n","import axios from 'axios'\n\nimport { splitMultiLineText, formatNumber } from './helpers'\n\nconst signEasyConfig = (additionalConfig = {}) => ({\n headers: {\n Authorization: `Bearer ${process.env.GATSBY_SIGN_EASY_API_KEY}`,\n },\n ...additionalConfig,\n})\n\nconst SIGN_EASY_BASE_API_URL = 'https://api.signeasy.com/v2.1'\n\nclass SignEasy {\n getPendingDocumentStatus(id) {\n return axios(\n `${SIGN_EASY_BASE_API_URL}/template/rs/${id}/`,\n signEasyConfig(),\n )\n }\n\n getSignedDocumentStatus(id) {\n return axios(\n `${SIGN_EASY_BASE_API_URL}/rs/envelope/signed/pending/${id}/`,\n signEasyConfig(),\n )\n }\n\n downloadDocument(id) {\n return axios(\n `${SIGN_EASY_BASE_API_URL}/rs/signed/${id}/download/`,\n signEasyConfig({ responseType: 'blob' }),\n )\n }\n\n sendContract({ template_file_id, ...data }) {\n return axios.post(\n `${SIGN_EASY_BASE_API_URL}/template/${template_file_id}/rs`,\n data,\n signEasyConfig(),\n )\n }\n\n remindSigners(id) {\n return axios.post(\n `${SIGN_EASY_BASE_API_URL}/template/rs/${id}/remind/`,\n {},\n signEasyConfig(),\n )\n }\n\n downloadAuditTrail(id) {\n return axios(\n `${SIGN_EASY_BASE_API_URL}/template/rs/signed/${id}/certificate`,\n signEasyConfig({ responseType: 'blob' }),\n )\n }\n\n /**\n *\n * @param {} lease - main lease object\n * @param {} coLessees - map of co-lessee names and emails Ex. co_lessee_name_#\n * @param {Number} numCoLessees - total number of co-lessees\n * @todo Any additions made to this should be reflected in the lease schema, and contract PDF form fields\n * We want to make sure the names of fields are consistent everywhere to prevent error\n */\n generateMergeFields(lease, coLessees = {}, numCoLessees = 0) {\n const coLesseeNames = numCoLessees.map((_, i) => {\n const coLesseeNumber = i + 1\n return {\n label: `co_lessee_name_${coLesseeNumber}`,\n value: coLessees[`co_lessee_name_${coLesseeNumber}`],\n font_size: 8,\n }\n })\n\n let coLesseesCombined = lease.main_lessee_name\n Object.keys(lease.co_lessees).forEach(colessee => {\n if (colessee.includes('name')) {\n coLesseesCombined += ' & ' + lease.co_lessees[colessee]\n }\n })\n\n const assets = splitMultiLineText(lease.asset_description)\n const serialNumbers = splitMultiLineText(lease.serial_number, true)\n\n return [\n // Main Info\n {\n label: 'main_lessee_name',\n value: lease.main_lessee_name,\n font_size: 8,\n },\n ...coLesseeNames,\n {\n label: 'main_lessee_address',\n value: lease.main_lessee_address,\n font_size: 8,\n },\n {\n label: 'main_lessee_city',\n value: lease.main_lessee_city,\n font_size: 8,\n },\n {\n label: 'main_lessee_province',\n value: lease.main_lessee_province,\n font_size: 8,\n },\n {\n label: 'main_lessee_postal_code',\n value: lease.main_lessee_postal_code,\n font_size: 8,\n },\n {\n label: 'main_lessee_phone',\n value: lease.main_lessee_phone || '',\n font_size: 8,\n },\n {\n label: 'main_lessee_cell',\n value: lease.main_lessee_cell || '',\n font_size: 8,\n },\n {\n label: 'main_lessee_email',\n value: lease.main_lessee_email,\n font_size: 8,\n },\n {\n label: 'main_lessee_contact',\n value: lease.main_lessee_contact || '',\n font_size: 8,\n },\n\n // Asset Description\n {\n label: 'asset_description_1',\n value: assets[0] || '',\n font_size: 8,\n },\n {\n label: 'asset_description_2',\n value: assets[1] || '',\n font_size: 8,\n },\n {\n label: 'asset_description_3',\n value: assets[2] || '',\n font_size: 8,\n },\n {\n label: 'serial_number_1',\n value: serialNumbers[0] || '',\n font_size: 8,\n },\n {\n label: 'serial_number_2',\n value: serialNumbers[1] || '',\n font_size: 8,\n },\n {\n label: 'serial_number_3',\n value: serialNumbers[2] || '',\n font_size: 8,\n },\n {\n label: 'equipment_location',\n value: lease.equipment_location || '',\n font_size: 8,\n },\n\n // Other Info\n {\n label: 'sales_rep',\n value: lease.sales_rep || '',\n font_size: 8,\n },\n {\n label: 'vendor_phone_number',\n value: lease.vendor_phone_number || '',\n font_size: 8,\n },\n\n // Payment Terms 1\n {\n label: 'term_okd',\n value: String(lease.term_okd || ''),\n font_size: 8,\n },\n {\n label: 'number_of_payments_1',\n value: String(lease.number_of_payments_1 || ''),\n font_size: 8,\n },\n {\n label: 'rental_amount_1',\n value: lease.rental_amount_1\n ? `$${formatNumber(lease.rental_amount_1)}`\n : '',\n font_size: 8,\n },\n {\n label: 'other_1',\n value: 'N/A',\n font_size: 8,\n },\n {\n label: 'pst_1',\n value: `${\n String(lease.pst_1).toLowerCase() === 'n/a'\n ? 'N/A'\n : lease.pst_1\n ? `$${formatNumber(lease.pst_1)}`\n : ''\n }`,\n font_size: 8,\n },\n {\n label: 'gst_1',\n value: lease.gst_1 ? `$${formatNumber(lease.gst_1)}` : '',\n font_size: 8,\n },\n {\n label: 'total_1',\n value: lease.total_1 ? `$${formatNumber(lease.total_1)}` : '',\n font_size: 8,\n },\n\n // Payment Terms 2\n {\n label: 'monthly',\n value: 'X',\n font_size: 8,\n },\n {\n label: 'number_of_payments_2',\n value: String(lease.number_of_payments_2 || ''),\n font_size: 8,\n },\n {\n label: 'rental_amount_2',\n value: lease.rental_amount_2\n ? `$${formatNumber(lease.rental_amount_2)}`\n : '',\n font_size: 8,\n },\n {\n label: 'other_2',\n value: 'N/A',\n font_size: 8,\n },\n {\n label: 'pst_2',\n value: `${\n String(lease.pst_2).toLowerCase() === 'n/a'\n ? 'N/A'\n : lease.pst_2\n ? `$${formatNumber(lease.pst_2)}`\n : ''\n }`,\n font_size: 8,\n },\n {\n label: 'gst_2',\n value: lease.gst_2 ? `$${formatNumber(lease.gst_2)}` : '',\n font_size: 8,\n },\n {\n label: 'total_2',\n value: lease.total_2 ? `$${formatNumber(lease.total_2)}` : '',\n font_size: 8,\n },\n\n // Commencement and purchase option docs\n {\n label: 'co_lessees_combined',\n value: coLesseesCombined,\n font_size: 8,\n },\n {\n label: 'asset_serial_combined_1',\n value: `${assets[0] || ''} ${serialNumbers[0] || ''}`,\n font_size: 8,\n },\n {\n label: 'asset_serial_combined_2',\n value: `${assets[1] || ''} ${serialNumbers[1] || ''}`,\n font_size: 8,\n },\n {\n label: 'asset_serial_combined_3',\n value: `${assets[2] || ''} ${serialNumbers[2] || ''}`,\n font_size: 8,\n },\n {\n label: 'vendor',\n value: String(lease.vendor || ''),\n font_size: 8,\n },\n {\n label: 'purchase_option_month',\n value: String(lease.purchase_option_month || ''),\n font_size: 8,\n },\n {\n label: 'purchase_option_price',\n value: `$${formatNumber(lease.purchase_price)} + taxes`,\n font_size: 8,\n },\n {\n label: 'commencement_date',\n value: lease.commencement_date || '',\n font_size: 8,\n },\n ]\n }\n}\n\nexport default new SignEasy()\n","import React from 'react'\nimport propTypes from 'prop-types'\n\nconst LeaseToggle = ({ leaseToggleState, setLeaseToggleState }) => {\n return (\n
    \n setLeaseToggleState('credit')}\n id='credit'\n >\n Credit Application\n
    \n setLeaseToggleState('contract')}\n id='contract'\n >\n Lease Documentation\n
    \n \n )\n}\n\nLeaseToggle.propTypes = {\n leaseToggleState: propTypes.string,\n setLeaseToggleState: propTypes.func,\n}\n\nexport default LeaseToggle\n","// KEEP IN SYNC WITH - amplify/backend/function/currencyWebhooks/src/actions.js\n\nexport const CURRENCY_ACTIONS = {\n GET_APPLICATION: 'GET_APPLICATION',\n UPDATE_APPLICATION: 'UPDATE_APPLICATION',\n GET_SECTION1071: 'GET_SECTION1071',\n GET_STIPULATION: 'GET_STIPULATION',\n CREATE_OR_UPDATE_STIPULATION: 'CREATE_OR_UPDATE_STIPULATION',\n GET_STIPULATION_TYPES: 'GET_STIPULATION_TYPES',\n GET_DOCUMENT: 'GET_DOCUMENT',\n CREATE_WEBHOOK: 'CREATE_WEBHOOK',\n DELETE_WEBHOOK: 'DELETE_WEBHOOK',\n}\n\n// keep in sync with amplify/backend/function/currencyWebhooks/src/Lease/LeaseHelpers.js\nexport const CURRENCY_CC_EMAILS = ['brad.m@addcapital.ca']\n\n// currency dev+prod broker email: credit+currency@addcapital.ca\n// currency broker password: AddCapitalCurrency2025\n// if this changes, also change the broker id in the currency webhook lambda\n// amplify/backend/function/currencyWebhooks/src/Lease/LeaseController.js\nconst DEV_CURRENCY_BROKER_ID = '5bc1abc8-9a09-4e24-ab0e-385e67c6e761'\nconst PROD_CURRENCY_BROKER_ID = 'ab7a17e4-ef18-446a-aeb1-e94b18e86a1b'\n\nexport const CURRENCY_BROKER_ID =\n process.env.GATSBY_ADD_ENV === 'production'\n ? PROD_CURRENCY_BROKER_ID\n : DEV_CURRENCY_BROKER_ID\n\nexport const CURRENCY_DECLINE_REASONS = [\n {\n label: 'Insufficient Credit Score',\n value: 1,\n },\n {\n label: 'Poor Credit History',\n value: 2,\n },\n {\n label: 'Thin Credit History',\n value: 3,\n },\n {\n label: 'Restricted EQ/Industry/State',\n value: 4,\n },\n {\n label: 'FICO Score',\n value: 5,\n },\n {\n label: 'Insufficient TIB',\n value: 6,\n },\n {\n label: 'Insufficient Payback Capacity',\n value: 7,\n },\n {\n label: 'Low Comp Credit',\n value: 8,\n },\n {\n label: 'Non-Essential Equipment',\n value: 9,\n },\n {\n label: 'Delinquencies/Charge Offs',\n value: 10,\n },\n {\n label: 'Paynet Score',\n value: 11,\n },\n {\n label: 'High Utilization',\n value: 12,\n },\n {\n label: 'Bankruptcy',\n value: 13,\n },\n {\n label: 'Child Support',\n value: 14,\n },\n {\n label: 'Outstanding Approval w/ other Broker',\n value: 15,\n },\n {\n label: 'Potential Fraud',\n value: 16,\n },\n {\n label: 'Other',\n value: 17,\n },\n]\n","import React from 'react'\nimport propTypes from 'prop-types'\nimport moment from 'moment'\n\nimport * as LEASE_STATUS from '../data/leaseStatus'\n\nconst LeaseMainInfo = ({ data }) => {\n return (\n
    \n Lease Information\n
    {`Status - ${LEASE_STATUS[data.lease.status].display}`}
    \n
    \n {`Submitted - ${moment(data.lease.createdAt).format(\n 'MMMM DD, YYYY h:mm A',\n )}`}\n
    \n
    {`Submitted By - ${data.broker.name}`}
    \n {data.lease?.reference_number ? (\n
    {`Reference Number: ${data.lease.reference_number}`}
    \n ) : null}\n
    \n )\n}\n\nLeaseMainInfo.propTypes = {\n data: propTypes.object,\n}\n\nexport default LeaseMainInfo\n","import React, { useState } from 'react'\nimport PropTypes from 'prop-types'\nimport { ClipLoader } from 'react-spinners'\n\nimport { Storage, Util } from '../amplify'\nimport { createToast } from '../util/reactHelpers'\n\nimport Input from './Input'\nimport Button from './Button'\n\n// File Upload Container with state + input addition logic\nconst FileUpload = ({\n leaseMetaData,\n disabled = false,\n noStartingInput = false,\n type = 'credit',\n disableAdding = false,\n constantFileName = null,\n // hook to be run after a file upload or delete\n fileActionHook = () => {},\n}) => {\n const [files, setFiles] = useState([])\n // const [uploadFilesSize, setUploadFilesSize] = useState(0)\n // const [totalFilesSize, setTotalFilesSize] = useState(0)\n const [fileLoading, setFileLoading] = useState(false)\n\n const cleanupFiles = () => {\n setFiles([])\n // setUploadFilesSize(0)\n // setTotalFilesSize(0)\n document.getElementsByName('multi_file_input')[0].value = null\n }\n\n const removeLocalFiles = () => {\n document.getElementsByName('multi_file_input')[0].value = null\n }\n\n // remove all files in multi file\n const removeFiles = async () => {\n setFileLoading(true)\n\n const removeFilesPromises = files.map(file => {\n return Storage.deleteDocument(\n `leases/${leaseMetaData.id}/${type}/${constantFileName || file}`,\n )\n })\n\n try {\n await Promise.all(removeFilesPromises)\n createToast('Successfully removed files.')\n } catch (error) {\n createToast('Files removal failed. Try again.', 'error')\n Util.LogError('ERROR_REMOVING_FILES', error, files)\n }\n\n cleanupFiles()\n fileActionHook()\n setFileLoading(false)\n }\n\n // add all selected files to storage bucket\n const onFileChange = async e => {\n e.preventDefault()\n e.stopPropagation()\n e.persist()\n setFileLoading(true)\n\n const iterableFiles = Array.from(e.target.files)\n\n // set total files upload size\n // setTotalFilesSize(iterableFiles.reduce((acc, file) => acc + file.size, 0))\n\n const filePromises = iterableFiles.map(async file => {\n return Storage.uploadDocument(\n `leases/${leaseMetaData.id}/${type}/${constantFileName || file.name}`,\n file,\n // progress => {\n // setUploadFilesSize(uploadFilesSize + progress.loaded)\n // },\n )\n })\n\n try {\n await Promise.all(filePromises)\n\n // set file names in state after upload\n setFiles([...files, ...iterableFiles.map(file => file.name)])\n\n createToast('Successfully added files.')\n } catch (error) {\n createToast('Failed to add files. Try again.', 'error')\n Util.LogError('ERROR_ADDING_FILES', error, iterableFiles)\n cleanupFiles()\n }\n\n removeLocalFiles()\n fileActionHook()\n setFileLoading(false)\n }\n\n return (\n
    \n
    \n

    Current Files:

    \n
      \n {files.map(file => (\n
    • {file}
    • \n ))}\n
    \n
    \n {/* initial file input */}\n {!disableAdding && (\n \n \n
    \n ) : (\n \n Remove All Files\n \n )\n }\n />\n )}\n \n )\n}\n\nFileUpload.propTypes = {\n leaseMetaData: PropTypes.object,\n disabled: PropTypes.bool,\n noStartingInput: PropTypes.bool,\n type: PropTypes.string,\n disableAdding: PropTypes.bool,\n constantFileName: PropTypes.string,\n fileActionHook: PropTypes.func,\n}\n\nexport default FileUpload\n","import React from 'react'\nimport propTypes from 'prop-types'\nimport moment from 'moment'\n\nimport { Storage, Util } from '../amplify'\nimport { parseLeaseFiles } from '../util'\nimport * as LEASE_STATUS from '../data/leaseStatus'\n\nimport Button from './Button'\nimport FileUpload from './FileUpload'\n\nconst LeaseFiles = ({ data, setData, isDisabled = false, type, IS_ADMIN }) => {\n const files = data.files[type]\n\n const IS_ALLOWED_TO_ADD_FILES =\n (data.lease.status === LEASE_STATUS.LEASE_NEEDS_INFO_CREDIT.status &&\n type === 'credit') ||\n (data.lease.status === LEASE_STATUS.LEASE_NEEDS_INFO_CONTRACT.status &&\n type === 'contract') ||\n (data.lease.status === LEASE_STATUS.LEASE_APPROVED_CREDIT.status &&\n type === 'contract')\n\n let typeOfFile = type.charAt(0).toUpperCase() + type.slice(1)\n typeOfFile = typeOfFile.replace(/([a-z])([A-Z0-9])/g, '$1 $2')\n\n const removeExistingFile = async file => {\n try {\n await Storage.deleteDocument(file)\n const updatedFiles = await Storage.listDocuments(\n `leases/${data.lease.id}`,\n )\n const sortedFiles = parseLeaseFiles(updatedFiles)\n\n setData({\n ...data,\n files: sortedFiles,\n })\n } catch (error) {\n Util.LogError('ERROR_REMOVING_EXISTING_FILE', error, data)\n }\n }\n\n const renderDeleteButton = file => {\n return (\n (IS_ADMIN ||\n (data.lease.status === LEASE_STATUS.LEASE_NEEDS_INFO_CREDIT.status &&\n type === 'credit') ||\n (data.lease.status === LEASE_STATUS.LEASE_NEEDS_INFO_CONTRACT.status &&\n type === 'contract')) && (\n removeExistingFile(file.key)}\n >\n X\n \n )\n )\n }\n\n const viewExistingFile = async file => {\n try {\n const fileURL = await Storage.getDocumentURL(file)\n window.open(fileURL, '_blank')\n } catch (error) {\n Util.LogError('ERROR_FETCHING_EXISTING_FILE', error, file)\n }\n }\n\n return (\n <>\n
    \n \n {files.length\n ? `Attached ${typeOfFile} Files`\n : IS_ALLOWED_TO_ADD_FILES\n ? `Add Lease ${typeOfFile} Documents`\n : `No Attached ${typeOfFile} Files`}\n \n\n {/* Current Files Rendered */}\n
    \n {files.map(file => {\n const fileName = file.key.split('/')[3]\n const fileAdded = file.lastModified\n\n // Render all files normally if you are an admin.\n // If you are a broker, never render the credit decision doc, and only render the\n // approval doc once we are passed the pending credit stage (credit has been approved)\n return !IS_ADMIN &&\n (fileName === 'credit_decision_doc.pdf' ||\n (fileName === 'credit_approval_doc.pdf' &&\n data.lease.status ===\n LEASE_STATUS.LEASE_PENDING_CREDIT.status)) ? null : (\n
    \n
    \n
    {fileName}
    \n
    \n {`File added: ${moment(fileAdded).format(\n 'MMMM DD, YYYY h:mm A',\n )}`}\n
    \n
    \n
    \n viewExistingFile(file.key)}\n >\n \n 🔍\n \n \n\n {/*Render File Delete Button*/}\n {renderDeleteButton(file)}\n
    \n
    \n )\n })}\n
    \n {IS_ALLOWED_TO_ADD_FILES && (\n \n )}\n
    \n \n )\n}\n\nLeaseFiles.propTypes = {\n data: propTypes.object,\n setData: propTypes.func,\n isDisabled: propTypes.bool,\n type: propTypes.string,\n IS_ADMIN: propTypes.bool,\n}\n\nexport default LeaseFiles\n","import React from 'react'\nimport propTypes from 'prop-types'\nimport { ClipLoader } from 'react-spinners'\nimport Select from 'react-dropdown-select'\n\nimport * as LEASE_STATUS from '../data/leaseStatus'\nimport { CURRENCY_DECLINE_REASONS } from '../util/currency/constants'\n\nimport Input from './Input'\nimport Button from './Button'\n\nconst LeaseAdminReview = ({\n adminReview,\n setAdminReview,\n submitAdminReview,\n formType,\n isFromCurrency = false,\n}) => {\n const showFeedbackTextArea = !isFromCurrency || adminReview.status === LEASE_STATUS.APPROVE_CREDIT\n // For currency leases, decline feedback must be from predefined options\n const showFeedbackDeclineDropdown = isFromCurrency && adminReview.status === LEASE_STATUS.DENY_CREDIT\n\n const onFeedbackChange = (option) => {\n setAdminReview({\n ...adminReview,\n feedback: option.length ? option[0].label : '',\n })\n }\n\n return (\n // Credit Form\n
    \n {!adminReview.successful && (\n <>\n {`Admin ${formType} Review`}\n \n )}\n\n {!adminReview.successful ? (\n formType === 'Credit' ? (\n
    \n \n setAdminReview({\n ...adminReview,\n status: LEASE_STATUS.APPROVE_CREDIT,\n })\n }\n name='radio-approve'\n inputStyles={{ width: 20, height: 20 }}\n />\n \n setAdminReview({\n ...adminReview,\n status: LEASE_STATUS.DENY_CREDIT,\n })\n }\n name='radio-deny'\n inputStyles={{ width: 20, height: 20 }}\n />\n \n setAdminReview({\n ...adminReview,\n status: LEASE_STATUS.NEEDS_INFO_CREDIT,\n })\n }\n name='radio-needs-info'\n inputStyles={{ width: 20, height: 20 }}\n />\n {showFeedbackTextArea && (\n \n setAdminReview({\n ...adminReview,\n feedback: e.target.value,\n })\n }\n />\n )}\n {showFeedbackDeclineDropdown && (\n \n )}\n {adminReview.loading ? (\n
    \n \n
    \n ) : (\n \n )}\n \n ) : (\n // Contract Form\n
    \n \n setAdminReview({\n ...adminReview,\n status: LEASE_STATUS.APPROVE_CONTRACT,\n })\n }\n name='radio-approve'\n inputStyles={{ width: 20, height: 20 }}\n />\n\n \n setAdminReview({\n ...adminReview,\n status: LEASE_STATUS.NEEDS_INFO_CONTRACT,\n })\n }\n name='radio-needs-info'\n inputStyles={{ width: 20, height: 20 }}\n />\n \n setAdminReview({\n ...adminReview,\n feedback: e.target.value,\n })\n }\n />\n {adminReview.loading ? (\n
    \n \n
    \n ) : (\n \n )}\n \n )\n ) : null}\n
    \n )\n}\n\nLeaseAdminReview.propTypes = {\n adminReview: propTypes.object,\n setAdminReview: propTypes.func,\n submitAdminReview: propTypes.func,\n formType: propTypes.string,\n isFromCurrency: propTypes.bool,\n}\n\nexport default LeaseAdminReview\n","import React from 'react'\nimport propTypes from 'prop-types'\nimport { ClipLoader } from 'react-spinners'\n\nimport Input from './Input'\nimport Button from './Button'\n\nconst LeaseNeedsInfo = ({\n needsInfoUpdate,\n submitNeedsInfoUpdate,\n lease,\n type,\n}) => {\n const infoType = type === 'credit' ? 'credit application' : 'contract'\n\n return (\n
    \n {!needsInfoUpdate.successful && (\n <>\n Needs More Information\n
    \n {`Your ${infoType} was denied as more information was needed. Please see the\n feedback and make the necessary changes to your lease ${infoType}.`}\n
    \n \n {needsInfoUpdate.loading ? (\n
    \n \n
    \n ) : (\n {`Resubmit ${type}`}\n )}\n \n )}\n
    \n )\n}\n\nLeaseNeedsInfo.propTypes = {\n needsInfoUpdate: propTypes.object,\n lease: propTypes.object,\n submitNeedsInfoUpdate: propTypes.func,\n type: propTypes.string,\n}\n\nexport default LeaseNeedsInfo\n","import React from 'react'\nimport propTypes from 'prop-types'\n\nimport Input from './Input'\n\nconst LeaseDenied = ({ lease, type }) => {\n return (\n
    \n <>\n Lease Denied\n
    \n Your lease was denied for the reasons below. Contact{' '}\n credit@addcapital.ca for\n more information if needed.\n
    \n \n \n
    \n )\n}\n\nLeaseDenied.propTypes = {\n lease: propTypes.object,\n type: propTypes.string,\n}\n\nexport default LeaseDenied\n","import React, { useState } from 'react'\nimport propTypes from 'prop-types'\nimport { ClipLoader } from 'react-spinners'\nimport { PDFDocument } from 'pdf-lib'\nimport moment from 'moment'\n\nimport { API, Storage, Lambda, Util } from '../amplify'\nimport { renderForm, parseLeaseFiles, parseCoLessees } from '../util'\nimport { formatNumber, isMobile } from '../util/helpers'\nimport { createToast } from '../util/reactHelpers'\nimport {\n CURRENCY_ACTIONS,\n CURRENCY_BROKER_ID,\n} from '../util/currency/constants'\nimport * as LEASE_STATUS from '../data/leaseStatus'\n\nimport Button from './Button'\nimport LeaseMainInfo from './LeaseMainInfo'\nimport LeaseFiles from './LeaseFiles'\nimport LeaseAdminReview from './LeaseAdminReview'\nimport LeaseNeedsInfo from './LeaseNeedsInfo'\nimport LeaseDenied from './LeaseDenied'\nimport creditApprovalDoc from '../assets/pdf/credit-approval.pdf'\nimport creditDecisionDoc from '../assets/pdf/credit-decision.pdf'\n\nconst LeaseCreditForm = ({\n data,\n user,\n setData,\n onLeaseInputChange,\n IS_ADMIN,\n didSubmitReview,\n setDidSubmitReview,\n}) => {\n const DOLLAR_FIELDS = [\n 'equipment_cost',\n 'administration_fee',\n 'collateral_exposure',\n 'exist_value',\n 'dp_final',\n 'trade_u_value',\n 'trade_in_value',\n 'equipment_value',\n 'clbo_value',\n 'total_exposure',\n 'security_deposit',\n 'additional_coll_value',\n ]\n\n const [needsInfoUpdate, setNeedsInfoUpdate] = useState({\n loading: false,\n response: null,\n successful: false,\n })\n const [adminCreditReview, setAdminCreditReview] = useState({\n status: null,\n feedback: null,\n loading: false,\n response: null,\n successful: false,\n })\n\n const [creditLogUpdate, setCreditLogUpdate] = useState({\n loading: false,\n response: null,\n successful: false,\n generateApprovalDocResponse: null,\n generateDecisionDocResponse: null,\n })\n\n const [adminUpdateLoading, setAdminUpdateLoading] = useState(false)\n\n const IS_MOBILE = isMobile('sm')\n const isFromCurrency = data.broker.id === CURRENCY_BROKER_ID\n\n const renderCreditMessage = () => {\n let message\n\n switch (data.lease.status) {\n case LEASE_STATUS.LEASE_APPROVED_CREDIT.status:\n message = (\n
    \n We are pleased to inform you that your credit application has been\n approved.\n
    \n Please view the 'Lease Documentation' tab to complete the\n Contract.\n
    \n )\n break\n\n case LEASE_STATUS.LEASE_NEEDS_INFO_CREDIT.status:\n message = (\n
    \n After submitting the credit application, we have determined there is\n still some information needed.\n
    \n Please see the feedback.\n
    \n )\n break\n\n case LEASE_STATUS.LEASE_PENDING_CREDIT.status:\n message = (\n
    \n Your credit submission is being reviewed. Thank you for your\n patience.\n
    \n )\n break\n\n case LEASE_STATUS.LEASE_DENIED_CREDIT.status:\n message = (\n
    \n After submitting the credit application, we have denied the\n application. Please see the feedback.\n
    \n )\n break\n\n default:\n message = \n break\n }\n\n return message\n }\n\n const submitAdminReview = async e => {\n e.preventDefault()\n\n let status\n let notificationStatus\n let ccAddContract = false\n let docURL = null\n const generatedCreditApprovalDoc = data.files.creditLog.reduce(\n (acc, file) => acc || file.key.includes('credit_approval_doc'),\n false,\n )\n\n switch (adminCreditReview.status) {\n case LEASE_STATUS.APPROVE_CREDIT:\n status = LEASE_STATUS.LEASE_APPROVED_CREDIT.status\n notificationStatus = 'has been credit approved by ADD Capital'\n ccAddContract = true\n if (!generatedCreditApprovalDoc) {\n return createToast(\n 'You must generate a Credit Approval Doc before approving!',\n 'error',\n )\n }\n if (!data.lease.term_okd) {\n return createToast(\n 'You must set a approvedterm before approving!',\n 'error',\n )\n }\n docURL = await Storage.getDocumentURL(\n `leases/${data.lease.id}/creditLog/credit_approval_doc.pdf`,\n )\n break\n\n case LEASE_STATUS.DENY_CREDIT:\n status = LEASE_STATUS.LEASE_DENIED_CREDIT.status\n notificationStatus = 'has been denied credit by ADD Capital'\n break\n\n case LEASE_STATUS.NEEDS_INFO_CREDIT:\n status = LEASE_STATUS.LEASE_NEEDS_INFO_CREDIT.status\n notificationStatus = 'needs more credit information'\n break\n\n default:\n break\n }\n\n try {\n setAdminCreditReview({\n ...adminCreditReview,\n loading: true,\n })\n await API.updateLease({\n ...data.lease,\n status,\n co_lessees: JSON.stringify(data.lease?.co_lessees || {}),\n admin_credit_feedback: adminCreditReview.feedback,\n admin_review_name: user.attributes.name,\n })\n\n // Update currency application\n\n if (isFromCurrency) {\n await Lambda.currency({\n action: CURRENCY_ACTIONS.UPDATE_APPLICATION,\n data: {\n applicationID: data.lease.currency_application_id,\n status,\n reason: adminCreditReview.feedback,\n approvedAmount: data.lease.equipment_cost,\n approvedTerm: data.lease.term_okd,\n },\n })\n }\n\n const emailTo = isFromCurrency\n ? data.lease.main_lessee_email\n : data.broker.email\n const leaseNextSteps = isFromCurrency\n ? 'Please contact ADD Capital if you have any questions'\n : 'View the Credit Application to see the credit approval details or view the Lease Documentation tab to start filling out lease contract information'\n\n // send notification to broker (or end customer if lease is from currency)\n await Lambda.sendEmail({\n IS_NOTIFICATION: true,\n TO: emailTo,\n FROM: 'CREDIT',\n CONTRACT_CC: ccAddContract,\n CREDIT_APPROVAL_DOC_URL: docURL,\n name: data.broker.name,\n clientName: data.lease.main_lessee_name,\n leaseName: data.lease.main_lessee_name,\n leaseStatus: notificationStatus,\n leaseNextSteps,\n leaseID: data.lease.id,\n })\n\n // so admin cannot flip tabs and re-review again\n setDidSubmitReview({\n credit: true,\n contract: false,\n })\n const msg = 'Successfully Reviewed Credit Application'\n createToast(msg)\n setAdminCreditReview({\n ...adminCreditReview,\n loading: false,\n response: msg,\n successful: true,\n })\n } catch (error) {\n Util.LogError('ERROR_ADMIN_CREDIT_RESPONSE', error, {\n user: user.attributes,\n data,\n })\n const msg =\n 'An unknown error has occurred when submitting the response. Please try again.'\n createToast(msg, 'error')\n setAdminCreditReview({\n ...adminCreditReview,\n loading: false,\n response: msg,\n successful: false,\n })\n }\n }\n\n const submitCreditLogUpdate = async e => {\n e.preventDefault()\n\n setCreditLogUpdate({\n loading: true,\n response: null,\n })\n\n try {\n await API.updateLease({\n ...data.lease,\n co_lessees: JSON.stringify(data.lease?.co_lessees || {}),\n })\n\n const msg = 'Successfully Saved Credit Log'\n createToast(msg)\n setCreditLogUpdate({\n loading: false,\n response: msg,\n successful: true,\n })\n } catch (error) {\n Util.LogError('ERROR_SAVING_CREDIT_LOG', error, {\n user: user.attributes,\n data,\n })\n const msg = 'An unknown error has occurred. Please try again.'\n createToast(msg, 'error')\n setCreditLogUpdate({\n loading: false,\n response: msg,\n })\n }\n }\n\n // this essentially does the exact same thing as the method above for saving the credit log\n // maybe the credit log should only save those fields, or we can combine these methods\n const updateCredit = async () => {\n setAdminUpdateLoading(true)\n\n try {\n await API.updateLease({\n ...data.lease,\n co_lessees: JSON.stringify(data.lease?.co_lessees || {}),\n })\n const msg = 'Successfully Saved Credit Form'\n createToast(msg)\n setAdminUpdateLoading(false)\n } catch (error) {\n Util.LogError('ERROR_UPDATING_CREDIT_FORM', error, {\n user: user.attributes,\n data,\n })\n const msg = 'An unknown error has occurred. Please try again.'\n createToast(msg, 'error')\n setAdminUpdateLoading(false)\n }\n }\n\n const submitNeedsInfoUpdate = async () => {\n setNeedsInfoUpdate({\n loading: true,\n response: null,\n })\n\n try {\n await API.updateLease({\n id: data.lease.id,\n ...data.lease,\n co_lessees: JSON.stringify(data.lease?.co_lessees || {}),\n status: LEASE_STATUS.LEASE_PENDING_CREDIT.status,\n })\n\n // send notification to ADD about credit resubmission\n await Lambda.sendEmail({\n IS_NOTIFICATION: true,\n TO: 'CREDIT',\n FROM: 'CREDIT',\n name: 'ADD Capital',\n clientName: data.lease.main_lessee_name,\n leaseName: data.lease.main_lessee_name,\n leaseStatus: 'has been re-submitted for credit approval by the broker',\n leaseNextSteps:\n 'View the credit application to provide feedback to the broker',\n leaseID: data.lease.id,\n })\n\n const msg = 'Successfully Re-submitted Credit Application'\n createToast(msg)\n setNeedsInfoUpdate({\n loading: false,\n response: msg,\n successful: true,\n })\n } catch (error) {\n Util.LogError('ERROR_RESUBMITTING_LEASE', error, {\n user: user.attributes,\n data,\n })\n const msg =\n 'An unknown error has occurred when re-submitting the credit application. Please try again.'\n createToast(msg, 'error')\n setNeedsInfoUpdate({\n loading: false,\n response: msg,\n })\n }\n }\n\n const generateCreditDoc = async (blankCreditDoc, docType) => {\n setCreditLogUpdate({\n loading: true,\n })\n try {\n const blankPdfBytes = await fetch(blankCreditDoc).then(res =>\n res.arrayBuffer(),\n )\n\n const pdfDoc = await PDFDocument.load(blankPdfBytes)\n\n // Get all the form fields in this document, populate from lease data\n const form = pdfDoc.getForm()\n const fields = form.getFields()\n fields.forEach(field => {\n const name = field.getName()\n if (DOLLAR_FIELDS.includes(name)) {\n field.setText(String(formatNumber(Number(data.lease[name])) || ''))\n } else {\n field.setText(String(data.lease[name] || ''))\n }\n })\n\n // Fill in broker name\n const brokerNameField = form.getFieldMaybe('broker_name')\n brokerNameField?.setText(String(data.broker.name || ''))\n\n // Fill in reference number\n const referenceNumber = form.getFieldMaybe('reference_number')\n referenceNumber?.setText(String(data.lease.reference_number || ''))\n\n // Fill in current date\n const date = moment().format('MMMM DD, YYYY')\n const dateField = form.getTextField('date')\n dateField.setText(date)\n\n // Fill in colessees\n const coLesseesString = parseCoLessees(data.lease.co_lessees)\n const coLesseesField = form.getFieldMaybe('co_lessee_names')\n coLesseesField.setText(coLesseesString)\n\n // Fill in non lease data fields\n const net =\n Number(data.lease.equipment_cost) -\n Number(data.lease.dp_final) -\n Number(data.lease.trade_in_value) +\n Number(data.lease.trade_u_value)\n\n const netField = form.getFieldMaybe('net')\n netField?.setText(String(formatNumber(net) || ''))\n\n form.flatten()\n\n // Serialize the PDFDocument to bytes (a Uint8Array)\n const pdfBytes = await pdfDoc.save()\n\n const blob = new Blob([pdfBytes], { type: 'application/pdf' })\n\n // Upload file to storage then set updated files locally\n await Storage.uploadDocument(\n `leases/${data.lease.id}/creditLog/${docType}.pdf`,\n blob,\n )\n const updatedFiles = await Storage.listDocuments(\n `leases/${data.lease.id}`,\n )\n const sortedFiles = parseLeaseFiles(updatedFiles)\n setData({\n ...data,\n files: sortedFiles,\n })\n\n if (docType === 'credit_approval_doc') {\n createToast('Successfully Generated Credit Approval Doc')\n setCreditLogUpdate({\n loading: false,\n generateApprovalDocResponse: 'Successfully Generated',\n })\n } else {\n createToast('Successfully Generated Credit Decision Doc')\n setCreditLogUpdate({\n loading: false,\n generateDecisionDocResponse: 'Successfully Generated',\n })\n }\n } catch (error) {\n Util.LogError('ERROR_GENERATING_CREDIT_DOC', error, {\n user: user.attributes,\n data,\n })\n if (docType === 'credit_approval_doc') {\n const msg = 'Failed to generate credit approval doc. Try again later.'\n createToast(msg, 'error')\n setCreditLogUpdate({\n loading: false,\n generateApprovalDocResponse: msg,\n })\n } else {\n const msg = 'Failed to generate credit decision doc. Try again later.'\n createToast(msg, 'error')\n setCreditLogUpdate({\n loading: false,\n generateDecisionDocResponse: msg,\n })\n }\n }\n }\n\n const IS_GENERAL_INFO_EDITABLE = IS_ADMIN\n ? true\n : data.lease.status === LEASE_STATUS.LEASE_NEEDS_INFO_CREDIT.status\n\n const IS_CREDIT_LOG_EDITABLE = IS_ADMIN\n ? true\n : data.lease.status === LEASE_STATUS.LEASE_NEEDS_INFO_CREDIT.status ||\n data.lease.status === LEASE_STATUS.LEASE_PENDING_CREDIT.status\n\n return (\n <>\n
    \n {!IS_ADMIN && renderCreditMessage()}\n
    \n\n {/* Main Lease Info */}\n \n
    \n
    \n {/* Lease General Info Form */}\n \n
    \n General Credit Information\n
    \n
    \n {renderForm({\n schema: 'creditGeneral',\n labelType: 'view',\n IS_ADMIN,\n IS_MOBILE,\n inputProps: {\n disabled:\n !IS_GENERAL_INFO_EDITABLE || needsInfoUpdate.successful,\n onChange: IS_GENERAL_INFO_EDITABLE\n ? onLeaseInputChange\n : undefined,\n data: data.lease,\n },\n })}\n {IS_ADMIN && (\n
    \n {adminUpdateLoading ? (\n \n ) : (\n <>\n
    \n ATTENTION: Any edits made will be saved on the broker\n side too!\n
    \n \n \n )}\n
    \n )}\n
    \n
    \n
    \n \n
    \n {IS_ADMIN ? (\n
    \n {/* Lease Credit Log */}\n \n
    Credit Log Information
    \n
    \n
    \n {renderForm({\n schema: 'creditLog',\n labelType: 'edit',\n IS_ADMIN,\n IS_MOBILE,\n inputProps: {\n disabled: !IS_CREDIT_LOG_EDITABLE,\n onChange: IS_CREDIT_LOG_EDITABLE\n ? onLeaseInputChange\n : undefined,\n data: data.lease,\n },\n })}\n
    \n {/* Only show save button when form is editable and not loading */}\n {creditLogUpdate.loading ? (\n \n ) : (\n IS_CREDIT_LOG_EDITABLE && (\n <>\n
    \n \n
    \n
    \n
    \n
    \n ATTENTION: Generated approval file will be\n visible to the broker upon credit approval\n
    \n \n generateCreditDoc(\n creditApprovalDoc,\n 'credit_approval_doc',\n )\n }\n >\n Generate Credit Approval Doc\n \n
    \n
    \n
    \n
    \n ATTENTION: Generated decision file will not be\n visible to the broker\n
    \n \n generateCreditDoc(\n creditDecisionDoc,\n 'credit_decision_doc',\n )\n }\n >\n Generate Credit Decision Doc\n \n
    \n
    \n \n )\n )}\n
    \n \n
    \n
    \n
    \n ) : (\n
    \n {/* Attached Files */}\n \n \n
    \n )}\n
    \n
    \n {IS_ADMIN && (\n
    \n {/* Attached Files */}\n \n \n
    \n )}\n
    \n {/* Admin Credit Approval */}\n {IS_ADMIN &&\n data.lease.status === LEASE_STATUS.LEASE_PENDING_CREDIT.status &&\n (didSubmitReview.credit ? (\n

    You have already reviewed this credit application.

    \n ) : (\n \n ))}\n\n {/* Lease Needs Info Feedback */}\n {data.lease.status ===\n LEASE_STATUS.LEASE_NEEDS_INFO_CREDIT.status && (\n \n )}\n\n {/* Lease Denied */}\n {data.lease.status === LEASE_STATUS.LEASE_DENIED_CREDIT.status && (\n \n )}\n
    \n
    \n \n )\n}\n\nLeaseCreditForm.propTypes = {\n data: propTypes.object,\n user: propTypes.object,\n setData: propTypes.func,\n onLeaseInputChange: propTypes.func,\n IS_ADMIN: propTypes.bool,\n didSubmitReview: propTypes.object,\n setDidSubmitReview: propTypes.func,\n}\n\nexport default LeaseCreditForm\n","import React from 'react'\nimport propTypes from 'prop-types'\nimport moment from 'moment'\nimport { ClipLoader } from 'react-spinners'\n\nimport Button from './Button'\n\nexport function ESignatureStatus({\n documentInfo,\n viewContractAuditTrail,\n viewContractCertificate,\n signReminderData,\n remindLessees,\n lease,\n}) {\n const isDocusign = documentInfo.isDocusign\n // Maps docusign role names to our internal lessee names\n const lesseeMap = {\n main_lessee: lease.main_lessee_name,\n co_lessee_1: lease.co_lessees?.co_lessee_name_1,\n co_lessee_2: lease.co_lessees?.co_lessee_name_2,\n co_lessee_3: lease.co_lessees?.co_lessee_name_3,\n }\n\n const sentDate = isDocusign\n ? new Date(documentInfo.sentDateTime).getTime() / 1000\n : documentInfo.created_time\n const docName = isDocusign\n ? documentInfo.envelopeDocuments[0].name\n : documentInfo.name\n const isCompleted = isDocusign\n ? documentInfo.status === 'completed'\n : documentInfo.status === 'complete'\n\n const recipientMarkup = (\n isDocusign ? documentInfo.recipients.signers : documentInfo.recipients\n ).map(recipient => {\n const key = isDocusign\n ? recipient.recipientIdGuid\n : recipient.email + recipient.last_modified_time\n const dateFinalized = isDocusign\n ? new Date(recipient.signedDateTime).getTime() / 1000\n : recipient.last_modified_time\n\n const docusignLesseeName = lesseeMap[recipient.roleName]\n\n return (\n
    \n
    \n Lessee\n {` - ${isDocusign ? docusignLesseeName : recipient.first_name}`}\n
    \n
    \n Email\n {` - ${recipient.email}`}\n
    \n
    \n Status\n {` - ${\n isDocusign\n ? recipient.status\n : recipient.status.split('_').join(' ')\n }`}\n
    \n {isCompleted && (\n
    \n Date Finalized\n {` - ${moment.unix(dateFinalized).format('MMMM DD, YYYY h:mm A')}`}\n
    \n )}\n
    \n )\n })\n\n return (\n
    \n
    \n Status\n {` - ${documentInfo.status}`}\n
    \n
    \n Date sent\n {` -\n ${moment.unix(sentDate).format('MMMM DD, YYYY h:mm A')}`}\n
    \n
    \n Name of Document\n {` - ${docName}`}\n
    \n {isCompleted && (\n // TODO: should this only be available to admins?\n <>\n
    \n \n
    \n {isDocusign && (\n
    \n \n
    \n )}\n \n\n )}\n
    \n Lessee Signature Status\n
    \n {recipientMarkup}\n {!isDocusign && documentInfo.status === 'incomplete' && (\n
    \n \n ATTENTION: This will send an email reminder to all lessees who have\n not yet signed.\n

    \n {signReminderData.loading ? (\n \n \n
    \n ) : (\n \n )}\n
    \n )}\n \n )\n}\n\nESignatureStatus.propTypes = {\n documentInfo: propTypes.object,\n viewContractAuditTrail: propTypes.func,\n viewContractCertificate: propTypes.func,\n signReminderData: propTypes.object,\n remindLessees: propTypes.func,\n lease: propTypes.object,\n}\n","// KEEP IN SYNC WITH - amplify/backend/function/docusignHelper/src/index.js:DOCUSIGN_ACTIONS\n\nexport const DOCUSIGN_ACTIONS = {\n USERS_LIST: 'USERS_LIST',\n GET_USER: 'GET_USER',\n CREATE_ENVELOPE: 'CREATE_ENVELOPE',\n UPDATE_ENVELOPE: 'UPDATE_ENVELOPE',\n GET_TABS: 'GET_TABS',\n UPDATE_TABS: 'UPDATE_TABS',\n GET_ENVELOPE_STATUS: 'GET_ENVELOPE_STATUS',\n LIST_AUDIT_EVENTS: 'LIST_AUDIT_EVENTS',\n DOWNLOAD_ENVELOPE_DOCUMENTS: 'DOWNLOAD_ENVELOPE_DOCUMENTS',\n}\n","import { Lambda } from '../../amplify'\nimport { DOCUSIGN_ACTIONS } from './DocusignActions'\nimport { splitMultiLineText, formatNumber, truncate } from '../helpers'\n\nconst devStagingTemplateMap = {\n 0: '89898203-a148-4a98-888d-0a4c06c9758b', // only main lessee (1_signature_contract)\n 1: '7aac13d3-47df-4bea-87fe-646feb8150ff', // main lessee + 1 co-lessee (2_signature_contract)\n 2: 'a3293688-0eb6-4709-aaf7-ec0171ebf9a3', // main lessee + 2 co-lessees (3_signature_contract)\n 3: 'a6483ce9-6943-445d-860c-e9701bdc9a7a', // main lessee + 3 co-lessees (4_signature_contract)\n}\nconst prodTemplateMap = {\n 0: 'e40931fe-56f8-4be4-863c-5bbb37a12579', // only main lessee (1_signature_contract)\n 1: 'a2ec167c-cf33-433e-9f0c-609e711c8e3a', // main lessee + 1 co-lessee (2_signature_contract)\n 2: '71aed48f-dffa-41b7-af37-fe58c8f8678d', // main lessee + 2 co-lessees (3_signature_contract)\n 3: 'cdbda91e-2ba9-4b34-ab9f-6036c44d187a', // main lessee + 3 co-lessees (4_signature_contract)\n}\n\nconst templateMap =\n process.env.GATSBY_ADD_ENV === 'production'\n ? prodTemplateMap\n : devStagingTemplateMap\n\nconst EQUIPMENT_MAX_LEN = 86\nconst SUPPLIER_MAX_LEN = 31\n\n/**\n *\n * @param {} lease - main lease object\n */\nconst generateTabData = lease => {\n const parsedCoLessees = lease.co_lessees\n const numCoLessees = Array(Object.keys(parsedCoLessees).length / 2).fill(\n 'co-lessee',\n )\n\n const coLesseeNames = numCoLessees.map((_, i) => {\n const coLesseeNumber = i + 1\n return {\n tabLabel: `co_lessee_name_${coLesseeNumber}`,\n value: parsedCoLessees[`co_lessee_name_${coLesseeNumber}`],\n }\n })\n\n let coLesseesCombined = lease.main_lessee_name\n Object.keys(lease.co_lessees).forEach(colessee => {\n if (colessee.includes('name')) {\n coLesseesCombined += ' & ' + lease.co_lessees[colessee]\n }\n })\n\n const assets = splitMultiLineText(lease.asset_description)\n const serialNumbers = splitMultiLineText(lease.serial_number, true)\n\n return [\n // Main Info\n {\n tabLabel: 'main_lessee_name',\n value: lease.main_lessee_name,\n },\n ...coLesseeNames,\n {\n tabLabel: 'main_lessee_address',\n value: lease.main_lessee_address,\n },\n {\n tabLabel: 'main_lessee_city',\n value: lease.main_lessee_city,\n },\n {\n tabLabel: 'main_lessee_province',\n value: lease.main_lessee_province,\n },\n {\n tabLabel: 'main_lessee_postal_code',\n value: lease.main_lessee_postal_code,\n },\n {\n tabLabel: 'main_lessee_phone',\n value: lease.main_lessee_phone || '',\n },\n {\n tabLabel: 'main_lessee_cell',\n value: lease.main_lessee_cell || '',\n },\n {\n tabLabel: 'main_lessee_email',\n value: lease.main_lessee_email,\n },\n {\n tabLabel: 'main_lessee_contact',\n value: lease.main_lessee_contact || '',\n },\n\n // Asset Description\n {\n tabLabel: 'asset_description_1',\n value: truncate(assets[0], EQUIPMENT_MAX_LEN),\n },\n {\n tabLabel: 'asset_description_2',\n value: truncate(assets[1], EQUIPMENT_MAX_LEN),\n },\n {\n tabLabel: 'asset_description_3',\n value: truncate(assets[2], EQUIPMENT_MAX_LEN),\n },\n {\n tabLabel: 'serial_number_1',\n value: serialNumbers[0] || '',\n },\n {\n tabLabel: 'serial_number_2',\n value: serialNumbers[1] || '',\n },\n {\n tabLabel: 'serial_number_3',\n value: serialNumbers[2] || '',\n },\n {\n tabLabel: 'equipment_location',\n value: lease.equipment_location || '',\n },\n\n // Other Info\n {\n tabLabel: 'sales_rep',\n value: lease.sales_rep || '',\n },\n {\n tabLabel: 'vendor_phone_number',\n value: lease.vendor_phone_number || '',\n },\n\n // Payment Terms 1\n {\n tabLabel: 'term_okd',\n value: String(lease.term_okd || ''),\n },\n {\n tabLabel: 'number_of_payments_1',\n value: String(lease.number_of_payments_1 || ''),\n },\n {\n tabLabel: 'rental_amount_1',\n value: lease.rental_amount_1\n ? `$${formatNumber(lease.rental_amount_1)}`\n : '',\n },\n {\n tabLabel: 'other_1',\n value: 'N/A',\n },\n {\n tabLabel: 'pst_1',\n value: `${\n String(lease.pst_1).toLowerCase() === 'n/a'\n ? 'N/A'\n : lease.pst_1\n ? `$${formatNumber(lease.pst_1)}`\n : ''\n }`,\n },\n {\n tabLabel: 'gst_1',\n value: lease.gst_1 ? `$${formatNumber(lease.gst_1)}` : '',\n },\n {\n tabLabel: 'total_1',\n value: lease.total_1 ? `$${formatNumber(lease.total_1)}` : '',\n },\n\n // Payment Terms 2\n {\n tabLabel: 'monthly',\n value: 'X',\n },\n {\n tabLabel: 'number_of_payments_2',\n value: String(lease.number_of_payments_2 || ''),\n },\n {\n tabLabel: 'rental_amount_2',\n value: lease.rental_amount_2\n ? `$${formatNumber(lease.rental_amount_2)}`\n : '',\n },\n {\n tabLabel: 'other_2',\n value: 'N/A',\n },\n {\n tabLabel: 'pst_2',\n value: `${\n String(lease.pst_2).toLowerCase() === 'n/a'\n ? 'N/A'\n : lease.pst_2\n ? `$${formatNumber(lease.pst_2)}`\n : ''\n }`,\n },\n {\n tabLabel: 'gst_2',\n value: lease.gst_2 ? `$${formatNumber(lease.gst_2)}` : '',\n },\n {\n tabLabel: 'total_2',\n value: lease.total_2 ? `$${formatNumber(lease.total_2)}` : '',\n },\n\n // Commencement and purchase option docs\n {\n tabLabel: 'co_lessees_combined',\n value: coLesseesCombined,\n },\n {\n tabLabel: 'asset_serial_combined_1',\n value: `${assets[0] || ''} ${serialNumbers[0] || ''}`,\n },\n {\n tabLabel: 'asset_serial_combined_2',\n value: `${assets[1] || ''} ${serialNumbers[1] || ''}`,\n },\n {\n tabLabel: 'asset_serial_combined_3',\n value: `${assets[2] || ''} ${serialNumbers[2] || ''}`,\n },\n {\n tabLabel: 'vendor',\n value: truncate(lease.vendor, SUPPLIER_MAX_LEN),\n },\n {\n tabLabel: 'purchase_option_month',\n value: String(lease.purchase_option_month || ''),\n },\n {\n tabLabel: 'purchase_option_price',\n value: `$${formatNumber(lease.purchase_price)} + taxes`,\n },\n {\n tabLabel: 'commencement_date',\n value: lease.commencement_date || '',\n },\n ]\n}\n\nconst addLeaseDataToDocusignTabs = (leaseFieldValues, docusignTabs) => {\n const newPopulatedTabs = docusignTabs.map(tab => {\n const correspondingLeaseField = leaseFieldValues.find(\n leaseField => leaseField.tabLabel === tab.tabLabel,\n )\n\n return {\n tabId: tab.tabId,\n value: correspondingLeaseField?.value,\n }\n })\n\n return newPopulatedTabs\n}\n\nconst populateDraftEnvelope = async (lease, envelopeId) => {\n // Generate json tab data from lease data for envelope\n const populatedLeaseFields = generateTabData(lease)\n\n // Pull all the tab data from draft envelope\n const getTabsResponse = await Lambda.docusign({\n action: DOCUSIGN_ACTIONS.GET_TABS,\n data: {\n envelopeId,\n documentId: 1,\n },\n })\n\n if (getTabsResponse.error) {\n throw new Error(getTabsResponse.message)\n }\n\n const docusignTabs = getTabsResponse.data.prefillTabs.textTabs\n\n // Insert lease field values into docusign tabs\n const newTabData = addLeaseDataToDocusignTabs(\n populatedLeaseFields,\n docusignTabs,\n )\n\n // update tab values by id\n const updateTabsResponse = await Lambda.docusign({\n action: DOCUSIGN_ACTIONS.UPDATE_TABS,\n data: {\n envelopeId,\n documentId: 1,\n tabs: {\n prefillTabs: {\n textTabs: newTabData,\n },\n },\n },\n })\n\n if (updateTabsResponse.error) {\n throw new Error(updateTabsResponse.message)\n }\n}\n\nconst createDraftEnvelope = async lease => {\n const parsedCoLessees = lease.co_lessees\n const numCoLessees = Array(Object.keys(parsedCoLessees).length / 2).fill(\n 'co-lessee',\n )\n\n const contractData = {\n templateId: templateMap[numCoLessees.length],\n templateRoles: [\n // main lessee\n {\n email: lease.main_lessee_email,\n name: lease.main_lessee_name,\n roleName: 'main_lessee',\n emailNotification: {\n emailSubject: `ADD Capital Contract Package - ${lease.main_lessee_name}`,\n },\n },\n // co-lessees\n ...numCoLessees.map((_, i) => {\n const coLesseeNumber = i + 1\n const coLesseeName = parsedCoLessees[`co_lessee_name_${coLesseeNumber}`]\n return {\n email: parsedCoLessees[`co_lessee_email_${coLesseeNumber}`],\n name: coLesseeName,\n roleName: `co_lessee_${coLesseeNumber}`,\n emailNotification: {\n emailSubject: `ADD Capital Contract Package - ${coLesseeName}`,\n },\n }\n }),\n ],\n status: 'created',\n }\n\n // Create draft envelope\n const createEnvelopeResponse = await Lambda.docusign({\n action: DOCUSIGN_ACTIONS.CREATE_ENVELOPE,\n data: contractData,\n })\n\n if (createEnvelopeResponse.error) {\n throw new Error(createEnvelopeResponse.message)\n }\n\n return createEnvelopeResponse.data\n}\n\nconst sendDraftEnvelope = async envelopeId => {\n // sennnnnd it\n const sendEnvelopeResponse = await Lambda.docusign({\n action: DOCUSIGN_ACTIONS.UPDATE_ENVELOPE,\n data: {\n envelopeId,\n status: 'sent',\n },\n })\n\n if (sendEnvelopeResponse.error) {\n throw new Error(sendEnvelopeResponse.message)\n }\n\n return sendEnvelopeResponse.data\n}\n\nexport const buildAndSendEnvelope = async lease => {\n // should hoist envelopeId so if any of the chained requests fail we can still save the envelopeId\n\n const draftEnvelopeData = await createDraftEnvelope(lease)\n\n await populateDraftEnvelope(lease, draftEnvelopeData.envelopeId)\n\n const sentEnvelopeData = await sendDraftEnvelope(draftEnvelopeData.envelopeId)\n\n return sentEnvelopeData\n}\n","import React, { useState, useEffect } from 'react'\nimport propTypes from 'prop-types'\nimport { ClipLoader } from 'react-spinners'\nimport { PDFDocument } from 'pdf-lib'\n\nimport { API, Storage, Lambda, Util } from '../amplify'\nimport { renderForm, SignEasy, parseLeaseFiles } from '../util'\nimport { CURRENCY_ACTIONS, CURRENCY_BROKER_ID } from '../util/currency/constants'\nimport {\n splitMultiLineText,\n formatNumber,\n isMobile,\n isUUID,\n getFieldSetTextMaybe,\n} from '../util/helpers'\nimport {\n createToast,\n createModal,\n formatDocusignAuditData,\n} from '../util/reactHelpers'\nimport * as LEASE_STATUS from '../data/leaseStatus'\nimport contractPackage1 from '../assets/pdf/contract-package-1.pdf'\nimport contractPackage2 from '../assets/pdf/contract-package-2.pdf'\nimport contractPackage3 from '../assets/pdf/contract-package-3.pdf'\nimport contractPackage4 from '../assets/pdf/contract-package-4.pdf'\nimport insuranceDoc from '../assets/pdf/insurance-doc.pdf'\n\nimport Button from './Button'\nimport LeaseMainInfo from './LeaseMainInfo'\nimport LeaseFiles from './LeaseFiles'\nimport LeaseAdminReview from './LeaseAdminReview'\nimport LeaseNeedsInfo from './LeaseNeedsInfo'\nimport FileUpload from './FileUpload'\nimport { ESignatureStatus } from './ESignatureStatus'\nimport { buildAndSendEnvelope } from '../util/docusign/BuildAndSendEnvelope'\nimport { DOCUSIGN_ACTIONS } from '../util/docusign/DocusignActions'\n\nconst LeaseContractForm = ({\n data,\n setData,\n user,\n onLeaseInputChange,\n IS_ADMIN,\n didSubmitReview,\n setDidSubmitReview,\n}) => {\n const DOCUMENT_SENT =\n (data.lease.status === LEASE_STATUS.LEASE_APPROVED_CONTRACT.status ||\n data.lease.status === LEASE_STATUS.LEASE_COMPLETE.status) &&\n data.lease.contract_document_id\n\n const DOCUMENT_ACTIONS =\n data.lease.status === LEASE_STATUS.LEASE_APPROVED_CONTRACT.status &&\n !data.lease.contract_document_id\n\n const ON_SIGNATURE_DECISION =\n !data.lease.contract_document_id &&\n !data.lease.assuming_contract_responsibility\n\n const IS_CONTRACT_EDITABLE = IS_ADMIN\n ? true\n : data.lease.status === LEASE_STATUS.LEASE_APPROVED_CREDIT.status ||\n data.lease.status === LEASE_STATUS.LEASE_NEEDS_INFO_CONTRACT.status ||\n (data.lease.status === LEASE_STATUS.LEASE_APPROVED_CONTRACT.status &&\n ON_SIGNATURE_DECISION)\n\n const CONTRACT_NAME = 'ADD Capital Contract Package'\n\n const DOLLAR_FIELDS = [\n 'rental_amount_1',\n 'rental_amount_2',\n 'pst_1',\n 'pst_2',\n 'gst_1',\n 'gst_2',\n 'total_1',\n 'total_2',\n 'vendor_invoice',\n ]\n\n // This is for the preview PDF doc (some fields we dont want to shrink)\n const USE_REGULAR_FONT_SIZE_FIELDS = [\n 'commencement_date',\n 'purchase_option_month',\n 'purchase_option_price',\n ]\n\n useEffect(() => {\n if (DOCUMENT_SENT) {\n // is docusign document\n if (isUUID(data.lease.contract_document_id)) {\n Lambda.docusign({\n action: DOCUSIGN_ACTIONS.GET_ENVELOPE_STATUS,\n data: { envelopeId: data.lease.contract_document_id },\n })\n .then(({ data: documentInfo }) => {\n setDocumentInfo({ ...documentInfo, isDocusign: true })\n })\n .catch(error => {\n Util.LogError(\n 'ERROR_FETCHING_DOCUSIGN_DOCUMENT',\n error,\n data.lease.contract_document_id,\n )\n })\n } else {\n SignEasy.getPendingDocumentStatus(data.lease.contract_document_id)\n .then(({ data: documentInfo }) => {\n setDocumentInfo({ ...documentInfo, isDocusign: false })\n })\n .catch(error => {\n Util.LogError(\n 'ERROR_FETCHING_SIGN_EASY_DOCUMENT',\n error,\n data.lease.contract_document_id,\n )\n })\n }\n }\n }, [data.lease.contract_document_id])\n\n const [documentInfo, setDocumentInfo] = useState(null)\n const [contractInfo, setContractInfo] = useState({\n loading: false,\n response: null,\n successful: false,\n })\n const [needsInfoUpdate, setNeedsInfoUpdate] = useState({\n loading: false,\n response: null,\n successful: false,\n })\n const [adminContractReview, setAdminContractReview] = useState({\n status: null,\n feedback: null,\n loading: false,\n response: null,\n successful: false,\n })\n const [signReminderData, setSignReminderData] = useState({\n loading: false,\n response: null,\n })\n const [updateContractLoading, setUpdateContractLoading] = useState(false)\n const [documentActions, setDocumentActions] = useState({\n loading: false,\n successful: false,\n })\n const [saveAndPreviewLoading, setSaveAndPreviewLoading] = useState(false)\n const [contractComplete, setContractComplete] = useState({\n loading: false,\n successful: false,\n })\n\n const [modalData, setModalData] = useState({\n isOpen: false,\n title: '',\n description: '',\n submitText: '',\n submitHandler: () => {},\n })\n\n const IS_MOBILE = isMobile('sm')\n\n useEffect(() => {\n // add completed e signature document to S3\n if (documentInfo?.isDocusign) {\n if (\n documentInfo?.status === 'completed' &&\n data.lease.contract_document_id\n ) {\n // only upload the completed contract if it is not already there\n if (\n !data.files.generatedContract.filter(file =>\n file.key.includes(`${CONTRACT_NAME}.pdf`),\n ).length\n ) {\n uploadCompletedDocusignDocument()\n }\n }\n } else {\n if (\n documentInfo?.status === 'complete' &&\n data.lease.contract_document_id\n ) {\n // only upload the completed contract if it is not already there\n if (\n !data.files.generatedContract.filter(file =>\n file.key.includes(`${CONTRACT_NAME}.pdf`),\n ).length\n ) {\n uploadCompletedSignEasyDocument()\n }\n }\n }\n }, [documentInfo])\n\n const submitAdminReview = async e => {\n e.preventDefault()\n\n let status\n let notificationStatus\n\n switch (adminContractReview.status) {\n case LEASE_STATUS.APPROVE_CONTRACT:\n status = LEASE_STATUS.LEASE_APPROVED_CONTRACT.status\n notificationStatus = 'has had the contract approved by ADD Capital'\n break\n\n case LEASE_STATUS.NEEDS_INFO_CONTRACT:\n status = LEASE_STATUS.LEASE_NEEDS_INFO_CONTRACT.status\n notificationStatus = 'needs more contract information'\n break\n\n default:\n break\n }\n\n try {\n setAdminContractReview({\n ...adminContractReview,\n loading: true,\n })\n\n await API.updateLease({\n id: data.lease.id,\n status,\n admin_contract_feedback: adminContractReview.feedback,\n })\n\n // send notification to broker\n await Lambda.sendEmail({\n IS_NOTIFICATION: true,\n TO: data.broker.email,\n FROM: 'CONTRACT',\n name: data.broker.name,\n clientName: data.lease.main_lessee_name,\n leaseName: data.lease.main_lessee_name,\n leaseStatus: notificationStatus,\n leaseNextSteps: 'View the contract application to see any feedback',\n leaseID: data.lease.id,\n })\n\n // so admin cannot flip tabs and re-review again\n setDidSubmitReview({\n credit: false,\n contract: true,\n })\n const msg = 'Successfully Reviewed Contract Application'\n createToast(msg)\n setAdminContractReview({\n ...adminContractReview,\n loading: false,\n response: msg,\n successful: true,\n })\n } catch (error) {\n Util.LogError('ERROR_ADMIN_CONTRACT_RESPONSE', error, {\n user: user.attributes,\n data,\n })\n const msg =\n 'An unknown error has occurred when submitting the response. Please try again.'\n createToast(msg, 'error')\n setAdminContractReview({\n ...adminContractReview,\n loading: false,\n response: msg,\n })\n }\n }\n\n const submitNeedsInfoUpdate = async () => {\n setNeedsInfoUpdate({\n loading: true,\n response: null,\n })\n\n try {\n await API.updateLease({\n ...data.lease,\n co_lessees: JSON.stringify(data.lease?.co_lessees || {}),\n status: LEASE_STATUS.LEASE_PENDING_CONTRACT.status,\n })\n\n // send notification to ADD about contract resubmission\n await Lambda.sendEmail({\n IS_NOTIFICATION: true,\n TO: 'CONTRACT',\n FROM: 'CONTRACT',\n name: 'ADD Capital',\n clientName: data.lease.main_lessee_name,\n leaseName: data.lease.main_lessee_name,\n leaseStatus:\n 'has been re-submitted for contract approval by the broker',\n leaseNextSteps:\n 'View the contract application to provide feedback to the broker',\n leaseID: data.lease.id,\n })\n\n const msg = 'Successfully Re-submitted Contract Info'\n createToast(msg)\n setNeedsInfoUpdate({\n loading: false,\n response: msg,\n successful: true,\n })\n } catch (error) {\n Util.LogError('ERROR_RESUBMITTING_LEASE', error, {\n user: user.attributes,\n data,\n })\n const msg =\n 'An unknown error has occurred when re-submitting the contract info. Please try again.'\n createToast(msg, 'error')\n setNeedsInfoUpdate({\n loading: false,\n response: msg,\n })\n }\n }\n\n const submitContract = async approvalType => {\n setContractInfo({\n loading: true,\n response: null,\n })\n\n try {\n let status\n let msg\n if (approvalType === 'WITH') {\n status = LEASE_STATUS.LEASE_PENDING_CONTRACT.status\n msg = 'Successfully Submitted Contract Info For Review'\n } else if (approvalType === 'WITHOUT') {\n status = LEASE_STATUS.LEASE_APPROVED_CONTRACT.status\n msg = 'Successfully Submitted Contract Info Without Approval'\n }\n\n // close confirmation modal\n setModalData({\n isOpen: false,\n title: '',\n description: '',\n submitText: '',\n submitHandler: () => {},\n })\n\n const updatedLease = await API.updateLease({\n ...data.lease,\n co_lessees: JSON.stringify(data.lease?.co_lessees || {}),\n status,\n })\n\n // set new lease data in local state to move to next step\n setData({\n ...data,\n lease: updatedLease.data.updateLease,\n })\n\n // send notification after update succeeds\n // broker wants approval from ADD\n if (approvalType === 'WITH') {\n await Lambda.sendEmail({\n IS_NOTIFICATION: true,\n TO: 'CONTRACT',\n FROM: 'CONTRACT',\n name: 'ADD Capital',\n clientName: data.lease.main_lessee_name,\n leaseName: data.lease.main_lessee_name,\n leaseStatus: 'has been submitted for contract approval by the broker',\n leaseNextSteps:\n 'View the contract application to provide feedback to the broker',\n leaseID: data.lease.id,\n })\n }\n\n createToast(msg)\n setContractInfo({\n loading: false,\n response: msg,\n successful: true,\n })\n } catch (error) {\n Util.LogError('ERROR_SUBMITTING_CONTRACT', error, {\n user: user.attributes,\n data,\n })\n createToast('Error submitting contract info. Please try again.', 'error')\n setContractInfo({\n loading: false,\n successful: false,\n })\n }\n }\n\n const updateContract = async () => {\n setUpdateContractLoading(true)\n\n try {\n await API.updateLease({\n ...data.lease,\n co_lessees: JSON.stringify(data.lease?.co_lessees || {}),\n })\n\n const msg = 'Successfully Saved Contract Information'\n createToast(msg)\n setUpdateContractLoading(false)\n } catch (error) {\n Util.LogError('ERROR_UPDATING_CONTRACT', error, {\n user: user.attributes,\n data,\n })\n createToast('Error updating contract info. Please try again.', 'error')\n setUpdateContractLoading(false)\n }\n }\n\n const completeLease = async () => {\n const status = LEASE_STATUS.LEASE_COMPLETE.status\n setContractComplete({\n loading: true,\n })\n try {\n await API.updateLease({\n ...data.lease,\n co_lessees: JSON.stringify(data.lease?.co_lessees || {}),\n status,\n })\n\n // Update currency application\n const isFromCurrency = data.broker.id === CURRENCY_BROKER_ID\n\n if (isFromCurrency) {\n await Lambda.currency({\n action: CURRENCY_ACTIONS.UPDATE_APPLICATION,\n data: {\n applicationID: data.lease.currency_application_id,\n status: LEASE_STATUS.LEASE_COMPLETE.status,\n approvedAmount: data.lease.equipment_cost,\n approvedTerm: data.lease.term_okd,\n },\n })\n }\n\n setContractComplete({\n loading: false,\n successful: true,\n })\n createToast(\n \"Success! Lease has been moved to the 'Lease Complete' category\",\n )\n } catch (error) {\n Util.LogError('ERROR_UPDATING_STATUS_TO_LEASE_COMPLETE', error, {\n user: user.attributes,\n data,\n })\n setContractComplete({\n loading: false,\n successful: false,\n })\n createToast(\n 'Error updating lease status to complete. Please try again.',\n 'error',\n )\n }\n }\n\n const renderContractMessage = () => {\n let message\n\n switch (data.lease.status) {\n case LEASE_STATUS.LEASE_APPROVED_CREDIT.status:\n message = (\n
    Terms are subject to the credit conditions indicated below:
    \n )\n break\n\n case LEASE_STATUS.LEASE_APPROVED_CONTRACT.status:\n message =
    Your contract information has been approved!
    \n break\n\n case LEASE_STATUS.LEASE_NEEDS_INFO_CONTRACT.status:\n message = (\n
    \n After submitting the contract information for review, we have\n determined there is still some information needed. Please see the\n feedback.\n
    \n )\n break\n\n case LEASE_STATUS.LEASE_PENDING_CONTRACT.status:\n message = (\n
    \n Your contract submission is being reviewed. Thank you for your\n patience.\n
    \n )\n break\n\n case LEASE_STATUS.LEASE_COMPLETE.status:\n message = (\n
    \n This lease has been marked as complete by an admin. You may not make\n any further changes.\n
    \n )\n break\n\n default:\n message = (\n
    \n The submitted application is not yet in the Contract Review Stage.\n Please check back soon.\n
    \n )\n break\n }\n\n return message\n }\n\n const generateESignatureRequest = async () => {\n setDocumentActions({\n loading: true,\n successful: false,\n })\n\n try {\n // close confirmation modal\n setModalData({\n isOpen: false,\n title: '',\n description: '',\n submitText: '',\n submitHandler: () => {},\n })\n\n // remove any old ADD contracts before requesting sign easy\n await Storage.deleteDocument(\n `leases/${data.lease.id}/generatedContract/${CONTRACT_NAME}.pdf`,\n )\n\n const envelopeData = await createDocusignEnvelope()\n if (!envelopeData?.envelopeId) return\n\n const updatedLease = await API.updateLease({\n id: data.lease.id,\n contract_document_id: envelopeData.envelopeId,\n })\n\n // set new lease data in local state to move to next step reactively\n setData({\n ...data,\n lease: updatedLease.data.updateLease,\n files: {\n ...data.files,\n generatedContract: data.files.generatedContract.filter(\n file => !file.key.includes(CONTRACT_NAME),\n ),\n },\n })\n\n createToast('Successfully sent contract out for signatures.')\n setDocumentActions({\n loading: false,\n successful: true,\n })\n } catch (error) {\n createToast(\n 'Something went wrong while sending the contract. Please try again.',\n 'error',\n )\n setDocumentActions({\n loading: false,\n successful: false,\n })\n }\n }\n\n const noSignatureContractHandler = async () => {\n setDocumentActions({\n loading: true,\n successful: false,\n })\n\n try {\n // close confirmation modal\n setModalData({\n isOpen: false,\n title: '',\n description: '',\n submitText: '',\n submitHandler: () => {},\n })\n\n const numCoLessees = Object.keys(data.lease.co_lessees).length / 2\n let contractBlob\n if (numCoLessees === 0) {\n contractBlob = await generateNoSignatureContract(contractPackage1)\n } else if (numCoLessees === 1) {\n contractBlob = await generateNoSignatureContract(contractPackage2)\n } else if (numCoLessees === 2) {\n contractBlob = await generateNoSignatureContract(contractPackage3)\n } else {\n contractBlob = await generateNoSignatureContract(contractPackage4)\n }\n\n // Upload file to storage then set updated files locally\n await Storage.uploadDocument(\n `leases/${data.lease.id}/generatedContract/${CONTRACT_NAME}.pdf`,\n contractBlob,\n )\n const updatedFiles = await Storage.listDocuments(\n `leases/${data.lease.id}`,\n )\n const sortedFiles = parseLeaseFiles(updatedFiles)\n\n // update lease to indicate broker is handling the contract, not sign easy\n const updatedLease = await API.updateLease({\n id: data.lease.id,\n assuming_contract_responsibility: true,\n })\n // set new data in local state to move to next step reactively\n setData({\n ...data,\n lease: updatedLease.data.updateLease,\n files: sortedFiles,\n })\n\n createToast(\n 'Successfully Generated Lease Contract. You may now view/download the contract.',\n )\n setDocumentActions({\n loading: false,\n successful: true,\n })\n } catch (error) {\n createToast(\n 'Error creating the lease contract. Please try again.',\n 'error',\n )\n Util.LogError('ERROR_GENERATING_NO_SIGNATURE_LEASE_CONTRACT', error, {\n user: user.attributes,\n data,\n })\n setDocumentActions({\n loading: false,\n successful: false,\n })\n }\n }\n\n /**\n *\n * @return {FileBlob} Returns No-Sig Generated Lease Contract file blob\n */\n const generateNoSignatureContract = async (\n blankContractDoc,\n isInsuranceDoc,\n ) => {\n const blankPdfBytes = await fetch(blankContractDoc).then(res =>\n res.arrayBuffer(),\n )\n const pdfDoc = await PDFDocument.load(blankPdfBytes)\n\n const form = pdfDoc.getForm()\n const fields = form.getFields()\n const shouldUseDocusignFonts = !isInsuranceDoc\n\n // extend form class\n form.getFieldSetTextMaybe = getFieldSetTextMaybe\n\n // set all fields directly from lease data\n fields.forEach(field => {\n const name = field.getName()\n if (DOLLAR_FIELDS.includes(name)) {\n field.setText(\n String(\n !data.lease[name] || data.lease[name] === 'false'\n ? ''\n : String(data.lease[name]).toLowerCase() === 'n/a'\n ? 'N/A'\n : `$${formatNumber(data.lease[name])}`,\n ),\n )\n } else {\n field.setText(\n String(\n !data.lease[name] || data.lease[name] === 'false'\n ? ''\n : String(data.lease[name]).toLowerCase() === 'n/a'\n ? 'N/A'\n : data.lease[name],\n ),\n )\n }\n\n if (\n shouldUseDocusignFonts &&\n !USE_REGULAR_FONT_SIZE_FIELDS.includes(name)\n ) {\n field.setFontSize(8)\n }\n })\n\n // set co-lessees\n Object.keys(data.lease.co_lessees).forEach(colessee => {\n if (colessee.includes('name')) {\n form.getFieldSetTextMaybe(\n colessee,\n data.lease.co_lessees[colessee],\n shouldUseDocusignFonts,\n )\n }\n })\n\n // set co-lessees combined for purchase option and insurance docs\n let coLesseesCombined = data.lease.main_lessee_name\n Object.keys(data.lease.co_lessees).forEach(colessee => {\n if (colessee.includes('name')) {\n coLesseesCombined += ' & ' + data.lease.co_lessees[colessee]\n }\n })\n\n form.getFieldSetTextMaybe(\n 'co_lessees_combined',\n coLesseesCombined,\n shouldUseDocusignFonts,\n )\n if (isInsuranceDoc) {\n form.getFieldMaybe('co_lessees_combined').setFontSize(8)\n }\n\n // set assets and serial numbers\n const assets = splitMultiLineText(data.lease.asset_description)\n const serialNumbers = splitMultiLineText(data.lease.serial_number, true)\n\n form.getFieldSetTextMaybe(\n 'asset_description_1',\n assets[0],\n shouldUseDocusignFonts,\n )\n form.getFieldSetTextMaybe(\n 'asset_description_2',\n assets[1],\n shouldUseDocusignFonts,\n )\n form.getFieldSetTextMaybe(\n 'asset_description_3',\n assets[2],\n shouldUseDocusignFonts,\n )\n form.getFieldSetTextMaybe(\n 'serial_number_1',\n serialNumbers[0],\n shouldUseDocusignFonts,\n )\n form.getFieldSetTextMaybe(\n 'serial_number_2',\n serialNumbers[1],\n shouldUseDocusignFonts,\n )\n form.getFieldSetTextMaybe(\n 'serial_number_3',\n serialNumbers[2],\n shouldUseDocusignFonts,\n )\n\n // set purchase option and insurance doc asset descriptions\n form.getFieldSetTextMaybe(\n 'asset_serial_combined_1',\n `${assets[0] || ''} ${serialNumbers[0] || ''}`,\n shouldUseDocusignFonts,\n )\n form.getFieldSetTextMaybe(\n 'asset_serial_combined_2',\n `${assets[1] || ''} ${serialNumbers[1] || ''}`,\n shouldUseDocusignFonts,\n )\n form.getFieldSetTextMaybe(\n 'asset_serial_combined_3',\n `${assets[2] || ''} ${serialNumbers[2] || ''}`,\n shouldUseDocusignFonts,\n )\n\n // set monthly field\n form.getFieldSetTextMaybe('monthly', 'X', shouldUseDocusignFonts)\n\n // set 'other' fields as NA every time\n form.getFieldSetTextMaybe('other_1', 'N/A', shouldUseDocusignFonts)\n form.getFieldSetTextMaybe('other_2', 'N/A', shouldUseDocusignFonts)\n\n // set purchase price with tax\n form.getFieldSetTextMaybe(\n 'purchase_option_price',\n `$${formatNumber(data.lease.purchase_price) || ''} + taxes`,\n )\n\n // set insurance value field\n const insuranceValue =\n Number(data.lease.number_of_payments_1) *\n Number(data.lease.rental_amount_1) +\n Number(data.lease.number_of_payments_2) *\n Number(data.lease.rental_amount_2)\n\n form.getFieldSetTextMaybe(\n 'insurance_value',\n String(formatNumber(insuranceValue)),\n shouldUseDocusignFonts,\n )\n\n form.flatten()\n\n // update titles\n if (isInsuranceDoc) {\n pdfDoc.setTitle('Insurance Doc')\n } else {\n pdfDoc.setTitle('ADD Capital Contract Package')\n }\n\n const pdfBytes = await pdfDoc.save()\n return new Blob([pdfBytes], { type: 'application/pdf' })\n }\n\n const createDocusignEnvelope = async () => {\n try {\n const envelopeResult = await buildAndSendEnvelope(data.lease)\n return envelopeResult\n } catch (error) {\n Util.LogError('ERROR_CREATING_DOCUSIGN_DOCUMENT', error, data.lease)\n createToast('Error Generating E-Document. Please try again.', 'error')\n }\n }\n\n const uploadCompletedDocusignDocument = async () => {\n try {\n const { data: pdf } = await Lambda.docusign({\n action: DOCUSIGN_ACTIONS.DOWNLOAD_ENVELOPE_DOCUMENTS,\n data: {\n envelopeId: data.lease.contract_document_id,\n docType: 'combined', // 'combined' for contract, 'certificate' for cert\n },\n })\n\n const fileBlob = new Blob([new Uint8Array(pdf.data).buffer], {\n type: 'application/pdf',\n })\n\n // Upload file to storage then set updated files locally\n await Storage.uploadDocument(\n `leases/${data.lease.id}/generatedContract/${CONTRACT_NAME}.pdf`,\n fileBlob,\n )\n const updatedFiles = await Storage.listDocuments(\n `leases/${data.lease.id}`,\n )\n setData({\n ...data,\n files: parseLeaseFiles(updatedFiles),\n })\n } catch (error) {\n Util.LogError('ERROR_FETCHING/DOWNLOADING_SIGNED_E-DOCUMENT', error, {\n docInfo: documentInfo,\n data,\n })\n createToast('Error fetching signed document. Please try again.', 'error')\n }\n }\n\n const uploadCompletedSignEasyDocument = async () => {\n try {\n const signedFile = (\n await SignEasy.getSignedDocumentStatus(documentInfo.id)\n ).data\n const rawFile = (await SignEasy.downloadDocument(signedFile.id)).data\n const fileBlob = new Blob([rawFile], { type: 'application/pdf' })\n\n // Upload file to storage then set updated files locally\n await Storage.uploadDocument(\n `leases/${data.lease.id}/generatedContract/${CONTRACT_NAME}.pdf`,\n fileBlob,\n )\n const updatedFiles = await Storage.listDocuments(\n `leases/${data.lease.id}`,\n )\n setData({\n ...data,\n files: parseLeaseFiles(updatedFiles),\n })\n } catch (error) {\n Util.LogError('ERROR_FETCHING/DOWNLOADING_SIGNED_E-DOCUMENT', error, {\n docInfo: documentInfo,\n data,\n })\n createToast('Error fetching signed document. Please try again.', 'error')\n }\n }\n\n const viewContractAuditTrail = async () => {\n try {\n if (documentInfo.isDocusign) {\n const { data: auditEvents } = await Lambda.docusign({\n action: DOCUSIGN_ACTIONS.LIST_AUDIT_EVENTS,\n data: { envelopeId: data.lease.contract_document_id },\n })\n\n setModalData({\n isOpen: true,\n title: 'Audit Events for E-Signature Document',\n description: formatDocusignAuditData(auditEvents),\n submitText: null,\n contentLabel: 'E-Signature Document Audit Events',\n noMarginTop: true,\n isNode: true,\n })\n } else {\n const signedFile = (\n await SignEasy.getSignedDocumentStatus(documentInfo.id)\n ).data\n const rawFile = (await SignEasy.downloadAuditTrail(signedFile.id)).data\n const fileBlob = new Blob([rawFile], { type: 'application/pdf' })\n const fileURL = URL.createObjectURL(fileBlob)\n window.open(fileURL, '_blank')\n }\n } catch (error) {\n Util.LogError(\n 'ERROR_FETCHING/DOWNLOADING_SIGNED_E-DOCUMENT_AUDIT_TRAIL',\n error,\n documentInfo,\n )\n createToast(\n 'Error Fetching Signed Document Audit Trail. Please try again.',\n 'error',\n )\n }\n }\n\n const viewContractCertificate = async () => {\n try {\n const { data: pdf } = await Lambda.docusign({\n action: DOCUSIGN_ACTIONS.DOWNLOAD_ENVELOPE_DOCUMENTS,\n data: {\n envelopeId: data.lease.contract_document_id,\n docType: 'certificate',\n },\n })\n const fileBlob = new Blob([new Uint8Array(pdf.data).buffer], {\n type: 'application/pdf',\n })\n const fileURL = URL.createObjectURL(fileBlob)\n window.open(fileURL, '_blank')\n } catch (error) {\n Util.LogError(\n 'ERROR_FETCHING/DOWNLOADING_SIGNED_E-DOCUMENT_CERT',\n error,\n documentInfo,\n )\n createToast(\n 'Error Fetching Signed Document Certificate. Please try again.',\n 'error',\n )\n }\n }\n\n const remindLessees = async () => {\n try {\n setSignReminderData({ ...signReminderData, loading: true })\n await SignEasy.remindSigners(documentInfo.id)\n const msg = 'Successfully reminded Lessees.'\n createToast(msg)\n setSignReminderData({\n ...signReminderData,\n loading: false,\n response: msg,\n })\n } catch (error) {\n const msg = 'An unknown error occurred. Please try again.'\n createToast(error.response?.data?.message || msg, 'error')\n setSignReminderData({\n ...signReminderData,\n loading: false,\n response: msg,\n })\n Util.LogError('ERROR_SENDING_E-DOCUMENT_REMINDER', error, documentInfo)\n }\n }\n\n const saveAndGenerateContract = async () => {\n setSaveAndPreviewLoading(true)\n\n try {\n await API.updateLease({\n ...data.lease,\n co_lessees: JSON.stringify(data.lease?.co_lessees || {}),\n })\n\n const numCoLessees = Object.keys(data.lease.co_lessees).length / 2\n let contractBlob\n if (numCoLessees === 0) {\n contractBlob = await generateNoSignatureContract(contractPackage1)\n } else if (numCoLessees === 1) {\n contractBlob = await generateNoSignatureContract(contractPackage2)\n } else if (numCoLessees === 2) {\n contractBlob = await generateNoSignatureContract(contractPackage3)\n } else {\n contractBlob = await generateNoSignatureContract(contractPackage4)\n }\n const insuranceDocBlob = await generateNoSignatureContract(\n insuranceDoc,\n true,\n )\n\n // Upload contract package blob to storage\n await Storage.uploadDocument(\n `leases/${data.lease.id}/generatedContract/${CONTRACT_NAME}.pdf`,\n contractBlob,\n )\n // Upload insurance doc blob to storage\n await Storage.uploadDocument(\n `leases/${data.lease.id}/generatedContract/Insurance Doc.pdf`,\n insuranceDocBlob,\n )\n\n // set updated files locally\n const updatedFiles = await Storage.listDocuments(\n `leases/${data.lease.id}`,\n )\n const sortedFiles = parseLeaseFiles(updatedFiles)\n\n // add updated file to contract files\n setData({\n ...data,\n files: sortedFiles,\n })\n\n const msg =\n 'Successfully Updated Lease Contract Documents. You may view the updated document package under Attached Generated Contract Files.'\n createToast(msg)\n setSaveAndPreviewLoading(false)\n } catch (error) {\n createToast(\n 'Unable to save and update the lease contract documents. Please try again',\n 'error',\n )\n Util.LogError('ERROR_SAVING_AND_GENERATING_CONTRACT_BROKER', error, {\n user: user.attributes,\n data,\n })\n setSaveAndPreviewLoading(false)\n }\n }\n\n const validateRequiredFields = fields => {\n let error = false\n // check if required fields are present\n fields.forEach(field => {\n if (!field) {\n // todo get name from field if more are needed\n createToast('Commencement Date is a required field!', 'error')\n error = true\n }\n })\n if (error) return true\n\n // make sure main lessee email is filled out\n if (!data.lease.main_lessee_email) {\n createToast('The main lessee email is a required field!', 'error')\n return true\n }\n\n // make sure all co-lessee emails are filled out\n Object.keys(data.lease.co_lessees).forEach(key => {\n const val = data.lease.co_lessees[key]\n if (!error && key.includes('co_lessee_email') && !val) {\n createToast(\n `Co-Lessee ${key.split('_')[3]} Email is a required field!`,\n 'error',\n )\n error = true\n }\n })\n if (error) return true\n\n return error\n }\n\n return (\n <>\n
    \n {!IS_ADMIN && renderContractMessage()}\n
    \n\n
    \n {/* Main Lease Info */}\n
    \n \n <>\n
    IPC payable to ADD submitted along with documentation
    \n
    All documents to comply with PIPEDA legislation
    \n
    \n Suppliers' invoices made out to ADD and current dated\n
    \n
    Amounts over $5,000 to be certified
    \n
    PAPP mandatory on all leases
    \n \n
    \n\n {/* Document Info */}\n
    \n DOCUMENTATION REQUIRED:\n
      \n
    • Lease Contract and related documents as provided
    • \n
    • \n Insurance showing ADD as loss payee and additionally insured\n
    • \n
    • Copy of Incorporation Papers or Profile Report
    • \n
    • Individual’s ID: current DL
    • \n
    • \n Picture of Truck or Trailer, Odometer, and VIN Plate required on\n all Private Sale transactions involving a motor vehicle\n
    • \n
    \n
    \n
    \n\n {![\n LEASE_STATUS.LEASE_DENIED_CREDIT.status,\n LEASE_STATUS.LEASE_PENDING_CREDIT.status,\n LEASE_STATUS.LEASE_NEEDS_INFO_CREDIT.status,\n ].includes(data.lease.status) && (\n <>\n
    \n
    \n {/* Lease Contract Form */}\n \n
    Contract Information
    \n
    \n {renderForm({\n schema: 'contract',\n labelType: 'view',\n IS_ADMIN,\n IS_MOBILE,\n inputProps: {\n disabled:\n needsInfoUpdate.successful || !IS_CONTRACT_EDITABLE,\n onChange: onLeaseInputChange,\n data: data.lease,\n },\n })}\n\n {/* Admin and Broker Update Contract Button */}\n
    \n {updateContractLoading || saveAndPreviewLoading ? (\n \n ) : (\n
    \n {!data.lease.contract_document_id && (\n <>\n
    \n ATTENTION: You can edit, generate, and preview\n documents as many times as you wish.\n
    \n Generated documents from this form will appear at\n the bottom of this page for preview.\n
    \n \n \n )}\n
    \n )}\n
    \n
    \n
    \n
    \n \n\n
    \n <>\n {/* Contract Document Status */}\n {DOCUMENT_SENT && (\n
    \n \n Contract Signature Status\n \n {documentInfo ? (\n \n ) : (\n \n \n
    \n )}\n
    \n )}\n \n\n {/* Admin Contract Approval */}\n {IS_ADMIN &&\n data.lease.status ===\n LEASE_STATUS.LEASE_PENDING_CONTRACT.status &&\n (didSubmitReview.contract ? (\n

    You have already reviewed this contract application.

    \n ) : (\n \n ))}\n\n {/* Send out E-signature or generate lease contract section */}\n {DOCUMENT_ACTIONS ? (\n documentActions.loading ? (\n \n \n \n ) : (\n !data.lease.assuming_contract_responsibility && (\n
    \n \n ATTENTION: Once an option is selected below, you will not\n be able to edit the contract details above anymore.\n
    \n You will not be able to undo this action. Make sure the{' '}\n {CONTRACT_NAME} is up to date and accurate.\n
    \n
    \n
    \n \n setModalData({\n isOpen: true,\n title: 'Confirm E-Signature Request',\n description: `Confirm that you wish to automatically send e-signature requests for the ${CONTRACT_NAME} document to all listed lessees via e-mail. After sending, you will be able to view the status of the signatures. Make sure the contract is up to date with the information you entered before you proceed.`,\n submitText: 'Send E-Signature Contract Request',\n submitHandler: generateESignatureRequest,\n })\n }\n disabled={documentActions.successful}\n >\n Send E-Signature Contract Request\n \n
    \n
    \n Or\n
    \n
    \n \n setModalData({\n isOpen: true,\n title: 'Confirm Document Generation',\n description: `Confirm that you wish to generate an ${CONTRACT_NAME} document with all information populated except the lessee signatures. You may print this out or email this as needed.`,\n submitText:\n 'Generate Contract without E-Signatures',\n submitHandler: noSignatureContractHandler,\n })\n }\n disabled={documentActions.successful}\n >\n Generate Contract without E-Signatures\n \n
    \n \n )\n )\n ) : null}\n\n {/* Upload Updated ADD contract section if handled on own */}\n {data.lease.assuming_contract_responsibility && (\n
    \n Upload Updated ADD Capital Contract Package\n
      \n
    • \n Once the contract package has been signed and finalized,\n upload it here\n
    • \n
    • \n Note this will overwrite the contract package on the right,\n so make sure it is correct\n
    • \n
    \n {\n const updatedFiles = await Storage.listDocuments(\n `leases/${data.lease.id}`,\n )\n setData({\n ...data,\n files: parseLeaseFiles(updatedFiles),\n })\n }}\n />\n
    \n )}\n\n {/* Attached Files */}\n
    \n \n {saveAndPreviewLoading ? (\n
    \n \n
    \n ) : (\n \n )}\n
    \n {/* Contract Needs Info Feedback */}\n {data.lease.status ===\n LEASE_STATUS.LEASE_NEEDS_INFO_CONTRACT.status && (\n \n )}\n\n {/* Submit Lease Contract Button */}\n {contractInfo.loading ? (\n \n \n \n ) : (\n data.lease.status === LEASE_STATUS.LEASE_APPROVED_CREDIT.status &&\n !IS_ADMIN && (\n
    \n
    \n {\n if (\n validateRequiredFields([data.lease.commencement_date])\n ) {\n return\n }\n\n setModalData({\n isOpen: true,\n title: 'Confirm Approval Intent',\n description:\n 'Confirm that you wish to submit the contract details and wait for an approval from ADD Capital.',\n submitText: 'Submit Contract for Approval',\n submitHandler: () => submitContract('WITH'),\n })\n }}\n disabled={contractInfo.successful}\n >\n Submit Contract Details For Approval\n \n
    \n\n
    \n {' '}\n Or{' '}\n
    \n\n
    \n {\n if (\n validateRequiredFields([data.lease.commencement_date])\n ) {\n return\n }\n\n setModalData({\n isOpen: true,\n title: 'Confirm Approval Intent',\n description:\n 'Confirm that you wish to continue the lease contract without approval from ADD Capital. Note that you assume full responsibility for the validity of this contract.',\n submitText: 'Continue Contract Without Approval',\n submitHandler: () => submitContract('WITHOUT'),\n })\n }}\n disabled={contractInfo.successful}\n >\n Continue Lease Contract Without Approval\n \n
    \n
    \n )\n )}\n \n {/* Complete Lease button for admins. Kind of brutal ternary but basically only\n show button if e-sig docs have been sent or contract has been generated */}\n
    \n {contractComplete.loading ? (\n \n ) : (\n (data.lease.assuming_contract_responsibility || DOCUMENT_SENT) &&\n IS_ADMIN &&\n data.lease.status ===\n LEASE_STATUS.LEASE_APPROVED_CONTRACT.status &&\n !contractComplete.successful && (\n \n
    \n ATTENTION: You will no longer be able to make changes to\n this lease\n
    \n \n
    \n )\n )}\n \n \n )}\n {createModal(modalData, setModalData)}\n \n )\n}\n\nLeaseContractForm.propTypes = {\n data: propTypes.object,\n setData: propTypes.func,\n onLeaseInputChange: propTypes.func,\n IS_ADMIN: propTypes.bool,\n didSubmitReview: propTypes.object,\n setDidSubmitReview: propTypes.func,\n}\n\nexport default LeaseContractForm\n","import React, { useState, useEffect } from 'react'\nimport PropTypes from 'prop-types'\nimport { navigate, Link } from 'gatsby'\nimport { ClipLoader } from 'react-spinners'\n\nimport { API, Storage, Util } from '../amplify'\nimport { parseLeaseFiles } from '../util'\n\nimport PortalPage from './PortalPage'\nimport LeaseToggle from './LeaseToggle'\n\nimport LeaseCreditForm from './LeaseCreditForm'\nimport LeaseContractForm from './LeaseContractForm'\n\nconst Lease = ({ user }) => {\n const leaseID =\n typeof window !== 'undefined' ? window.location.pathname.split('/')[3] : ''\n const IS_ADMIN = user?.attributes?.['custom:type'] === 'admin'\n\n const [data, _setData] = useState({\n loading: true,\n lease: {},\n broker: {},\n files: {\n credit: [],\n creditLog: [],\n contract: [],\n generatedContract: [],\n },\n })\n // wrapper setData function to do any extra data setter functionality\n const setData = newData => {\n // to get around amplify JSON bug\n // https://github.com/aws-amplify/amplify-js/issues/5767\n let parsedCoLessees = newData.lease.co_lessees\n if (typeof parsedCoLessees === 'string') {\n parsedCoLessees = JSON.parse(parsedCoLessees)\n }\n if (typeof parsedCoLessees === 'string') {\n parsedCoLessees = JSON.parse(parsedCoLessees)\n }\n // make sure co-lessees always have at least a blank email field corresponding\n const coLesseeKeys = Object.keys(parsedCoLessees)\n parsedCoLessees = coLesseeKeys.reduce((acc, field) => {\n let updatedCoLessees = { ...acc, ...parsedCoLessees }\n\n if (field.includes('co_lessee_name')) {\n const coLesseeNum = Number(field.split('_')[3])\n\n // if colessee map does not already have email defined, insert blank one\n if (!coLesseeKeys.includes(`co_lessee_email_${coLesseeNum}`)) {\n updatedCoLessees = {\n ...updatedCoLessees,\n [`co_lessee_email_${coLesseeNum}`]: '',\n }\n }\n }\n\n return updatedCoLessees\n }, parsedCoLessees)\n\n _setData({\n ...newData,\n lease: {\n ...newData.lease,\n co_lessees: parsedCoLessees,\n main_lessee_country: 'Canada', // somewhere this gets set to false, explicity set\n },\n })\n }\n\n const [leaseToggleState, setLeaseToggleState] = useState('credit')\n const [updateFormulaFields, setUpdateFormulaFields] = useState(false)\n const [didSubmitReview, setDidSubmitReview] = useState({\n credit: false,\n contract: false,\n })\n\n // do this permission checking in GQL instead? will save a request\n useEffect(() => {\n getBrokerId()\n }, [])\n\n // Do calculations for formula fields\n useEffect(() => {\n const calculatedFields = {}\n // Credit\n if (data.lease.equipment_cost) {\n calculatedFields.dp_percentage = (\n (Number(data.lease.dp_final) / Number(data.lease.equipment_cost)) *\n 100\n ).toFixed(1)\n }\n\n calculatedFields.clbo_value =\n Number(data.lease.equipment_cost) -\n Number(data.lease.dp_final) -\n Number(data.lease.trade_in_value) +\n Number(data.lease.trade_u_value)\n\n calculatedFields.collateral_exposure =\n Number(calculatedFields.clbo_value) -\n Number(data.lease.equipment_value) -\n Number(data.lease.security_deposit) -\n Number(data.lease.additional_coll_value)\n\n calculatedFields.total_exposure =\n Number(calculatedFields.clbo_value) + Number(data.lease.exist_value)\n\n if (updateFormulaFields) {\n setData({\n ...data,\n lease: {\n ...data.lease,\n ...calculatedFields,\n },\n })\n setUpdateFormulaFields(false)\n }\n }, [data.lease])\n\n // main lease change handler that updates entire lease and is passed down to all forms\n const onLeaseInputChange = e => {\n if (!e.target.name) return\n\n // Replace empty strings with null\n let inputFieldValue = e.target.value\n if (e.target.value === '') {\n inputFieldValue = null\n }\n\n setData({\n ...data,\n lease: {\n ...data.lease,\n [e.target.name]:\n e.target.type === 'checkbox' ? e.target.checked : inputFieldValue,\n },\n })\n\n setUpdateFormulaFields(true)\n }\n\n // check if the broker can actually access this lease\n const getBrokerId = async () => {\n try {\n const response = (await API.getLeaseBroker(leaseID))?.data\n\n // if there is no lease at the specified URI, go back to portal\n if (!response?.getLease) {\n navigate('/portal')\n }\n\n if (!IS_ADMIN && response.getLease?.broker_id !== user.username) {\n navigate('/portal')\n } else {\n getLease(response.getLease.broker_id)\n }\n } catch (error) {\n Util.LogError('ERROR_FETCHING_LEASE_BROKER', error, leaseID)\n }\n }\n\n const getLease = async leaseBrokerId => {\n try {\n const leaseResponse = (\n await API.getLeaseAndBroker(leaseID, leaseBrokerId)\n ).data\n\n const filesResponse = await Storage.listDocuments(`leases/${leaseID}`)\n const sortedFiles = parseLeaseFiles(filesResponse)\n\n setLeaseToggleState(\n leaseResponse.getLease.status.includes('CREDIT')\n ? 'credit'\n : 'contract',\n )\n\n setData({\n loading: false,\n lease: leaseResponse.getLease,\n broker: leaseResponse.getUser,\n files: sortedFiles,\n })\n } catch (error) {\n Util.LogError('ERROR_FETCHING_LEASE_OR_FILES', error, `leases/${leaseID}`)\n }\n }\n\n return (\n \n Back to Applications\n ,\n ]}\n >\n {data.loading ? (\n
    \n \n
    \n ) : (\n
    \n
    {`${leaseToggleState.toUpperCase()} APPLICATION INFO`}
    \n\n {/* Lease Toggle */}\n \n\n {leaseToggleState === 'credit' ? (\n \n ) : (\n \n )}\n
    \n )}\n \n )\n}\n\nLease.propTypes = {\n user: PropTypes.object,\n}\n\nexport default Lease\n","import React, { useState } from 'react'\nimport PropTypes from 'prop-types'\nimport { ClipLoader } from 'react-spinners'\n\nimport { renderForm } from '../util'\nimport { isMobile } from '../util/helpers'\n\nimport Text from './Text'\nimport Button from './Button'\nimport FileUpload from './FileUpload'\n\nconst LeaseForm = ({ onLeaseSubmit, leaseStatus, leaseMetaData }) => {\n const [leaseInputs, setLeaseInputs] = useState({\n main_lessee_country: 'Canada',\n })\n\n const IS_MOBILE = isMobile('sm')\n\n const onLeaseInputChange = e => {\n let key\n let value\n\n // redundant but maybe good to be explicit\n if (e.target.type === 'dropdown') {\n key = e.target.name\n value = e.target.value\n } else if (e.target.type === 'checkbox') {\n key = e.target.name\n value = e.target.checked\n } else {\n key = e.target.name\n value = e.target.value\n }\n\n setLeaseInputs({\n ...leaseInputs,\n [key]: value,\n })\n }\n\n const submitLease = e => {\n e.preventDefault()\n onLeaseSubmit(leaseInputs)\n }\n\n return (\n
    \n
    \n
    \n \n {leaseStatus.message}\n \n {renderForm({\n schema: 'creditGeneral',\n labelType: 'edit',\n IS_ADMIN: false,\n IS_MOBILE,\n inputProps: {\n disabled: leaseStatus.loading,\n onChange: onLeaseInputChange,\n },\n })}\n
    \n
    \n \n ATTENTION: Information inputted may be edited by an ADD Capital\n admin at any point.\n \n
    \n
    \n Add Lease Credit Documents\n \n
    \n
    \n {leaseStatus.loading ? (\n \n ) : (\n \n )}\n \n
    \n
    \n )\n}\n\nLeaseForm.propTypes = {\n onLeaseSubmit: PropTypes.func,\n leaseStatus: PropTypes.object,\n leaseMetaData: PropTypes.object,\n}\n\nexport default LeaseForm\n","/* eslint-disable no-await-in-loop */\n\nimport React, { useState } from 'react'\nimport PropTypes from 'prop-types'\nimport { Link } from 'gatsby'\nimport { v4 as uuid } from 'uuid'\nimport { createToast } from '../util/reactHelpers'\n\nimport { API, Lambda, Util } from '../amplify'\nimport leaseCreditFormSchema from '../data/leaseCreditFormSchema.json'\nimport { LEASE_PENDING_CREDIT } from '../data/leaseStatus'\n\nimport PortalPage from './PortalPage'\nimport Button from './Button'\nimport LeaseForm from './LeaseForm'\nimport BrokerDropdown from './BrokerDropdown'\n\n// Starting count for lease reference number\nconst START_REF_COUNT = 50000\n\nconst NewLease = ({ user, brokerList }) => {\n const IS_ADMIN = user.attributes?.['custom:type'] === 'admin'\n\n const [LEASE_ID, SET_LEASE_ID] = useState(uuid())\n const [leaseStatus, setLeaseStatus] = useState({\n message: '',\n error: false,\n loading: false,\n })\n const [submitSuccessful, setSubmitSuccessful] = useState(false)\n const [selectedBroker, setSelectedBroker] = useState([])\n\n const leaseMetaData = {\n id: LEASE_ID,\n type: 'lease',\n broker_id: IS_ADMIN ? selectedBroker[0]?.value : user?.attributes?.sub,\n status: LEASE_PENDING_CREDIT.status,\n }\n\n const onLeaseSubmit = async leaseInputs => {\n if (IS_ADMIN && selectedBroker.length === 0) {\n return createToast(\n 'You must select a broker to assign this lease to',\n 'error',\n )\n }\n\n setLeaseStatus({\n message: '',\n error: false,\n loading: true,\n })\n\n let paginationToken = null\n let totalLeaseCount = 0\n\n // poll with pagination token to get full lease count\n do {\n const {\n data: {\n listLeases: { nextToken, scannedCount },\n },\n } = await API.getTotalLeaseCounts({ nextToken: paginationToken })\n\n paginationToken = nextToken\n totalLeaseCount += scannedCount\n } while (paginationToken !== null)\n\n const fields = leaseCreditFormSchema.flat().reduce((acc, field) => {\n const value = leaseInputs[field.name]\n return { ...acc, [field.name]: value ?? '' }\n }, {})\n\n try {\n const lease = await API.createLease({\n ...leaseMetaData,\n ...fields,\n // stringify co-lessees\n co_lessees: JSON.stringify(fields?.co_lessees || {}),\n // save cased lessee name to search on\n cased_lessee_name: fields.main_lessee_name.toUpperCase(),\n\n // reference number\n reference_number: String(totalLeaseCount + START_REF_COUNT || ''),\n })\n\n // send broker email about credit application\n if (IS_ADMIN) {\n // should ADD be cc'd?\n await Lambda.sendEmail({\n IS_NOTIFICATION: true,\n TO: selectedBroker[0].email,\n FROM: 'CREDIT',\n name: selectedBroker[0].label,\n clientName: fields.main_lessee_name,\n leaseStatus:\n 'has been submitted by an ADD Capital admin on your behalf',\n leaseNextSteps:\n 'The credit submission is currently in the review stage. Once it has been approved, you can begin entering lease documentation details',\n leaseID: lease.data.createLease.id,\n })\n } else {\n // send ADD notification on submit\n await Lambda.sendEmail({\n IS_NOTIFICATION: true,\n TO: 'CREDIT',\n FROM: 'CREDIT',\n name: 'ADD Capital',\n clientName: fields.main_lessee_name,\n leaseStatus: 'has been submitted by the broker',\n leaseNextSteps: 'View the lease to provide feedback to the broker',\n leaseID: lease.data.createLease.id,\n })\n }\n\n setLeaseStatus({\n ...leaseStatus,\n loading: false,\n })\n setSubmitSuccessful(true)\n } catch (error) {\n Util.LogError('ERROR_CREATING_LEASE', error, fields)\n\n const msg = 'An unknown error has occured. Please try again!'\n createToast(msg, 'error')\n\n setLeaseStatus({\n message: error.message || msg,\n error: true,\n loading: false,\n })\n }\n }\n\n return (\n \n Back to Applications\n ,\n ]}\n >\n {submitSuccessful ? (\n
    \n
    \n Successfully Submitted Credit Application for Review.\n
    \n {\n SET_LEASE_ID(uuid())\n setSubmitSuccessful(false)\n setLeaseStatus({\n message: '',\n error: false,\n loading: false,\n })\n }}\n >\n Submit Another Credit Application\n \n
    \n ) : (\n
    \n
    NEW CREDIT APPLICATION
    \n
    \n {IS_ADMIN && Select a broker to assign this lease to:}\n \n
    \n
    \n \n
    \n
    \n )}\n \n )\n}\n\nNewLease.propTypes = {\n user: PropTypes.object,\n brokerList: PropTypes.array,\n}\n\nexport default NewLease\n","import React, { useState } from 'react'\nimport PropTypes from 'prop-types'\nimport { navigate } from 'gatsby'\nimport moment from 'moment'\n\nimport { API, Util } from '../amplify'\nimport Button from './Button'\nimport { createToast, createModal } from '../util/reactHelpers'\nimport { isMobile } from '../util/helpers'\nimport * as LEASE_STATUS from '../data/leaseStatus'\n\nconst LeaseBar = ({ lease, broker, fetchLeaseData, IS_ADMIN }) => {\n const IS_MOBILE = isMobile(1000)\n\n const [modalData, setModalData] = useState({\n isOpen: false,\n title: '',\n description: '',\n submitText: '',\n submitHandler: () => {},\n })\n\n const renderAssetDescription = () => {\n const n = IS_MOBILE ? 21 : 70\n return lease?.asset_description.length > n\n ? lease?.asset_description.substr(0, n - 1) + '....'\n : lease?.asset_description\n }\n\n const archiveLease = async () => {\n const status = LEASE_STATUS.LEASE_ARCHIVED.status\n\n try {\n await API.updateLease({\n ...lease,\n co_lessees: JSON.stringify(lease?.co_lessees || {}),\n status,\n })\n\n // Reset modal state\n setModalData({\n isOpen: false,\n title: '',\n description: '',\n submitText: '',\n submitHandler: () => {},\n })\n\n // Re fetch leases to update UI\n await fetchLeaseData()\n\n createToast('Successfully archived lease')\n } catch (error) {\n Util.LogError('ERROR_ARCHIVING_LEASE', error, {\n ...lease,\n co_lessees: JSON.stringify(lease?.co_lessees || {}),\n status,\n })\n createToast(\n 'Failed to archive lease application. Please try again.',\n 'error',\n )\n }\n }\n return (\n
    \n navigate(`/portal/lease/${lease?.id}`)}\n >\n
    \n
    \n Lessee: \n {lease?.main_lessee_name}\n
    \n
    \n Equipment: \n {renderAssetDescription()}\n
    \n
    \n
    \n
    \n
    Broker: 
    \n
    {broker?.name}
    \n
    \n
    \n
    Created: 
    \n
    \n {moment(lease.createdAt).format('MMMM DD, YYYY h:mm A')}\n
    \n
    \n
    \n
    \n {IS_ADMIN && lease.status !== LEASE_STATUS.LEASE_ARCHIVED.status && (\n \n setModalData({\n isOpen: true,\n title: 'Confirm Archive',\n description:\n 'Are you sure you want to archive this lease application? You will still be able to access it from the \"Archived\" section.',\n submitText: 'Archive',\n submitHandler: archiveLease,\n })\n }\n >\n X\n \n )}\n {createModal(modalData, setModalData)}\n \n )\n}\n\nLeaseBar.propTypes = {\n lease: PropTypes.object,\n broker: PropTypes.object,\n fetchLeaseData: PropTypes.func,\n IS_ADMIN: PropTypes.bool,\n}\n\nexport default LeaseBar\n","import React from 'react'\nimport PropTypes from 'prop-types'\n\nconst SearchBar = ({ placeholder, handleChange, fetchSearchedLeases }) => {\n return (\n
    \n {\n if (e.key === 'Enter') {\n fetchSearchedLeases()\n }\n }}\n />\n
    \n )\n}\n\nSearchBar.propTypes = {\n placeholder: PropTypes.string,\n handleChange: PropTypes.func,\n fetchSearchedLeases: PropTypes.func,\n}\n\nexport default SearchBar\n","import React, { useState, useEffect } from 'react'\nimport PropTypes from 'prop-types'\nimport { Link, navigate } from 'gatsby'\nimport { ClipLoader } from 'react-spinners'\n\nimport { Auth, API, Util } from '../amplify'\nimport * as LEASE_STATUS from '../data/leaseStatus'\n\nimport PortalPage from './PortalPage'\nimport Button from './Button'\nimport LeaseBar from './LeaseBar'\nimport SearchBar from './SearchBar'\nimport BrokerDropdown from './BrokerDropdown'\n\nconst LeaseOverview = ({\n user,\n refreshAuthStatus,\n brokerList,\n selectedBrokerFilter,\n setSelectedBrokerFilter,\n}) => {\n const IS_ADMIN = user.attributes?.['custom:type'] === 'admin'\n const URL_LEASE_STATUS =\n typeof window !== 'undefined' ? window.location.pathname.split('/')[3] : ''\n\n // if URL status is invalid\n const leaseStatus = LEASE_STATUS[`LEASE_${URL_LEASE_STATUS}`]\n if (!leaseStatus?.url) {\n navigate('/portal')\n }\n\n const [data, setData] = useState({\n loading: true,\n leases: [],\n brokers: {},\n nextToken: null,\n })\n const [search, setSearch] = useState('')\n\n useEffect(() => {\n fetchLeaseData()\n }, [selectedBrokerFilter])\n\n const baseQuery = {\n type: 'lease',\n sortDirection: 'DESC',\n limit: 5000,\n nextToken: data.nextToken,\n }\n const baseFilter = {\n status: {\n eq: leaseStatus.status,\n },\n }\n const searchFilter = {\n cased_lessee_name: {\n contains: search?.toUpperCase(),\n },\n }\n\n const leaseQuery = IS_ADMIN\n ? {\n ...baseQuery,\n filter: {\n ...baseFilter,\n ...(search && searchFilter),\n ...(selectedBrokerFilter[0]?.value && {\n broker_id: {\n eq: selectedBrokerFilter[0].value,\n },\n }),\n },\n }\n : {\n ...baseQuery,\n filter: {\n ...baseFilter,\n ...(search && searchFilter),\n broker_id: {\n eq: user.username,\n },\n },\n }\n\n const fetchLeaseData = async () => {\n try {\n const leaseResponse = (await API.listSortedLeases(leaseQuery)).data\n .listLeasesSortedByCreated\n\n const dedupedUsers = leaseResponse.items.reduce(\n (acc, lease) => ({ ...acc, [lease.broker_id]: 'broker' }),\n {},\n )\n\n let userResponse = {}\n if (Object.keys(dedupedUsers).length) {\n userResponse = await API.listUsers({\n filter: {\n or: Object.keys(dedupedUsers).map(id => ({\n id: {\n eq: id,\n },\n })),\n },\n })\n }\n\n const userMap = userResponse?.data?.listUsers?.items?.reduce(\n (acc, userObj) => ({\n ...acc,\n [userObj.id]: userObj,\n }),\n {},\n )\n\n setData({\n ...data,\n loading: false,\n leases: leaseResponse.items,\n brokers: userMap || {},\n nextToken: leaseResponse.nextToken,\n })\n } catch (error) {\n Util.LogError('ERROR_FETCHING_LEASES', error, {\n user: user.attributes,\n })\n }\n }\n\n // pagination was never ever used lol\n const fetchMoreLeases = async () => {\n setData({ ...data, loading: true })\n\n try {\n const leaseResponse = (await API.listSortedLeases(leaseQuery)).data\n .listLeasesSortedByCreated\n\n setData({\n ...data,\n loading: false,\n leases: [...data.leases, ...leaseResponse.items],\n nextToken: leaseResponse.nextToken,\n })\n } catch (error) {\n Util.LogError('ERROR_FETCHING_MORE_LEASES', error, {\n user: user.attributes,\n })\n }\n }\n\n const fetchSearchedLeases = async () => {\n setData({ ...data, loading: true, nextToken: null })\n\n if (!search) {\n setSearch('')\n await fetchLeaseData()\n return\n }\n\n try {\n const leaseResponse = (\n await API.listSortedLeases({ ...leaseQuery, nextToken: null })\n ).data.listLeasesSortedByCreated\n\n setData({\n ...data,\n loading: false,\n leases: leaseResponse.items,\n nextToken: leaseResponse.nextToken,\n })\n } catch (error) {\n Util.LogError('ERROR_FETCHING_SEARCHED_LEASES', error, {\n user: user.attributes,\n })\n }\n }\n\n const renderLeases = () => {\n return data.leases.map(lease => (\n \n ))\n }\n\n const onDropdownChange = option => {\n const value = option.length ? option : [{ label: 'No Filter', value: '' }]\n setSelectedBrokerFilter(value)\n }\n\n return (\n \n Back to Applications\n ,\n ,\n {\n await Auth.logout()\n refreshAuthStatus()\n }}\n key='logoutLink'\n >\n Logout\n ,\n ]}\n >\n
    \n
    \n
    {leaseStatus.pluralDisplay}
    \n
    \n setSearch(e.target.value || '')}\n fetchSearchedLeases={fetchSearchedLeases}\n />\n \n
    \n
    \n {data.loading ? (\n
    \n \n
    \n ) : (\n renderLeases()\n )}\n\n {/* Pagination */}\n {data.nextToken && (\n \n \n
    \n )}\n \n \n )\n}\n\nLeaseOverview.propTypes = {\n user: PropTypes.object,\n refreshAuthStatus: PropTypes.func,\n brokerList: PropTypes.array,\n selectedBrokerFilter: PropTypes.array,\n setSelectedBrokerFilter: PropTypes.func,\n}\n\nexport default LeaseOverview\n","import React, { useState, useEffect } from 'react'\nimport { ClipLoader } from 'react-spinners'\nimport { Router } from '@reach/router'\nimport { ToastContainer } from 'react-toastify'\n\nimport { Auth, API, Util } from '../../amplify'\nimport { isMobile } from '../../util/helpers'\n\nimport Layout from '../../layouts/index'\nimport SEO from '../../components/SEO'\nimport PrivateRoute from '../../components/PrivateRoute'\nimport LoginForm from '../../components/Login'\nimport BrokerHome from '../../components/BrokerHome'\nimport Lease from '../../components/Lease'\nimport NewLease from '../../components/NewLease'\nimport LeaseOverview from '../../components/LeaseOverview'\nimport NotFound from '../../components/NotFound'\n\nimport 'react-toastify/dist/ReactToastify.css'\n\nconst Portal = () => {\n const BLOCK_MOBILE_ACCESS = false\n const IS_MOBILE = isMobile('md')\n\n const [isLoading, setIsLoading] = useState(true)\n const [user, setUser] = useState({})\n const [brokerList, setBrokerList] = useState([])\n const [isLoggedIn, setIsLoggedIn] = useState(false)\n const [selectedBrokerFilter, setSelectedBrokerFilter] = useState([\n {\n label: 'Select a Broker Filter...',\n value: null,\n },\n ])\n\n useEffect(() => {\n refreshAuthStatus()\n }, [])\n\n const fetchBrokers = async () => {\n try {\n const userResponse = await API.listUsers({\n filter: {\n type: {\n ne: 'admin',\n },\n },\n })\n\n const brokers = [\n { label: 'No Filter', value: '' },\n ...(userResponse?.data?.listUsers?.items || []).map(broker => ({\n label: broker.name,\n value: broker.id,\n email: broker.email,\n })),\n ]\n\n setBrokerList(brokers)\n } catch (error) {\n Util.LogError('ERROR_FETCHING_BROKER_FILTER_OPTIONS', error, user)\n }\n }\n\n const refreshAuthStatus = async () => {\n try {\n const authUser = await Auth.authStatus()\n\n setUser(authUser)\n setIsLoggedIn(!!authUser?.attributes)\n setIsLoading(false)\n\n if (authUser.attributes?.['custom:type'] === 'admin') {\n fetchBrokers()\n }\n } catch (error) {\n Util.LogError('ERROR_REFRESHING_AUTH_STATUS', error)\n }\n }\n\n return (\n \n \n \n\n
    \n {BLOCK_MOBILE_ACCESS && IS_MOBILE ? (\n
    \n
    \n

    \n Oops! This portal can only be accessed via desktop. Mobile usage\n is not supported at this time\n

    \n
    \n
    \n ) : (\n
    \n {isLoading ? (\n
    \n \n
    \n ) : (\n
    \n \n \n\n i !== 0)}\n />\n\n \n\n \n\n \n\n \n \n
    \n )}\n
    \n )}\n
    \n
    \n )\n}\n\nexport default Portal\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\nfunction ZStream() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n this.next_in = 0;\n /* number of bytes available at input */\n this.avail_in = 0;\n /* total number of input bytes read so far */\n this.total_in = 0;\n /* next output byte should be put there */\n this.output = null; // JS specific, because we have no pointers\n this.next_out = 0;\n /* remaining free space at output */\n this.avail_out = 0;\n /* total number of bytes output so far */\n this.total_out = 0;\n /* last error message, NULL if no error */\n this.msg = '' /*Z_NULL*/;\n /* not visible by applications */\n this.state = null;\n /* best guess about the data type: binary or text */\n this.data_type = 2 /*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n}\nmodule.exports = ZStream;","\"use strict\";\n\nexports.__esModule = !0, exports.default = void 0;\nvar _react = _interopRequireDefault(require(\"react\")),\n _propTypes = _interopRequireDefault(require(\"prop-types\"));\nfunction _interopRequireDefault(a) {\n return a && a.__esModule ? a : {\n default: a\n };\n}\nfunction _inheritsLoose(a, b) {\n a.prototype = Object.create(b.prototype), a.prototype.constructor = a, _setPrototypeOf(a, b);\n}\nfunction _setPrototypeOf(a, b) {\n return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (a, b) {\n return a.__proto__ = b, a;\n }, _setPrototypeOf(a, b);\n}\nvar ClickOutside = /*#__PURE__*/function (a) {\n function b() {\n for (var b, c = arguments.length, d = Array(c), e = 0; e < c; e++) d[e] = arguments[e];\n return b = a.call.apply(a, [this].concat(d)) || this, b.container = /*#__PURE__*/_react.default.createRef(), b.handleClick = function (a) {\n var c = b.container.current,\n d = a.target,\n e = b.props.onClickOutside;\n (c && c === d || c && !c.contains(d)) && e(a);\n }, b;\n }\n _inheritsLoose(b, a);\n var c = b.prototype;\n return c.componentDidMount = function componentDidMount() {\n document.addEventListener(\"click\", this.handleClick, !0);\n }, c.componentWillUnmount = function componentWillUnmount() {\n document.removeEventListener(\"click\", this.handleClick, !0);\n }, c.render = function render() {\n var a = this.props,\n b = a.className,\n c = a.children;\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: b,\n ref: this.container\n }, c);\n }, b;\n }(_react.default.Component),\n _default = ClickOutside;\nexports.default = _default;","import { __extends } from \"tslib\";\nimport { arrayAsString } from \"../utils\";\nvar MethodNotImplementedError = /** @class */function (_super) {\n __extends(MethodNotImplementedError, _super);\n function MethodNotImplementedError(className, methodName) {\n var _this = this;\n var msg = \"Method \" + className + \".\" + methodName + \"() not implemented\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return MethodNotImplementedError;\n}(Error);\nexport { MethodNotImplementedError };\nvar PrivateConstructorError = /** @class */function (_super) {\n __extends(PrivateConstructorError, _super);\n function PrivateConstructorError(className) {\n var _this = this;\n var msg = \"Cannot construct \" + className + \" - it has a private constructor\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return PrivateConstructorError;\n}(Error);\nexport { PrivateConstructorError };\nvar UnexpectedObjectTypeError = /** @class */function (_super) {\n __extends(UnexpectedObjectTypeError, _super);\n function UnexpectedObjectTypeError(expected, actual) {\n var _this = this;\n var name = function (t) {\n var _a, _b;\n return (_a = t === null || t === void 0 ? void 0 : t.name) !== null && _a !== void 0 ? _a : (_b = t === null || t === void 0 ? void 0 : t.constructor) === null || _b === void 0 ? void 0 : _b.name;\n };\n var expectedTypes = Array.isArray(expected) ? expected.map(name) : [name(expected)];\n var msg = \"Expected instance of \" + expectedTypes.join(' or ') + \", \" + (\"but got instance of \" + (actual ? name(actual) : actual));\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return UnexpectedObjectTypeError;\n}(Error);\nexport { UnexpectedObjectTypeError };\nvar UnsupportedEncodingError = /** @class */function (_super) {\n __extends(UnsupportedEncodingError, _super);\n function UnsupportedEncodingError(encoding) {\n var _this = this;\n var msg = encoding + \" stream encoding not supported\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return UnsupportedEncodingError;\n}(Error);\nexport { UnsupportedEncodingError };\nvar ReparseError = /** @class */function (_super) {\n __extends(ReparseError, _super);\n function ReparseError(className, methodName) {\n var _this = this;\n var msg = \"Cannot call \" + className + \".\" + methodName + \"() more than once\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return ReparseError;\n}(Error);\nexport { ReparseError };\nvar MissingCatalogError = /** @class */function (_super) {\n __extends(MissingCatalogError, _super);\n function MissingCatalogError(ref) {\n var _this = this;\n var msg = \"Missing catalog (ref=\" + ref + \")\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return MissingCatalogError;\n}(Error);\nexport { MissingCatalogError };\nvar MissingPageContentsEmbeddingError = /** @class */function (_super) {\n __extends(MissingPageContentsEmbeddingError, _super);\n function MissingPageContentsEmbeddingError() {\n var _this = this;\n var msg = \"Can't embed page with missing Contents\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return MissingPageContentsEmbeddingError;\n}(Error);\nexport { MissingPageContentsEmbeddingError };\nvar UnrecognizedStreamTypeError = /** @class */function (_super) {\n __extends(UnrecognizedStreamTypeError, _super);\n function UnrecognizedStreamTypeError(stream) {\n var _a, _b, _c;\n var _this = this;\n var streamType = (_c = (_b = (_a = stream === null || stream === void 0 ? void 0 : stream.contructor) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : stream === null || stream === void 0 ? void 0 : stream.name) !== null && _c !== void 0 ? _c : stream;\n var msg = \"Unrecognized stream type: \" + streamType;\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return UnrecognizedStreamTypeError;\n}(Error);\nexport { UnrecognizedStreamTypeError };\nvar PageEmbeddingMismatchedContextError = /** @class */function (_super) {\n __extends(PageEmbeddingMismatchedContextError, _super);\n function PageEmbeddingMismatchedContextError() {\n var _this = this;\n var msg = \"Found mismatched contexts while embedding pages. All pages in the array passed to `PDFDocument.embedPages()` must be from the same document.\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return PageEmbeddingMismatchedContextError;\n}(Error);\nexport { PageEmbeddingMismatchedContextError };\nvar PDFArrayIsNotRectangleError = /** @class */function (_super) {\n __extends(PDFArrayIsNotRectangleError, _super);\n function PDFArrayIsNotRectangleError(size) {\n var _this = this;\n var msg = \"Attempted to convert PDFArray with \" + size + \" elements to rectangle, but must have exactly 4 elements.\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return PDFArrayIsNotRectangleError;\n}(Error);\nexport { PDFArrayIsNotRectangleError };\nvar InvalidPDFDateStringError = /** @class */function (_super) {\n __extends(InvalidPDFDateStringError, _super);\n function InvalidPDFDateStringError(value) {\n var _this = this;\n var msg = \"Attempted to convert \\\"\" + value + \"\\\" to a date, but it does not match the PDF date string format.\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return InvalidPDFDateStringError;\n}(Error);\nexport { InvalidPDFDateStringError };\nvar InvalidTargetIndexError = /** @class */function (_super) {\n __extends(InvalidTargetIndexError, _super);\n function InvalidTargetIndexError(targetIndex, Count) {\n var _this = this;\n var msg = \"Invalid targetIndex specified: targetIndex=\" + targetIndex + \" must be less than Count=\" + Count;\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return InvalidTargetIndexError;\n}(Error);\nexport { InvalidTargetIndexError };\nvar CorruptPageTreeError = /** @class */function (_super) {\n __extends(CorruptPageTreeError, _super);\n function CorruptPageTreeError(targetIndex, operation) {\n var _this = this;\n var msg = \"Failed to \" + operation + \" at targetIndex=\" + targetIndex + \" due to corrupt page tree: It is likely that one or more 'Count' entries are invalid\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return CorruptPageTreeError;\n}(Error);\nexport { CorruptPageTreeError };\nvar IndexOutOfBoundsError = /** @class */function (_super) {\n __extends(IndexOutOfBoundsError, _super);\n function IndexOutOfBoundsError(index, min, max) {\n var _this = this;\n var msg = \"index should be at least \" + min + \" and at most \" + max + \", but was actually \" + index;\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return IndexOutOfBoundsError;\n}(Error);\nexport { IndexOutOfBoundsError };\nvar InvalidAcroFieldValueError = /** @class */function (_super) {\n __extends(InvalidAcroFieldValueError, _super);\n function InvalidAcroFieldValueError() {\n var _this = this;\n var msg = \"Attempted to set invalid field value\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return InvalidAcroFieldValueError;\n}(Error);\nexport { InvalidAcroFieldValueError };\nvar MultiSelectValueError = /** @class */function (_super) {\n __extends(MultiSelectValueError, _super);\n function MultiSelectValueError() {\n var _this = this;\n var msg = \"Attempted to select multiple values for single-select field\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return MultiSelectValueError;\n}(Error);\nexport { MultiSelectValueError };\nvar MissingDAEntryError = /** @class */function (_super) {\n __extends(MissingDAEntryError, _super);\n function MissingDAEntryError(fieldName) {\n var _this = this;\n var msg = \"No /DA (default appearance) entry found for field: \" + fieldName;\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return MissingDAEntryError;\n}(Error);\nexport { MissingDAEntryError };\nvar MissingTfOperatorError = /** @class */function (_super) {\n __extends(MissingTfOperatorError, _super);\n function MissingTfOperatorError(fieldName) {\n var _this = this;\n var msg = \"No Tf operator found for DA of field: \" + fieldName;\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return MissingTfOperatorError;\n}(Error);\nexport { MissingTfOperatorError };\nvar NumberParsingError = /** @class */function (_super) {\n __extends(NumberParsingError, _super);\n function NumberParsingError(pos, value) {\n var _this = this;\n var msg = \"Failed to parse number \" + (\"(line:\" + pos.line + \" col:\" + pos.column + \" offset=\" + pos.offset + \"): \\\"\" + value + \"\\\"\");\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return NumberParsingError;\n}(Error);\nexport { NumberParsingError };\nvar PDFParsingError = /** @class */function (_super) {\n __extends(PDFParsingError, _super);\n function PDFParsingError(pos, details) {\n var _this = this;\n var msg = \"Failed to parse PDF document \" + (\"(line:\" + pos.line + \" col:\" + pos.column + \" offset=\" + pos.offset + \"): \" + details);\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return PDFParsingError;\n}(Error);\nexport { PDFParsingError };\nvar NextByteAssertionError = /** @class */function (_super) {\n __extends(NextByteAssertionError, _super);\n function NextByteAssertionError(pos, expectedByte, actualByte) {\n var _this = this;\n var msg = \"Expected next byte to be \" + expectedByte + \" but it was actually \" + actualByte;\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return NextByteAssertionError;\n}(PDFParsingError);\nexport { NextByteAssertionError };\nvar PDFObjectParsingError = /** @class */function (_super) {\n __extends(PDFObjectParsingError, _super);\n function PDFObjectParsingError(pos, byte) {\n var _this = this;\n var msg = \"Failed to parse PDF object starting with the following byte: \" + byte;\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return PDFObjectParsingError;\n}(PDFParsingError);\nexport { PDFObjectParsingError };\nvar PDFInvalidObjectParsingError = /** @class */function (_super) {\n __extends(PDFInvalidObjectParsingError, _super);\n function PDFInvalidObjectParsingError(pos) {\n var _this = this;\n var msg = \"Failed to parse invalid PDF object\";\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return PDFInvalidObjectParsingError;\n}(PDFParsingError);\nexport { PDFInvalidObjectParsingError };\nvar PDFStreamParsingError = /** @class */function (_super) {\n __extends(PDFStreamParsingError, _super);\n function PDFStreamParsingError(pos) {\n var _this = this;\n var msg = \"Failed to parse PDF stream\";\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return PDFStreamParsingError;\n}(PDFParsingError);\nexport { PDFStreamParsingError };\nvar UnbalancedParenthesisError = /** @class */function (_super) {\n __extends(UnbalancedParenthesisError, _super);\n function UnbalancedParenthesisError(pos) {\n var _this = this;\n var msg = \"Failed to parse PDF literal string due to unbalanced parenthesis\";\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return UnbalancedParenthesisError;\n}(PDFParsingError);\nexport { UnbalancedParenthesisError };\nvar StalledParserError = /** @class */function (_super) {\n __extends(StalledParserError, _super);\n function StalledParserError(pos) {\n var _this = this;\n var msg = \"Parser stalled\";\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return StalledParserError;\n}(PDFParsingError);\nexport { StalledParserError };\nvar MissingPDFHeaderError = /** @class */function (_super) {\n __extends(MissingPDFHeaderError, _super);\n function MissingPDFHeaderError(pos) {\n var _this = this;\n var msg = \"No PDF header found\";\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return MissingPDFHeaderError;\n}(PDFParsingError);\nexport { MissingPDFHeaderError };\nvar MissingKeywordError = /** @class */function (_super) {\n __extends(MissingKeywordError, _super);\n function MissingKeywordError(pos, keyword) {\n var _this = this;\n var msg = \"Did not find expected keyword '\" + arrayAsString(keyword) + \"'\";\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return MissingKeywordError;\n}(PDFParsingError);\nexport { MissingKeywordError };","import { toHexString } from \"./strings\";\n/**\n * Encodes a string to UTF-8.\n *\n * @param input The string to be encoded.\n * @param byteOrderMark Whether or not a byte order marker (BOM) should be added\n * to the start of the encoding. (default `true`)\n * @returns A Uint8Array containing the UTF-8 encoding of the input string.\n *\n * -----------------------------------------------------------------------------\n *\n * JavaScript strings are composed of Unicode code points. Code points are\n * integers in the range 0 to 1,114,111 (0x10FFFF). When serializing a string,\n * it must be encoded as a sequence of words. A word is typically 8, 16, or 32\n * bytes in size. As such, Unicode defines three encoding forms: UTF-8, UTF-16,\n * and UTF-32. These encoding forms are described in the Unicode standard [1].\n * This function implements the UTF-8 encoding form.\n *\n * -----------------------------------------------------------------------------\n *\n * In UTF-8, each code point is mapped to a sequence of 1, 2, 3, or 4 bytes.\n * Note that the logic which defines this mapping is slightly convoluted, and\n * not as straightforward as the mapping logic for UTF-16 or UTF-32. The UTF-8\n * mapping logic is as follows [2]:\n *\n * • If a code point is in the range U+0000..U+007F, then view it as a 7-bit\n * integer: 0bxxxxxxx. Map the code point to 1 byte with the first high order\n * bit set to 0:\n *\n * b1=0b0xxxxxxx\n *\n * • If a code point is in the range U+0080..U+07FF, then view it as an 11-bit\n * integer: 0byyyyyxxxxxx. Map the code point to 2 bytes with the first 5 bits\n * of the code point stored in the first byte, and the last 6 bits stored in\n * the second byte:\n *\n * b1=0b110yyyyy b2=0b10xxxxxx\n *\n * • If a code point is in the range U+0800..U+FFFF, then view it as a 16-bit\n * integer, 0bzzzzyyyyyyxxxxxx. Map the code point to 3 bytes with the first\n * 4 bits stored in the first byte, the next 6 bits stored in the second byte,\n * and the last 6 bits in the third byte:\n *\n * b1=0b1110zzzz b2=0b10yyyyyy b3=0b10xxxxxx\n *\n * • If a code point is in the range U+10000...U+10FFFF, then view it as a\n * 21-bit integer, 0bvvvzzzzzzyyyyyyxxxxxx. Map the code point to 4 bytes with\n * the first 3 bits stored in the first byte, the next 6 bits stored in the\n * second byte, the next 6 bits stored in the third byte, and the last 6 bits\n * stored in the fourth byte:\n *\n * b1=0b11110xxx b2=0b10zzzzzz b3=0b10yyyyyy b4=0b10xxxxxx\n *\n * -----------------------------------------------------------------------------\n *\n * It is important to note, when iterating through the code points of a string\n * in JavaScript, that if a character is encoded as a surrogate pair it will\n * increase the string's length by 2 instead of 1 [4]. For example:\n *\n * ```\n * > 'a'.length\n * 1\n * > '💩'.length\n * 2\n * > '語'.length\n * 1\n * > 'a💩語'.length\n * 4\n * ```\n *\n * The results of the above example are explained by the fact that the\n * characters 'a' and '語' are not represented by surrogate pairs, but '💩' is.\n *\n * Because of this idiosyncrasy in JavaScript's string implementation and APIs,\n * we must \"jump\" an extra index after encoding a character as a surrogate\n * pair. In practice, this means we must increment the index of our for loop by\n * 2 if we encode a surrogate pair, and 1 in all other cases.\n *\n * -----------------------------------------------------------------------------\n *\n * References:\n * - [1] https://www.unicode.org/versions/Unicode12.0.0/UnicodeStandard-12.0.pdf\n * 3.9 Unicode Encoding Forms - UTF-8\n * - [2] http://www.herongyang.com/Unicode/UTF-8-UTF-8-Encoding.html\n * - [3] http://www.herongyang.com/Unicode/UTF-8-UTF-8-Encoding-Algorithm.html\n * - [4] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length#Description\n *\n */\nexport var utf8Encode = function (input, byteOrderMark) {\n if (byteOrderMark === void 0) {\n byteOrderMark = true;\n }\n var encoded = [];\n if (byteOrderMark) encoded.push(0xef, 0xbb, 0xbf);\n for (var idx = 0, len = input.length; idx < len;) {\n var codePoint = input.codePointAt(idx);\n // One byte encoding\n if (codePoint < 0x80) {\n var byte1 = codePoint & 0x7f;\n encoded.push(byte1);\n idx += 1;\n }\n // Two byte encoding\n else if (codePoint < 0x0800) {\n var byte1 = codePoint >> 6 & 0x1f | 0xc0;\n var byte2 = codePoint & 0x3f | 0x80;\n encoded.push(byte1, byte2);\n idx += 1;\n }\n // Three byte encoding\n else if (codePoint < 0x010000) {\n var byte1 = codePoint >> 12 & 0x0f | 0xe0;\n var byte2 = codePoint >> 6 & 0x3f | 0x80;\n var byte3 = codePoint & 0x3f | 0x80;\n encoded.push(byte1, byte2, byte3);\n idx += 1;\n }\n // Four byte encoding (surrogate pair)\n else if (codePoint < 0x110000) {\n var byte1 = codePoint >> 18 & 0x07 | 0xf0;\n var byte2 = codePoint >> 12 & 0x3f | 0x80;\n var byte3 = codePoint >> 6 & 0x3f | 0x80;\n var byte4 = codePoint >> 0 & 0x3f | 0x80;\n encoded.push(byte1, byte2, byte3, byte4);\n idx += 2;\n }\n // Should never reach this case\n else throw new Error(\"Invalid code point: 0x\" + toHexString(codePoint));\n }\n return new Uint8Array(encoded);\n};\n/**\n * Encodes a string to UTF-16.\n *\n * @param input The string to be encoded.\n * @param byteOrderMark Whether or not a byte order marker (BOM) should be added\n * to the start of the encoding. (default `true`)\n * @returns A Uint16Array containing the UTF-16 encoding of the input string.\n *\n * -----------------------------------------------------------------------------\n *\n * JavaScript strings are composed of Unicode code points. Code points are\n * integers in the range 0 to 1,114,111 (0x10FFFF). When serializing a string,\n * it must be encoded as a sequence of words. A word is typically 8, 16, or 32\n * bytes in size. As such, Unicode defines three encoding forms: UTF-8, UTF-16,\n * and UTF-32. These encoding forms are described in the Unicode standard [1].\n * This function implements the UTF-16 encoding form.\n *\n * -----------------------------------------------------------------------------\n *\n * In UTF-16, each code point is mapped to one or two 16-bit integers. The\n * UTF-16 mapping logic is as follows [2]:\n *\n * • If a code point is in the range U+0000..U+FFFF, then map the code point to\n * a 16-bit integer with the most significant byte first.\n *\n * • If a code point is in the range U+10000..U+10000, then map the code point\n * to two 16-bit integers. The first integer should contain the high surrogate\n * and the second integer should contain the low surrogate. Both surrogates\n * should be written with the most significant byte first.\n *\n * -----------------------------------------------------------------------------\n *\n * It is important to note, when iterating through the code points of a string\n * in JavaScript, that if a character is encoded as a surrogate pair it will\n * increase the string's length by 2 instead of 1 [4]. For example:\n *\n * ```\n * > 'a'.length\n * 1\n * > '💩'.length\n * 2\n * > '語'.length\n * 1\n * > 'a💩語'.length\n * 4\n * ```\n *\n * The results of the above example are explained by the fact that the\n * characters 'a' and '語' are not represented by surrogate pairs, but '💩' is.\n *\n * Because of this idiosyncrasy in JavaScript's string implementation and APIs,\n * we must \"jump\" an extra index after encoding a character as a surrogate\n * pair. In practice, this means we must increment the index of our for loop by\n * 2 if we encode a surrogate pair, and 1 in all other cases.\n *\n * -----------------------------------------------------------------------------\n *\n * References:\n * - [1] https://www.unicode.org/versions/Unicode12.0.0/UnicodeStandard-12.0.pdf\n * 3.9 Unicode Encoding Forms - UTF-8\n * - [2] http://www.herongyang.com/Unicode/UTF-16-UTF-16-Encoding.html\n * - [3] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length#Description\n *\n */\nexport var utf16Encode = function (input, byteOrderMark) {\n if (byteOrderMark === void 0) {\n byteOrderMark = true;\n }\n var encoded = [];\n if (byteOrderMark) encoded.push(0xfeff);\n for (var idx = 0, len = input.length; idx < len;) {\n var codePoint = input.codePointAt(idx);\n // Two byte encoding\n if (codePoint < 0x010000) {\n encoded.push(codePoint);\n idx += 1;\n }\n // Four byte encoding (surrogate pair)\n else if (codePoint < 0x110000) {\n encoded.push(highSurrogate(codePoint), lowSurrogate(codePoint));\n idx += 2;\n }\n // Should never reach this case\n else throw new Error(\"Invalid code point: 0x\" + toHexString(codePoint));\n }\n return new Uint16Array(encoded);\n};\n/**\n * Returns `true` if the `codePoint` is within the\n * Basic Multilingual Plane (BMP). Code points inside the BMP are not encoded\n * with surrogate pairs.\n * @param codePoint The code point to be evaluated.\n *\n * Reference: https://en.wikipedia.org/wiki/UTF-16#Description\n */\nexport var isWithinBMP = function (codePoint) {\n return codePoint >= 0 && codePoint <= 0xffff;\n};\n/**\n * Returns `true` if the given `codePoint` is valid and must be represented\n * with a surrogate pair when encoded.\n * @param codePoint The code point to be evaluated.\n *\n * Reference: https://en.wikipedia.org/wiki/UTF-16#Description\n */\nexport var hasSurrogates = function (codePoint) {\n return codePoint >= 0x010000 && codePoint <= 0x10ffff;\n};\n// From Unicode 3.0 spec, section 3.7:\n// http://unicode.org/versions/Unicode3.0.0/ch03.pdf\nexport var highSurrogate = function (codePoint) {\n return Math.floor((codePoint - 0x10000) / 0x400) + 0xd800;\n};\n// From Unicode 3.0 spec, section 3.7:\n// http://unicode.org/versions/Unicode3.0.0/ch03.pdf\nexport var lowSurrogate = function (codePoint) {\n return (codePoint - 0x10000) % 0x400 + 0xdc00;\n};\nvar ByteOrder;\n(function (ByteOrder) {\n ByteOrder[\"BigEndian\"] = \"BigEndian\";\n ByteOrder[\"LittleEndian\"] = \"LittleEndian\";\n})(ByteOrder || (ByteOrder = {}));\nvar REPLACEMENT = '�'.codePointAt(0);\n/**\n * Decodes a Uint8Array of data to a string using UTF-16.\n *\n * Note that this function attempts to recover from erronous input by\n * inserting the replacement character (�) to mark invalid code points\n * and surrogate pairs.\n *\n * @param input A Uint8Array containing UTF-16 encoded data\n * @param byteOrderMark Whether or not a byte order marker (BOM) should be read\n * at the start of the encoding. (default `true`)\n * @returns The decoded string.\n */\nexport var utf16Decode = function (input, byteOrderMark) {\n if (byteOrderMark === void 0) {\n byteOrderMark = true;\n }\n // Need at least 2 bytes of data in UTF-16 encodings\n if (input.length <= 1) return String.fromCodePoint(REPLACEMENT);\n var byteOrder = byteOrderMark ? readBOM(input) : ByteOrder.BigEndian;\n // Skip byte order mark if needed\n var idx = byteOrderMark ? 2 : 0;\n var codePoints = [];\n while (input.length - idx >= 2) {\n var first = decodeValues(input[idx++], input[idx++], byteOrder);\n if (isHighSurrogate(first)) {\n if (input.length - idx < 2) {\n // Need at least 2 bytes left for the low surrogate that is required\n codePoints.push(REPLACEMENT);\n } else {\n var second = decodeValues(input[idx++], input[idx++], byteOrder);\n if (isLowSurrogate(second)) {\n codePoints.push(first, second);\n } else {\n // Low surrogates should always follow high surrogates\n codePoints.push(REPLACEMENT);\n }\n }\n } else if (isLowSurrogate(first)) {\n // High surrogates should always come first since `decodeValues()`\n // accounts for the byte ordering\n idx += 2;\n codePoints.push(REPLACEMENT);\n } else {\n codePoints.push(first);\n }\n }\n // There shouldn't be extra byte(s) left over\n if (idx < input.length) codePoints.push(REPLACEMENT);\n return String.fromCodePoint.apply(String, codePoints);\n};\n/**\n * Returns `true` if the given `codePoint` is a high surrogate.\n * @param codePoint The code point to be evaluated.\n *\n * Reference: https://en.wikipedia.org/wiki/UTF-16#Description\n */\nvar isHighSurrogate = function (codePoint) {\n return codePoint >= 0xd800 && codePoint <= 0xdbff;\n};\n/**\n * Returns `true` if the given `codePoint` is a low surrogate.\n * @param codePoint The code point to be evaluated.\n *\n * Reference: https://en.wikipedia.org/wiki/UTF-16#Description\n */\nvar isLowSurrogate = function (codePoint) {\n return codePoint >= 0xdc00 && codePoint <= 0xdfff;\n};\n/**\n * Decodes the given utf-16 values first and second using the specified\n * byte order.\n * @param first The first byte of the encoding.\n * @param second The second byte of the encoding.\n * @param byteOrder The byte order of the encoding.\n * Reference: https://en.wikipedia.org/wiki/UTF-16#Examples\n */\nvar decodeValues = function (first, second, byteOrder) {\n // Append the binary representation of the preceding byte by shifting the\n // first one 8 to the left and than applying a bitwise or-operator to append\n // the second one.\n if (byteOrder === ByteOrder.LittleEndian) return second << 8 | first;\n if (byteOrder === ByteOrder.BigEndian) return first << 8 | second;\n throw new Error(\"Invalid byteOrder: \" + byteOrder);\n};\n/**\n * Returns whether the given array contains a byte order mark for the\n * UTF-16BE or UTF-16LE encoding. If it has neither, BigEndian is assumed.\n *\n * Reference: https://en.wikipedia.org/wiki/Byte_order_mark#UTF-16\n *\n * @param bytes The byte array to be evaluated.\n */\n// prettier-ignore\nvar readBOM = function (bytes) {\n return hasUtf16BigEndianBOM(bytes) ? ByteOrder.BigEndian : hasUtf16LittleEndianBOM(bytes) ? ByteOrder.LittleEndian : ByteOrder.BigEndian;\n};\nvar hasUtf16BigEndianBOM = function (bytes) {\n return bytes[0] === 0xfe && bytes[1] === 0xff;\n};\nvar hasUtf16LittleEndianBOM = function (bytes) {\n return bytes[0] === 0xff && bytes[1] === 0xfe;\n};\nexport var hasUtf16BOM = function (bytes) {\n return hasUtf16BigEndianBOM(bytes) || hasUtf16LittleEndianBOM(bytes);\n};","module.exports = __webpack_public_path__ + \"static/contract-package-4-7572a5a6a2a24b1f1a78e1fd58015e98.pdf\";","/*\n * The `chars`, `lookup`, and `decodeFromBase64` members of this file are\n * licensed under the following:\n *\n * base64-arraybuffer\n * https://github.com/niklasvh/base64-arraybuffer\n *\n * Copyright (c) 2012 Niklas von Hertzen\n * Licensed under the MIT license.\n *\n */\nimport pako from 'pako';\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n// Use a lookup table to find the index.\nvar lookup = new Uint8Array(256);\nfor (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\nexport var decodeFromBase64 = function (base64) {\n var bufferLength = base64.length * 0.75;\n var len = base64.length;\n var i;\n var p = 0;\n var encoded1;\n var encoded2;\n var encoded3;\n var encoded4;\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n var bytes = new Uint8Array(bufferLength);\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n bytes[p++] = encoded1 << 2 | encoded2 >> 4;\n bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;\n bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;\n }\n return bytes;\n};\nvar arrayToString = function (array) {\n var str = '';\n for (var i = 0; i < array.length; i++) {\n str += String.fromCharCode(array[i]);\n }\n return str;\n};\nexport var decompressJson = function (compressedJson) {\n return arrayToString(pako.inflate(decodeFromBase64(compressedJson)));\n};\nexport var padStart = function (value, length, padChar) {\n var padding = '';\n for (var idx = 0, len = length - value.length; idx < len; idx++) {\n padding += padChar;\n }\n return padding + value;\n};","import { decompressJson } from './utils';\nimport CourierBoldCompressed from './Courier-Bold.compressed.json';\nimport CourierBoldObliqueCompressed from './Courier-BoldOblique.compressed.json';\nimport CourierObliqueCompressed from './Courier-Oblique.compressed.json';\nimport CourierCompressed from './Courier.compressed.json';\nimport HelveticaBoldCompressed from './Helvetica-Bold.compressed.json';\nimport HelveticaBoldObliqueCompressed from './Helvetica-BoldOblique.compressed.json';\nimport HelveticaObliqueCompressed from './Helvetica-Oblique.compressed.json';\nimport HelveticaCompressed from './Helvetica.compressed.json';\nimport TimesBoldCompressed from './Times-Bold.compressed.json';\nimport TimesBoldItalicCompressed from './Times-BoldItalic.compressed.json';\nimport TimesItalicCompressed from './Times-Italic.compressed.json';\nimport TimesRomanCompressed from './Times-Roman.compressed.json';\nimport SymbolCompressed from './Symbol.compressed.json';\nimport ZapfDingbatsCompressed from './ZapfDingbats.compressed.json';\n// prettier-ignore\nvar compressedJsonForFontName = {\n 'Courier': CourierCompressed,\n 'Courier-Bold': CourierBoldCompressed,\n 'Courier-Oblique': CourierObliqueCompressed,\n 'Courier-BoldOblique': CourierBoldObliqueCompressed,\n 'Helvetica': HelveticaCompressed,\n 'Helvetica-Bold': HelveticaBoldCompressed,\n 'Helvetica-Oblique': HelveticaObliqueCompressed,\n 'Helvetica-BoldOblique': HelveticaBoldObliqueCompressed,\n 'Times-Roman': TimesRomanCompressed,\n 'Times-Bold': TimesBoldCompressed,\n 'Times-Italic': TimesItalicCompressed,\n 'Times-BoldItalic': TimesBoldItalicCompressed,\n 'Symbol': SymbolCompressed,\n 'ZapfDingbats': ZapfDingbatsCompressed\n};\nexport var FontNames;\n(function (FontNames) {\n FontNames[\"Courier\"] = \"Courier\";\n FontNames[\"CourierBold\"] = \"Courier-Bold\";\n FontNames[\"CourierOblique\"] = \"Courier-Oblique\";\n FontNames[\"CourierBoldOblique\"] = \"Courier-BoldOblique\";\n FontNames[\"Helvetica\"] = \"Helvetica\";\n FontNames[\"HelveticaBold\"] = \"Helvetica-Bold\";\n FontNames[\"HelveticaOblique\"] = \"Helvetica-Oblique\";\n FontNames[\"HelveticaBoldOblique\"] = \"Helvetica-BoldOblique\";\n FontNames[\"TimesRoman\"] = \"Times-Roman\";\n FontNames[\"TimesRomanBold\"] = \"Times-Bold\";\n FontNames[\"TimesRomanItalic\"] = \"Times-Italic\";\n FontNames[\"TimesRomanBoldItalic\"] = \"Times-BoldItalic\";\n FontNames[\"Symbol\"] = \"Symbol\";\n FontNames[\"ZapfDingbats\"] = \"ZapfDingbats\";\n})(FontNames || (FontNames = {}));\nvar fontCache = {};\nvar Font = /** @class */function () {\n function Font() {\n var _this = this;\n this.getWidthOfGlyph = function (glyphName) {\n return _this.CharWidths[glyphName];\n };\n this.getXAxisKerningForPair = function (leftGlyphName, rightGlyphName) {\n return (_this.KernPairXAmounts[leftGlyphName] || {})[rightGlyphName];\n };\n }\n Font.load = function (fontName) {\n var cachedFont = fontCache[fontName];\n if (cachedFont) return cachedFont;\n var json = decompressJson(compressedJsonForFontName[fontName]);\n var font = Object.assign(new Font(), JSON.parse(json));\n font.CharWidths = font.CharMetrics.reduce(function (acc, metric) {\n acc[metric.N] = metric.WX;\n return acc;\n }, {});\n font.KernPairXAmounts = font.KernPairs.reduce(function (acc, _a) {\n var name1 = _a[0],\n name2 = _a[1],\n width = _a[2];\n if (!acc[name1]) acc[name1] = {};\n acc[name1][name2] = width;\n return acc;\n }, {});\n fontCache[fontName] = font;\n return font;\n };\n return Font;\n}();\nexport { Font };","/* tslint:disable max-classes-per-file */\nimport { decompressJson, padStart } from './utils';\nimport AllEncodingsCompressed from './all-encodings.compressed.json';\nvar decompressedEncodings = decompressJson(AllEncodingsCompressed);\nvar allUnicodeMappings = JSON.parse(decompressedEncodings);\nvar Encoding = /** @class */function () {\n function Encoding(name, unicodeMappings) {\n var _this = this;\n this.canEncodeUnicodeCodePoint = function (codePoint) {\n return codePoint in _this.unicodeMappings;\n };\n this.encodeUnicodeCodePoint = function (codePoint) {\n var mapped = _this.unicodeMappings[codePoint];\n if (!mapped) {\n var str = String.fromCharCode(codePoint);\n var hexCode = \"0x\" + padStart(codePoint.toString(16), 4, '0');\n var msg = _this.name + \" cannot encode \\\"\" + str + \"\\\" (\" + hexCode + \")\";\n throw new Error(msg);\n }\n return {\n code: mapped[0],\n name: mapped[1]\n };\n };\n this.name = name;\n this.supportedCodePoints = Object.keys(unicodeMappings).map(Number).sort(function (a, b) {\n return a - b;\n });\n this.unicodeMappings = unicodeMappings;\n }\n return Encoding;\n}();\nexport var Encodings = {\n Symbol: new Encoding('Symbol', allUnicodeMappings.symbol),\n ZapfDingbats: new Encoding('ZapfDingbats', allUnicodeMappings.zapfdingbats),\n WinAnsi: new Encoding('WinAnsi', allUnicodeMappings.win1252)\n};","module.exports = __webpack_public_path__ + \"static/contract-package-2-7a3e74d8491d139043d07df9a1bf4d53.pdf\";","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\nrequire(\"core-js/modules/es.regexp.flags.js\");\nvar utils = require('../utils/common');\nvar adler32 = require('./adler32');\nvar crc32 = require('./crc32');\nvar inflate_fast = require('./inffast');\nvar inflate_table = require('./inftrees');\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n/* Allowed flush values; see deflate() and inflate() below for details */\n//var Z_NO_FLUSH = 0;\n//var Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\n//var Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\nvar Z_TREES = 6;\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\nvar Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\nvar Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5;\n//var Z_VERSION_ERROR = -6;\n\n/* The deflate compression method */\nvar Z_DEFLATED = 8;\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\nvar HEAD = 1; /* i: waiting for magic header */\nvar FLAGS = 2; /* i: waiting for method and flags (gzip) */\nvar TIME = 3; /* i: waiting for modification time (gzip) */\nvar OS = 4; /* i: waiting for extra flags and operating system (gzip) */\nvar EXLEN = 5; /* i: waiting for extra length (gzip) */\nvar EXTRA = 6; /* i: waiting for extra bytes (gzip) */\nvar NAME = 7; /* i: waiting for end of file name (gzip) */\nvar COMMENT = 8; /* i: waiting for end of comment (gzip) */\nvar HCRC = 9; /* i: waiting for header crc (gzip) */\nvar DICTID = 10; /* i: waiting for dictionary check value */\nvar DICT = 11; /* waiting for inflateSetDictionary() call */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\nvar TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */\nvar STORED = 14; /* i: waiting for stored size (length and complement) */\nvar COPY_ = 15; /* i/o: same as COPY below, but only first time in */\nvar COPY = 16; /* i/o: waiting for input or output to copy stored block */\nvar TABLE = 17; /* i: waiting for dynamic block table lengths */\nvar LENLENS = 18; /* i: waiting for code length code lengths */\nvar CODELENS = 19; /* i: waiting for length/lit and distance code lengths */\nvar LEN_ = 20; /* i: same as LEN below, but only first time in */\nvar LEN = 21; /* i: waiting for length/lit/eob code */\nvar LENEXT = 22; /* i: waiting for length extra bits */\nvar DIST = 23; /* i: waiting for distance code */\nvar DISTEXT = 24; /* i: waiting for distance extra bits */\nvar MATCH = 25; /* o: waiting for output space to copy string */\nvar LIT = 26; /* o: waiting for output space to write literal */\nvar CHECK = 27; /* i: waiting for 32-bit check value */\nvar LENGTH = 28; /* i: waiting for 32-bit length (gzip) */\nvar DONE = 29; /* finished check, done -- remain here until reset */\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar MEM = 31; /* got an inflate() memory error -- remain here until reset */\nvar SYNC = 32; /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_WBITS = MAX_WBITS;\nfunction zswap32(q) {\n return (q >>> 24 & 0xff) + (q >>> 8 & 0xff00) + ((q & 0xff00) << 8) + ((q & 0xff) << 24);\n}\nfunction InflateState() {\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib) */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new utils.Buf16(320); /* temporary storage for code lengths */\n this.work = new utils.Buf16(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n}\nfunction inflateResetKeep(strm) {\n var state;\n if (!strm || !strm.state) {\n return Z_STREAM_ERROR;\n }\n state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) {\n /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.dmax = 32768;\n state.head = null /*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);\n state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\\n\"));\n return Z_OK;\n}\nfunction inflateReset(strm) {\n var state;\n if (!strm || !strm.state) {\n return Z_STREAM_ERROR;\n }\n state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n}\nfunction inflateReset2(strm, windowBits) {\n var wrap;\n var state;\n\n /* get the state */\n if (!strm || !strm.state) {\n return Z_STREAM_ERROR;\n }\n state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n } else {\n wrap = (windowBits >> 4) + 1;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n}\nfunction inflateInit2(strm, windowBits) {\n var ret;\n var state;\n if (!strm) {\n return Z_STREAM_ERROR;\n }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n strm.state = state;\n state.window = null /*Z_NULL*/;\n ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK) {\n strm.state = null /*Z_NULL*/;\n }\n return ret;\n}\nfunction inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n}\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nvar virgin = true;\nvar lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\nfunction fixedtables(state) {\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n var sym;\n lenfix = new utils.Buf32(512);\n distfix = new utils.Buf32(32);\n\n /* literal/length table */\n sym = 0;\n while (sym < 144) {\n state.lens[sym++] = 8;\n }\n while (sym < 256) {\n state.lens[sym++] = 9;\n }\n while (sym < 280) {\n state.lens[sym++] = 7;\n }\n while (sym < 288) {\n state.lens[sym++] = 8;\n }\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, {\n bits: 9\n });\n\n /* distance table */\n sym = 0;\n while (sym < 32) {\n state.lens[sym++] = 5;\n }\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, {\n bits: 5\n });\n\n /* do this just once */\n virgin = false;\n }\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n}\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nfunction updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n } else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n } else {\n state.wnext += dist;\n if (state.wnext === state.wsize) {\n state.wnext = 0;\n }\n if (state.whave < state.wsize) {\n state.whave += dist;\n }\n }\n }\n return 0;\n}\nfunction inflate(strm, flush) {\n var state;\n var input, output; // input/output buffers\n var next; /* next input INDEX */\n var put; /* next output INDEX */\n var have, left; /* available input and output */\n var hold; /* bit buffer */\n var bits; /* bits in bit buffer */\n var _in, _out; /* save starting available input and output */\n var copy; /* number of stored or match bytes to copy */\n var from; /* where to copy match bytes from */\n var from_source;\n var here = 0; /* current decoding table entry */\n var here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //var last; /* parent table entry */\n var last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n var len; /* length to copy for repeats, bits to drop */\n var ret; /* return code */\n var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */\n var opts;\n var n; // temporary var for NEED_BITS\n\n var order = /* permutation of code lengths */\n [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0) {\n return Z_STREAM_ERROR;\n }\n state = strm.state;\n if (state.mode === TYPE) {\n state.mode = TYPEDO;\n } /* skip check */\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK;\n inf_leave:\n // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) {\n break inf_leave;\n }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.wrap & 2 && hold === 0x8b1f) {\n /* gzip header */\n state.check = 0 /*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = hold >>> 8 & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n state.flags = 0; /* expect zlib header */\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff /*BITS(8)*/) << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f /*BITS(4)*/) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f /*BITS(4)*/) + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n } else if (len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n state.dmax = 1 << len;\n //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n strm.adler = state.check = 1 /*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) {\n break inf_leave;\n }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = hold >> 8 & 1;\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = hold >>> 8 & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) {\n break inf_leave;\n }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = hold >>> 8 & 0xff;\n hbuf[2] = hold >>> 16 & 0xff;\n hbuf[3] = hold >>> 24 & 0xff;\n state.check = crc32(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) {\n break inf_leave;\n }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = hold & 0xff;\n state.head.os = hold >> 8;\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = hold >>> 8 & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) {\n break inf_leave;\n }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = hold >>> 8 & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n } else if (state.head) {\n state.head.extra = null /*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) {\n copy = have;\n }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more convenient processing later\n state.head.extra = new Array(state.head.extra_len);\n }\n utils.arraySet(state.head.extra, input, next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n copy, /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len);\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) {\n break inf_leave;\n }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) {\n break inf_leave;\n }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len && state.length < 65536 /*state.head.name_max*/) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) {\n break inf_leave;\n }\n } else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) {\n break inf_leave;\n }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len && state.length < 65536 /*state.head.comm_max*/) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) {\n break inf_leave;\n }\n } else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) {\n break inf_leave;\n }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = state.flags >> 9 & 1;\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) {\n break inf_leave;\n }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT;\n }\n strm.adler = state.check = 1 /*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) {\n break inf_leave;\n }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) {\n break inf_leave;\n }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = hold & 0x01 /*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch (hold & 0x03 /*BITS(2)*/) {\n case 0:\n /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1:\n /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2:\n /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) {\n break inf_leave;\n }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== (hold >>> 16 ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) {\n break inf_leave;\n }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) {\n copy = have;\n }\n if (copy > left) {\n copy = left;\n }\n if (copy === 0) {\n break inf_leave;\n }\n //--- zmemcpy(put, next, copy); ---\n utils.arraySet(output, input, next, copy, put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\\n\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) {\n break inf_leave;\n }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f /*BITS(5)*/) + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f /*BITS(5)*/) + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f /*BITS(4)*/) + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n //#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n //#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) {\n break inf_leave;\n }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = hold & 0x07; //BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n opts = {\n bits: state.lenbits\n };\n ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & (1 << state.lenbits) - 1]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = here >>> 16 & 0xff;\n here_val = here & 0xffff;\n if (here_bits <= bits) {\n break;\n }\n //--- PULLBYTE() ---//\n if (have === 0) {\n break inf_leave;\n }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n } else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) {\n break inf_leave;\n }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03); //BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n } else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) {\n break inf_leave;\n }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07); //BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n } else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) {\n break inf_leave;\n }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f); //BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) {\n break;\n }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n opts = {\n bits: state.lenbits\n };\n ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = {\n bits: state.distbits\n };\n ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok\\n'));\n state.mode = LEN_;\n if (flush === Z_TREES) {\n break inf_leave;\n }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inflate_fast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & (1 << state.lenbits) - 1]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = here >>> 16 & 0xff;\n here_val = here & 0xffff;\n if (here_bits <= bits) {\n break;\n }\n //--- PULLBYTE() ---//\n if (have === 0) {\n break inf_leave;\n }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1 /*BITS(last.bits + last.op)*/) >> last_bits)];\n here_bits = here >>> 24;\n here_op = here >>> 16 & 0xff;\n here_val = here & 0xffff;\n if (last_bits + here_bits <= bits) {\n break;\n }\n //--- PULLBYTE() ---//\n if (have === 0) {\n break inf_leave;\n }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) {\n break inf_leave;\n }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & (1 << state.extra) - 1 /*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & (1 << state.distbits) - 1]; /*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = here >>> 16 & 0xff;\n here_val = here & 0xffff;\n if (here_bits <= bits) {\n break;\n }\n //--- PULLBYTE() ---//\n if (have === 0) {\n break inf_leave;\n }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1 /*BITS(last.bits + last.op)*/) >> last_bits)];\n here_bits = here >>> 24;\n here_op = here >>> 16 & 0xff;\n here_val = here & 0xffff;\n if (last_bits + here_bits <= bits) {\n break;\n }\n //--- PULLBYTE() ---//\n if (have === 0) {\n break inf_leave;\n }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = here_op & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) {\n break inf_leave;\n }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & (1 << state.extra) - 1 /*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n //#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) {\n break inf_leave;\n }\n copy = _out - left;\n if (state.offset > copy) {\n /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n // (!) This block is disabled in zlib defaults,\n // don't enable it for binary compatibility\n //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n // Trace((stderr, \"inflate.c too far\\n\"));\n // copy -= state.whave;\n // if (copy > state.length) { copy = state.length; }\n // if (copy > left) { copy = left; }\n // left -= copy;\n // state.length -= copy;\n // do {\n // output[put++] = 0;\n // } while (--copy);\n // if (state.length === 0) { state.mode = LEN; }\n // break;\n //#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n } else {\n from = state.wnext - copy;\n }\n if (copy > state.length) {\n copy = state.length;\n }\n from_source = state.window;\n } else {\n /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) {\n copy = left;\n }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) {\n state.mode = LEN;\n }\n break;\n case LIT:\n if (left === 0) {\n break inf_leave;\n }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) {\n break inf_leave;\n }\n have--;\n // Use '|' instead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if (_out) {\n strm.adler = state.check = /*UPDATE(state.check, put - _out, _out);*/\n state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out);\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) {\n break inf_leave;\n }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH)) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if (state.wrap && _out) {\n strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/\n state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out);\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if ((_in === 0 && _out === 0 || flush === Z_FINISH) && ret === Z_OK) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n}\nfunction inflateEnd(strm) {\n if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {\n return Z_STREAM_ERROR;\n }\n var state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK;\n}\nfunction inflateGetHeader(strm, head) {\n var state;\n\n /* check state */\n if (!strm || !strm.state) {\n return Z_STREAM_ERROR;\n }\n state = strm.state;\n if ((state.wrap & 2) === 0) {\n return Z_STREAM_ERROR;\n }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK;\n}\nfunction inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n var state;\n var dictid;\n var ret;\n\n /* check state */\n if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) {\n return Z_STREAM_ERROR;\n }\n state = strm.state;\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\\n\"));\n return Z_OK;\n}\nexports.inflateReset = inflateReset;\nexports.inflateReset2 = inflateReset2;\nexports.inflateResetKeep = inflateResetKeep;\nexports.inflateInit = inflateInit;\nexports.inflateInit2 = inflateInit2;\nexports.inflate = inflate;\nexports.inflateEnd = inflateEnd;\nexports.inflateGetHeader = inflateGetHeader;\nexports.inflateSetDictionary = inflateSetDictionary;\nexports.inflateInfo = 'pako inflate (from Nodeca project)';\n\n/* Not implemented\nexports.inflateCopy = inflateCopy;\nexports.inflateGetDictionary = inflateGetDictionary;\nexports.inflateMark = inflateMark;\nexports.inflatePrime = inflatePrime;\nexports.inflateSync = inflateSync;\nexports.inflateSyncPoint = inflateSyncPoint;\nexports.inflateUndermine = inflateUndermine;\n*/","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\nvar utils = require('../utils/common');\nvar trees = require('./trees');\nvar adler32 = require('./adler32');\nvar crc32 = require('./crc32');\nvar msg = require('./messages');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n/* Allowed flush values; see deflate() and inflate() below for details */\nvar Z_NO_FLUSH = 0;\nvar Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\nvar Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\n//var Z_TREES = 6;\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\n//var Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\n//var Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5;\n//var Z_VERSION_ERROR = -6;\n\n/* compression levels */\n//var Z_NO_COMPRESSION = 0;\n//var Z_BEST_SPEED = 1;\n//var Z_BEST_COMPRESSION = 9;\nvar Z_DEFAULT_COMPRESSION = -1;\nvar Z_FILTERED = 1;\nvar Z_HUFFMAN_ONLY = 2;\nvar Z_RLE = 3;\nvar Z_FIXED = 4;\nvar Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\n//var Z_BINARY = 0;\n//var Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n/* The deflate compression method */\nvar Z_DEFLATED = 8;\n\n/*============================================================================*/\n\nvar MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_MEM_LEVEL = 8;\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nvar D_CODES = 30;\n/* number of distance codes */\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\nvar MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1;\nvar PRESET_DICT = 0x20;\nvar INIT_STATE = 42;\nvar EXTRA_STATE = 69;\nvar NAME_STATE = 73;\nvar COMMENT_STATE = 91;\nvar HCRC_STATE = 103;\nvar BUSY_STATE = 113;\nvar FINISH_STATE = 666;\nvar BS_NEED_MORE = 1; /* block not completed, need more input or more output */\nvar BS_BLOCK_DONE = 2; /* block flush performed */\nvar BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nvar BS_FINISH_DONE = 4; /* finish done, accept no more input or output */\n\nvar OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nfunction err(strm, errorCode) {\n strm.msg = msg[errorCode];\n return errorCode;\n}\nfunction rank(f) {\n return (f << 1) - (f > 4 ? 9 : 0);\n}\nfunction zero(buf) {\n var len = buf.length;\n while (--len >= 0) {\n buf[len] = 0;\n }\n}\n\n/* =========================================================================\n * Flush as much pending output as possible. All deflate() output goes\n * through this function so some applications may wish to modify it\n * to avoid allocating a large strm->output buffer and copying into it.\n * (See also read_buf()).\n */\nfunction flush_pending(strm) {\n var s = strm.state;\n\n //_tr_flush_bits(s);\n var len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) {\n return;\n }\n utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n}\nfunction flush_block_only(s, last) {\n trees._tr_flush_block(s, s.block_start >= 0 ? s.block_start : -1, s.strstart - s.block_start, last);\n s.block_start = s.strstart;\n flush_pending(s.strm);\n}\nfunction put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n}\n\n/* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\nfunction putShortMSB(s, b) {\n // put_byte(s, (Byte)(b >> 8));\n // put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = b >>> 8 & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}\n\n/* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read. All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->input buffer and copying from it.\n * (See also flush_pending()).\n */\nfunction read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n if (len > size) {\n len = size;\n }\n if (len === 0) {\n return 0;\n }\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n } else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n strm.next_in += len;\n strm.total_in += len;\n return len;\n}\n\n/* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\nfunction longest_match(s, cur_match) {\n var chain_length = s.max_chain_length; /* max hash chain length */\n var scan = s.strstart; /* current string */\n var match; /* matched string */\n var len; /* length of current match */\n var best_len = s.prev_length; /* best match length so far */\n var nice_match = s.nice_match; /* stop if match long enough */\n var limit = s.strstart > s.w_size - MIN_LOOKAHEAD ? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0 /*NIL*/;\n var _win = s.window; // shortcut\n\n var wmask = s.w_mask;\n var prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n var strend = s.strstart + MAX_MATCH;\n var scan_end1 = _win[scan + best_len - 1];\n var scan_end = _win[scan + best_len];\n\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if (nice_match > s.lookahead) {\n nice_match = s.lookahead;\n }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n\n if (_win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1]) {\n continue;\n }\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2;\n match++;\n // Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n /*jshint noempty:false*/\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n if (len >= nice_match) {\n break;\n }\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n}\n\n/* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n * At least one byte has been read, or avail_in == 0; reads are\n * performed for at least two bytes (required for the zip translate_eol\n * option -- not supported here).\n */\nfunction fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = m >= _w_size ? m - _w_size : 0;\n } while (--n);\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = m >= _w_size ? m - _w_size : 0;\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask;\n //#if MIN_MATCH != 3\n // Call update_hash() MIN_MATCH-3 more times\n //#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n // if (s.high_water < s.window_size) {\n // var curr = s.strstart + s.lookahead;\n // var init = 0;\n //\n // if (s.high_water < curr) {\n // /* Previous high water mark below current data -- zero WIN_INIT\n // * bytes or up to end of window, whichever is less.\n // */\n // init = s.window_size - curr;\n // if (init > WIN_INIT)\n // init = WIN_INIT;\n // zmemzero(s->window + curr, (unsigned)init);\n // s->high_water = curr + init;\n // }\n // else if (s->high_water < (ulg)curr + WIN_INIT) {\n // /* High water mark at or above current data, but below current data\n // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n // * to end of window, whichever is less.\n // */\n // init = (ulg)curr + WIN_INIT - s->high_water;\n // if (init > s->window_size - s->high_water)\n // init = s->window_size - s->high_water;\n // zmemzero(s->window + s->high_water, (unsigned)init);\n // s->high_water += init;\n // }\n // }\n //\n // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n // \"not enough room for search\");\n}\n\n/* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n * This function does not insert new strings in the dictionary since\n * uncompressible data is probably not useful. This function is used\n * only for the level=0 compression option.\n * NOTE: this function should be optimized to avoid extra copying from\n * window to pending_buf.\n */\nfunction deflate_stored(s, flush) {\n /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */\n var max_block_size = 0xffff;\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\n\n /* Copy as much as possible from input to output: */\n for (;;) {\n /* Fill the window as much as possible: */\n if (s.lookahead <= 1) {\n //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n // s->block_start >= (long)s->w_size, \"slide too late\");\n // if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n // s.block_start >= s.w_size)) {\n // throw new Error(\"slide too late\");\n // }\n\n fill_window(s);\n if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n }\n //Assert(s->block_start >= 0L, \"block gone\");\n // if (s.block_start < 0) throw new Error(\"block gone\");\n\n s.strstart += s.lookahead;\n s.lookahead = 0;\n\n /* Emit a stored block if pending_buf will be full: */\n var max_start = s.block_start + max_block_size;\n if (s.strstart === 0 || s.strstart >= max_start) {\n /* strstart == 0 is possible when wraparound on 16-bit machine */\n s.lookahead = s.strstart - max_start;\n s.strstart = max_start;\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n /* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */\n if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.strstart > s.block_start) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_NEED_MORE;\n}\n\n/* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\nfunction deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0 /*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0 /*NIL*/ && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match /*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n //#if MIN_MATCH != 3\n // Call UPDATE_HASH() MIN_MATCH-3 more times\n //#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\nfunction deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break;\n } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0 /*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n if (hash_head !== 0 /*NIL*/ && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD /*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096 /*TOO_FAR*/)) {\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * For Z_RLE, simply look for runs of bytes, generate matches only of distance\n * one. Do not maintain a hash table. (It will be regenerated if this run of\n * deflate switches away from Z_RLE.)\n */\nfunction deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break;\n } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.\n * (It will be regenerated if this run of deflate switches away from Huffman.)\n */\nfunction deflate_huff(s, flush) {\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we have a literal to write. */\n if (s.lookahead === 0) {\n fill_window(s);\n if (s.lookahead === 0) {\n if (flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n break; /* flush the current block */\n }\n }\n\n /* Output a literal byte */\n s.match_length = 0;\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\nfunction Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}\nvar configuration_table;\nconfiguration_table = [/* good lazy nice chain */\nnew Config(0, 0, 0, 0, deflate_stored), /* 0 store only */\nnew Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */\nnew Config(4, 5, 16, 8, deflate_fast), /* 2 */\nnew Config(4, 6, 32, 32, deflate_fast), /* 3 */\n\nnew Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */\nnew Config(8, 16, 32, 32, deflate_slow), /* 5 */\nnew Config(8, 16, 128, 128, deflate_slow), /* 6 */\nnew Config(8, 32, 128, 256, deflate_slow), /* 7 */\nnew Config(32, 128, 258, 1024, deflate_slow), /* 8 */\nnew Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */];\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nfunction lm_init(s) {\n s.window_size = 2 * s.w_size;\n\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n\n /* Set the default configuration parameters:\n */\n s.max_lazy_match = configuration_table[s.level].max_lazy;\n s.good_match = configuration_table[s.level].good_length;\n s.nice_match = configuration_table[s.level].nice_length;\n s.max_chain_length = configuration_table[s.level].max_chain;\n s.strstart = 0;\n s.block_start = 0;\n s.lookahead = 0;\n s.insert = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n s.ins_h = 0;\n}\nfunction DeflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.status = 0; /* as the name implies */\n this.pending_buf = null; /* output still pending */\n this.pending_buf_size = 0; /* size of pending_buf */\n this.pending_out = 0; /* next pending byte to output to the stream */\n this.pending = 0; /* nb of bytes in the pending buffer */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.gzhead = null; /* gzip header information to write */\n this.gzindex = 0; /* where in extra, name, or comment */\n this.method = Z_DEFLATED; /* can only be DEFLATED */\n this.last_flush = -1; /* value of flush param for previous deflate call */\n\n this.w_size = 0; /* LZ77 window size (32K by default) */\n this.w_bits = 0; /* log2(w_size) (8..16) */\n this.w_mask = 0; /* w_size - 1 */\n\n this.window = null;\n /* Sliding window. Input bytes are read into the second half of the window,\n * and move to the first half later to keep a dictionary of at least wSize\n * bytes. With this organization, matches are limited to a distance of\n * wSize-MAX_MATCH bytes, but this ensures that IO is always\n * performed with a length multiple of the block size.\n */\n\n this.window_size = 0;\n /* Actual size of window: 2*wSize, except when the user input buffer\n * is directly used as sliding window.\n */\n\n this.prev = null;\n /* Link to older string with same hash index. To limit the size of this\n * array to 64K, this link is maintained only for the last 32K strings.\n * An index in this array is thus a window index modulo 32K.\n */\n\n this.head = null; /* Heads of the hash chains or NIL. */\n\n this.ins_h = 0; /* hash index of string to be inserted */\n this.hash_size = 0; /* number of elements in hash table */\n this.hash_bits = 0; /* log2(hash_size) */\n this.hash_mask = 0; /* hash_size-1 */\n\n this.hash_shift = 0;\n /* Number of bits by which ins_h must be shifted at each input\n * step. It must be such that after MIN_MATCH steps, the oldest\n * byte no longer takes part in the hash key, that is:\n * hash_shift * MIN_MATCH >= hash_bits\n */\n\n this.block_start = 0;\n /* Window position at the beginning of the current output block. Gets\n * negative when the window is moved backwards.\n */\n\n this.match_length = 0; /* length of best match */\n this.prev_match = 0; /* previous match */\n this.match_available = 0; /* set if previous match exists */\n this.strstart = 0; /* start of string to insert */\n this.match_start = 0; /* start of matching string */\n this.lookahead = 0; /* number of valid bytes ahead in window */\n\n this.prev_length = 0;\n /* Length of the best match at previous step. Matches not greater than this\n * are discarded. This is used in the lazy match evaluation.\n */\n\n this.max_chain_length = 0;\n /* To speed up deflation, hash chains are never searched beyond this\n * length. A higher limit improves compression ratio but degrades the\n * speed.\n */\n\n this.max_lazy_match = 0;\n /* Attempt to find a better match only when the current match is strictly\n * smaller than this value. This mechanism is used only for compression\n * levels >= 4.\n */\n // That's alias to max_lazy_match, don't use directly\n //this.max_insert_length = 0;\n /* Insert new strings in the hash table only if the match length is not\n * greater than this length. This saves time but degrades compression.\n * max_insert_length is used only for compression levels <= 3.\n */\n\n this.level = 0; /* compression level (1..9) */\n this.strategy = 0; /* favor or force Huffman coding*/\n\n this.good_match = 0;\n /* Use a faster search when the previous match is longer than this */\n\n this.nice_match = 0; /* Stop searching when current match exceeds this */\n\n /* used by trees.c: */\n\n /* Didn't use ct_data typedef below to suppress compiler warning */\n\n // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */\n // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */\n\n // Use flat array of DOUBLE size, with interleaved fata,\n // because JS does not support effective\n this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);\n this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);\n this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);\n zero(this.dyn_ltree);\n zero(this.dyn_dtree);\n zero(this.bl_tree);\n this.l_desc = null; /* desc. for literal tree */\n this.d_desc = null; /* desc. for distance tree */\n this.bl_desc = null; /* desc. for bit length tree */\n\n //ush bl_count[MAX_BITS+1];\n this.bl_count = new utils.Buf16(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */\n zero(this.heap);\n this.heap_len = 0; /* number of elements in the heap */\n this.heap_max = 0; /* element of largest frequency */\n /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n * The same heap array is used to build all trees.\n */\n\n this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n zero(this.depth);\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n\n this.l_buf = 0; /* buffer index for literals or lengths */\n\n this.lit_bufsize = 0;\n /* Size of match buffer for literals/lengths. There are 4 reasons for\n * limiting lit_bufsize to 64K:\n * - frequencies can be kept in 16 bit counters\n * - if compression is not successful for the first block, all input\n * data is still in the window so we can still emit a stored block even\n * when input comes from standard input. (This can also be done for\n * all blocks if lit_bufsize is not greater than 32K.)\n * - if compression is not successful for a file smaller than 64K, we can\n * even emit a stored file instead of a stored block (saving 5 bytes).\n * This is applicable only for zip (not gzip or zlib).\n * - creating new Huffman trees less frequently may not provide fast\n * adaptation to changes in the input data statistics. (Take for\n * example a binary file with poorly compressible code followed by\n * a highly compressible string table.) Smaller buffer sizes give\n * fast adaptation but have of course the overhead of transmitting\n * trees more frequently.\n * - I can't count above 4\n */\n\n this.last_lit = 0; /* running index in l_buf */\n\n this.d_buf = 0;\n /* Buffer index for distances. To simplify the code, d_buf and l_buf have\n * the same number of elements. To use different lengths, an extra flag\n * array would be necessary.\n */\n\n this.opt_len = 0; /* bit length of current block with optimal trees */\n this.static_len = 0; /* bit length of current block with static trees */\n this.matches = 0; /* number of string matches in current block */\n this.insert = 0; /* bytes at end of window left to insert */\n\n this.bi_buf = 0;\n /* Output buffer. bits are inserted starting at the bottom (least\n * significant bits).\n */\n this.bi_valid = 0;\n /* Number of valid bits in bi_buf. All bits above the last valid bit\n * are always zero.\n */\n\n // Used for window memory init. We safely ignore it for JS. That makes\n // sense only for pointers and memory check tools.\n //this.high_water = 0;\n /* High water mark offset in window for initialized bytes -- bytes above\n * this are set to zero in order to avoid memory check warnings when\n * longest match routines access bytes past the input. This is then\n * updated to the new high water mark.\n */\n}\nfunction deflateResetKeep(strm) {\n var s;\n if (!strm || !strm.state) {\n return err(strm, Z_STREAM_ERROR);\n }\n strm.total_in = strm.total_out = 0;\n strm.data_type = Z_UNKNOWN;\n s = strm.state;\n s.pending = 0;\n s.pending_out = 0;\n if (s.wrap < 0) {\n s.wrap = -s.wrap;\n /* was made negative by deflate(..., Z_FINISH); */\n }\n s.status = s.wrap ? INIT_STATE : BUSY_STATE;\n strm.adler = s.wrap === 2 ? 0 // crc32(0, Z_NULL, 0)\n : 1; // adler32(0, Z_NULL, 0)\n s.last_flush = Z_NO_FLUSH;\n trees._tr_init(s);\n return Z_OK;\n}\nfunction deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK) {\n lm_init(strm.state);\n }\n return ret;\n}\nfunction deflateSetHeader(strm, head) {\n if (!strm || !strm.state) {\n return Z_STREAM_ERROR;\n }\n if (strm.state.wrap !== 2) {\n return Z_STREAM_ERROR;\n }\n strm.state.gzhead = head;\n return Z_OK;\n}\nfunction deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm) {\n // === Z_NULL\n return Z_STREAM_ERROR;\n }\n var wrap = 1;\n if (level === Z_DEFAULT_COMPRESSION) {\n level = 6;\n }\n if (windowBits < 0) {\n /* suppress zlib wrapper */\n wrap = 0;\n windowBits = -windowBits;\n } else if (windowBits > 15) {\n wrap = 2; /* write gzip wrapper instead */\n windowBits -= 16;\n }\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) {\n return err(strm, Z_STREAM_ERROR);\n }\n if (windowBits === 8) {\n windowBits = 9;\n }\n /* until 256-byte window bug fixed */\n\n var s = new DeflateState();\n strm.state = s;\n s.strm = strm;\n s.wrap = wrap;\n s.gzhead = null;\n s.w_bits = windowBits;\n s.w_size = 1 << s.w_bits;\n s.w_mask = s.w_size - 1;\n s.hash_bits = memLevel + 7;\n s.hash_size = 1 << s.hash_bits;\n s.hash_mask = s.hash_size - 1;\n s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n s.window = new utils.Buf8(s.w_size * 2);\n s.head = new utils.Buf16(s.hash_size);\n s.prev = new utils.Buf16(s.w_size);\n\n // Don't need mem init magic for JS.\n //s.high_water = 0; /* nothing written to s->window yet */\n\n s.lit_bufsize = 1 << memLevel + 6; /* 16K elements by default */\n\n s.pending_buf_size = s.lit_bufsize * 4;\n\n //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);\n //s->pending_buf = (uchf *) overlay;\n s.pending_buf = new utils.Buf8(s.pending_buf_size);\n\n // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);\n s.d_buf = 1 * s.lit_bufsize;\n\n //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;\n s.l_buf = (1 + 2) * s.lit_bufsize;\n s.level = level;\n s.strategy = strategy;\n s.method = method;\n return deflateReset(strm);\n}\nfunction deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n}\nfunction deflate(strm, flush) {\n var old_flush, s;\n var beg, val; // for gzip header write only\n\n if (!strm || !strm.state || flush > Z_BLOCK || flush < 0) {\n return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n }\n s = strm.state;\n if (!strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH) {\n return err(strm, strm.avail_out === 0 ? Z_BUF_ERROR : Z_STREAM_ERROR);\n }\n s.strm = strm; /* just in case */\n old_flush = s.last_flush;\n s.last_flush = flush;\n\n /* Write the header */\n if (s.status === INIT_STATE) {\n if (s.wrap === 2) {\n // GZIP header\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n put_byte(s, 31);\n put_byte(s, 139);\n put_byte(s, 8);\n if (!s.gzhead) {\n // s->gzhead == Z_NULL\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0);\n put_byte(s, OS_CODE);\n s.status = BUSY_STATE;\n } else {\n put_byte(s, (s.gzhead.text ? 1 : 0) + (s.gzhead.hcrc ? 2 : 0) + (!s.gzhead.extra ? 0 : 4) + (!s.gzhead.name ? 0 : 8) + (!s.gzhead.comment ? 0 : 16));\n put_byte(s, s.gzhead.time & 0xff);\n put_byte(s, s.gzhead.time >> 8 & 0xff);\n put_byte(s, s.gzhead.time >> 16 & 0xff);\n put_byte(s, s.gzhead.time >> 24 & 0xff);\n put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0);\n put_byte(s, s.gzhead.os & 0xff);\n if (s.gzhead.extra && s.gzhead.extra.length) {\n put_byte(s, s.gzhead.extra.length & 0xff);\n put_byte(s, s.gzhead.extra.length >> 8 & 0xff);\n }\n if (s.gzhead.hcrc) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n }\n s.gzindex = 0;\n s.status = EXTRA_STATE;\n }\n } else\n // DEFLATE header\n {\n var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8;\n var level_flags = -1;\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n level_flags = 0;\n } else if (s.level < 6) {\n level_flags = 1;\n } else if (s.level === 6) {\n level_flags = 2;\n } else {\n level_flags = 3;\n }\n header |= level_flags << 6;\n if (s.strstart !== 0) {\n header |= PRESET_DICT;\n }\n header += 31 - header % 31;\n s.status = BUSY_STATE;\n putShortMSB(s, header);\n\n /* Save the adler32 of the preset dictionary: */\n if (s.strstart !== 0) {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n strm.adler = 1; // adler32(0L, Z_NULL, 0);\n }\n }\n\n //#ifdef GZIP\n if (s.status === EXTRA_STATE) {\n if (s.gzhead.extra /* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n\n while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n break;\n }\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);\n s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (s.gzindex === s.gzhead.extra.length) {\n s.gzindex = 0;\n s.status = NAME_STATE;\n }\n } else {\n s.status = NAME_STATE;\n }\n }\n if (s.status === NAME_STATE) {\n if (s.gzhead.name /* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.name.length) {\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.gzindex = 0;\n s.status = COMMENT_STATE;\n }\n } else {\n s.status = COMMENT_STATE;\n }\n }\n if (s.status === COMMENT_STATE) {\n if (s.gzhead.comment /* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.comment.length) {\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.status = HCRC_STATE;\n }\n } else {\n s.status = HCRC_STATE;\n }\n }\n if (s.status === HCRC_STATE) {\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size) {\n flush_pending(strm);\n }\n if (s.pending + 2 <= s.pending_buf_size) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, strm.adler >> 8 & 0xff);\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n s.status = BUSY_STATE;\n }\n } else {\n s.status = BUSY_STATE;\n }\n }\n //#endif\n\n /* Flush as much pending output as possible */\n if (s.pending !== 0) {\n flush_pending(strm);\n if (strm.avail_out === 0) {\n /* Since avail_out is 0, deflate will be called again with\n * more output space, but possibly with both pending and\n * avail_in equal to zero. There won't be anything to do,\n * but this is not an error situation so make sure we\n * return OK instead of BUF_ERROR at next call of deflate:\n */\n s.last_flush = -1;\n return Z_OK;\n }\n\n /* Make sure there is something to do and avoid duplicate consecutive\n * flushes. For repeated and useless calls with Z_FINISH, we keep\n * returning Z_STREAM_END instead of Z_BUF_ERROR.\n */\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* User must not provide more input after the first FINISH: */\n if (s.status === FINISH_STATE && strm.avail_in !== 0) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* Start a new block or continue the current one.\n */\n if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH && s.status !== FINISH_STATE) {\n var bstate = s.strategy === Z_HUFFMAN_ONLY ? deflate_huff(s, flush) : s.strategy === Z_RLE ? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush);\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {\n s.status = FINISH_STATE;\n }\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0) {\n s.last_flush = -1;\n /* avoid BUF_ERROR next call, see above */\n }\n return Z_OK;\n /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n * of deflate should use the same flush parameter to make sure\n * that the flush is complete. So we don't have to output an\n * empty block here, this will be done at next call. This also\n * ensures that for a very small output buffer, we emit at most\n * one empty block.\n */\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH) {\n trees._tr_align(s);\n } else if (flush !== Z_BLOCK) {\n /* FULL_FLUSH or SYNC_FLUSH */\n\n trees._tr_stored_block(s, 0, 0, false);\n /* For a full flush, this empty block will be recognized\n * as a special marker by inflate_sync().\n */\n if (flush === Z_FULL_FLUSH) {\n /*** CLEAR_HASH(s); ***/ /* forget history */\n zero(s.head); // Fill with NIL (= 0);\n\n if (s.lookahead === 0) {\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n }\n }\n flush_pending(strm);\n if (strm.avail_out === 0) {\n s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */\n return Z_OK;\n }\n }\n }\n //Assert(strm->avail_out > 0, \"bug2\");\n //if (strm.avail_out <= 0) { throw new Error(\"bug2\");}\n\n if (flush !== Z_FINISH) {\n return Z_OK;\n }\n if (s.wrap <= 0) {\n return Z_STREAM_END;\n }\n\n /* Write the trailer */\n if (s.wrap === 2) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, strm.adler >> 8 & 0xff);\n put_byte(s, strm.adler >> 16 & 0xff);\n put_byte(s, strm.adler >> 24 & 0xff);\n put_byte(s, strm.total_in & 0xff);\n put_byte(s, strm.total_in >> 8 & 0xff);\n put_byte(s, strm.total_in >> 16 & 0xff);\n put_byte(s, strm.total_in >> 24 & 0xff);\n } else {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n flush_pending(strm);\n /* If avail_out is zero, the application will call deflate again\n * to flush the rest.\n */\n if (s.wrap > 0) {\n s.wrap = -s.wrap;\n }\n /* write the trailer only once! */\n return s.pending !== 0 ? Z_OK : Z_STREAM_END;\n}\nfunction deflateEnd(strm) {\n var status;\n if (!strm /*== Z_NULL*/ || !strm.state /*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n status = strm.state.status;\n if (status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE) {\n return err(strm, Z_STREAM_ERROR);\n }\n strm.state = null;\n return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;\n}\n\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\nfunction deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n var s;\n var str, n;\n var wrap;\n var avail;\n var next;\n var input;\n var tmpDict;\n if (!strm /*== Z_NULL*/ || !strm.state /*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n s = strm.state;\n wrap = s.wrap;\n if (wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead) {\n return Z_STREAM_ERROR;\n }\n\n /* when using zlib wrappers, compute Adler-32 for provided dictionary */\n if (wrap === 1) {\n /* adler32(strm->adler, dictionary, dictLength); */\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n }\n s.wrap = 0; /* avoid computing Adler-32 in read_buf */\n\n /* if dictionary would fill window, just replace the history */\n if (dictLength >= s.w_size) {\n if (wrap === 0) {\n /* already empty otherwise */\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n /* use the tail */\n // dictionary = dictionary.slice(dictLength - s.w_size);\n tmpDict = new utils.Buf8(s.w_size);\n utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);\n dictionary = tmpDict;\n dictLength = s.w_size;\n }\n /* insert dictionary into window and hash */\n avail = strm.avail_in;\n next = strm.next_in;\n input = strm.input;\n strm.avail_in = dictLength;\n strm.next_in = 0;\n strm.input = dictionary;\n fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart;\n n = s.lookahead - (MIN_MATCH - 1);\n do {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n } while (--n);\n s.strstart = str;\n s.lookahead = MIN_MATCH - 1;\n fill_window(s);\n }\n s.strstart += s.lookahead;\n s.block_start = s.strstart;\n s.insert = s.lookahead;\n s.lookahead = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n strm.next_in = next;\n strm.input = input;\n strm.avail_in = avail;\n s.wrap = wrap;\n return Z_OK;\n}\nexports.deflateInit = deflateInit;\nexports.deflateInit2 = deflateInit2;\nexports.deflateReset = deflateReset;\nexports.deflateResetKeep = deflateResetKeep;\nexports.deflateSetHeader = deflateSetHeader;\nexports.deflate = deflate;\nexports.deflateEnd = deflateEnd;\nexports.deflateSetDictionary = deflateSetDictionary;\nexports.deflateInfo = 'pako deflate (from Nodeca project)';\n\n/* Not implemented\nexports.deflateBound = deflateBound;\nexports.deflateCopy = deflateCopy;\nexports.deflateParams = deflateParams;\nexports.deflatePending = deflatePending;\nexports.deflatePrime = deflatePrime;\nexports.deflateTune = deflateTune;\n*/","\"use strict\";\n\nexports.__esModule = !0, exports.default = void 0;\nvar _base = _interopRequireDefault(require(\"@emotion/styled/base\")),\n _react = _interopRequireWildcard(require(\"react\")),\n _util = require(\"../util\"),\n PropTypes = _interopRequireWildcard(require(\"prop-types\")),\n _constants = require(\"../constants\");\nfunction _getRequireWildcardCache(a) {\n if (\"function\" != typeof WeakMap) return null;\n var b = new WeakMap(),\n c = new WeakMap();\n return (_getRequireWildcardCache = function (a) {\n return a ? c : b;\n })(a);\n}\nfunction _interopRequireWildcard(a, b) {\n if (!b && a && a.__esModule) return a;\n if (null === a || \"object\" != typeof a && \"function\" != typeof a) return {\n default: a\n };\n var c = _getRequireWildcardCache(b);\n if (c && c.has(a)) return c.get(a);\n var d = {},\n e = Object.defineProperty && Object.getOwnPropertyDescriptor;\n for (var f in a) if (\"default\" != f && Object.prototype.hasOwnProperty.call(a, f)) {\n var g = e ? Object.getOwnPropertyDescriptor(a, f) : null;\n g && (g.get || g.set) ? Object.defineProperty(d, f, g) : d[f] = a[f];\n }\n return d.default = a, c && c.set(a, d), d;\n}\nfunction _interopRequireDefault(a) {\n return a && a.__esModule ? a : {\n default: a\n };\n}\nfunction _inheritsLoose(a, b) {\n a.prototype = Object.create(b.prototype), a.prototype.constructor = a, _setPrototypeOf(a, b);\n}\nfunction _setPrototypeOf(a, b) {\n return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (a, b) {\n return a.__proto__ = b, a;\n }, _setPrototypeOf(a, b);\n}\nvar handlePlaceHolder = function (a, b) {\n var c = a.addPlaceholder,\n d = a.searchable,\n e = a.placeholder,\n f = b.values && 0 === b.values.length,\n g = b.values && 0 < b.values.length;\n return g && c && d ? c : f ? e : g && !d ? \"\" : \"\";\n },\n Input = /*#__PURE__*/function (a) {\n function b() {\n for (var b, c = arguments.length, d = Array(c), e = 0; e < c; e++) d[e] = arguments[e];\n return b = a.call.apply(a, [this].concat(d)) || this, b.input = /*#__PURE__*/_react.default.createRef(), b.onBlur = function (a) {\n return a.stopPropagation(), b.props.state.dropdown ? b.input.current.focus() : b.input.current.blur();\n }, b.handleKeyPress = function (a) {\n var c = b.props,\n d = c.props,\n e = c.state,\n f = c.methods;\n return d.create && \"Enter\" === a.key && !(0, _util.valueExistInSelected)(e.search, [].concat(e.values, d.options), b.props) && e.search && null === e.cursor && f.createNew(e.search);\n }, b;\n }\n _inheritsLoose(b, a);\n var c = b.prototype;\n return c.componentDidUpdate = function componentDidUpdate(a) {\n (this.props.state.dropdown || a.state.dropdown !== this.props.state.dropdown && this.props.state.dropdown || this.props.props.autoFocus) && this.input.current.focus(), a.state.dropdown === this.props.state.dropdown || this.props.state.dropdown || this.input.current.blur();\n }, c.render = function render() {\n var a = this.props,\n b = a.props,\n c = a.state,\n d = a.methods;\n return b.inputRenderer ? b.inputRenderer({\n props: b,\n state: c,\n methods: d,\n inputRef: this.input\n }) : /*#__PURE__*/_react.default.createElement(InputComponent, {\n ref: this.input,\n tabIndex: \"-1\",\n onFocus: function onFocus(a) {\n return a.stopPropagation();\n },\n className: _constants.LIB_NAME + \"-input\",\n size: d.getInputSize(),\n value: c.search,\n readOnly: !b.searchable,\n onClick: function onClick() {\n return d.dropDown(\"open\");\n },\n onKeyPress: this.handleKeyPress,\n onChange: d.setSearch,\n onBlur: this.onBlur,\n placeholder: handlePlaceHolder(b, c),\n disabled: b.disabled\n });\n }, b;\n }(_react.Component),\n InputComponent = /*#__PURE__*/(0, _base.default)(\"input\", \"production\" === process.env.NODE_ENV ? {\n target: \"e11wid6y0\"\n } : {\n target: \"e11wid6y0\",\n label: \"InputComponent\"\n })(\"line-height:inherit;border:none;margin-left:5px;background:transparent;padding:0;width:calc(\", function (a) {\n var b = a.size;\n return b + \"ch\";\n }, \" + 5px);font-size:smaller;\", function (a) {\n var b = a.readOnly;\n return b && \"cursor: pointer;\";\n }, \" :focus{outline:none;}\" + (\"production\" === process.env.NODE_ENV ? \"\" : \"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL0lucHV0LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWlHbUMiLCJmaWxlIjoiLi4vLi4vc3JjL2NvbXBvbmVudHMvSW5wdXQuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgQ29tcG9uZW50IH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IHsgdmFsdWVFeGlzdEluU2VsZWN0ZWQgfSBmcm9tICcuLi91dGlsJztcbmltcG9ydCAqIGFzIFByb3BUeXBlcyBmcm9tICdwcm9wLXR5cGVzJztcbmltcG9ydCB7IExJQl9OQU1FIH0gZnJvbSAnLi4vY29uc3RhbnRzJztcblxuY29uc3QgaGFuZGxlUGxhY2VIb2xkZXIgPSAocHJvcHMsIHN0YXRlKSA9PiB7XG4gIGNvbnN0IHsgYWRkUGxhY2Vob2xkZXIsIHNlYXJjaGFibGUsIHBsYWNlaG9sZGVyIH0gPSBwcm9wcztcbiAgY29uc3Qgbm9WYWx1ZXMgPSBzdGF0ZS52YWx1ZXMgJiYgc3RhdGUudmFsdWVzLmxlbmd0aCA9PT0gMDtcbiAgY29uc3QgaGFzVmFsdWVzID0gc3RhdGUudmFsdWVzICYmIHN0YXRlLnZhbHVlcy5sZW5ndGggPiAwO1xuXG4gIGlmIChoYXNWYWx1ZXMgJiYgYWRkUGxhY2Vob2xkZXIgJiYgc2VhcmNoYWJsZSkge1xuICAgIHJldHVybiBhZGRQbGFjZWhvbGRlcjtc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25DbGljaz17KCkgPT4gbWV0aG9kcy5kcm9wRG93bignb3BlbicpfVxuICAgICAgICBvbktleVByZXNzPXt0aGlzLmhhbmRsZUtleVByZXNzfVxuICAgICAgICBvbkNoYW5nZT17bWV0aG9kcy5zZXRTZWFyY2h9XG4gICAgICAgIG9uQmx1cj17dGhpcy5vbkJsdXJ9XG4gICAgICAgIHBsYWNlaG9sZGVyPXtoYW5kbGVQbGFjZUhvbGRlcihwcm9wcywgc3RhdGUpfVxuICAgICAgICBkaXNhYmxlZD17cHJvcHMuZGlzYWJsZWR9XG4gICAgICAvPlxuICAgICk7XG4gIH1cbn1cblxuSW5wdXQucHJvcFR5cGVzID0ge1xuICBwcm9wczogUHJvcFR5cGVzLm9iamVjdCxcbiAgc3RhdGU6IFByb3BUeXBlcy5vYmplY3QsXG4gIG1ldGhvZHM6IFByb3BUeXBlcy5vYmplY3Rcbn07XG5cbmNvbnN0IElucHV0Q29tcG9uZW50ID0gc3R5bGVkLmlucHV0YFxuICBsaW5lLWhlaWdodDogaW5oZXJpdDtcbiAgYm9yZGVyOiBub25lO1xuICBtYXJnaW4tbGVmdDogNXB4O1xuICBiYWNrZ3JvdW5kOiB0cmFuc3BhcmVudDtcbiAgcGFkZGluZzogMDtcbiAgd2lkdGg6IGNhbGMoJHsoeyBzaXplIH0pID0+IGAke3NpemV9Y2hgfSArIDVweCk7XG4gIGZvbnQtc2l6ZTogc21hbGxlcjtcbiAgJHsoeyByZWFkT25seSB9KSA9PiByZWFkT25seSAmJiAnY3Vyc29yOiBwb2ludGVyOyd9XG4gIDpmb2N1cyB7XG4gICAgb3V0bGluZTogbm9uZTtcbiAgfVxuYDtcblxuZXhwb3J0IGRlZmF1bHQgSW5wdXQ7XG4iXX0= */\")),\n _default = Input;\nexports.default = _default;","function memoize(fn) {\n var cache = Object.create(null);\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\nexport { memoize as default };","import memoize from '@emotion/memoize';\n\n// eslint-disable-next-line no-undef\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar isPropValid = /* #__PURE__ */memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */ && prop.charCodeAt(1) === 110\n /* n */ && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */);\nexport { isPropValid as default };","var isDevelopment = false;\n\n/*\n\nBased off glamor's StyleSheet, thanks Sunil ❤️\n\nhigh performance StyleSheet for css-in-js systems\n\n- uses multiple style tags behind the scenes for millions of rules\n- uses `insertRule` for appending in production for *much* faster performance\n\n// usage\n\nimport { StyleSheet } from '@emotion/sheet'\n\nlet styleSheet = new StyleSheet({ key: '', container: document.head })\n\nstyleSheet.insert('#box { border: 1px solid red; }')\n- appends a css rule into the stylesheet\n\nstyleSheet.flush()\n- empties the stylesheet of all its contents\n\n*/\n\nfunction sheetForTag(tag) {\n if (tag.sheet) {\n return tag.sheet;\n } // this weirdness brought to you by firefox\n\n /* istanbul ignore next */\n\n for (var i = 0; i < document.styleSheets.length; i++) {\n if (document.styleSheets[i].ownerNode === tag) {\n return document.styleSheets[i];\n }\n } // this function should always return with a value\n // TS can't understand it though so we make it stop complaining here\n\n return undefined;\n}\nfunction createStyleElement(options) {\n var tag = document.createElement('style');\n tag.setAttribute('data-emotion', options.key);\n if (options.nonce !== undefined) {\n tag.setAttribute('nonce', options.nonce);\n }\n tag.appendChild(document.createTextNode(''));\n tag.setAttribute('data-s', '');\n return tag;\n}\nvar StyleSheet = /*#__PURE__*/function () {\n // Using Node instead of HTMLElement since container may be a ShadowRoot\n function StyleSheet(options) {\n var _this = this;\n this._insertTag = function (tag) {\n var before;\n if (_this.tags.length === 0) {\n if (_this.insertionPoint) {\n before = _this.insertionPoint.nextSibling;\n } else if (_this.prepend) {\n before = _this.container.firstChild;\n } else {\n before = _this.before;\n }\n } else {\n before = _this.tags[_this.tags.length - 1].nextSibling;\n }\n _this.container.insertBefore(tag, before);\n _this.tags.push(tag);\n };\n this.isSpeedy = options.speedy === undefined ? !isDevelopment : options.speedy;\n this.tags = [];\n this.ctr = 0;\n this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets\n\n this.key = options.key;\n this.container = options.container;\n this.prepend = options.prepend;\n this.insertionPoint = options.insertionPoint;\n this.before = null;\n }\n var _proto = StyleSheet.prototype;\n _proto.hydrate = function hydrate(nodes) {\n nodes.forEach(this._insertTag);\n };\n _proto.insert = function insert(rule) {\n // the max length is how many rules we have per style tag, it's 65000 in speedy mode\n // it's 1 in dev because we insert source maps that map a single rule to a location\n // and you can only have one source map per style tag\n if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {\n this._insertTag(createStyleElement(this));\n }\n var tag = this.tags[this.tags.length - 1];\n if (this.isSpeedy) {\n var sheet = sheetForTag(tag);\n try {\n // this is the ultrafast version, works across browsers\n // the big drawback is that the css won't be editable in devtools\n sheet.insertRule(rule, sheet.cssRules.length);\n } catch (e) {}\n } else {\n tag.appendChild(document.createTextNode(rule));\n }\n this.ctr++;\n };\n _proto.flush = function flush() {\n this.tags.forEach(function (tag) {\n var _tag$parentNode;\n return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag);\n });\n this.tags = [];\n this.ctr = 0;\n };\n return StyleSheet;\n}();\nexport { StyleSheet };","var e = \"-ms-\";\nvar r = \"-moz-\";\nvar a = \"-webkit-\";\nvar n = \"comm\";\nvar c = \"rule\";\nvar s = \"decl\";\nvar t = \"@page\";\nvar u = \"@media\";\nvar i = \"@import\";\nvar f = \"@charset\";\nvar o = \"@viewport\";\nvar l = \"@supports\";\nvar v = \"@document\";\nvar p = \"@namespace\";\nvar h = \"@keyframes\";\nvar b = \"@font-face\";\nvar w = \"@counter-style\";\nvar d = \"@font-feature-values\";\nvar $ = \"@layer\";\nvar g = Math.abs;\nvar k = String.fromCharCode;\nvar m = Object.assign;\nfunction x(e, r) {\n return O(e, 0) ^ 45 ? (((r << 2 ^ O(e, 0)) << 2 ^ O(e, 1)) << 2 ^ O(e, 2)) << 2 ^ O(e, 3) : 0;\n}\nfunction y(e) {\n return e.trim();\n}\nfunction j(e, r) {\n return (e = r.exec(e)) ? e[0] : e;\n}\nfunction z(e, r, a) {\n return e.replace(r, a);\n}\nfunction C(e, r) {\n return e.indexOf(r);\n}\nfunction O(e, r) {\n return e.charCodeAt(r) | 0;\n}\nfunction A(e, r, a) {\n return e.slice(r, a);\n}\nfunction M(e) {\n return e.length;\n}\nfunction S(e) {\n return e.length;\n}\nfunction q(e, r) {\n return r.push(e), e;\n}\nfunction B(e, r) {\n return e.map(r).join(\"\");\n}\nvar D = 1;\nvar E = 1;\nvar F = 0;\nvar G = 0;\nvar H = 0;\nvar I = \"\";\nfunction J(e, r, a, n, c, s, t) {\n return {\n value: e,\n root: r,\n parent: a,\n type: n,\n props: c,\n children: s,\n line: D,\n column: E,\n length: t,\n return: \"\"\n };\n}\nfunction K(e, r) {\n return m(J(\"\", null, null, \"\", null, null, 0), e, {\n length: -e.length\n }, r);\n}\nfunction L() {\n return H;\n}\nfunction N() {\n H = G > 0 ? O(I, --G) : 0;\n if (E--, H === 10) E = 1, D--;\n return H;\n}\nfunction P() {\n H = G < F ? O(I, G++) : 0;\n if (E++, H === 10) E = 1, D++;\n return H;\n}\nfunction Q() {\n return O(I, G);\n}\nfunction R() {\n return G;\n}\nfunction T(e, r) {\n return A(I, e, r);\n}\nfunction U(e) {\n switch (e) {\n case 0:\n case 9:\n case 10:\n case 13:\n case 32:\n return 5;\n case 33:\n case 43:\n case 44:\n case 47:\n case 62:\n case 64:\n case 126:\n case 59:\n case 123:\n case 125:\n return 4;\n case 58:\n return 3;\n case 34:\n case 39:\n case 40:\n case 91:\n return 2;\n case 41:\n case 93:\n return 1;\n }\n return 0;\n}\nfunction V(e) {\n return D = E = 1, F = M(I = e), G = 0, [];\n}\nfunction W(e) {\n return I = \"\", e;\n}\nfunction X(e) {\n return y(T(G - 1, re(e === 91 ? e + 2 : e === 40 ? e + 1 : e)));\n}\nfunction Y(e) {\n return W(_(V(e)));\n}\nfunction Z(e) {\n while (H = Q()) if (H < 33) P();else break;\n return U(e) > 2 || U(H) > 3 ? \"\" : \" \";\n}\nfunction _(e) {\n while (P()) switch (U(H)) {\n case 0:\n q(ne(G - 1), e);\n break;\n case 2:\n q(X(H), e);\n break;\n default:\n q(k(H), e);\n }\n return e;\n}\nfunction ee(e, r) {\n while (--r && P()) if (H < 48 || H > 102 || H > 57 && H < 65 || H > 70 && H < 97) break;\n return T(e, R() + (r < 6 && Q() == 32 && P() == 32));\n}\nfunction re(e) {\n while (P()) switch (H) {\n case e:\n return G;\n case 34:\n case 39:\n if (e !== 34 && e !== 39) re(H);\n break;\n case 40:\n if (e === 41) re(e);\n break;\n case 92:\n P();\n break;\n }\n return G;\n}\nfunction ae(e, r) {\n while (P()) if (e + H === 47 + 10) break;else if (e + H === 42 + 42 && Q() === 47) break;\n return \"/*\" + T(r, G - 1) + \"*\" + k(e === 47 ? e : P());\n}\nfunction ne(e) {\n while (!U(Q())) P();\n return T(e, G);\n}\nfunction ce(e) {\n return W(se(\"\", null, null, null, [\"\"], e = V(e), 0, [0], e));\n}\nfunction se(e, r, a, n, c, s, t, u, i) {\n var f = 0;\n var o = 0;\n var l = t;\n var v = 0;\n var p = 0;\n var h = 0;\n var b = 1;\n var w = 1;\n var d = 1;\n var $ = 0;\n var g = \"\";\n var m = c;\n var x = s;\n var y = n;\n var j = g;\n while (w) switch (h = $, $ = P()) {\n case 40:\n if (h != 108 && O(j, l - 1) == 58) {\n if (C(j += z(X($), \"&\", \"&\\f\"), \"&\\f\") != -1) d = -1;\n break;\n }\n case 34:\n case 39:\n case 91:\n j += X($);\n break;\n case 9:\n case 10:\n case 13:\n case 32:\n j += Z(h);\n break;\n case 92:\n j += ee(R() - 1, 7);\n continue;\n case 47:\n switch (Q()) {\n case 42:\n case 47:\n q(ue(ae(P(), R()), r, a), i);\n break;\n default:\n j += \"/\";\n }\n break;\n case 123 * b:\n u[f++] = M(j) * d;\n case 125 * b:\n case 59:\n case 0:\n switch ($) {\n case 0:\n case 125:\n w = 0;\n case 59 + o:\n if (d == -1) j = z(j, /\\f/g, \"\");\n if (p > 0 && M(j) - l) q(p > 32 ? ie(j + \";\", n, a, l - 1) : ie(z(j, \" \", \"\") + \";\", n, a, l - 2), i);\n break;\n case 59:\n j += \";\";\n default:\n q(y = te(j, r, a, f, o, c, u, g, m = [], x = [], l), s);\n if ($ === 123) if (o === 0) se(j, r, y, y, m, s, l, u, x);else switch (v === 99 && O(j, 3) === 110 ? 100 : v) {\n case 100:\n case 108:\n case 109:\n case 115:\n se(e, y, y, n && q(te(e, y, y, 0, 0, c, u, g, c, m = [], l), x), c, x, l, u, n ? m : x);\n break;\n default:\n se(j, y, y, y, [\"\"], x, 0, u, x);\n }\n }\n f = o = p = 0, b = d = 1, g = j = \"\", l = t;\n break;\n case 58:\n l = 1 + M(j), p = h;\n default:\n if (b < 1) if ($ == 123) --b;else if ($ == 125 && b++ == 0 && N() == 125) continue;\n switch (j += k($), $ * b) {\n case 38:\n d = o > 0 ? 1 : (j += \"\\f\", -1);\n break;\n case 44:\n u[f++] = (M(j) - 1) * d, d = 1;\n break;\n case 64:\n if (Q() === 45) j += X(P());\n v = Q(), o = l = M(g = j += ne(R())), $++;\n break;\n case 45:\n if (h === 45 && M(j) == 2) b = 0;\n }\n }\n return s;\n}\nfunction te(e, r, a, n, s, t, u, i, f, o, l) {\n var v = s - 1;\n var p = s === 0 ? t : [\"\"];\n var h = S(p);\n for (var b = 0, w = 0, d = 0; b < n; ++b) for (var $ = 0, k = A(e, v + 1, v = g(w = u[b])), m = e; $ < h; ++$) if (m = y(w > 0 ? p[$] + \" \" + k : z(k, /&\\f/g, p[$]))) f[d++] = m;\n return J(e, r, a, s === 0 ? c : i, f, o, l);\n}\nfunction ue(e, r, a) {\n return J(e, r, a, n, k(L()), A(e, 2, -2), 0);\n}\nfunction ie(e, r, a, n) {\n return J(e, r, a, s, A(e, 0, n), A(e, n + 1, -1), n);\n}\nfunction fe(n, c, s) {\n switch (x(n, c)) {\n case 5103:\n return a + \"print-\" + n + n;\n case 5737:\n case 4201:\n case 3177:\n case 3433:\n case 1641:\n case 4457:\n case 2921:\n case 5572:\n case 6356:\n case 5844:\n case 3191:\n case 6645:\n case 3005:\n case 6391:\n case 5879:\n case 5623:\n case 6135:\n case 4599:\n case 4855:\n case 4215:\n case 6389:\n case 5109:\n case 5365:\n case 5621:\n case 3829:\n return a + n + n;\n case 4789:\n return r + n + n;\n case 5349:\n case 4246:\n case 4810:\n case 6968:\n case 2756:\n return a + n + r + n + e + n + n;\n case 5936:\n switch (O(n, c + 11)) {\n case 114:\n return a + n + e + z(n, /[svh]\\w+-[tblr]{2}/, \"tb\") + n;\n case 108:\n return a + n + e + z(n, /[svh]\\w+-[tblr]{2}/, \"tb-rl\") + n;\n case 45:\n return a + n + e + z(n, /[svh]\\w+-[tblr]{2}/, \"lr\") + n;\n }\n case 6828:\n case 4268:\n case 2903:\n return a + n + e + n + n;\n case 6165:\n return a + n + e + \"flex-\" + n + n;\n case 5187:\n return a + n + z(n, /(\\w+).+(:[^]+)/, a + \"box-$1$2\" + e + \"flex-$1$2\") + n;\n case 5443:\n return a + n + e + \"flex-item-\" + z(n, /flex-|-self/g, \"\") + (!j(n, /flex-|baseline/) ? e + \"grid-row-\" + z(n, /flex-|-self/g, \"\") : \"\") + n;\n case 4675:\n return a + n + e + \"flex-line-pack\" + z(n, /align-content|flex-|-self/g, \"\") + n;\n case 5548:\n return a + n + e + z(n, \"shrink\", \"negative\") + n;\n case 5292:\n return a + n + e + z(n, \"basis\", \"preferred-size\") + n;\n case 6060:\n return a + \"box-\" + z(n, \"-grow\", \"\") + a + n + e + z(n, \"grow\", \"positive\") + n;\n case 4554:\n return a + z(n, /([^-])(transform)/g, \"$1\" + a + \"$2\") + n;\n case 6187:\n return z(z(z(n, /(zoom-|grab)/, a + \"$1\"), /(image-set)/, a + \"$1\"), n, \"\") + n;\n case 5495:\n case 3959:\n return z(n, /(image-set\\([^]*)/, a + \"$1\" + \"$`$1\");\n case 4968:\n return z(z(n, /(.+:)(flex-)?(.*)/, a + \"box-pack:$3\" + e + \"flex-pack:$3\"), /s.+-b[^;]+/, \"justify\") + a + n + n;\n case 4200:\n if (!j(n, /flex-|baseline/)) return e + \"grid-column-align\" + A(n, c) + n;\n break;\n case 2592:\n case 3360:\n return e + z(n, \"template-\", \"\") + n;\n case 4384:\n case 3616:\n if (s && s.some(function (e, r) {\n return c = r, j(e.props, /grid-\\w+-end/);\n })) {\n return ~C(n + (s = s[c].value), \"span\") ? n : e + z(n, \"-start\", \"\") + n + e + \"grid-row-span:\" + (~C(s, \"span\") ? j(s, /\\d+/) : +j(s, /\\d+/) - +j(n, /\\d+/)) + \";\";\n }\n return e + z(n, \"-start\", \"\") + n;\n case 4896:\n case 4128:\n return s && s.some(function (e) {\n return j(e.props, /grid-\\w+-start/);\n }) ? n : e + z(z(n, \"-end\", \"-span\"), \"span \", \"\") + n;\n case 4095:\n case 3583:\n case 4068:\n case 2532:\n return z(n, /(.+)-inline(.+)/, a + \"$1$2\") + n;\n case 8116:\n case 7059:\n case 5753:\n case 5535:\n case 5445:\n case 5701:\n case 4933:\n case 4677:\n case 5533:\n case 5789:\n case 5021:\n case 4765:\n if (M(n) - 1 - c > 6) switch (O(n, c + 1)) {\n case 109:\n if (O(n, c + 4) !== 45) break;\n case 102:\n return z(n, /(.+:)(.+)-([^]+)/, \"$1\" + a + \"$2-$3\" + \"$1\" + r + (O(n, c + 3) == 108 ? \"$3\" : \"$2-$3\")) + n;\n case 115:\n return ~C(n, \"stretch\") ? fe(z(n, \"stretch\", \"fill-available\"), c, s) + n : n;\n }\n break;\n case 5152:\n case 5920:\n return z(n, /(.+?):(\\d+)(\\s*\\/\\s*(span)?\\s*(\\d+))?(.*)/, function (r, a, c, s, t, u, i) {\n return e + a + \":\" + c + i + (s ? e + a + \"-span:\" + (t ? u : +u - +c) + i : \"\") + n;\n });\n case 4949:\n if (O(n, c + 6) === 121) return z(n, \":\", \":\" + a) + n;\n break;\n case 6444:\n switch (O(n, O(n, 14) === 45 ? 18 : 11)) {\n case 120:\n return z(n, /(.+:)([^;\\s!]+)(;|(\\s+)?!.+)?/, \"$1\" + a + (O(n, 14) === 45 ? \"inline-\" : \"\") + \"box$3\" + \"$1\" + a + \"$2$3\" + \"$1\" + e + \"$2box$3\") + n;\n case 100:\n return z(n, \":\", \":\" + e) + n;\n }\n break;\n case 5719:\n case 2647:\n case 2135:\n case 3927:\n case 2391:\n return z(n, \"scroll-\", \"scroll-snap-\") + n;\n }\n return n;\n}\nfunction oe(e, r) {\n var a = \"\";\n var n = S(e);\n for (var c = 0; c < n; c++) a += r(e[c], c, e, r) || \"\";\n return a;\n}\nfunction le(e, r, a, t) {\n switch (e.type) {\n case $:\n if (e.children.length) break;\n case i:\n case s:\n return e.return = e.return || e.value;\n case n:\n return \"\";\n case h:\n return e.return = e.value + \"{\" + oe(e.children, t) + \"}\";\n case c:\n e.value = e.props.join(\",\");\n }\n return M(a = oe(e.children, t)) ? e.return = e.value + \"{\" + a + \"}\" : \"\";\n}\nfunction ve(e) {\n var r = S(e);\n return function (a, n, c, s) {\n var t = \"\";\n for (var u = 0; u < r; u++) t += e[u](a, n, c, s) || \"\";\n return t;\n };\n}\nfunction pe(e) {\n return function (r) {\n if (!r.root) if (r = r.return) e(r);\n };\n}\nfunction he(n, t, u, i) {\n if (n.length > -1) if (!n.return) switch (n.type) {\n case s:\n n.return = fe(n.value, n.length, u);\n return;\n case h:\n return oe([K(n, {\n value: z(n.value, \"@\", \"@\" + a)\n })], i);\n case c:\n if (n.length) return B(n.props, function (c) {\n switch (j(c, /(::plac\\w+|:read-\\w+)/)) {\n case \":read-only\":\n case \":read-write\":\n return oe([K(n, {\n props: [z(c, /:(read-\\w+)/, \":\" + r + \"$1\")]\n })], i);\n case \"::placeholder\":\n return oe([K(n, {\n props: [z(c, /:(plac\\w+)/, \":\" + a + \"input-$1\")]\n }), K(n, {\n props: [z(c, /:(plac\\w+)/, \":\" + r + \"$1\")]\n }), K(n, {\n props: [z(c, /:(plac\\w+)/, e + \"input-$1\")]\n })], i);\n }\n return \"\";\n });\n }\n}\nfunction be(e) {\n switch (e.type) {\n case c:\n e.props = e.props.map(function (r) {\n return B(Y(r), function (r, a, n) {\n switch (O(r, 0)) {\n case 12:\n return A(r, 1, M(r));\n case 0:\n case 40:\n case 43:\n case 62:\n case 126:\n return r;\n case 58:\n if (n[++a] === \"global\") n[a] = \"\", n[++a] = \"\\f\" + A(n[a], a = 1, -1);\n case 32:\n return a === 1 ? \"\" : r;\n default:\n switch (a) {\n case 0:\n e = r;\n return S(n) > 1 ? \"\" : r;\n case a = S(n) - 1:\n case 2:\n return a === 2 ? r + e + e : r + e;\n default:\n return r;\n }\n }\n });\n });\n }\n}\nexport { f as CHARSET, n as COMMENT, w as COUNTER_STYLE, s as DECLARATION, v as DOCUMENT, b as FONT_FACE, d as FONT_FEATURE_VALUES, i as IMPORT, h as KEYFRAMES, $ as LAYER, u as MEDIA, r as MOZ, e as MS, p as NAMESPACE, t as PAGE, c as RULESET, l as SUPPORTS, o as VIEWPORT, a as WEBKIT, g as abs, V as alloc, q as append, m as assign, R as caret, L as char, H as character, I as characters, O as charat, E as column, B as combine, ue as comment, ae as commenter, ce as compile, K as copy, W as dealloc, ie as declaration, X as delimit, re as delimiter, ee as escaping, k as from, x as hash, ne as identifier, C as indexof, F as length, D as line, j as match, ve as middleware, be as namespace, P as next, J as node, se as parse, Q as peek, G as position, fe as prefix, he as prefixer, N as prev, z as replace, te as ruleset, pe as rulesheet, oe as serialize, S as sizeof, T as slice, le as stringify, M as strlen, A as substr, U as token, Y as tokenize, _ as tokenizer, y as trim, Z as whitespace };","var weakMemoize = function weakMemoize(func) {\n var cache = new WeakMap();\n return function (arg) {\n if (cache.has(arg)) {\n // Use non-null assertion because we just checked that the cache `has` it\n // This allows us to remove `undefined` from the return value\n return cache.get(arg);\n }\n var ret = func(arg);\n cache.set(arg, ret);\n return ret;\n };\n};\nexport { weakMemoize as default };","import { StyleSheet } from '@emotion/sheet';\nimport { dealloc, alloc, next, token, from, peek, delimit, slice, position, RULESET, combine, match, serialize, copy, replace, WEBKIT, MOZ, MS, KEYFRAMES, DECLARATION, hash, charat, strlen, indexof, stringify, rulesheet, middleware, compile } from 'stylis';\nimport weakMemoize from '@emotion/weak-memoize';\nimport memoize from '@emotion/memoize';\nvar isBrowser = typeof document !== 'undefined';\nvar identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {\n var previous = 0;\n var character = 0;\n while (true) {\n previous = character;\n character = peek(); // &\\f\n\n if (previous === 38 && character === 12) {\n points[index] = 1;\n }\n if (token(character)) {\n break;\n }\n next();\n }\n return slice(begin, position);\n};\nvar toRules = function toRules(parsed, points) {\n // pretend we've started with a comma\n var index = -1;\n var character = 44;\n do {\n switch (token(character)) {\n case 0:\n // &\\f\n if (character === 38 && peek() === 12) {\n // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings\n // stylis inserts \\f after & to know when & where it should replace this sequence with the context selector\n // and when it should just concatenate the outer and inner selectors\n // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here\n points[index] = 1;\n }\n parsed[index] += identifierWithPointTracking(position - 1, points, index);\n break;\n case 2:\n parsed[index] += delimit(character);\n break;\n case 4:\n // comma\n if (character === 44) {\n // colon\n parsed[++index] = peek() === 58 ? '&\\f' : '';\n points[index] = parsed[index].length;\n break;\n }\n\n // fallthrough\n\n default:\n parsed[index] += from(character);\n }\n } while (character = next());\n return parsed;\n};\nvar getRules = function getRules(value, points) {\n return dealloc(toRules(alloc(value), points));\n}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11\n\nvar fixedElements = /* #__PURE__ */new WeakMap();\nvar compat = function compat(element) {\n if (element.type !== 'rule' || !element.parent ||\n // positive .length indicates that this rule contains pseudo\n // negative .length indicates that this rule has been already prefixed\n element.length < 1) {\n return;\n }\n var value = element.value,\n parent = element.parent;\n var isImplicitRule = element.column === parent.column && element.line === parent.line;\n while (parent.type !== 'rule') {\n parent = parent.parent;\n if (!parent) return;\n } // short-circuit for the simplest case\n\n if (element.props.length === 1 && value.charCodeAt(0) !== 58\n /* colon */ && !fixedElements.get(parent)) {\n return;\n } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)\n // then the props has already been manipulated beforehand as they that array is shared between it and its \"rule parent\"\n\n if (isImplicitRule) {\n return;\n }\n fixedElements.set(element, true);\n var points = [];\n var rules = getRules(value, points);\n var parentRules = parent.props;\n for (var i = 0, k = 0; i < rules.length; i++) {\n for (var j = 0; j < parentRules.length; j++, k++) {\n element.props[k] = points[i] ? rules[i].replace(/&\\f/g, parentRules[j]) : parentRules[j] + \" \" + rules[i];\n }\n }\n};\nvar removeLabel = function removeLabel(element) {\n if (element.type === 'decl') {\n var value = element.value;\n if (\n // charcode for l\n value.charCodeAt(0) === 108 &&\n // charcode for b\n value.charCodeAt(2) === 98) {\n // this ignores label\n element[\"return\"] = '';\n element.value = '';\n }\n }\n};\n\n/* eslint-disable no-fallthrough */\n\nfunction prefix(value, length) {\n switch (hash(value, length)) {\n // color-adjust\n case 5103:\n return WEBKIT + 'print-' + value + value;\n // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)\n\n case 5737:\n case 4201:\n case 3177:\n case 3433:\n case 1641:\n case 4457:\n case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break\n\n case 5572:\n case 6356:\n case 5844:\n case 3191:\n case 6645:\n case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,\n\n case 6391:\n case 5879:\n case 5623:\n case 6135:\n case 4599:\n case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)\n\n case 4215:\n case 6389:\n case 5109:\n case 5365:\n case 5621:\n case 3829:\n return WEBKIT + value + value;\n // appearance, user-select, transform, hyphens, text-size-adjust\n\n case 5349:\n case 4246:\n case 4810:\n case 6968:\n case 2756:\n return WEBKIT + value + MOZ + value + MS + value + value;\n // flex, flex-direction\n\n case 6828:\n case 4268:\n return WEBKIT + value + MS + value + value;\n // order\n\n case 6165:\n return WEBKIT + value + MS + 'flex-' + value + value;\n // align-items\n\n case 5187:\n return WEBKIT + value + replace(value, /(\\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;\n // align-self\n\n case 5443:\n return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;\n // align-content\n\n case 4675:\n return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;\n // flex-shrink\n\n case 5548:\n return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;\n // flex-basis\n\n case 5292:\n return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;\n // flex-grow\n\n case 6060:\n return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;\n // transition\n\n case 4554:\n return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;\n // cursor\n\n case 6187:\n return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;\n // background, background-image\n\n case 5495:\n case 3959:\n return replace(value, /(image-set\\([^]*)/, WEBKIT + '$1' + '$`$1');\n // justify-content\n\n case 4968:\n return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;\n // (margin|padding)-inline-(start|end)\n\n case 4095:\n case 3583:\n case 4068:\n case 2532:\n return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;\n // (min|max)?(width|height|inline-size|block-size)\n\n case 8116:\n case 7059:\n case 5753:\n case 5535:\n case 5445:\n case 5701:\n case 4933:\n case 4677:\n case 5533:\n case 5789:\n case 5021:\n case 4765:\n // stretch, max-content, min-content, fill-available\n if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {\n // (m)ax-content, (m)in-content\n case 109:\n // -\n if (charat(value, length + 4) !== 45) break;\n // (f)ill-available, (f)it-content\n\n case 102:\n return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;\n // (s)tretch\n\n case 115:\n return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;\n }\n break;\n // position: sticky\n\n case 4949:\n // (s)ticky?\n if (charat(value, length + 1) !== 115) break;\n // display: (flex|inline-flex)\n\n case 6444:\n switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {\n // stic(k)y\n case 107:\n return replace(value, ':', ':' + WEBKIT) + value;\n // (inline-)?fl(e)x\n\n case 101:\n return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;\n }\n break;\n // writing-mode\n\n case 5936:\n switch (charat(value, length + 11)) {\n // vertical-l(r)\n case 114:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb') + value;\n // vertical-r(l)\n\n case 108:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb-rl') + value;\n // horizontal(-)tb\n\n case 45:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'lr') + value;\n }\n return WEBKIT + value + MS + value + value;\n }\n return value;\n}\nvar prefixer = function prefixer(element, index, children, callback) {\n if (element.length > -1) if (!element[\"return\"]) switch (element.type) {\n case DECLARATION:\n element[\"return\"] = prefix(element.value, element.length);\n break;\n case KEYFRAMES:\n return serialize([copy(element, {\n value: replace(element.value, '@', '@' + WEBKIT)\n })], callback);\n case RULESET:\n if (element.length) return combine(element.props, function (value) {\n switch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n // :read-(only|write)\n case ':read-only':\n case ':read-write':\n return serialize([copy(element, {\n props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]\n })], callback);\n // :placeholder\n\n case '::placeholder':\n return serialize([copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]\n })], callback);\n }\n return '';\n });\n }\n};\n\n/* import type { StylisPlugin } from './types' */\n\n/*\nexport type Options = {\n nonce?: string,\n stylisPlugins?: StylisPlugin[],\n key: string,\n container?: HTMLElement,\n speedy?: boolean,\n prepend?: boolean,\n insertionPoint?: HTMLElement\n}\n*/\n\nvar getServerStylisCache = isBrowser ? undefined : weakMemoize(function () {\n return memoize(function () {\n var cache = {};\n return function (name) {\n return cache[name];\n };\n });\n});\nvar defaultStylisPlugins = [prefixer];\nvar createCache = function /*: EmotionCache */\ncreateCache(options\n/*: Options */) {\n var key = options.key;\n if (isBrowser && key === 'css') {\n var ssrStyles = document.querySelectorAll(\"style[data-emotion]:not([data-s])\"); // get SSRed styles out of the way of React's hydration\n // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)\n // note this very very intentionally targets all style elements regardless of the key to ensure\n // that creating a cache works inside of render of a React component\n\n Array.prototype.forEach.call(ssrStyles, function (node\n /*: HTMLStyleElement */) {\n // we want to only move elements which have a space in the data-emotion attribute value\n // because that indicates that it is an Emotion 11 server-side rendered style elements\n // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector\n // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)\n // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles\n // will not result in the Emotion 10 styles being destroyed\n var dataEmotionAttribute = node.getAttribute('data-emotion');\n if (dataEmotionAttribute.indexOf(' ') === -1) {\n return;\n }\n document.head.appendChild(node);\n node.setAttribute('data-s', '');\n });\n }\n var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;\n var inserted = {};\n var container;\n /* : Node */\n\n var nodesToHydrate = [];\n if (isBrowser) {\n container = options.container || document.head;\n Array.prototype.forEach.call(\n // this means we will ignore elements which don't have a space in them which\n // means that the style elements we're looking at are only Emotion 11 server-rendered style elements\n document.querySelectorAll(\"style[data-emotion^=\\\"\" + key + \" \\\"]\"), function (node\n /*: HTMLStyleElement */) {\n var attrib = node.getAttribute(\"data-emotion\").split(' ');\n for (var i = 1; i < attrib.length; i++) {\n inserted[attrib[i]] = true;\n }\n nodesToHydrate.push(node);\n });\n }\n var _insert;\n /*: (\n selector: string,\n serialized: SerializedStyles,\n sheet: StyleSheet,\n shouldCache: boolean\n ) => string | void */\n\n var omnipresentPlugins = [compat, removeLabel];\n if (isBrowser) {\n var currentSheet;\n var finalizingPlugins = [stringify, rulesheet(function (rule) {\n currentSheet.insert(rule);\n })];\n var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));\n var stylis = function stylis(styles) {\n return serialize(compile(styles), serializer);\n };\n _insert = function /*: void */\n insert(selector\n /*: string */, serialized\n /*: SerializedStyles */, sheet\n /*: StyleSheet */, shouldCache\n /*: boolean */) {\n currentSheet = sheet;\n stylis(selector ? selector + \"{\" + serialized.styles + \"}\" : serialized.styles);\n if (shouldCache) {\n cache.inserted[serialized.name] = true;\n }\n };\n } else {\n var _finalizingPlugins = [stringify];\n var _serializer = middleware(omnipresentPlugins.concat(stylisPlugins, _finalizingPlugins));\n var _stylis = function _stylis(styles) {\n return serialize(compile(styles), _serializer);\n };\n var serverStylisCache = getServerStylisCache(stylisPlugins)(key);\n var getRules = function /*: string */\n getRules(selector\n /*: string */, serialized\n /*: SerializedStyles */) {\n var name = serialized.name;\n if (serverStylisCache[name] === undefined) {\n serverStylisCache[name] = _stylis(selector ? selector + \"{\" + serialized.styles + \"}\" : serialized.styles);\n }\n return serverStylisCache[name];\n };\n _insert = function /*: string | void */\n _insert(selector\n /*: string */, serialized\n /*: SerializedStyles */, sheet\n /*: StyleSheet */, shouldCache\n /*: boolean */) {\n var name = serialized.name;\n var rules = getRules(selector, serialized);\n if (cache.compat === undefined) {\n // in regular mode, we don't set the styles on the inserted cache\n // since we don't need to and that would be wasting memory\n // we return them so that they are rendered in a style tag\n if (shouldCache) {\n cache.inserted[name] = true;\n }\n return rules;\n } else {\n // in compat mode, we put the styles on the inserted cache so\n // that emotion-server can pull out the styles\n // except when we don't want to cache it which was in Global but now\n // is nowhere but we don't want to do a major right now\n // and just in case we're going to leave the case here\n // it's also not affecting client side bundle size\n // so it's really not a big deal\n if (shouldCache) {\n cache.inserted[name] = rules;\n } else {\n return rules;\n }\n }\n };\n }\n var cache\n /*: EmotionCache */ = {\n key: key,\n sheet: new StyleSheet({\n key: key,\n container: container,\n nonce: options.nonce,\n speedy: options.speedy,\n prepend: options.prepend,\n insertionPoint: options.insertionPoint\n }),\n nonce: options.nonce,\n inserted: inserted,\n registered: {},\n insert: _insert\n };\n cache.sheet.hydrate(nodesToHydrate);\n return cache;\n};\nexport { createCache as default };","import * as React from 'react';\nvar isBrowser = typeof document !== 'undefined';\nvar syncFallback = function syncFallback(create) {\n return create();\n};\nvar useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : false;\nvar useInsertionEffectAlwaysWithSyncFallback = !isBrowser ? syncFallback : useInsertionEffect || syncFallback;\nvar useInsertionEffectWithLayoutFallback = useInsertionEffect || React.useLayoutEffect;\nexport { useInsertionEffectAlwaysWithSyncFallback, useInsertionEffectWithLayoutFallback };","import * as React from 'react';\nimport { useContext, forwardRef } from 'react';\nimport createCache from '@emotion/cache';\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport weakMemoize from '@emotion/weak-memoize';\nimport hoistNonReactStatics from '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\nimport { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\nvar isBrowser = \"object\" !== 'undefined';\nvar hasOwnProperty = {}.hasOwnProperty;\nvar EmotionCacheContext = /* #__PURE__ */React.createContext(\n// we're doing this to avoid preconstruct's dead code elimination in this one case\n// because this module is primarily intended for the browser and node\n// but it's also required in react native and similar environments sometimes\n// and we could have a special build just for that\n// but this is much easier and the native packages\n// might use a different theme context in the future anyway\ntypeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({\n key: 'css'\n}) : null);\nif (process.env.NODE_ENV !== 'production') {\n EmotionCacheContext.displayName = 'EmotionCacheContext';\n}\nvar CacheProvider = EmotionCacheContext.Provider;\nvar __unsafe_useEmotionCache = function useEmotionCache() {\n return useContext(EmotionCacheContext);\n};\nvar withEmotionCache = function withEmotionCache(func) {\n // $FlowFixMe\n return /*#__PURE__*/forwardRef(function (props, ref) {\n // the cache will never be null in the browser\n var cache = useContext(EmotionCacheContext);\n return func(props, cache, ref);\n });\n};\nif (!isBrowser) {\n withEmotionCache = function withEmotionCache(func) {\n return function (props) {\n var cache = useContext(EmotionCacheContext);\n if (cache === null) {\n // yes, we're potentially creating this on every render\n // it doesn't actually matter though since it's only on the server\n // so there will only every be a single render\n // that could change in the future because of suspense and etc. but for now,\n // this works and i don't want to optimise for a future thing that we aren't sure about\n cache = createCache({\n key: 'css'\n });\n return /*#__PURE__*/React.createElement(EmotionCacheContext.Provider, {\n value: cache\n }, func(props, cache));\n } else {\n return func(props, cache);\n }\n };\n };\n}\nvar ThemeContext = /* #__PURE__ */React.createContext({});\nif (process.env.NODE_ENV !== 'production') {\n ThemeContext.displayName = 'EmotionThemeContext';\n}\nvar useTheme = function useTheme() {\n return React.useContext(ThemeContext);\n};\nvar getTheme = function getTheme(outerTheme, theme) {\n if (typeof theme === 'function') {\n var mergedTheme = theme(outerTheme);\n if (process.env.NODE_ENV !== 'production' && (mergedTheme == null || typeof mergedTheme !== 'object' || Array.isArray(mergedTheme))) {\n throw new Error('[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!');\n }\n return mergedTheme;\n }\n if (process.env.NODE_ENV !== 'production' && (theme == null || typeof theme !== 'object' || Array.isArray(theme))) {\n throw new Error('[ThemeProvider] Please make your theme prop a plain object');\n }\n return _extends({}, outerTheme, theme);\n};\nvar createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {\n return weakMemoize(function (theme) {\n return getTheme(outerTheme, theme);\n });\n});\nvar ThemeProvider = function ThemeProvider(props) {\n var theme = React.useContext(ThemeContext);\n if (props.theme !== theme) {\n theme = createCacheWithTheme(theme)(props.theme);\n }\n return /*#__PURE__*/React.createElement(ThemeContext.Provider, {\n value: theme\n }, props.children);\n};\nfunction withTheme(Component) {\n var componentName = Component.displayName || Component.name || 'Component';\n var render = function render(props, ref) {\n var theme = React.useContext(ThemeContext);\n return /*#__PURE__*/React.createElement(Component, _extends({\n theme: theme,\n ref: ref\n }, props));\n }; // $FlowFixMe\n\n var WithTheme = /*#__PURE__*/React.forwardRef(render);\n WithTheme.displayName = \"WithTheme(\" + componentName + \")\";\n return hoistNonReactStatics(WithTheme, Component);\n}\nvar getLastPart = function getLastPart(functionName) {\n // The match may be something like 'Object.createEmotionProps' or\n // 'Loader.prototype.render'\n var parts = functionName.split('.');\n return parts[parts.length - 1];\n};\nvar getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) {\n // V8\n var match = /^\\s+at\\s+([A-Za-z0-9$.]+)\\s/.exec(line);\n if (match) return getLastPart(match[1]); // Safari / Firefox\n\n match = /^([A-Za-z0-9$.]+)@/.exec(line);\n if (match) return getLastPart(match[1]);\n return undefined;\n};\nvar internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS\n// identifiers, thus we only need to replace what is a valid character for JS,\n// but not for CSS.\n\nvar sanitizeIdentifier = function sanitizeIdentifier(identifier) {\n return identifier.replace(/\\$/g, '-');\n};\nvar getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) {\n if (!stackTrace) return undefined;\n var lines = stackTrace.split('\\n');\n for (var i = 0; i < lines.length; i++) {\n var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just \"Error\"\n\n if (!functionName) continue; // If we reach one of these, we have gone too far and should quit\n\n if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an\n // uppercase letter\n\n if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName);\n }\n return undefined;\n};\nvar typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';\nvar labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';\nvar createEmotionProps = function createEmotionProps(type, props) {\n if (process.env.NODE_ENV !== 'production' && typeof props.css === 'string' &&\n // check if there is a css declaration\n props.css.indexOf(':') !== -1) {\n throw new Error(\"Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`\" + props.css + \"`\");\n }\n var newProps = {};\n for (var key in props) {\n if (hasOwnProperty.call(props, key)) {\n newProps[key] = props[key];\n }\n }\n newProps[typePropName] = type; // For performance, only call getLabelFromStackTrace in development and when\n // the label hasn't already been computed\n\n if (process.env.NODE_ENV !== 'production' && !!props.css && (typeof props.css !== 'object' || typeof props.css.name !== 'string' || props.css.name.indexOf('-') === -1)) {\n var label = getLabelFromStackTrace(new Error().stack);\n if (label) newProps[labelPropName] = label;\n }\n return newProps;\n};\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serialized = _ref.serialized,\n isStringTag = _ref.isStringTag;\n registerStyles(cache, serialized, isStringTag);\n useInsertionEffectAlwaysWithSyncFallback(function () {\n return insertStyles(cache, serialized, isStringTag);\n });\n return null;\n};\nvar Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {\n var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works\n // not passing the registered cache to serializeStyles because it would\n // make certain babel optimisations not possible\n\n if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {\n cssProp = cache.registered[cssProp];\n }\n var WrappedComponent = props[typePropName];\n var registeredStyles = [cssProp];\n var className = '';\n if (typeof props.className === 'string') {\n className = getRegisteredStyles(cache.registered, registeredStyles, props.className);\n } else if (props.className != null) {\n className = props.className + \" \";\n }\n var serialized = serializeStyles(registeredStyles, undefined, React.useContext(ThemeContext));\n if (process.env.NODE_ENV !== 'production' && serialized.name.indexOf('-') === -1) {\n var labelFromStack = props[labelPropName];\n if (labelFromStack) {\n serialized = serializeStyles([serialized, 'label:' + labelFromStack + ';']);\n }\n }\n className += cache.key + \"-\" + serialized.name;\n var newProps = {};\n for (var key in props) {\n if (hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && (process.env.NODE_ENV === 'production' || key !== labelPropName)) {\n newProps[key] = props[key];\n }\n }\n newProps.ref = ref;\n newProps.className = className;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serialized: serialized,\n isStringTag: typeof WrappedComponent === 'string'\n }), /*#__PURE__*/React.createElement(WrappedComponent, newProps));\n});\nif (process.env.NODE_ENV !== 'production') {\n Emotion.displayName = 'EmotionCssPropInternal';\n}\nvar Emotion$1 = Emotion;\nexport { CacheProvider as C, Emotion$1 as E, ThemeContext as T, __unsafe_useEmotionCache as _, ThemeProvider as a, withTheme as b, createEmotionProps as c, hasOwnProperty as h, isBrowser as i, useTheme as u, withEmotionCache as w };","var isBrowser = typeof document !== 'undefined';\nfunction getRegisteredStyles(registered, registeredStyles, classNames) {\n var rawClassName = '';\n classNames.split(' ').forEach(function (className) {\n if (registered[className] !== undefined) {\n registeredStyles.push(registered[className] + \";\");\n } else if (className) {\n rawClassName += className + \" \";\n }\n });\n return rawClassName;\n}\nvar registerStyles = function registerStyles(cache, serialized, isStringTag) {\n var className = cache.key + \"-\" + serialized.name;\n if (\n // we only need to add the styles to the registered cache if the\n // class name could be used further down\n // the tree but if it's a string tag, we know it won't\n // so we don't have to add it to registered cache.\n // this improves memory usage since we can avoid storing the whole style string\n (isStringTag === false ||\n // we need to always store it if we're in compat mode and\n // in node since emotion-server relies on whether a style is in\n // the registered cache to know whether a style is global or not\n // also, note that this check will be dead code eliminated in the browser\n isBrowser === false && cache.compat !== undefined) && cache.registered[className] === undefined) {\n cache.registered[className] = serialized.styles;\n }\n};\nvar insertStyles = function insertStyles(cache, serialized, isStringTag) {\n registerStyles(cache, serialized, isStringTag);\n var className = cache.key + \"-\" + serialized.name;\n if (cache.inserted[serialized.name] === undefined) {\n var stylesForSSR = '';\n var current = serialized;\n do {\n var maybeStyles = cache.insert(serialized === current ? \".\" + className : '', current, cache.sheet, true);\n if (!isBrowser && maybeStyles !== undefined) {\n stylesForSSR += maybeStyles;\n }\n current = current.next;\n } while (current !== undefined);\n if (!isBrowser && stylesForSSR.length !== 0) {\n return stylesForSSR;\n }\n }\n};\nexport { getRegisteredStyles, insertStyles, registerStyles };","var unitlessKeys = {\n animationIterationCount: 1,\n aspectRatio: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n boxFlex: 1,\n boxFlexGroup: 1,\n boxOrdinalGroup: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexPositive: 1,\n flexShrink: 1,\n flexNegative: 1,\n flexOrder: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n msGridRow: 1,\n msGridRowSpan: 1,\n msGridColumn: 1,\n msGridColumnSpan: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n scale: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n // SVG-related properties\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1\n};\nexport { unitlessKeys as default };","import hashString from '@emotion/hash';\nimport unitless from '@emotion/unitless';\nimport memoize from '@emotion/memoize';\nvar isDevelopment = false;\nvar hyphenateRegex = /[A-Z]|^ms/g;\nvar animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;\nvar isCustomProperty = function isCustomProperty(property) {\n return property.charCodeAt(1) === 45;\n};\nvar isProcessableValue = function isProcessableValue(value) {\n return value != null && typeof value !== 'boolean';\n};\nvar processStyleName = /* #__PURE__ */memoize(function (styleName) {\n return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();\n});\nvar processStyleValue = function processStyleValue(key, value) {\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n if (typeof value === 'string') {\n return value.replace(animationRegex, function (match, p1, p2) {\n cursor = {\n name: p1,\n styles: p2,\n next: cursor\n };\n return p1;\n });\n }\n }\n }\n if (unitless[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {\n return value + 'px';\n }\n return value;\n};\nvar noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';\nfunction handleInterpolation(mergedProps, registered, interpolation) {\n if (interpolation == null) {\n return '';\n }\n var componentSelector = interpolation;\n if (componentSelector.__emotion_styles !== undefined) {\n return componentSelector;\n }\n switch (typeof interpolation) {\n case 'boolean':\n {\n return '';\n }\n case 'object':\n {\n var keyframes = interpolation;\n if (keyframes.anim === 1) {\n cursor = {\n name: keyframes.name,\n styles: keyframes.styles,\n next: cursor\n };\n return keyframes.name;\n }\n var serializedStyles = interpolation;\n if (serializedStyles.styles !== undefined) {\n var next = serializedStyles.next;\n if (next !== undefined) {\n // not the most efficient thing ever but this is a pretty rare case\n // and there will be very few iterations of this generally\n while (next !== undefined) {\n cursor = {\n name: next.name,\n styles: next.styles,\n next: cursor\n };\n next = next.next;\n }\n }\n var styles = serializedStyles.styles + \";\";\n return styles;\n }\n return createStringFromObject(mergedProps, registered, interpolation);\n }\n case 'function':\n {\n if (mergedProps !== undefined) {\n var previousCursor = cursor;\n var result = interpolation(mergedProps);\n cursor = previousCursor;\n return handleInterpolation(mergedProps, registered, result);\n }\n break;\n }\n } // finalize string values (regular strings and functions interpolated into css calls)\n\n var asString = interpolation;\n if (registered == null) {\n return asString;\n }\n var cached = registered[asString];\n return cached !== undefined ? cached : asString;\n}\nfunction createStringFromObject(mergedProps, registered, obj) {\n var string = '';\n if (Array.isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n string += handleInterpolation(mergedProps, registered, obj[i]) + \";\";\n }\n } else {\n for (var key in obj) {\n var value = obj[key];\n if (typeof value !== 'object') {\n var asString = value;\n if (registered != null && registered[asString] !== undefined) {\n string += key + \"{\" + registered[asString] + \"}\";\n } else if (isProcessableValue(asString)) {\n string += processStyleName(key) + \":\" + processStyleValue(key, asString) + \";\";\n }\n } else {\n if (key === 'NO_COMPONENT_SELECTOR' && isDevelopment) {\n throw new Error(noComponentSelectorMessage);\n }\n if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {\n for (var _i = 0; _i < value.length; _i++) {\n if (isProcessableValue(value[_i])) {\n string += processStyleName(key) + \":\" + processStyleValue(key, value[_i]) + \";\";\n }\n }\n } else {\n var interpolated = handleInterpolation(mergedProps, registered, value);\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n string += processStyleName(key) + \":\" + interpolated + \";\";\n break;\n }\n default:\n {\n string += key + \"{\" + interpolated + \"}\";\n }\n }\n }\n }\n }\n }\n return string;\n}\nvar labelPattern = /label:\\s*([^\\s;{]+)\\s*(;|$)/g; // this is the cursor for keyframes\n// keyframes are stored on the SerializedStyles object as a linked list\n\nvar cursor;\nfunction serializeStyles(args, registered, mergedProps) {\n if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {\n return args[0];\n }\n var stringMode = true;\n var styles = '';\n cursor = undefined;\n var strings = args[0];\n if (strings == null || strings.raw === undefined) {\n stringMode = false;\n styles += handleInterpolation(mergedProps, registered, strings);\n } else {\n var asTemplateStringsArr = strings;\n styles += asTemplateStringsArr[0];\n } // we start at 1 since we've already handled the first arg\n\n for (var i = 1; i < args.length; i++) {\n styles += handleInterpolation(mergedProps, registered, args[i]);\n if (stringMode) {\n var templateStringsArr = strings;\n styles += templateStringsArr[i];\n }\n } // using a global regex with .exec is stateful so lastIndex has to be reset each time\n\n labelPattern.lastIndex = 0;\n var identifierName = '';\n var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5\n\n while ((match = labelPattern.exec(styles)) !== null) {\n identifierName += '-' + match[1];\n }\n var name = hashString(styles) + identifierName;\n return {\n name: name,\n styles: styles,\n next: cursor\n };\n}\nexport { serializeStyles };","/* eslint-disable */\n// Inspired by https://github.com/garycourt/murmurhash-js\n// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86\nfunction murmur2(str) {\n // 'm' and 'r' are mixing constants generated offline.\n // They're not really 'magic', they just happen to work well.\n // const m = 0x5bd1e995;\n // const r = 24;\n // Initialize the hash\n var h = 0; // Mix 4 bytes at a time into the hash\n\n var k,\n i = 0,\n len = str.length;\n for (; len >= 4; ++i, len -= 4) {\n k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;\n k = /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);\n k ^= /* k >>> r: */\n k >>> 24;\n h = /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^ /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Handle the last few bytes of the input array\n\n switch (len) {\n case 3:\n h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n case 2:\n h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n case 1:\n h ^= str.charCodeAt(i) & 0xff;\n h = /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Do a few final mixes of the hash to ensure the last few\n // bytes are well-incorporated.\n\n h ^= h >>> 13;\n h = /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n return ((h ^ h >>> 15) >>> 0).toString(36);\n}\nexport { murmur2 as default };","import _extends from '@babel/runtime/helpers/esm/extends';\nimport * as React from 'react';\nimport isPropValid from '@emotion/is-prop-valid';\nimport { withEmotionCache, ThemeContext } from '@emotion/react';\nimport { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\nimport { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\nvar testOmitPropsOnStringTag = isPropValid;\nvar testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {\n return key !== 'theme';\n};\nvar getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {\n return typeof tag === 'string' &&\n // 96 is one less than the char code\n // for \"a\" so this is checking that\n // it's a lowercase character\n tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;\n};\nvar composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {\n var shouldForwardProp;\n if (options) {\n var optionsShouldForwardProp = options.shouldForwardProp;\n shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {\n return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);\n } : optionsShouldForwardProp;\n }\n if (typeof shouldForwardProp !== 'function' && isReal) {\n shouldForwardProp = tag.__emotion_forwardProp;\n }\n return shouldForwardProp;\n};\nvar ILLEGAL_ESCAPE_SEQUENCE_ERROR = \"You have illegal escape sequence in your template literal, most likely inside content's property value.\\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \\\"content: '\\\\00d7';\\\" should become \\\"content: '\\\\\\\\00d7';\\\".\\nYou can read more about this here:\\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences\";\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serialized = _ref.serialized,\n isStringTag = _ref.isStringTag;\n registerStyles(cache, serialized, isStringTag);\n useInsertionEffectAlwaysWithSyncFallback(function () {\n return insertStyles(cache, serialized, isStringTag);\n });\n return null;\n};\nvar createStyled = function createStyled(tag, options) {\n if (process.env.NODE_ENV !== 'production') {\n if (tag === undefined) {\n throw new Error('You are trying to create a styled element with an undefined component.\\nYou may have forgotten to import it.');\n }\n }\n var isReal = tag.__emotion_real === tag;\n var baseTag = isReal && tag.__emotion_base || tag;\n var identifierName;\n var targetClassName;\n if (options !== undefined) {\n identifierName = options.label;\n targetClassName = options.target;\n }\n var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);\n var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);\n var shouldUseAs = !defaultShouldForwardProp('as');\n return function () {\n var args = arguments;\n var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];\n if (identifierName !== undefined) {\n styles.push(\"label:\" + identifierName + \";\");\n }\n if (args[0] == null || args[0].raw === undefined) {\n styles.push.apply(styles, args);\n } else {\n if (process.env.NODE_ENV !== 'production' && args[0][0] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n styles.push(args[0][0]);\n var len = args.length;\n var i = 1;\n for (; i < len; i++) {\n if (process.env.NODE_ENV !== 'production' && args[0][i] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n styles.push(args[i], args[0][i]);\n }\n } // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class\n\n var Styled = withEmotionCache(function (props, cache, ref) {\n var FinalTag = shouldUseAs && props.as || baseTag;\n var className = '';\n var classInterpolations = [];\n var mergedProps = props;\n if (props.theme == null) {\n mergedProps = {};\n for (var key in props) {\n mergedProps[key] = props[key];\n }\n mergedProps.theme = React.useContext(ThemeContext);\n }\n if (typeof props.className === 'string') {\n className = getRegisteredStyles(cache.registered, classInterpolations, props.className);\n } else if (props.className != null) {\n className = props.className + \" \";\n }\n var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);\n className += cache.key + \"-\" + serialized.name;\n if (targetClassName !== undefined) {\n className += \" \" + targetClassName;\n }\n var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;\n var newProps = {};\n for (var _key in props) {\n if (shouldUseAs && _key === 'as') continue;\n if (\n // $FlowFixMe\n finalShouldForwardProp(_key)) {\n newProps[_key] = props[_key];\n }\n }\n newProps.className = className;\n newProps.ref = ref;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serialized: serialized,\n isStringTag: typeof FinalTag === 'string'\n }), /*#__PURE__*/React.createElement(FinalTag, newProps));\n });\n Styled.displayName = identifierName !== undefined ? identifierName : \"Styled(\" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + \")\";\n Styled.defaultProps = tag.defaultProps;\n Styled.__emotion_real = Styled;\n Styled.__emotion_base = baseTag;\n Styled.__emotion_styles = styles;\n Styled.__emotion_forwardProp = shouldForwardProp;\n Object.defineProperty(Styled, 'toString', {\n value: function value() {\n if (targetClassName === undefined && process.env.NODE_ENV !== 'production') {\n return 'NO_COMPONENT_SELECTOR';\n } // $FlowFixMe: coerce undefined to string\n\n return \".\" + targetClassName;\n }\n });\n Styled.withComponent = function (nextTag, nextOptions) {\n return createStyled(nextTag, _extends({}, options, nextOptions, {\n shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)\n })).apply(void 0, styles);\n };\n return Styled;\n };\n};\nexport { createStyled as default };","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.bodyOpenClassName = exports.portalClassName = undefined;\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n};\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\nvar _react = require(\"react\");\nvar _react2 = _interopRequireDefault(_react);\nvar _reactDom = require(\"react-dom\");\nvar _reactDom2 = _interopRequireDefault(_reactDom);\nvar _propTypes = require(\"prop-types\");\nvar _propTypes2 = _interopRequireDefault(_propTypes);\nvar _ModalPortal = require(\"./ModalPortal\");\nvar _ModalPortal2 = _interopRequireDefault(_ModalPortal);\nvar _ariaAppHider = require(\"../helpers/ariaAppHider\");\nvar ariaAppHider = _interopRequireWildcard(_ariaAppHider);\nvar _safeHTMLElement = require(\"../helpers/safeHTMLElement\");\nvar _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement);\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\nfunction _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n } else {\n var newObj = {};\n if (obj != null) {\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];\n }\n }\n newObj.default = obj;\n return newObj;\n }\n}\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n}\nvar portalClassName = exports.portalClassName = \"ReactModalPortal\";\nvar bodyOpenClassName = exports.bodyOpenClassName = \"ReactModal__Body--open\";\nvar isReact16 = _safeHTMLElement.canUseDOM && _reactDom2.default.createPortal !== undefined;\nvar createHTMLElement = function createHTMLElement(name) {\n return document.createElement(name);\n};\nvar getCreatePortal = function getCreatePortal() {\n return isReact16 ? _reactDom2.default.createPortal : _reactDom2.default.unstable_renderSubtreeIntoContainer;\n};\nfunction getParentElement(parentSelector) {\n return parentSelector();\n}\nvar Modal = function (_Component) {\n _inherits(Modal, _Component);\n function Modal() {\n var _ref;\n var _temp, _this, _ret;\n _classCallCheck(this, Modal);\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Modal.__proto__ || Object.getPrototypeOf(Modal)).call.apply(_ref, [this].concat(args))), _this), _this.removePortal = function () {\n !isReact16 && _reactDom2.default.unmountComponentAtNode(_this.node);\n var parent = getParentElement(_this.props.parentSelector);\n if (parent && parent.contains(_this.node)) {\n parent.removeChild(_this.node);\n } else {\n // eslint-disable-next-line no-console\n console.warn('React-Modal: \"parentSelector\" prop did not returned any DOM ' + \"element. Make sure that the parent element is unmounted to \" + \"avoid any memory leaks.\");\n }\n }, _this.portalRef = function (ref) {\n _this.portal = ref;\n }, _this.renderPortal = function (props) {\n var createPortal = getCreatePortal();\n var portal = createPortal(_this, _react2.default.createElement(_ModalPortal2.default, _extends({\n defaultStyles: Modal.defaultStyles\n }, props)), _this.node);\n _this.portalRef(portal);\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n _createClass(Modal, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (!_safeHTMLElement.canUseDOM) return;\n if (!isReact16) {\n this.node = createHTMLElement(\"div\");\n }\n this.node.className = this.props.portalClassName;\n var parent = getParentElement(this.props.parentSelector);\n parent.appendChild(this.node);\n !isReact16 && this.renderPortal(this.props);\n }\n }, {\n key: \"getSnapshotBeforeUpdate\",\n value: function getSnapshotBeforeUpdate(prevProps) {\n var prevParent = getParentElement(prevProps.parentSelector);\n var nextParent = getParentElement(this.props.parentSelector);\n return {\n prevParent: prevParent,\n nextParent: nextParent\n };\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, _, snapshot) {\n if (!_safeHTMLElement.canUseDOM) return;\n var _props = this.props,\n isOpen = _props.isOpen,\n portalClassName = _props.portalClassName;\n if (prevProps.portalClassName !== portalClassName) {\n this.node.className = portalClassName;\n }\n var prevParent = snapshot.prevParent,\n nextParent = snapshot.nextParent;\n if (nextParent !== prevParent) {\n prevParent.removeChild(this.node);\n nextParent.appendChild(this.node);\n }\n\n // Stop unnecessary renders if modal is remaining closed\n if (!prevProps.isOpen && !isOpen) return;\n !isReact16 && this.renderPortal(this.props);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (!_safeHTMLElement.canUseDOM || !this.node || !this.portal) return;\n var state = this.portal.state;\n var now = Date.now();\n var closesAt = state.isOpen && this.props.closeTimeoutMS && (state.closesAt || now + this.props.closeTimeoutMS);\n if (closesAt) {\n if (!state.beforeClose) {\n this.portal.closeWithTimeout();\n }\n setTimeout(this.removePortal, closesAt - now);\n } else {\n this.removePortal();\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n if (!_safeHTMLElement.canUseDOM || !isReact16) {\n return null;\n }\n if (!this.node && isReact16) {\n this.node = createHTMLElement(\"div\");\n }\n var createPortal = getCreatePortal();\n return createPortal(_react2.default.createElement(_ModalPortal2.default, _extends({\n ref: this.portalRef,\n defaultStyles: Modal.defaultStyles\n }, this.props)), this.node);\n }\n }], [{\n key: \"setAppElement\",\n value: function setAppElement(element) {\n ariaAppHider.setElement(element);\n }\n\n /* eslint-disable react/no-unused-prop-types */\n\n /* eslint-enable react/no-unused-prop-types */\n }]);\n return Modal;\n}(_react.Component);\nModal.propTypes = {\n isOpen: _propTypes2.default.bool.isRequired,\n style: _propTypes2.default.shape({\n content: _propTypes2.default.object,\n overlay: _propTypes2.default.object\n }),\n portalClassName: _propTypes2.default.string,\n bodyOpenClassName: _propTypes2.default.string,\n htmlOpenClassName: _propTypes2.default.string,\n className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({\n base: _propTypes2.default.string.isRequired,\n afterOpen: _propTypes2.default.string.isRequired,\n beforeClose: _propTypes2.default.string.isRequired\n })]),\n overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({\n base: _propTypes2.default.string.isRequired,\n afterOpen: _propTypes2.default.string.isRequired,\n beforeClose: _propTypes2.default.string.isRequired\n })]),\n appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(_safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(_safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),\n onAfterOpen: _propTypes2.default.func,\n onRequestClose: _propTypes2.default.func,\n closeTimeoutMS: _propTypes2.default.number,\n ariaHideApp: _propTypes2.default.bool,\n shouldFocusAfterRender: _propTypes2.default.bool,\n shouldCloseOnOverlayClick: _propTypes2.default.bool,\n shouldReturnFocusAfterClose: _propTypes2.default.bool,\n preventScroll: _propTypes2.default.bool,\n parentSelector: _propTypes2.default.func,\n aria: _propTypes2.default.object,\n data: _propTypes2.default.object,\n role: _propTypes2.default.string,\n contentLabel: _propTypes2.default.string,\n shouldCloseOnEsc: _propTypes2.default.bool,\n overlayRef: _propTypes2.default.func,\n contentRef: _propTypes2.default.func,\n id: _propTypes2.default.string,\n overlayElement: _propTypes2.default.func,\n contentElement: _propTypes2.default.func\n};\nModal.defaultProps = {\n isOpen: false,\n portalClassName: portalClassName,\n bodyOpenClassName: bodyOpenClassName,\n role: \"dialog\",\n ariaHideApp: true,\n closeTimeoutMS: 0,\n shouldFocusAfterRender: true,\n shouldCloseOnEsc: true,\n shouldCloseOnOverlayClick: true,\n shouldReturnFocusAfterClose: true,\n preventScroll: false,\n parentSelector: function parentSelector() {\n return document.body;\n },\n overlayElement: function overlayElement(props, contentEl) {\n return _react2.default.createElement(\"div\", props, contentEl);\n },\n contentElement: function contentElement(props, children) {\n return _react2.default.createElement(\"div\", props, children);\n }\n};\nModal.defaultStyles = {\n overlay: {\n position: \"fixed\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: \"rgba(255, 255, 255, 0.75)\"\n },\n content: {\n position: \"absolute\",\n top: \"40px\",\n left: \"40px\",\n right: \"40px\",\n bottom: \"40px\",\n border: \"1px solid #ccc\",\n background: \"#fff\",\n overflow: \"auto\",\n WebkitOverflowScrolling: \"touch\",\n borderRadius: \"4px\",\n outline: \"none\",\n padding: \"20px\"\n }\n};\n(0, _reactLifecyclesCompat.polyfill)(Modal);\nif (process.env.NODE_ENV !== \"production\") {\n Modal.setCreateHTMLElement = function (fn) {\n return createHTMLElement = fn;\n };\n}\nexports.default = Modal;","import { __awaiter, __generator } from \"tslib\";\nimport PDFString from \"../objects/PDFString\";\nimport PDFHexString from \"../objects/PDFHexString\";\n/**\n * From the PDF-A3 specification, section **3.1. Requirements - General**.\n * See:\n * * https://www.pdfa.org/wp-content/uploads/2018/10/PDF20_AN002-AF.pdf\n */\nexport var AFRelationship;\n(function (AFRelationship) {\n AFRelationship[\"Source\"] = \"Source\";\n AFRelationship[\"Data\"] = \"Data\";\n AFRelationship[\"Alternative\"] = \"Alternative\";\n AFRelationship[\"Supplement\"] = \"Supplement\";\n AFRelationship[\"EncryptedPayload\"] = \"EncryptedPayload\";\n AFRelationship[\"FormData\"] = \"EncryptedPayload\";\n AFRelationship[\"Schema\"] = \"Schema\";\n AFRelationship[\"Unspecified\"] = \"Unspecified\";\n})(AFRelationship || (AFRelationship = {}));\nvar FileEmbedder = /** @class */function () {\n function FileEmbedder(fileData, fileName, options) {\n if (options === void 0) {\n options = {};\n }\n this.fileData = fileData;\n this.fileName = fileName;\n this.options = options;\n }\n FileEmbedder.for = function (bytes, fileName, options) {\n if (options === void 0) {\n options = {};\n }\n return new FileEmbedder(bytes, fileName, options);\n };\n FileEmbedder.prototype.embedIntoContext = function (context, ref) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, mimeType, description, creationDate, modificationDate, afRelationship, embeddedFileStream, embeddedFileStreamRef, fileSpecDict;\n return __generator(this, function (_b) {\n _a = this.options, mimeType = _a.mimeType, description = _a.description, creationDate = _a.creationDate, modificationDate = _a.modificationDate, afRelationship = _a.afRelationship;\n embeddedFileStream = context.flateStream(this.fileData, {\n Type: 'EmbeddedFile',\n Subtype: mimeType !== null && mimeType !== void 0 ? mimeType : undefined,\n Params: {\n Size: this.fileData.length,\n CreationDate: creationDate ? PDFString.fromDate(creationDate) : undefined,\n ModDate: modificationDate ? PDFString.fromDate(modificationDate) : undefined\n }\n });\n embeddedFileStreamRef = context.register(embeddedFileStream);\n fileSpecDict = context.obj({\n Type: 'Filespec',\n F: PDFString.of(this.fileName),\n UF: PDFHexString.fromText(this.fileName),\n EF: {\n F: embeddedFileStreamRef\n },\n Desc: description ? PDFHexString.fromText(description) : undefined,\n AFRelationship: afRelationship !== null && afRelationship !== void 0 ? afRelationship : undefined\n });\n if (ref) {\n context.assign(ref, fileSpecDict);\n return [2 /*return*/, ref];\n } else {\n return [2 /*return*/, context.register(fileSpecDict)];\n }\n return [2 /*return*/];\n });\n });\n };\n return FileEmbedder;\n}();\nexport default FileEmbedder;","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar b = \"function\" === typeof Symbol && Symbol.for,\n c = b ? Symbol.for(\"react.element\") : 60103,\n d = b ? Symbol.for(\"react.portal\") : 60106,\n e = b ? Symbol.for(\"react.fragment\") : 60107,\n f = b ? Symbol.for(\"react.strict_mode\") : 60108,\n g = b ? Symbol.for(\"react.profiler\") : 60114,\n h = b ? Symbol.for(\"react.provider\") : 60109,\n k = b ? Symbol.for(\"react.context\") : 60110,\n l = b ? Symbol.for(\"react.async_mode\") : 60111,\n m = b ? Symbol.for(\"react.concurrent_mode\") : 60111,\n n = b ? Symbol.for(\"react.forward_ref\") : 60112,\n p = b ? Symbol.for(\"react.suspense\") : 60113,\n q = b ? Symbol.for(\"react.suspense_list\") : 60120,\n r = b ? Symbol.for(\"react.memo\") : 60115,\n t = b ? Symbol.for(\"react.lazy\") : 60116,\n v = b ? Symbol.for(\"react.block\") : 60121,\n w = b ? Symbol.for(\"react.fundamental\") : 60117,\n x = b ? Symbol.for(\"react.responder\") : 60118,\n y = b ? Symbol.for(\"react.scope\") : 60119;\nfunction z(a) {\n if (\"object\" === typeof a && null !== a) {\n var u = a.$$typeof;\n switch (u) {\n case c:\n switch (a = a.type, a) {\n case l:\n case m:\n case e:\n case g:\n case f:\n case p:\n return a;\n default:\n switch (a = a && a.$$typeof, a) {\n case k:\n case n:\n case t:\n case r:\n case h:\n return a;\n default:\n return u;\n }\n }\n case d:\n return u;\n }\n }\n}\nfunction A(a) {\n return z(a) === m;\n}\nexports.AsyncMode = l;\nexports.ConcurrentMode = m;\nexports.ContextConsumer = k;\nexports.ContextProvider = h;\nexports.Element = c;\nexports.ForwardRef = n;\nexports.Fragment = e;\nexports.Lazy = t;\nexports.Memo = r;\nexports.Portal = d;\nexports.Profiler = g;\nexports.StrictMode = f;\nexports.Suspense = p;\nexports.isAsyncMode = function (a) {\n return A(a) || z(a) === l;\n};\nexports.isConcurrentMode = A;\nexports.isContextConsumer = function (a) {\n return z(a) === k;\n};\nexports.isContextProvider = function (a) {\n return z(a) === h;\n};\nexports.isElement = function (a) {\n return \"object\" === typeof a && null !== a && a.$$typeof === c;\n};\nexports.isForwardRef = function (a) {\n return z(a) === n;\n};\nexports.isFragment = function (a) {\n return z(a) === e;\n};\nexports.isLazy = function (a) {\n return z(a) === t;\n};\nexports.isMemo = function (a) {\n return z(a) === r;\n};\nexports.isPortal = function (a) {\n return z(a) === d;\n};\nexports.isProfiler = function (a) {\n return z(a) === g;\n};\nexports.isStrictMode = function (a) {\n return z(a) === f;\n};\nexports.isSuspense = function (a) {\n return z(a) === p;\n};\nexports.isValidElementType = function (a) {\n return \"string\" === typeof a || \"function\" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || \"object\" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);\n};\nexports.typeOf = z;","var CharCodes;\n(function (CharCodes) {\n CharCodes[CharCodes[\"Null\"] = 0] = \"Null\";\n CharCodes[CharCodes[\"Backspace\"] = 8] = \"Backspace\";\n CharCodes[CharCodes[\"Tab\"] = 9] = \"Tab\";\n CharCodes[CharCodes[\"Newline\"] = 10] = \"Newline\";\n CharCodes[CharCodes[\"FormFeed\"] = 12] = \"FormFeed\";\n CharCodes[CharCodes[\"CarriageReturn\"] = 13] = \"CarriageReturn\";\n CharCodes[CharCodes[\"Space\"] = 32] = \"Space\";\n CharCodes[CharCodes[\"ExclamationPoint\"] = 33] = \"ExclamationPoint\";\n CharCodes[CharCodes[\"Hash\"] = 35] = \"Hash\";\n CharCodes[CharCodes[\"Percent\"] = 37] = \"Percent\";\n CharCodes[CharCodes[\"LeftParen\"] = 40] = \"LeftParen\";\n CharCodes[CharCodes[\"RightParen\"] = 41] = \"RightParen\";\n CharCodes[CharCodes[\"Plus\"] = 43] = \"Plus\";\n CharCodes[CharCodes[\"Minus\"] = 45] = \"Minus\";\n CharCodes[CharCodes[\"Dash\"] = 45] = \"Dash\";\n CharCodes[CharCodes[\"Period\"] = 46] = \"Period\";\n CharCodes[CharCodes[\"ForwardSlash\"] = 47] = \"ForwardSlash\";\n CharCodes[CharCodes[\"Zero\"] = 48] = \"Zero\";\n CharCodes[CharCodes[\"One\"] = 49] = \"One\";\n CharCodes[CharCodes[\"Two\"] = 50] = \"Two\";\n CharCodes[CharCodes[\"Three\"] = 51] = \"Three\";\n CharCodes[CharCodes[\"Four\"] = 52] = \"Four\";\n CharCodes[CharCodes[\"Five\"] = 53] = \"Five\";\n CharCodes[CharCodes[\"Six\"] = 54] = \"Six\";\n CharCodes[CharCodes[\"Seven\"] = 55] = \"Seven\";\n CharCodes[CharCodes[\"Eight\"] = 56] = \"Eight\";\n CharCodes[CharCodes[\"Nine\"] = 57] = \"Nine\";\n CharCodes[CharCodes[\"LessThan\"] = 60] = \"LessThan\";\n CharCodes[CharCodes[\"GreaterThan\"] = 62] = \"GreaterThan\";\n CharCodes[CharCodes[\"A\"] = 65] = \"A\";\n CharCodes[CharCodes[\"D\"] = 68] = \"D\";\n CharCodes[CharCodes[\"E\"] = 69] = \"E\";\n CharCodes[CharCodes[\"F\"] = 70] = \"F\";\n CharCodes[CharCodes[\"O\"] = 79] = \"O\";\n CharCodes[CharCodes[\"P\"] = 80] = \"P\";\n CharCodes[CharCodes[\"R\"] = 82] = \"R\";\n CharCodes[CharCodes[\"LeftSquareBracket\"] = 91] = \"LeftSquareBracket\";\n CharCodes[CharCodes[\"BackSlash\"] = 92] = \"BackSlash\";\n CharCodes[CharCodes[\"RightSquareBracket\"] = 93] = \"RightSquareBracket\";\n CharCodes[CharCodes[\"a\"] = 97] = \"a\";\n CharCodes[CharCodes[\"b\"] = 98] = \"b\";\n CharCodes[CharCodes[\"d\"] = 100] = \"d\";\n CharCodes[CharCodes[\"e\"] = 101] = \"e\";\n CharCodes[CharCodes[\"f\"] = 102] = \"f\";\n CharCodes[CharCodes[\"i\"] = 105] = \"i\";\n CharCodes[CharCodes[\"j\"] = 106] = \"j\";\n CharCodes[CharCodes[\"l\"] = 108] = \"l\";\n CharCodes[CharCodes[\"m\"] = 109] = \"m\";\n CharCodes[CharCodes[\"n\"] = 110] = \"n\";\n CharCodes[CharCodes[\"o\"] = 111] = \"o\";\n CharCodes[CharCodes[\"r\"] = 114] = \"r\";\n CharCodes[CharCodes[\"s\"] = 115] = \"s\";\n CharCodes[CharCodes[\"t\"] = 116] = \"t\";\n CharCodes[CharCodes[\"u\"] = 117] = \"u\";\n CharCodes[CharCodes[\"x\"] = 120] = \"x\";\n CharCodes[CharCodes[\"LeftCurly\"] = 123] = \"LeftCurly\";\n CharCodes[CharCodes[\"RightCurly\"] = 125] = \"RightCurly\";\n CharCodes[CharCodes[\"Tilde\"] = 126] = \"Tilde\";\n})(CharCodes || (CharCodes = {}));\nexport default CharCodes;","module.exports = __webpack_public_path__ + \"static/credit-decision-1cac37bf50edb8f2c4b68cbe2ae9d7cb.pdf\";","import CharCodes from \"../syntax/CharCodes\";\nimport { charFromCode, copyStringIntoBuffer } from \"../../utils\";\nvar PDFHeader = /** @class */function () {\n function PDFHeader(major, minor) {\n this.major = String(major);\n this.minor = String(minor);\n }\n PDFHeader.prototype.toString = function () {\n var bc = charFromCode(129);\n return \"%PDF-\" + this.major + \".\" + this.minor + \"\\n%\" + bc + bc + bc + bc;\n };\n PDFHeader.prototype.sizeInBytes = function () {\n return 12 + this.major.length + this.minor.length;\n };\n PDFHeader.prototype.copyBytesInto = function (buffer, offset) {\n var initialOffset = offset;\n buffer[offset++] = CharCodes.Percent;\n buffer[offset++] = CharCodes.P;\n buffer[offset++] = CharCodes.D;\n buffer[offset++] = CharCodes.F;\n buffer[offset++] = CharCodes.Dash;\n offset += copyStringIntoBuffer(this.major, buffer, offset);\n buffer[offset++] = CharCodes.Period;\n offset += copyStringIntoBuffer(this.minor, buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.Percent;\n buffer[offset++] = 129;\n buffer[offset++] = 129;\n buffer[offset++] = 129;\n buffer[offset++] = 129;\n return offset - initialOffset;\n };\n PDFHeader.forVersion = function (major, minor) {\n return new PDFHeader(major, minor);\n };\n return PDFHeader;\n}();\nexport default PDFHeader;","import { __extends } from \"tslib\";\nimport { copyStringIntoBuffer, numberToString } from \"../../utils/index\";\nimport PDFObject from \"./PDFObject\";\nvar PDFNumber = /** @class */function (_super) {\n __extends(PDFNumber, _super);\n function PDFNumber(value) {\n var _this = _super.call(this) || this;\n _this.numberValue = value;\n _this.stringValue = numberToString(value);\n return _this;\n }\n PDFNumber.prototype.asNumber = function () {\n return this.numberValue;\n };\n /** @deprecated in favor of [[PDFNumber.asNumber]] */\n PDFNumber.prototype.value = function () {\n return this.numberValue;\n };\n PDFNumber.prototype.clone = function () {\n return PDFNumber.of(this.numberValue);\n };\n PDFNumber.prototype.toString = function () {\n return this.stringValue;\n };\n PDFNumber.prototype.sizeInBytes = function () {\n return this.stringValue.length;\n };\n PDFNumber.prototype.copyBytesInto = function (buffer, offset) {\n offset += copyStringIntoBuffer(this.stringValue, buffer, offset);\n return this.stringValue.length;\n };\n PDFNumber.of = function (value) {\n return new PDFNumber(value);\n };\n return PDFNumber;\n}(PDFObject);\nexport default PDFNumber;","import { __extends, __spreadArrays } from \"tslib\";\nimport PDFNumber from \"./PDFNumber\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { PDFArrayIsNotRectangleError } from \"../errors\";\nvar PDFArray = /** @class */function (_super) {\n __extends(PDFArray, _super);\n function PDFArray(context) {\n var _this = _super.call(this) || this;\n _this.array = [];\n _this.context = context;\n return _this;\n }\n PDFArray.prototype.size = function () {\n return this.array.length;\n };\n PDFArray.prototype.push = function (object) {\n this.array.push(object);\n };\n PDFArray.prototype.insert = function (index, object) {\n this.array.splice(index, 0, object);\n };\n PDFArray.prototype.indexOf = function (object) {\n var index = this.array.indexOf(object);\n return index === -1 ? undefined : index;\n };\n PDFArray.prototype.remove = function (index) {\n this.array.splice(index, 1);\n };\n PDFArray.prototype.set = function (idx, object) {\n this.array[idx] = object;\n };\n PDFArray.prototype.get = function (index) {\n return this.array[index];\n };\n PDFArray.prototype.lookupMaybe = function (index) {\n var _a;\n var types = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n types[_i - 1] = arguments[_i];\n }\n return (_a = this.context).lookupMaybe.apply(_a, __spreadArrays([this.get(index)], types));\n };\n PDFArray.prototype.lookup = function (index) {\n var _a;\n var types = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n types[_i - 1] = arguments[_i];\n }\n return (_a = this.context).lookup.apply(_a, __spreadArrays([this.get(index)], types));\n };\n PDFArray.prototype.asRectangle = function () {\n if (this.size() !== 4) throw new PDFArrayIsNotRectangleError(this.size());\n var lowerLeftX = this.lookup(0, PDFNumber).asNumber();\n var lowerLeftY = this.lookup(1, PDFNumber).asNumber();\n var upperRightX = this.lookup(2, PDFNumber).asNumber();\n var upperRightY = this.lookup(3, PDFNumber).asNumber();\n var x = lowerLeftX;\n var y = lowerLeftY;\n var width = upperRightX - lowerLeftX;\n var height = upperRightY - lowerLeftY;\n return {\n x: x,\n y: y,\n width: width,\n height: height\n };\n };\n PDFArray.prototype.asArray = function () {\n return this.array.slice();\n };\n PDFArray.prototype.clone = function (context) {\n var clone = PDFArray.withContext(context || this.context);\n for (var idx = 0, len = this.size(); idx < len; idx++) {\n clone.push(this.array[idx]);\n }\n return clone;\n };\n PDFArray.prototype.toString = function () {\n var arrayString = '[ ';\n for (var idx = 0, len = this.size(); idx < len; idx++) {\n arrayString += this.get(idx).toString();\n arrayString += ' ';\n }\n arrayString += ']';\n return arrayString;\n };\n PDFArray.prototype.sizeInBytes = function () {\n var size = 3;\n for (var idx = 0, len = this.size(); idx < len; idx++) {\n size += this.get(idx).sizeInBytes() + 1;\n }\n return size;\n };\n PDFArray.prototype.copyBytesInto = function (buffer, offset) {\n var initialOffset = offset;\n buffer[offset++] = CharCodes.LeftSquareBracket;\n buffer[offset++] = CharCodes.Space;\n for (var idx = 0, len = this.size(); idx < len; idx++) {\n offset += this.get(idx).copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Space;\n }\n buffer[offset++] = CharCodes.RightSquareBracket;\n return offset - initialOffset;\n };\n PDFArray.prototype.scalePDFNumbers = function (x, y) {\n for (var idx = 0, len = this.size(); idx < len; idx++) {\n var el = this.lookup(idx);\n if (el instanceof PDFNumber) {\n var factor = idx % 2 === 0 ? x : y;\n this.set(idx, PDFNumber.of(el.asNumber() * factor));\n }\n }\n };\n PDFArray.withContext = function (context) {\n return new PDFArray(context);\n };\n return PDFArray;\n}(PDFObject);\nexport default PDFArray;","import { __extends } from \"tslib\";\nimport { PrivateConstructorError } from \"../errors\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nvar ENFORCER = {};\nvar PDFBool = /** @class */function (_super) {\n __extends(PDFBool, _super);\n function PDFBool(enforcer, value) {\n var _this = this;\n if (enforcer !== ENFORCER) throw new PrivateConstructorError('PDFBool');\n _this = _super.call(this) || this;\n _this.value = value;\n return _this;\n }\n PDFBool.prototype.asBoolean = function () {\n return this.value;\n };\n PDFBool.prototype.clone = function () {\n return this;\n };\n PDFBool.prototype.toString = function () {\n return String(this.value);\n };\n PDFBool.prototype.sizeInBytes = function () {\n return this.value ? 4 : 5;\n };\n PDFBool.prototype.copyBytesInto = function (buffer, offset) {\n if (this.value) {\n buffer[offset++] = CharCodes.t;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.u;\n buffer[offset++] = CharCodes.e;\n return 4;\n } else {\n buffer[offset++] = CharCodes.f;\n buffer[offset++] = CharCodes.a;\n buffer[offset++] = CharCodes.l;\n buffer[offset++] = CharCodes.s;\n buffer[offset++] = CharCodes.e;\n return 5;\n }\n };\n PDFBool.True = new PDFBool(ENFORCER, true);\n PDFBool.False = new PDFBool(ENFORCER, false);\n return PDFBool;\n}(PDFObject);\nexport default PDFBool;","import CharCodes from \"./CharCodes\";\nexport var IsDelimiter = new Uint8Array(256);\nIsDelimiter[CharCodes.LeftParen] = 1;\nIsDelimiter[CharCodes.RightParen] = 1;\nIsDelimiter[CharCodes.LessThan] = 1;\nIsDelimiter[CharCodes.GreaterThan] = 1;\nIsDelimiter[CharCodes.LeftSquareBracket] = 1;\nIsDelimiter[CharCodes.RightSquareBracket] = 1;\nIsDelimiter[CharCodes.LeftCurly] = 1;\nIsDelimiter[CharCodes.RightCurly] = 1;\nIsDelimiter[CharCodes.ForwardSlash] = 1;\nIsDelimiter[CharCodes.Percent] = 1;","import CharCodes from \"./CharCodes\";\nexport var IsWhitespace = new Uint8Array(256);\nIsWhitespace[CharCodes.Null] = 1;\nIsWhitespace[CharCodes.Tab] = 1;\nIsWhitespace[CharCodes.Newline] = 1;\nIsWhitespace[CharCodes.FormFeed] = 1;\nIsWhitespace[CharCodes.CarriageReturn] = 1;\nIsWhitespace[CharCodes.Space] = 1;","import CharCodes from \"./CharCodes\";\nimport { IsDelimiter } from \"./Delimiters\";\nimport { IsWhitespace } from \"./Whitespace\";\nexport var IsIrregular = new Uint8Array(256);\nfor (var idx = 0, len = 256; idx < len; idx++) {\n IsIrregular[idx] = IsWhitespace[idx] || IsDelimiter[idx] ? 1 : 0;\n}\nIsIrregular[CharCodes.Hash] = 1;","import { __extends } from \"tslib\";\nimport { PrivateConstructorError } from \"../errors\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { IsIrregular } from \"../syntax/Irregular\";\nimport { charFromHexCode, copyStringIntoBuffer, toCharCode, toHexString } from \"../../utils\";\nvar decodeName = function (name) {\n return name.replace(/#([\\dABCDEF]{2})/g, function (_, hex) {\n return charFromHexCode(hex);\n });\n};\nvar isRegularChar = function (charCode) {\n return charCode >= CharCodes.ExclamationPoint && charCode <= CharCodes.Tilde && !IsIrregular[charCode];\n};\nvar ENFORCER = {};\nvar pool = new Map();\nvar PDFName = /** @class */function (_super) {\n __extends(PDFName, _super);\n function PDFName(enforcer, name) {\n var _this = this;\n if (enforcer !== ENFORCER) throw new PrivateConstructorError('PDFName');\n _this = _super.call(this) || this;\n var encodedName = '/';\n for (var idx = 0, len = name.length; idx < len; idx++) {\n var character = name[idx];\n var code = toCharCode(character);\n encodedName += isRegularChar(code) ? character : \"#\" + toHexString(code);\n }\n _this.encodedName = encodedName;\n return _this;\n }\n PDFName.prototype.asBytes = function () {\n var bytes = [];\n var hex = '';\n var escaped = false;\n var pushByte = function (byte) {\n if (byte !== undefined) bytes.push(byte);\n escaped = false;\n };\n for (var idx = 1, len = this.encodedName.length; idx < len; idx++) {\n var char = this.encodedName[idx];\n var byte = toCharCode(char);\n var nextChar = this.encodedName[idx + 1];\n if (!escaped) {\n if (byte === CharCodes.Hash) escaped = true;else pushByte(byte);\n } else {\n if (byte >= CharCodes.Zero && byte <= CharCodes.Nine || byte >= CharCodes.a && byte <= CharCodes.f || byte >= CharCodes.A && byte <= CharCodes.F) {\n hex += char;\n if (hex.length === 2 || !(nextChar >= '0' && nextChar <= '9' || nextChar >= 'a' && nextChar <= 'f' || nextChar >= 'A' && nextChar <= 'F')) {\n pushByte(parseInt(hex, 16));\n hex = '';\n }\n } else {\n pushByte(byte);\n }\n }\n }\n return new Uint8Array(bytes);\n };\n // TODO: This should probably use `utf8Decode()`\n // TODO: Polyfill Array.from?\n PDFName.prototype.decodeText = function () {\n var bytes = this.asBytes();\n return String.fromCharCode.apply(String, Array.from(bytes));\n };\n PDFName.prototype.asString = function () {\n return this.encodedName;\n };\n /** @deprecated in favor of [[PDFName.asString]] */\n PDFName.prototype.value = function () {\n return this.encodedName;\n };\n PDFName.prototype.clone = function () {\n return this;\n };\n PDFName.prototype.toString = function () {\n return this.encodedName;\n };\n PDFName.prototype.sizeInBytes = function () {\n return this.encodedName.length;\n };\n PDFName.prototype.copyBytesInto = function (buffer, offset) {\n offset += copyStringIntoBuffer(this.encodedName, buffer, offset);\n return this.encodedName.length;\n };\n PDFName.of = function (name) {\n var decodedValue = decodeName(name);\n var instance = pool.get(decodedValue);\n if (!instance) {\n instance = new PDFName(ENFORCER, decodedValue);\n pool.set(decodedValue, instance);\n }\n return instance;\n };\n /* tslint:disable member-ordering */\n PDFName.Length = PDFName.of('Length');\n PDFName.FlateDecode = PDFName.of('FlateDecode');\n PDFName.Resources = PDFName.of('Resources');\n PDFName.Font = PDFName.of('Font');\n PDFName.XObject = PDFName.of('XObject');\n PDFName.ExtGState = PDFName.of('ExtGState');\n PDFName.Contents = PDFName.of('Contents');\n PDFName.Type = PDFName.of('Type');\n PDFName.Parent = PDFName.of('Parent');\n PDFName.MediaBox = PDFName.of('MediaBox');\n PDFName.Page = PDFName.of('Page');\n PDFName.Annots = PDFName.of('Annots');\n PDFName.TrimBox = PDFName.of('TrimBox');\n PDFName.ArtBox = PDFName.of('ArtBox');\n PDFName.BleedBox = PDFName.of('BleedBox');\n PDFName.CropBox = PDFName.of('CropBox');\n PDFName.Rotate = PDFName.of('Rotate');\n PDFName.Title = PDFName.of('Title');\n PDFName.Author = PDFName.of('Author');\n PDFName.Subject = PDFName.of('Subject');\n PDFName.Creator = PDFName.of('Creator');\n PDFName.Keywords = PDFName.of('Keywords');\n PDFName.Producer = PDFName.of('Producer');\n PDFName.CreationDate = PDFName.of('CreationDate');\n PDFName.ModDate = PDFName.of('ModDate');\n return PDFName;\n}(PDFObject);\nexport default PDFName;","var PDFOperatorNames;\n(function (PDFOperatorNames) {\n // Non Stroking Color Operators\n PDFOperatorNames[\"NonStrokingColor\"] = \"sc\";\n PDFOperatorNames[\"NonStrokingColorN\"] = \"scn\";\n PDFOperatorNames[\"NonStrokingColorRgb\"] = \"rg\";\n PDFOperatorNames[\"NonStrokingColorGray\"] = \"g\";\n PDFOperatorNames[\"NonStrokingColorCmyk\"] = \"k\";\n PDFOperatorNames[\"NonStrokingColorspace\"] = \"cs\";\n // Stroking Color Operators\n PDFOperatorNames[\"StrokingColor\"] = \"SC\";\n PDFOperatorNames[\"StrokingColorN\"] = \"SCN\";\n PDFOperatorNames[\"StrokingColorRgb\"] = \"RG\";\n PDFOperatorNames[\"StrokingColorGray\"] = \"G\";\n PDFOperatorNames[\"StrokingColorCmyk\"] = \"K\";\n PDFOperatorNames[\"StrokingColorspace\"] = \"CS\";\n // Marked Content Operators\n PDFOperatorNames[\"BeginMarkedContentSequence\"] = \"BDC\";\n PDFOperatorNames[\"BeginMarkedContent\"] = \"BMC\";\n PDFOperatorNames[\"EndMarkedContent\"] = \"EMC\";\n PDFOperatorNames[\"MarkedContentPointWithProps\"] = \"DP\";\n PDFOperatorNames[\"MarkedContentPoint\"] = \"MP\";\n PDFOperatorNames[\"DrawObject\"] = \"Do\";\n // Graphics State Operators\n PDFOperatorNames[\"ConcatTransformationMatrix\"] = \"cm\";\n PDFOperatorNames[\"PopGraphicsState\"] = \"Q\";\n PDFOperatorNames[\"PushGraphicsState\"] = \"q\";\n PDFOperatorNames[\"SetFlatness\"] = \"i\";\n PDFOperatorNames[\"SetGraphicsStateParams\"] = \"gs\";\n PDFOperatorNames[\"SetLineCapStyle\"] = \"J\";\n PDFOperatorNames[\"SetLineDashPattern\"] = \"d\";\n PDFOperatorNames[\"SetLineJoinStyle\"] = \"j\";\n PDFOperatorNames[\"SetLineMiterLimit\"] = \"M\";\n PDFOperatorNames[\"SetLineWidth\"] = \"w\";\n PDFOperatorNames[\"SetTextMatrix\"] = \"Tm\";\n PDFOperatorNames[\"SetRenderingIntent\"] = \"ri\";\n // Graphics Operators\n PDFOperatorNames[\"AppendRectangle\"] = \"re\";\n PDFOperatorNames[\"BeginInlineImage\"] = \"BI\";\n PDFOperatorNames[\"BeginInlineImageData\"] = \"ID\";\n PDFOperatorNames[\"EndInlineImage\"] = \"EI\";\n PDFOperatorNames[\"ClipEvenOdd\"] = \"W*\";\n PDFOperatorNames[\"ClipNonZero\"] = \"W\";\n PDFOperatorNames[\"CloseAndStroke\"] = \"s\";\n PDFOperatorNames[\"CloseFillEvenOddAndStroke\"] = \"b*\";\n PDFOperatorNames[\"CloseFillNonZeroAndStroke\"] = \"b\";\n PDFOperatorNames[\"ClosePath\"] = \"h\";\n PDFOperatorNames[\"AppendBezierCurve\"] = \"c\";\n PDFOperatorNames[\"CurveToReplicateFinalPoint\"] = \"y\";\n PDFOperatorNames[\"CurveToReplicateInitialPoint\"] = \"v\";\n PDFOperatorNames[\"EndPath\"] = \"n\";\n PDFOperatorNames[\"FillEvenOddAndStroke\"] = \"B*\";\n PDFOperatorNames[\"FillEvenOdd\"] = \"f*\";\n PDFOperatorNames[\"FillNonZeroAndStroke\"] = \"B\";\n PDFOperatorNames[\"FillNonZero\"] = \"f\";\n PDFOperatorNames[\"LegacyFillNonZero\"] = \"F\";\n PDFOperatorNames[\"LineTo\"] = \"l\";\n PDFOperatorNames[\"MoveTo\"] = \"m\";\n PDFOperatorNames[\"ShadingFill\"] = \"sh\";\n PDFOperatorNames[\"StrokePath\"] = \"S\";\n // Text Operators\n PDFOperatorNames[\"BeginText\"] = \"BT\";\n PDFOperatorNames[\"EndText\"] = \"ET\";\n PDFOperatorNames[\"MoveText\"] = \"Td\";\n PDFOperatorNames[\"MoveTextSetLeading\"] = \"TD\";\n PDFOperatorNames[\"NextLine\"] = \"T*\";\n PDFOperatorNames[\"SetCharacterSpacing\"] = \"Tc\";\n PDFOperatorNames[\"SetFontAndSize\"] = \"Tf\";\n PDFOperatorNames[\"SetTextHorizontalScaling\"] = \"Tz\";\n PDFOperatorNames[\"SetTextLineHeight\"] = \"TL\";\n PDFOperatorNames[\"SetTextRenderingMode\"] = \"Tr\";\n PDFOperatorNames[\"SetTextRise\"] = \"Ts\";\n PDFOperatorNames[\"SetWordSpacing\"] = \"Tw\";\n PDFOperatorNames[\"ShowText\"] = \"Tj\";\n PDFOperatorNames[\"ShowTextAdjusted\"] = \"TJ\";\n PDFOperatorNames[\"ShowTextLine\"] = \"'\";\n PDFOperatorNames[\"ShowTextLineAndSpace\"] = \"\\\"\";\n // Type3 Font Operators\n PDFOperatorNames[\"Type3D0\"] = \"d0\";\n PDFOperatorNames[\"Type3D1\"] = \"d1\";\n // Compatibility Section Operators\n PDFOperatorNames[\"BeginCompatibilitySection\"] = \"BX\";\n PDFOperatorNames[\"EndCompatibilitySection\"] = \"EX\";\n})(PDFOperatorNames || (PDFOperatorNames = {}));\nexport default PDFOperatorNames;","import { __extends } from \"tslib\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nvar PDFNull = /** @class */function (_super) {\n __extends(PDFNull, _super);\n function PDFNull() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFNull.prototype.asNull = function () {\n return null;\n };\n PDFNull.prototype.clone = function () {\n return this;\n };\n PDFNull.prototype.toString = function () {\n return 'null';\n };\n PDFNull.prototype.sizeInBytes = function () {\n return 4;\n };\n PDFNull.prototype.copyBytesInto = function (buffer, offset) {\n buffer[offset++] = CharCodes.n;\n buffer[offset++] = CharCodes.u;\n buffer[offset++] = CharCodes.l;\n buffer[offset++] = CharCodes.l;\n return 4;\n };\n return PDFNull;\n}(PDFObject);\nexport default new PDFNull();","import { __extends, __spreadArrays } from \"tslib\";\nimport PDFName from \"./PDFName\";\nimport PDFNull from \"./PDFNull\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nvar PDFDict = /** @class */function (_super) {\n __extends(PDFDict, _super);\n function PDFDict(map, context) {\n var _this = _super.call(this) || this;\n _this.dict = map;\n _this.context = context;\n return _this;\n }\n PDFDict.prototype.keys = function () {\n return Array.from(this.dict.keys());\n };\n PDFDict.prototype.values = function () {\n return Array.from(this.dict.values());\n };\n PDFDict.prototype.entries = function () {\n return Array.from(this.dict.entries());\n };\n PDFDict.prototype.set = function (key, value) {\n this.dict.set(key, value);\n };\n PDFDict.prototype.get = function (key,\n // TODO: `preservePDFNull` is for backwards compatibility. Should be\n // removed in next breaking API change.\n preservePDFNull) {\n if (preservePDFNull === void 0) {\n preservePDFNull = false;\n }\n var value = this.dict.get(key);\n if (value === PDFNull && !preservePDFNull) return undefined;\n return value;\n };\n PDFDict.prototype.has = function (key) {\n var value = this.dict.get(key);\n return value !== undefined && value !== PDFNull;\n };\n PDFDict.prototype.lookupMaybe = function (key) {\n var _a;\n var types = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n types[_i - 1] = arguments[_i];\n }\n // TODO: `preservePDFNull` is for backwards compatibility. Should be\n // removed in next breaking API change.\n var preservePDFNull = types.includes(PDFNull);\n var value = (_a = this.context).lookupMaybe.apply(_a, __spreadArrays([this.get(key, preservePDFNull)], types));\n if (value === PDFNull && !preservePDFNull) return undefined;\n return value;\n };\n PDFDict.prototype.lookup = function (key) {\n var _a;\n var types = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n types[_i - 1] = arguments[_i];\n }\n // TODO: `preservePDFNull` is for backwards compatibility. Should be\n // removed in next breaking API change.\n var preservePDFNull = types.includes(PDFNull);\n var value = (_a = this.context).lookup.apply(_a, __spreadArrays([this.get(key, preservePDFNull)], types));\n if (value === PDFNull && !preservePDFNull) return undefined;\n return value;\n };\n PDFDict.prototype.delete = function (key) {\n return this.dict.delete(key);\n };\n PDFDict.prototype.asMap = function () {\n return new Map(this.dict);\n };\n /** Generate a random key that doesn't exist in current key set */\n PDFDict.prototype.uniqueKey = function (tag) {\n if (tag === void 0) {\n tag = '';\n }\n var existingKeys = this.keys();\n var key = PDFName.of(this.context.addRandomSuffix(tag, 10));\n while (existingKeys.includes(key)) {\n key = PDFName.of(this.context.addRandomSuffix(tag, 10));\n }\n return key;\n };\n PDFDict.prototype.clone = function (context) {\n var clone = PDFDict.withContext(context || this.context);\n var entries = this.entries();\n for (var idx = 0, len = entries.length; idx < len; idx++) {\n var _a = entries[idx],\n key = _a[0],\n value = _a[1];\n clone.set(key, value);\n }\n return clone;\n };\n PDFDict.prototype.toString = function () {\n var dictString = '<<\\n';\n var entries = this.entries();\n for (var idx = 0, len = entries.length; idx < len; idx++) {\n var _a = entries[idx],\n key = _a[0],\n value = _a[1];\n dictString += key.toString() + ' ' + value.toString() + '\\n';\n }\n dictString += '>>';\n return dictString;\n };\n PDFDict.prototype.sizeInBytes = function () {\n var size = 5;\n var entries = this.entries();\n for (var idx = 0, len = entries.length; idx < len; idx++) {\n var _a = entries[idx],\n key = _a[0],\n value = _a[1];\n size += key.sizeInBytes() + value.sizeInBytes() + 2;\n }\n return size;\n };\n PDFDict.prototype.copyBytesInto = function (buffer, offset) {\n var initialOffset = offset;\n buffer[offset++] = CharCodes.LessThan;\n buffer[offset++] = CharCodes.LessThan;\n buffer[offset++] = CharCodes.Newline;\n var entries = this.entries();\n for (var idx = 0, len = entries.length; idx < len; idx++) {\n var _a = entries[idx],\n key = _a[0],\n value = _a[1];\n offset += key.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Space;\n offset += value.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n }\n buffer[offset++] = CharCodes.GreaterThan;\n buffer[offset++] = CharCodes.GreaterThan;\n return offset - initialOffset;\n };\n PDFDict.withContext = function (context) {\n return new PDFDict(new Map(), context);\n };\n PDFDict.fromMapWithContext = function (map, context) {\n return new PDFDict(map, context);\n };\n return PDFDict;\n}(PDFObject);\nexport default PDFDict;","import { __extends } from \"tslib\";\nimport { MethodNotImplementedError } from \"../errors\";\nimport PDFName from \"./PDFName\";\nimport PDFNumber from \"./PDFNumber\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nvar PDFStream = /** @class */function (_super) {\n __extends(PDFStream, _super);\n function PDFStream(dict) {\n var _this = _super.call(this) || this;\n _this.dict = dict;\n return _this;\n }\n PDFStream.prototype.clone = function (_context) {\n throw new MethodNotImplementedError(this.constructor.name, 'clone');\n };\n PDFStream.prototype.getContentsString = function () {\n throw new MethodNotImplementedError(this.constructor.name, 'getContentsString');\n };\n PDFStream.prototype.getContents = function () {\n throw new MethodNotImplementedError(this.constructor.name, 'getContents');\n };\n PDFStream.prototype.getContentsSize = function () {\n throw new MethodNotImplementedError(this.constructor.name, 'getContentsSize');\n };\n PDFStream.prototype.updateDict = function () {\n var contentsSize = this.getContentsSize();\n this.dict.set(PDFName.Length, PDFNumber.of(contentsSize));\n };\n PDFStream.prototype.sizeInBytes = function () {\n this.updateDict();\n return this.dict.sizeInBytes() + this.getContentsSize() + 18;\n };\n PDFStream.prototype.toString = function () {\n this.updateDict();\n var streamString = this.dict.toString();\n streamString += '\\nstream\\n';\n streamString += this.getContentsString();\n streamString += '\\nendstream';\n return streamString;\n };\n PDFStream.prototype.copyBytesInto = function (buffer, offset) {\n this.updateDict();\n var initialOffset = offset;\n offset += this.dict.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.s;\n buffer[offset++] = CharCodes.t;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.e;\n buffer[offset++] = CharCodes.a;\n buffer[offset++] = CharCodes.m;\n buffer[offset++] = CharCodes.Newline;\n var contents = this.getContents();\n for (var idx = 0, len = contents.length; idx < len; idx++) {\n buffer[offset++] = contents[idx];\n }\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.e;\n buffer[offset++] = CharCodes.n;\n buffer[offset++] = CharCodes.d;\n buffer[offset++] = CharCodes.s;\n buffer[offset++] = CharCodes.t;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.e;\n buffer[offset++] = CharCodes.a;\n buffer[offset++] = CharCodes.m;\n return offset - initialOffset;\n };\n return PDFStream;\n}(PDFObject);\nexport default PDFStream;","import { __extends } from \"tslib\";\nimport PDFStream from \"./PDFStream\";\nimport { arrayAsString } from \"../../utils\";\nvar PDFRawStream = /** @class */function (_super) {\n __extends(PDFRawStream, _super);\n function PDFRawStream(dict, contents) {\n var _this = _super.call(this, dict) || this;\n _this.contents = contents;\n return _this;\n }\n PDFRawStream.prototype.asUint8Array = function () {\n return this.contents.slice();\n };\n PDFRawStream.prototype.clone = function (context) {\n return PDFRawStream.of(this.dict.clone(context), this.contents.slice());\n };\n PDFRawStream.prototype.getContentsString = function () {\n return arrayAsString(this.contents);\n };\n PDFRawStream.prototype.getContents = function () {\n return this.contents;\n };\n PDFRawStream.prototype.getContentsSize = function () {\n return this.contents.length;\n };\n PDFRawStream.of = function (dict, contents) {\n return new PDFRawStream(dict, contents);\n };\n return PDFRawStream;\n}(PDFStream);\nexport default PDFRawStream;","import { __extends } from \"tslib\";\nimport { PrivateConstructorError } from \"../errors\";\nimport PDFObject from \"./PDFObject\";\nimport { copyStringIntoBuffer } from \"../../utils\";\nvar ENFORCER = {};\nvar pool = new Map();\nvar PDFRef = /** @class */function (_super) {\n __extends(PDFRef, _super);\n function PDFRef(enforcer, objectNumber, generationNumber) {\n var _this = this;\n if (enforcer !== ENFORCER) throw new PrivateConstructorError('PDFRef');\n _this = _super.call(this) || this;\n _this.objectNumber = objectNumber;\n _this.generationNumber = generationNumber;\n _this.tag = objectNumber + \" \" + generationNumber + \" R\";\n return _this;\n }\n PDFRef.prototype.clone = function () {\n return this;\n };\n PDFRef.prototype.toString = function () {\n return this.tag;\n };\n PDFRef.prototype.sizeInBytes = function () {\n return this.tag.length;\n };\n PDFRef.prototype.copyBytesInto = function (buffer, offset) {\n offset += copyStringIntoBuffer(this.tag, buffer, offset);\n return this.tag.length;\n };\n PDFRef.of = function (objectNumber, generationNumber) {\n if (generationNumber === void 0) {\n generationNumber = 0;\n }\n var tag = objectNumber + \" \" + generationNumber + \" R\";\n var instance = pool.get(tag);\n if (!instance) {\n instance = new PDFRef(ENFORCER, objectNumber, generationNumber);\n pool.set(tag, instance);\n }\n return instance;\n };\n return PDFRef;\n}(PDFObject);\nexport default PDFRef;","import PDFObject from \"../objects/PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { copyStringIntoBuffer } from \"../../utils\";\nvar PDFOperator = /** @class */function () {\n function PDFOperator(name, args) {\n this.name = name;\n this.args = args || [];\n }\n PDFOperator.prototype.clone = function (context) {\n var args = new Array(this.args.length);\n for (var idx = 0, len = args.length; idx < len; idx++) {\n var arg = this.args[idx];\n args[idx] = arg instanceof PDFObject ? arg.clone(context) : arg;\n }\n return PDFOperator.of(this.name, args);\n };\n PDFOperator.prototype.toString = function () {\n var value = '';\n for (var idx = 0, len = this.args.length; idx < len; idx++) {\n value += String(this.args[idx]) + ' ';\n }\n value += this.name;\n return value;\n };\n PDFOperator.prototype.sizeInBytes = function () {\n var size = 0;\n for (var idx = 0, len = this.args.length; idx < len; idx++) {\n var arg = this.args[idx];\n size += (arg instanceof PDFObject ? arg.sizeInBytes() : arg.length) + 1;\n }\n size += this.name.length;\n return size;\n };\n PDFOperator.prototype.copyBytesInto = function (buffer, offset) {\n var initialOffset = offset;\n for (var idx = 0, len = this.args.length; idx < len; idx++) {\n var arg = this.args[idx];\n if (arg instanceof PDFObject) {\n offset += arg.copyBytesInto(buffer, offset);\n } else {\n offset += copyStringIntoBuffer(arg, buffer, offset);\n }\n buffer[offset++] = CharCodes.Space;\n }\n offset += copyStringIntoBuffer(this.name, buffer, offset);\n return offset - initialOffset;\n };\n PDFOperator.of = function (name, args) {\n return new PDFOperator(name, args);\n };\n return PDFOperator;\n}();\nexport default PDFOperator;","import { __extends } from \"tslib\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFRef from \"../objects/PDFRef\";\nimport PDFFlateStream from \"./PDFFlateStream\";\nimport { bytesFor, Cache, reverseArray, sizeInBytes, sum } from \"../../utils\";\nexport var EntryType;\n(function (EntryType) {\n EntryType[EntryType[\"Deleted\"] = 0] = \"Deleted\";\n EntryType[EntryType[\"Uncompressed\"] = 1] = \"Uncompressed\";\n EntryType[EntryType[\"Compressed\"] = 2] = \"Compressed\";\n})(EntryType || (EntryType = {}));\n/**\n * Entries should be added using the [[addDeletedEntry]],\n * [[addUncompressedEntry]], and [[addCompressedEntry]] methods\n * **in order of ascending object number**.\n */\nvar PDFCrossRefStream = /** @class */function (_super) {\n __extends(PDFCrossRefStream, _super);\n function PDFCrossRefStream(dict, entries, encode) {\n if (encode === void 0) {\n encode = true;\n }\n var _this = _super.call(this, dict, encode) || this;\n // Returns an array of integer pairs for each subsection of the cross ref\n // section, where each integer pair represents:\n // firstObjectNumber(OfSection), length(OfSection)\n _this.computeIndex = function () {\n var subsections = [];\n var subsectionLength = 0;\n for (var idx = 0, len = _this.entries.length; idx < len; idx++) {\n var currEntry = _this.entries[idx];\n var prevEntry = _this.entries[idx - 1];\n if (idx === 0) {\n subsections.push(currEntry.ref.objectNumber);\n } else if (currEntry.ref.objectNumber - prevEntry.ref.objectNumber > 1) {\n subsections.push(subsectionLength);\n subsections.push(currEntry.ref.objectNumber);\n subsectionLength = 0;\n }\n subsectionLength += 1;\n }\n subsections.push(subsectionLength);\n return subsections;\n };\n _this.computeEntryTuples = function () {\n var entryTuples = new Array(_this.entries.length);\n for (var idx = 0, len = _this.entries.length; idx < len; idx++) {\n var entry = _this.entries[idx];\n if (entry.type === EntryType.Deleted) {\n var type = entry.type,\n nextFreeObjectNumber = entry.nextFreeObjectNumber,\n ref = entry.ref;\n entryTuples[idx] = [type, nextFreeObjectNumber, ref.generationNumber];\n }\n if (entry.type === EntryType.Uncompressed) {\n var type = entry.type,\n offset = entry.offset,\n ref = entry.ref;\n entryTuples[idx] = [type, offset, ref.generationNumber];\n }\n if (entry.type === EntryType.Compressed) {\n var type = entry.type,\n objectStreamRef = entry.objectStreamRef,\n index = entry.index;\n entryTuples[idx] = [type, objectStreamRef.objectNumber, index];\n }\n }\n return entryTuples;\n };\n _this.computeMaxEntryByteWidths = function () {\n var entryTuples = _this.entryTuplesCache.access();\n var widths = [0, 0, 0];\n for (var idx = 0, len = entryTuples.length; idx < len; idx++) {\n var _a = entryTuples[idx],\n first = _a[0],\n second = _a[1],\n third = _a[2];\n var firstSize = sizeInBytes(first);\n var secondSize = sizeInBytes(second);\n var thirdSize = sizeInBytes(third);\n if (firstSize > widths[0]) widths[0] = firstSize;\n if (secondSize > widths[1]) widths[1] = secondSize;\n if (thirdSize > widths[2]) widths[2] = thirdSize;\n }\n return widths;\n };\n _this.entries = entries || [];\n _this.entryTuplesCache = Cache.populatedBy(_this.computeEntryTuples);\n _this.maxByteWidthsCache = Cache.populatedBy(_this.computeMaxEntryByteWidths);\n _this.indexCache = Cache.populatedBy(_this.computeIndex);\n dict.set(PDFName.of('Type'), PDFName.of('XRef'));\n return _this;\n }\n PDFCrossRefStream.prototype.addDeletedEntry = function (ref, nextFreeObjectNumber) {\n var type = EntryType.Deleted;\n this.entries.push({\n type: type,\n ref: ref,\n nextFreeObjectNumber: nextFreeObjectNumber\n });\n this.entryTuplesCache.invalidate();\n this.maxByteWidthsCache.invalidate();\n this.indexCache.invalidate();\n this.contentsCache.invalidate();\n };\n PDFCrossRefStream.prototype.addUncompressedEntry = function (ref, offset) {\n var type = EntryType.Uncompressed;\n this.entries.push({\n type: type,\n ref: ref,\n offset: offset\n });\n this.entryTuplesCache.invalidate();\n this.maxByteWidthsCache.invalidate();\n this.indexCache.invalidate();\n this.contentsCache.invalidate();\n };\n PDFCrossRefStream.prototype.addCompressedEntry = function (ref, objectStreamRef, index) {\n var type = EntryType.Compressed;\n this.entries.push({\n type: type,\n ref: ref,\n objectStreamRef: objectStreamRef,\n index: index\n });\n this.entryTuplesCache.invalidate();\n this.maxByteWidthsCache.invalidate();\n this.indexCache.invalidate();\n this.contentsCache.invalidate();\n };\n PDFCrossRefStream.prototype.clone = function (context) {\n var _a = this,\n dict = _a.dict,\n entries = _a.entries,\n encode = _a.encode;\n return PDFCrossRefStream.of(dict.clone(context), entries.slice(), encode);\n };\n PDFCrossRefStream.prototype.getContentsString = function () {\n var entryTuples = this.entryTuplesCache.access();\n var byteWidths = this.maxByteWidthsCache.access();\n var value = '';\n for (var entryIdx = 0, entriesLen = entryTuples.length; entryIdx < entriesLen; entryIdx++) {\n var _a = entryTuples[entryIdx],\n first = _a[0],\n second = _a[1],\n third = _a[2];\n var firstBytes = reverseArray(bytesFor(first));\n var secondBytes = reverseArray(bytesFor(second));\n var thirdBytes = reverseArray(bytesFor(third));\n for (var idx = byteWidths[0] - 1; idx >= 0; idx--) {\n value += (firstBytes[idx] || 0).toString(2);\n }\n for (var idx = byteWidths[1] - 1; idx >= 0; idx--) {\n value += (secondBytes[idx] || 0).toString(2);\n }\n for (var idx = byteWidths[2] - 1; idx >= 0; idx--) {\n value += (thirdBytes[idx] || 0).toString(2);\n }\n }\n return value;\n };\n PDFCrossRefStream.prototype.getUnencodedContents = function () {\n var entryTuples = this.entryTuplesCache.access();\n var byteWidths = this.maxByteWidthsCache.access();\n var buffer = new Uint8Array(this.getUnencodedContentsSize());\n var offset = 0;\n for (var entryIdx = 0, entriesLen = entryTuples.length; entryIdx < entriesLen; entryIdx++) {\n var _a = entryTuples[entryIdx],\n first = _a[0],\n second = _a[1],\n third = _a[2];\n var firstBytes = reverseArray(bytesFor(first));\n var secondBytes = reverseArray(bytesFor(second));\n var thirdBytes = reverseArray(bytesFor(third));\n for (var idx = byteWidths[0] - 1; idx >= 0; idx--) {\n buffer[offset++] = firstBytes[idx] || 0;\n }\n for (var idx = byteWidths[1] - 1; idx >= 0; idx--) {\n buffer[offset++] = secondBytes[idx] || 0;\n }\n for (var idx = byteWidths[2] - 1; idx >= 0; idx--) {\n buffer[offset++] = thirdBytes[idx] || 0;\n }\n }\n return buffer;\n };\n PDFCrossRefStream.prototype.getUnencodedContentsSize = function () {\n var byteWidths = this.maxByteWidthsCache.access();\n var entryWidth = sum(byteWidths);\n return entryWidth * this.entries.length;\n };\n PDFCrossRefStream.prototype.updateDict = function () {\n _super.prototype.updateDict.call(this);\n var byteWidths = this.maxByteWidthsCache.access();\n var index = this.indexCache.access();\n var context = this.dict.context;\n this.dict.set(PDFName.of('W'), context.obj(byteWidths));\n this.dict.set(PDFName.of('Index'), context.obj(index));\n };\n PDFCrossRefStream.create = function (dict, encode) {\n if (encode === void 0) {\n encode = true;\n }\n var stream = new PDFCrossRefStream(dict, [], encode);\n stream.addDeletedEntry(PDFRef.of(0, 65535), 0);\n return stream;\n };\n PDFCrossRefStream.of = function (dict, entries, encode) {\n if (encode === void 0) {\n encode = true;\n }\n return new PDFCrossRefStream(dict, entries, encode);\n };\n return PDFCrossRefStream;\n}(PDFFlateStream);\nexport default PDFCrossRefStream;","import { __extends } from \"tslib\";\nimport pako from 'pako';\nimport { MethodNotImplementedError } from \"../errors\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFStream from \"../objects/PDFStream\";\nimport { Cache } from \"../../utils\";\nvar PDFFlateStream = /** @class */function (_super) {\n __extends(PDFFlateStream, _super);\n function PDFFlateStream(dict, encode) {\n var _this = _super.call(this, dict) || this;\n _this.computeContents = function () {\n var unencodedContents = _this.getUnencodedContents();\n return _this.encode ? pako.deflate(unencodedContents) : unencodedContents;\n };\n _this.encode = encode;\n if (encode) dict.set(PDFName.of('Filter'), PDFName.of('FlateDecode'));\n _this.contentsCache = Cache.populatedBy(_this.computeContents);\n return _this;\n }\n PDFFlateStream.prototype.getContents = function () {\n return this.contentsCache.access();\n };\n PDFFlateStream.prototype.getContentsSize = function () {\n return this.contentsCache.access().length;\n };\n PDFFlateStream.prototype.getUnencodedContents = function () {\n throw new MethodNotImplementedError(this.constructor.name, 'getUnencodedContents');\n };\n return PDFFlateStream;\n}(PDFStream);\nexport default PDFFlateStream;","import { __extends } from \"tslib\";\nimport PDFFlateStream from \"./PDFFlateStream\";\nimport CharCodes from \"../syntax/CharCodes\";\nvar PDFContentStream = /** @class */function (_super) {\n __extends(PDFContentStream, _super);\n function PDFContentStream(dict, operators, encode) {\n if (encode === void 0) {\n encode = true;\n }\n var _this = _super.call(this, dict, encode) || this;\n _this.operators = operators;\n return _this;\n }\n PDFContentStream.prototype.push = function () {\n var _a;\n var operators = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operators[_i] = arguments[_i];\n }\n (_a = this.operators).push.apply(_a, operators);\n };\n PDFContentStream.prototype.clone = function (context) {\n var operators = new Array(this.operators.length);\n for (var idx = 0, len = this.operators.length; idx < len; idx++) {\n operators[idx] = this.operators[idx].clone(context);\n }\n var _a = this,\n dict = _a.dict,\n encode = _a.encode;\n return PDFContentStream.of(dict.clone(context), operators, encode);\n };\n PDFContentStream.prototype.getContentsString = function () {\n var value = '';\n for (var idx = 0, len = this.operators.length; idx < len; idx++) {\n value += this.operators[idx] + \"\\n\";\n }\n return value;\n };\n PDFContentStream.prototype.getUnencodedContents = function () {\n var buffer = new Uint8Array(this.getUnencodedContentsSize());\n var offset = 0;\n for (var idx = 0, len = this.operators.length; idx < len; idx++) {\n offset += this.operators[idx].copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n }\n return buffer;\n };\n PDFContentStream.prototype.getUnencodedContentsSize = function () {\n var size = 0;\n for (var idx = 0, len = this.operators.length; idx < len; idx++) {\n size += this.operators[idx].sizeInBytes() + 1;\n }\n return size;\n };\n PDFContentStream.of = function (dict, operators, encode) {\n if (encode === void 0) {\n encode = true;\n }\n return new PDFContentStream(dict, operators, encode);\n };\n return PDFContentStream;\n}(PDFFlateStream);\nexport default PDFContentStream;","/**\n * Generates a pseudo random number. Although it is not cryptographically secure\n * and uniformly distributed, it is not a concern for the intended use-case,\n * which is to generate distinct numbers.\n *\n * Credit: https://stackoverflow.com/a/19303725/10254049\n */\nvar SimpleRNG = /** @class */function () {\n function SimpleRNG(seed) {\n this.seed = seed;\n }\n SimpleRNG.prototype.nextInt = function () {\n var x = Math.sin(this.seed++) * 10000;\n return x - Math.floor(x);\n };\n SimpleRNG.withSeed = function (seed) {\n return new SimpleRNG(seed);\n };\n return SimpleRNG;\n}();\nexport { SimpleRNG };","import { __assign } from \"tslib\";\nimport pako from 'pako';\nimport PDFHeader from \"./document/PDFHeader\";\nimport { UnexpectedObjectTypeError } from \"./errors\";\nimport PDFArray from \"./objects/PDFArray\";\nimport PDFBool from \"./objects/PDFBool\";\nimport PDFDict from \"./objects/PDFDict\";\nimport PDFName from \"./objects/PDFName\";\nimport PDFNull from \"./objects/PDFNull\";\nimport PDFNumber from \"./objects/PDFNumber\";\nimport PDFObject from \"./objects/PDFObject\";\nimport PDFRawStream from \"./objects/PDFRawStream\";\nimport PDFRef from \"./objects/PDFRef\";\nimport PDFOperator from \"./operators/PDFOperator\";\nimport Ops from \"./operators/PDFOperatorNames\";\nimport PDFContentStream from \"./structures/PDFContentStream\";\nimport { typedArrayFor } from \"../utils\";\nimport { SimpleRNG } from \"../utils/rng\";\nvar byAscendingObjectNumber = function (_a, _b) {\n var a = _a[0];\n var b = _b[0];\n return a.objectNumber - b.objectNumber;\n};\nvar PDFContext = /** @class */function () {\n function PDFContext() {\n this.largestObjectNumber = 0;\n this.header = PDFHeader.forVersion(1, 7);\n this.trailerInfo = {};\n this.indirectObjects = new Map();\n this.rng = SimpleRNG.withSeed(1);\n }\n PDFContext.prototype.assign = function (ref, object) {\n this.indirectObjects.set(ref, object);\n if (ref.objectNumber > this.largestObjectNumber) {\n this.largestObjectNumber = ref.objectNumber;\n }\n };\n PDFContext.prototype.nextRef = function () {\n this.largestObjectNumber += 1;\n return PDFRef.of(this.largestObjectNumber);\n };\n PDFContext.prototype.register = function (object) {\n var ref = this.nextRef();\n this.assign(ref, object);\n return ref;\n };\n PDFContext.prototype.delete = function (ref) {\n return this.indirectObjects.delete(ref);\n };\n PDFContext.prototype.lookupMaybe = function (ref) {\n var types = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n types[_i - 1] = arguments[_i];\n }\n // TODO: `preservePDFNull` is for backwards compatibility. Should be\n // removed in next breaking API change.\n var preservePDFNull = types.includes(PDFNull);\n var result = ref instanceof PDFRef ? this.indirectObjects.get(ref) : ref;\n if (!result || result === PDFNull && !preservePDFNull) return undefined;\n for (var idx = 0, len = types.length; idx < len; idx++) {\n var type = types[idx];\n if (type === PDFNull) {\n if (result === PDFNull) return result;\n } else {\n if (result instanceof type) return result;\n }\n }\n throw new UnexpectedObjectTypeError(types, result);\n };\n PDFContext.prototype.lookup = function (ref) {\n var types = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n types[_i - 1] = arguments[_i];\n }\n var result = ref instanceof PDFRef ? this.indirectObjects.get(ref) : ref;\n if (types.length === 0) return result;\n for (var idx = 0, len = types.length; idx < len; idx++) {\n var type = types[idx];\n if (type === PDFNull) {\n if (result === PDFNull) return result;\n } else {\n if (result instanceof type) return result;\n }\n }\n throw new UnexpectedObjectTypeError(types, result);\n };\n PDFContext.prototype.getObjectRef = function (pdfObject) {\n var entries = Array.from(this.indirectObjects.entries());\n for (var idx = 0, len = entries.length; idx < len; idx++) {\n var _a = entries[idx],\n ref = _a[0],\n object = _a[1];\n if (object === pdfObject) {\n return ref;\n }\n }\n return undefined;\n };\n PDFContext.prototype.enumerateIndirectObjects = function () {\n return Array.from(this.indirectObjects.entries()).sort(byAscendingObjectNumber);\n };\n PDFContext.prototype.obj = function (literal) {\n if (literal instanceof PDFObject) {\n return literal;\n } else if (literal === null || literal === undefined) {\n return PDFNull;\n } else if (typeof literal === 'string') {\n return PDFName.of(literal);\n } else if (typeof literal === 'number') {\n return PDFNumber.of(literal);\n } else if (typeof literal === 'boolean') {\n return literal ? PDFBool.True : PDFBool.False;\n } else if (Array.isArray(literal)) {\n var array = PDFArray.withContext(this);\n for (var idx = 0, len = literal.length; idx < len; idx++) {\n array.push(this.obj(literal[idx]));\n }\n return array;\n } else {\n var dict = PDFDict.withContext(this);\n var keys = Object.keys(literal);\n for (var idx = 0, len = keys.length; idx < len; idx++) {\n var key = keys[idx];\n var value = literal[key];\n if (value !== undefined) dict.set(PDFName.of(key), this.obj(value));\n }\n return dict;\n }\n };\n PDFContext.prototype.stream = function (contents, dict) {\n if (dict === void 0) {\n dict = {};\n }\n return PDFRawStream.of(this.obj(dict), typedArrayFor(contents));\n };\n PDFContext.prototype.flateStream = function (contents, dict) {\n if (dict === void 0) {\n dict = {};\n }\n return this.stream(pako.deflate(typedArrayFor(contents)), __assign(__assign({}, dict), {\n Filter: 'FlateDecode'\n }));\n };\n PDFContext.prototype.contentStream = function (operators, dict) {\n if (dict === void 0) {\n dict = {};\n }\n return PDFContentStream.of(this.obj(dict), operators);\n };\n PDFContext.prototype.formXObject = function (operators, dict) {\n if (dict === void 0) {\n dict = {};\n }\n return this.contentStream(operators, __assign(__assign({\n BBox: this.obj([0, 0, 0, 0]),\n Matrix: this.obj([1, 0, 0, 1, 0, 0])\n }, dict), {\n Type: 'XObject',\n Subtype: 'Form'\n }));\n };\n /*\n * Reference to PDFContentStream that contains a single PDFOperator: `q`.\n * Used by [[PDFPageLeaf]] instances to ensure that when content streams are\n * added to a modified PDF, they start in the default, unchanged graphics\n * state.\n */\n PDFContext.prototype.getPushGraphicsStateContentStream = function () {\n if (this.pushGraphicsStateContentStreamRef) {\n return this.pushGraphicsStateContentStreamRef;\n }\n var dict = this.obj({});\n var op = PDFOperator.of(Ops.PushGraphicsState);\n var stream = PDFContentStream.of(dict, [op]);\n this.pushGraphicsStateContentStreamRef = this.register(stream);\n return this.pushGraphicsStateContentStreamRef;\n };\n /*\n * Reference to PDFContentStream that contains a single PDFOperator: `Q`.\n * Used by [[PDFPageLeaf]] instances to ensure that when content streams are\n * added to a modified PDF, they start in the default, unchanged graphics\n * state.\n */\n PDFContext.prototype.getPopGraphicsStateContentStream = function () {\n if (this.popGraphicsStateContentStreamRef) {\n return this.popGraphicsStateContentStreamRef;\n }\n var dict = this.obj({});\n var op = PDFOperator.of(Ops.PopGraphicsState);\n var stream = PDFContentStream.of(dict, [op]);\n this.popGraphicsStateContentStreamRef = this.register(stream);\n return this.popGraphicsStateContentStreamRef;\n };\n PDFContext.prototype.addRandomSuffix = function (prefix, suffixLength) {\n if (suffixLength === void 0) {\n suffixLength = 4;\n }\n return prefix + \"-\" + Math.floor(this.rng.nextInt() * Math.pow(10, suffixLength));\n };\n PDFContext.create = function () {\n return new PDFContext();\n };\n return PDFContext;\n}();\nexport default PDFContext;","import { __extends } from \"tslib\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFStream from \"../objects/PDFStream\";\nvar PDFPageLeaf = /** @class */function (_super) {\n __extends(PDFPageLeaf, _super);\n function PDFPageLeaf(map, context, autoNormalizeCTM) {\n if (autoNormalizeCTM === void 0) {\n autoNormalizeCTM = true;\n }\n var _this = _super.call(this, map, context) || this;\n _this.normalized = false;\n _this.autoNormalizeCTM = autoNormalizeCTM;\n return _this;\n }\n PDFPageLeaf.prototype.clone = function (context) {\n var clone = PDFPageLeaf.fromMapWithContext(new Map(), context || this.context, this.autoNormalizeCTM);\n var entries = this.entries();\n for (var idx = 0, len = entries.length; idx < len; idx++) {\n var _a = entries[idx],\n key = _a[0],\n value = _a[1];\n clone.set(key, value);\n }\n return clone;\n };\n PDFPageLeaf.prototype.Parent = function () {\n return this.lookupMaybe(PDFName.Parent, PDFDict);\n };\n PDFPageLeaf.prototype.Contents = function () {\n return this.lookup(PDFName.of('Contents'));\n };\n PDFPageLeaf.prototype.Annots = function () {\n return this.lookupMaybe(PDFName.Annots, PDFArray);\n };\n PDFPageLeaf.prototype.BleedBox = function () {\n return this.lookupMaybe(PDFName.BleedBox, PDFArray);\n };\n PDFPageLeaf.prototype.TrimBox = function () {\n return this.lookupMaybe(PDFName.TrimBox, PDFArray);\n };\n PDFPageLeaf.prototype.ArtBox = function () {\n return this.lookupMaybe(PDFName.ArtBox, PDFArray);\n };\n PDFPageLeaf.prototype.Resources = function () {\n var dictOrRef = this.getInheritableAttribute(PDFName.Resources);\n return this.context.lookupMaybe(dictOrRef, PDFDict);\n };\n PDFPageLeaf.prototype.MediaBox = function () {\n var arrayOrRef = this.getInheritableAttribute(PDFName.MediaBox);\n return this.context.lookup(arrayOrRef, PDFArray);\n };\n PDFPageLeaf.prototype.CropBox = function () {\n var arrayOrRef = this.getInheritableAttribute(PDFName.CropBox);\n return this.context.lookupMaybe(arrayOrRef, PDFArray);\n };\n PDFPageLeaf.prototype.Rotate = function () {\n var numberOrRef = this.getInheritableAttribute(PDFName.Rotate);\n return this.context.lookupMaybe(numberOrRef, PDFNumber);\n };\n PDFPageLeaf.prototype.getInheritableAttribute = function (name) {\n var attribute;\n this.ascend(function (node) {\n if (!attribute) attribute = node.get(name);\n });\n return attribute;\n };\n PDFPageLeaf.prototype.setParent = function (parentRef) {\n this.set(PDFName.Parent, parentRef);\n };\n PDFPageLeaf.prototype.addContentStream = function (contentStreamRef) {\n var Contents = this.normalizedEntries().Contents || this.context.obj([]);\n this.set(PDFName.Contents, Contents);\n Contents.push(contentStreamRef);\n };\n PDFPageLeaf.prototype.wrapContentStreams = function (startStream, endStream) {\n var Contents = this.Contents();\n if (Contents instanceof PDFArray) {\n Contents.insert(0, startStream);\n Contents.push(endStream);\n return true;\n }\n return false;\n };\n PDFPageLeaf.prototype.addAnnot = function (annotRef) {\n var Annots = this.normalizedEntries().Annots;\n Annots.push(annotRef);\n };\n PDFPageLeaf.prototype.removeAnnot = function (annotRef) {\n var Annots = this.normalizedEntries().Annots;\n var index = Annots.indexOf(annotRef);\n if (index !== undefined) {\n Annots.remove(index);\n }\n };\n PDFPageLeaf.prototype.setFontDictionary = function (name, fontDictRef) {\n var Font = this.normalizedEntries().Font;\n Font.set(name, fontDictRef);\n };\n PDFPageLeaf.prototype.newFontDictionaryKey = function (tag) {\n var Font = this.normalizedEntries().Font;\n return Font.uniqueKey(tag);\n };\n PDFPageLeaf.prototype.newFontDictionary = function (tag, fontDictRef) {\n var key = this.newFontDictionaryKey(tag);\n this.setFontDictionary(key, fontDictRef);\n return key;\n };\n PDFPageLeaf.prototype.setXObject = function (name, xObjectRef) {\n var XObject = this.normalizedEntries().XObject;\n XObject.set(name, xObjectRef);\n };\n PDFPageLeaf.prototype.newXObjectKey = function (tag) {\n var XObject = this.normalizedEntries().XObject;\n return XObject.uniqueKey(tag);\n };\n PDFPageLeaf.prototype.newXObject = function (tag, xObjectRef) {\n var key = this.newXObjectKey(tag);\n this.setXObject(key, xObjectRef);\n return key;\n };\n PDFPageLeaf.prototype.setExtGState = function (name, extGStateRef) {\n var ExtGState = this.normalizedEntries().ExtGState;\n ExtGState.set(name, extGStateRef);\n };\n PDFPageLeaf.prototype.newExtGStateKey = function (tag) {\n var ExtGState = this.normalizedEntries().ExtGState;\n return ExtGState.uniqueKey(tag);\n };\n PDFPageLeaf.prototype.newExtGState = function (tag, extGStateRef) {\n var key = this.newExtGStateKey(tag);\n this.setExtGState(key, extGStateRef);\n return key;\n };\n PDFPageLeaf.prototype.ascend = function (visitor) {\n visitor(this);\n var Parent = this.Parent();\n if (Parent) Parent.ascend(visitor);\n };\n PDFPageLeaf.prototype.normalize = function () {\n if (this.normalized) return;\n var context = this.context;\n var contentsRef = this.get(PDFName.Contents);\n var contents = this.context.lookup(contentsRef);\n if (contents instanceof PDFStream) {\n this.set(PDFName.Contents, context.obj([contentsRef]));\n }\n if (this.autoNormalizeCTM) {\n this.wrapContentStreams(this.context.getPushGraphicsStateContentStream(), this.context.getPopGraphicsStateContentStream());\n }\n // TODO: Clone `Resources` if it is inherited\n var dictOrRef = this.getInheritableAttribute(PDFName.Resources);\n var Resources = context.lookupMaybe(dictOrRef, PDFDict) || context.obj({});\n this.set(PDFName.Resources, Resources);\n // TODO: Clone `Font` if it is inherited\n var Font = Resources.lookupMaybe(PDFName.Font, PDFDict) || context.obj({});\n Resources.set(PDFName.Font, Font);\n // TODO: Clone `XObject` if it is inherited\n var XObject = Resources.lookupMaybe(PDFName.XObject, PDFDict) || context.obj({});\n Resources.set(PDFName.XObject, XObject);\n // TODO: Clone `ExtGState` if it is inherited\n var ExtGState = Resources.lookupMaybe(PDFName.ExtGState, PDFDict) || context.obj({});\n Resources.set(PDFName.ExtGState, ExtGState);\n var Annots = this.Annots() || context.obj([]);\n this.set(PDFName.Annots, Annots);\n this.normalized = true;\n };\n PDFPageLeaf.prototype.normalizedEntries = function () {\n this.normalize();\n var Annots = this.Annots();\n var Resources = this.Resources();\n var Contents = this.Contents();\n return {\n Annots: Annots,\n Resources: Resources,\n Contents: Contents,\n Font: Resources.lookup(PDFName.Font, PDFDict),\n XObject: Resources.lookup(PDFName.XObject, PDFDict),\n ExtGState: Resources.lookup(PDFName.ExtGState, PDFDict)\n };\n };\n PDFPageLeaf.InheritableEntries = ['Resources', 'MediaBox', 'CropBox', 'Rotate'];\n PDFPageLeaf.withContextAndParent = function (context, parent) {\n var dict = new Map();\n dict.set(PDFName.Type, PDFName.Page);\n dict.set(PDFName.Parent, parent);\n dict.set(PDFName.Resources, context.obj({}));\n dict.set(PDFName.MediaBox, context.obj([0, 0, 612, 792]));\n return new PDFPageLeaf(dict, context, false);\n };\n PDFPageLeaf.fromMapWithContext = function (map, context, autoNormalizeCTM) {\n if (autoNormalizeCTM === void 0) {\n autoNormalizeCTM = true;\n }\n return new PDFPageLeaf(map, context, autoNormalizeCTM);\n };\n return PDFPageLeaf;\n}(PDFDict);\nexport default PDFPageLeaf;","import PDFArray from \"./objects/PDFArray\";\nimport PDFDict from \"./objects/PDFDict\";\nimport PDFName from \"./objects/PDFName\";\nimport PDFRef from \"./objects/PDFRef\";\nimport PDFStream from \"./objects/PDFStream\";\nimport PDFPageLeaf from \"./structures/PDFPageLeaf\";\n/**\n * PDFObjectCopier copies PDFObjects from a src context to a dest context.\n * The primary use case for this is to copy pages between PDFs.\n *\n * _Copying_ an object with a PDFObjectCopier is different from _cloning_ an\n * object with its [[PDFObject.clone]] method:\n *\n * ```\n * const src: PDFContext = ...\n * const dest: PDFContext = ...\n * const originalObject: PDFObject = ...\n * const copiedObject = PDFObjectCopier.for(src, dest).copy(originalObject);\n * const clonedObject = originalObject.clone();\n * ```\n *\n * Copying an object is equivalent to cloning it and then copying over any other\n * objects that it references. Note that only dictionaries, arrays, and streams\n * (or structures build from them) can contain indirect references to other\n * objects. Copying a PDFObject that is not a dictionary, array, or stream is\n * supported, but is equivalent to cloning it.\n */\nvar PDFObjectCopier = /** @class */function () {\n function PDFObjectCopier(src, dest) {\n var _this = this;\n this.traversedObjects = new Map();\n // prettier-ignore\n this.copy = function (object) {\n return object instanceof PDFPageLeaf ? _this.copyPDFPage(object) : object instanceof PDFDict ? _this.copyPDFDict(object) : object instanceof PDFArray ? _this.copyPDFArray(object) : object instanceof PDFStream ? _this.copyPDFStream(object) : object instanceof PDFRef ? _this.copyPDFIndirectObject(object) : object.clone();\n };\n this.copyPDFPage = function (originalPage) {\n var clonedPage = originalPage.clone();\n // Move any entries that the originalPage is inheriting from its parent\n // tree nodes directly into originalPage so they are preserved during\n // the copy.\n var InheritableEntries = PDFPageLeaf.InheritableEntries;\n for (var idx = 0, len = InheritableEntries.length; idx < len; idx++) {\n var key = PDFName.of(InheritableEntries[idx]);\n var value = clonedPage.getInheritableAttribute(key);\n if (!clonedPage.get(key) && value) clonedPage.set(key, value);\n }\n // Remove the parent reference to prevent the whole donor document's page\n // tree from being copied when we only need a single page.\n clonedPage.delete(PDFName.of('Parent'));\n return _this.copyPDFDict(clonedPage);\n };\n this.copyPDFDict = function (originalDict) {\n if (_this.traversedObjects.has(originalDict)) {\n return _this.traversedObjects.get(originalDict);\n }\n var clonedDict = originalDict.clone(_this.dest);\n _this.traversedObjects.set(originalDict, clonedDict);\n var entries = originalDict.entries();\n for (var idx = 0, len = entries.length; idx < len; idx++) {\n var _a = entries[idx],\n key = _a[0],\n value = _a[1];\n clonedDict.set(key, _this.copy(value));\n }\n return clonedDict;\n };\n this.copyPDFArray = function (originalArray) {\n if (_this.traversedObjects.has(originalArray)) {\n return _this.traversedObjects.get(originalArray);\n }\n var clonedArray = originalArray.clone(_this.dest);\n _this.traversedObjects.set(originalArray, clonedArray);\n for (var idx = 0, len = originalArray.size(); idx < len; idx++) {\n var value = originalArray.get(idx);\n clonedArray.set(idx, _this.copy(value));\n }\n return clonedArray;\n };\n this.copyPDFStream = function (originalStream) {\n if (_this.traversedObjects.has(originalStream)) {\n return _this.traversedObjects.get(originalStream);\n }\n var clonedStream = originalStream.clone(_this.dest);\n _this.traversedObjects.set(originalStream, clonedStream);\n var entries = originalStream.dict.entries();\n for (var idx = 0, len = entries.length; idx < len; idx++) {\n var _a = entries[idx],\n key = _a[0],\n value = _a[1];\n clonedStream.dict.set(key, _this.copy(value));\n }\n return clonedStream;\n };\n this.copyPDFIndirectObject = function (ref) {\n var alreadyMapped = _this.traversedObjects.has(ref);\n if (!alreadyMapped) {\n var newRef = _this.dest.nextRef();\n _this.traversedObjects.set(ref, newRef);\n var dereferencedValue = _this.src.lookup(ref);\n if (dereferencedValue) {\n var cloned = _this.copy(dereferencedValue);\n _this.dest.assign(newRef, cloned);\n }\n }\n return _this.traversedObjects.get(ref);\n };\n this.src = src;\n this.dest = dest;\n }\n PDFObjectCopier.for = function (src, dest) {\n return new PDFObjectCopier(src, dest);\n };\n return PDFObjectCopier;\n}();\nexport default PDFObjectCopier;","import PDFRef from \"../objects/PDFRef\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { copyStringIntoBuffer, padStart } from \"../../utils\";\n/**\n * Entries should be added using the [[addEntry]] and [[addDeletedEntry]]\n * methods **in order of ascending object number**.\n */\nvar PDFCrossRefSection = /** @class */function () {\n function PDFCrossRefSection(firstEntry) {\n this.subsections = firstEntry ? [[firstEntry]] : [];\n this.chunkIdx = 0;\n this.chunkLength = firstEntry ? 1 : 0;\n }\n PDFCrossRefSection.prototype.addEntry = function (ref, offset) {\n this.append({\n ref: ref,\n offset: offset,\n deleted: false\n });\n };\n PDFCrossRefSection.prototype.addDeletedEntry = function (ref, nextFreeObjectNumber) {\n this.append({\n ref: ref,\n offset: nextFreeObjectNumber,\n deleted: true\n });\n };\n PDFCrossRefSection.prototype.toString = function () {\n var section = \"xref\\n\";\n for (var rangeIdx = 0, rangeLen = this.subsections.length; rangeIdx < rangeLen; rangeIdx++) {\n var range = this.subsections[rangeIdx];\n section += range[0].ref.objectNumber + \" \" + range.length + \"\\n\";\n for (var entryIdx = 0, entryLen = range.length; entryIdx < entryLen; entryIdx++) {\n var entry = range[entryIdx];\n section += padStart(String(entry.offset), 10, '0');\n section += ' ';\n section += padStart(String(entry.ref.generationNumber), 5, '0');\n section += ' ';\n section += entry.deleted ? 'f' : 'n';\n section += ' \\n';\n }\n }\n return section;\n };\n PDFCrossRefSection.prototype.sizeInBytes = function () {\n var size = 5;\n for (var idx = 0, len = this.subsections.length; idx < len; idx++) {\n var subsection = this.subsections[idx];\n var subsectionLength = subsection.length;\n var firstEntry = subsection[0];\n size += 2;\n size += String(firstEntry.ref.objectNumber).length;\n size += String(subsectionLength).length;\n size += 20 * subsectionLength;\n }\n return size;\n };\n PDFCrossRefSection.prototype.copyBytesInto = function (buffer, offset) {\n var initialOffset = offset;\n buffer[offset++] = CharCodes.x;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.e;\n buffer[offset++] = CharCodes.f;\n buffer[offset++] = CharCodes.Newline;\n offset += this.copySubsectionsIntoBuffer(this.subsections, buffer, offset);\n return offset - initialOffset;\n };\n PDFCrossRefSection.prototype.copySubsectionsIntoBuffer = function (subsections, buffer, offset) {\n var initialOffset = offset;\n var length = subsections.length;\n for (var idx = 0; idx < length; idx++) {\n var subsection = this.subsections[idx];\n var firstObjectNumber = String(subsection[0].ref.objectNumber);\n offset += copyStringIntoBuffer(firstObjectNumber, buffer, offset);\n buffer[offset++] = CharCodes.Space;\n var rangeLength = String(subsection.length);\n offset += copyStringIntoBuffer(rangeLength, buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n offset += this.copyEntriesIntoBuffer(subsection, buffer, offset);\n }\n return offset - initialOffset;\n };\n PDFCrossRefSection.prototype.copyEntriesIntoBuffer = function (entries, buffer, offset) {\n var length = entries.length;\n for (var idx = 0; idx < length; idx++) {\n var entry = entries[idx];\n var entryOffset = padStart(String(entry.offset), 10, '0');\n offset += copyStringIntoBuffer(entryOffset, buffer, offset);\n buffer[offset++] = CharCodes.Space;\n var entryGen = padStart(String(entry.ref.generationNumber), 5, '0');\n offset += copyStringIntoBuffer(entryGen, buffer, offset);\n buffer[offset++] = CharCodes.Space;\n buffer[offset++] = entry.deleted ? CharCodes.f : CharCodes.n;\n buffer[offset++] = CharCodes.Space;\n buffer[offset++] = CharCodes.Newline;\n }\n return 20 * length;\n };\n PDFCrossRefSection.prototype.append = function (currEntry) {\n if (this.chunkLength === 0) {\n this.subsections.push([currEntry]);\n this.chunkIdx = 0;\n this.chunkLength = 1;\n return;\n }\n var chunk = this.subsections[this.chunkIdx];\n var prevEntry = chunk[this.chunkLength - 1];\n if (currEntry.ref.objectNumber - prevEntry.ref.objectNumber > 1) {\n this.subsections.push([currEntry]);\n this.chunkIdx += 1;\n this.chunkLength = 1;\n } else {\n chunk.push(currEntry);\n this.chunkLength += 1;\n }\n };\n PDFCrossRefSection.create = function () {\n return new PDFCrossRefSection({\n ref: PDFRef.of(0, 65535),\n offset: 0,\n deleted: true\n });\n };\n PDFCrossRefSection.createEmpty = function () {\n return new PDFCrossRefSection();\n };\n return PDFCrossRefSection;\n}();\nexport default PDFCrossRefSection;","import CharCodes from \"../syntax/CharCodes\";\nimport { copyStringIntoBuffer } from \"../../utils\";\nvar PDFTrailer = /** @class */function () {\n function PDFTrailer(lastXRefOffset) {\n this.lastXRefOffset = String(lastXRefOffset);\n }\n PDFTrailer.prototype.toString = function () {\n return \"startxref\\n\" + this.lastXRefOffset + \"\\n%%EOF\";\n };\n PDFTrailer.prototype.sizeInBytes = function () {\n return 16 + this.lastXRefOffset.length;\n };\n PDFTrailer.prototype.copyBytesInto = function (buffer, offset) {\n var initialOffset = offset;\n buffer[offset++] = CharCodes.s;\n buffer[offset++] = CharCodes.t;\n buffer[offset++] = CharCodes.a;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.t;\n buffer[offset++] = CharCodes.x;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.e;\n buffer[offset++] = CharCodes.f;\n buffer[offset++] = CharCodes.Newline;\n offset += copyStringIntoBuffer(this.lastXRefOffset, buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.Percent;\n buffer[offset++] = CharCodes.Percent;\n buffer[offset++] = CharCodes.E;\n buffer[offset++] = CharCodes.O;\n buffer[offset++] = CharCodes.F;\n return offset - initialOffset;\n };\n PDFTrailer.forLastCrossRefSectionOffset = function (offset) {\n return new PDFTrailer(offset);\n };\n return PDFTrailer;\n}();\nexport default PDFTrailer;","import CharCodes from \"../syntax/CharCodes\";\nvar PDFTrailerDict = /** @class */function () {\n function PDFTrailerDict(dict) {\n this.dict = dict;\n }\n PDFTrailerDict.prototype.toString = function () {\n return \"trailer\\n\" + this.dict.toString();\n };\n PDFTrailerDict.prototype.sizeInBytes = function () {\n return 8 + this.dict.sizeInBytes();\n };\n PDFTrailerDict.prototype.copyBytesInto = function (buffer, offset) {\n var initialOffset = offset;\n buffer[offset++] = CharCodes.t;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.a;\n buffer[offset++] = CharCodes.i;\n buffer[offset++] = CharCodes.l;\n buffer[offset++] = CharCodes.e;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.Newline;\n offset += this.dict.copyBytesInto(buffer, offset);\n return offset - initialOffset;\n };\n PDFTrailerDict.of = function (dict) {\n return new PDFTrailerDict(dict);\n };\n return PDFTrailerDict;\n}();\nexport default PDFTrailerDict;","import { __extends } from \"tslib\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFFlateStream from \"./PDFFlateStream\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { copyStringIntoBuffer, last } from \"../../utils\";\nvar PDFObjectStream = /** @class */function (_super) {\n __extends(PDFObjectStream, _super);\n function PDFObjectStream(context, objects, encode) {\n if (encode === void 0) {\n encode = true;\n }\n var _this = _super.call(this, context.obj({}), encode) || this;\n _this.objects = objects;\n _this.offsets = _this.computeObjectOffsets();\n _this.offsetsString = _this.computeOffsetsString();\n _this.dict.set(PDFName.of('Type'), PDFName.of('ObjStm'));\n _this.dict.set(PDFName.of('N'), PDFNumber.of(_this.objects.length));\n _this.dict.set(PDFName.of('First'), PDFNumber.of(_this.offsetsString.length));\n return _this;\n }\n PDFObjectStream.prototype.getObjectsCount = function () {\n return this.objects.length;\n };\n PDFObjectStream.prototype.clone = function (context) {\n return PDFObjectStream.withContextAndObjects(context || this.dict.context, this.objects.slice(), this.encode);\n };\n PDFObjectStream.prototype.getContentsString = function () {\n var value = this.offsetsString;\n for (var idx = 0, len = this.objects.length; idx < len; idx++) {\n var _a = this.objects[idx],\n object = _a[1];\n value += object + \"\\n\";\n }\n return value;\n };\n PDFObjectStream.prototype.getUnencodedContents = function () {\n var buffer = new Uint8Array(this.getUnencodedContentsSize());\n var offset = copyStringIntoBuffer(this.offsetsString, buffer, 0);\n for (var idx = 0, len = this.objects.length; idx < len; idx++) {\n var _a = this.objects[idx],\n object = _a[1];\n offset += object.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n }\n return buffer;\n };\n PDFObjectStream.prototype.getUnencodedContentsSize = function () {\n return this.offsetsString.length + last(this.offsets)[1] + last(this.objects)[1].sizeInBytes() + 1;\n };\n PDFObjectStream.prototype.computeOffsetsString = function () {\n var offsetsString = '';\n for (var idx = 0, len = this.offsets.length; idx < len; idx++) {\n var _a = this.offsets[idx],\n objectNumber = _a[0],\n offset = _a[1];\n offsetsString += objectNumber + \" \" + offset + \" \";\n }\n return offsetsString;\n };\n PDFObjectStream.prototype.computeObjectOffsets = function () {\n var offset = 0;\n var offsets = new Array(this.objects.length);\n for (var idx = 0, len = this.objects.length; idx < len; idx++) {\n var _a = this.objects[idx],\n ref = _a[0],\n object = _a[1];\n offsets[idx] = [ref.objectNumber, offset];\n offset += object.sizeInBytes() + 1; // '\\n'\n }\n return offsets;\n };\n PDFObjectStream.withContextAndObjects = function (context, objects, encode) {\n if (encode === void 0) {\n encode = true;\n }\n return new PDFObjectStream(context, objects, encode);\n };\n return PDFObjectStream;\n}(PDFFlateStream);\nexport default PDFObjectStream;","import { __awaiter, __generator } from \"tslib\";\nimport PDFCrossRefSection from \"../document/PDFCrossRefSection\";\nimport PDFHeader from \"../document/PDFHeader\";\nimport PDFTrailer from \"../document/PDFTrailer\";\nimport PDFTrailerDict from \"../document/PDFTrailerDict\";\nimport PDFObjectStream from \"../structures/PDFObjectStream\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { copyStringIntoBuffer, waitForTick } from \"../../utils\";\nvar PDFWriter = /** @class */function () {\n function PDFWriter(context, objectsPerTick) {\n var _this = this;\n this.parsedObjects = 0;\n this.shouldWaitForTick = function (n) {\n _this.parsedObjects += n;\n return _this.parsedObjects % _this.objectsPerTick === 0;\n };\n this.context = context;\n this.objectsPerTick = objectsPerTick;\n }\n PDFWriter.prototype.serializeToBuffer = function () {\n return __awaiter(this, void 0, void 0, function () {\n var _a, size, header, indirectObjects, xref, trailerDict, trailer, offset, buffer, idx, len, _b, ref, object, objectNumber, generationNumber, n;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n return [4 /*yield*/, this.computeBufferSize()];\n case 1:\n _a = _c.sent(), size = _a.size, header = _a.header, indirectObjects = _a.indirectObjects, xref = _a.xref, trailerDict = _a.trailerDict, trailer = _a.trailer;\n offset = 0;\n buffer = new Uint8Array(size);\n offset += header.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.Newline;\n idx = 0, len = indirectObjects.length;\n _c.label = 2;\n case 2:\n if (!(idx < len)) return [3 /*break*/, 5];\n _b = indirectObjects[idx], ref = _b[0], object = _b[1];\n objectNumber = String(ref.objectNumber);\n offset += copyStringIntoBuffer(objectNumber, buffer, offset);\n buffer[offset++] = CharCodes.Space;\n generationNumber = String(ref.generationNumber);\n offset += copyStringIntoBuffer(generationNumber, buffer, offset);\n buffer[offset++] = CharCodes.Space;\n buffer[offset++] = CharCodes.o;\n buffer[offset++] = CharCodes.b;\n buffer[offset++] = CharCodes.j;\n buffer[offset++] = CharCodes.Newline;\n offset += object.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.e;\n buffer[offset++] = CharCodes.n;\n buffer[offset++] = CharCodes.d;\n buffer[offset++] = CharCodes.o;\n buffer[offset++] = CharCodes.b;\n buffer[offset++] = CharCodes.j;\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.Newline;\n n = object instanceof PDFObjectStream ? object.getObjectsCount() : 1;\n if (!this.shouldWaitForTick(n)) return [3 /*break*/, 4];\n return [4 /*yield*/, waitForTick()];\n case 3:\n _c.sent();\n _c.label = 4;\n case 4:\n idx++;\n return [3 /*break*/, 2];\n case 5:\n if (xref) {\n offset += xref.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n }\n if (trailerDict) {\n offset += trailerDict.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.Newline;\n }\n offset += trailer.copyBytesInto(buffer, offset);\n return [2 /*return*/, buffer];\n }\n });\n });\n };\n PDFWriter.prototype.computeIndirectObjectSize = function (_a) {\n var ref = _a[0],\n object = _a[1];\n var refSize = ref.sizeInBytes() + 3; // 'R' -> 'obj\\n'\n var objectSize = object.sizeInBytes() + 9; // '\\nendobj\\n\\n'\n return refSize + objectSize;\n };\n PDFWriter.prototype.createTrailerDict = function () {\n return this.context.obj({\n Size: this.context.largestObjectNumber + 1,\n Root: this.context.trailerInfo.Root,\n Encrypt: this.context.trailerInfo.Encrypt,\n Info: this.context.trailerInfo.Info,\n ID: this.context.trailerInfo.ID\n });\n };\n PDFWriter.prototype.computeBufferSize = function () {\n return __awaiter(this, void 0, void 0, function () {\n var header, size, xref, indirectObjects, idx, len, indirectObject, ref, xrefOffset, trailerDict, trailer;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n header = PDFHeader.forVersion(1, 7);\n size = header.sizeInBytes() + 2;\n xref = PDFCrossRefSection.create();\n indirectObjects = this.context.enumerateIndirectObjects();\n idx = 0, len = indirectObjects.length;\n _a.label = 1;\n case 1:\n if (!(idx < len)) return [3 /*break*/, 4];\n indirectObject = indirectObjects[idx];\n ref = indirectObject[0];\n xref.addEntry(ref, size);\n size += this.computeIndirectObjectSize(indirectObject);\n if (!this.shouldWaitForTick(1)) return [3 /*break*/, 3];\n return [4 /*yield*/, waitForTick()];\n case 2:\n _a.sent();\n _a.label = 3;\n case 3:\n idx++;\n return [3 /*break*/, 1];\n case 4:\n xrefOffset = size;\n size += xref.sizeInBytes() + 1; // '\\n'\n trailerDict = PDFTrailerDict.of(this.createTrailerDict());\n size += trailerDict.sizeInBytes() + 2; // '\\n\\n'\n trailer = PDFTrailer.forLastCrossRefSectionOffset(xrefOffset);\n size += trailer.sizeInBytes();\n return [2 /*return*/, {\n size: size,\n header: header,\n indirectObjects: indirectObjects,\n xref: xref,\n trailerDict: trailerDict,\n trailer: trailer\n }];\n }\n });\n });\n };\n PDFWriter.forContext = function (context, objectsPerTick) {\n return new PDFWriter(context, objectsPerTick);\n };\n return PDFWriter;\n}();\nexport default PDFWriter;","import { __extends } from \"tslib\";\nimport PDFObject from \"./PDFObject\";\nvar PDFInvalidObject = /** @class */function (_super) {\n __extends(PDFInvalidObject, _super);\n function PDFInvalidObject(data) {\n var _this = _super.call(this) || this;\n _this.data = data;\n return _this;\n }\n PDFInvalidObject.prototype.clone = function () {\n return PDFInvalidObject.of(this.data.slice());\n };\n PDFInvalidObject.prototype.toString = function () {\n return \"PDFInvalidObject(\" + this.data.length + \" bytes)\";\n };\n PDFInvalidObject.prototype.sizeInBytes = function () {\n return this.data.length;\n };\n PDFInvalidObject.prototype.copyBytesInto = function (buffer, offset) {\n var length = this.data.length;\n for (var idx = 0; idx < length; idx++) {\n buffer[offset++] = this.data[idx];\n }\n return length;\n };\n PDFInvalidObject.of = function (data) {\n return new PDFInvalidObject(data);\n };\n return PDFInvalidObject;\n}(PDFObject);\nexport default PDFInvalidObject;","import { __awaiter, __generator } from \"tslib\";\n// prettier-ignore\nvar MARKERS = [0xffc0, 0xffc1, 0xffc2, 0xffc3, 0xffc5, 0xffc6, 0xffc7, 0xffc8, 0xffc9, 0xffca, 0xffcb, 0xffcc, 0xffcd, 0xffce, 0xffcf];\nvar ColorSpace;\n(function (ColorSpace) {\n ColorSpace[\"DeviceGray\"] = \"DeviceGray\";\n ColorSpace[\"DeviceRGB\"] = \"DeviceRGB\";\n ColorSpace[\"DeviceCMYK\"] = \"DeviceCMYK\";\n})(ColorSpace || (ColorSpace = {}));\nvar ChannelToColorSpace = {\n 1: ColorSpace.DeviceGray,\n 3: ColorSpace.DeviceRGB,\n 4: ColorSpace.DeviceCMYK\n};\n/**\n * A note of thanks to the developers of https://github.com/foliojs/pdfkit, as\n * this class borrows from:\n * https://github.com/foliojs/pdfkit/blob/a6af76467ce06bd6a2af4aa7271ccac9ff152a7d/lib/image/jpeg.js\n */\nvar JpegEmbedder = /** @class */function () {\n function JpegEmbedder(imageData, bitsPerComponent, width, height, colorSpace) {\n this.imageData = imageData;\n this.bitsPerComponent = bitsPerComponent;\n this.width = width;\n this.height = height;\n this.colorSpace = colorSpace;\n }\n JpegEmbedder.for = function (imageData) {\n return __awaiter(this, void 0, void 0, function () {\n var dataView, soi, pos, marker, bitsPerComponent, height, width, channelByte, channelName, colorSpace;\n return __generator(this, function (_a) {\n dataView = new DataView(imageData.buffer);\n soi = dataView.getUint16(0);\n if (soi !== 0xffd8) throw new Error('SOI not found in JPEG');\n pos = 2;\n while (pos < dataView.byteLength) {\n marker = dataView.getUint16(pos);\n pos += 2;\n if (MARKERS.includes(marker)) break;\n pos += dataView.getUint16(pos);\n }\n if (!MARKERS.includes(marker)) throw new Error('Invalid JPEG');\n pos += 2;\n bitsPerComponent = dataView.getUint8(pos++);\n height = dataView.getUint16(pos);\n pos += 2;\n width = dataView.getUint16(pos);\n pos += 2;\n channelByte = dataView.getUint8(pos++);\n channelName = ChannelToColorSpace[channelByte];\n if (!channelName) throw new Error('Unknown JPEG channel.');\n colorSpace = channelName;\n return [2 /*return*/, new JpegEmbedder(imageData, bitsPerComponent, width, height, colorSpace)];\n });\n });\n };\n JpegEmbedder.prototype.embedIntoContext = function (context, ref) {\n return __awaiter(this, void 0, void 0, function () {\n var xObject;\n return __generator(this, function (_a) {\n xObject = context.stream(this.imageData, {\n Type: 'XObject',\n Subtype: 'Image',\n BitsPerComponent: this.bitsPerComponent,\n Width: this.width,\n Height: this.height,\n ColorSpace: this.colorSpace,\n Filter: 'DCTDecode',\n // CMYK JPEG streams in PDF are typically stored complemented,\n // with 1 as 'off' and 0 as 'on' (PDF 32000-1:2008, 8.6.4.4).\n //\n // Standalone CMYK JPEG (usually exported by Photoshop) are\n // stored inverse, with 0 as 'off' and 1 as 'on', like RGB.\n //\n // Applying a swap here as a hedge that most bytes passing\n // through this method will benefit from it.\n Decode: this.colorSpace === ColorSpace.DeviceCMYK ? [1, 0, 1, 0, 1, 0, 1, 0] : undefined\n });\n if (ref) {\n context.assign(ref, xObject);\n return [2 /*return*/, ref];\n } else {\n return [2 /*return*/, context.register(xObject)];\n }\n return [2 /*return*/];\n });\n });\n };\n return JpegEmbedder;\n}();\nexport default JpegEmbedder;","import { __awaiter, __extends, __generator } from \"tslib\";\nimport PDFHeader from \"../document/PDFHeader\";\nimport PDFTrailer from \"../document/PDFTrailer\";\nimport PDFInvalidObject from \"../objects/PDFInvalidObject\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFRef from \"../objects/PDFRef\";\nimport PDFStream from \"../objects/PDFStream\";\nimport PDFCrossRefStream from \"../structures/PDFCrossRefStream\";\nimport PDFObjectStream from \"../structures/PDFObjectStream\";\nimport PDFWriter from \"./PDFWriter\";\nimport { last, waitForTick } from \"../../utils\";\nvar PDFStreamWriter = /** @class */function (_super) {\n __extends(PDFStreamWriter, _super);\n function PDFStreamWriter(context, objectsPerTick, encodeStreams, objectsPerStream) {\n var _this = _super.call(this, context, objectsPerTick) || this;\n _this.encodeStreams = encodeStreams;\n _this.objectsPerStream = objectsPerStream;\n return _this;\n }\n PDFStreamWriter.prototype.computeBufferSize = function () {\n return __awaiter(this, void 0, void 0, function () {\n var objectNumber, header, size, xrefStream, uncompressedObjects, compressedObjects, objectStreamRefs, indirectObjects, idx, len, indirectObject, ref, object, shouldNotCompress, chunk, objectStreamRef, idx, len, chunk, ref, objectStream, xrefStreamRef, xrefOffset, trailer;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n objectNumber = this.context.largestObjectNumber + 1;\n header = PDFHeader.forVersion(1, 7);\n size = header.sizeInBytes() + 2;\n xrefStream = PDFCrossRefStream.create(this.createTrailerDict(), this.encodeStreams);\n uncompressedObjects = [];\n compressedObjects = [];\n objectStreamRefs = [];\n indirectObjects = this.context.enumerateIndirectObjects();\n idx = 0, len = indirectObjects.length;\n _a.label = 1;\n case 1:\n if (!(idx < len)) return [3 /*break*/, 6];\n indirectObject = indirectObjects[idx];\n ref = indirectObject[0], object = indirectObject[1];\n shouldNotCompress = ref === this.context.trailerInfo.Encrypt || object instanceof PDFStream || object instanceof PDFInvalidObject || ref.generationNumber !== 0;\n if (!shouldNotCompress) return [3 /*break*/, 4];\n uncompressedObjects.push(indirectObject);\n xrefStream.addUncompressedEntry(ref, size);\n size += this.computeIndirectObjectSize(indirectObject);\n if (!this.shouldWaitForTick(1)) return [3 /*break*/, 3];\n return [4 /*yield*/, waitForTick()];\n case 2:\n _a.sent();\n _a.label = 3;\n case 3:\n return [3 /*break*/, 5];\n case 4:\n chunk = last(compressedObjects);\n objectStreamRef = last(objectStreamRefs);\n if (!chunk || chunk.length % this.objectsPerStream === 0) {\n chunk = [];\n compressedObjects.push(chunk);\n objectStreamRef = PDFRef.of(objectNumber++);\n objectStreamRefs.push(objectStreamRef);\n }\n xrefStream.addCompressedEntry(ref, objectStreamRef, chunk.length);\n chunk.push(indirectObject);\n _a.label = 5;\n case 5:\n idx++;\n return [3 /*break*/, 1];\n case 6:\n idx = 0, len = compressedObjects.length;\n _a.label = 7;\n case 7:\n if (!(idx < len)) return [3 /*break*/, 10];\n chunk = compressedObjects[idx];\n ref = objectStreamRefs[idx];\n objectStream = PDFObjectStream.withContextAndObjects(this.context, chunk, this.encodeStreams);\n xrefStream.addUncompressedEntry(ref, size);\n size += this.computeIndirectObjectSize([ref, objectStream]);\n uncompressedObjects.push([ref, objectStream]);\n if (!this.shouldWaitForTick(chunk.length)) return [3 /*break*/, 9];\n return [4 /*yield*/, waitForTick()];\n case 8:\n _a.sent();\n _a.label = 9;\n case 9:\n idx++;\n return [3 /*break*/, 7];\n case 10:\n xrefStreamRef = PDFRef.of(objectNumber++);\n xrefStream.dict.set(PDFName.of('Size'), PDFNumber.of(objectNumber));\n xrefStream.addUncompressedEntry(xrefStreamRef, size);\n xrefOffset = size;\n size += this.computeIndirectObjectSize([xrefStreamRef, xrefStream]);\n uncompressedObjects.push([xrefStreamRef, xrefStream]);\n trailer = PDFTrailer.forLastCrossRefSectionOffset(xrefOffset);\n size += trailer.sizeInBytes();\n return [2 /*return*/, {\n size: size,\n header: header,\n indirectObjects: uncompressedObjects,\n trailer: trailer\n }];\n }\n });\n });\n };\n PDFStreamWriter.forContext = function (context, objectsPerTick, encodeStreams, objectsPerStream) {\n if (encodeStreams === void 0) {\n encodeStreams = true;\n }\n if (objectsPerStream === void 0) {\n objectsPerStream = 50;\n }\n return new PDFStreamWriter(context, objectsPerTick, encodeStreams, objectsPerStream);\n };\n return PDFStreamWriter;\n}(PDFWriter);\nexport default PDFStreamWriter;","import { Encodings, Font, FontNames } from '@pdf-lib/standard-fonts';\nimport PDFHexString from \"../objects/PDFHexString\";\nimport { toCodePoint, toHexString } from \"../../utils\";\n/**\n * A note of thanks to the developers of https://github.com/foliojs/pdfkit, as\n * this class borrows from:\n * https://github.com/foliojs/pdfkit/blob/f91bdd61c164a72ea06be1a43dc0a412afc3925f/lib/font/afm.coffee\n */\nvar StandardFontEmbedder = /** @class */function () {\n function StandardFontEmbedder(fontName, customName) {\n // prettier-ignore\n this.encoding = fontName === FontNames.ZapfDingbats ? Encodings.ZapfDingbats : fontName === FontNames.Symbol ? Encodings.Symbol : Encodings.WinAnsi;\n this.font = Font.load(fontName);\n this.fontName = this.font.FontName;\n this.customName = customName;\n }\n /**\n * Encode the JavaScript string into this font. (JavaScript encodes strings in\n * Unicode, but standard fonts use either WinAnsi, ZapfDingbats, or Symbol\n * encodings)\n */\n StandardFontEmbedder.prototype.encodeText = function (text) {\n var glyphs = this.encodeTextAsGlyphs(text);\n var hexCodes = new Array(glyphs.length);\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n hexCodes[idx] = toHexString(glyphs[idx].code);\n }\n return PDFHexString.of(hexCodes.join(''));\n };\n StandardFontEmbedder.prototype.widthOfTextAtSize = function (text, size) {\n var glyphs = this.encodeTextAsGlyphs(text);\n var totalWidth = 0;\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n var left = glyphs[idx].name;\n var right = (glyphs[idx + 1] || {}).name;\n var kernAmount = this.font.getXAxisKerningForPair(left, right) || 0;\n totalWidth += this.widthOfGlyph(left) + kernAmount;\n }\n var scale = size / 1000;\n return totalWidth * scale;\n };\n StandardFontEmbedder.prototype.heightOfFontAtSize = function (size, options) {\n if (options === void 0) {\n options = {};\n }\n var _a = options.descender,\n descender = _a === void 0 ? true : _a;\n var _b = this.font,\n Ascender = _b.Ascender,\n Descender = _b.Descender,\n FontBBox = _b.FontBBox;\n var yTop = Ascender || FontBBox[3];\n var yBottom = Descender || FontBBox[1];\n var height = yTop - yBottom;\n if (!descender) height += Descender || 0;\n return height / 1000 * size;\n };\n StandardFontEmbedder.prototype.sizeOfFontAtHeight = function (height) {\n var _a = this.font,\n Ascender = _a.Ascender,\n Descender = _a.Descender,\n FontBBox = _a.FontBBox;\n var yTop = Ascender || FontBBox[3];\n var yBottom = Descender || FontBBox[1];\n return 1000 * height / (yTop - yBottom);\n };\n StandardFontEmbedder.prototype.embedIntoContext = function (context, ref) {\n var fontDict = context.obj({\n Type: 'Font',\n Subtype: 'Type1',\n BaseFont: this.customName || this.fontName,\n Encoding: this.encoding === Encodings.WinAnsi ? 'WinAnsiEncoding' : undefined\n });\n if (ref) {\n context.assign(ref, fontDict);\n return ref;\n } else {\n return context.register(fontDict);\n }\n };\n StandardFontEmbedder.prototype.widthOfGlyph = function (glyphName) {\n // Default to 250 if font doesn't specify a width\n return this.font.getWidthOfGlyph(glyphName) || 250;\n };\n StandardFontEmbedder.prototype.encodeTextAsGlyphs = function (text) {\n var codePoints = Array.from(text);\n var glyphs = new Array(codePoints.length);\n for (var idx = 0, len = codePoints.length; idx < len; idx++) {\n var codePoint = toCodePoint(codePoints[idx]);\n glyphs[idx] = this.encoding.encodeUnicodeCodePoint(codePoint);\n }\n return glyphs;\n };\n StandardFontEmbedder.for = function (fontName, customName) {\n return new StandardFontEmbedder(fontName, customName);\n };\n return StandardFontEmbedder;\n}();\nexport default StandardFontEmbedder;","import { toHexString, toHexStringOfMinLength } from \"../../utils\";\nimport { hasSurrogates, highSurrogate, isWithinBMP, lowSurrogate } from \"../../utils/unicode\";\n/** `glyphs` should be an array of unique glyphs */\nexport var createCmap = function (glyphs, glyphId) {\n var bfChars = new Array(glyphs.length);\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n var glyph = glyphs[idx];\n var id = cmapHexFormat(cmapHexString(glyphId(glyph)));\n var unicode = cmapHexFormat.apply(void 0, glyph.codePoints.map(cmapCodePointFormat));\n bfChars[idx] = [id, unicode];\n }\n return fillCmapTemplate(bfChars);\n};\n/* =============================== Templates ================================ */\nvar fillCmapTemplate = function (bfChars) {\n return \"/CIDInit /ProcSet findresource begin\\n12 dict begin\\nbegincmap\\n/CIDSystemInfo <<\\n /Registry (Adobe)\\n /Ordering (UCS)\\n /Supplement 0\\n>> def\\n/CMapName /Adobe-Identity-UCS def\\n/CMapType 2 def\\n1 begincodespacerange\\n<0000>\\nendcodespacerange\\n\" + bfChars.length + \" beginbfchar\\n\" + bfChars.map(function (_a) {\n var glyphId = _a[0],\n codePoint = _a[1];\n return glyphId + \" \" + codePoint;\n }).join('\\n') + \"\\nendbfchar\\nendcmap\\nCMapName currentdict /CMap defineresource pop\\nend\\nend\";\n};\n/* =============================== Utilities ================================ */\nvar cmapHexFormat = function () {\n var values = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n values[_i] = arguments[_i];\n }\n return \"<\" + values.join('') + \">\";\n};\nvar cmapHexString = function (value) {\n return toHexStringOfMinLength(value, 4);\n};\nvar cmapCodePointFormat = function (codePoint) {\n if (isWithinBMP(codePoint)) return cmapHexString(codePoint);\n if (hasSurrogates(codePoint)) {\n var hs = highSurrogate(codePoint);\n var ls = lowSurrogate(codePoint);\n return \"\" + cmapHexString(hs) + cmapHexString(ls);\n }\n var hex = toHexString(codePoint);\n var msg = \"0x\" + hex + \" is not a valid UTF-8 or UTF-16 codepoint.\";\n throw new Error(msg);\n};","import { __awaiter, __generator } from \"tslib\";\nimport { createCmap } from \"./CMap\";\nimport { deriveFontFlags } from \"./FontFlags\";\nimport PDFHexString from \"../objects/PDFHexString\";\nimport PDFString from \"../objects/PDFString\";\nimport { byAscendingId, Cache, sortedUniq, toHexStringOfMinLength } from \"../../utils\";\n/**\n * A note of thanks to the developers of https://github.com/foliojs/pdfkit, as\n * this class borrows from:\n * https://github.com/devongovett/pdfkit/blob/e71edab0dd4657b5a767804ba86c94c58d01fbca/lib/image/jpeg.coffee\n */\nvar CustomFontEmbedder = /** @class */function () {\n function CustomFontEmbedder(font, fontData, customName, fontFeatures) {\n var _this = this;\n this.allGlyphsInFontSortedById = function () {\n var glyphs = new Array(_this.font.characterSet.length);\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n var codePoint = _this.font.characterSet[idx];\n glyphs[idx] = _this.font.glyphForCodePoint(codePoint);\n }\n return sortedUniq(glyphs.sort(byAscendingId), function (g) {\n return g.id;\n });\n };\n this.font = font;\n this.scale = 1000 / this.font.unitsPerEm;\n this.fontData = fontData;\n this.fontName = this.font.postscriptName || 'Font';\n this.customName = customName;\n this.fontFeatures = fontFeatures;\n this.baseFontName = '';\n this.glyphCache = Cache.populatedBy(this.allGlyphsInFontSortedById);\n }\n CustomFontEmbedder.for = function (fontkit, fontData, customName, fontFeatures) {\n return __awaiter(this, void 0, void 0, function () {\n var font;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n return [4 /*yield*/, fontkit.create(fontData)];\n case 1:\n font = _a.sent();\n return [2 /*return*/, new CustomFontEmbedder(font, fontData, customName, fontFeatures)];\n }\n });\n });\n };\n /**\n * Encode the JavaScript string into this font. (JavaScript encodes strings in\n * Unicode, but embedded fonts use their own custom encodings)\n */\n CustomFontEmbedder.prototype.encodeText = function (text) {\n var glyphs = this.font.layout(text, this.fontFeatures).glyphs;\n var hexCodes = new Array(glyphs.length);\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n hexCodes[idx] = toHexStringOfMinLength(glyphs[idx].id, 4);\n }\n return PDFHexString.of(hexCodes.join(''));\n };\n // The advanceWidth takes into account kerning automatically, so we don't\n // have to do that manually like we do for the standard fonts.\n CustomFontEmbedder.prototype.widthOfTextAtSize = function (text, size) {\n var glyphs = this.font.layout(text, this.fontFeatures).glyphs;\n var totalWidth = 0;\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n totalWidth += glyphs[idx].advanceWidth * this.scale;\n }\n var scale = size / 1000;\n return totalWidth * scale;\n };\n CustomFontEmbedder.prototype.heightOfFontAtSize = function (size, options) {\n if (options === void 0) {\n options = {};\n }\n var _a = options.descender,\n descender = _a === void 0 ? true : _a;\n var _b = this.font,\n ascent = _b.ascent,\n descent = _b.descent,\n bbox = _b.bbox;\n var yTop = (ascent || bbox.maxY) * this.scale;\n var yBottom = (descent || bbox.minY) * this.scale;\n var height = yTop - yBottom;\n if (!descender) height -= Math.abs(descent) || 0;\n return height / 1000 * size;\n };\n CustomFontEmbedder.prototype.sizeOfFontAtHeight = function (height) {\n var _a = this.font,\n ascent = _a.ascent,\n descent = _a.descent,\n bbox = _a.bbox;\n var yTop = (ascent || bbox.maxY) * this.scale;\n var yBottom = (descent || bbox.minY) * this.scale;\n return 1000 * height / (yTop - yBottom);\n };\n CustomFontEmbedder.prototype.embedIntoContext = function (context, ref) {\n this.baseFontName = this.customName || context.addRandomSuffix(this.fontName);\n return this.embedFontDict(context, ref);\n };\n CustomFontEmbedder.prototype.embedFontDict = function (context, ref) {\n return __awaiter(this, void 0, void 0, function () {\n var cidFontDictRef, unicodeCMapRef, fontDict;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n return [4 /*yield*/, this.embedCIDFontDict(context)];\n case 1:\n cidFontDictRef = _a.sent();\n unicodeCMapRef = this.embedUnicodeCmap(context);\n fontDict = context.obj({\n Type: 'Font',\n Subtype: 'Type0',\n BaseFont: this.baseFontName,\n Encoding: 'Identity-H',\n DescendantFonts: [cidFontDictRef],\n ToUnicode: unicodeCMapRef\n });\n if (ref) {\n context.assign(ref, fontDict);\n return [2 /*return*/, ref];\n } else {\n return [2 /*return*/, context.register(fontDict)];\n }\n return [2 /*return*/];\n }\n });\n });\n };\n CustomFontEmbedder.prototype.isCFF = function () {\n return this.font.cff;\n };\n CustomFontEmbedder.prototype.embedCIDFontDict = function (context) {\n return __awaiter(this, void 0, void 0, function () {\n var fontDescriptorRef, cidFontDict;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n return [4 /*yield*/, this.embedFontDescriptor(context)];\n case 1:\n fontDescriptorRef = _a.sent();\n cidFontDict = context.obj({\n Type: 'Font',\n Subtype: this.isCFF() ? 'CIDFontType0' : 'CIDFontType2',\n CIDToGIDMap: 'Identity',\n BaseFont: this.baseFontName,\n CIDSystemInfo: {\n Registry: PDFString.of('Adobe'),\n Ordering: PDFString.of('Identity'),\n Supplement: 0\n },\n FontDescriptor: fontDescriptorRef,\n W: this.computeWidths()\n });\n return [2 /*return*/, context.register(cidFontDict)];\n }\n });\n });\n };\n CustomFontEmbedder.prototype.embedFontDescriptor = function (context) {\n return __awaiter(this, void 0, void 0, function () {\n var fontStreamRef, scale, _a, italicAngle, ascent, descent, capHeight, xHeight, _b, minX, minY, maxX, maxY, fontDescriptor;\n var _c;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n return [4 /*yield*/, this.embedFontStream(context)];\n case 1:\n fontStreamRef = _d.sent();\n scale = this.scale;\n _a = this.font, italicAngle = _a.italicAngle, ascent = _a.ascent, descent = _a.descent, capHeight = _a.capHeight, xHeight = _a.xHeight;\n _b = this.font.bbox, minX = _b.minX, minY = _b.minY, maxX = _b.maxX, maxY = _b.maxY;\n fontDescriptor = context.obj((_c = {\n Type: 'FontDescriptor',\n FontName: this.baseFontName,\n Flags: deriveFontFlags(this.font),\n FontBBox: [minX * scale, minY * scale, maxX * scale, maxY * scale],\n ItalicAngle: italicAngle,\n Ascent: ascent * scale,\n Descent: descent * scale,\n CapHeight: (capHeight || ascent) * scale,\n XHeight: (xHeight || 0) * scale,\n // Not sure how to compute/find this, nor is anybody else really:\n // https://stackoverflow.com/questions/35485179/stemv-value-of-the-truetype-font\n StemV: 0\n }, _c[this.isCFF() ? 'FontFile3' : 'FontFile2'] = fontStreamRef, _c));\n return [2 /*return*/, context.register(fontDescriptor)];\n }\n });\n });\n };\n CustomFontEmbedder.prototype.serializeFont = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.fontData];\n });\n });\n };\n CustomFontEmbedder.prototype.embedFontStream = function (context) {\n return __awaiter(this, void 0, void 0, function () {\n var fontStream, _a, _b;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n _b = (_a = context).flateStream;\n return [4 /*yield*/, this.serializeFont()];\n case 1:\n fontStream = _b.apply(_a, [_c.sent(), {\n Subtype: this.isCFF() ? 'CIDFontType0C' : undefined\n }]);\n return [2 /*return*/, context.register(fontStream)];\n }\n });\n });\n };\n CustomFontEmbedder.prototype.embedUnicodeCmap = function (context) {\n var cmap = createCmap(this.glyphCache.access(), this.glyphId.bind(this));\n var cmapStream = context.flateStream(cmap);\n return context.register(cmapStream);\n };\n CustomFontEmbedder.prototype.glyphId = function (glyph) {\n return glyph ? glyph.id : -1;\n };\n CustomFontEmbedder.prototype.computeWidths = function () {\n var glyphs = this.glyphCache.access();\n var widths = [];\n var currSection = [];\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n var currGlyph = glyphs[idx];\n var prevGlyph = glyphs[idx - 1];\n var currGlyphId = this.glyphId(currGlyph);\n var prevGlyphId = this.glyphId(prevGlyph);\n if (idx === 0) {\n widths.push(currGlyphId);\n } else if (currGlyphId - prevGlyphId !== 1) {\n widths.push(currSection);\n widths.push(currGlyphId);\n currSection = [];\n }\n currSection.push(currGlyph.advanceWidth * this.scale);\n }\n widths.push(currSection);\n return widths;\n };\n return CustomFontEmbedder;\n}();\nexport default CustomFontEmbedder;","// prettier-ignore\nvar makeFontFlags = function (options) {\n var flags = 0;\n var flipBit = function (bit) {\n flags |= 1 << bit - 1;\n };\n if (options.fixedPitch) flipBit(1);\n if (options.serif) flipBit(2);\n if (options.symbolic) flipBit(3);\n if (options.script) flipBit(4);\n if (options.nonsymbolic) flipBit(6);\n if (options.italic) flipBit(7);\n if (options.allCap) flipBit(17);\n if (options.smallCap) flipBit(18);\n if (options.forceBold) flipBit(19);\n return flags;\n};\n// From: https://github.com/foliojs/pdfkit/blob/83f5f7243172a017adcf6a7faa5547c55982c57b/lib/font/embedded.js#L123-L129\nexport var deriveFontFlags = function (font) {\n var familyClass = font['OS/2'] ? font['OS/2'].sFamilyClass : 0;\n var flags = makeFontFlags({\n fixedPitch: font.post.isFixedPitch,\n serif: 1 <= familyClass && familyClass <= 7,\n symbolic: true,\n script: familyClass === 10,\n italic: font.head.macStyle.italic\n });\n return flags;\n};","import { __awaiter, __extends, __generator } from \"tslib\";\nimport CustomFontEmbedder from \"./CustomFontEmbedder\";\nimport PDFHexString from \"../objects/PDFHexString\";\nimport { Cache, mergeUint8Arrays, toHexStringOfMinLength } from \"../../utils\";\n/**\n * A note of thanks to the developers of https://github.com/foliojs/pdfkit, as\n * this class borrows from:\n * https://github.com/devongovett/pdfkit/blob/e71edab0dd4657b5a767804ba86c94c58d01fbca/lib/image/jpeg.coffee\n */\nvar CustomFontSubsetEmbedder = /** @class */function (_super) {\n __extends(CustomFontSubsetEmbedder, _super);\n function CustomFontSubsetEmbedder(font, fontData, customFontName, fontFeatures) {\n var _this = _super.call(this, font, fontData, customFontName, fontFeatures) || this;\n _this.subset = _this.font.createSubset();\n _this.glyphs = [];\n _this.glyphCache = Cache.populatedBy(function () {\n return _this.glyphs;\n });\n _this.glyphIdMap = new Map();\n return _this;\n }\n CustomFontSubsetEmbedder.for = function (fontkit, fontData, customFontName, fontFeatures) {\n return __awaiter(this, void 0, void 0, function () {\n var font;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n return [4 /*yield*/, fontkit.create(fontData)];\n case 1:\n font = _a.sent();\n return [2 /*return*/, new CustomFontSubsetEmbedder(font, fontData, customFontName, fontFeatures)];\n }\n });\n });\n };\n CustomFontSubsetEmbedder.prototype.encodeText = function (text) {\n var glyphs = this.font.layout(text, this.fontFeatures).glyphs;\n var hexCodes = new Array(glyphs.length);\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n var glyph = glyphs[idx];\n var subsetGlyphId = this.subset.includeGlyph(glyph);\n this.glyphs[subsetGlyphId - 1] = glyph;\n this.glyphIdMap.set(glyph.id, subsetGlyphId);\n hexCodes[idx] = toHexStringOfMinLength(subsetGlyphId, 4);\n }\n this.glyphCache.invalidate();\n return PDFHexString.of(hexCodes.join(''));\n };\n CustomFontSubsetEmbedder.prototype.isCFF = function () {\n return this.subset.cff;\n };\n CustomFontSubsetEmbedder.prototype.glyphId = function (glyph) {\n return glyph ? this.glyphIdMap.get(glyph.id) : -1;\n };\n CustomFontSubsetEmbedder.prototype.serializeFont = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var parts = [];\n _this.subset.encodeStream().on('data', function (bytes) {\n return parts.push(bytes);\n }).on('end', function () {\n return resolve(mergeUint8Arrays(parts));\n }).on('error', function (err) {\n return reject(err);\n });\n });\n };\n return CustomFontSubsetEmbedder;\n}(CustomFontEmbedder);\nexport default CustomFontSubsetEmbedder;","import pako from 'pako';\nvar UPNG = {};\nUPNG.toRGBA8 = function (out) {\n var w = out.width,\n h = out.height;\n if (out.tabs.acTL == null) return [UPNG.toRGBA8.decodeImage(out.data, w, h, out).buffer];\n var frms = [];\n if (out.frames[0].data == null) out.frames[0].data = out.data;\n var len = w * h * 4,\n img = new Uint8Array(len),\n empty = new Uint8Array(len),\n prev = new Uint8Array(len);\n for (var i = 0; i < out.frames.length; i++) {\n var frm = out.frames[i];\n var fx = frm.rect.x,\n fy = frm.rect.y,\n fw = frm.rect.width,\n fh = frm.rect.height;\n var fdata = UPNG.toRGBA8.decodeImage(frm.data, fw, fh, out);\n if (i != 0) for (var j = 0; j < len; j++) prev[j] = img[j];\n if (frm.blend == 0) UPNG._copyTile(fdata, fw, fh, img, w, h, fx, fy, 0);else if (frm.blend == 1) UPNG._copyTile(fdata, fw, fh, img, w, h, fx, fy, 1);\n frms.push(img.buffer.slice(0));\n if (frm.dispose == 0) {} else if (frm.dispose == 1) UPNG._copyTile(empty, fw, fh, img, w, h, fx, fy, 0);else if (frm.dispose == 2) for (var j = 0; j < len; j++) img[j] = prev[j];\n }\n return frms;\n};\nUPNG.toRGBA8.decodeImage = function (data, w, h, out) {\n var area = w * h,\n bpp = UPNG.decode._getBPP(out);\n var bpl = Math.ceil(w * bpp / 8); // bytes per line\n\n var bf = new Uint8Array(area * 4),\n bf32 = new Uint32Array(bf.buffer);\n var ctype = out.ctype,\n depth = out.depth;\n var rs = UPNG._bin.readUshort;\n\n //console.log(ctype, depth);\n var time = Date.now();\n if (ctype == 6) {\n // RGB + alpha\n var qarea = area << 2;\n if (depth == 8) for (var i = 0; i < qarea; i += 4) {\n bf[i] = data[i];\n bf[i + 1] = data[i + 1];\n bf[i + 2] = data[i + 2];\n bf[i + 3] = data[i + 3];\n }\n if (depth == 16) for (var i = 0; i < qarea; i++) {\n bf[i] = data[i << 1];\n }\n } else if (ctype == 2) {\n // RGB\n var ts = out.tabs[\"tRNS\"];\n if (ts == null) {\n if (depth == 8) for (var i = 0; i < area; i++) {\n var ti = i * 3;\n bf32[i] = 255 << 24 | data[ti + 2] << 16 | data[ti + 1] << 8 | data[ti];\n }\n if (depth == 16) for (var i = 0; i < area; i++) {\n var ti = i * 6;\n bf32[i] = 255 << 24 | data[ti + 4] << 16 | data[ti + 2] << 8 | data[ti];\n }\n } else {\n var tr = ts[0],\n tg = ts[1],\n tb = ts[2];\n if (depth == 8) for (var i = 0; i < area; i++) {\n var qi = i << 2,\n ti = i * 3;\n bf32[i] = 255 << 24 | data[ti + 2] << 16 | data[ti + 1] << 8 | data[ti];\n if (data[ti] == tr && data[ti + 1] == tg && data[ti + 2] == tb) bf[qi + 3] = 0;\n }\n if (depth == 16) for (var i = 0; i < area; i++) {\n var qi = i << 2,\n ti = i * 6;\n bf32[i] = 255 << 24 | data[ti + 4] << 16 | data[ti + 2] << 8 | data[ti];\n if (rs(data, ti) == tr && rs(data, ti + 2) == tg && rs(data, ti + 4) == tb) bf[qi + 3] = 0;\n }\n }\n } else if (ctype == 3) {\n // palette\n var p = out.tabs[\"PLTE\"],\n ap = out.tabs[\"tRNS\"],\n tl = ap ? ap.length : 0;\n //console.log(p, ap);\n if (depth == 1) for (var y = 0; y < h; y++) {\n var s0 = y * bpl,\n t0 = y * w;\n for (var i = 0; i < w; i++) {\n var qi = t0 + i << 2,\n j = data[s0 + (i >> 3)] >> 7 - ((i & 7) << 0) & 1,\n cj = 3 * j;\n bf[qi] = p[cj];\n bf[qi + 1] = p[cj + 1];\n bf[qi + 2] = p[cj + 2];\n bf[qi + 3] = j < tl ? ap[j] : 255;\n }\n }\n if (depth == 2) for (var y = 0; y < h; y++) {\n var s0 = y * bpl,\n t0 = y * w;\n for (var i = 0; i < w; i++) {\n var qi = t0 + i << 2,\n j = data[s0 + (i >> 2)] >> 6 - ((i & 3) << 1) & 3,\n cj = 3 * j;\n bf[qi] = p[cj];\n bf[qi + 1] = p[cj + 1];\n bf[qi + 2] = p[cj + 2];\n bf[qi + 3] = j < tl ? ap[j] : 255;\n }\n }\n if (depth == 4) for (var y = 0; y < h; y++) {\n var s0 = y * bpl,\n t0 = y * w;\n for (var i = 0; i < w; i++) {\n var qi = t0 + i << 2,\n j = data[s0 + (i >> 1)] >> 4 - ((i & 1) << 2) & 15,\n cj = 3 * j;\n bf[qi] = p[cj];\n bf[qi + 1] = p[cj + 1];\n bf[qi + 2] = p[cj + 2];\n bf[qi + 3] = j < tl ? ap[j] : 255;\n }\n }\n if (depth == 8) for (var i = 0; i < area; i++) {\n var qi = i << 2,\n j = data[i],\n cj = 3 * j;\n bf[qi] = p[cj];\n bf[qi + 1] = p[cj + 1];\n bf[qi + 2] = p[cj + 2];\n bf[qi + 3] = j < tl ? ap[j] : 255;\n }\n } else if (ctype == 4) {\n // gray + alpha\n if (depth == 8) for (var i = 0; i < area; i++) {\n var qi = i << 2,\n di = i << 1,\n gr = data[di];\n bf[qi] = gr;\n bf[qi + 1] = gr;\n bf[qi + 2] = gr;\n bf[qi + 3] = data[di + 1];\n }\n if (depth == 16) for (var i = 0; i < area; i++) {\n var qi = i << 2,\n di = i << 2,\n gr = data[di];\n bf[qi] = gr;\n bf[qi + 1] = gr;\n bf[qi + 2] = gr;\n bf[qi + 3] = data[di + 2];\n }\n } else if (ctype == 0) {\n // gray\n var tr = out.tabs[\"tRNS\"] ? out.tabs[\"tRNS\"] : -1;\n for (var y = 0; y < h; y++) {\n var off = y * bpl,\n to = y * w;\n if (depth == 1) for (var x = 0; x < w; x++) {\n var gr = 255 * (data[off + (x >>> 3)] >>> 7 - (x & 7) & 1),\n al = gr == tr * 255 ? 0 : 255;\n bf32[to + x] = al << 24 | gr << 16 | gr << 8 | gr;\n } else if (depth == 2) for (var x = 0; x < w; x++) {\n var gr = 85 * (data[off + (x >>> 2)] >>> 6 - ((x & 3) << 1) & 3),\n al = gr == tr * 85 ? 0 : 255;\n bf32[to + x] = al << 24 | gr << 16 | gr << 8 | gr;\n } else if (depth == 4) for (var x = 0; x < w; x++) {\n var gr = 17 * (data[off + (x >>> 1)] >>> 4 - ((x & 1) << 2) & 15),\n al = gr == tr * 17 ? 0 : 255;\n bf32[to + x] = al << 24 | gr << 16 | gr << 8 | gr;\n } else if (depth == 8) for (var x = 0; x < w; x++) {\n var gr = data[off + x],\n al = gr == tr ? 0 : 255;\n bf32[to + x] = al << 24 | gr << 16 | gr << 8 | gr;\n } else if (depth == 16) for (var x = 0; x < w; x++) {\n var gr = data[off + (x << 1)],\n al = rs(data, off + (x << i)) == tr ? 0 : 255;\n bf32[to + x] = al << 24 | gr << 16 | gr << 8 | gr;\n }\n }\n }\n //console.log(Date.now()-time);\n return bf;\n};\nUPNG.decode = function (buff) {\n var data = new Uint8Array(buff),\n offset = 8,\n bin = UPNG._bin,\n rUs = bin.readUshort,\n rUi = bin.readUint;\n var out = {\n tabs: {},\n frames: []\n };\n var dd = new Uint8Array(data.length),\n doff = 0; // put all IDAT data into it\n var fd,\n foff = 0; // frames\n\n var mgck = [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a];\n for (var i = 0; i < 8; i++) if (data[i] != mgck[i]) throw \"The input is not a PNG file!\";\n while (offset < data.length) {\n var len = bin.readUint(data, offset);\n offset += 4;\n var type = bin.readASCII(data, offset, 4);\n offset += 4;\n //console.log(type,len);\n\n if (type == \"IHDR\") {\n UPNG.decode._IHDR(data, offset, out);\n } else if (type == \"IDAT\") {\n for (var i = 0; i < len; i++) dd[doff + i] = data[offset + i];\n doff += len;\n } else if (type == \"acTL\") {\n out.tabs[type] = {\n num_frames: rUi(data, offset),\n num_plays: rUi(data, offset + 4)\n };\n fd = new Uint8Array(data.length);\n } else if (type == \"fcTL\") {\n if (foff != 0) {\n var fr = out.frames[out.frames.length - 1];\n fr.data = UPNG.decode._decompress(out, fd.slice(0, foff), fr.rect.width, fr.rect.height);\n foff = 0;\n }\n var rct = {\n x: rUi(data, offset + 12),\n y: rUi(data, offset + 16),\n width: rUi(data, offset + 4),\n height: rUi(data, offset + 8)\n };\n var del = rUs(data, offset + 22);\n del = rUs(data, offset + 20) / (del == 0 ? 100 : del);\n var frm = {\n rect: rct,\n delay: Math.round(del * 1000),\n dispose: data[offset + 24],\n blend: data[offset + 25]\n };\n //console.log(frm);\n out.frames.push(frm);\n } else if (type == \"fdAT\") {\n for (var i = 0; i < len - 4; i++) fd[foff + i] = data[offset + i + 4];\n foff += len - 4;\n } else if (type == \"pHYs\") {\n out.tabs[type] = [bin.readUint(data, offset), bin.readUint(data, offset + 4), data[offset + 8]];\n } else if (type == \"cHRM\") {\n out.tabs[type] = [];\n for (var i = 0; i < 8; i++) out.tabs[type].push(bin.readUint(data, offset + i * 4));\n } else if (type == \"tEXt\") {\n if (out.tabs[type] == null) out.tabs[type] = {};\n var nz = bin.nextZero(data, offset);\n var keyw = bin.readASCII(data, offset, nz - offset);\n var text = bin.readASCII(data, nz + 1, offset + len - nz - 1);\n out.tabs[type][keyw] = text;\n } else if (type == \"iTXt\") {\n if (out.tabs[type] == null) out.tabs[type] = {};\n var nz = 0,\n off = offset;\n nz = bin.nextZero(data, off);\n var keyw = bin.readASCII(data, off, nz - off);\n off = nz + 1;\n var cflag = data[off],\n cmeth = data[off + 1];\n off += 2;\n nz = bin.nextZero(data, off);\n var ltag = bin.readASCII(data, off, nz - off);\n off = nz + 1;\n nz = bin.nextZero(data, off);\n var tkeyw = bin.readUTF8(data, off, nz - off);\n off = nz + 1;\n var text = bin.readUTF8(data, off, len - (off - offset));\n out.tabs[type][keyw] = text;\n } else if (type == \"PLTE\") {\n out.tabs[type] = bin.readBytes(data, offset, len);\n } else if (type == \"hIST\") {\n var pl = out.tabs[\"PLTE\"].length / 3;\n out.tabs[type] = [];\n for (var i = 0; i < pl; i++) out.tabs[type].push(rUs(data, offset + i * 2));\n } else if (type == \"tRNS\") {\n if (out.ctype == 3) out.tabs[type] = bin.readBytes(data, offset, len);else if (out.ctype == 0) out.tabs[type] = rUs(data, offset);else if (out.ctype == 2) out.tabs[type] = [rUs(data, offset), rUs(data, offset + 2), rUs(data, offset + 4)];\n //else console.log(\"tRNS for unsupported color type\",out.ctype, len);\n } else if (type == \"gAMA\") out.tabs[type] = bin.readUint(data, offset) / 100000;else if (type == \"sRGB\") out.tabs[type] = data[offset];else if (type == \"bKGD\") {\n if (out.ctype == 0 || out.ctype == 4) out.tabs[type] = [rUs(data, offset)];else if (out.ctype == 2 || out.ctype == 6) out.tabs[type] = [rUs(data, offset), rUs(data, offset + 2), rUs(data, offset + 4)];else if (out.ctype == 3) out.tabs[type] = data[offset];\n } else if (type == \"IEND\") {\n break;\n }\n //else { log(\"unknown chunk type\", type, len); }\n offset += len;\n var crc = bin.readUint(data, offset);\n offset += 4;\n }\n if (foff != 0) {\n var fr = out.frames[out.frames.length - 1];\n fr.data = UPNG.decode._decompress(out, fd.slice(0, foff), fr.rect.width, fr.rect.height);\n foff = 0;\n }\n out.data = UPNG.decode._decompress(out, dd, out.width, out.height);\n delete out.compress;\n delete out.interlace;\n delete out.filter;\n return out;\n};\nUPNG.decode._decompress = function (out, dd, w, h) {\n var time = Date.now();\n var bpp = UPNG.decode._getBPP(out),\n bpl = Math.ceil(w * bpp / 8),\n buff = new Uint8Array((bpl + 1 + out.interlace) * h);\n dd = UPNG.decode._inflate(dd, buff);\n //console.log(dd.length, buff.length);\n //console.log(Date.now()-time);\n\n var time = Date.now();\n if (out.interlace == 0) dd = UPNG.decode._filterZero(dd, out, 0, w, h);else if (out.interlace == 1) dd = UPNG.decode._readInterlace(dd, out);\n //console.log(Date.now()-time);\n return dd;\n};\nUPNG.decode._inflate = function (data, buff) {\n var out = UPNG[\"inflateRaw\"](new Uint8Array(data.buffer, 2, data.length - 6), buff);\n return out;\n};\nUPNG.inflateRaw = function () {\n var H = {};\n H.H = {};\n H.H.N = function (N, W) {\n var R = Uint8Array,\n i = 0,\n m = 0,\n J = 0,\n h = 0,\n Q = 0,\n X = 0,\n u = 0,\n w = 0,\n d = 0,\n v,\n C;\n if (N[0] == 3 && N[1] == 0) return W ? W : new R(0);\n var V = H.H,\n n = V.b,\n A = V.e,\n l = V.R,\n M = V.n,\n I = V.A,\n e = V.Z,\n b = V.m,\n Z = W == null;\n if (Z) W = new R(N.length >>> 2 << 3);\n while (i == 0) {\n i = n(N, d, 1);\n m = n(N, d + 1, 2);\n d += 3;\n if (m == 0) {\n if ((d & 7) != 0) d += 8 - (d & 7);\n var D = (d >>> 3) + 4,\n q = N[D - 4] | N[D - 3] << 8;\n if (Z) W = H.H.W(W, w + q);\n W.set(new R(N.buffer, N.byteOffset + D, q), w);\n d = D + q << 3;\n w += q;\n continue;\n }\n if (Z) W = H.H.W(W, w + (1 << 17));\n if (m == 1) {\n v = b.J;\n C = b.h;\n X = (1 << 9) - 1;\n u = (1 << 5) - 1;\n }\n if (m == 2) {\n J = A(N, d, 5) + 257;\n h = A(N, d + 5, 5) + 1;\n Q = A(N, d + 10, 4) + 4;\n d += 14;\n var E = d,\n j = 1;\n for (var c = 0; c < 38; c += 2) {\n b.Q[c] = 0;\n b.Q[c + 1] = 0;\n }\n for (var c = 0; c < Q; c++) {\n var K = A(N, d + c * 3, 3);\n b.Q[(b.X[c] << 1) + 1] = K;\n if (K > j) j = K;\n }\n d += 3 * Q;\n M(b.Q, j);\n I(b.Q, j, b.u);\n v = b.w;\n C = b.d;\n d = l(b.u, (1 << j) - 1, J + h, N, d, b.v);\n var r = V.V(b.v, 0, J, b.C);\n X = (1 << r) - 1;\n var S = V.V(b.v, J, h, b.D);\n u = (1 << S) - 1;\n M(b.C, r);\n I(b.C, r, v);\n M(b.D, S);\n I(b.D, S, C);\n }\n while (!0) {\n var T = v[e(N, d) & X];\n d += T & 15;\n var p = T >>> 4;\n if (p >>> 8 == 0) {\n W[w++] = p;\n } else if (p == 256) {\n break;\n } else {\n var z = w + p - 254;\n if (p > 264) {\n var _ = b.q[p - 257];\n z = w + (_ >>> 3) + A(N, d, _ & 7);\n d += _ & 7;\n }\n var $ = C[e(N, d) & u];\n d += $ & 15;\n var s = $ >>> 4,\n Y = b.c[s],\n a = (Y >>> 4) + n(N, d, Y & 15);\n d += Y & 15;\n while (w < z) {\n W[w] = W[w++ - a];\n W[w] = W[w++ - a];\n W[w] = W[w++ - a];\n W[w] = W[w++ - a];\n }\n w = z;\n }\n }\n }\n return W.length == w ? W : W.slice(0, w);\n };\n H.H.W = function (N, W) {\n var R = N.length;\n if (W <= R) return N;\n var V = new Uint8Array(R << 1);\n V.set(N, 0);\n return V;\n };\n H.H.R = function (N, W, R, V, n, A) {\n var l = H.H.e,\n M = H.H.Z,\n I = 0;\n while (I < R) {\n var e = N[M(V, n) & W];\n n += e & 15;\n var b = e >>> 4;\n if (b <= 15) {\n A[I] = b;\n I++;\n } else {\n var Z = 0,\n m = 0;\n if (b == 16) {\n m = 3 + l(V, n, 2);\n n += 2;\n Z = A[I - 1];\n } else if (b == 17) {\n m = 3 + l(V, n, 3);\n n += 3;\n } else if (b == 18) {\n m = 11 + l(V, n, 7);\n n += 7;\n }\n var J = I + m;\n while (I < J) {\n A[I] = Z;\n I++;\n }\n }\n }\n return n;\n };\n H.H.V = function (N, W, R, V) {\n var n = 0,\n A = 0,\n l = V.length >>> 1;\n while (A < R) {\n var M = N[A + W];\n V[A << 1] = 0;\n V[(A << 1) + 1] = M;\n if (M > n) n = M;\n A++;\n }\n while (A < l) {\n V[A << 1] = 0;\n V[(A << 1) + 1] = 0;\n A++;\n }\n return n;\n };\n H.H.n = function (N, W) {\n var R = H.H.m,\n V = N.length,\n n,\n A,\n l,\n M,\n I,\n e = R.j;\n for (var M = 0; M <= W; M++) e[M] = 0;\n for (M = 1; M < V; M += 2) e[N[M]]++;\n var b = R.K;\n n = 0;\n e[0] = 0;\n for (A = 1; A <= W; A++) {\n n = n + e[A - 1] << 1;\n b[A] = n;\n }\n for (l = 0; l < V; l += 2) {\n I = N[l + 1];\n if (I != 0) {\n N[l] = b[I];\n b[I]++;\n }\n }\n };\n H.H.A = function (N, W, R) {\n var V = N.length,\n n = H.H.m,\n A = n.r;\n for (var l = 0; l < V; l += 2) if (N[l + 1] != 0) {\n var M = l >> 1,\n I = N[l + 1],\n e = M << 4 | I,\n b = W - I,\n Z = N[l] << b,\n m = Z + (1 << b);\n while (Z != m) {\n var J = A[Z] >>> 15 - W;\n R[J] = e;\n Z++;\n }\n }\n };\n H.H.l = function (N, W) {\n var R = H.H.m.r,\n V = 15 - W;\n for (var n = 0; n < N.length; n += 2) {\n var A = N[n] << W - N[n + 1];\n N[n] = R[A] >>> V;\n }\n };\n H.H.M = function (N, W, R) {\n R = R << (W & 7);\n var V = W >>> 3;\n N[V] |= R;\n N[V + 1] |= R >>> 8;\n };\n H.H.I = function (N, W, R) {\n R = R << (W & 7);\n var V = W >>> 3;\n N[V] |= R;\n N[V + 1] |= R >>> 8;\n N[V + 2] |= R >>> 16;\n };\n H.H.e = function (N, W, R) {\n return (N[W >>> 3] | N[(W >>> 3) + 1] << 8) >>> (W & 7) & (1 << R) - 1;\n };\n H.H.b = function (N, W, R) {\n return (N[W >>> 3] | N[(W >>> 3) + 1] << 8 | N[(W >>> 3) + 2] << 16) >>> (W & 7) & (1 << R) - 1;\n };\n H.H.Z = function (N, W) {\n return (N[W >>> 3] | N[(W >>> 3) + 1] << 8 | N[(W >>> 3) + 2] << 16) >>> (W & 7);\n };\n H.H.i = function (N, W) {\n return (N[W >>> 3] | N[(W >>> 3) + 1] << 8 | N[(W >>> 3) + 2] << 16 | N[(W >>> 3) + 3] << 24) >>> (W & 7);\n };\n H.H.m = function () {\n var N = Uint16Array,\n W = Uint32Array;\n return {\n K: new N(16),\n j: new N(16),\n X: [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15],\n S: [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 999, 999, 999],\n T: [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0],\n q: new N(32),\n p: [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 65535, 65535],\n z: [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0],\n c: new W(32),\n J: new N(512),\n _: [],\n h: new N(32),\n $: [],\n w: new N(32768),\n C: [],\n v: [],\n d: new N(32768),\n D: [],\n u: new N(512),\n Q: [],\n r: new N(1 << 15),\n s: new W(286),\n Y: new W(30),\n a: new W(19),\n t: new W(15e3),\n k: new N(1 << 16),\n g: new N(1 << 15)\n };\n }();\n (function () {\n var N = H.H.m,\n W = 1 << 15;\n for (var R = 0; R < W; R++) {\n var V = R;\n V = (V & 2863311530) >>> 1 | (V & 1431655765) << 1;\n V = (V & 3435973836) >>> 2 | (V & 858993459) << 2;\n V = (V & 4042322160) >>> 4 | (V & 252645135) << 4;\n V = (V & 4278255360) >>> 8 | (V & 16711935) << 8;\n N.r[R] = (V >>> 16 | V << 16) >>> 17;\n }\n function n(A, l, M) {\n while (l-- != 0) A.push(0, M);\n }\n for (var R = 0; R < 32; R++) {\n N.q[R] = N.S[R] << 3 | N.T[R];\n N.c[R] = N.p[R] << 4 | N.z[R];\n }\n n(N._, 144, 8);\n n(N._, 255 - 143, 9);\n n(N._, 279 - 255, 7);\n n(N._, 287 - 279, 8);\n H.H.n(N._, 9);\n H.H.A(N._, 9, N.J);\n H.H.l(N._, 9);\n n(N.$, 32, 5);\n H.H.n(N.$, 5);\n H.H.A(N.$, 5, N.h);\n H.H.l(N.$, 5);\n n(N.Q, 19, 0);\n n(N.C, 286, 0);\n n(N.D, 30, 0);\n n(N.v, 320, 0);\n })();\n return H.H.N;\n}();\nUPNG.decode._readInterlace = function (data, out) {\n var w = out.width,\n h = out.height;\n var bpp = UPNG.decode._getBPP(out),\n cbpp = bpp >> 3,\n bpl = Math.ceil(w * bpp / 8);\n var img = new Uint8Array(h * bpl);\n var di = 0;\n var starting_row = [0, 0, 4, 0, 2, 0, 1];\n var starting_col = [0, 4, 0, 2, 0, 1, 0];\n var row_increment = [8, 8, 8, 4, 4, 2, 2];\n var col_increment = [8, 8, 4, 4, 2, 2, 1];\n var pass = 0;\n while (pass < 7) {\n var ri = row_increment[pass],\n ci = col_increment[pass];\n var sw = 0,\n sh = 0;\n var cr = starting_row[pass];\n while (cr < h) {\n cr += ri;\n sh++;\n }\n var cc = starting_col[pass];\n while (cc < w) {\n cc += ci;\n sw++;\n }\n var bpll = Math.ceil(sw * bpp / 8);\n UPNG.decode._filterZero(data, out, di, sw, sh);\n var y = 0,\n row = starting_row[pass];\n while (row < h) {\n var col = starting_col[pass];\n var cdi = di + y * bpll << 3;\n while (col < w) {\n if (bpp == 1) {\n var val = data[cdi >> 3];\n val = val >> 7 - (cdi & 7) & 1;\n img[row * bpl + (col >> 3)] |= val << 7 - ((col & 7) << 0);\n }\n if (bpp == 2) {\n var val = data[cdi >> 3];\n val = val >> 6 - (cdi & 7) & 3;\n img[row * bpl + (col >> 2)] |= val << 6 - ((col & 3) << 1);\n }\n if (bpp == 4) {\n var val = data[cdi >> 3];\n val = val >> 4 - (cdi & 7) & 15;\n img[row * bpl + (col >> 1)] |= val << 4 - ((col & 1) << 2);\n }\n if (bpp >= 8) {\n var ii = row * bpl + col * cbpp;\n for (var j = 0; j < cbpp; j++) img[ii + j] = data[(cdi >> 3) + j];\n }\n cdi += bpp;\n col += ci;\n }\n y++;\n row += ri;\n }\n if (sw * sh != 0) di += sh * (1 + bpll);\n pass = pass + 1;\n }\n return img;\n};\nUPNG.decode._getBPP = function (out) {\n var noc = [1, null, 3, 1, 2, null, 4][out.ctype];\n return noc * out.depth;\n};\nUPNG.decode._filterZero = function (data, out, off, w, h) {\n var bpp = UPNG.decode._getBPP(out),\n bpl = Math.ceil(w * bpp / 8),\n paeth = UPNG.decode._paeth;\n bpp = Math.ceil(bpp / 8);\n var i = 0,\n di = 1,\n type = data[off],\n x = 0;\n if (type > 1) data[off] = [0, 0, 1][type - 2];\n if (type == 3) for (x = bpp; x < bpl; x++) data[x + 1] = data[x + 1] + (data[x + 1 - bpp] >>> 1) & 255;\n for (var y = 0; y < h; y++) {\n i = off + y * bpl;\n di = i + y + 1;\n type = data[di - 1];\n x = 0;\n if (type == 0) for (; x < bpl; x++) data[i + x] = data[di + x];else if (type == 1) {\n for (; x < bpp; x++) data[i + x] = data[di + x];\n for (; x < bpl; x++) data[i + x] = data[di + x] + data[i + x - bpp];\n } else if (type == 2) {\n for (; x < bpl; x++) data[i + x] = data[di + x] + data[i + x - bpl];\n } else if (type == 3) {\n for (; x < bpp; x++) data[i + x] = data[di + x] + (data[i + x - bpl] >>> 1);\n for (; x < bpl; x++) data[i + x] = data[di + x] + (data[i + x - bpl] + data[i + x - bpp] >>> 1);\n } else {\n for (; x < bpp; x++) data[i + x] = data[di + x] + paeth(0, data[i + x - bpl], 0);\n for (; x < bpl; x++) data[i + x] = data[di + x] + paeth(data[i + x - bpp], data[i + x - bpl], data[i + x - bpp - bpl]);\n }\n }\n return data;\n};\nUPNG.decode._paeth = function (a, b, c) {\n var p = a + b - c,\n pa = p - a,\n pb = p - b,\n pc = p - c;\n if (pa * pa <= pb * pb && pa * pa <= pc * pc) return a;else if (pb * pb <= pc * pc) return b;\n return c;\n};\nUPNG.decode._IHDR = function (data, offset, out) {\n var bin = UPNG._bin;\n out.width = bin.readUint(data, offset);\n offset += 4;\n out.height = bin.readUint(data, offset);\n offset += 4;\n out.depth = data[offset];\n offset++;\n out.ctype = data[offset];\n offset++;\n out.compress = data[offset];\n offset++;\n out.filter = data[offset];\n offset++;\n out.interlace = data[offset];\n offset++;\n};\nUPNG._bin = {\n nextZero: function (data, p) {\n while (data[p] != 0) p++;\n return p;\n },\n readUshort: function (buff, p) {\n return buff[p] << 8 | buff[p + 1];\n },\n writeUshort: function (buff, p, n) {\n buff[p] = n >> 8 & 255;\n buff[p + 1] = n & 255;\n },\n readUint: function (buff, p) {\n return buff[p] * (256 * 256 * 256) + (buff[p + 1] << 16 | buff[p + 2] << 8 | buff[p + 3]);\n },\n writeUint: function (buff, p, n) {\n buff[p] = n >> 24 & 255;\n buff[p + 1] = n >> 16 & 255;\n buff[p + 2] = n >> 8 & 255;\n buff[p + 3] = n & 255;\n },\n readASCII: function (buff, p, l) {\n var s = \"\";\n for (var i = 0; i < l; i++) s += String.fromCharCode(buff[p + i]);\n return s;\n },\n writeASCII: function (data, p, s) {\n for (var i = 0; i < s.length; i++) data[p + i] = s.charCodeAt(i);\n },\n readBytes: function (buff, p, l) {\n var arr = [];\n for (var i = 0; i < l; i++) arr.push(buff[p + i]);\n return arr;\n },\n pad: function (n) {\n return n.length < 2 ? \"0\" + n : n;\n },\n readUTF8: function (buff, p, l) {\n var s = \"\",\n ns;\n for (var i = 0; i < l; i++) s += \"%\" + UPNG._bin.pad(buff[p + i].toString(16));\n try {\n ns = decodeURIComponent(s);\n } catch (e) {\n return UPNG._bin.readASCII(buff, p, l);\n }\n return ns;\n }\n};\nUPNG._copyTile = function (sb, sw, sh, tb, tw, th, xoff, yoff, mode) {\n var w = Math.min(sw, tw),\n h = Math.min(sh, th);\n var si = 0,\n ti = 0;\n for (var y = 0; y < h; y++) for (var x = 0; x < w; x++) {\n if (xoff >= 0 && yoff >= 0) {\n si = y * sw + x << 2;\n ti = (yoff + y) * tw + xoff + x << 2;\n } else {\n si = (-yoff + y) * sw - xoff + x << 2;\n ti = y * tw + x << 2;\n }\n if (mode == 0) {\n tb[ti] = sb[si];\n tb[ti + 1] = sb[si + 1];\n tb[ti + 2] = sb[si + 2];\n tb[ti + 3] = sb[si + 3];\n } else if (mode == 1) {\n var fa = sb[si + 3] * (1 / 255),\n fr = sb[si] * fa,\n fg = sb[si + 1] * fa,\n fb = sb[si + 2] * fa;\n var ba = tb[ti + 3] * (1 / 255),\n br = tb[ti] * ba,\n bg = tb[ti + 1] * ba,\n bb = tb[ti + 2] * ba;\n var ifa = 1 - fa,\n oa = fa + ba * ifa,\n ioa = oa == 0 ? 0 : 1 / oa;\n tb[ti + 3] = 255 * oa;\n tb[ti + 0] = (fr + br * ifa) * ioa;\n tb[ti + 1] = (fg + bg * ifa) * ioa;\n tb[ti + 2] = (fb + bb * ifa) * ioa;\n } else if (mode == 2) {\n // copy only differences, otherwise zero\n var fa = sb[si + 3],\n fr = sb[si],\n fg = sb[si + 1],\n fb = sb[si + 2];\n var ba = tb[ti + 3],\n br = tb[ti],\n bg = tb[ti + 1],\n bb = tb[ti + 2];\n if (fa == ba && fr == br && fg == bg && fb == bb) {\n tb[ti] = 0;\n tb[ti + 1] = 0;\n tb[ti + 2] = 0;\n tb[ti + 3] = 0;\n } else {\n tb[ti] = fr;\n tb[ti + 1] = fg;\n tb[ti + 2] = fb;\n tb[ti + 3] = fa;\n }\n } else if (mode == 3) {\n // check if can be blended\n var fa = sb[si + 3],\n fr = sb[si],\n fg = sb[si + 1],\n fb = sb[si + 2];\n var ba = tb[ti + 3],\n br = tb[ti],\n bg = tb[ti + 1],\n bb = tb[ti + 2];\n if (fa == ba && fr == br && fg == bg && fb == bb) continue;\n //if(fa!=255 && ba!=0) return false;\n if (fa < 220 && ba > 20) return false;\n }\n }\n return true;\n};\nUPNG.encode = function (bufs, w, h, ps, dels, tabs, forbidPlte) {\n if (ps == null) ps = 0;\n if (forbidPlte == null) forbidPlte = false;\n var nimg = UPNG.encode.compress(bufs, w, h, ps, [false, false, false, 0, forbidPlte]);\n UPNG.encode.compressPNG(nimg, -1);\n return UPNG.encode._main(nimg, w, h, dels, tabs);\n};\nUPNG.encodeLL = function (bufs, w, h, cc, ac, depth, dels, tabs) {\n var nimg = {\n ctype: 0 + (cc == 1 ? 0 : 2) + (ac == 0 ? 0 : 4),\n depth: depth,\n frames: []\n };\n var time = Date.now();\n var bipp = (cc + ac) * depth,\n bipl = bipp * w;\n for (var i = 0; i < bufs.length; i++) nimg.frames.push({\n rect: {\n x: 0,\n y: 0,\n width: w,\n height: h\n },\n img: new Uint8Array(bufs[i]),\n blend: 0,\n dispose: 1,\n bpp: Math.ceil(bipp / 8),\n bpl: Math.ceil(bipl / 8)\n });\n UPNG.encode.compressPNG(nimg, 0, true);\n var out = UPNG.encode._main(nimg, w, h, dels, tabs);\n return out;\n};\nUPNG.encode._main = function (nimg, w, h, dels, tabs) {\n if (tabs == null) tabs = {};\n var crc = UPNG.crc.crc,\n wUi = UPNG._bin.writeUint,\n wUs = UPNG._bin.writeUshort,\n wAs = UPNG._bin.writeASCII;\n var offset = 8,\n anim = nimg.frames.length > 1,\n pltAlpha = false;\n var leng = 8 + (16 + 5 + 4) /*+ (9+4)*/ + (anim ? 20 : 0);\n if (tabs[\"sRGB\"] != null) leng += 8 + 1 + 4;\n if (tabs[\"pHYs\"] != null) leng += 8 + 9 + 4;\n if (nimg.ctype == 3) {\n var dl = nimg.plte.length;\n for (var i = 0; i < dl; i++) if (nimg.plte[i] >>> 24 != 255) pltAlpha = true;\n leng += 8 + dl * 3 + 4 + (pltAlpha ? 8 + dl * 1 + 4 : 0);\n }\n for (var j = 0; j < nimg.frames.length; j++) {\n var fr = nimg.frames[j];\n if (anim) leng += 38;\n leng += fr.cimg.length + 12;\n if (j != 0) leng += 4;\n }\n leng += 12;\n var data = new Uint8Array(leng);\n var wr = [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a];\n for (var i = 0; i < 8; i++) data[i] = wr[i];\n wUi(data, offset, 13);\n offset += 4;\n wAs(data, offset, \"IHDR\");\n offset += 4;\n wUi(data, offset, w);\n offset += 4;\n wUi(data, offset, h);\n offset += 4;\n data[offset] = nimg.depth;\n offset++; // depth\n data[offset] = nimg.ctype;\n offset++; // ctype\n data[offset] = 0;\n offset++; // compress\n data[offset] = 0;\n offset++; // filter\n data[offset] = 0;\n offset++; // interlace\n wUi(data, offset, crc(data, offset - 17, 17));\n offset += 4; // crc\n\n // 13 bytes to say, that it is sRGB\n if (tabs[\"sRGB\"] != null) {\n wUi(data, offset, 1);\n offset += 4;\n wAs(data, offset, \"sRGB\");\n offset += 4;\n data[offset] = tabs[\"sRGB\"];\n offset++;\n wUi(data, offset, crc(data, offset - 5, 5));\n offset += 4; // crc\n }\n if (tabs[\"pHYs\"] != null) {\n wUi(data, offset, 9);\n offset += 4;\n wAs(data, offset, \"pHYs\");\n offset += 4;\n wUi(data, offset, tabs[\"pHYs\"][0]);\n offset += 4;\n wUi(data, offset, tabs[\"pHYs\"][1]);\n offset += 4;\n data[offset] = tabs[\"pHYs\"][2];\n offset++;\n wUi(data, offset, crc(data, offset - 13, 13));\n offset += 4; // crc\n }\n if (anim) {\n wUi(data, offset, 8);\n offset += 4;\n wAs(data, offset, \"acTL\");\n offset += 4;\n wUi(data, offset, nimg.frames.length);\n offset += 4;\n wUi(data, offset, tabs[\"loop\"] != null ? tabs[\"loop\"] : 0);\n offset += 4;\n wUi(data, offset, crc(data, offset - 12, 12));\n offset += 4; // crc\n }\n if (nimg.ctype == 3) {\n var dl = nimg.plte.length;\n wUi(data, offset, dl * 3);\n offset += 4;\n wAs(data, offset, \"PLTE\");\n offset += 4;\n for (var i = 0; i < dl; i++) {\n var ti = i * 3,\n c = nimg.plte[i],\n r = c & 255,\n g = c >>> 8 & 255,\n b = c >>> 16 & 255;\n data[offset + ti + 0] = r;\n data[offset + ti + 1] = g;\n data[offset + ti + 2] = b;\n }\n offset += dl * 3;\n wUi(data, offset, crc(data, offset - dl * 3 - 4, dl * 3 + 4));\n offset += 4; // crc\n\n if (pltAlpha) {\n wUi(data, offset, dl);\n offset += 4;\n wAs(data, offset, \"tRNS\");\n offset += 4;\n for (var i = 0; i < dl; i++) data[offset + i] = nimg.plte[i] >>> 24 & 255;\n offset += dl;\n wUi(data, offset, crc(data, offset - dl - 4, dl + 4));\n offset += 4; // crc\n }\n }\n var fi = 0;\n for (var j = 0; j < nimg.frames.length; j++) {\n var fr = nimg.frames[j];\n if (anim) {\n wUi(data, offset, 26);\n offset += 4;\n wAs(data, offset, \"fcTL\");\n offset += 4;\n wUi(data, offset, fi++);\n offset += 4;\n wUi(data, offset, fr.rect.width);\n offset += 4;\n wUi(data, offset, fr.rect.height);\n offset += 4;\n wUi(data, offset, fr.rect.x);\n offset += 4;\n wUi(data, offset, fr.rect.y);\n offset += 4;\n wUs(data, offset, dels[j]);\n offset += 2;\n wUs(data, offset, 1000);\n offset += 2;\n data[offset] = fr.dispose;\n offset++; // dispose\n data[offset] = fr.blend;\n offset++; // blend\n wUi(data, offset, crc(data, offset - 30, 30));\n offset += 4; // crc\n }\n var imgd = fr.cimg,\n dl = imgd.length;\n wUi(data, offset, dl + (j == 0 ? 0 : 4));\n offset += 4;\n var ioff = offset;\n wAs(data, offset, j == 0 ? \"IDAT\" : \"fdAT\");\n offset += 4;\n if (j != 0) {\n wUi(data, offset, fi++);\n offset += 4;\n }\n data.set(imgd, offset);\n offset += dl;\n wUi(data, offset, crc(data, ioff, offset - ioff));\n offset += 4; // crc\n }\n wUi(data, offset, 0);\n offset += 4;\n wAs(data, offset, \"IEND\");\n offset += 4;\n wUi(data, offset, crc(data, offset - 4, 4));\n offset += 4; // crc\n\n return data.buffer;\n};\nUPNG.encode.compressPNG = function (out, filter, levelZero) {\n for (var i = 0; i < out.frames.length; i++) {\n var frm = out.frames[i],\n nw = frm.rect.width,\n nh = frm.rect.height;\n var fdata = new Uint8Array(nh * frm.bpl + nh);\n frm.cimg = UPNG.encode._filterZero(frm.img, nh, frm.bpp, frm.bpl, fdata, filter, levelZero);\n }\n};\nUPNG.encode.compress = function (bufs, w, h, ps, prms)\n// prms: onlyBlend, minBits, forbidPlte\n{\n //var time = Date.now();\n var onlyBlend = prms[0],\n evenCrd = prms[1],\n forbidPrev = prms[2],\n minBits = prms[3],\n forbidPlte = prms[4];\n var ctype = 6,\n depth = 8,\n alphaAnd = 255;\n for (var j = 0; j < bufs.length; j++) {\n // when not quantized, other frames can contain colors, that are not in an initial frame\n var img = new Uint8Array(bufs[j]),\n ilen = img.length;\n for (var i = 0; i < ilen; i += 4) alphaAnd &= img[i + 3];\n }\n var gotAlpha = alphaAnd != 255;\n\n //console.log(\"alpha check\", Date.now()-time); time = Date.now();\n\n //var brute = gotAlpha && forGIF;\t\t// brute : frames can only be copied, not \"blended\"\n var frms = UPNG.encode.framize(bufs, w, h, onlyBlend, evenCrd, forbidPrev);\n //console.log(\"framize\", Date.now()-time); time = Date.now();\n\n var cmap = {},\n plte = [],\n inds = [];\n if (ps != 0) {\n var nbufs = [];\n for (var i = 0; i < frms.length; i++) nbufs.push(frms[i].img.buffer);\n var abuf = UPNG.encode.concatRGBA(nbufs),\n qres = UPNG.quantize(abuf, ps);\n var cof = 0,\n bb = new Uint8Array(qres.abuf);\n for (var i = 0; i < frms.length; i++) {\n var ti = frms[i].img,\n bln = ti.length;\n inds.push(new Uint8Array(qres.inds.buffer, cof >> 2, bln >> 2));\n for (var j = 0; j < bln; j += 4) {\n ti[j] = bb[cof + j];\n ti[j + 1] = bb[cof + j + 1];\n ti[j + 2] = bb[cof + j + 2];\n ti[j + 3] = bb[cof + j + 3];\n }\n cof += bln;\n }\n for (var i = 0; i < qres.plte.length; i++) plte.push(qres.plte[i].est.rgba);\n //console.log(\"quantize\", Date.now()-time); time = Date.now();\n } else {\n // what if ps==0, but there are <=256 colors? we still need to detect, if the palette could be used\n for (var j = 0; j < frms.length; j++) {\n // when not quantized, other frames can contain colors, that are not in an initial frame\n var frm = frms[j],\n img32 = new Uint32Array(frm.img.buffer),\n nw = frm.rect.width,\n ilen = img32.length;\n var ind = new Uint8Array(ilen);\n inds.push(ind);\n for (var i = 0; i < ilen; i++) {\n var c = img32[i];\n if (i != 0 && c == img32[i - 1]) ind[i] = ind[i - 1];else if (i > nw && c == img32[i - nw]) ind[i] = ind[i - nw];else {\n var cmc = cmap[c];\n if (cmc == null) {\n cmap[c] = cmc = plte.length;\n plte.push(c);\n if (plte.length >= 300) break;\n }\n ind[i] = cmc;\n }\n }\n }\n //console.log(\"make palette\", Date.now()-time); time = Date.now();\n }\n var cc = plte.length; //console.log(\"colors:\",cc);\n if (cc <= 256 && forbidPlte == false) {\n if (cc <= 2) depth = 1;else if (cc <= 4) depth = 2;else if (cc <= 16) depth = 4;else depth = 8;\n depth = Math.max(depth, minBits);\n }\n for (var j = 0; j < frms.length; j++) {\n var frm = frms[j],\n nx = frm.rect.x,\n ny = frm.rect.y,\n nw = frm.rect.width,\n nh = frm.rect.height;\n var cimg = frm.img,\n cimg32 = new Uint32Array(cimg.buffer);\n var bpl = 4 * nw,\n bpp = 4;\n if (cc <= 256 && forbidPlte == false) {\n bpl = Math.ceil(depth * nw / 8);\n var nimg = new Uint8Array(bpl * nh);\n var inj = inds[j];\n for (var y = 0; y < nh; y++) {\n var i = y * bpl,\n ii = y * nw;\n if (depth == 8) for (var x = 0; x < nw; x++) nimg[i + x] = inj[ii + x];else if (depth == 4) for (var x = 0; x < nw; x++) nimg[i + (x >> 1)] |= inj[ii + x] << 4 - (x & 1) * 4;else if (depth == 2) for (var x = 0; x < nw; x++) nimg[i + (x >> 2)] |= inj[ii + x] << 6 - (x & 3) * 2;else if (depth == 1) for (var x = 0; x < nw; x++) nimg[i + (x >> 3)] |= inj[ii + x] << 7 - (x & 7) * 1;\n }\n cimg = nimg;\n ctype = 3;\n bpp = 1;\n } else if (gotAlpha == false && frms.length == 1) {\n // some next \"reduced\" frames may contain alpha for blending\n var nimg = new Uint8Array(nw * nh * 3),\n area = nw * nh;\n for (var i = 0; i < area; i++) {\n var ti = i * 3,\n qi = i * 4;\n nimg[ti] = cimg[qi];\n nimg[ti + 1] = cimg[qi + 1];\n nimg[ti + 2] = cimg[qi + 2];\n }\n cimg = nimg;\n ctype = 2;\n bpp = 3;\n bpl = 3 * nw;\n }\n frm.img = cimg;\n frm.bpl = bpl;\n frm.bpp = bpp;\n }\n //console.log(\"colors => palette indices\", Date.now()-time); time = Date.now();\n\n return {\n ctype: ctype,\n depth: depth,\n plte: plte,\n frames: frms\n };\n};\nUPNG.encode.framize = function (bufs, w, h, alwaysBlend, evenCrd, forbidPrev) {\n /* DISPOSE\n - 0 : no change\n \t- 1 : clear to transparent\n \t- 2 : retstore to content before rendering (previous frame disposed)\n \tBLEND\n \t- 0 : replace\n \t- 1 : blend\n */\n var frms = [];\n for (var j = 0; j < bufs.length; j++) {\n var cimg = new Uint8Array(bufs[j]),\n cimg32 = new Uint32Array(cimg.buffer);\n var nimg;\n var nx = 0,\n ny = 0,\n nw = w,\n nh = h,\n blend = alwaysBlend ? 1 : 0;\n if (j != 0) {\n var tlim = forbidPrev || alwaysBlend || j == 1 || frms[j - 2].dispose != 0 ? 1 : 2,\n tstp = 0,\n tarea = 1e9;\n for (var it = 0; it < tlim; it++) {\n var pimg = new Uint8Array(bufs[j - 1 - it]),\n p32 = new Uint32Array(bufs[j - 1 - it]);\n var mix = w,\n miy = h,\n max = -1,\n may = -1;\n for (var y = 0; y < h; y++) for (var x = 0; x < w; x++) {\n var i = y * w + x;\n if (cimg32[i] != p32[i]) {\n if (x < mix) mix = x;\n if (x > max) max = x;\n if (y < miy) miy = y;\n if (y > may) may = y;\n }\n }\n if (max == -1) mix = miy = max = may = 0;\n if (evenCrd) {\n if ((mix & 1) == 1) mix--;\n if ((miy & 1) == 1) miy--;\n }\n var sarea = (max - mix + 1) * (may - miy + 1);\n if (sarea < tarea) {\n tarea = sarea;\n tstp = it;\n nx = mix;\n ny = miy;\n nw = max - mix + 1;\n nh = may - miy + 1;\n }\n }\n\n // alwaysBlend: pokud zjistím, že blendit nelze, nastavím předchozímu snímku dispose=1. Zajistím, aby obsahoval můj obdélník.\n var pimg = new Uint8Array(bufs[j - 1 - tstp]);\n if (tstp == 1) frms[j - 1].dispose = 2;\n nimg = new Uint8Array(nw * nh * 4);\n UPNG._copyTile(pimg, w, h, nimg, nw, nh, -nx, -ny, 0);\n blend = UPNG._copyTile(cimg, w, h, nimg, nw, nh, -nx, -ny, 3) ? 1 : 0;\n if (blend == 1) UPNG.encode._prepareDiff(cimg, w, h, nimg, {\n x: nx,\n y: ny,\n width: nw,\n height: nh\n });else UPNG._copyTile(cimg, w, h, nimg, nw, nh, -nx, -ny, 0);\n //UPNG._copyTile(cimg,w,h, nimg,nw,nh, -nx,-ny, blend==1?2:0);\n } else nimg = cimg.slice(0); // img may be rewritten further ... don't rewrite input\n\n frms.push({\n rect: {\n x: nx,\n y: ny,\n width: nw,\n height: nh\n },\n img: nimg,\n blend: blend,\n dispose: 0\n });\n }\n if (alwaysBlend) for (var j = 0; j < frms.length; j++) {\n var frm = frms[j];\n if (frm.blend == 1) continue;\n var r0 = frm.rect,\n r1 = frms[j - 1].rect;\n var miX = Math.min(r0.x, r1.x),\n miY = Math.min(r0.y, r1.y);\n var maX = Math.max(r0.x + r0.width, r1.x + r1.width),\n maY = Math.max(r0.y + r0.height, r1.y + r1.height);\n var r = {\n x: miX,\n y: miY,\n width: maX - miX,\n height: maY - miY\n };\n frms[j - 1].dispose = 1;\n if (j - 1 != 0) UPNG.encode._updateFrame(bufs, w, h, frms, j - 1, r, evenCrd);\n UPNG.encode._updateFrame(bufs, w, h, frms, j, r, evenCrd);\n }\n var area = 0;\n if (bufs.length != 1) for (var i = 0; i < frms.length; i++) {\n var frm = frms[i];\n area += frm.rect.width * frm.rect.height;\n //if(i==0 || frm.blend!=1) continue;\n //var ob = new Uint8Array(\n //console.log(frm.blend, frm.dispose, frm.rect);\n }\n //if(area!=0) console.log(area);\n return frms;\n};\nUPNG.encode._updateFrame = function (bufs, w, h, frms, i, r, evenCrd) {\n var U8 = Uint8Array,\n U32 = Uint32Array;\n var pimg = new U8(bufs[i - 1]),\n pimg32 = new U32(bufs[i - 1]),\n nimg = i + 1 < bufs.length ? new U8(bufs[i + 1]) : null;\n var cimg = new U8(bufs[i]),\n cimg32 = new U32(cimg.buffer);\n var mix = w,\n miy = h,\n max = -1,\n may = -1;\n for (var y = 0; y < r.height; y++) for (var x = 0; x < r.width; x++) {\n var cx = r.x + x,\n cy = r.y + y;\n var j = cy * w + cx,\n cc = cimg32[j];\n // no need to draw transparency, or to dispose it. Or, if writing the same color and the next one does not need transparency.\n if (cc == 0 || frms[i - 1].dispose == 0 && pimg32[j] == cc && (nimg == null || nimg[j * 4 + 3] != 0) /**/) {} else {\n if (cx < mix) mix = cx;\n if (cx > max) max = cx;\n if (cy < miy) miy = cy;\n if (cy > may) may = cy;\n }\n }\n if (max == -1) mix = miy = max = may = 0;\n if (evenCrd) {\n if ((mix & 1) == 1) mix--;\n if ((miy & 1) == 1) miy--;\n }\n r = {\n x: mix,\n y: miy,\n width: max - mix + 1,\n height: may - miy + 1\n };\n var fr = frms[i];\n fr.rect = r;\n fr.blend = 1;\n fr.img = new Uint8Array(r.width * r.height * 4);\n if (frms[i - 1].dispose == 0) {\n UPNG._copyTile(pimg, w, h, fr.img, r.width, r.height, -r.x, -r.y, 0);\n UPNG.encode._prepareDiff(cimg, w, h, fr.img, r);\n //UPNG._copyTile(cimg,w,h, fr.img,r.width,r.height, -r.x,-r.y, 2);\n } else UPNG._copyTile(cimg, w, h, fr.img, r.width, r.height, -r.x, -r.y, 0);\n};\nUPNG.encode._prepareDiff = function (cimg, w, h, nimg, rec) {\n UPNG._copyTile(cimg, w, h, nimg, rec.width, rec.height, -rec.x, -rec.y, 2);\n /*\n var n32 = new Uint32Array(nimg.buffer);\n var og = new Uint8Array(rec.width*rec.height*4), o32 = new Uint32Array(og.buffer);\n UPNG._copyTile(cimg,w,h, og,rec.width,rec.height, -rec.x,-rec.y, 0);\n for(var i=4; i>>2]==o32[(i>>>2)-1]) {\n \t\tn32[i>>>2]=o32[i>>>2];\n \t\t//var j = i, c=p32[(i>>>2)-1];\n \t\t//while(p32[j>>>2]==c) { n32[j>>>2]=c; j+=4; }\n \t}\n }\n for(var i=nimg.length-8; i>0; i-=4) {\n \tif(nimg[i+7]!=0 && nimg[i+3]==0 && o32[i>>>2]==o32[(i>>>2)+1]) {\n \t\tn32[i>>>2]=o32[i>>>2];\n \t\t//var j = i, c=p32[(i>>>2)-1];\n \t\t//while(p32[j>>>2]==c) { n32[j>>>2]=c; j+=4; }\n \t}\n }*/\n};\nUPNG.encode._filterZero = function (img, h, bpp, bpl, data, filter, levelZero) {\n var fls = [],\n ftry = [0, 1, 2, 3, 4];\n if (filter != -1) ftry = [filter];else if (h * bpl > 500000 || bpp == 1) ftry = [0];\n var opts;\n if (levelZero) opts = {\n level: 0\n };\n var CMPR = levelZero && UZIP != null ? UZIP : pako;\n for (var i = 0; i < ftry.length; i++) {\n for (var y = 0; y < h; y++) UPNG.encode._filterLine(data, img, y, bpl, bpp, ftry[i]);\n //var nimg = new Uint8Array(data.length);\n //var sz = UZIP.F.deflate(data, nimg); fls.push(nimg.slice(0,sz));\n //var dfl = pako[\"deflate\"](data), dl=dfl.length-4;\n //var crc = (dfl[dl+3]<<24)|(dfl[dl+2]<<16)|(dfl[dl+1]<<8)|(dfl[dl+0]<<0);\n //console.log(crc, UZIP.adler(data,2,data.length-6));\n fls.push(CMPR[\"deflate\"](data, opts));\n }\n var ti,\n tsize = 1e9;\n for (var i = 0; i < fls.length; i++) if (fls[i].length < tsize) {\n ti = i;\n tsize = fls[i].length;\n }\n return fls[ti];\n};\nUPNG.encode._filterLine = function (data, img, y, bpl, bpp, type) {\n var i = y * bpl,\n di = i + y,\n paeth = UPNG.decode._paeth;\n data[di] = type;\n di++;\n if (type == 0) {\n if (bpl < 500) for (var x = 0; x < bpl; x++) data[di + x] = img[i + x];else data.set(new Uint8Array(img.buffer, i, bpl), di);\n } else if (type == 1) {\n for (var x = 0; x < bpp; x++) data[di + x] = img[i + x];\n for (var x = bpp; x < bpl; x++) data[di + x] = img[i + x] - img[i + x - bpp] + 256 & 255;\n } else if (y == 0) {\n for (var x = 0; x < bpp; x++) data[di + x] = img[i + x];\n if (type == 2) for (var x = bpp; x < bpl; x++) data[di + x] = img[i + x];\n if (type == 3) for (var x = bpp; x < bpl; x++) data[di + x] = img[i + x] - (img[i + x - bpp] >> 1) + 256 & 255;\n if (type == 4) for (var x = bpp; x < bpl; x++) data[di + x] = img[i + x] - paeth(img[i + x - bpp], 0, 0) + 256 & 255;\n } else {\n if (type == 2) {\n for (var x = 0; x < bpl; x++) data[di + x] = img[i + x] + 256 - img[i + x - bpl] & 255;\n }\n if (type == 3) {\n for (var x = 0; x < bpp; x++) data[di + x] = img[i + x] + 256 - (img[i + x - bpl] >> 1) & 255;\n for (var x = bpp; x < bpl; x++) data[di + x] = img[i + x] + 256 - (img[i + x - bpl] + img[i + x - bpp] >> 1) & 255;\n }\n if (type == 4) {\n for (var x = 0; x < bpp; x++) data[di + x] = img[i + x] + 256 - paeth(0, img[i + x - bpl], 0) & 255;\n for (var x = bpp; x < bpl; x++) data[di + x] = img[i + x] + 256 - paeth(img[i + x - bpp], img[i + x - bpl], img[i + x - bpp - bpl]) & 255;\n }\n }\n};\nUPNG.crc = {\n table: function () {\n var tab = new Uint32Array(256);\n for (var n = 0; n < 256; n++) {\n var c = n;\n for (var k = 0; k < 8; k++) {\n if (c & 1) c = 0xedb88320 ^ c >>> 1;else c = c >>> 1;\n }\n tab[n] = c;\n }\n return tab;\n }(),\n update: function (c, buf, off, len) {\n for (var i = 0; i < len; i++) c = UPNG.crc.table[(c ^ buf[off + i]) & 0xff] ^ c >>> 8;\n return c;\n },\n crc: function (b, o, l) {\n return UPNG.crc.update(0xffffffff, b, o, l) ^ 0xffffffff;\n }\n};\nUPNG.quantize = function (abuf, ps) {\n var oimg = new Uint8Array(abuf),\n nimg = oimg.slice(0),\n nimg32 = new Uint32Array(nimg.buffer);\n var KD = UPNG.quantize.getKDtree(nimg, ps);\n var root = KD[0],\n leafs = KD[1];\n var planeDst = UPNG.quantize.planeDst;\n var sb = oimg,\n tb = nimg32,\n len = sb.length;\n var inds = new Uint8Array(oimg.length >> 2);\n for (var i = 0; i < len; i += 4) {\n var r = sb[i] * (1 / 255),\n g = sb[i + 1] * (1 / 255),\n b = sb[i + 2] * (1 / 255),\n a = sb[i + 3] * (1 / 255);\n\n // exact, but too slow :(\n var nd = UPNG.quantize.getNearest(root, r, g, b, a);\n //var nd = root;\n //while(nd.left) nd = (planeDst(nd.est,r,g,b,a)<=0) ? nd.left : nd.right;\n\n inds[i >> 2] = nd.ind;\n tb[i >> 2] = nd.est.rgba;\n }\n return {\n abuf: nimg.buffer,\n inds: inds,\n plte: leafs\n };\n};\nUPNG.quantize.getKDtree = function (nimg, ps, err) {\n if (err == null) err = 0.0001;\n var nimg32 = new Uint32Array(nimg.buffer);\n var root = {\n i0: 0,\n i1: nimg.length,\n bst: null,\n est: null,\n tdst: 0,\n left: null,\n right: null\n }; // basic statistic, extra statistic\n root.bst = UPNG.quantize.stats(nimg, root.i0, root.i1);\n root.est = UPNG.quantize.estats(root.bst);\n var leafs = [root];\n while (leafs.length < ps) {\n var maxL = 0,\n mi = 0;\n for (var i = 0; i < leafs.length; i++) if (leafs[i].est.L > maxL) {\n maxL = leafs[i].est.L;\n mi = i;\n }\n if (maxL < err) break;\n var node = leafs[mi];\n var s0 = UPNG.quantize.splitPixels(nimg, nimg32, node.i0, node.i1, node.est.e, node.est.eMq255);\n var s0wrong = node.i0 >= s0 || node.i1 <= s0;\n //console.log(maxL, leafs.length, mi);\n if (s0wrong) {\n node.est.L = 0;\n continue;\n }\n var ln = {\n i0: node.i0,\n i1: s0,\n bst: null,\n est: null,\n tdst: 0,\n left: null,\n right: null\n };\n ln.bst = UPNG.quantize.stats(nimg, ln.i0, ln.i1);\n ln.est = UPNG.quantize.estats(ln.bst);\n var rn = {\n i0: s0,\n i1: node.i1,\n bst: null,\n est: null,\n tdst: 0,\n left: null,\n right: null\n };\n rn.bst = {\n R: [],\n m: [],\n N: node.bst.N - ln.bst.N\n };\n for (var i = 0; i < 16; i++) rn.bst.R[i] = node.bst.R[i] - ln.bst.R[i];\n for (var i = 0; i < 4; i++) rn.bst.m[i] = node.bst.m[i] - ln.bst.m[i];\n rn.est = UPNG.quantize.estats(rn.bst);\n node.left = ln;\n node.right = rn;\n leafs[mi] = ln;\n leafs.push(rn);\n }\n leafs.sort(function (a, b) {\n return b.bst.N - a.bst.N;\n });\n for (var i = 0; i < leafs.length; i++) leafs[i].ind = i;\n return [root, leafs];\n};\nUPNG.quantize.getNearest = function (nd, r, g, b, a) {\n if (nd.left == null) {\n nd.tdst = UPNG.quantize.dist(nd.est.q, r, g, b, a);\n return nd;\n }\n var planeDst = UPNG.quantize.planeDst(nd.est, r, g, b, a);\n var node0 = nd.left,\n node1 = nd.right;\n if (planeDst > 0) {\n node0 = nd.right;\n node1 = nd.left;\n }\n var ln = UPNG.quantize.getNearest(node0, r, g, b, a);\n if (ln.tdst <= planeDst * planeDst) return ln;\n var rn = UPNG.quantize.getNearest(node1, r, g, b, a);\n return rn.tdst < ln.tdst ? rn : ln;\n};\nUPNG.quantize.planeDst = function (est, r, g, b, a) {\n var e = est.e;\n return e[0] * r + e[1] * g + e[2] * b + e[3] * a - est.eMq;\n};\nUPNG.quantize.dist = function (q, r, g, b, a) {\n var d0 = r - q[0],\n d1 = g - q[1],\n d2 = b - q[2],\n d3 = a - q[3];\n return d0 * d0 + d1 * d1 + d2 * d2 + d3 * d3;\n};\nUPNG.quantize.splitPixels = function (nimg, nimg32, i0, i1, e, eMq) {\n var vecDot = UPNG.quantize.vecDot;\n i1 -= 4;\n var shfs = 0;\n while (i0 < i1) {\n while (vecDot(nimg, i0, e) <= eMq) i0 += 4;\n while (vecDot(nimg, i1, e) > eMq) i1 -= 4;\n if (i0 >= i1) break;\n var t = nimg32[i0 >> 2];\n nimg32[i0 >> 2] = nimg32[i1 >> 2];\n nimg32[i1 >> 2] = t;\n i0 += 4;\n i1 -= 4;\n }\n while (vecDot(nimg, i0, e) > eMq) i0 -= 4;\n return i0 + 4;\n};\nUPNG.quantize.vecDot = function (nimg, i, e) {\n return nimg[i] * e[0] + nimg[i + 1] * e[1] + nimg[i + 2] * e[2] + nimg[i + 3] * e[3];\n};\nUPNG.quantize.stats = function (nimg, i0, i1) {\n var R = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n var m = [0, 0, 0, 0];\n var N = i1 - i0 >> 2;\n for (var i = i0; i < i1; i += 4) {\n var r = nimg[i] * (1 / 255),\n g = nimg[i + 1] * (1 / 255),\n b = nimg[i + 2] * (1 / 255),\n a = nimg[i + 3] * (1 / 255);\n //var r = nimg[i], g = nimg[i+1], b = nimg[i+2], a = nimg[i+3];\n m[0] += r;\n m[1] += g;\n m[2] += b;\n m[3] += a;\n R[0] += r * r;\n R[1] += r * g;\n R[2] += r * b;\n R[3] += r * a;\n R[5] += g * g;\n R[6] += g * b;\n R[7] += g * a;\n R[10] += b * b;\n R[11] += b * a;\n R[15] += a * a;\n }\n R[4] = R[1];\n R[8] = R[2];\n R[9] = R[6];\n R[12] = R[3];\n R[13] = R[7];\n R[14] = R[11];\n return {\n R: R,\n m: m,\n N: N\n };\n};\nUPNG.quantize.estats = function (stats) {\n var R = stats.R,\n m = stats.m,\n N = stats.N;\n\n // when all samples are equal, but N is large (millions), the Rj can be non-zero ( 0.0003.... - precission error)\n var m0 = m[0],\n m1 = m[1],\n m2 = m[2],\n m3 = m[3],\n iN = N == 0 ? 0 : 1 / N;\n var Rj = [R[0] - m0 * m0 * iN, R[1] - m0 * m1 * iN, R[2] - m0 * m2 * iN, R[3] - m0 * m3 * iN, R[4] - m1 * m0 * iN, R[5] - m1 * m1 * iN, R[6] - m1 * m2 * iN, R[7] - m1 * m3 * iN, R[8] - m2 * m0 * iN, R[9] - m2 * m1 * iN, R[10] - m2 * m2 * iN, R[11] - m2 * m3 * iN, R[12] - m3 * m0 * iN, R[13] - m3 * m1 * iN, R[14] - m3 * m2 * iN, R[15] - m3 * m3 * iN];\n var A = Rj,\n M = UPNG.M4;\n var b = [0.5, 0.5, 0.5, 0.5],\n mi = 0,\n tmi = 0;\n if (N != 0) for (var i = 0; i < 10; i++) {\n b = M.multVec(A, b);\n tmi = Math.sqrt(M.dot(b, b));\n b = M.sml(1 / tmi, b);\n if (Math.abs(tmi - mi) < 1e-9) break;\n mi = tmi;\n }\n //b = [0,0,1,0]; mi=N;\n var q = [m0 * iN, m1 * iN, m2 * iN, m3 * iN];\n var eMq255 = M.dot(M.sml(255, q), b);\n return {\n Cov: Rj,\n q: q,\n e: b,\n L: mi,\n eMq255: eMq255,\n eMq: M.dot(b, q),\n rgba: (Math.round(255 * q[3]) << 24 | Math.round(255 * q[2]) << 16 | Math.round(255 * q[1]) << 8 | Math.round(255 * q[0]) << 0) >>> 0\n };\n};\nUPNG.M4 = {\n multVec: function (m, v) {\n return [m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3] * v[3], m[4] * v[0] + m[5] * v[1] + m[6] * v[2] + m[7] * v[3], m[8] * v[0] + m[9] * v[1] + m[10] * v[2] + m[11] * v[3], m[12] * v[0] + m[13] * v[1] + m[14] * v[2] + m[15] * v[3]];\n },\n dot: function (x, y) {\n return x[0] * y[0] + x[1] * y[1] + x[2] * y[2] + x[3] * y[3];\n },\n sml: function (a, y) {\n return [a * y[0], a * y[1], a * y[2], a * y[3]];\n }\n};\nUPNG.encode.concatRGBA = function (bufs) {\n var tlen = 0;\n for (var i = 0; i < bufs.length; i++) tlen += bufs[i].byteLength;\n var nimg = new Uint8Array(tlen),\n noff = 0;\n for (var i = 0; i < bufs.length; i++) {\n var img = new Uint8Array(bufs[i]),\n il = img.length;\n for (var j = 0; j < il; j += 4) {\n var r = img[j],\n g = img[j + 1],\n b = img[j + 2],\n a = img[j + 3];\n if (a == 0) r = g = b = 0;\n nimg[noff + j] = r;\n nimg[noff + j + 1] = g;\n nimg[noff + j + 2] = b;\n nimg[noff + j + 3] = a;\n }\n noff += il;\n }\n return nimg.buffer;\n};\nexport default UPNG;","import UPNG from '@pdf-lib/upng';\nvar getImageType = function (ctype) {\n if (ctype === 0) return PngType.Greyscale;\n if (ctype === 2) return PngType.Truecolour;\n if (ctype === 3) return PngType.IndexedColour;\n if (ctype === 4) return PngType.GreyscaleWithAlpha;\n if (ctype === 6) return PngType.TruecolourWithAlpha;\n throw new Error(\"Unknown color type: \" + ctype);\n};\nvar splitAlphaChannel = function (rgbaChannel) {\n var pixelCount = Math.floor(rgbaChannel.length / 4);\n var rgbChannel = new Uint8Array(pixelCount * 3);\n var alphaChannel = new Uint8Array(pixelCount * 1);\n var rgbaOffset = 0;\n var rgbOffset = 0;\n var alphaOffset = 0;\n while (rgbaOffset < rgbaChannel.length) {\n rgbChannel[rgbOffset++] = rgbaChannel[rgbaOffset++];\n rgbChannel[rgbOffset++] = rgbaChannel[rgbaOffset++];\n rgbChannel[rgbOffset++] = rgbaChannel[rgbaOffset++];\n alphaChannel[alphaOffset++] = rgbaChannel[rgbaOffset++];\n }\n return {\n rgbChannel: rgbChannel,\n alphaChannel: alphaChannel\n };\n};\nexport var PngType;\n(function (PngType) {\n PngType[\"Greyscale\"] = \"Greyscale\";\n PngType[\"Truecolour\"] = \"Truecolour\";\n PngType[\"IndexedColour\"] = \"IndexedColour\";\n PngType[\"GreyscaleWithAlpha\"] = \"GreyscaleWithAlpha\";\n PngType[\"TruecolourWithAlpha\"] = \"TruecolourWithAlpha\";\n})(PngType || (PngType = {}));\nvar PNG = /** @class */function () {\n function PNG(pngData) {\n var upng = UPNG.decode(pngData);\n var frames = UPNG.toRGBA8(upng);\n if (frames.length > 1) throw new Error(\"Animated PNGs are not supported\");\n var frame = new Uint8Array(frames[0]);\n var _a = splitAlphaChannel(frame),\n rgbChannel = _a.rgbChannel,\n alphaChannel = _a.alphaChannel;\n this.rgbChannel = rgbChannel;\n var hasAlphaValues = alphaChannel.some(function (a) {\n return a < 255;\n });\n if (hasAlphaValues) this.alphaChannel = alphaChannel;\n this.type = getImageType(upng.ctype);\n this.width = upng.width;\n this.height = upng.height;\n this.bitsPerComponent = 8;\n }\n PNG.load = function (pngData) {\n return new PNG(pngData);\n };\n return PNG;\n}();\nexport { PNG };","import PDFArray from \"../objects/PDFArray\";\nimport PDFBool from \"../objects/PDFBool\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport { assertEachIs, assertInteger, assertIsOneOf, assertRange } from \"../../utils\";\nvar asEnum = function (rawValue, enumType) {\n if (rawValue === undefined) return undefined;\n return enumType[rawValue];\n};\nexport var NonFullScreenPageMode;\n(function (NonFullScreenPageMode) {\n /**\n * After exiting FullScreen mode, neither the document outline nor thumbnail\n * images should be visible.\n */\n NonFullScreenPageMode[\"UseNone\"] = \"UseNone\";\n /** After exiting FullScreen mode, the document outline should be visible. */\n NonFullScreenPageMode[\"UseOutlines\"] = \"UseOutlines\";\n /** After exiting FullScreen mode, thumbnail images should be visible. */\n NonFullScreenPageMode[\"UseThumbs\"] = \"UseThumbs\";\n /**\n * After exiting FullScreen mode, the optional content group panel should be\n * visible.\n */\n NonFullScreenPageMode[\"UseOC\"] = \"UseOC\";\n})(NonFullScreenPageMode || (NonFullScreenPageMode = {}));\nexport var ReadingDirection;\n(function (ReadingDirection) {\n /** The predominant reading order is Left to Right. */\n ReadingDirection[\"L2R\"] = \"L2R\";\n /**\n * The predominant reading order is Right to left (including vertical writing\n * systems, such as Chinese, Japanese and Korean).\n */\n ReadingDirection[\"R2L\"] = \"R2L\";\n})(ReadingDirection || (ReadingDirection = {}));\nexport var PrintScaling;\n(function (PrintScaling) {\n /** No page scaling. */\n PrintScaling[\"None\"] = \"None\";\n /* Use the PDF reader's default print scaling. */\n PrintScaling[\"AppDefault\"] = \"AppDefault\";\n})(PrintScaling || (PrintScaling = {}));\nexport var Duplex;\n(function (Duplex) {\n /** The PDF reader should print single-sided. */\n Duplex[\"Simplex\"] = \"Simplex\";\n /**\n * The PDF reader should print double sided and flip on the short edge of the\n * sheet.\n */\n Duplex[\"DuplexFlipShortEdge\"] = \"DuplexFlipShortEdge\";\n /**\n * The PDF reader should print double sided and flip on the long edge of the\n * sheet.\n */\n Duplex[\"DuplexFlipLongEdge\"] = \"DuplexFlipLongEdge\";\n})(Duplex || (Duplex = {}));\nvar ViewerPreferences = /** @class */function () {\n /** @ignore */\n function ViewerPreferences(dict) {\n this.dict = dict;\n }\n ViewerPreferences.prototype.lookupBool = function (key) {\n var returnObj = this.dict.lookup(PDFName.of(key));\n if (returnObj instanceof PDFBool) return returnObj;\n return undefined;\n };\n ViewerPreferences.prototype.lookupName = function (key) {\n var returnObj = this.dict.lookup(PDFName.of(key));\n if (returnObj instanceof PDFName) return returnObj;\n return undefined;\n };\n /** @ignore */\n ViewerPreferences.prototype.HideToolbar = function () {\n return this.lookupBool('HideToolbar');\n };\n /** @ignore */\n ViewerPreferences.prototype.HideMenubar = function () {\n return this.lookupBool('HideMenubar');\n };\n /** @ignore */\n ViewerPreferences.prototype.HideWindowUI = function () {\n return this.lookupBool('HideWindowUI');\n };\n /** @ignore */\n ViewerPreferences.prototype.FitWindow = function () {\n return this.lookupBool('FitWindow');\n };\n /** @ignore */\n ViewerPreferences.prototype.CenterWindow = function () {\n return this.lookupBool('CenterWindow');\n };\n /** @ignore */\n ViewerPreferences.prototype.DisplayDocTitle = function () {\n return this.lookupBool('DisplayDocTitle');\n };\n /** @ignore */\n ViewerPreferences.prototype.NonFullScreenPageMode = function () {\n return this.lookupName('NonFullScreenPageMode');\n };\n /** @ignore */\n ViewerPreferences.prototype.Direction = function () {\n return this.lookupName('Direction');\n };\n /** @ignore */\n ViewerPreferences.prototype.PrintScaling = function () {\n return this.lookupName('PrintScaling');\n };\n /** @ignore */\n ViewerPreferences.prototype.Duplex = function () {\n return this.lookupName('Duplex');\n };\n /** @ignore */\n ViewerPreferences.prototype.PickTrayByPDFSize = function () {\n return this.lookupBool('PickTrayByPDFSize');\n };\n /** @ignore */\n ViewerPreferences.prototype.PrintPageRange = function () {\n var PrintPageRange = this.dict.lookup(PDFName.of('PrintPageRange'));\n if (PrintPageRange instanceof PDFArray) return PrintPageRange;\n return undefined;\n };\n /** @ignore */\n ViewerPreferences.prototype.NumCopies = function () {\n var NumCopies = this.dict.lookup(PDFName.of('NumCopies'));\n if (NumCopies instanceof PDFNumber) return NumCopies;\n return undefined;\n };\n /**\n * Returns `true` if PDF readers should hide the toolbar menus when displaying\n * this document.\n * @returns Whether or not toolbars should be hidden.\n */\n ViewerPreferences.prototype.getHideToolbar = function () {\n var _a, _b;\n return (_b = (_a = this.HideToolbar()) === null || _a === void 0 ? void 0 : _a.asBoolean()) !== null && _b !== void 0 ? _b : false;\n };\n /**\n * Returns `true` if PDF readers should hide the menu bar when displaying this\n * document.\n * @returns Whether or not the menu bar should be hidden.\n */\n ViewerPreferences.prototype.getHideMenubar = function () {\n var _a, _b;\n return (_b = (_a = this.HideMenubar()) === null || _a === void 0 ? void 0 : _a.asBoolean()) !== null && _b !== void 0 ? _b : false;\n };\n /**\n * Returns `true` if PDF readers should hide the user interface elements in\n * the document's window (such as scroll bars and navigation controls),\n * leaving only the document's contents displayed.\n * @returns Whether or not user interface elements should be hidden.\n */\n ViewerPreferences.prototype.getHideWindowUI = function () {\n var _a, _b;\n return (_b = (_a = this.HideWindowUI()) === null || _a === void 0 ? void 0 : _a.asBoolean()) !== null && _b !== void 0 ? _b : false;\n };\n /**\n * Returns `true` if PDF readers should resize the document's window to fit\n * the size of the first displayed page.\n * @returns Whether or not the window should be resized to fit.\n */\n ViewerPreferences.prototype.getFitWindow = function () {\n var _a, _b;\n return (_b = (_a = this.FitWindow()) === null || _a === void 0 ? void 0 : _a.asBoolean()) !== null && _b !== void 0 ? _b : false;\n };\n /**\n * Returns `true` if PDF readers should position the document's window in the\n * center of the screen.\n * @returns Whether or not to center the document window.\n */\n ViewerPreferences.prototype.getCenterWindow = function () {\n var _a, _b;\n return (_b = (_a = this.CenterWindow()) === null || _a === void 0 ? void 0 : _a.asBoolean()) !== null && _b !== void 0 ? _b : false;\n };\n /**\n * Returns `true` if the window's title bar should display the document\n * `Title`, taken from the document metadata (see [[PDFDocument.getTitle]]).\n * Returns `false` if the title bar should instead display the filename of the\n * PDF file.\n * @returns Whether to display the document title.\n */\n ViewerPreferences.prototype.getDisplayDocTitle = function () {\n var _a, _b;\n return (_b = (_a = this.DisplayDocTitle()) === null || _a === void 0 ? void 0 : _a.asBoolean()) !== null && _b !== void 0 ? _b : false;\n };\n /**\n * Returns the page mode, which tells the PDF reader how to display the\n * document after exiting full-screen mode.\n * @returns The page mode after exiting full-screen mode.\n */\n ViewerPreferences.prototype.getNonFullScreenPageMode = function () {\n var _a, _b;\n var mode = (_a = this.NonFullScreenPageMode()) === null || _a === void 0 ? void 0 : _a.decodeText();\n return (_b = asEnum(mode, NonFullScreenPageMode)) !== null && _b !== void 0 ? _b : NonFullScreenPageMode.UseNone;\n };\n /**\n * Returns the predominant reading order for text.\n * @returns The text reading order.\n */\n ViewerPreferences.prototype.getReadingDirection = function () {\n var _a, _b;\n var direction = (_a = this.Direction()) === null || _a === void 0 ? void 0 : _a.decodeText();\n return (_b = asEnum(direction, ReadingDirection)) !== null && _b !== void 0 ? _b : ReadingDirection.L2R;\n };\n /**\n * Returns the page scaling option that the PDF reader should select when the\n * print dialog is displayed.\n * @returns The page scaling option.\n */\n ViewerPreferences.prototype.getPrintScaling = function () {\n var _a, _b;\n var scaling = (_a = this.PrintScaling()) === null || _a === void 0 ? void 0 : _a.decodeText();\n return (_b = asEnum(scaling, PrintScaling)) !== null && _b !== void 0 ? _b : PrintScaling.AppDefault;\n };\n /**\n * Returns the paper handling option that should be used when printing the\n * file from the print dialog.\n * @returns The paper handling option.\n */\n ViewerPreferences.prototype.getDuplex = function () {\n var _a;\n var duplex = (_a = this.Duplex()) === null || _a === void 0 ? void 0 : _a.decodeText();\n return asEnum(duplex, Duplex);\n };\n /**\n * Returns `true` if the PDF page size should be used to select the input\n * paper tray.\n * @returns Whether or not the PDF page size should be used to select the\n * input paper tray.\n */\n ViewerPreferences.prototype.getPickTrayByPDFSize = function () {\n var _a;\n return (_a = this.PickTrayByPDFSize()) === null || _a === void 0 ? void 0 : _a.asBoolean();\n };\n /**\n * Returns an array of page number ranges, which are the values used to\n * initialize the print dialog box when the file is printed. Each range\n * specifies the first (`start`) and last (`end`) pages in a sub-range of\n * pages to be printed. The first page of the PDF file is denoted by 0.\n * For example:\n * ```js\n * const viewerPrefs = pdfDoc.catalog.getOrCreateViewerPreferences()\n * const includesPage3 = viewerPrefs\n * .getPrintRanges()\n * .some(pr => pr.start =< 2 && pr.end >= 2)\n * if (includesPage3) console.log('printRange includes page 3')\n * ```\n * @returns An array of objects, each with the properties `start` and `end`,\n * denoting page indices. If not, specified an empty array is\n * returned.\n */\n ViewerPreferences.prototype.getPrintPageRange = function () {\n var rng = this.PrintPageRange();\n if (!rng) return [];\n var pageRanges = [];\n for (var i = 0; i < rng.size(); i += 2) {\n // Despite the spec clearly stating that \"The first page of the PDF file\n // shall be donoted by 1\", several test PDFs (spec 1.7) created in\n // Acrobat XI 11.0 and also read with Reader DC 2020.013 indicate this is\n // actually a 0 based index.\n var start = rng.lookup(i, PDFNumber).asNumber();\n var end = rng.lookup(i + 1, PDFNumber).asNumber();\n pageRanges.push({\n start: start,\n end: end\n });\n }\n return pageRanges;\n };\n /**\n * Returns the number of copies to be printed when the print dialog is opened\n * for this document.\n * @returns The default number of copies to be printed.\n */\n ViewerPreferences.prototype.getNumCopies = function () {\n var _a, _b;\n return (_b = (_a = this.NumCopies()) === null || _a === void 0 ? void 0 : _a.asNumber()) !== null && _b !== void 0 ? _b : 1;\n };\n /**\n * Choose whether the PDF reader's toolbars should be hidden while the\n * document is active.\n * @param hideToolbar `true` if the toolbar should be hidden.\n */\n ViewerPreferences.prototype.setHideToolbar = function (hideToolbar) {\n var HideToolbar = this.dict.context.obj(hideToolbar);\n this.dict.set(PDFName.of('HideToolbar'), HideToolbar);\n };\n /**\n * Choose whether the PDF reader's menu bar should be hidden while the\n * document is active.\n * @param hideMenubar `true` if the menu bar should be hidden.\n */\n ViewerPreferences.prototype.setHideMenubar = function (hideMenubar) {\n var HideMenubar = this.dict.context.obj(hideMenubar);\n this.dict.set(PDFName.of('HideMenubar'), HideMenubar);\n };\n /**\n * Choose whether the PDF reader should hide user interface elements in the\n * document's window (such as scroll bars and navigation controls), leaving\n * only the document's contents displayed.\n * @param hideWindowUI `true` if the user interface elements should be hidden.\n */\n ViewerPreferences.prototype.setHideWindowUI = function (hideWindowUI) {\n var HideWindowUI = this.dict.context.obj(hideWindowUI);\n this.dict.set(PDFName.of('HideWindowUI'), HideWindowUI);\n };\n /**\n * Choose whether the PDF reader should resize the document's window to fit\n * the size of the first displayed page.\n * @param fitWindow `true` if the window should be resized.\n */\n ViewerPreferences.prototype.setFitWindow = function (fitWindow) {\n var FitWindow = this.dict.context.obj(fitWindow);\n this.dict.set(PDFName.of('FitWindow'), FitWindow);\n };\n /**\n * Choose whether the PDF reader should position the document's window in the\n * center of the screen.\n * @param centerWindow `true` if the window should be centered.\n */\n ViewerPreferences.prototype.setCenterWindow = function (centerWindow) {\n var CenterWindow = this.dict.context.obj(centerWindow);\n this.dict.set(PDFName.of('CenterWindow'), CenterWindow);\n };\n /**\n * Choose whether the window's title bar should display the document `Title`\n * taken from the document metadata (see [[PDFDocument.setTitle]]). If\n * `false`, the title bar should instead display the PDF filename.\n * @param displayTitle `true` if the document title should be displayed.\n */\n ViewerPreferences.prototype.setDisplayDocTitle = function (displayTitle) {\n var DisplayDocTitle = this.dict.context.obj(displayTitle);\n this.dict.set(PDFName.of('DisplayDocTitle'), DisplayDocTitle);\n };\n /**\n * Choose how the PDF reader should display the document upon exiting\n * full-screen mode. This entry is meaningful only if the value of the\n * `PageMode` entry in the document's [[PDFCatalog]] is `FullScreen`.\n *\n * For example:\n * ```js\n * import { PDFDocument, NonFullScreenPageMode, PDFName } from 'pdf-lib'\n *\n * const pdfDoc = await PDFDocument.create()\n *\n * // Set the PageMode\n * pdfDoc.catalog.set(PDFName.of('PageMode'),PDFName.of('FullScreen'))\n *\n * // Set what happens when full-screen is closed\n * const viewerPrefs = pdfDoc.catalog.getOrCreateViewerPreferences()\n * viewerPrefs.setNonFullScreenPageMode(NonFullScreenPageMode.UseOutlines)\n * ```\n *\n * @param nonFullScreenPageMode How the document should be displayed upon\n * exiting full screen mode.\n */\n ViewerPreferences.prototype.setNonFullScreenPageMode = function (nonFullScreenPageMode) {\n assertIsOneOf(nonFullScreenPageMode, 'nonFullScreenPageMode', NonFullScreenPageMode);\n var mode = PDFName.of(nonFullScreenPageMode);\n this.dict.set(PDFName.of('NonFullScreenPageMode'), mode);\n };\n /**\n * Choose the predominant reading order for text.\n *\n * This entry has no direct effect on the document's contents or page\n * numbering, but may be used to determine the relative positioning of pages\n * when displayed side by side or printed n-up.\n *\n * For example:\n * ```js\n * import { PDFDocument, ReadingDirection } from 'pdf-lib'\n *\n * const pdfDoc = await PDFDocument.create()\n * const viewerPrefs = pdfDoc.catalog.getOrCreateViewerPreferences()\n * viewerPrefs.setReadingDirection(ReadingDirection.R2L)\n * ```\n *\n * @param readingDirection The reading order for text.\n */\n ViewerPreferences.prototype.setReadingDirection = function (readingDirection) {\n assertIsOneOf(readingDirection, 'readingDirection', ReadingDirection);\n var direction = PDFName.of(readingDirection);\n this.dict.set(PDFName.of('Direction'), direction);\n };\n /**\n * Choose the page scaling option that should be selected when a print dialog\n * is displayed for this document.\n *\n * For example:\n * ```js\n * import { PDFDocument, PrintScaling } from 'pdf-lib'\n *\n * const pdfDoc = await PDFDocument.create()\n * const viewerPrefs = pdfDoc.catalog.getOrCreateViewerPreferences()\n * viewerPrefs.setPrintScaling(PrintScaling.None)\n * ```\n *\n * @param printScaling The print scaling option.\n */\n ViewerPreferences.prototype.setPrintScaling = function (printScaling) {\n assertIsOneOf(printScaling, 'printScaling', PrintScaling);\n var scaling = PDFName.of(printScaling);\n this.dict.set(PDFName.of('PrintScaling'), scaling);\n };\n /**\n * Choose the paper handling option that should be selected by default in the\n * print dialog.\n *\n * For example:\n * ```js\n * import { PDFDocument, Duplex } from 'pdf-lib'\n *\n * const pdfDoc = await PDFDocument.create()\n * const viewerPrefs = pdfDoc.catalog.getOrCreateViewerPreferences()\n * viewerPrefs.setDuplex(Duplex.DuplexFlipShortEdge)\n * ```\n *\n * @param duplex The double or single sided printing option.\n */\n ViewerPreferences.prototype.setDuplex = function (duplex) {\n assertIsOneOf(duplex, 'duplex', Duplex);\n var dup = PDFName.of(duplex);\n this.dict.set(PDFName.of('Duplex'), dup);\n };\n /**\n * Choose whether the PDF document's page size should be used to select the\n * input paper tray when printing. This setting influences only the preset\n * values used to populate the print dialog presented by a PDF reader.\n *\n * If PickTrayByPDFSize is true, the check box in the print dialog associated\n * with input paper tray should be checked. This setting has no effect on\n * operating systems that do not provide the ability to pick the input tray\n * by size.\n *\n * @param pickTrayByPDFSize `true` if the document's page size should be used\n * to select the input paper tray.\n */\n ViewerPreferences.prototype.setPickTrayByPDFSize = function (pickTrayByPDFSize) {\n var PickTrayByPDFSize = this.dict.context.obj(pickTrayByPDFSize);\n this.dict.set(PDFName.of('PickTrayByPDFSize'), PickTrayByPDFSize);\n };\n /**\n * Choose the page numbers used to initialize the print dialog box when the\n * file is printed. The first page of the PDF file is denoted by 0.\n *\n * For example:\n * ```js\n * import { PDFDocument } from 'pdf-lib'\n *\n * const pdfDoc = await PDFDocument.create()\n * const viewerPrefs = pdfDoc.catalog.getOrCreateViewerPreferences()\n *\n * // We can set the default print range to only the first page\n * viewerPrefs.setPrintPageRange({ start: 0, end: 0 })\n *\n * // Or we can supply noncontiguous ranges (e.g. pages 1, 3, and 5-7)\n * viewerPrefs.setPrintPageRange([\n * { start: 0, end: 0 },\n * { start: 2, end: 2 },\n * { start: 4, end: 6 },\n * ])\n * ```\n *\n * @param printPageRange An object or array of objects, each with the\n * properties `start` and `end`, denoting a range of\n * page indices.\n */\n ViewerPreferences.prototype.setPrintPageRange = function (printPageRange) {\n if (!Array.isArray(printPageRange)) printPageRange = [printPageRange];\n var flatRange = [];\n for (var idx = 0, len = printPageRange.length; idx < len; idx++) {\n flatRange.push(printPageRange[idx].start);\n flatRange.push(printPageRange[idx].end);\n }\n assertEachIs(flatRange, 'printPageRange', ['number']);\n var pageRanges = this.dict.context.obj(flatRange);\n this.dict.set(PDFName.of('PrintPageRange'), pageRanges);\n };\n /**\n * Choose the default number of copies to be printed when the print dialog is\n * opened for this file.\n * @param numCopies The default number of copies.\n */\n ViewerPreferences.prototype.setNumCopies = function (numCopies) {\n assertRange(numCopies, 'numCopies', 1, Number.MAX_VALUE);\n assertInteger(numCopies, 'numCopies');\n var NumCopies = this.dict.context.obj(numCopies);\n this.dict.set(PDFName.of('NumCopies'), NumCopies);\n };\n /** @ignore */\n ViewerPreferences.fromDict = function (dict) {\n return new ViewerPreferences(dict);\n };\n /** @ignore */\n ViewerPreferences.create = function (context) {\n var dict = context.obj({});\n return new ViewerPreferences(dict);\n };\n return ViewerPreferences;\n}();\nexport default ViewerPreferences;","import { __awaiter, __generator } from \"tslib\";\nimport { PNG } from \"../../utils/png\";\n/**\n * A note of thanks to the developers of https://github.com/foliojs/pdfkit, as\n * this class borrows from:\n * https://github.com/devongovett/pdfkit/blob/e71edab0dd4657b5a767804ba86c94c58d01fbca/lib/image/png.coffee\n */\nvar PngEmbedder = /** @class */function () {\n function PngEmbedder(png) {\n this.image = png;\n this.bitsPerComponent = png.bitsPerComponent;\n this.width = png.width;\n this.height = png.height;\n this.colorSpace = 'DeviceRGB';\n }\n PngEmbedder.for = function (imageData) {\n return __awaiter(this, void 0, void 0, function () {\n var png;\n return __generator(this, function (_a) {\n png = PNG.load(imageData);\n return [2 /*return*/, new PngEmbedder(png)];\n });\n });\n };\n PngEmbedder.prototype.embedIntoContext = function (context, ref) {\n return __awaiter(this, void 0, void 0, function () {\n var SMask, xObject;\n return __generator(this, function (_a) {\n SMask = this.embedAlphaChannel(context);\n xObject = context.flateStream(this.image.rgbChannel, {\n Type: 'XObject',\n Subtype: 'Image',\n BitsPerComponent: this.image.bitsPerComponent,\n Width: this.image.width,\n Height: this.image.height,\n ColorSpace: this.colorSpace,\n SMask: SMask\n });\n if (ref) {\n context.assign(ref, xObject);\n return [2 /*return*/, ref];\n } else {\n return [2 /*return*/, context.register(xObject)];\n }\n return [2 /*return*/];\n });\n });\n };\n PngEmbedder.prototype.embedAlphaChannel = function (context) {\n if (!this.image.alphaChannel) return undefined;\n var xObject = context.flateStream(this.image.alphaChannel, {\n Type: 'XObject',\n Subtype: 'Image',\n Height: this.image.height,\n Width: this.image.width,\n BitsPerComponent: this.image.bitsPerComponent,\n ColorSpace: 'DeviceGray',\n Decode: [0, 1]\n });\n return context.register(xObject);\n };\n return PngEmbedder;\n}();\nexport default PngEmbedder;","/*\n * Copyright 2012 Mozilla Foundation\n *\n * The Stream class contained in this file is a TypeScript port of the\n * JavaScript Stream class in Mozilla's pdf.js project, made available\n * under the Apache 2.0 open source license.\n */\nvar Stream = /** @class */function () {\n function Stream(buffer, start, length) {\n this.bytes = buffer;\n this.start = start || 0;\n this.pos = this.start;\n this.end = !!start && !!length ? start + length : this.bytes.length;\n }\n Object.defineProperty(Stream.prototype, \"length\", {\n get: function () {\n return this.end - this.start;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Stream.prototype, \"isEmpty\", {\n get: function () {\n return this.length === 0;\n },\n enumerable: false,\n configurable: true\n });\n Stream.prototype.getByte = function () {\n if (this.pos >= this.end) {\n return -1;\n }\n return this.bytes[this.pos++];\n };\n Stream.prototype.getUint16 = function () {\n var b0 = this.getByte();\n var b1 = this.getByte();\n if (b0 === -1 || b1 === -1) {\n return -1;\n }\n return (b0 << 8) + b1;\n };\n Stream.prototype.getInt32 = function () {\n var b0 = this.getByte();\n var b1 = this.getByte();\n var b2 = this.getByte();\n var b3 = this.getByte();\n return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3;\n };\n // Returns subarray of original buffer, should only be read.\n Stream.prototype.getBytes = function (length, forceClamped) {\n if (forceClamped === void 0) {\n forceClamped = false;\n }\n var bytes = this.bytes;\n var pos = this.pos;\n var strEnd = this.end;\n if (!length) {\n var subarray = bytes.subarray(pos, strEnd);\n // `this.bytes` is always a `Uint8Array` here.\n return forceClamped ? new Uint8ClampedArray(subarray) : subarray;\n } else {\n var end = pos + length;\n if (end > strEnd) {\n end = strEnd;\n }\n this.pos = end;\n var subarray = bytes.subarray(pos, end);\n // `this.bytes` is always a `Uint8Array` here.\n return forceClamped ? new Uint8ClampedArray(subarray) : subarray;\n }\n };\n Stream.prototype.peekByte = function () {\n var peekedByte = this.getByte();\n this.pos--;\n return peekedByte;\n };\n Stream.prototype.peekBytes = function (length, forceClamped) {\n if (forceClamped === void 0) {\n forceClamped = false;\n }\n var bytes = this.getBytes(length, forceClamped);\n this.pos -= bytes.length;\n return bytes;\n };\n Stream.prototype.skip = function (n) {\n if (!n) {\n n = 1;\n }\n this.pos += n;\n };\n Stream.prototype.reset = function () {\n this.pos = this.start;\n };\n Stream.prototype.moveStart = function () {\n this.start = this.pos;\n };\n Stream.prototype.makeSubStream = function (start, length) {\n return new Stream(this.bytes, start, length);\n };\n Stream.prototype.decode = function () {\n return this.bytes;\n };\n return Stream;\n}();\nexport default Stream;","import { MethodNotImplementedError } from \"../errors\";\nimport Stream from \"./Stream\";\n/*\n * Copyright 2012 Mozilla Foundation\n *\n * The DecodeStream class contained in this file is a TypeScript port of the\n * JavaScript DecodeStream class in Mozilla's pdf.js project, made available\n * under the Apache 2.0 open source license.\n */\n// Lots of DecodeStreams are created whose buffers are never used. For these\n// we share a single empty buffer. This is (a) space-efficient and (b) avoids\n// having special cases that would be required if we used |null| for an empty\n// buffer.\nvar emptyBuffer = new Uint8Array(0);\n/**\n * Super class for the decoding streams\n */\nvar DecodeStream = /** @class */function () {\n function DecodeStream(maybeMinBufferLength) {\n this.pos = 0;\n this.bufferLength = 0;\n this.eof = false;\n this.buffer = emptyBuffer;\n this.minBufferLength = 512;\n if (maybeMinBufferLength) {\n // Compute the first power of two that is as big as maybeMinBufferLength.\n while (this.minBufferLength < maybeMinBufferLength) {\n this.minBufferLength *= 2;\n }\n }\n }\n Object.defineProperty(DecodeStream.prototype, \"isEmpty\", {\n get: function () {\n while (!this.eof && this.bufferLength === 0) {\n this.readBlock();\n }\n return this.bufferLength === 0;\n },\n enumerable: false,\n configurable: true\n });\n DecodeStream.prototype.getByte = function () {\n var pos = this.pos;\n while (this.bufferLength <= pos) {\n if (this.eof) {\n return -1;\n }\n this.readBlock();\n }\n return this.buffer[this.pos++];\n };\n DecodeStream.prototype.getUint16 = function () {\n var b0 = this.getByte();\n var b1 = this.getByte();\n if (b0 === -1 || b1 === -1) {\n return -1;\n }\n return (b0 << 8) + b1;\n };\n DecodeStream.prototype.getInt32 = function () {\n var b0 = this.getByte();\n var b1 = this.getByte();\n var b2 = this.getByte();\n var b3 = this.getByte();\n return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3;\n };\n DecodeStream.prototype.getBytes = function (length, forceClamped) {\n if (forceClamped === void 0) {\n forceClamped = false;\n }\n var end;\n var pos = this.pos;\n if (length) {\n this.ensureBuffer(pos + length);\n end = pos + length;\n while (!this.eof && this.bufferLength < end) {\n this.readBlock();\n }\n var bufEnd = this.bufferLength;\n if (end > bufEnd) {\n end = bufEnd;\n }\n } else {\n while (!this.eof) {\n this.readBlock();\n }\n end = this.bufferLength;\n }\n this.pos = end;\n var subarray = this.buffer.subarray(pos, end);\n // `this.buffer` is either a `Uint8Array` or `Uint8ClampedArray` here.\n return forceClamped && !(subarray instanceof Uint8ClampedArray) ? new Uint8ClampedArray(subarray) : subarray;\n };\n DecodeStream.prototype.peekByte = function () {\n var peekedByte = this.getByte();\n this.pos--;\n return peekedByte;\n };\n DecodeStream.prototype.peekBytes = function (length, forceClamped) {\n if (forceClamped === void 0) {\n forceClamped = false;\n }\n var bytes = this.getBytes(length, forceClamped);\n this.pos -= bytes.length;\n return bytes;\n };\n DecodeStream.prototype.skip = function (n) {\n if (!n) {\n n = 1;\n }\n this.pos += n;\n };\n DecodeStream.prototype.reset = function () {\n this.pos = 0;\n };\n DecodeStream.prototype.makeSubStream = function (start, length /* dict */) {\n var end = start + length;\n while (this.bufferLength <= end && !this.eof) {\n this.readBlock();\n }\n return new Stream(this.buffer, start, length /* dict */);\n };\n DecodeStream.prototype.decode = function () {\n while (!this.eof) this.readBlock();\n return this.buffer.subarray(0, this.bufferLength);\n };\n DecodeStream.prototype.readBlock = function () {\n throw new MethodNotImplementedError(this.constructor.name, 'readBlock');\n };\n DecodeStream.prototype.ensureBuffer = function (requested) {\n var buffer = this.buffer;\n if (requested <= buffer.byteLength) {\n return buffer;\n }\n var size = this.minBufferLength;\n while (size < requested) {\n size *= 2;\n }\n var buffer2 = new Uint8Array(size);\n buffer2.set(buffer);\n return this.buffer = buffer2;\n };\n return DecodeStream;\n}();\nexport default DecodeStream;","/*\n * Copyright 2012 Mozilla Foundation\n *\n * The Ascii85Stream class contained in this file is a TypeScript port of the\n * JavaScript Ascii85Stream class in Mozilla's pdf.js project, made available\n * under the Apache 2.0 open source license.\n */\nimport { __extends } from \"tslib\";\nimport DecodeStream from \"./DecodeStream\";\nvar isSpace = function (ch) {\n return ch === 0x20 || ch === 0x09 || ch === 0x0d || ch === 0x0a;\n};\nvar Ascii85Stream = /** @class */function (_super) {\n __extends(Ascii85Stream, _super);\n function Ascii85Stream(stream, maybeLength) {\n var _this = _super.call(this, maybeLength) || this;\n _this.stream = stream;\n _this.input = new Uint8Array(5);\n // Most streams increase in size when decoded, but Ascii85 streams\n // typically shrink by ~20%.\n if (maybeLength) {\n maybeLength = 0.8 * maybeLength;\n }\n return _this;\n }\n Ascii85Stream.prototype.readBlock = function () {\n var TILDA_CHAR = 0x7e; // '~'\n var Z_LOWER_CHAR = 0x7a; // 'z'\n var EOF = -1;\n var stream = this.stream;\n var c = stream.getByte();\n while (isSpace(c)) {\n c = stream.getByte();\n }\n if (c === EOF || c === TILDA_CHAR) {\n this.eof = true;\n return;\n }\n var bufferLength = this.bufferLength;\n var buffer;\n var i;\n // special code for z\n if (c === Z_LOWER_CHAR) {\n buffer = this.ensureBuffer(bufferLength + 4);\n for (i = 0; i < 4; ++i) {\n buffer[bufferLength + i] = 0;\n }\n this.bufferLength += 4;\n } else {\n var input = this.input;\n input[0] = c;\n for (i = 1; i < 5; ++i) {\n c = stream.getByte();\n while (isSpace(c)) {\n c = stream.getByte();\n }\n input[i] = c;\n if (c === EOF || c === TILDA_CHAR) {\n break;\n }\n }\n buffer = this.ensureBuffer(bufferLength + i - 1);\n this.bufferLength += i - 1;\n // partial ending;\n if (i < 5) {\n for (; i < 5; ++i) {\n input[i] = 0x21 + 84;\n }\n this.eof = true;\n }\n var t = 0;\n for (i = 0; i < 5; ++i) {\n t = t * 85 + (input[i] - 0x21);\n }\n for (i = 3; i >= 0; --i) {\n buffer[bufferLength + i] = t & 0xff;\n t >>= 8;\n }\n }\n };\n return Ascii85Stream;\n}(DecodeStream);\nexport default Ascii85Stream;","/*\n * Copyright 2012 Mozilla Foundation\n *\n * The AsciiHexStream class contained in this file is a TypeScript port of the\n * JavaScript AsciiHexStream class in Mozilla's pdf.js project, made available\n * under the Apache 2.0 open source license.\n */\nimport { __extends } from \"tslib\";\nimport DecodeStream from \"./DecodeStream\";\nvar AsciiHexStream = /** @class */function (_super) {\n __extends(AsciiHexStream, _super);\n function AsciiHexStream(stream, maybeLength) {\n var _this = _super.call(this, maybeLength) || this;\n _this.stream = stream;\n _this.firstDigit = -1;\n // Most streams increase in size when decoded, but AsciiHex streams shrink\n // by 50%.\n if (maybeLength) {\n maybeLength = 0.5 * maybeLength;\n }\n return _this;\n }\n AsciiHexStream.prototype.readBlock = function () {\n var UPSTREAM_BLOCK_SIZE = 8000;\n var bytes = this.stream.getBytes(UPSTREAM_BLOCK_SIZE);\n if (!bytes.length) {\n this.eof = true;\n return;\n }\n var maxDecodeLength = bytes.length + 1 >> 1;\n var buffer = this.ensureBuffer(this.bufferLength + maxDecodeLength);\n var bufferLength = this.bufferLength;\n var firstDigit = this.firstDigit;\n for (var i = 0, ii = bytes.length; i < ii; i++) {\n var ch = bytes[i];\n var digit = void 0;\n if (ch >= 0x30 && ch <= 0x39) {\n // '0'-'9'\n digit = ch & 0x0f;\n } else if (ch >= 0x41 && ch <= 0x46 || ch >= 0x61 && ch <= 0x66) {\n // 'A'-'Z', 'a'-'z'\n digit = (ch & 0x0f) + 9;\n } else if (ch === 0x3e) {\n // '>'\n this.eof = true;\n break;\n } else {\n // probably whitespace\n continue; // ignoring\n }\n if (firstDigit < 0) {\n firstDigit = digit;\n } else {\n buffer[bufferLength++] = firstDigit << 4 | digit;\n firstDigit = -1;\n }\n }\n if (firstDigit >= 0 && this.eof) {\n // incomplete byte\n buffer[bufferLength++] = firstDigit << 4;\n firstDigit = -1;\n }\n this.firstDigit = firstDigit;\n this.bufferLength = bufferLength;\n };\n return AsciiHexStream;\n}(DecodeStream);\nexport default AsciiHexStream;","/*\n * Copyright 1996-2003 Glyph & Cog, LLC\n *\n * The flate stream implementation contained in this file is a JavaScript port\n * of XPDF's implementation, made available under the Apache 2.0 open source\n * license.\n */\nimport { __extends } from \"tslib\";\n/*\n * Copyright 2012 Mozilla Foundation\n *\n * The FlateStream class contained in this file is a TypeScript port of the\n * JavaScript FlateStream class in Mozilla's pdf.js project, made available\n * under the Apache 2.0 open source license.\n */\n/* tslint:disable no-conditional-assignment */\nimport DecodeStream from \"./DecodeStream\";\n// prettier-ignore\nvar codeLenCodeMap = new Int32Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// prettier-ignore\nvar lengthDecode = new Int32Array([0x00003, 0x00004, 0x00005, 0x00006, 0x00007, 0x00008, 0x00009, 0x0000a, 0x1000b, 0x1000d, 0x1000f, 0x10011, 0x20013, 0x20017, 0x2001b, 0x2001f, 0x30023, 0x3002b, 0x30033, 0x3003b, 0x40043, 0x40053, 0x40063, 0x40073, 0x50083, 0x500a3, 0x500c3, 0x500e3, 0x00102, 0x00102, 0x00102]);\n// prettier-ignore\nvar distDecode = new Int32Array([0x00001, 0x00002, 0x00003, 0x00004, 0x10005, 0x10007, 0x20009, 0x2000d, 0x30011, 0x30019, 0x40021, 0x40031, 0x50041, 0x50061, 0x60081, 0x600c1, 0x70101, 0x70181, 0x80201, 0x80301, 0x90401, 0x90601, 0xa0801, 0xa0c01, 0xb1001, 0xb1801, 0xc2001, 0xc3001, 0xd4001, 0xd6001]);\n// prettier-ignore\nvar fixedLitCodeTab = [new Int32Array([0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c0, 0x70108, 0x80060, 0x80020, 0x900a0, 0x80000, 0x80080, 0x80040, 0x900e0, 0x70104, 0x80058, 0x80018, 0x90090, 0x70114, 0x80078, 0x80038, 0x900d0, 0x7010c, 0x80068, 0x80028, 0x900b0, 0x80008, 0x80088, 0x80048, 0x900f0, 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c8, 0x7010a, 0x80064, 0x80024, 0x900a8, 0x80004, 0x80084, 0x80044, 0x900e8, 0x70106, 0x8005c, 0x8001c, 0x90098, 0x70116, 0x8007c, 0x8003c, 0x900d8, 0x7010e, 0x8006c, 0x8002c, 0x900b8, 0x8000c, 0x8008c, 0x8004c, 0x900f8, 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c4, 0x70109, 0x80062, 0x80022, 0x900a4, 0x80002, 0x80082, 0x80042, 0x900e4, 0x70105, 0x8005a, 0x8001a, 0x90094, 0x70115, 0x8007a, 0x8003a, 0x900d4, 0x7010d, 0x8006a, 0x8002a, 0x900b4, 0x8000a, 0x8008a, 0x8004a, 0x900f4, 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cc, 0x7010b, 0x80066, 0x80026, 0x900ac, 0x80006, 0x80086, 0x80046, 0x900ec, 0x70107, 0x8005e, 0x8001e, 0x9009c, 0x70117, 0x8007e, 0x8003e, 0x900dc, 0x7010f, 0x8006e, 0x8002e, 0x900bc, 0x8000e, 0x8008e, 0x8004e, 0x900fc, 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c2, 0x70108, 0x80061, 0x80021, 0x900a2, 0x80001, 0x80081, 0x80041, 0x900e2, 0x70104, 0x80059, 0x80019, 0x90092, 0x70114, 0x80079, 0x80039, 0x900d2, 0x7010c, 0x80069, 0x80029, 0x900b2, 0x80009, 0x80089, 0x80049, 0x900f2, 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900ca, 0x7010a, 0x80065, 0x80025, 0x900aa, 0x80005, 0x80085, 0x80045, 0x900ea, 0x70106, 0x8005d, 0x8001d, 0x9009a, 0x70116, 0x8007d, 0x8003d, 0x900da, 0x7010e, 0x8006d, 0x8002d, 0x900ba, 0x8000d, 0x8008d, 0x8004d, 0x900fa, 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c6, 0x70109, 0x80063, 0x80023, 0x900a6, 0x80003, 0x80083, 0x80043, 0x900e6, 0x70105, 0x8005b, 0x8001b, 0x90096, 0x70115, 0x8007b, 0x8003b, 0x900d6, 0x7010d, 0x8006b, 0x8002b, 0x900b6, 0x8000b, 0x8008b, 0x8004b, 0x900f6, 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900ce, 0x7010b, 0x80067, 0x80027, 0x900ae, 0x80007, 0x80087, 0x80047, 0x900ee, 0x70107, 0x8005f, 0x8001f, 0x9009e, 0x70117, 0x8007f, 0x8003f, 0x900de, 0x7010f, 0x8006f, 0x8002f, 0x900be, 0x8000f, 0x8008f, 0x8004f, 0x900fe, 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c1, 0x70108, 0x80060, 0x80020, 0x900a1, 0x80000, 0x80080, 0x80040, 0x900e1, 0x70104, 0x80058, 0x80018, 0x90091, 0x70114, 0x80078, 0x80038, 0x900d1, 0x7010c, 0x80068, 0x80028, 0x900b1, 0x80008, 0x80088, 0x80048, 0x900f1, 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c9, 0x7010a, 0x80064, 0x80024, 0x900a9, 0x80004, 0x80084, 0x80044, 0x900e9, 0x70106, 0x8005c, 0x8001c, 0x90099, 0x70116, 0x8007c, 0x8003c, 0x900d9, 0x7010e, 0x8006c, 0x8002c, 0x900b9, 0x8000c, 0x8008c, 0x8004c, 0x900f9, 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c5, 0x70109, 0x80062, 0x80022, 0x900a5, 0x80002, 0x80082, 0x80042, 0x900e5, 0x70105, 0x8005a, 0x8001a, 0x90095, 0x70115, 0x8007a, 0x8003a, 0x900d5, 0x7010d, 0x8006a, 0x8002a, 0x900b5, 0x8000a, 0x8008a, 0x8004a, 0x900f5, 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cd, 0x7010b, 0x80066, 0x80026, 0x900ad, 0x80006, 0x80086, 0x80046, 0x900ed, 0x70107, 0x8005e, 0x8001e, 0x9009d, 0x70117, 0x8007e, 0x8003e, 0x900dd, 0x7010f, 0x8006e, 0x8002e, 0x900bd, 0x8000e, 0x8008e, 0x8004e, 0x900fd, 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c3, 0x70108, 0x80061, 0x80021, 0x900a3, 0x80001, 0x80081, 0x80041, 0x900e3, 0x70104, 0x80059, 0x80019, 0x90093, 0x70114, 0x80079, 0x80039, 0x900d3, 0x7010c, 0x80069, 0x80029, 0x900b3, 0x80009, 0x80089, 0x80049, 0x900f3, 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900cb, 0x7010a, 0x80065, 0x80025, 0x900ab, 0x80005, 0x80085, 0x80045, 0x900eb, 0x70106, 0x8005d, 0x8001d, 0x9009b, 0x70116, 0x8007d, 0x8003d, 0x900db, 0x7010e, 0x8006d, 0x8002d, 0x900bb, 0x8000d, 0x8008d, 0x8004d, 0x900fb, 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c7, 0x70109, 0x80063, 0x80023, 0x900a7, 0x80003, 0x80083, 0x80043, 0x900e7, 0x70105, 0x8005b, 0x8001b, 0x90097, 0x70115, 0x8007b, 0x8003b, 0x900d7, 0x7010d, 0x8006b, 0x8002b, 0x900b7, 0x8000b, 0x8008b, 0x8004b, 0x900f7, 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900cf, 0x7010b, 0x80067, 0x80027, 0x900af, 0x80007, 0x80087, 0x80047, 0x900ef, 0x70107, 0x8005f, 0x8001f, 0x9009f, 0x70117, 0x8007f, 0x8003f, 0x900df, 0x7010f, 0x8006f, 0x8002f, 0x900bf, 0x8000f, 0x8008f, 0x8004f, 0x900ff]), 9];\n// prettier-ignore\nvar fixedDistCodeTab = [new Int32Array([0x50000, 0x50010, 0x50008, 0x50018, 0x50004, 0x50014, 0x5000c, 0x5001c, 0x50002, 0x50012, 0x5000a, 0x5001a, 0x50006, 0x50016, 0x5000e, 0x00000, 0x50001, 0x50011, 0x50009, 0x50019, 0x50005, 0x50015, 0x5000d, 0x5001d, 0x50003, 0x50013, 0x5000b, 0x5001b, 0x50007, 0x50017, 0x5000f, 0x00000]), 5];\nvar FlateStream = /** @class */function (_super) {\n __extends(FlateStream, _super);\n function FlateStream(stream, maybeLength) {\n var _this = _super.call(this, maybeLength) || this;\n _this.stream = stream;\n var cmf = stream.getByte();\n var flg = stream.getByte();\n if (cmf === -1 || flg === -1) {\n throw new Error(\"Invalid header in flate stream: \" + cmf + \", \" + flg);\n }\n if ((cmf & 0x0f) !== 0x08) {\n throw new Error(\"Unknown compression method in flate stream: \" + cmf + \", \" + flg);\n }\n if (((cmf << 8) + flg) % 31 !== 0) {\n throw new Error(\"Bad FCHECK in flate stream: \" + cmf + \", \" + flg);\n }\n if (flg & 0x20) {\n throw new Error(\"FDICT bit set in flate stream: \" + cmf + \", \" + flg);\n }\n _this.codeSize = 0;\n _this.codeBuf = 0;\n return _this;\n }\n FlateStream.prototype.readBlock = function () {\n var buffer;\n var len;\n var str = this.stream;\n // read block header\n var hdr = this.getBits(3);\n if (hdr & 1) {\n this.eof = true;\n }\n hdr >>= 1;\n if (hdr === 0) {\n // uncompressed block\n var b = void 0;\n if ((b = str.getByte()) === -1) {\n throw new Error('Bad block header in flate stream');\n }\n var blockLen = b;\n if ((b = str.getByte()) === -1) {\n throw new Error('Bad block header in flate stream');\n }\n blockLen |= b << 8;\n if ((b = str.getByte()) === -1) {\n throw new Error('Bad block header in flate stream');\n }\n var check = b;\n if ((b = str.getByte()) === -1) {\n throw new Error('Bad block header in flate stream');\n }\n check |= b << 8;\n if (check !== (~blockLen & 0xffff) && (blockLen !== 0 || check !== 0)) {\n // Ignoring error for bad \"empty\" block (see issue 1277)\n throw new Error('Bad uncompressed block length in flate stream');\n }\n this.codeBuf = 0;\n this.codeSize = 0;\n var bufferLength = this.bufferLength;\n buffer = this.ensureBuffer(bufferLength + blockLen);\n var end = bufferLength + blockLen;\n this.bufferLength = end;\n if (blockLen === 0) {\n if (str.peekByte() === -1) {\n this.eof = true;\n }\n } else {\n for (var n = bufferLength; n < end; ++n) {\n if ((b = str.getByte()) === -1) {\n this.eof = true;\n break;\n }\n buffer[n] = b;\n }\n }\n return;\n }\n var litCodeTable;\n var distCodeTable;\n if (hdr === 1) {\n // compressed block, fixed codes\n litCodeTable = fixedLitCodeTab;\n distCodeTable = fixedDistCodeTab;\n } else if (hdr === 2) {\n // compressed block, dynamic codes\n var numLitCodes = this.getBits(5) + 257;\n var numDistCodes = this.getBits(5) + 1;\n var numCodeLenCodes = this.getBits(4) + 4;\n // build the code lengths code table\n var codeLenCodeLengths = new Uint8Array(codeLenCodeMap.length);\n var i = void 0;\n for (i = 0; i < numCodeLenCodes; ++i) {\n codeLenCodeLengths[codeLenCodeMap[i]] = this.getBits(3);\n }\n var codeLenCodeTab = this.generateHuffmanTable(codeLenCodeLengths);\n // build the literal and distance code tables\n len = 0;\n i = 0;\n var codes = numLitCodes + numDistCodes;\n var codeLengths = new Uint8Array(codes);\n var bitsLength = void 0;\n var bitsOffset = void 0;\n var what = void 0;\n while (i < codes) {\n var code = this.getCode(codeLenCodeTab);\n if (code === 16) {\n bitsLength = 2;\n bitsOffset = 3;\n what = len;\n } else if (code === 17) {\n bitsLength = 3;\n bitsOffset = 3;\n what = len = 0;\n } else if (code === 18) {\n bitsLength = 7;\n bitsOffset = 11;\n what = len = 0;\n } else {\n codeLengths[i++] = len = code;\n continue;\n }\n var repeatLength = this.getBits(bitsLength) + bitsOffset;\n while (repeatLength-- > 0) {\n codeLengths[i++] = what;\n }\n }\n litCodeTable = this.generateHuffmanTable(codeLengths.subarray(0, numLitCodes));\n distCodeTable = this.generateHuffmanTable(codeLengths.subarray(numLitCodes, codes));\n } else {\n throw new Error('Unknown block type in flate stream');\n }\n buffer = this.buffer;\n var limit = buffer ? buffer.length : 0;\n var pos = this.bufferLength;\n while (true) {\n var code1 = this.getCode(litCodeTable);\n if (code1 < 256) {\n if (pos + 1 >= limit) {\n buffer = this.ensureBuffer(pos + 1);\n limit = buffer.length;\n }\n buffer[pos++] = code1;\n continue;\n }\n if (code1 === 256) {\n this.bufferLength = pos;\n return;\n }\n code1 -= 257;\n code1 = lengthDecode[code1];\n var code2 = code1 >> 16;\n if (code2 > 0) {\n code2 = this.getBits(code2);\n }\n len = (code1 & 0xffff) + code2;\n code1 = this.getCode(distCodeTable);\n code1 = distDecode[code1];\n code2 = code1 >> 16;\n if (code2 > 0) {\n code2 = this.getBits(code2);\n }\n var dist = (code1 & 0xffff) + code2;\n if (pos + len >= limit) {\n buffer = this.ensureBuffer(pos + len);\n limit = buffer.length;\n }\n for (var k = 0; k < len; ++k, ++pos) {\n buffer[pos] = buffer[pos - dist];\n }\n }\n };\n FlateStream.prototype.getBits = function (bits) {\n var str = this.stream;\n var codeSize = this.codeSize;\n var codeBuf = this.codeBuf;\n var b;\n while (codeSize < bits) {\n if ((b = str.getByte()) === -1) {\n throw new Error('Bad encoding in flate stream');\n }\n codeBuf |= b << codeSize;\n codeSize += 8;\n }\n b = codeBuf & (1 << bits) - 1;\n this.codeBuf = codeBuf >> bits;\n this.codeSize = codeSize -= bits;\n return b;\n };\n FlateStream.prototype.getCode = function (table) {\n var str = this.stream;\n var codes = table[0];\n var maxLen = table[1];\n var codeSize = this.codeSize;\n var codeBuf = this.codeBuf;\n var b;\n while (codeSize < maxLen) {\n if ((b = str.getByte()) === -1) {\n // premature end of stream. code might however still be valid.\n // codeSize < codeLen check below guards against incomplete codeVal.\n break;\n }\n codeBuf |= b << codeSize;\n codeSize += 8;\n }\n var code = codes[codeBuf & (1 << maxLen) - 1];\n if (typeof codes === 'number') {\n console.log('FLATE:', code);\n }\n var codeLen = code >> 16;\n var codeVal = code & 0xffff;\n if (codeLen < 1 || codeSize < codeLen) {\n throw new Error('Bad encoding in flate stream');\n }\n this.codeBuf = codeBuf >> codeLen;\n this.codeSize = codeSize - codeLen;\n return codeVal;\n };\n FlateStream.prototype.generateHuffmanTable = function (lengths) {\n var n = lengths.length;\n // find max code length\n var maxLen = 0;\n var i;\n for (i = 0; i < n; ++i) {\n if (lengths[i] > maxLen) {\n maxLen = lengths[i];\n }\n }\n // build the table\n var size = 1 << maxLen;\n var codes = new Int32Array(size);\n for (var len = 1, code = 0, skip = 2; len <= maxLen; ++len, code <<= 1, skip <<= 1) {\n for (var val = 0; val < n; ++val) {\n if (lengths[val] === len) {\n // bit-reverse the code\n var code2 = 0;\n var t = code;\n for (i = 0; i < len; ++i) {\n code2 = code2 << 1 | t & 1;\n t >>= 1;\n }\n // fill the table entries\n for (i = code2; i < size; i += skip) {\n codes[i] = len << 16 | val;\n }\n ++code;\n }\n }\n }\n return [codes, maxLen];\n };\n return FlateStream;\n}(DecodeStream);\nexport default FlateStream;","/*\n * Copyright 2012 Mozilla Foundation\n *\n * The LZWStream class contained in this file is a TypeScript port of the\n * JavaScript LZWStream class in Mozilla's pdf.js project, made available\n * under the Apache 2.0 open source license.\n */\nimport { __extends } from \"tslib\";\nimport DecodeStream from \"./DecodeStream\";\nvar LZWStream = /** @class */function (_super) {\n __extends(LZWStream, _super);\n function LZWStream(stream, maybeLength, earlyChange) {\n var _this = _super.call(this, maybeLength) || this;\n _this.stream = stream;\n _this.cachedData = 0;\n _this.bitsCached = 0;\n var maxLzwDictionarySize = 4096;\n var lzwState = {\n earlyChange: earlyChange,\n codeLength: 9,\n nextCode: 258,\n dictionaryValues: new Uint8Array(maxLzwDictionarySize),\n dictionaryLengths: new Uint16Array(maxLzwDictionarySize),\n dictionaryPrevCodes: new Uint16Array(maxLzwDictionarySize),\n currentSequence: new Uint8Array(maxLzwDictionarySize),\n currentSequenceLength: 0\n };\n for (var i = 0; i < 256; ++i) {\n lzwState.dictionaryValues[i] = i;\n lzwState.dictionaryLengths[i] = 1;\n }\n _this.lzwState = lzwState;\n return _this;\n }\n LZWStream.prototype.readBlock = function () {\n var blockSize = 512;\n var estimatedDecodedSize = blockSize * 2;\n var decodedSizeDelta = blockSize;\n var i;\n var j;\n var q;\n var lzwState = this.lzwState;\n if (!lzwState) {\n return; // eof was found\n }\n var earlyChange = lzwState.earlyChange;\n var nextCode = lzwState.nextCode;\n var dictionaryValues = lzwState.dictionaryValues;\n var dictionaryLengths = lzwState.dictionaryLengths;\n var dictionaryPrevCodes = lzwState.dictionaryPrevCodes;\n var codeLength = lzwState.codeLength;\n var prevCode = lzwState.prevCode;\n var currentSequence = lzwState.currentSequence;\n var currentSequenceLength = lzwState.currentSequenceLength;\n var decodedLength = 0;\n var currentBufferLength = this.bufferLength;\n var buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize);\n for (i = 0; i < blockSize; i++) {\n var code = this.readBits(codeLength);\n var hasPrev = currentSequenceLength > 0;\n if (!code || code < 256) {\n currentSequence[0] = code;\n currentSequenceLength = 1;\n } else if (code >= 258) {\n if (code < nextCode) {\n currentSequenceLength = dictionaryLengths[code];\n for (j = currentSequenceLength - 1, q = code; j >= 0; j--) {\n currentSequence[j] = dictionaryValues[q];\n q = dictionaryPrevCodes[q];\n }\n } else {\n currentSequence[currentSequenceLength++] = currentSequence[0];\n }\n } else if (code === 256) {\n codeLength = 9;\n nextCode = 258;\n currentSequenceLength = 0;\n continue;\n } else {\n this.eof = true;\n delete this.lzwState;\n break;\n }\n if (hasPrev) {\n dictionaryPrevCodes[nextCode] = prevCode;\n dictionaryLengths[nextCode] = dictionaryLengths[prevCode] + 1;\n dictionaryValues[nextCode] = currentSequence[0];\n nextCode++;\n codeLength = nextCode + earlyChange & nextCode + earlyChange - 1 ? codeLength : Math.min(Math.log(nextCode + earlyChange) / 0.6931471805599453 + 1, 12) | 0;\n }\n prevCode = code;\n decodedLength += currentSequenceLength;\n if (estimatedDecodedSize < decodedLength) {\n do {\n estimatedDecodedSize += decodedSizeDelta;\n } while (estimatedDecodedSize < decodedLength);\n buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize);\n }\n for (j = 0; j < currentSequenceLength; j++) {\n buffer[currentBufferLength++] = currentSequence[j];\n }\n }\n lzwState.nextCode = nextCode;\n lzwState.codeLength = codeLength;\n lzwState.prevCode = prevCode;\n lzwState.currentSequenceLength = currentSequenceLength;\n this.bufferLength = currentBufferLength;\n };\n LZWStream.prototype.readBits = function (n) {\n var bitsCached = this.bitsCached;\n var cachedData = this.cachedData;\n while (bitsCached < n) {\n var c = this.stream.getByte();\n if (c === -1) {\n this.eof = true;\n return null;\n }\n cachedData = cachedData << 8 | c;\n bitsCached += 8;\n }\n this.bitsCached = bitsCached -= n;\n this.cachedData = cachedData;\n return cachedData >>> bitsCached & (1 << n) - 1;\n };\n return LZWStream;\n}(DecodeStream);\nexport default LZWStream;","/*\n * Copyright 2012 Mozilla Foundation\n *\n * The RunLengthStream class contained in this file is a TypeScript port of the\n * JavaScript RunLengthStream class in Mozilla's pdf.js project, made available\n * under the Apache 2.0 open source license.\n */\nimport { __extends } from \"tslib\";\nimport DecodeStream from \"./DecodeStream\";\nvar RunLengthStream = /** @class */function (_super) {\n __extends(RunLengthStream, _super);\n function RunLengthStream(stream, maybeLength) {\n var _this = _super.call(this, maybeLength) || this;\n _this.stream = stream;\n return _this;\n }\n RunLengthStream.prototype.readBlock = function () {\n // The repeatHeader has following format. The first byte defines type of run\n // and amount of bytes to repeat/copy: n = 0 through 127 - copy next n bytes\n // (in addition to the second byte from the header), n = 129 through 255 -\n // duplicate the second byte from the header (257 - n) times, n = 128 - end.\n var repeatHeader = this.stream.getBytes(2);\n if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] === 128) {\n this.eof = true;\n return;\n }\n var buffer;\n var bufferLength = this.bufferLength;\n var n = repeatHeader[0];\n if (n < 128) {\n // copy n bytes\n buffer = this.ensureBuffer(bufferLength + n + 1);\n buffer[bufferLength++] = repeatHeader[1];\n if (n > 0) {\n var source = this.stream.getBytes(n);\n buffer.set(source, bufferLength);\n bufferLength += n;\n }\n } else {\n n = 257 - n;\n var b = repeatHeader[1];\n buffer = this.ensureBuffer(bufferLength + n + 1);\n for (var i = 0; i < n; i++) {\n buffer[bufferLength++] = b;\n }\n }\n this.bufferLength = bufferLength;\n };\n return RunLengthStream;\n}(DecodeStream);\nexport default RunLengthStream;","import { UnexpectedObjectTypeError, UnsupportedEncodingError } from \"../errors\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport Ascii85Stream from \"./Ascii85Stream\";\nimport AsciiHexStream from \"./AsciiHexStream\";\nimport FlateStream from \"./FlateStream\";\nimport LZWStream from \"./LZWStream\";\nimport RunLengthStream from \"./RunLengthStream\";\nimport Stream from \"./Stream\";\nvar decodeStream = function (stream, encoding, params) {\n if (encoding === PDFName.of('FlateDecode')) {\n return new FlateStream(stream);\n }\n if (encoding === PDFName.of('LZWDecode')) {\n var earlyChange = 1;\n if (params instanceof PDFDict) {\n var EarlyChange = params.lookup(PDFName.of('EarlyChange'));\n if (EarlyChange instanceof PDFNumber) {\n earlyChange = EarlyChange.asNumber();\n }\n }\n return new LZWStream(stream, undefined, earlyChange);\n }\n if (encoding === PDFName.of('ASCII85Decode')) {\n return new Ascii85Stream(stream);\n }\n if (encoding === PDFName.of('ASCIIHexDecode')) {\n return new AsciiHexStream(stream);\n }\n if (encoding === PDFName.of('RunLengthDecode')) {\n return new RunLengthStream(stream);\n }\n throw new UnsupportedEncodingError(encoding.asString());\n};\nexport var decodePDFRawStream = function (_a) {\n var dict = _a.dict,\n contents = _a.contents;\n var stream = new Stream(contents);\n var Filter = dict.lookup(PDFName.of('Filter'));\n var DecodeParms = dict.lookup(PDFName.of('DecodeParms'));\n if (Filter instanceof PDFName) {\n stream = decodeStream(stream, Filter, DecodeParms);\n } else if (Filter instanceof PDFArray) {\n for (var idx = 0, len = Filter.size(); idx < len; idx++) {\n stream = decodeStream(stream, Filter.lookup(idx, PDFName), DecodeParms && DecodeParms.lookupMaybe(idx, PDFDict));\n }\n } else if (!!Filter) {\n throw new UnexpectedObjectTypeError([PDFName, PDFArray], Filter);\n }\n return stream;\n};","import { __awaiter, __generator } from \"tslib\";\nimport { MissingPageContentsEmbeddingError, UnrecognizedStreamTypeError } from \"../errors\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFRawStream from \"../objects/PDFRawStream\";\nimport PDFStream from \"../objects/PDFStream\";\nimport { decodePDFRawStream } from \"../streams/decode\";\nimport PDFContentStream from \"../structures/PDFContentStream\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { mergeIntoTypedArray } from \"../../utils\";\nvar fullPageBoundingBox = function (page) {\n var mediaBox = page.MediaBox();\n var width = mediaBox.lookup(2, PDFNumber).asNumber() - mediaBox.lookup(0, PDFNumber).asNumber();\n var height = mediaBox.lookup(3, PDFNumber).asNumber() - mediaBox.lookup(1, PDFNumber).asNumber();\n return {\n left: 0,\n bottom: 0,\n right: width,\n top: height\n };\n};\n// Returns the identity matrix, modified to position the content of the given\n// bounding box at (0, 0).\nvar boundingBoxAdjustedMatrix = function (bb) {\n return [1, 0, 0, 1, -bb.left, -bb.bottom];\n};\nvar PDFPageEmbedder = /** @class */function () {\n function PDFPageEmbedder(page, boundingBox, transformationMatrix) {\n this.page = page;\n var bb = boundingBox !== null && boundingBox !== void 0 ? boundingBox : fullPageBoundingBox(page);\n this.width = bb.right - bb.left;\n this.height = bb.top - bb.bottom;\n this.boundingBox = bb;\n this.transformationMatrix = transformationMatrix !== null && transformationMatrix !== void 0 ? transformationMatrix : boundingBoxAdjustedMatrix(bb);\n }\n PDFPageEmbedder.for = function (page, boundingBox, transformationMatrix) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, new PDFPageEmbedder(page, boundingBox, transformationMatrix)];\n });\n });\n };\n PDFPageEmbedder.prototype.embedIntoContext = function (context, ref) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, Contents, Resources, decodedContents, _b, left, bottom, right, top, xObject;\n return __generator(this, function (_c) {\n _a = this.page.normalizedEntries(), Contents = _a.Contents, Resources = _a.Resources;\n if (!Contents) throw new MissingPageContentsEmbeddingError();\n decodedContents = this.decodeContents(Contents);\n _b = this.boundingBox, left = _b.left, bottom = _b.bottom, right = _b.right, top = _b.top;\n xObject = context.flateStream(decodedContents, {\n Type: 'XObject',\n Subtype: 'Form',\n FormType: 1,\n BBox: [left, bottom, right, top],\n Matrix: this.transformationMatrix,\n Resources: Resources\n });\n if (ref) {\n context.assign(ref, xObject);\n return [2 /*return*/, ref];\n } else {\n return [2 /*return*/, context.register(xObject)];\n }\n return [2 /*return*/];\n });\n });\n };\n // `contents` is an array of streams which are merged to include them in the XObject.\n // This methods extracts each stream and joins them with a newline character.\n PDFPageEmbedder.prototype.decodeContents = function (contents) {\n var newline = Uint8Array.of(CharCodes.Newline);\n var decodedContents = [];\n for (var idx = 0, len = contents.size(); idx < len; idx++) {\n var stream = contents.lookup(idx, PDFStream);\n var content = void 0;\n if (stream instanceof PDFRawStream) {\n content = decodePDFRawStream(stream).decode();\n } else if (stream instanceof PDFContentStream) {\n content = stream.getUnencodedContents();\n } else {\n throw new UnrecognizedStreamTypeError(stream);\n }\n decodedContents.push(content, newline);\n }\n return mergeIntoTypedArray.apply(void 0, decodedContents);\n };\n return PDFPageEmbedder;\n}();\nexport default PDFPageEmbedder;","var flag = function (bitIndex) {\n return 1 << bitIndex;\n};\n/** From PDF spec table 221 */\nexport var AcroFieldFlags;\n(function (AcroFieldFlags) {\n /**\n * If set, the user may not change the value of the field. Any associated\n * widget annotations will not interact with the user; that is, they will not\n * respond to mouse clicks or change their appearance in response to mouse\n * motions. This flag is useful for fields whose values are computed or\n * imported from a database.\n */\n AcroFieldFlags[AcroFieldFlags[\"ReadOnly\"] = flag(1 - 1)] = \"ReadOnly\";\n /**\n * If set, the field shall have a value at the time it is exported by a\n * submit-form action (see 12.7.5.2, \"Submit-Form Action\").\n */\n AcroFieldFlags[AcroFieldFlags[\"Required\"] = flag(2 - 1)] = \"Required\";\n /**\n * If set, the field shall not be exported by a submit-form action\n * (see 12.7.5.2, \"Submit-Form Action\").\n */\n AcroFieldFlags[AcroFieldFlags[\"NoExport\"] = flag(3 - 1)] = \"NoExport\";\n})(AcroFieldFlags || (AcroFieldFlags = {}));\n/** From PDF spec table 226 */\nexport var AcroButtonFlags;\n(function (AcroButtonFlags) {\n /**\n * (Radio buttons only) If set, exactly one radio button shall be selected at\n * all times; selecting the currently selected button has no effect. If clear,\n * clicking the selected button deselects it, leaving no button selected.\n */\n AcroButtonFlags[AcroButtonFlags[\"NoToggleToOff\"] = flag(15 - 1)] = \"NoToggleToOff\";\n /**\n * If set, the field is a set of radio buttons; if clear, the field is a check\n * box. This flag may be set only if the Pushbutton flag is clear.\n */\n AcroButtonFlags[AcroButtonFlags[\"Radio\"] = flag(16 - 1)] = \"Radio\";\n /**\n * If set, the field is a pushbutton that does not retain a permanent value.\n */\n AcroButtonFlags[AcroButtonFlags[\"PushButton\"] = flag(17 - 1)] = \"PushButton\";\n /**\n * If set, a group of radio buttons within a radio button field that use the\n * same value for the on state will turn on and off in unison; that is if one\n * is checked, they are all checked. If clear, the buttons are mutually\n * exclusive (the same behavior as HTML radio buttons).\n */\n AcroButtonFlags[AcroButtonFlags[\"RadiosInUnison\"] = flag(26 - 1)] = \"RadiosInUnison\";\n})(AcroButtonFlags || (AcroButtonFlags = {}));\n/** From PDF spec table 228 */\nexport var AcroTextFlags;\n(function (AcroTextFlags) {\n /**\n * If set, the field may contain multiple lines of text; if clear, the field's\n * text shall be restricted to a single line.\n */\n AcroTextFlags[AcroTextFlags[\"Multiline\"] = flag(13 - 1)] = \"Multiline\";\n /**\n * If set, the field is intended for entering a secure password that should\n * not be echoed visibly to the screen. Characters typed from the keyboard\n * shall instead be echoed in some unreadable form, such as asterisks or\n * bullet characters.\n * > NOTE To protect password confidentiality, readers should never store\n * > the value of the text field in the PDF file if this flag is set.\n */\n AcroTextFlags[AcroTextFlags[\"Password\"] = flag(14 - 1)] = \"Password\";\n /**\n * If set, the text entered in the field represents the pathname of a file\n * whose contents shall be submitted as the value of the field.\n */\n AcroTextFlags[AcroTextFlags[\"FileSelect\"] = flag(21 - 1)] = \"FileSelect\";\n /**\n * If set, text entered in the field shall not be spell-checked.\n */\n AcroTextFlags[AcroTextFlags[\"DoNotSpellCheck\"] = flag(23 - 1)] = \"DoNotSpellCheck\";\n /**\n * If set, the field shall not scroll (horizontally for single-line fields,\n * vertically for multiple-line fields) to accommodate more text than fits\n * within its annotation rectangle. Once the field is full, no further text\n * shall be accepted for interactive form filling; for non-interactive form\n * filling, the filler should take care not to add more character than will\n * visibly fit in the defined area.\n */\n AcroTextFlags[AcroTextFlags[\"DoNotScroll\"] = flag(24 - 1)] = \"DoNotScroll\";\n /**\n * May be set only if the MaxLen entry is present in the text field dictionary\n * (see Table 229) and if the Multiline, Password, and FileSelect flags are\n * clear. If set, the field shall be automatically divided into as many\n * equally spaced positions, or combs, as the value of MaxLen, and the text\n * is laid out into those combs.\n */\n AcroTextFlags[AcroTextFlags[\"Comb\"] = flag(25 - 1)] = \"Comb\";\n /**\n * If set, the value of this field shall be a rich text string\n * (see 12.7.3.4, \"Rich Text Strings\"). If the field has a value, the RV\n * entry of the field dictionary (Table 222) shall specify the rich text\n * string.\n */\n AcroTextFlags[AcroTextFlags[\"RichText\"] = flag(26 - 1)] = \"RichText\";\n})(AcroTextFlags || (AcroTextFlags = {}));\n/** From PDF spec table 230 */\nexport var AcroChoiceFlags;\n(function (AcroChoiceFlags) {\n /**\n * If set, the field is a combo box; if clear, the field is a list box.\n */\n AcroChoiceFlags[AcroChoiceFlags[\"Combo\"] = flag(18 - 1)] = \"Combo\";\n /**\n * If set, the combo box shall include an editable text box as well as a\n * drop-down list; if clear, it shall include only a drop-down list. This\n * flag shall be used only if the Combo flag is set.\n */\n AcroChoiceFlags[AcroChoiceFlags[\"Edit\"] = flag(19 - 1)] = \"Edit\";\n /**\n * If set, the field's option items shall be sorted alphabetically. This flag\n * is intended for use by writers, not by readers. Conforming readers shall\n * display the options in the order in which they occur in the Opt array\n * (see Table 231).\n */\n AcroChoiceFlags[AcroChoiceFlags[\"Sort\"] = flag(20 - 1)] = \"Sort\";\n /**\n * If set, more than one of the field's option items may be selected\n * simultaneously; if clear, at most one item shall be selected.\n */\n AcroChoiceFlags[AcroChoiceFlags[\"MultiSelect\"] = flag(22 - 1)] = \"MultiSelect\";\n /**\n * If set, text entered in the field shall not be spell-checked. This flag\n * shall not be used unless the Combo and Edit flags are both set.\n */\n AcroChoiceFlags[AcroChoiceFlags[\"DoNotSpellCheck\"] = flag(23 - 1)] = \"DoNotSpellCheck\";\n /**\n * If set, the new value shall be committed as soon as a selection is made\n * (commonly with the pointing device). In this case, supplying a value for\n * a field involves three actions: selecting the field for fill-in,\n * selecting a choice for the fill-in value, and leaving that field, which\n * finalizes or \"commits\" the data choice and triggers any actions associated\n * with the entry or changing of this data. If this flag is on, then\n * processing does not wait for leaving the field action to occur, but\n * immediately proceeds to the third step.\n *\n * This option enables applications to perform an action once a selection is\n * made, without requiring the user to exit the field. If clear, the new\n * value is not committed until the user exits the field.\n */\n AcroChoiceFlags[AcroChoiceFlags[\"CommitOnSelChange\"] = flag(27 - 1)] = \"CommitOnSelChange\";\n})(AcroChoiceFlags || (AcroChoiceFlags = {}));","import PDFDict from \"../objects/PDFDict\";\nimport PDFString from \"../objects/PDFString\";\nimport PDFHexString from \"../objects/PDFHexString\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFRef from \"../objects/PDFRef\";\nimport { findLastMatch } from \"../../utils\";\nimport { MissingDAEntryError, MissingTfOperatorError } from \"../errors\";\n// Examples:\n// `/Helv 12 Tf` -> ['Helv', '12']\n// `/HeBo 8.00 Tf` -> ['HeBo', '8.00']\n// `/HeBo Tf` -> ['HeBo', undefined]\nvar tfRegex = /\\/([^\\0\\t\\n\\f\\r\\ ]+)[\\0\\t\\n\\f\\r\\ ]*(\\d*\\.\\d+|\\d+)?[\\0\\t\\n\\f\\r\\ ]+Tf/;\nvar PDFAcroField = /** @class */function () {\n function PDFAcroField(dict, ref) {\n this.dict = dict;\n this.ref = ref;\n }\n PDFAcroField.prototype.T = function () {\n return this.dict.lookupMaybe(PDFName.of('T'), PDFString, PDFHexString);\n };\n PDFAcroField.prototype.Ff = function () {\n var numberOrRef = this.getInheritableAttribute(PDFName.of('Ff'));\n return this.dict.context.lookupMaybe(numberOrRef, PDFNumber);\n };\n PDFAcroField.prototype.V = function () {\n var valueOrRef = this.getInheritableAttribute(PDFName.of('V'));\n return this.dict.context.lookup(valueOrRef);\n };\n PDFAcroField.prototype.Kids = function () {\n return this.dict.lookupMaybe(PDFName.of('Kids'), PDFArray);\n };\n // Parent(): PDFDict | undefined {\n // return this.dict.lookupMaybe(PDFName.of('Parent'), PDFDict);\n // }\n PDFAcroField.prototype.DA = function () {\n var da = this.dict.lookup(PDFName.of('DA'));\n if (da instanceof PDFString || da instanceof PDFHexString) return da;\n return undefined;\n };\n PDFAcroField.prototype.setKids = function (kids) {\n this.dict.set(PDFName.of('Kids'), this.dict.context.obj(kids));\n };\n PDFAcroField.prototype.getParent = function () {\n // const parent = this.Parent();\n // if (!parent) return undefined;\n // return new PDFAcroField(parent);\n var parentRef = this.dict.get(PDFName.of('Parent'));\n if (parentRef instanceof PDFRef) {\n var parent_1 = this.dict.lookup(PDFName.of('Parent'), PDFDict);\n return new PDFAcroField(parent_1, parentRef);\n }\n return undefined;\n };\n PDFAcroField.prototype.setParent = function (parent) {\n if (!parent) this.dict.delete(PDFName.of('Parent'));else this.dict.set(PDFName.of('Parent'), parent);\n };\n PDFAcroField.prototype.getFullyQualifiedName = function () {\n var parent = this.getParent();\n if (!parent) return this.getPartialName();\n return parent.getFullyQualifiedName() + \".\" + this.getPartialName();\n };\n PDFAcroField.prototype.getPartialName = function () {\n var _a;\n return (_a = this.T()) === null || _a === void 0 ? void 0 : _a.decodeText();\n };\n PDFAcroField.prototype.setPartialName = function (partialName) {\n if (!partialName) this.dict.delete(PDFName.of('T'));else this.dict.set(PDFName.of('T'), PDFHexString.fromText(partialName));\n };\n PDFAcroField.prototype.setDefaultAppearance = function (appearance) {\n this.dict.set(PDFName.of('DA'), PDFString.of(appearance));\n };\n PDFAcroField.prototype.getDefaultAppearance = function () {\n var DA = this.DA();\n if (DA instanceof PDFHexString) {\n return DA.decodeText();\n }\n return DA === null || DA === void 0 ? void 0 : DA.asString();\n };\n PDFAcroField.prototype.setFontSize = function (fontSize) {\n var _a;\n var name = (_a = this.getFullyQualifiedName()) !== null && _a !== void 0 ? _a : '';\n var da = this.getDefaultAppearance();\n if (!da) throw new MissingDAEntryError(name);\n var daMatch = findLastMatch(da, tfRegex);\n if (!daMatch.match) throw new MissingTfOperatorError(name);\n var daStart = da.slice(0, daMatch.pos - daMatch.match[0].length);\n var daEnd = daMatch.pos <= da.length ? da.slice(daMatch.pos) : '';\n var fontName = daMatch.match[1];\n var modifiedDa = daStart + \" /\" + fontName + \" \" + fontSize + \" Tf \" + daEnd;\n this.setDefaultAppearance(modifiedDa);\n };\n PDFAcroField.prototype.getFlags = function () {\n var _a, _b;\n return (_b = (_a = this.Ff()) === null || _a === void 0 ? void 0 : _a.asNumber()) !== null && _b !== void 0 ? _b : 0;\n };\n PDFAcroField.prototype.setFlags = function (flags) {\n this.dict.set(PDFName.of('Ff'), PDFNumber.of(flags));\n };\n PDFAcroField.prototype.hasFlag = function (flag) {\n var flags = this.getFlags();\n return (flags & flag) !== 0;\n };\n PDFAcroField.prototype.setFlag = function (flag) {\n var flags = this.getFlags();\n this.setFlags(flags | flag);\n };\n PDFAcroField.prototype.clearFlag = function (flag) {\n var flags = this.getFlags();\n this.setFlags(flags & ~flag);\n };\n PDFAcroField.prototype.setFlagTo = function (flag, enable) {\n if (enable) this.setFlag(flag);else this.clearFlag(flag);\n };\n PDFAcroField.prototype.getInheritableAttribute = function (name) {\n var attribute;\n this.ascend(function (node) {\n if (!attribute) attribute = node.dict.get(name);\n });\n return attribute;\n };\n PDFAcroField.prototype.ascend = function (visitor) {\n visitor(this);\n var parent = this.getParent();\n if (parent) parent.ascend(visitor);\n };\n return PDFAcroField;\n}();\nexport default PDFAcroField;","import PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\n// TODO: Also handle the `/S` and `/D` entries\nvar BorderStyle = /** @class */function () {\n function BorderStyle(dict) {\n this.dict = dict;\n }\n BorderStyle.prototype.W = function () {\n var W = this.dict.lookup(PDFName.of('W'));\n if (W instanceof PDFNumber) return W;\n return undefined;\n };\n BorderStyle.prototype.getWidth = function () {\n var _a, _b;\n return (_b = (_a = this.W()) === null || _a === void 0 ? void 0 : _a.asNumber()) !== null && _b !== void 0 ? _b : 1;\n };\n BorderStyle.prototype.setWidth = function (width) {\n var W = this.dict.context.obj(width);\n this.dict.set(PDFName.of('W'), W);\n };\n BorderStyle.fromDict = function (dict) {\n return new BorderStyle(dict);\n };\n return BorderStyle;\n}();\nexport default BorderStyle;","import PDFDict from \"../objects/PDFDict\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFStream from \"../objects/PDFStream\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFRef from \"../objects/PDFRef\";\nimport PDFNumber from \"../objects/PDFNumber\";\nvar PDFAnnotation = /** @class */function () {\n function PDFAnnotation(dict) {\n this.dict = dict;\n }\n // This is technically required by the PDF spec\n PDFAnnotation.prototype.Rect = function () {\n return this.dict.lookup(PDFName.of('Rect'), PDFArray);\n };\n PDFAnnotation.prototype.AP = function () {\n return this.dict.lookupMaybe(PDFName.of('AP'), PDFDict);\n };\n PDFAnnotation.prototype.F = function () {\n var numberOrRef = this.dict.lookup(PDFName.of('F'));\n return this.dict.context.lookupMaybe(numberOrRef, PDFNumber);\n };\n PDFAnnotation.prototype.getRectangle = function () {\n var _a;\n var Rect = this.Rect();\n return (_a = Rect === null || Rect === void 0 ? void 0 : Rect.asRectangle()) !== null && _a !== void 0 ? _a : {\n x: 0,\n y: 0,\n width: 0,\n height: 0\n };\n };\n PDFAnnotation.prototype.setRectangle = function (rect) {\n var x = rect.x,\n y = rect.y,\n width = rect.width,\n height = rect.height;\n var Rect = this.dict.context.obj([x, y, x + width, y + height]);\n this.dict.set(PDFName.of('Rect'), Rect);\n };\n PDFAnnotation.prototype.getAppearanceState = function () {\n var AS = this.dict.lookup(PDFName.of('AS'));\n if (AS instanceof PDFName) return AS;\n return undefined;\n };\n PDFAnnotation.prototype.setAppearanceState = function (state) {\n this.dict.set(PDFName.of('AS'), state);\n };\n PDFAnnotation.prototype.setAppearances = function (appearances) {\n this.dict.set(PDFName.of('AP'), appearances);\n };\n PDFAnnotation.prototype.ensureAP = function () {\n var AP = this.AP();\n if (!AP) {\n AP = this.dict.context.obj({});\n this.dict.set(PDFName.of('AP'), AP);\n }\n return AP;\n };\n PDFAnnotation.prototype.getNormalAppearance = function () {\n var AP = this.ensureAP();\n var N = AP.get(PDFName.of('N'));\n if (N instanceof PDFRef || N instanceof PDFDict) return N;\n throw new Error(\"Unexpected N type: \" + (N === null || N === void 0 ? void 0 : N.constructor.name));\n };\n /** @param appearance A PDFDict or PDFStream (direct or ref) */\n PDFAnnotation.prototype.setNormalAppearance = function (appearance) {\n var AP = this.ensureAP();\n AP.set(PDFName.of('N'), appearance);\n };\n /** @param appearance A PDFDict or PDFStream (direct or ref) */\n PDFAnnotation.prototype.setRolloverAppearance = function (appearance) {\n var AP = this.ensureAP();\n AP.set(PDFName.of('R'), appearance);\n };\n /** @param appearance A PDFDict or PDFStream (direct or ref) */\n PDFAnnotation.prototype.setDownAppearance = function (appearance) {\n var AP = this.ensureAP();\n AP.set(PDFName.of('D'), appearance);\n };\n PDFAnnotation.prototype.removeRolloverAppearance = function () {\n var AP = this.AP();\n AP === null || AP === void 0 ? void 0 : AP.delete(PDFName.of('R'));\n };\n PDFAnnotation.prototype.removeDownAppearance = function () {\n var AP = this.AP();\n AP === null || AP === void 0 ? void 0 : AP.delete(PDFName.of('D'));\n };\n PDFAnnotation.prototype.getAppearances = function () {\n var AP = this.AP();\n if (!AP) return undefined;\n var N = AP.lookup(PDFName.of('N'), PDFDict, PDFStream);\n var R = AP.lookupMaybe(PDFName.of('R'), PDFDict, PDFStream);\n var D = AP.lookupMaybe(PDFName.of('D'), PDFDict, PDFStream);\n return {\n normal: N,\n rollover: R,\n down: D\n };\n };\n PDFAnnotation.prototype.getFlags = function () {\n var _a, _b;\n return (_b = (_a = this.F()) === null || _a === void 0 ? void 0 : _a.asNumber()) !== null && _b !== void 0 ? _b : 0;\n };\n PDFAnnotation.prototype.setFlags = function (flags) {\n this.dict.set(PDFName.of('F'), PDFNumber.of(flags));\n };\n PDFAnnotation.prototype.hasFlag = function (flag) {\n var flags = this.getFlags();\n return (flags & flag) !== 0;\n };\n PDFAnnotation.prototype.setFlag = function (flag) {\n var flags = this.getFlags();\n this.setFlags(flags | flag);\n };\n PDFAnnotation.prototype.clearFlag = function (flag) {\n var flags = this.getFlags();\n this.setFlags(flags & ~flag);\n };\n PDFAnnotation.prototype.setFlagTo = function (flag, enable) {\n if (enable) this.setFlag(flag);else this.clearFlag(flag);\n };\n PDFAnnotation.fromDict = function (dict) {\n return new PDFAnnotation(dict);\n };\n return PDFAnnotation;\n}();\nexport default PDFAnnotation;","import PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFHexString from \"../objects/PDFHexString\";\nimport PDFString from \"../objects/PDFString\";\nvar AppearanceCharacteristics = /** @class */function () {\n function AppearanceCharacteristics(dict) {\n this.dict = dict;\n }\n AppearanceCharacteristics.prototype.R = function () {\n var R = this.dict.lookup(PDFName.of('R'));\n if (R instanceof PDFNumber) return R;\n return undefined;\n };\n AppearanceCharacteristics.prototype.BC = function () {\n var BC = this.dict.lookup(PDFName.of('BC'));\n if (BC instanceof PDFArray) return BC;\n return undefined;\n };\n AppearanceCharacteristics.prototype.BG = function () {\n var BG = this.dict.lookup(PDFName.of('BG'));\n if (BG instanceof PDFArray) return BG;\n return undefined;\n };\n AppearanceCharacteristics.prototype.CA = function () {\n var CA = this.dict.lookup(PDFName.of('CA'));\n if (CA instanceof PDFHexString || CA instanceof PDFString) return CA;\n return undefined;\n };\n AppearanceCharacteristics.prototype.RC = function () {\n var RC = this.dict.lookup(PDFName.of('RC'));\n if (RC instanceof PDFHexString || RC instanceof PDFString) return RC;\n return undefined;\n };\n AppearanceCharacteristics.prototype.AC = function () {\n var AC = this.dict.lookup(PDFName.of('AC'));\n if (AC instanceof PDFHexString || AC instanceof PDFString) return AC;\n return undefined;\n };\n AppearanceCharacteristics.prototype.getRotation = function () {\n var _a;\n return (_a = this.R()) === null || _a === void 0 ? void 0 : _a.asNumber();\n };\n AppearanceCharacteristics.prototype.getBorderColor = function () {\n var BC = this.BC();\n if (!BC) return undefined;\n var components = [];\n for (var idx = 0, len = BC === null || BC === void 0 ? void 0 : BC.size(); idx < len; idx++) {\n var component = BC.get(idx);\n if (component instanceof PDFNumber) components.push(component.asNumber());\n }\n return components;\n };\n AppearanceCharacteristics.prototype.getBackgroundColor = function () {\n var BG = this.BG();\n if (!BG) return undefined;\n var components = [];\n for (var idx = 0, len = BG === null || BG === void 0 ? void 0 : BG.size(); idx < len; idx++) {\n var component = BG.get(idx);\n if (component instanceof PDFNumber) components.push(component.asNumber());\n }\n return components;\n };\n AppearanceCharacteristics.prototype.getCaptions = function () {\n var CA = this.CA();\n var RC = this.RC();\n var AC = this.AC();\n return {\n normal: CA === null || CA === void 0 ? void 0 : CA.decodeText(),\n rollover: RC === null || RC === void 0 ? void 0 : RC.decodeText(),\n down: AC === null || AC === void 0 ? void 0 : AC.decodeText()\n };\n };\n AppearanceCharacteristics.prototype.setRotation = function (rotation) {\n var R = this.dict.context.obj(rotation);\n this.dict.set(PDFName.of('R'), R);\n };\n AppearanceCharacteristics.prototype.setBorderColor = function (color) {\n var BC = this.dict.context.obj(color);\n this.dict.set(PDFName.of('BC'), BC);\n };\n AppearanceCharacteristics.prototype.setBackgroundColor = function (color) {\n var BG = this.dict.context.obj(color);\n this.dict.set(PDFName.of('BG'), BG);\n };\n AppearanceCharacteristics.prototype.setCaptions = function (captions) {\n var CA = PDFHexString.fromText(captions.normal);\n this.dict.set(PDFName.of('CA'), CA);\n if (captions.rollover) {\n var RC = PDFHexString.fromText(captions.rollover);\n this.dict.set(PDFName.of('RC'), RC);\n } else {\n this.dict.delete(PDFName.of('RC'));\n }\n if (captions.down) {\n var AC = PDFHexString.fromText(captions.down);\n this.dict.set(PDFName.of('AC'), AC);\n } else {\n this.dict.delete(PDFName.of('AC'));\n }\n };\n AppearanceCharacteristics.fromDict = function (dict) {\n return new AppearanceCharacteristics(dict);\n };\n return AppearanceCharacteristics;\n}();\nexport default AppearanceCharacteristics;","import { __extends } from \"tslib\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFRef from \"../objects/PDFRef\";\nimport PDFString from \"../objects/PDFString\";\nimport PDFHexString from \"../objects/PDFHexString\";\nimport BorderStyle from \"./BorderStyle\";\nimport PDFAnnotation from \"./PDFAnnotation\";\nimport AppearanceCharacteristics from \"./AppearanceCharacteristics\";\nvar PDFWidgetAnnotation = /** @class */function (_super) {\n __extends(PDFWidgetAnnotation, _super);\n function PDFWidgetAnnotation() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFWidgetAnnotation.prototype.MK = function () {\n var MK = this.dict.lookup(PDFName.of('MK'));\n if (MK instanceof PDFDict) return MK;\n return undefined;\n };\n PDFWidgetAnnotation.prototype.BS = function () {\n var BS = this.dict.lookup(PDFName.of('BS'));\n if (BS instanceof PDFDict) return BS;\n return undefined;\n };\n PDFWidgetAnnotation.prototype.DA = function () {\n var da = this.dict.lookup(PDFName.of('DA'));\n if (da instanceof PDFString || da instanceof PDFHexString) return da;\n return undefined;\n };\n PDFWidgetAnnotation.prototype.P = function () {\n var P = this.dict.get(PDFName.of('P'));\n if (P instanceof PDFRef) return P;\n return undefined;\n };\n PDFWidgetAnnotation.prototype.setP = function (page) {\n this.dict.set(PDFName.of('P'), page);\n };\n PDFWidgetAnnotation.prototype.setDefaultAppearance = function (appearance) {\n this.dict.set(PDFName.of('DA'), PDFString.of(appearance));\n };\n PDFWidgetAnnotation.prototype.getDefaultAppearance = function () {\n var DA = this.DA();\n if (DA instanceof PDFHexString) {\n return DA.decodeText();\n }\n return DA === null || DA === void 0 ? void 0 : DA.asString();\n };\n PDFWidgetAnnotation.prototype.getAppearanceCharacteristics = function () {\n var MK = this.MK();\n if (MK) return AppearanceCharacteristics.fromDict(MK);\n return undefined;\n };\n PDFWidgetAnnotation.prototype.getOrCreateAppearanceCharacteristics = function () {\n var MK = this.MK();\n if (MK) return AppearanceCharacteristics.fromDict(MK);\n var ac = AppearanceCharacteristics.fromDict(this.dict.context.obj({}));\n this.dict.set(PDFName.of('MK'), ac.dict);\n return ac;\n };\n PDFWidgetAnnotation.prototype.getBorderStyle = function () {\n var BS = this.BS();\n if (BS) return BorderStyle.fromDict(BS);\n return undefined;\n };\n PDFWidgetAnnotation.prototype.getOrCreateBorderStyle = function () {\n var BS = this.BS();\n if (BS) return BorderStyle.fromDict(BS);\n var bs = BorderStyle.fromDict(this.dict.context.obj({}));\n this.dict.set(PDFName.of('BS'), bs.dict);\n return bs;\n };\n PDFWidgetAnnotation.prototype.getOnValue = function () {\n var _a;\n var normal = (_a = this.getAppearances()) === null || _a === void 0 ? void 0 : _a.normal;\n if (normal instanceof PDFDict) {\n var keys = normal.keys();\n for (var idx = 0, len = keys.length; idx < len; idx++) {\n var key = keys[idx];\n if (key !== PDFName.of('Off')) return key;\n }\n }\n return undefined;\n };\n PDFWidgetAnnotation.fromDict = function (dict) {\n return new PDFWidgetAnnotation(dict);\n };\n PDFWidgetAnnotation.create = function (context, parent) {\n var dict = context.obj({\n Type: 'Annot',\n Subtype: 'Widget',\n Rect: [0, 0, 0, 0],\n Parent: parent\n });\n return new PDFWidgetAnnotation(dict);\n };\n return PDFWidgetAnnotation;\n}(PDFAnnotation);\nexport default PDFWidgetAnnotation;","import { __extends } from \"tslib\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFAcroField from \"./PDFAcroField\";\nimport PDFWidgetAnnotation from \"../annotation/PDFWidgetAnnotation\";\nimport { IndexOutOfBoundsError } from \"../errors\";\nvar PDFAcroTerminal = /** @class */function (_super) {\n __extends(PDFAcroTerminal, _super);\n function PDFAcroTerminal() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFAcroTerminal.prototype.FT = function () {\n var nameOrRef = this.getInheritableAttribute(PDFName.of('FT'));\n return this.dict.context.lookup(nameOrRef, PDFName);\n };\n PDFAcroTerminal.prototype.getWidgets = function () {\n var kidDicts = this.Kids();\n // This field is itself a widget\n if (!kidDicts) return [PDFWidgetAnnotation.fromDict(this.dict)];\n // This field's kids are its widgets\n var widgets = new Array(kidDicts.size());\n for (var idx = 0, len = kidDicts.size(); idx < len; idx++) {\n var dict = kidDicts.lookup(idx, PDFDict);\n widgets[idx] = PDFWidgetAnnotation.fromDict(dict);\n }\n return widgets;\n };\n PDFAcroTerminal.prototype.addWidget = function (ref) {\n var Kids = this.normalizedEntries().Kids;\n Kids.push(ref);\n };\n PDFAcroTerminal.prototype.removeWidget = function (idx) {\n var kidDicts = this.Kids();\n if (!kidDicts) {\n // This field is itself a widget\n if (idx !== 0) throw new IndexOutOfBoundsError(idx, 0, 0);\n this.setKids([]);\n } else {\n // This field's kids are its widgets\n if (idx < 0 || idx > kidDicts.size()) {\n throw new IndexOutOfBoundsError(idx, 0, kidDicts.size());\n }\n kidDicts.remove(idx);\n }\n };\n PDFAcroTerminal.prototype.normalizedEntries = function () {\n var Kids = this.Kids();\n // If this field is itself a widget (because it was only rendered once in\n // the document, so the field and widget properties were merged) then we\n // add itself to the `Kids` array. The alternative would be to try\n // splitting apart the widget properties and creating a separate object\n // for them.\n if (!Kids) {\n Kids = this.dict.context.obj([this.ref]);\n this.dict.set(PDFName.of('Kids'), Kids);\n }\n return {\n Kids: Kids\n };\n };\n PDFAcroTerminal.fromDict = function (dict, ref) {\n return new PDFAcroTerminal(dict, ref);\n };\n return PDFAcroTerminal;\n}(PDFAcroField);\nexport default PDFAcroTerminal;","import { __extends } from \"tslib\";\nimport PDFString from \"../objects/PDFString\";\nimport PDFHexString from \"../objects/PDFHexString\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFAcroTerminal from \"./PDFAcroTerminal\";\nimport { IndexOutOfBoundsError } from \"../errors\";\nvar PDFAcroButton = /** @class */function (_super) {\n __extends(PDFAcroButton, _super);\n function PDFAcroButton() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFAcroButton.prototype.Opt = function () {\n return this.dict.lookupMaybe(PDFName.of('Opt'), PDFString, PDFHexString, PDFArray);\n };\n PDFAcroButton.prototype.setOpt = function (opt) {\n this.dict.set(PDFName.of('Opt'), this.dict.context.obj(opt));\n };\n PDFAcroButton.prototype.getExportValues = function () {\n var opt = this.Opt();\n if (!opt) return undefined;\n if (opt instanceof PDFString || opt instanceof PDFHexString) {\n return [opt];\n }\n var values = [];\n for (var idx = 0, len = opt.size(); idx < len; idx++) {\n var value = opt.lookup(idx);\n if (value instanceof PDFString || value instanceof PDFHexString) {\n values.push(value);\n }\n }\n return values;\n };\n PDFAcroButton.prototype.removeExportValue = function (idx) {\n var opt = this.Opt();\n if (!opt) return;\n if (opt instanceof PDFString || opt instanceof PDFHexString) {\n if (idx !== 0) throw new IndexOutOfBoundsError(idx, 0, 0);\n this.setOpt([]);\n } else {\n if (idx < 0 || idx > opt.size()) {\n throw new IndexOutOfBoundsError(idx, 0, opt.size());\n }\n opt.remove(idx);\n }\n };\n // Enforce use use of /Opt even if it isn't strictly necessary\n PDFAcroButton.prototype.normalizeExportValues = function () {\n var _a, _b, _c, _d;\n var exportValues = (_a = this.getExportValues()) !== null && _a !== void 0 ? _a : [];\n var Opt = [];\n var widgets = this.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var exportVal = (_b = exportValues[idx]) !== null && _b !== void 0 ? _b : PDFHexString.fromText((_d = (_c = widget.getOnValue()) === null || _c === void 0 ? void 0 : _c.decodeText()) !== null && _d !== void 0 ? _d : '');\n Opt.push(exportVal);\n }\n this.setOpt(Opt);\n };\n /**\n * Reuses existing opt if one exists with the same value (assuming\n * `useExistingIdx` is `true`). Returns index of existing (or new) opt.\n */\n PDFAcroButton.prototype.addOpt = function (opt, useExistingOptIdx) {\n var _a;\n this.normalizeExportValues();\n var optText = opt.decodeText();\n var existingIdx;\n if (useExistingOptIdx) {\n var exportValues = (_a = this.getExportValues()) !== null && _a !== void 0 ? _a : [];\n for (var idx = 0, len = exportValues.length; idx < len; idx++) {\n var exportVal = exportValues[idx];\n if (exportVal.decodeText() === optText) existingIdx = idx;\n }\n }\n var Opt = this.Opt();\n Opt.push(opt);\n return existingIdx !== null && existingIdx !== void 0 ? existingIdx : Opt.size() - 1;\n };\n PDFAcroButton.prototype.addWidgetWithOpt = function (widget, opt, useExistingOptIdx) {\n var optIdx = this.addOpt(opt, useExistingOptIdx);\n var apStateValue = PDFName.of(String(optIdx));\n this.addWidget(widget);\n return apStateValue;\n };\n return PDFAcroButton;\n}(PDFAcroTerminal);\nexport default PDFAcroButton;","import { __extends } from \"tslib\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFAcroButton from \"./PDFAcroButton\";\nimport { InvalidAcroFieldValueError } from \"../errors\";\nvar PDFAcroCheckBox = /** @class */function (_super) {\n __extends(PDFAcroCheckBox, _super);\n function PDFAcroCheckBox() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFAcroCheckBox.prototype.setValue = function (value) {\n var _a;\n var onValue = (_a = this.getOnValue()) !== null && _a !== void 0 ? _a : PDFName.of('Yes');\n if (value !== onValue && value !== PDFName.of('Off')) {\n throw new InvalidAcroFieldValueError();\n }\n this.dict.set(PDFName.of('V'), value);\n var widgets = this.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var state = widget.getOnValue() === value ? value : PDFName.of('Off');\n widget.setAppearanceState(state);\n }\n };\n PDFAcroCheckBox.prototype.getValue = function () {\n var v = this.V();\n if (v instanceof PDFName) return v;\n return PDFName.of('Off');\n };\n PDFAcroCheckBox.prototype.getOnValue = function () {\n var widget = this.getWidgets()[0];\n return widget === null || widget === void 0 ? void 0 : widget.getOnValue();\n };\n PDFAcroCheckBox.fromDict = function (dict, ref) {\n return new PDFAcroCheckBox(dict, ref);\n };\n PDFAcroCheckBox.create = function (context) {\n var dict = context.obj({\n FT: 'Btn',\n Kids: []\n });\n var ref = context.register(dict);\n return new PDFAcroCheckBox(dict, ref);\n };\n return PDFAcroCheckBox;\n}(PDFAcroButton);\nexport default PDFAcroCheckBox;","import { __extends } from \"tslib\";\nimport PDFAcroTerminal from \"./PDFAcroTerminal\";\nimport PDFHexString from \"../objects/PDFHexString\";\nimport PDFString from \"../objects/PDFString\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFName from \"../objects/PDFName\";\nimport { AcroChoiceFlags } from \"./flags\";\nimport { InvalidAcroFieldValueError, MultiSelectValueError } from \"../errors\";\nvar PDFAcroChoice = /** @class */function (_super) {\n __extends(PDFAcroChoice, _super);\n function PDFAcroChoice() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFAcroChoice.prototype.setValues = function (values) {\n if (this.hasFlag(AcroChoiceFlags.Combo) && !this.hasFlag(AcroChoiceFlags.Edit) && !this.valuesAreValid(values)) {\n throw new InvalidAcroFieldValueError();\n }\n if (values.length === 0) {\n this.dict.delete(PDFName.of('V'));\n }\n if (values.length === 1) {\n this.dict.set(PDFName.of('V'), values[0]);\n }\n if (values.length > 1) {\n if (!this.hasFlag(AcroChoiceFlags.MultiSelect)) {\n throw new MultiSelectValueError();\n }\n this.dict.set(PDFName.of('V'), this.dict.context.obj(values));\n }\n this.updateSelectedIndices(values);\n };\n PDFAcroChoice.prototype.valuesAreValid = function (values) {\n var options = this.getOptions();\n var _loop_1 = function (idx, len) {\n var val = values[idx].decodeText();\n if (!options.find(function (o) {\n return val === (o.display || o.value).decodeText();\n })) {\n return {\n value: false\n };\n }\n };\n for (var idx = 0, len = values.length; idx < len; idx++) {\n var state_1 = _loop_1(idx, len);\n if (typeof state_1 === \"object\") return state_1.value;\n }\n return true;\n };\n PDFAcroChoice.prototype.updateSelectedIndices = function (values) {\n if (values.length > 1) {\n var indices = new Array(values.length);\n var options = this.getOptions();\n var _loop_2 = function (idx, len) {\n var val = values[idx].decodeText();\n indices[idx] = options.findIndex(function (o) {\n return val === (o.display || o.value).decodeText();\n });\n };\n for (var idx = 0, len = values.length; idx < len; idx++) {\n _loop_2(idx, len);\n }\n this.dict.set(PDFName.of('I'), this.dict.context.obj(indices.sort()));\n } else {\n this.dict.delete(PDFName.of('I'));\n }\n };\n PDFAcroChoice.prototype.getValues = function () {\n var v = this.V();\n if (v instanceof PDFString || v instanceof PDFHexString) return [v];\n if (v instanceof PDFArray) {\n var values = [];\n for (var idx = 0, len = v.size(); idx < len; idx++) {\n var value = v.lookup(idx);\n if (value instanceof PDFString || value instanceof PDFHexString) {\n values.push(value);\n }\n }\n return values;\n }\n return [];\n };\n PDFAcroChoice.prototype.Opt = function () {\n return this.dict.lookupMaybe(PDFName.of('Opt'), PDFString, PDFHexString, PDFArray);\n };\n PDFAcroChoice.prototype.setOptions = function (options) {\n var newOpt = new Array(options.length);\n for (var idx = 0, len = options.length; idx < len; idx++) {\n var _a = options[idx],\n value = _a.value,\n display = _a.display;\n newOpt[idx] = this.dict.context.obj([value, display || value]);\n }\n this.dict.set(PDFName.of('Opt'), this.dict.context.obj(newOpt));\n };\n PDFAcroChoice.prototype.getOptions = function () {\n var Opt = this.Opt();\n // Not supposed to happen - Opt _should_ always be `PDFArray | undefined`\n if (Opt instanceof PDFString || Opt instanceof PDFHexString) {\n return [{\n value: Opt,\n display: Opt\n }];\n }\n if (Opt instanceof PDFArray) {\n var res = [];\n for (var idx = 0, len = Opt.size(); idx < len; idx++) {\n var item = Opt.lookup(idx);\n // If `item` is a string, use that as both the export and text value\n if (item instanceof PDFString || item instanceof PDFHexString) {\n res.push({\n value: item,\n display: item\n });\n }\n // If `item` is an array of one, treat it the same as just a string,\n // if it's an array of two then `item[0]` is the export value and\n // `item[1]` is the text value\n if (item instanceof PDFArray) {\n if (item.size() > 0) {\n var first = item.lookup(0, PDFString, PDFHexString);\n var second = item.lookupMaybe(1, PDFString, PDFHexString);\n res.push({\n value: first,\n display: second || first\n });\n }\n }\n }\n return res;\n }\n return [];\n };\n return PDFAcroChoice;\n}(PDFAcroTerminal);\nexport default PDFAcroChoice;","import { __extends } from \"tslib\";\nimport PDFAcroChoice from \"./PDFAcroChoice\";\nimport { AcroChoiceFlags } from \"./flags\";\nvar PDFAcroComboBox = /** @class */function (_super) {\n __extends(PDFAcroComboBox, _super);\n function PDFAcroComboBox() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFAcroComboBox.fromDict = function (dict, ref) {\n return new PDFAcroComboBox(dict, ref);\n };\n PDFAcroComboBox.create = function (context) {\n var dict = context.obj({\n FT: 'Ch',\n Ff: AcroChoiceFlags.Combo,\n Kids: []\n });\n var ref = context.register(dict);\n return new PDFAcroComboBox(dict, ref);\n };\n return PDFAcroComboBox;\n}(PDFAcroChoice);\nexport default PDFAcroComboBox;","import { __extends } from \"tslib\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFAcroField from \"./PDFAcroField\";\nvar PDFAcroNonTerminal = /** @class */function (_super) {\n __extends(PDFAcroNonTerminal, _super);\n function PDFAcroNonTerminal() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFAcroNonTerminal.prototype.addField = function (field) {\n var Kids = this.normalizedEntries().Kids;\n Kids === null || Kids === void 0 ? void 0 : Kids.push(field);\n };\n PDFAcroNonTerminal.prototype.normalizedEntries = function () {\n var Kids = this.Kids();\n if (!Kids) {\n Kids = this.dict.context.obj([]);\n this.dict.set(PDFName.of('Kids'), Kids);\n }\n return {\n Kids: Kids\n };\n };\n PDFAcroNonTerminal.fromDict = function (dict, ref) {\n return new PDFAcroNonTerminal(dict, ref);\n };\n PDFAcroNonTerminal.create = function (context) {\n var dict = context.obj({});\n var ref = context.register(dict);\n return new PDFAcroNonTerminal(dict, ref);\n };\n return PDFAcroNonTerminal;\n}(PDFAcroField);\nexport default PDFAcroNonTerminal;","import { __extends } from \"tslib\";\nimport PDFAcroTerminal from \"./PDFAcroTerminal\";\nvar PDFAcroSignature = /** @class */function (_super) {\n __extends(PDFAcroSignature, _super);\n function PDFAcroSignature() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFAcroSignature.fromDict = function (dict, ref) {\n return new PDFAcroSignature(dict, ref);\n };\n return PDFAcroSignature;\n}(PDFAcroTerminal);\nexport default PDFAcroSignature;","import { __extends } from \"tslib\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFString from \"../objects/PDFString\";\nimport PDFHexString from \"../objects/PDFHexString\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFAcroTerminal from \"./PDFAcroTerminal\";\nvar PDFAcroText = /** @class */function (_super) {\n __extends(PDFAcroText, _super);\n function PDFAcroText() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFAcroText.prototype.MaxLen = function () {\n var maxLen = this.dict.lookup(PDFName.of('MaxLen'));\n if (maxLen instanceof PDFNumber) return maxLen;\n return undefined;\n };\n PDFAcroText.prototype.Q = function () {\n var q = this.dict.lookup(PDFName.of('Q'));\n if (q instanceof PDFNumber) return q;\n return undefined;\n };\n PDFAcroText.prototype.setMaxLength = function (maxLength) {\n this.dict.set(PDFName.of('MaxLen'), PDFNumber.of(maxLength));\n };\n PDFAcroText.prototype.removeMaxLength = function () {\n this.dict.delete(PDFName.of('MaxLen'));\n };\n PDFAcroText.prototype.getMaxLength = function () {\n var _a;\n return (_a = this.MaxLen()) === null || _a === void 0 ? void 0 : _a.asNumber();\n };\n PDFAcroText.prototype.setQuadding = function (quadding) {\n this.dict.set(PDFName.of('Q'), PDFNumber.of(quadding));\n };\n PDFAcroText.prototype.getQuadding = function () {\n var _a;\n return (_a = this.Q()) === null || _a === void 0 ? void 0 : _a.asNumber();\n };\n PDFAcroText.prototype.setValue = function (value) {\n this.dict.set(PDFName.of('V'), value);\n // const widgets = this.getWidgets();\n // for (let idx = 0, len = widgets.length; idx < len; idx++) {\n // const widget = widgets[idx];\n // const state = widget.getOnValue() === value ? value : PDFName.of('Off');\n // widget.setAppearanceState(state);\n // }\n };\n PDFAcroText.prototype.removeValue = function () {\n this.dict.delete(PDFName.of('V'));\n };\n PDFAcroText.prototype.getValue = function () {\n var v = this.V();\n if (v instanceof PDFString || v instanceof PDFHexString) return v;\n return undefined;\n };\n PDFAcroText.fromDict = function (dict, ref) {\n return new PDFAcroText(dict, ref);\n };\n PDFAcroText.create = function (context) {\n var dict = context.obj({\n FT: 'Tx',\n Kids: []\n });\n var ref = context.register(dict);\n return new PDFAcroText(dict, ref);\n };\n return PDFAcroText;\n}(PDFAcroTerminal);\nexport default PDFAcroText;","import { __extends } from \"tslib\";\nimport PDFAcroButton from \"./PDFAcroButton\";\nimport { AcroButtonFlags } from \"./flags\";\nvar PDFAcroPushButton = /** @class */function (_super) {\n __extends(PDFAcroPushButton, _super);\n function PDFAcroPushButton() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFAcroPushButton.fromDict = function (dict, ref) {\n return new PDFAcroPushButton(dict, ref);\n };\n PDFAcroPushButton.create = function (context) {\n var dict = context.obj({\n FT: 'Btn',\n Ff: AcroButtonFlags.PushButton,\n Kids: []\n });\n var ref = context.register(dict);\n return new PDFAcroPushButton(dict, ref);\n };\n return PDFAcroPushButton;\n}(PDFAcroButton);\nexport default PDFAcroPushButton;","import { __extends } from \"tslib\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFAcroButton from \"./PDFAcroButton\";\nimport { AcroButtonFlags } from \"./flags\";\nimport { InvalidAcroFieldValueError } from \"../errors\";\nvar PDFAcroRadioButton = /** @class */function (_super) {\n __extends(PDFAcroRadioButton, _super);\n function PDFAcroRadioButton() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFAcroRadioButton.prototype.setValue = function (value) {\n var onValues = this.getOnValues();\n if (!onValues.includes(value) && value !== PDFName.of('Off')) {\n throw new InvalidAcroFieldValueError();\n }\n this.dict.set(PDFName.of('V'), value);\n var widgets = this.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var state = widget.getOnValue() === value ? value : PDFName.of('Off');\n widget.setAppearanceState(state);\n }\n };\n PDFAcroRadioButton.prototype.getValue = function () {\n var v = this.V();\n if (v instanceof PDFName) return v;\n return PDFName.of('Off');\n };\n PDFAcroRadioButton.prototype.getOnValues = function () {\n var widgets = this.getWidgets();\n var onValues = [];\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var onValue = widgets[idx].getOnValue();\n if (onValue) onValues.push(onValue);\n }\n return onValues;\n };\n PDFAcroRadioButton.fromDict = function (dict, ref) {\n return new PDFAcroRadioButton(dict, ref);\n };\n PDFAcroRadioButton.create = function (context) {\n var dict = context.obj({\n FT: 'Btn',\n Ff: AcroButtonFlags.Radio,\n Kids: []\n });\n var ref = context.register(dict);\n return new PDFAcroRadioButton(dict, ref);\n };\n return PDFAcroRadioButton;\n}(PDFAcroButton);\nexport default PDFAcroRadioButton;","import { __extends } from \"tslib\";\nimport PDFAcroChoice from \"./PDFAcroChoice\";\nvar PDFAcroListBox = /** @class */function (_super) {\n __extends(PDFAcroListBox, _super);\n function PDFAcroListBox() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFAcroListBox.fromDict = function (dict, ref) {\n return new PDFAcroListBox(dict, ref);\n };\n PDFAcroListBox.create = function (context) {\n var dict = context.obj({\n FT: 'Ch',\n Kids: []\n });\n var ref = context.register(dict);\n return new PDFAcroListBox(dict, ref);\n };\n return PDFAcroListBox;\n}(PDFAcroChoice);\nexport default PDFAcroListBox;","import PDFNumber from \"../objects/PDFNumber\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFRef from \"../objects/PDFRef\";\nimport PDFAcroTerminal from \"./PDFAcroTerminal\";\nimport PDFAcroNonTerminal from \"./PDFAcroNonTerminal\";\nimport PDFAcroSignature from \"./PDFAcroSignature\";\nimport PDFAcroText from \"./PDFAcroText\";\nimport PDFAcroPushButton from \"./PDFAcroPushButton\";\nimport PDFAcroRadioButton from \"./PDFAcroRadioButton\";\nimport PDFAcroCheckBox from \"./PDFAcroCheckBox\";\nimport PDFAcroComboBox from \"./PDFAcroComboBox\";\nimport PDFAcroListBox from \"./PDFAcroListBox\";\nimport { AcroButtonFlags, AcroChoiceFlags } from \"./flags\";\nexport var createPDFAcroFields = function (kidDicts) {\n if (!kidDicts) return [];\n var kids = [];\n for (var idx = 0, len = kidDicts.size(); idx < len; idx++) {\n var ref = kidDicts.get(idx);\n var dict = kidDicts.lookup(idx);\n // if (dict instanceof PDFDict) kids.push(PDFAcroField.fromDict(dict));\n if (ref instanceof PDFRef && dict instanceof PDFDict) {\n kids.push([createPDFAcroField(dict, ref), ref]);\n }\n }\n return kids;\n};\nexport var createPDFAcroField = function (dict, ref) {\n var isNonTerminal = isNonTerminalAcroField(dict);\n if (isNonTerminal) return PDFAcroNonTerminal.fromDict(dict, ref);\n return createPDFAcroTerminal(dict, ref);\n};\n// TODO: Maybe just check if the dict is *not* a widget? That might be better.\n// According to the PDF spec:\n//\n// > A field's children in the hierarchy may also include widget annotations\n// > that define its appearance on the page. A field that has children that\n// > are fields is called a non-terminal field. A field that does not have\n// > children that are fields is called a terminal field.\n//\n// The spec is not entirely clear about how to determine whether a given\n// dictionary represents an acrofield or a widget annotation. So we will assume\n// that a dictionary is an acrofield if it is a member of the `/Kids` array\n// and it contains a `/T` entry (widgets do not have `/T` entries). This isn't\n// a bullet proof solution, because the `/T` entry is technically defined as\n// optional for acrofields by the PDF spec. But in practice all acrofields seem\n// to have a `/T` entry defined.\nvar isNonTerminalAcroField = function (dict) {\n var kids = dict.lookup(PDFName.of('Kids'));\n if (kids instanceof PDFArray) {\n for (var idx = 0, len = kids.size(); idx < len; idx++) {\n var kid = kids.lookup(idx);\n var kidIsField = kid instanceof PDFDict && kid.has(PDFName.of('T'));\n if (kidIsField) return true;\n }\n }\n return false;\n};\nvar createPDFAcroTerminal = function (dict, ref) {\n var ftNameOrRef = getInheritableAttribute(dict, PDFName.of('FT'));\n var type = dict.context.lookup(ftNameOrRef, PDFName);\n if (type === PDFName.of('Btn')) return createPDFAcroButton(dict, ref);\n if (type === PDFName.of('Ch')) return createPDFAcroChoice(dict, ref);\n if (type === PDFName.of('Tx')) return PDFAcroText.fromDict(dict, ref);\n if (type === PDFName.of('Sig')) return PDFAcroSignature.fromDict(dict, ref);\n // We should never reach this line. But there are a lot of weird PDFs out\n // there. So, just to be safe, we'll try to handle things gracefully instead\n // of throwing an error.\n return PDFAcroTerminal.fromDict(dict, ref);\n};\nvar createPDFAcroButton = function (dict, ref) {\n var _a;\n var ffNumberOrRef = getInheritableAttribute(dict, PDFName.of('Ff'));\n var ffNumber = dict.context.lookupMaybe(ffNumberOrRef, PDFNumber);\n var flags = (_a = ffNumber === null || ffNumber === void 0 ? void 0 : ffNumber.asNumber()) !== null && _a !== void 0 ? _a : 0;\n if (flagIsSet(flags, AcroButtonFlags.PushButton)) {\n return PDFAcroPushButton.fromDict(dict, ref);\n } else if (flagIsSet(flags, AcroButtonFlags.Radio)) {\n return PDFAcroRadioButton.fromDict(dict, ref);\n } else {\n return PDFAcroCheckBox.fromDict(dict, ref);\n }\n};\nvar createPDFAcroChoice = function (dict, ref) {\n var _a;\n var ffNumberOrRef = getInheritableAttribute(dict, PDFName.of('Ff'));\n var ffNumber = dict.context.lookupMaybe(ffNumberOrRef, PDFNumber);\n var flags = (_a = ffNumber === null || ffNumber === void 0 ? void 0 : ffNumber.asNumber()) !== null && _a !== void 0 ? _a : 0;\n if (flagIsSet(flags, AcroChoiceFlags.Combo)) {\n return PDFAcroComboBox.fromDict(dict, ref);\n } else {\n return PDFAcroListBox.fromDict(dict, ref);\n }\n};\nvar flagIsSet = function (flags, flag) {\n return (flags & flag) !== 0;\n};\nvar getInheritableAttribute = function (startNode, name) {\n var attribute;\n ascend(startNode, function (node) {\n if (!attribute) attribute = node.get(name);\n });\n return attribute;\n};\nvar ascend = function (startNode, visitor) {\n visitor(startNode);\n var Parent = startNode.lookupMaybe(PDFName.of('Parent'), PDFDict);\n if (Parent) ascend(Parent, visitor);\n};","import PDFDict from \"../objects/PDFDict\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFAcroNonTerminal from \"./PDFAcroNonTerminal\";\nimport { createPDFAcroField, createPDFAcroFields } from \"./utils\";\nvar PDFAcroForm = /** @class */function () {\n function PDFAcroForm(dict) {\n this.dict = dict;\n }\n PDFAcroForm.prototype.Fields = function () {\n var fields = this.dict.lookup(PDFName.of('Fields'));\n if (fields instanceof PDFArray) return fields;\n return undefined;\n };\n PDFAcroForm.prototype.getFields = function () {\n var Fields = this.normalizedEntries().Fields;\n var fields = new Array(Fields.size());\n for (var idx = 0, len = Fields.size(); idx < len; idx++) {\n var ref = Fields.get(idx);\n var dict = Fields.lookup(idx, PDFDict);\n fields[idx] = [createPDFAcroField(dict, ref), ref];\n }\n return fields;\n };\n PDFAcroForm.prototype.getAllFields = function () {\n var allFields = [];\n var pushFields = function (fields) {\n if (!fields) return;\n for (var idx = 0, len = fields.length; idx < len; idx++) {\n var field = fields[idx];\n allFields.push(field);\n var fieldModel = field[0];\n if (fieldModel instanceof PDFAcroNonTerminal) {\n pushFields(createPDFAcroFields(fieldModel.Kids()));\n }\n }\n };\n pushFields(this.getFields());\n return allFields;\n };\n PDFAcroForm.prototype.addField = function (field) {\n var Fields = this.normalizedEntries().Fields;\n Fields === null || Fields === void 0 ? void 0 : Fields.push(field);\n };\n PDFAcroForm.prototype.removeField = function (field) {\n var parent = field.getParent();\n var fields = parent === undefined ? this.normalizedEntries().Fields : parent.Kids();\n var index = fields === null || fields === void 0 ? void 0 : fields.indexOf(field.ref);\n if (fields === undefined || index === undefined) {\n throw new Error(\"Tried to remove inexistent field \" + field.getFullyQualifiedName());\n }\n fields.remove(index);\n if (parent !== undefined && fields.size() === 0) {\n this.removeField(parent);\n }\n };\n PDFAcroForm.prototype.normalizedEntries = function () {\n var Fields = this.Fields();\n if (!Fields) {\n Fields = this.dict.context.obj([]);\n this.dict.set(PDFName.of('Fields'), Fields);\n }\n return {\n Fields: Fields\n };\n };\n PDFAcroForm.fromDict = function (dict) {\n return new PDFAcroForm(dict);\n };\n PDFAcroForm.create = function (context) {\n var dict = context.obj({\n Fields: []\n });\n return new PDFAcroForm(dict);\n };\n return PDFAcroForm;\n}();\nexport default PDFAcroForm;","import { __extends } from \"tslib\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFName from \"../objects/PDFName\";\nimport { PDFAcroForm } from \"../acroform\";\nimport ViewerPreferences from '../interactive/ViewerPreferences';\nvar PDFCatalog = /** @class */function (_super) {\n __extends(PDFCatalog, _super);\n function PDFCatalog() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFCatalog.prototype.Pages = function () {\n return this.lookup(PDFName.of('Pages'), PDFDict);\n };\n PDFCatalog.prototype.AcroForm = function () {\n return this.lookupMaybe(PDFName.of('AcroForm'), PDFDict);\n };\n PDFCatalog.prototype.getAcroForm = function () {\n var dict = this.AcroForm();\n if (!dict) return undefined;\n return PDFAcroForm.fromDict(dict);\n };\n PDFCatalog.prototype.getOrCreateAcroForm = function () {\n var acroForm = this.getAcroForm();\n if (!acroForm) {\n acroForm = PDFAcroForm.create(this.context);\n var acroFormRef = this.context.register(acroForm.dict);\n this.set(PDFName.of('AcroForm'), acroFormRef);\n }\n return acroForm;\n };\n PDFCatalog.prototype.ViewerPreferences = function () {\n return this.lookupMaybe(PDFName.of('ViewerPreferences'), PDFDict);\n };\n PDFCatalog.prototype.getViewerPreferences = function () {\n var dict = this.ViewerPreferences();\n if (!dict) return undefined;\n return ViewerPreferences.fromDict(dict);\n };\n PDFCatalog.prototype.getOrCreateViewerPreferences = function () {\n var viewerPrefs = this.getViewerPreferences();\n if (!viewerPrefs) {\n viewerPrefs = ViewerPreferences.create(this.context);\n var viewerPrefsRef = this.context.register(viewerPrefs.dict);\n this.set(PDFName.of('ViewerPreferences'), viewerPrefsRef);\n }\n return viewerPrefs;\n };\n /**\n * Inserts the given ref as a leaf node of this catalog's page tree at the\n * specified index (zero-based). Also increments the `Count` of each node in\n * the page tree hierarchy to accomodate the new page.\n *\n * Returns the ref of the PDFPageTree node into which `leafRef` was inserted.\n */\n PDFCatalog.prototype.insertLeafNode = function (leafRef, index) {\n var pagesRef = this.get(PDFName.of('Pages'));\n var maybeParentRef = this.Pages().insertLeafNode(leafRef, index);\n return maybeParentRef || pagesRef;\n };\n PDFCatalog.prototype.removeLeafNode = function (index) {\n this.Pages().removeLeafNode(index);\n };\n PDFCatalog.withContextAndPages = function (context, pages) {\n var dict = new Map();\n dict.set(PDFName.of('Type'), PDFName.of('Catalog'));\n dict.set(PDFName.of('Pages'), pages);\n return new PDFCatalog(dict, context);\n };\n PDFCatalog.fromMapWithContext = function (map, context) {\n return new PDFCatalog(map, context);\n };\n return PDFCatalog;\n}(PDFDict);\nexport default PDFCatalog;","import { __extends } from \"tslib\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFPageLeaf from \"./PDFPageLeaf\";\nimport { InvalidTargetIndexError, CorruptPageTreeError } from \"../errors\";\nvar PDFPageTree = /** @class */function (_super) {\n __extends(PDFPageTree, _super);\n function PDFPageTree() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFPageTree.prototype.Parent = function () {\n return this.lookup(PDFName.of('Parent'));\n };\n PDFPageTree.prototype.Kids = function () {\n return this.lookup(PDFName.of('Kids'), PDFArray);\n };\n PDFPageTree.prototype.Count = function () {\n return this.lookup(PDFName.of('Count'), PDFNumber);\n };\n PDFPageTree.prototype.pushTreeNode = function (treeRef) {\n var Kids = this.Kids();\n Kids.push(treeRef);\n };\n PDFPageTree.prototype.pushLeafNode = function (leafRef) {\n var Kids = this.Kids();\n this.insertLeafKid(Kids.size(), leafRef);\n };\n /**\n * Inserts the given ref as a leaf node of this page tree at the specified\n * index (zero-based). Also increments the `Count` of each page tree in the\n * hierarchy to accomodate the new page.\n *\n * Returns the ref of the PDFPageTree node into which `leafRef` was inserted,\n * or `undefined` if it was inserted into the root node (the PDFPageTree upon\n * which the method was first called).\n */\n PDFPageTree.prototype.insertLeafNode = function (leafRef, targetIndex) {\n var Kids = this.Kids();\n var Count = this.Count().asNumber();\n if (targetIndex > Count) {\n throw new InvalidTargetIndexError(targetIndex, Count);\n }\n var leafsRemainingUntilTarget = targetIndex;\n for (var idx = 0, len = Kids.size(); idx < len; idx++) {\n if (leafsRemainingUntilTarget === 0) {\n // Insert page and return\n this.insertLeafKid(idx, leafRef);\n return undefined;\n }\n var kidRef = Kids.get(idx);\n var kid = this.context.lookup(kidRef);\n if (kid instanceof PDFPageTree) {\n if (kid.Count().asNumber() > leafsRemainingUntilTarget) {\n // Dig in\n return kid.insertLeafNode(leafRef, leafsRemainingUntilTarget) || kidRef;\n } else {\n // Move on\n leafsRemainingUntilTarget -= kid.Count().asNumber();\n }\n }\n if (kid instanceof PDFPageLeaf) {\n // Move on\n leafsRemainingUntilTarget -= 1;\n }\n }\n if (leafsRemainingUntilTarget === 0) {\n // Insert page at the end and return\n this.insertLeafKid(Kids.size(), leafRef);\n return undefined;\n }\n // Should never get here if `targetIndex` is valid\n throw new CorruptPageTreeError(targetIndex, 'insertLeafNode');\n };\n /**\n * Removes the leaf node at the specified index (zero-based) from this page\n * tree. Also decrements the `Count` of each page tree in the hierarchy to\n * account for the removed page.\n *\n * If `prune` is true, then intermediate tree nodes will be removed from the\n * tree if they contain 0 children after the leaf node is removed.\n */\n PDFPageTree.prototype.removeLeafNode = function (targetIndex, prune) {\n if (prune === void 0) {\n prune = true;\n }\n var Kids = this.Kids();\n var Count = this.Count().asNumber();\n if (targetIndex >= Count) {\n throw new InvalidTargetIndexError(targetIndex, Count);\n }\n var leafsRemainingUntilTarget = targetIndex;\n for (var idx = 0, len = Kids.size(); idx < len; idx++) {\n var kidRef = Kids.get(idx);\n var kid = this.context.lookup(kidRef);\n if (kid instanceof PDFPageTree) {\n if (kid.Count().asNumber() > leafsRemainingUntilTarget) {\n // Dig in\n kid.removeLeafNode(leafsRemainingUntilTarget, prune);\n if (prune && kid.Kids().size() === 0) Kids.remove(idx);\n return;\n } else {\n // Move on\n leafsRemainingUntilTarget -= kid.Count().asNumber();\n }\n }\n if (kid instanceof PDFPageLeaf) {\n if (leafsRemainingUntilTarget === 0) {\n // Remove page and return\n this.removeKid(idx);\n return;\n } else {\n // Move on\n leafsRemainingUntilTarget -= 1;\n }\n }\n }\n // Should never get here if `targetIndex` is valid\n throw new CorruptPageTreeError(targetIndex, 'removeLeafNode');\n };\n PDFPageTree.prototype.ascend = function (visitor) {\n visitor(this);\n var Parent = this.Parent();\n if (Parent) Parent.ascend(visitor);\n };\n /** Performs a Post-Order traversal of this page tree */\n PDFPageTree.prototype.traverse = function (visitor) {\n var Kids = this.Kids();\n for (var idx = 0, len = Kids.size(); idx < len; idx++) {\n var kidRef = Kids.get(idx);\n var kid = this.context.lookup(kidRef);\n if (kid instanceof PDFPageTree) kid.traverse(visitor);\n visitor(kid, kidRef);\n }\n };\n PDFPageTree.prototype.insertLeafKid = function (kidIdx, leafRef) {\n var Kids = this.Kids();\n this.ascend(function (node) {\n var newCount = node.Count().asNumber() + 1;\n node.set(PDFName.of('Count'), PDFNumber.of(newCount));\n });\n Kids.insert(kidIdx, leafRef);\n };\n PDFPageTree.prototype.removeKid = function (kidIdx) {\n var Kids = this.Kids();\n var kid = Kids.lookup(kidIdx);\n if (kid instanceof PDFPageLeaf) {\n this.ascend(function (node) {\n var newCount = node.Count().asNumber() - 1;\n node.set(PDFName.of('Count'), PDFNumber.of(newCount));\n });\n }\n Kids.remove(kidIdx);\n };\n PDFPageTree.withContext = function (context, parent) {\n var dict = new Map();\n dict.set(PDFName.of('Type'), PDFName.of('Pages'));\n dict.set(PDFName.of('Kids'), context.obj([]));\n dict.set(PDFName.of('Count'), context.obj(0));\n if (parent) dict.set(PDFName.of('Parent'), parent);\n return new PDFPageTree(dict, context);\n };\n PDFPageTree.fromMapWithContext = function (map, context) {\n return new PDFPageTree(map, context);\n };\n return PDFPageTree;\n}(PDFDict);\nexport default PDFPageTree;","import CharCodes from \"./CharCodes\";\nexport var IsDigit = new Uint8Array(256);\nIsDigit[CharCodes.Zero] = 1;\nIsDigit[CharCodes.One] = 1;\nIsDigit[CharCodes.Two] = 1;\nIsDigit[CharCodes.Three] = 1;\nIsDigit[CharCodes.Four] = 1;\nIsDigit[CharCodes.Five] = 1;\nIsDigit[CharCodes.Six] = 1;\nIsDigit[CharCodes.Seven] = 1;\nIsDigit[CharCodes.Eight] = 1;\nIsDigit[CharCodes.Nine] = 1;\nexport var IsNumericPrefix = new Uint8Array(256);\nIsNumericPrefix[CharCodes.Period] = 1;\nIsNumericPrefix[CharCodes.Plus] = 1;\nIsNumericPrefix[CharCodes.Minus] = 1;\nexport var IsNumeric = new Uint8Array(256);\nfor (var idx = 0, len = 256; idx < len; idx++) {\n IsNumeric[idx] = IsDigit[idx] || IsNumericPrefix[idx] ? 1 : 0;\n}","import { NumberParsingError } from \"../errors\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { IsDigit, IsNumeric } from \"../syntax/Numeric\";\nimport { IsWhitespace } from \"../syntax/Whitespace\";\nimport { charFromCode } from \"../../utils\";\nvar Newline = CharCodes.Newline,\n CarriageReturn = CharCodes.CarriageReturn;\n// TODO: Throw error if eof is reached before finishing object parse...\nvar BaseParser = /** @class */function () {\n function BaseParser(bytes, capNumbers) {\n if (capNumbers === void 0) {\n capNumbers = false;\n }\n this.bytes = bytes;\n this.capNumbers = capNumbers;\n }\n BaseParser.prototype.parseRawInt = function () {\n var value = '';\n while (!this.bytes.done()) {\n var byte = this.bytes.peek();\n if (!IsDigit[byte]) break;\n value += charFromCode(this.bytes.next());\n }\n var numberValue = Number(value);\n if (!value || !isFinite(numberValue)) {\n throw new NumberParsingError(this.bytes.position(), value);\n }\n return numberValue;\n };\n // TODO: Maybe handle exponential format?\n // TODO: Compare performance of string concatenation to charFromCode(...bytes)\n BaseParser.prototype.parseRawNumber = function () {\n var value = '';\n // Parse integer-part, the leading (+ | - | . | 0-9)\n while (!this.bytes.done()) {\n var byte = this.bytes.peek();\n if (!IsNumeric[byte]) break;\n value += charFromCode(this.bytes.next());\n if (byte === CharCodes.Period) break;\n }\n // Parse decimal-part, the trailing (0-9)\n while (!this.bytes.done()) {\n var byte = this.bytes.peek();\n if (!IsDigit[byte]) break;\n value += charFromCode(this.bytes.next());\n }\n var numberValue = Number(value);\n if (!value || !isFinite(numberValue)) {\n throw new NumberParsingError(this.bytes.position(), value);\n }\n if (numberValue > Number.MAX_SAFE_INTEGER) {\n if (this.capNumbers) {\n var msg = \"Parsed number that is too large for some PDF readers: \" + value + \", using Number.MAX_SAFE_INTEGER instead.\";\n console.warn(msg);\n return Number.MAX_SAFE_INTEGER;\n } else {\n var msg = \"Parsed number that is too large for some PDF readers: \" + value + \", not capping.\";\n console.warn(msg);\n }\n }\n return numberValue;\n };\n BaseParser.prototype.skipWhitespace = function () {\n while (!this.bytes.done() && IsWhitespace[this.bytes.peek()]) {\n this.bytes.next();\n }\n };\n BaseParser.prototype.skipLine = function () {\n while (!this.bytes.done()) {\n var byte = this.bytes.peek();\n if (byte === Newline || byte === CarriageReturn) return;\n this.bytes.next();\n }\n };\n BaseParser.prototype.skipComment = function () {\n if (this.bytes.peek() !== CharCodes.Percent) return false;\n while (!this.bytes.done()) {\n var byte = this.bytes.peek();\n if (byte === Newline || byte === CarriageReturn) return true;\n this.bytes.next();\n }\n return true;\n };\n BaseParser.prototype.skipWhitespaceAndComments = function () {\n this.skipWhitespace();\n while (this.skipComment()) this.skipWhitespace();\n };\n BaseParser.prototype.matchKeyword = function (keyword) {\n var initialOffset = this.bytes.offset();\n for (var idx = 0, len = keyword.length; idx < len; idx++) {\n if (this.bytes.done() || this.bytes.next() !== keyword[idx]) {\n this.bytes.moveTo(initialOffset);\n return false;\n }\n }\n return true;\n };\n return BaseParser;\n}();\nexport default BaseParser;","var flag = function (bitIndex) {\n return 1 << bitIndex;\n};\n/** From PDF spec table 165 */\nexport var AnnotationFlags;\n(function (AnnotationFlags) {\n /**\n * If set, do not display the annotation if it does not belong to one of the\n * standard annotation types and no annotation handler is available. If clear,\n * display such an unknown annotation using an appearance stream specified by\n * its appearance dictionary, if any.\n */\n AnnotationFlags[AnnotationFlags[\"Invisible\"] = flag(1 - 1)] = \"Invisible\";\n /**\n * If set, do not display or print the annotation or allow it to interact with\n * the user, regardless of its annotation type or whether an annotation\n * handler is available.\n *\n * In cases where screen space is limited, the ability to hide and show\n * annotations selectively can be used in combination with appearance streams\n * to display auxiliary pop-up information similar in function to online help\n * systems.\n */\n AnnotationFlags[AnnotationFlags[\"Hidden\"] = flag(2 - 1)] = \"Hidden\";\n /**\n * If set, print the annotation when the page is printed. If clear, never\n * print the annotation, regardless of whether it is displayed on the screen.\n *\n * This can be useful for annotations representing interactive pushbuttons,\n * which would serve no meaningful purpose on the printed page.\n */\n AnnotationFlags[AnnotationFlags[\"Print\"] = flag(3 - 1)] = \"Print\";\n /**\n * If set, do not scale the annotation’s appearance to match the magnification\n * of the page. The location of the annotation on the page (defined by the\n * upper-left corner of its annotation rectangle) shall remain fixed,\n * regardless of the page magnification.\n */\n AnnotationFlags[AnnotationFlags[\"NoZoom\"] = flag(4 - 1)] = \"NoZoom\";\n /**\n * If set, do not rotate the annotation’s appearance to match the rotation of\n * the page. The upper-left corner of the annotation rectangle shall remain in\n * a fixed location on the page, regardless of the page rotation.\n */\n AnnotationFlags[AnnotationFlags[\"NoRotate\"] = flag(5 - 1)] = \"NoRotate\";\n /**\n * If set, do not display the annotation on the screen or allow it to interact\n * with the user. The annotation may be printed (depending on the setting of\n * the Print flag) but should be considered hidden for purposes of on-screen\n * display and user interaction.\n */\n AnnotationFlags[AnnotationFlags[\"NoView\"] = flag(6 - 1)] = \"NoView\";\n /**\n * If set, do not allow the annotation to interact with the user. The\n * annotation may be displayed or printed (depending on the settings of the\n * NoView and Print flags) but should not respond to mouse clicks or change\n * its appearance in response to mouse motions.\n *\n * This flag shall be ignored for widget annotations; its function is\n * subsumed by the ReadOnly flag of the associated form field.\n */\n AnnotationFlags[AnnotationFlags[\"ReadOnly\"] = flag(7 - 1)] = \"ReadOnly\";\n /**\n * If set, do not allow the annotation to be deleted or its properties\n * (including position and size) to be modified by the user. However, this\n * flag does not restrict changes to the annotation’s contents, such as the\n * value of a form field.\n */\n AnnotationFlags[AnnotationFlags[\"Locked\"] = flag(8 - 1)] = \"Locked\";\n /**\n * If set, invert the interpretation of the NoView flag for certain events.\n *\n * A typical use is to have an annotation that appears only when a mouse\n * cursor is held over it.\n */\n AnnotationFlags[AnnotationFlags[\"ToggleNoView\"] = flag(9 - 1)] = \"ToggleNoView\";\n /**\n * If set, do not allow the contents of the annotation to be modified by the\n * user. This flag does not restrict deletion of the annotation or changes to\n * other annotation properties, such as position and size.\n */\n AnnotationFlags[AnnotationFlags[\"LockedContents\"] = flag(10 - 1)] = \"LockedContents\";\n})(AnnotationFlags || (AnnotationFlags = {}));","import { NextByteAssertionError } from \"../errors\";\nimport { decodePDFRawStream } from \"../streams/decode\";\nimport CharCodes from \"../syntax/CharCodes\";\n// TODO: See how line/col tracking affects performance\nvar ByteStream = /** @class */function () {\n function ByteStream(bytes) {\n this.idx = 0;\n this.line = 0;\n this.column = 0;\n this.bytes = bytes;\n this.length = this.bytes.length;\n }\n ByteStream.prototype.moveTo = function (offset) {\n this.idx = offset;\n };\n ByteStream.prototype.next = function () {\n var byte = this.bytes[this.idx++];\n if (byte === CharCodes.Newline) {\n this.line += 1;\n this.column = 0;\n } else {\n this.column += 1;\n }\n return byte;\n };\n ByteStream.prototype.assertNext = function (expected) {\n if (this.peek() !== expected) {\n throw new NextByteAssertionError(this.position(), expected, this.peek());\n }\n return this.next();\n };\n ByteStream.prototype.peek = function () {\n return this.bytes[this.idx];\n };\n ByteStream.prototype.peekAhead = function (steps) {\n return this.bytes[this.idx + steps];\n };\n ByteStream.prototype.peekAt = function (offset) {\n return this.bytes[offset];\n };\n ByteStream.prototype.done = function () {\n return this.idx >= this.length;\n };\n ByteStream.prototype.offset = function () {\n return this.idx;\n };\n ByteStream.prototype.slice = function (start, end) {\n return this.bytes.slice(start, end);\n };\n ByteStream.prototype.position = function () {\n return {\n line: this.line,\n column: this.column,\n offset: this.idx\n };\n };\n ByteStream.of = function (bytes) {\n return new ByteStream(bytes);\n };\n ByteStream.fromPDFRawStream = function (rawStream) {\n return ByteStream.of(decodePDFRawStream(rawStream).decode());\n };\n return ByteStream;\n}();\nexport default ByteStream;","import { __spreadArrays } from \"tslib\";\nimport CharCodes from \"./CharCodes\";\nvar Space = CharCodes.Space,\n CarriageReturn = CharCodes.CarriageReturn,\n Newline = CharCodes.Newline;\nvar stream = [CharCodes.s, CharCodes.t, CharCodes.r, CharCodes.e, CharCodes.a, CharCodes.m];\nvar endstream = [CharCodes.e, CharCodes.n, CharCodes.d, CharCodes.s, CharCodes.t, CharCodes.r, CharCodes.e, CharCodes.a, CharCodes.m];\nexport var Keywords = {\n header: [CharCodes.Percent, CharCodes.P, CharCodes.D, CharCodes.F, CharCodes.Dash],\n eof: [CharCodes.Percent, CharCodes.Percent, CharCodes.E, CharCodes.O, CharCodes.F],\n obj: [CharCodes.o, CharCodes.b, CharCodes.j],\n endobj: [CharCodes.e, CharCodes.n, CharCodes.d, CharCodes.o, CharCodes.b, CharCodes.j],\n xref: [CharCodes.x, CharCodes.r, CharCodes.e, CharCodes.f],\n trailer: [CharCodes.t, CharCodes.r, CharCodes.a, CharCodes.i, CharCodes.l, CharCodes.e, CharCodes.r],\n startxref: [CharCodes.s, CharCodes.t, CharCodes.a, CharCodes.r, CharCodes.t, CharCodes.x, CharCodes.r, CharCodes.e, CharCodes.f],\n true: [CharCodes.t, CharCodes.r, CharCodes.u, CharCodes.e],\n false: [CharCodes.f, CharCodes.a, CharCodes.l, CharCodes.s, CharCodes.e],\n null: [CharCodes.n, CharCodes.u, CharCodes.l, CharCodes.l],\n stream: stream,\n streamEOF1: __spreadArrays(stream, [Space, CarriageReturn, Newline]),\n streamEOF2: __spreadArrays(stream, [CarriageReturn, Newline]),\n streamEOF3: __spreadArrays(stream, [CarriageReturn]),\n streamEOF4: __spreadArrays(stream, [Newline]),\n endstream: endstream,\n EOF1endstream: __spreadArrays([CarriageReturn, Newline], endstream),\n EOF2endstream: __spreadArrays([CarriageReturn], endstream),\n EOF3endstream: __spreadArrays([Newline], endstream)\n};","import { __extends } from \"tslib\";\nimport { PDFObjectParsingError, PDFStreamParsingError, UnbalancedParenthesisError } from \"../errors\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFBool from \"../objects/PDFBool\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFHexString from \"../objects/PDFHexString\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNull from \"../objects/PDFNull\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFRawStream from \"../objects/PDFRawStream\";\nimport PDFRef from \"../objects/PDFRef\";\nimport PDFString from \"../objects/PDFString\";\nimport BaseParser from \"./BaseParser\";\nimport ByteStream from \"./ByteStream\";\nimport PDFCatalog from \"../structures/PDFCatalog\";\nimport PDFPageLeaf from \"../structures/PDFPageLeaf\";\nimport PDFPageTree from \"../structures/PDFPageTree\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { IsDelimiter } from \"../syntax/Delimiters\";\nimport { Keywords } from \"../syntax/Keywords\";\nimport { IsDigit, IsNumeric } from \"../syntax/Numeric\";\nimport { IsWhitespace } from \"../syntax/Whitespace\";\nimport { charFromCode } from \"../../utils\";\n// TODO: Throw error if eof is reached before finishing object parse...\nvar PDFObjectParser = /** @class */function (_super) {\n __extends(PDFObjectParser, _super);\n function PDFObjectParser(byteStream, context, capNumbers) {\n if (capNumbers === void 0) {\n capNumbers = false;\n }\n var _this = _super.call(this, byteStream, capNumbers) || this;\n _this.context = context;\n return _this;\n }\n // TODO: Is it possible to reduce duplicate parsing for ref lookaheads?\n PDFObjectParser.prototype.parseObject = function () {\n this.skipWhitespaceAndComments();\n if (this.matchKeyword(Keywords.true)) return PDFBool.True;\n if (this.matchKeyword(Keywords.false)) return PDFBool.False;\n if (this.matchKeyword(Keywords.null)) return PDFNull;\n var byte = this.bytes.peek();\n if (byte === CharCodes.LessThan && this.bytes.peekAhead(1) === CharCodes.LessThan) {\n return this.parseDictOrStream();\n }\n if (byte === CharCodes.LessThan) return this.parseHexString();\n if (byte === CharCodes.LeftParen) return this.parseString();\n if (byte === CharCodes.ForwardSlash) return this.parseName();\n if (byte === CharCodes.LeftSquareBracket) return this.parseArray();\n if (IsNumeric[byte]) return this.parseNumberOrRef();\n throw new PDFObjectParsingError(this.bytes.position(), byte);\n };\n PDFObjectParser.prototype.parseNumberOrRef = function () {\n var firstNum = this.parseRawNumber();\n this.skipWhitespaceAndComments();\n var lookaheadStart = this.bytes.offset();\n if (IsDigit[this.bytes.peek()]) {\n var secondNum = this.parseRawNumber();\n this.skipWhitespaceAndComments();\n if (this.bytes.peek() === CharCodes.R) {\n this.bytes.assertNext(CharCodes.R);\n return PDFRef.of(firstNum, secondNum);\n }\n }\n this.bytes.moveTo(lookaheadStart);\n return PDFNumber.of(firstNum);\n };\n // TODO: Maybe update PDFHexString.of() logic to remove whitespace and validate input?\n PDFObjectParser.prototype.parseHexString = function () {\n var value = '';\n this.bytes.assertNext(CharCodes.LessThan);\n while (!this.bytes.done() && this.bytes.peek() !== CharCodes.GreaterThan) {\n value += charFromCode(this.bytes.next());\n }\n this.bytes.assertNext(CharCodes.GreaterThan);\n return PDFHexString.of(value);\n };\n PDFObjectParser.prototype.parseString = function () {\n var nestingLvl = 0;\n var isEscaped = false;\n var value = '';\n while (!this.bytes.done()) {\n var byte = this.bytes.next();\n value += charFromCode(byte);\n // Check for unescaped parenthesis\n if (!isEscaped) {\n if (byte === CharCodes.LeftParen) nestingLvl += 1;\n if (byte === CharCodes.RightParen) nestingLvl -= 1;\n }\n // Track whether current character is being escaped or not\n if (byte === CharCodes.BackSlash) {\n isEscaped = !isEscaped;\n } else if (isEscaped) {\n isEscaped = false;\n }\n // Once (if) the unescaped parenthesis balance out, return their contents\n if (nestingLvl === 0) {\n // Remove the outer parens so they aren't part of the contents\n return PDFString.of(value.substring(1, value.length - 1));\n }\n }\n throw new UnbalancedParenthesisError(this.bytes.position());\n };\n // TODO: Compare performance of string concatenation to charFromCode(...bytes)\n // TODO: Maybe preallocate small Uint8Array if can use charFromCode?\n PDFObjectParser.prototype.parseName = function () {\n this.bytes.assertNext(CharCodes.ForwardSlash);\n var name = '';\n while (!this.bytes.done()) {\n var byte = this.bytes.peek();\n if (IsWhitespace[byte] || IsDelimiter[byte]) break;\n name += charFromCode(byte);\n this.bytes.next();\n }\n return PDFName.of(name);\n };\n PDFObjectParser.prototype.parseArray = function () {\n this.bytes.assertNext(CharCodes.LeftSquareBracket);\n this.skipWhitespaceAndComments();\n var pdfArray = PDFArray.withContext(this.context);\n while (this.bytes.peek() !== CharCodes.RightSquareBracket) {\n var element = this.parseObject();\n pdfArray.push(element);\n this.skipWhitespaceAndComments();\n }\n this.bytes.assertNext(CharCodes.RightSquareBracket);\n return pdfArray;\n };\n PDFObjectParser.prototype.parseDict = function () {\n this.bytes.assertNext(CharCodes.LessThan);\n this.bytes.assertNext(CharCodes.LessThan);\n this.skipWhitespaceAndComments();\n var dict = new Map();\n while (!this.bytes.done() && this.bytes.peek() !== CharCodes.GreaterThan && this.bytes.peekAhead(1) !== CharCodes.GreaterThan) {\n var key = this.parseName();\n var value = this.parseObject();\n dict.set(key, value);\n this.skipWhitespaceAndComments();\n }\n this.skipWhitespaceAndComments();\n this.bytes.assertNext(CharCodes.GreaterThan);\n this.bytes.assertNext(CharCodes.GreaterThan);\n var Type = dict.get(PDFName.of('Type'));\n if (Type === PDFName.of('Catalog')) {\n return PDFCatalog.fromMapWithContext(dict, this.context);\n } else if (Type === PDFName.of('Pages')) {\n return PDFPageTree.fromMapWithContext(dict, this.context);\n } else if (Type === PDFName.of('Page')) {\n return PDFPageLeaf.fromMapWithContext(dict, this.context);\n } else {\n return PDFDict.fromMapWithContext(dict, this.context);\n }\n };\n PDFObjectParser.prototype.parseDictOrStream = function () {\n var startPos = this.bytes.position();\n var dict = this.parseDict();\n this.skipWhitespaceAndComments();\n if (!this.matchKeyword(Keywords.streamEOF1) && !this.matchKeyword(Keywords.streamEOF2) && !this.matchKeyword(Keywords.streamEOF3) && !this.matchKeyword(Keywords.streamEOF4) && !this.matchKeyword(Keywords.stream)) {\n return dict;\n }\n var start = this.bytes.offset();\n var end;\n var Length = dict.get(PDFName.of('Length'));\n if (Length instanceof PDFNumber) {\n end = start + Length.asNumber();\n this.bytes.moveTo(end);\n this.skipWhitespaceAndComments();\n if (!this.matchKeyword(Keywords.endstream)) {\n this.bytes.moveTo(start);\n end = this.findEndOfStreamFallback(startPos);\n }\n } else {\n end = this.findEndOfStreamFallback(startPos);\n }\n var contents = this.bytes.slice(start, end);\n return PDFRawStream.of(dict, contents);\n };\n PDFObjectParser.prototype.findEndOfStreamFallback = function (startPos) {\n // Move to end of stream, while handling nested streams\n var nestingLvl = 1;\n var end = this.bytes.offset();\n while (!this.bytes.done()) {\n end = this.bytes.offset();\n if (this.matchKeyword(Keywords.stream)) {\n nestingLvl += 1;\n } else if (this.matchKeyword(Keywords.EOF1endstream) || this.matchKeyword(Keywords.EOF2endstream) || this.matchKeyword(Keywords.EOF3endstream) || this.matchKeyword(Keywords.endstream)) {\n nestingLvl -= 1;\n } else {\n this.bytes.next();\n }\n if (nestingLvl === 0) break;\n }\n if (nestingLvl !== 0) throw new PDFStreamParsingError(startPos);\n return end;\n };\n PDFObjectParser.forBytes = function (bytes, context, capNumbers) {\n return new PDFObjectParser(ByteStream.of(bytes), context, capNumbers);\n };\n PDFObjectParser.forByteStream = function (byteStream, context, capNumbers) {\n if (capNumbers === void 0) {\n capNumbers = false;\n }\n return new PDFObjectParser(byteStream, context, capNumbers);\n };\n return PDFObjectParser;\n}(BaseParser);\nexport default PDFObjectParser;","import { __awaiter, __extends, __generator } from \"tslib\";\nimport { ReparseError } from \"../errors\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFRef from \"../objects/PDFRef\";\nimport ByteStream from \"./ByteStream\";\nimport PDFObjectParser from \"./PDFObjectParser\";\nimport { waitForTick } from \"../../utils\";\nvar PDFObjectStreamParser = /** @class */function (_super) {\n __extends(PDFObjectStreamParser, _super);\n function PDFObjectStreamParser(rawStream, shouldWaitForTick) {\n var _this = _super.call(this, ByteStream.fromPDFRawStream(rawStream), rawStream.dict.context) || this;\n var dict = rawStream.dict;\n _this.alreadyParsed = false;\n _this.shouldWaitForTick = shouldWaitForTick || function () {\n return false;\n };\n _this.firstOffset = dict.lookup(PDFName.of('First'), PDFNumber).asNumber();\n _this.objectCount = dict.lookup(PDFName.of('N'), PDFNumber).asNumber();\n return _this;\n }\n PDFObjectStreamParser.prototype.parseIntoContext = function () {\n return __awaiter(this, void 0, void 0, function () {\n var offsetsAndObjectNumbers, idx, len, _a, objectNumber, offset, object, ref;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (this.alreadyParsed) {\n throw new ReparseError('PDFObjectStreamParser', 'parseIntoContext');\n }\n this.alreadyParsed = true;\n offsetsAndObjectNumbers = this.parseOffsetsAndObjectNumbers();\n idx = 0, len = offsetsAndObjectNumbers.length;\n _b.label = 1;\n case 1:\n if (!(idx < len)) return [3 /*break*/, 4];\n _a = offsetsAndObjectNumbers[idx], objectNumber = _a.objectNumber, offset = _a.offset;\n this.bytes.moveTo(this.firstOffset + offset);\n object = this.parseObject();\n ref = PDFRef.of(objectNumber, 0);\n this.context.assign(ref, object);\n if (!this.shouldWaitForTick()) return [3 /*break*/, 3];\n return [4 /*yield*/, waitForTick()];\n case 2:\n _b.sent();\n _b.label = 3;\n case 3:\n idx++;\n return [3 /*break*/, 1];\n case 4:\n return [2 /*return*/];\n }\n });\n });\n };\n PDFObjectStreamParser.prototype.parseOffsetsAndObjectNumbers = function () {\n var offsetsAndObjectNumbers = [];\n for (var idx = 0, len = this.objectCount; idx < len; idx++) {\n this.skipWhitespaceAndComments();\n var objectNumber = this.parseRawInt();\n this.skipWhitespaceAndComments();\n var offset = this.parseRawInt();\n offsetsAndObjectNumbers.push({\n objectNumber: objectNumber,\n offset: offset\n });\n }\n return offsetsAndObjectNumbers;\n };\n PDFObjectStreamParser.forStream = function (rawStream, shouldWaitForTick) {\n return new PDFObjectStreamParser(rawStream, shouldWaitForTick);\n };\n return PDFObjectStreamParser;\n}(PDFObjectParser);\nexport default PDFObjectStreamParser;","import { ReparseError } from \"../errors\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFRef from \"../objects/PDFRef\";\nimport ByteStream from \"./ByteStream\";\nvar PDFXRefStreamParser = /** @class */function () {\n function PDFXRefStreamParser(rawStream) {\n this.alreadyParsed = false;\n this.dict = rawStream.dict;\n this.bytes = ByteStream.fromPDFRawStream(rawStream);\n this.context = this.dict.context;\n var Size = this.dict.lookup(PDFName.of('Size'), PDFNumber);\n var Index = this.dict.lookup(PDFName.of('Index'));\n if (Index instanceof PDFArray) {\n this.subsections = [];\n for (var idx = 0, len = Index.size(); idx < len; idx += 2) {\n var firstObjectNumber = Index.lookup(idx + 0, PDFNumber).asNumber();\n var length_1 = Index.lookup(idx + 1, PDFNumber).asNumber();\n this.subsections.push({\n firstObjectNumber: firstObjectNumber,\n length: length_1\n });\n }\n } else {\n this.subsections = [{\n firstObjectNumber: 0,\n length: Size.asNumber()\n }];\n }\n var W = this.dict.lookup(PDFName.of('W'), PDFArray);\n this.byteWidths = [-1, -1, -1];\n for (var idx = 0, len = W.size(); idx < len; idx++) {\n this.byteWidths[idx] = W.lookup(idx, PDFNumber).asNumber();\n }\n }\n PDFXRefStreamParser.prototype.parseIntoContext = function () {\n if (this.alreadyParsed) {\n throw new ReparseError('PDFXRefStreamParser', 'parseIntoContext');\n }\n this.alreadyParsed = true;\n this.context.trailerInfo = {\n Root: this.dict.get(PDFName.of('Root')),\n Encrypt: this.dict.get(PDFName.of('Encrypt')),\n Info: this.dict.get(PDFName.of('Info')),\n ID: this.dict.get(PDFName.of('ID'))\n };\n var entries = this.parseEntries();\n // for (let idx = 0, len = entries.length; idx < len; idx++) {\n // const entry = entries[idx];\n // if (entry.deleted) this.context.delete(entry.ref);\n // }\n return entries;\n };\n PDFXRefStreamParser.prototype.parseEntries = function () {\n var entries = [];\n var _a = this.byteWidths,\n typeFieldWidth = _a[0],\n offsetFieldWidth = _a[1],\n genFieldWidth = _a[2];\n for (var subsectionIdx = 0, subsectionLen = this.subsections.length; subsectionIdx < subsectionLen; subsectionIdx++) {\n var _b = this.subsections[subsectionIdx],\n firstObjectNumber = _b.firstObjectNumber,\n length_2 = _b.length;\n for (var objIdx = 0; objIdx < length_2; objIdx++) {\n var type = 0;\n for (var idx = 0, len = typeFieldWidth; idx < len; idx++) {\n type = type << 8 | this.bytes.next();\n }\n var offset = 0;\n for (var idx = 0, len = offsetFieldWidth; idx < len; idx++) {\n offset = offset << 8 | this.bytes.next();\n }\n var generationNumber = 0;\n for (var idx = 0, len = genFieldWidth; idx < len; idx++) {\n generationNumber = generationNumber << 8 | this.bytes.next();\n }\n // When the `type` field is absent, it defaults to 1\n if (typeFieldWidth === 0) type = 1;\n var objectNumber = firstObjectNumber + objIdx;\n var entry = {\n ref: PDFRef.of(objectNumber, generationNumber),\n offset: offset,\n deleted: type === 0,\n inObjectStream: type === 2\n };\n entries.push(entry);\n }\n }\n return entries;\n };\n PDFXRefStreamParser.forStream = function (rawStream) {\n return new PDFXRefStreamParser(rawStream);\n };\n return PDFXRefStreamParser;\n}();\nexport default PDFXRefStreamParser;","import { __awaiter, __extends, __generator } from \"tslib\";\nimport PDFCrossRefSection from \"../document/PDFCrossRefSection\";\nimport PDFHeader from \"../document/PDFHeader\";\nimport PDFTrailer from \"../document/PDFTrailer\";\nimport { MissingKeywordError, MissingPDFHeaderError, PDFInvalidObjectParsingError, ReparseError, StalledParserError } from \"../errors\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFInvalidObject from \"../objects/PDFInvalidObject\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFRawStream from \"../objects/PDFRawStream\";\nimport PDFRef from \"../objects/PDFRef\";\nimport ByteStream from \"./ByteStream\";\nimport PDFObjectParser from \"./PDFObjectParser\";\nimport PDFObjectStreamParser from \"./PDFObjectStreamParser\";\nimport PDFXRefStreamParser from \"./PDFXRefStreamParser\";\nimport PDFContext from \"../PDFContext\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { Keywords } from \"../syntax/Keywords\";\nimport { IsDigit } from \"../syntax/Numeric\";\nimport { waitForTick } from \"../../utils\";\nvar PDFParser = /** @class */function (_super) {\n __extends(PDFParser, _super);\n function PDFParser(pdfBytes, objectsPerTick, throwOnInvalidObject, capNumbers) {\n if (objectsPerTick === void 0) {\n objectsPerTick = Infinity;\n }\n if (throwOnInvalidObject === void 0) {\n throwOnInvalidObject = false;\n }\n if (capNumbers === void 0) {\n capNumbers = false;\n }\n var _this = _super.call(this, ByteStream.of(pdfBytes), PDFContext.create(), capNumbers) || this;\n _this.alreadyParsed = false;\n _this.parsedObjects = 0;\n _this.shouldWaitForTick = function () {\n _this.parsedObjects += 1;\n return _this.parsedObjects % _this.objectsPerTick === 0;\n };\n _this.objectsPerTick = objectsPerTick;\n _this.throwOnInvalidObject = throwOnInvalidObject;\n return _this;\n }\n PDFParser.prototype.parseDocument = function () {\n return __awaiter(this, void 0, void 0, function () {\n var prevOffset, offset;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (this.alreadyParsed) {\n throw new ReparseError('PDFParser', 'parseDocument');\n }\n this.alreadyParsed = true;\n this.context.header = this.parseHeader();\n _a.label = 1;\n case 1:\n if (!!this.bytes.done()) return [3 /*break*/, 3];\n return [4 /*yield*/, this.parseDocumentSection()];\n case 2:\n _a.sent();\n offset = this.bytes.offset();\n if (offset === prevOffset) {\n throw new StalledParserError(this.bytes.position());\n }\n prevOffset = offset;\n return [3 /*break*/, 1];\n case 3:\n this.maybeRecoverRoot();\n if (this.context.lookup(PDFRef.of(0))) {\n console.warn('Removing parsed object: 0 0 R');\n this.context.delete(PDFRef.of(0));\n }\n return [2 /*return*/, this.context];\n }\n });\n });\n };\n PDFParser.prototype.maybeRecoverRoot = function () {\n var isValidCatalog = function (obj) {\n return obj instanceof PDFDict && obj.lookup(PDFName.of('Type')) === PDFName.of('Catalog');\n };\n var catalog = this.context.lookup(this.context.trailerInfo.Root);\n if (!isValidCatalog(catalog)) {\n var indirectObjects = this.context.enumerateIndirectObjects();\n for (var idx = 0, len = indirectObjects.length; idx < len; idx++) {\n var _a = indirectObjects[idx],\n ref = _a[0],\n object = _a[1];\n if (isValidCatalog(object)) {\n this.context.trailerInfo.Root = ref;\n }\n }\n }\n };\n PDFParser.prototype.parseHeader = function () {\n while (!this.bytes.done()) {\n if (this.matchKeyword(Keywords.header)) {\n var major = this.parseRawInt();\n this.bytes.assertNext(CharCodes.Period);\n var minor = this.parseRawInt();\n var header = PDFHeader.forVersion(major, minor);\n this.skipBinaryHeaderComment();\n return header;\n }\n this.bytes.next();\n }\n throw new MissingPDFHeaderError(this.bytes.position());\n };\n PDFParser.prototype.parseIndirectObjectHeader = function () {\n this.skipWhitespaceAndComments();\n var objectNumber = this.parseRawInt();\n this.skipWhitespaceAndComments();\n var generationNumber = this.parseRawInt();\n this.skipWhitespaceAndComments();\n if (!this.matchKeyword(Keywords.obj)) {\n throw new MissingKeywordError(this.bytes.position(), Keywords.obj);\n }\n return PDFRef.of(objectNumber, generationNumber);\n };\n PDFParser.prototype.matchIndirectObjectHeader = function () {\n var initialOffset = this.bytes.offset();\n try {\n this.parseIndirectObjectHeader();\n return true;\n } catch (e) {\n this.bytes.moveTo(initialOffset);\n return false;\n }\n };\n PDFParser.prototype.parseIndirectObject = function () {\n return __awaiter(this, void 0, void 0, function () {\n var ref, object;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n ref = this.parseIndirectObjectHeader();\n this.skipWhitespaceAndComments();\n object = this.parseObject();\n this.skipWhitespaceAndComments();\n // if (!this.matchKeyword(Keywords.endobj)) {\n // throw new MissingKeywordError(this.bytes.position(), Keywords.endobj);\n // }\n // TODO: Log a warning if this fails...\n this.matchKeyword(Keywords.endobj);\n if (!(object instanceof PDFRawStream && object.dict.lookup(PDFName.of('Type')) === PDFName.of('ObjStm'))) return [3 /*break*/, 2];\n return [4 /*yield*/, PDFObjectStreamParser.forStream(object, this.shouldWaitForTick).parseIntoContext()];\n case 1:\n _a.sent();\n return [3 /*break*/, 3];\n case 2:\n if (object instanceof PDFRawStream && object.dict.lookup(PDFName.of('Type')) === PDFName.of('XRef')) {\n PDFXRefStreamParser.forStream(object).parseIntoContext();\n } else {\n this.context.assign(ref, object);\n }\n _a.label = 3;\n case 3:\n return [2 /*return*/, ref];\n }\n });\n });\n };\n // TODO: Improve and clean this up\n PDFParser.prototype.tryToParseInvalidIndirectObject = function () {\n var startPos = this.bytes.position();\n var msg = \"Trying to parse invalid object: \" + JSON.stringify(startPos) + \")\";\n if (this.throwOnInvalidObject) throw new Error(msg);\n console.warn(msg);\n var ref = this.parseIndirectObjectHeader();\n console.warn(\"Invalid object ref: \" + ref);\n this.skipWhitespaceAndComments();\n var start = this.bytes.offset();\n var failed = true;\n while (!this.bytes.done()) {\n if (this.matchKeyword(Keywords.endobj)) {\n failed = false;\n }\n if (!failed) break;\n this.bytes.next();\n }\n if (failed) throw new PDFInvalidObjectParsingError(startPos);\n var end = this.bytes.offset() - Keywords.endobj.length;\n var object = PDFInvalidObject.of(this.bytes.slice(start, end));\n this.context.assign(ref, object);\n return ref;\n };\n PDFParser.prototype.parseIndirectObjects = function () {\n return __awaiter(this, void 0, void 0, function () {\n var initialOffset, e_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n this.skipWhitespaceAndComments();\n _a.label = 1;\n case 1:\n if (!(!this.bytes.done() && IsDigit[this.bytes.peek()])) return [3 /*break*/, 8];\n initialOffset = this.bytes.offset();\n _a.label = 2;\n case 2:\n _a.trys.push([2, 4,, 5]);\n return [4 /*yield*/, this.parseIndirectObject()];\n case 3:\n _a.sent();\n return [3 /*break*/, 5];\n case 4:\n e_1 = _a.sent();\n // TODO: Add tracing/logging mechanism to track when this happens!\n this.bytes.moveTo(initialOffset);\n this.tryToParseInvalidIndirectObject();\n return [3 /*break*/, 5];\n case 5:\n this.skipWhitespaceAndComments();\n // TODO: Can this be done only when needed, to avoid harming performance?\n this.skipJibberish();\n if (!this.shouldWaitForTick()) return [3 /*break*/, 7];\n return [4 /*yield*/, waitForTick()];\n case 6:\n _a.sent();\n _a.label = 7;\n case 7:\n return [3 /*break*/, 1];\n case 8:\n return [2 /*return*/];\n }\n });\n });\n };\n PDFParser.prototype.maybeParseCrossRefSection = function () {\n this.skipWhitespaceAndComments();\n if (!this.matchKeyword(Keywords.xref)) return;\n this.skipWhitespaceAndComments();\n var objectNumber = -1;\n var xref = PDFCrossRefSection.createEmpty();\n while (!this.bytes.done() && IsDigit[this.bytes.peek()]) {\n var firstInt = this.parseRawInt();\n this.skipWhitespaceAndComments();\n var secondInt = this.parseRawInt();\n this.skipWhitespaceAndComments();\n var byte = this.bytes.peek();\n if (byte === CharCodes.n || byte === CharCodes.f) {\n var ref = PDFRef.of(objectNumber, secondInt);\n if (this.bytes.next() === CharCodes.n) {\n xref.addEntry(ref, firstInt);\n } else {\n // this.context.delete(ref);\n xref.addDeletedEntry(ref, firstInt);\n }\n objectNumber += 1;\n } else {\n objectNumber = firstInt;\n }\n this.skipWhitespaceAndComments();\n }\n return xref;\n };\n PDFParser.prototype.maybeParseTrailerDict = function () {\n this.skipWhitespaceAndComments();\n if (!this.matchKeyword(Keywords.trailer)) return;\n this.skipWhitespaceAndComments();\n var dict = this.parseDict();\n var context = this.context;\n context.trailerInfo = {\n Root: dict.get(PDFName.of('Root')) || context.trailerInfo.Root,\n Encrypt: dict.get(PDFName.of('Encrypt')) || context.trailerInfo.Encrypt,\n Info: dict.get(PDFName.of('Info')) || context.trailerInfo.Info,\n ID: dict.get(PDFName.of('ID')) || context.trailerInfo.ID\n };\n };\n PDFParser.prototype.maybeParseTrailer = function () {\n this.skipWhitespaceAndComments();\n if (!this.matchKeyword(Keywords.startxref)) return;\n this.skipWhitespaceAndComments();\n var offset = this.parseRawInt();\n this.skipWhitespace();\n this.matchKeyword(Keywords.eof);\n this.skipWhitespaceAndComments();\n this.matchKeyword(Keywords.eof);\n this.skipWhitespaceAndComments();\n return PDFTrailer.forLastCrossRefSectionOffset(offset);\n };\n PDFParser.prototype.parseDocumentSection = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n return [4 /*yield*/, this.parseIndirectObjects()];\n case 1:\n _a.sent();\n this.maybeParseCrossRefSection();\n this.maybeParseTrailerDict();\n this.maybeParseTrailer();\n // TODO: Can this be done only when needed, to avoid harming performance?\n this.skipJibberish();\n return [2 /*return*/];\n }\n });\n });\n };\n /**\n * This operation is not necessary for valid PDF files. But some invalid PDFs\n * contain jibberish in between indirect objects. This method is designed to\n * skip past that jibberish, should it exist, until it reaches the next\n * indirect object header, an xref table section, or the file trailer.\n */\n PDFParser.prototype.skipJibberish = function () {\n this.skipWhitespaceAndComments();\n while (!this.bytes.done()) {\n var initialOffset = this.bytes.offset();\n var byte = this.bytes.peek();\n var isAlphaNumeric = byte >= CharCodes.Space && byte <= CharCodes.Tilde;\n if (isAlphaNumeric) {\n if (this.matchKeyword(Keywords.xref) || this.matchKeyword(Keywords.trailer) || this.matchKeyword(Keywords.startxref) || this.matchIndirectObjectHeader()) {\n this.bytes.moveTo(initialOffset);\n break;\n }\n }\n this.bytes.next();\n }\n };\n /**\n * Skips the binary comment following a PDF header. The specification\n * defines this binary comment (section 7.5.2 File Header) as a sequence of 4\n * or more bytes that are 128 or greater, and which are preceded by a \"%\".\n *\n * This would imply that to strip out this binary comment, we could check for\n * a sequence of bytes starting with \"%\", and remove all subsequent bytes that\n * are 128 or greater. This works for many documents that properly comply with\n * the spec. But in the wild, there are PDFs that omit the leading \"%\", and\n * include bytes that are less than 128 (e.g. 0 or 1). So in order to parse\n * these headers correctly, we just throw out all bytes leading up to the\n * first indirect object header.\n */\n PDFParser.prototype.skipBinaryHeaderComment = function () {\n this.skipWhitespaceAndComments();\n try {\n var initialOffset = this.bytes.offset();\n this.parseIndirectObjectHeader();\n this.bytes.moveTo(initialOffset);\n } catch (e) {\n this.bytes.next();\n this.skipWhitespaceAndComments();\n }\n };\n PDFParser.forBytesWithOptions = function (pdfBytes, objectsPerTick, throwOnInvalidObject, capNumbers) {\n return new PDFParser(pdfBytes, objectsPerTick, throwOnInvalidObject, capNumbers);\n };\n return PDFParser;\n}(PDFObjectParser);\nexport default PDFParser;","\"use strict\";\n\nexports.__esModule = !0, exports.default = exports.Select = void 0;\nvar _base = _interopRequireDefault(require(\"@emotion/styled/base\")),\n _react = _interopRequireWildcard(require(\"react\")),\n _reactDom = _interopRequireDefault(require(\"react-dom\")),\n _ClickOutside = _interopRequireDefault(require(\"./components/ClickOutside\")),\n _Content = _interopRequireDefault(require(\"./components/Content\")),\n _Dropdown = _interopRequireDefault(require(\"./components/Dropdown\")),\n _Loading = _interopRequireDefault(require(\"./components/Loading\")),\n _Clear = _interopRequireDefault(require(\"./components/Clear\")),\n _Separator = _interopRequireDefault(require(\"./components/Separator\")),\n _DropdownHandle = _interopRequireDefault(require(\"./components/DropdownHandle\")),\n _util = require(\"./util\"),\n _constants = require(\"./constants\"),\n _SelectPropsModel = _interopRequireDefault(require(\"./models/SelectPropsModel\"));\nfunction _getRequireWildcardCache(a) {\n if (\"function\" != typeof WeakMap) return null;\n var b = new WeakMap(),\n c = new WeakMap();\n return (_getRequireWildcardCache = function (a) {\n return a ? c : b;\n })(a);\n}\nfunction _interopRequireWildcard(a, b) {\n if (!b && a && a.__esModule) return a;\n if (null === a || \"object\" != typeof a && \"function\" != typeof a) return {\n default: a\n };\n var c = _getRequireWildcardCache(b);\n if (c && c.has(a)) return c.get(a);\n var d = {},\n e = Object.defineProperty && Object.getOwnPropertyDescriptor;\n for (var f in a) if (\"default\" != f && Object.prototype.hasOwnProperty.call(a, f)) {\n var g = e ? Object.getOwnPropertyDescriptor(a, f) : null;\n g && (g.get || g.set) ? Object.defineProperty(d, f, g) : d[f] = a[f];\n }\n return d.default = a, c && c.set(a, d), d;\n}\nfunction _interopRequireDefault(a) {\n return a && a.__esModule ? a : {\n default: a\n };\n}\nfunction _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (a) {\n for (var b, c = 1; c < arguments.length; c++) for (var d in b = arguments[c], b) Object.prototype.hasOwnProperty.call(b, d) && (a[d] = b[d]);\n return a;\n }, _extends.apply(this, arguments);\n}\nfunction _assertThisInitialized(a) {\n if (void 0 === a) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return a;\n}\nfunction _inheritsLoose(a, b) {\n a.prototype = Object.create(b.prototype), a.prototype.constructor = a, _setPrototypeOf(a, b);\n}\nfunction _setPrototypeOf(a, b) {\n return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (a, b) {\n return a.__proto__ = b, a;\n }, _setPrototypeOf(a, b);\n}\nvar Select = /*#__PURE__*/function (a) {\n function b(b) {\n var c;\n return c = a.call(this, b) || this, c.onDropdownClose = function () {\n c.setState({\n cursor: null\n }), c.props.onDropdownClose();\n }, c.onScroll = function () {\n c.props.closeOnScroll && c.dropDown(\"close\"), c.updateSelectBounds();\n }, c.updateSelectBounds = function () {\n return c.select.current && c.setState({\n selectBounds: c.select.current.getBoundingClientRect()\n });\n }, c.getSelectBounds = function () {\n return c.state.selectBounds;\n }, c.dropDown = function (a, b, d) {\n void 0 === a && (a = \"toggle\"), void 0 === d && (d = !1);\n var e = b && b.target || b && b.srcElement;\n return void 0 !== c.props.onDropdownCloseRequest && c.state.dropdown && !1 === d && \"close\" === a ? c.props.onDropdownCloseRequest({\n props: c.props,\n methods: c.methods,\n state: c.state,\n close: function close() {\n return c.dropDown(\"close\", null, !0);\n }\n }) : c.props.portal && !c.props.closeOnScroll && !c.props.closeOnSelect && b && e && e.offsetParent && e.offsetParent.classList.contains(\"react-dropdown-select-dropdown\") ? void 0 : c.props.keepOpen ? c.setState({\n dropdown: !0\n }) : \"close\" === a && c.state.dropdown ? (c.select.current.blur(), c.setState({\n dropdown: !1,\n search: c.props.clearOnBlur ? \"\" : c.state.search,\n searchResults: c.props.options\n })) : \"open\" !== a || c.state.dropdown ? \"toggle\" === a && (c.select.current.focus(), c.setState({\n dropdown: !c.state.dropdown\n })) : c.setState({\n dropdown: !0\n });\n }, c.getSelectRef = function () {\n return c.select.current;\n }, c.addItem = function (a) {\n if (c.props.multi) {\n if ((0, _util.valueExistInSelected)((0, _util.getByPath)(a, c.props.valueField), c.state.values, c.props)) return c.removeItem(null, a, !1);\n c.setState({\n values: [].concat(c.state.values, [a])\n });\n } else c.setState({\n values: [a],\n dropdown: !1\n });\n return c.props.clearOnSelect && c.setState({\n search: \"\"\n }, function () {\n c.setState({\n searchResults: c.searchResults()\n });\n }), !0;\n }, c.removeItem = function (a, b, d) {\n void 0 === d && (d = !1), a && d && (a.preventDefault(), a.stopPropagation(), c.dropDown(\"close\")), c.setState({\n values: c.state.values.filter(function (a) {\n return (0, _util.getByPath)(a, c.props.valueField) !== (0, _util.getByPath)(b, c.props.valueField);\n })\n });\n }, c.setSearch = function (a) {\n c.setState({\n cursor: null\n }), c.setState({\n search: a.target.value\n }, function () {\n c.setState({\n searchResults: c.searchResults()\n });\n });\n }, c.getInputSize = function () {\n return c.state.search ? c.state.search.length : 0 < c.state.values.length ? c.props.addPlaceholder.length : c.props.placeholder.length;\n }, c.toggleSelectAll = function () {\n return c.setState({\n values: 0 === c.state.values.length ? c.selectAll() : c.clearAll()\n });\n }, c.clearAll = function () {\n c.props.onClearAll(), c.setState({\n values: []\n });\n }, c.selectAll = function (a) {\n void 0 === a && (a = []), c.props.onSelectAll();\n var b = 0 < a.length ? a : c.props.options.filter(function (a) {\n return !a.disabled;\n });\n c.setState({\n values: b\n });\n }, c.isSelected = function (a) {\n return !!c.state.values.find(function (b) {\n return (0, _util.getByPath)(b, c.props.valueField) === (0, _util.getByPath)(a, c.props.valueField);\n });\n }, c.areAllSelected = function () {\n return c.state.values.length === c.props.options.filter(function (a) {\n return !a.disabled;\n }).length;\n }, c.safeString = function (a) {\n return a.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n }, c.sortBy = function () {\n var a = c.props,\n d = a.sortBy,\n e = a.options;\n return d ? (e.sort(function (c, a) {\n return (0, _util.getProp)(c, d) < (0, _util.getProp)(a, d) ? -1 : (0, _util.getProp)(c, d) > (0, _util.getProp)(a, d) ? 1 : 0;\n }), e) : e;\n }, c.searchFn = function (a) {\n var b = a.state,\n d = a.methods,\n e = new RegExp(d.safeString(b.search), \"i\");\n return d.sortBy().filter(function (a) {\n return e.test((0, _util.getByPath)(a, c.props.searchBy) || (0, _util.getByPath)(a, c.props.valueField));\n });\n }, c.searchResults = function () {\n var a = {\n state: c.state,\n props: c.props,\n methods: c.methods\n };\n return c.props.searchFn(a) || c.searchFn(a);\n }, c.activeCursorItem = function (a) {\n return c.setState({\n activeCursorItem: a\n });\n }, c.handleKeyDown = function (a) {\n var b = {\n event: a,\n state: c.state,\n props: c.props,\n methods: c.methods,\n setState: c.setState.bind(_assertThisInitialized(c))\n };\n return c.props.handleKeyDownFn(b) || c.handleKeyDownFn(b);\n }, c.handleKeyDownFn = function (a) {\n var b = a.event,\n d = a.state,\n e = a.props,\n f = a.methods,\n g = a.setState,\n h = d.cursor,\n i = d.searchResults,\n j = \"Escape\" === b.key,\n k = \"Enter\" === b.key,\n l = \"ArrowUp\" === b.key,\n m = \"ArrowDown\" === b.key,\n n = \"Backspace\" === b.key,\n o = \"Tab\" === b.key && !b.shiftKey,\n p = b.shiftKey && \"Tab\" === b.key;\n if (m && !d.dropdown) return b.preventDefault(), c.dropDown(\"open\"), g({\n cursor: 0\n });\n if ((m || o && d.dropdown) && null === h) return g({\n cursor: 0\n });\n if ((l || m || p && d.dropdown || o && d.dropdown) && b.preventDefault(), j && c.dropDown(\"close\"), k) {\n var q = i[h];\n if (q && !q.disabled) {\n if (e.create && (0, _util.valueExistInSelected)(d.search, d.values, e)) return null;\n f.addItem(q);\n }\n }\n return (m || o && d.dropdown) && i.length === h ? g({\n cursor: 0\n }) : void ((m || o && d.dropdown) && g(function (a) {\n return {\n cursor: a.cursor + 1\n };\n }), (l || p && d.dropdown) && 0 < h && g(function (a) {\n return {\n cursor: a.cursor - 1\n };\n }), (l || p && d.dropdown) && 0 === h && g({\n cursor: i.length\n }), n && e.backspaceDelete && 0 === c.getInputSize() && c.setState({\n values: c.state.values.slice(0, -1)\n }));\n }, c.renderDropdown = function () {\n return c.props.portal ? /*#__PURE__*/_reactDom.default.createPortal(/*#__PURE__*/_react.default.createElement(_Dropdown.default, {\n props: c.props,\n state: c.state,\n methods: c.methods\n }), c.dropdownRoot) : /*#__PURE__*/_react.default.createElement(_Dropdown.default, {\n props: c.props,\n state: c.state,\n methods: c.methods\n });\n }, c.createNew = function (a) {\n var b,\n d = (b = {}, b[c.props.labelField] = a, b[c.props.valueField] = a, b);\n c.addItem(d), c.props.onCreateNew(d), c.setState({\n search: \"\"\n });\n }, c.state = {\n dropdown: !1,\n values: b.values,\n search: \"\",\n selectBounds: {},\n cursor: null,\n searchResults: b.options\n }, c.methods = {\n activeCursorItem: c.activeCursorItem,\n addItem: c.addItem,\n areAllSelected: c.areAllSelected,\n clearAll: c.clearAll,\n createNew: c.createNew,\n dropDown: c.dropDown,\n getInputSize: c.getInputSize,\n getSelectBounds: c.getSelectBounds,\n getSelectRef: c.getSelectRef,\n handleKeyDown: c.handleKeyDown,\n isSelected: c.isSelected,\n removeItem: c.removeItem,\n safeString: c.safeString,\n searchResults: c.searchResults,\n selectAll: c.selectAll,\n setSearch: c.setSearch,\n sortBy: c.sortBy,\n toggleSelectAll: c.toggleSelectAll\n }, c.select = /*#__PURE__*/_react.default.createRef(), c.dropdownRoot = \"undefined\" != typeof document && document.createElement(\"div\"), c;\n }\n _inheritsLoose(b, a);\n var c = b.prototype;\n return c.componentDidMount = function componentDidMount() {\n this.props.portal && this.props.portal.appendChild(this.dropdownRoot), (0, _util.isomorphicWindow)().addEventListener(\"resize\", (0, _util.debounce)(this.updateSelectBounds)), (0, _util.isomorphicWindow)().addEventListener(\"scroll\", (0, _util.debounce)(this.onScroll)), this.dropDown(\"close\"), this.select && this.updateSelectBounds(), this.props.defaultMenuIsOpen && this.dropDown(\"open\");\n }, c.componentDidUpdate = function componentDidUpdate(a, b) {\n var c = this;\n !this.props.compareValuesFunc(a.values, this.props.values) && this.props.compareValuesFunc(a.values, b.values) && (this.setState({\n values: this.props.values\n }, function () {\n c.props.onChange(c.state.values);\n }), this.updateSelectBounds()), a.options !== this.props.options && this.setState({\n searchResults: this.searchResults()\n }), b.values !== this.state.values && (this.props.onChange(this.state.values), this.updateSelectBounds()), b.search !== this.state.search && this.updateSelectBounds(), b.values !== this.state.values && this.props.closeOnSelect && this.dropDown(\"close\"), a.multi !== this.props.multi && this.updateSelectBounds(), b.dropdown && b.dropdown !== this.state.dropdown && this.onDropdownClose(), b.dropdown || b.dropdown === this.state.dropdown || this.props.onDropdownOpen();\n }, c.componentWillUnmount = function componentWillUnmount() {\n this.props.portal && this.props.portal.removeChild(this.dropdownRoot), (0, _util.isomorphicWindow)().removeEventListener(\"resize\", (0, _util.debounce)(this.updateSelectBounds, this.props.debounceDelay)), (0, _util.isomorphicWindow)().removeEventListener(\"scroll\", (0, _util.debounce)(this.onScroll, this.props.debounceDelay));\n }, c.render = function render() {\n var a = this;\n return /*#__PURE__*/_react.default.createElement(_ClickOutside.default, {\n onClickOutside: function onClickOutside(b) {\n return a.dropDown(\"close\", b);\n }\n }, /*#__PURE__*/_react.default.createElement(ReactDropdownSelect, _extends({\n onKeyDown: this.handleKeyDown,\n \"aria-label\": \"Dropdown select\",\n \"aria-expanded\": this.state.dropdown,\n onClick: function onClick(b) {\n return a.dropDown(\"open\", b);\n },\n tabIndex: this.props.disabled ? \"-1\" : \"0\",\n direction: this.props.direction,\n style: this.props.style,\n ref: this.select,\n disabled: this.props.disabled,\n className: _constants.LIB_NAME + \" \" + this.props.className,\n color: this.props.color\n }, this.props.additionalProps), /*#__PURE__*/_react.default.createElement(_Content.default, {\n props: this.props,\n state: this.state,\n methods: this.methods\n }), (this.props.name || this.props.required) && /*#__PURE__*/_react.default.createElement(\"input\", {\n tabIndex: -1,\n style: {\n opacity: 0,\n width: 0,\n position: \"absolute\"\n },\n name: this.props.name,\n required: this.props.required,\n pattern: this.props.pattern,\n defaultValue: this.state.values.map(function (b) {\n return b[a.props.labelField];\n }).toString() || [],\n disabled: this.props.disabled\n }), this.props.loading && /*#__PURE__*/_react.default.createElement(_Loading.default, {\n props: this.props\n }), this.props.clearable && /*#__PURE__*/_react.default.createElement(_Clear.default, {\n props: this.props,\n state: this.state,\n methods: this.methods\n }), this.props.separator && /*#__PURE__*/_react.default.createElement(_Separator.default, {\n props: this.props,\n state: this.state,\n methods: this.methods\n }), this.props.dropdownHandle && /*#__PURE__*/_react.default.createElement(_DropdownHandle.default, {\n onClick: function onClick() {\n return a.select.current.focus();\n },\n props: this.props,\n state: this.state,\n methods: this.methods\n }), this.state.dropdown && !this.props.disabled && this.renderDropdown()));\n }, b;\n}(_react.Component);\nexports.Select = Select, Select.defaultProps = {\n addPlaceholder: \"\",\n additionalProps: null,\n autoFocus: !1,\n backspaceDelete: !0,\n clearAllLabel: \"Clear all\",\n clearOnBlur: !0,\n clearOnSelect: !0,\n clearable: !1,\n closeOnScroll: !1,\n closeOnSelect: !1,\n closeOnClickInput: !1,\n color: \"#0074D9\",\n compareValuesFunc: _util.isEqual,\n create: !1,\n createNewLabel: \"add {search}\",\n debounceDelay: 0,\n direction: \"ltr\",\n disabled: !1,\n disabledLabel: \"disabled\",\n dropdownGap: 5,\n dropdownHandle: !0,\n dropdownHeight: \"300px\",\n dropdownPosition: \"bottom\",\n handleKeyDownFn: function handleKeyDownFn() {},\n keepOpen: !1,\n keepSelectedInList: !0,\n labelField: \"label\",\n loading: !1,\n multi: !1,\n name: null,\n noDataLabel: \"No data\",\n onChange: function onChange() {},\n onClearAll: function onClearAll() {},\n onCreateNew: function onCreateNew() {},\n onDropdownClose: function onDropdownClose() {},\n onDropdownCloseRequest: void 0,\n onDropdownOpen: function onDropdownOpen() {},\n onSelectAll: function onSelectAll() {},\n options: [],\n pattern: void 0,\n placeholder: \"Select...\",\n portal: null,\n required: !1,\n searchBy: \"label\",\n searchFn: function searchFn() {},\n searchable: !0,\n selectAll: !1,\n selectAllLabel: \"Select all\",\n separator: !1,\n sortBy: null,\n valueField: \"value\",\n values: [],\n defaultMenuIsOpen: !1\n};\nvar ReactDropdownSelect = /*#__PURE__*/(0, _base.default)(\"div\", \"production\" === process.env.NODE_ENV ? {\n target: \"e1gzf2xs0\"\n } : {\n target: \"e1gzf2xs0\",\n label: \"ReactDropdownSelect\"\n })(\"box-sizing:border-box;position:relative;display:flex;border:1px solid #ccc;width:100%;border-radius:2px;padding:2px 5px;flex-direction:row;direction:\", function (a) {\n var b = a.direction;\n return b;\n }, \";align-items:center;cursor:pointer;min-height:36px;\", function (a) {\n var b = a.disabled;\n return b ? \"cursor: not-allowed;pointer-events: none;opacity: 0.3;\" : \"pointer-events: all;\";\n }, \" :hover,:focus-within{border-color:\", function (a) {\n var b = a.color;\n return b;\n }, \";}:focus,:focus-within{outline:0;box-shadow:0 0 0 3px \", function (a) {\n var b = a.color;\n return (0, _util.hexToRGBA)(b, .2);\n }, \";}*{box-sizing:border-box;}\" + (\"production\" === process.env.NODE_ENV ? \"\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iAwLCB3aWR0aDogMCwgcG9zaXRpb246ICdhYnNvbHV0ZScgfX1cbiAgICAgICAgICAgICAgbmFtZT17dGhpcy5wcm9wcy5uYW1lfVxuICAgICAgICAgICAgICByZXF1aXJlZD17dGhpcy5wcm9wcy5yZXF1aXJlZH1cbiAgICAgICAgICAgICAgcGF0dGVybj17dGhpcy5wcm9wcy5wYXR0ZXJufVxuICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU9e1xuICAgICAgICAgICAgICAgIHRoaXMuc3RhdGUudmFsdWVzLm1hcCgodmFsdWUpID0+IHZhbHVlW3RoaXMucHJvcHMubGFiZWxGaWVsZF0pLnRvU3RyaW5nKCkgfHwgW11cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBkaXNhYmxlZD17dGhpcy5wcm9wcy5kaXNhYmxlZH1cbiAgICAgICAgICAgIC8+XG4gICAgICAgICAgKX1cblxuICAgICAgICAgIHt0aGlzLnByb3BzLmxvYWRpbmcgJiYgPExvYWRpbmcgcHJvcHM9e3RoaXMucHJvcHN9IC8+fVxuXG4gICAgICAgICAge3RoaXMucHJvcHMuY2xlYXJhYmxlICYmIChcbiAgICAgICAgICAgIDxDbGVhciBwcm9wcz17dGhpcy5wcm9wc30gc3RhdGU9e3RoaXMuc3RhdGV9IG1ldGhvZHM9e3RoaXMubWV0aG9kc30gLz5cbiAgICAgICAgICApfVxuXG4gICAgICAgICAge3RoaXMucHJvcHMuc2VwYXJhdG9yICYmIChcbiAgICAgICAgICAgIDxTZXBhcmF0b3IgcHJvcHM9e3RoaXMucHJvcHN9IHN0YXRlPXt0aGlzLnN0YXRlfSBtZXRob2RzPXt0aGlzLm1ldGhvZHN9IC8+XG4gICAgICAgICAgKX1cblxuICAgICAgICAgIHt0aGlzLnByb3BzLmRyb3Bkb3duSGFuZGxlICYmIChcbiAgICAgICAgICAgIDxEcm9wZG93bkhhbmRsZVxuICAgICAgICAgICAgICBvbkNsaWNrPXsoKSA9PiB0aGlzLnNlbGVjdC5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ports.default = _default;","/*\n * The `chars`, `lookup`, `encode`, and `decode` members of this file are\n * licensed under the following:\n *\n * base64-arraybuffer\n * https://github.com/niklasvh/base64-arraybuffer\n *\n * Copyright (c) 2012 Niklas von Hertzen\n * Licensed under the MIT license.\n *\n */\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n// Use a lookup table to find the index.\nvar lookup = new Uint8Array(256);\nfor (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\nexport var encodeToBase64 = function (bytes) {\n var base64 = '';\n var len = bytes.length;\n for (var i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64 += chars[bytes[i + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n return base64;\n};\nexport var decodeFromBase64 = function (base64) {\n var bufferLength = base64.length * 0.75;\n var len = base64.length;\n var i;\n var p = 0;\n var encoded1;\n var encoded2;\n var encoded3;\n var encoded4;\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n var bytes = new Uint8Array(bufferLength);\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n bytes[p++] = encoded1 << 2 | encoded2 >> 4;\n bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;\n bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;\n }\n return bytes;\n};\n// This regex is designed to be as flexible as possible. It will parse certain\n// invalid data URIs.\nvar DATA_URI_PREFIX_REGEX = /^(data)?:?([\\w\\/\\+]+)?;?(charset=[\\w-]+|base64)?.*,/i;\n/**\n * If the `dataUri` input is a data URI, then the data URI prefix must not be\n * longer than 100 characters, or this function will fail to decode it.\n *\n * @param dataUri a base64 data URI or plain base64 string\n * @returns a Uint8Array containing the decoded input\n */\nexport var decodeFromBase64DataUri = function (dataUri) {\n var trimmedUri = dataUri.trim();\n var prefix = trimmedUri.substring(0, 100);\n var res = prefix.match(DATA_URI_PREFIX_REGEX);\n // Assume it's not a data URI - just a plain base64 string\n if (!res) return decodeFromBase64(trimmedUri);\n // Remove the data URI prefix and parse the remainder as a base64 string\n var fullMatch = res[0];\n var data = trimmedUri.substring(fullMatch.length);\n return decodeFromBase64(data);\n};","import { toCharCode } from \"./strings\";\n// Mapping from PDFDocEncoding to Unicode code point\nvar pdfDocEncodingToUnicode = new Uint16Array(256);\n// Initialize the code points which are the same\nfor (var idx = 0; idx < 256; idx++) {\n pdfDocEncodingToUnicode[idx] = idx;\n}\n// Set differences (see \"Table D.2 – PDFDocEncoding Character Set\" of the PDF spec)\npdfDocEncodingToUnicode[0x16] = toCharCode('\\u0017'); // SYNCRONOUS IDLE\npdfDocEncodingToUnicode[0x18] = toCharCode('\\u02D8'); // BREVE\npdfDocEncodingToUnicode[0x19] = toCharCode('\\u02C7'); // CARON\npdfDocEncodingToUnicode[0x1a] = toCharCode('\\u02C6'); // MODIFIER LETTER CIRCUMFLEX ACCENT\npdfDocEncodingToUnicode[0x1b] = toCharCode('\\u02D9'); // DOT ABOVE\npdfDocEncodingToUnicode[0x1c] = toCharCode('\\u02DD'); // DOUBLE ACUTE ACCENT\npdfDocEncodingToUnicode[0x1d] = toCharCode('\\u02DB'); // OGONEK\npdfDocEncodingToUnicode[0x1e] = toCharCode('\\u02DA'); // RING ABOVE\npdfDocEncodingToUnicode[0x1f] = toCharCode('\\u02DC'); // SMALL TILDE\npdfDocEncodingToUnicode[0x7f] = toCharCode('\\uFFFD'); // REPLACEMENT CHARACTER (box with questionmark)\npdfDocEncodingToUnicode[0x80] = toCharCode('\\u2022'); // BULLET\npdfDocEncodingToUnicode[0x81] = toCharCode('\\u2020'); // DAGGER\npdfDocEncodingToUnicode[0x82] = toCharCode('\\u2021'); // DOUBLE DAGGER\npdfDocEncodingToUnicode[0x83] = toCharCode('\\u2026'); // HORIZONTAL ELLIPSIS\npdfDocEncodingToUnicode[0x84] = toCharCode('\\u2014'); // EM DASH\npdfDocEncodingToUnicode[0x85] = toCharCode('\\u2013'); // EN DASH\npdfDocEncodingToUnicode[0x86] = toCharCode('\\u0192'); // LATIN SMALL LETTER SCRIPT F\npdfDocEncodingToUnicode[0x87] = toCharCode('\\u2044'); // FRACTION SLASH (solidus)\npdfDocEncodingToUnicode[0x88] = toCharCode('\\u2039'); // SINGLE LEFT-POINTING ANGLE QUOTATION MARK\npdfDocEncodingToUnicode[0x89] = toCharCode('\\u203A'); // SINGLE RIGHT-POINTING ANGLE QUOTATION MARK\npdfDocEncodingToUnicode[0x8a] = toCharCode('\\u2212'); // MINUS SIGN\npdfDocEncodingToUnicode[0x8b] = toCharCode('\\u2030'); // PER MILLE SIGN\npdfDocEncodingToUnicode[0x8c] = toCharCode('\\u201E'); // DOUBLE LOW-9 QUOTATION MARK (quotedblbase)\npdfDocEncodingToUnicode[0x8d] = toCharCode('\\u201C'); // LEFT DOUBLE QUOTATION MARK (quotedblleft)\npdfDocEncodingToUnicode[0x8e] = toCharCode('\\u201D'); // RIGHT DOUBLE QUOTATION MARK (quotedblright)\npdfDocEncodingToUnicode[0x8f] = toCharCode('\\u2018'); // LEFT SINGLE QUOTATION MARK (quoteleft)\npdfDocEncodingToUnicode[0x90] = toCharCode('\\u2019'); // RIGHT SINGLE QUOTATION MARK (quoteright)\npdfDocEncodingToUnicode[0x91] = toCharCode('\\u201A'); // SINGLE LOW-9 QUOTATION MARK (quotesinglbase)\npdfDocEncodingToUnicode[0x92] = toCharCode('\\u2122'); // TRADE MARK SIGN\npdfDocEncodingToUnicode[0x93] = toCharCode('\\uFB01'); // LATIN SMALL LIGATURE FI\npdfDocEncodingToUnicode[0x94] = toCharCode('\\uFB02'); // LATIN SMALL LIGATURE FL\npdfDocEncodingToUnicode[0x95] = toCharCode('\\u0141'); // LATIN CAPITAL LETTER L WITH STROKE\npdfDocEncodingToUnicode[0x96] = toCharCode('\\u0152'); // LATIN CAPITAL LIGATURE OE\npdfDocEncodingToUnicode[0x97] = toCharCode('\\u0160'); // LATIN CAPITAL LETTER S WITH CARON\npdfDocEncodingToUnicode[0x98] = toCharCode('\\u0178'); // LATIN CAPITAL LETTER Y WITH DIAERESIS\npdfDocEncodingToUnicode[0x99] = toCharCode('\\u017D'); // LATIN CAPITAL LETTER Z WITH CARON\npdfDocEncodingToUnicode[0x9a] = toCharCode('\\u0131'); // LATIN SMALL LETTER DOTLESS I\npdfDocEncodingToUnicode[0x9b] = toCharCode('\\u0142'); // LATIN SMALL LETTER L WITH STROKE\npdfDocEncodingToUnicode[0x9c] = toCharCode('\\u0153'); // LATIN SMALL LIGATURE OE\npdfDocEncodingToUnicode[0x9d] = toCharCode('\\u0161'); // LATIN SMALL LETTER S WITH CARON\npdfDocEncodingToUnicode[0x9e] = toCharCode('\\u017E'); // LATIN SMALL LETTER Z WITH CARON\npdfDocEncodingToUnicode[0x9f] = toCharCode('\\uFFFD'); // REPLACEMENT CHARACTER (box with questionmark)\npdfDocEncodingToUnicode[0xa0] = toCharCode('\\u20AC'); // EURO SIGN\npdfDocEncodingToUnicode[0xad] = toCharCode('\\uFFFD'); // REPLACEMENT CHARACTER (box with questionmark)\n/**\n * Decode a byte array into a string using PDFDocEncoding.\n *\n * @param bytes a byte array (decimal representation) containing a string\n * encoded with PDFDocEncoding.\n */\nexport var pdfDocEncodingDecode = function (bytes) {\n var codePoints = new Array(bytes.length);\n for (var idx = 0, len = bytes.length; idx < len; idx++) {\n codePoints[idx] = pdfDocEncodingToUnicode[bytes[idx]];\n }\n return String.fromCodePoint.apply(String, codePoints);\n};","import { decodeFromBase64DataUri } from \"./base64\";\nimport { charFromCode } from \"./strings\";\nexport var last = function (array) {\n return array[array.length - 1];\n};\n// export const dropLast = (array: T[]): T[] =>\n// array.slice(0, array.length - 1);\nexport var typedArrayFor = function (value) {\n if (value instanceof Uint8Array) return value;\n var length = value.length;\n var typedArray = new Uint8Array(length);\n for (var idx = 0; idx < length; idx++) {\n typedArray[idx] = value.charCodeAt(idx);\n }\n return typedArray;\n};\nexport var mergeIntoTypedArray = function () {\n var arrays = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n arrays[_i] = arguments[_i];\n }\n var arrayCount = arrays.length;\n var typedArrays = [];\n for (var idx = 0; idx < arrayCount; idx++) {\n var element = arrays[idx];\n typedArrays[idx] = element instanceof Uint8Array ? element : typedArrayFor(element);\n }\n var totalSize = 0;\n for (var idx = 0; idx < arrayCount; idx++) {\n totalSize += arrays[idx].length;\n }\n var merged = new Uint8Array(totalSize);\n var offset = 0;\n for (var arrIdx = 0; arrIdx < arrayCount; arrIdx++) {\n var arr = typedArrays[arrIdx];\n for (var byteIdx = 0, arrLen = arr.length; byteIdx < arrLen; byteIdx++) {\n merged[offset++] = arr[byteIdx];\n }\n }\n return merged;\n};\nexport var mergeUint8Arrays = function (arrays) {\n var totalSize = 0;\n for (var idx = 0, len = arrays.length; idx < len; idx++) {\n totalSize += arrays[idx].length;\n }\n var mergedBuffer = new Uint8Array(totalSize);\n var offset = 0;\n for (var idx = 0, len = arrays.length; idx < len; idx++) {\n var array = arrays[idx];\n mergedBuffer.set(array, offset);\n offset += array.length;\n }\n return mergedBuffer;\n};\nexport var arrayAsString = function (array) {\n var str = '';\n for (var idx = 0, len = array.length; idx < len; idx++) {\n str += charFromCode(array[idx]);\n }\n return str;\n};\nexport var byAscendingId = function (a, b) {\n return a.id - b.id;\n};\nexport var sortedUniq = function (array, indexer) {\n var uniq = [];\n for (var idx = 0, len = array.length; idx < len; idx++) {\n var curr = array[idx];\n var prev = array[idx - 1];\n if (idx === 0 || indexer(curr) !== indexer(prev)) {\n uniq.push(curr);\n }\n }\n return uniq;\n};\n// Arrays and TypedArrays in JS both have .reverse() methods, which would seem\n// to negate the need for this function. However, not all runtimes support this\n// method (e.g. React Native). This function compensates for that fact.\nexport var reverseArray = function (array) {\n var arrayLen = array.length;\n for (var idx = 0, len = Math.floor(arrayLen / 2); idx < len; idx++) {\n var leftIdx = idx;\n var rightIdx = arrayLen - idx - 1;\n var temp = array[idx];\n array[leftIdx] = array[rightIdx];\n array[rightIdx] = temp;\n }\n return array;\n};\nexport var sum = function (array) {\n var total = 0;\n for (var idx = 0, len = array.length; idx < len; idx++) {\n total += array[idx];\n }\n return total;\n};\nexport var range = function (start, end) {\n var arr = new Array(end - start);\n for (var idx = 0, len = arr.length; idx < len; idx++) {\n arr[idx] = start + idx;\n }\n return arr;\n};\nexport var pluckIndices = function (arr, indices) {\n var plucked = new Array(indices.length);\n for (var idx = 0, len = indices.length; idx < len; idx++) {\n plucked[idx] = arr[indices[idx]];\n }\n return plucked;\n};\nexport var canBeConvertedToUint8Array = function (input) {\n return input instanceof Uint8Array || input instanceof ArrayBuffer || typeof input === 'string';\n};\nexport var toUint8Array = function (input) {\n if (typeof input === 'string') {\n return decodeFromBase64DataUri(input);\n } else if (input instanceof ArrayBuffer) {\n return new Uint8Array(input);\n } else if (input instanceof Uint8Array) {\n return input;\n } else {\n throw new TypeError('`input` must be one of `string | ArrayBuffer | Uint8Array`');\n }\n};","/**\n * Returns a Promise that resolves after at least one tick of the\n * Macro Task Queue occurs.\n */\nexport var waitForTick = function () {\n return new Promise(function (resolve) {\n setTimeout(function () {\n return resolve();\n }, 0);\n });\n};","// tslint:disable radix\n/**\n * Converts a number to its string representation in decimal. This function\n * differs from simply converting a number to a string with `.toString()`\n * because this function's output string will **not** contain exponential\n * notation.\n *\n * Credit: https://stackoverflow.com/a/46545519\n */\nexport var numberToString = function (num) {\n var numStr = String(num);\n if (Math.abs(num) < 1.0) {\n var e = parseInt(num.toString().split('e-')[1]);\n if (e) {\n var negative = num < 0;\n if (negative) num *= -1;\n num *= Math.pow(10, e - 1);\n numStr = '0.' + new Array(e).join('0') + num.toString().substring(2);\n if (negative) numStr = '-' + numStr;\n }\n } else {\n var e = parseInt(num.toString().split('+')[1]);\n if (e > 20) {\n e -= 20;\n num /= Math.pow(10, e);\n numStr = num.toString() + new Array(e + 1).join('0');\n }\n }\n return numStr;\n};\nexport var sizeInBytes = function (n) {\n return Math.ceil(n.toString(2).length / 8);\n};\n/**\n * Converts a number into its constituent bytes and returns them as\n * a number[].\n *\n * Returns most significant byte as first element in array. It may be necessary\n * to call .reverse() to get the bits in the desired order.\n *\n * Example:\n * bytesFor(0x02A41E) => [ 0b10, 0b10100100, 0b11110 ]\n *\n * Credit for algorithm: https://stackoverflow.com/a/1936865\n */\nexport var bytesFor = function (n) {\n var bytes = new Uint8Array(sizeInBytes(n));\n for (var i = 1; i <= bytes.length; i++) {\n bytes[i - 1] = n >> (bytes.length - i) * 8;\n }\n return bytes;\n};","export var error = function (msg) {\n throw new Error(msg);\n};","import { FontNames } from '@pdf-lib/standard-fonts';\nexport var values = function (obj) {\n return Object.keys(obj).map(function (k) {\n return obj[k];\n });\n};\nexport var StandardFontValues = values(FontNames);\nexport var isStandardFont = function (input) {\n return StandardFontValues.includes(input);\n};\nexport var rectanglesAreEqual = function (a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n};","/* tslint:disable:ban-types */\nimport { values as objectValues } from \"./objects\";\nexport var backtick = function (val) {\n return \"`\" + val + \"`\";\n};\nexport var singleQuote = function (val) {\n return \"'\" + val + \"'\";\n};\n// prettier-ignore\nvar formatValue = function (value) {\n var type = typeof value;\n if (type === 'string') return singleQuote(value);else if (type === 'undefined') return backtick(value);else return value;\n};\nexport var createValueErrorMsg = function (value, valueName, values) {\n var allowedValues = new Array(values.length);\n for (var idx = 0, len = values.length; idx < len; idx++) {\n var v = values[idx];\n allowedValues[idx] = formatValue(v);\n }\n var joinedValues = allowedValues.join(' or ');\n // prettier-ignore\n return backtick(valueName) + \" must be one of \" + joinedValues + \", but was actually \" + formatValue(value);\n};\nexport var assertIsOneOf = function (value, valueName, allowedValues) {\n if (!Array.isArray(allowedValues)) {\n allowedValues = objectValues(allowedValues);\n }\n for (var idx = 0, len = allowedValues.length; idx < len; idx++) {\n if (value === allowedValues[idx]) return;\n }\n throw new TypeError(createValueErrorMsg(value, valueName, allowedValues));\n};\nexport var assertIsOneOfOrUndefined = function (value, valueName, allowedValues) {\n if (!Array.isArray(allowedValues)) {\n allowedValues = objectValues(allowedValues);\n }\n assertIsOneOf(value, valueName, allowedValues.concat(undefined));\n};\nexport var assertIsSubset = function (values, valueName, allowedValues) {\n if (!Array.isArray(allowedValues)) {\n allowedValues = objectValues(allowedValues);\n }\n for (var idx = 0, len = values.length; idx < len; idx++) {\n assertIsOneOf(values[idx], valueName, allowedValues);\n }\n};\nexport var getType = function (val) {\n if (val === null) return 'null';\n if (val === undefined) return 'undefined';\n if (typeof val === 'string') return 'string';\n if (isNaN(val)) return 'NaN';\n if (typeof val === 'number') return 'number';\n if (typeof val === 'boolean') return 'boolean';\n if (typeof val === 'symbol') return 'symbol';\n if (typeof val === 'bigint') return 'bigint';\n if (val.constructor && val.constructor.name) return val.constructor.name;\n if (val.name) return val.name;\n if (val.constructor) return String(val.constructor);\n return String(val);\n};\nexport var isType = function (value, type) {\n if (type === 'null') return value === null;\n if (type === 'undefined') return value === undefined;\n if (type === 'string') return typeof value === 'string';\n if (type === 'number') return typeof value === 'number' && !isNaN(value);\n if (type === 'boolean') return typeof value === 'boolean';\n if (type === 'symbol') return typeof value === 'symbol';\n if (type === 'bigint') return typeof value === 'bigint';\n if (type === Date) return value instanceof Date;\n if (type === Array) return value instanceof Array;\n if (type === Uint8Array) return value instanceof Uint8Array;\n if (type === ArrayBuffer) return value instanceof ArrayBuffer;\n if (type === Function) return value instanceof Function;\n return value instanceof type[0];\n};\nexport var createTypeErrorMsg = function (value, valueName, types) {\n var allowedTypes = new Array(types.length);\n for (var idx = 0, len = types.length; idx < len; idx++) {\n var type = types[idx];\n if (type === 'null') allowedTypes[idx] = backtick('null');\n if (type === 'undefined') allowedTypes[idx] = backtick('undefined');\n if (type === 'string') allowedTypes[idx] = backtick('string');else if (type === 'number') allowedTypes[idx] = backtick('number');else if (type === 'boolean') allowedTypes[idx] = backtick('boolean');else if (type === 'symbol') allowedTypes[idx] = backtick('symbol');else if (type === 'bigint') allowedTypes[idx] = backtick('bigint');else if (type === Array) allowedTypes[idx] = backtick('Array');else if (type === Uint8Array) allowedTypes[idx] = backtick('Uint8Array');else if (type === ArrayBuffer) allowedTypes[idx] = backtick('ArrayBuffer');else allowedTypes[idx] = backtick(type[1]);\n }\n var joinedTypes = allowedTypes.join(' or ');\n // prettier-ignore\n return backtick(valueName) + \" must be of type \" + joinedTypes + \", but was actually of type \" + backtick(getType(value));\n};\nexport var assertIs = function (value, valueName, types) {\n for (var idx = 0, len = types.length; idx < len; idx++) {\n if (isType(value, types[idx])) return;\n }\n throw new TypeError(createTypeErrorMsg(value, valueName, types));\n};\nexport var assertOrUndefined = function (value, valueName, types) {\n assertIs(value, valueName, types.concat('undefined'));\n};\nexport var assertEachIs = function (values, valueName, types) {\n for (var idx = 0, len = values.length; idx < len; idx++) {\n assertIs(values[idx], valueName, types);\n }\n};\nexport var assertRange = function (value, valueName, min, max) {\n assertIs(value, valueName, ['number']);\n assertIs(min, 'min', ['number']);\n assertIs(max, 'max', ['number']);\n max = Math.max(min, max);\n if (value < min || value > max) {\n // prettier-ignore\n throw new Error(backtick(valueName) + \" must be at least \" + min + \" and at most \" + max + \", but was actually \" + value);\n }\n};\nexport var assertRangeOrUndefined = function (value, valueName, min, max) {\n assertIs(value, valueName, ['number', 'undefined']);\n if (typeof value === 'number') assertRange(value, valueName, min, max);\n};\nexport var assertMultiple = function (value, valueName, multiplier) {\n assertIs(value, valueName, ['number']);\n if (value % multiplier !== 0) {\n // prettier-ignore\n throw new Error(backtick(valueName) + \" must be a multiple of \" + multiplier + \", but was actually \" + value);\n }\n};\nexport var assertInteger = function (value, valueName) {\n if (!Number.isInteger(value)) {\n throw new Error(backtick(valueName) + \" must be an integer, but was actually \" + value);\n }\n};\nexport var assertPositive = function (value, valueName) {\n if (![1, 0].includes(Math.sign(value))) {\n // prettier-ignore\n throw new Error(backtick(valueName) + \" must be a positive number or 0, but was actually \" + value);\n }\n};","var Cache = /** @class */function () {\n function Cache(populate) {\n this.populate = populate;\n this.value = undefined;\n }\n Cache.prototype.getValue = function () {\n return this.value;\n };\n Cache.prototype.access = function () {\n if (!this.value) this.value = this.populate();\n return this.value;\n };\n Cache.prototype.invalidate = function () {\n this.value = undefined;\n };\n Cache.populatedBy = function (populate) {\n return new Cache(populate);\n };\n return Cache;\n}();\nexport default Cache;","'use strict';\n\nvar TYPED_OK = typeof Uint8Array !== 'undefined' && typeof Uint16Array !== 'undefined' && typeof Int32Array !== 'undefined';\nfunction _has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\nexports.assign = function (obj /*from1, from2, from3, ...*/) {\n var sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source) {\n continue;\n }\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n for (var p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n return obj;\n};\n\n// reduce buffer size, avoiding mem copy\nexports.shrinkBuf = function (buf, size) {\n if (buf.length === size) {\n return buf;\n }\n if (buf.subarray) {\n return buf.subarray(0, size);\n }\n buf.length = size;\n return buf;\n};\nvar fnTyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n // Fallback to ordinary array\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n var i, l, len, pos, chunk, result;\n\n // calculate data length\n len = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n result = new Uint8Array(len);\n pos = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n return result;\n }\n};\nvar fnUntyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n return [].concat.apply([], chunks);\n }\n};\n\n// Enable/Disable typed arrays use, for testing\n//\nexports.setTyped = function (on) {\n if (on) {\n exports.Buf8 = Uint8Array;\n exports.Buf16 = Uint16Array;\n exports.Buf32 = Int32Array;\n exports.assign(exports, fnTyped);\n } else {\n exports.Buf8 = Array;\n exports.Buf16 = Array;\n exports.Buf32 = Array;\n exports.assign(exports, fnUntyped);\n }\n};\nexports.setTyped(TYPED_OK);","//! moment.js\n//! version : 2.30.1\n//! authors : Tim Wood, Iskren Chernev, Moment.js contributors\n//! license : MIT\n//! momentjs.com\n\n;\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.moment = factory();\n})(this, function () {\n 'use strict';\n\n var hookCallback;\n function hooks() {\n return hookCallback.apply(null, arguments);\n }\n\n // This is done to register the method called with moment()\n // without creating circular dependencies.\n function setHookCallback(callback) {\n hookCallback = callback;\n }\n function isArray(input) {\n return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';\n }\n function isObject(input) {\n // IE8 will treat undefined and null as object if it wasn't for\n // input != null\n return input != null && Object.prototype.toString.call(input) === '[object Object]';\n }\n function hasOwnProp(a, b) {\n return Object.prototype.hasOwnProperty.call(a, b);\n }\n function isObjectEmpty(obj) {\n if (Object.getOwnPropertyNames) {\n return Object.getOwnPropertyNames(obj).length === 0;\n } else {\n var k;\n for (k in obj) {\n if (hasOwnProp(obj, k)) {\n return false;\n }\n }\n return true;\n }\n }\n function isUndefined(input) {\n return input === void 0;\n }\n function isNumber(input) {\n return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';\n }\n function isDate(input) {\n return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';\n }\n function map(arr, fn) {\n var res = [],\n i,\n arrLen = arr.length;\n for (i = 0; i < arrLen; ++i) {\n res.push(fn(arr[i], i));\n }\n return res;\n }\n function extend(a, b) {\n for (var i in b) {\n if (hasOwnProp(b, i)) {\n a[i] = b[i];\n }\n }\n if (hasOwnProp(b, 'toString')) {\n a.toString = b.toString;\n }\n if (hasOwnProp(b, 'valueOf')) {\n a.valueOf = b.valueOf;\n }\n return a;\n }\n function createUTC(input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, true).utc();\n }\n function defaultParsingFlags() {\n // We need to deep clone this object.\n return {\n empty: false,\n unusedTokens: [],\n unusedInput: [],\n overflow: -2,\n charsLeftOver: 0,\n nullInput: false,\n invalidEra: null,\n invalidMonth: null,\n invalidFormat: false,\n userInvalidated: false,\n iso: false,\n parsedDateParts: [],\n era: null,\n meridiem: null,\n rfc2822: false,\n weekdayMismatch: false\n };\n }\n function getParsingFlags(m) {\n if (m._pf == null) {\n m._pf = defaultParsingFlags();\n }\n return m._pf;\n }\n var some;\n if (Array.prototype.some) {\n some = Array.prototype.some;\n } else {\n some = function (fun) {\n var t = Object(this),\n len = t.length >>> 0,\n i;\n for (i = 0; i < len; i++) {\n if (i in t && fun.call(this, t[i], i, t)) {\n return true;\n }\n }\n return false;\n };\n }\n function isValid(m) {\n var flags = null,\n parsedParts = false,\n isNowValid = m._d && !isNaN(m._d.getTime());\n if (isNowValid) {\n flags = getParsingFlags(m);\n parsedParts = some.call(flags.parsedDateParts, function (i) {\n return i != null;\n });\n isNowValid = flags.overflow < 0 && !flags.empty && !flags.invalidEra && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts);\n if (m._strict) {\n isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === undefined;\n }\n }\n if (Object.isFrozen == null || !Object.isFrozen(m)) {\n m._isValid = isNowValid;\n } else {\n return isNowValid;\n }\n return m._isValid;\n }\n function createInvalid(flags) {\n var m = createUTC(NaN);\n if (flags != null) {\n extend(getParsingFlags(m), flags);\n } else {\n getParsingFlags(m).userInvalidated = true;\n }\n return m;\n }\n\n // Plugins that add properties should also add the key here (null value),\n // so we can properly clone ourselves.\n var momentProperties = hooks.momentProperties = [],\n updateInProgress = false;\n function copyConfig(to, from) {\n var i,\n prop,\n val,\n momentPropertiesLen = momentProperties.length;\n if (!isUndefined(from._isAMomentObject)) {\n to._isAMomentObject = from._isAMomentObject;\n }\n if (!isUndefined(from._i)) {\n to._i = from._i;\n }\n if (!isUndefined(from._f)) {\n to._f = from._f;\n }\n if (!isUndefined(from._l)) {\n to._l = from._l;\n }\n if (!isUndefined(from._strict)) {\n to._strict = from._strict;\n }\n if (!isUndefined(from._tzm)) {\n to._tzm = from._tzm;\n }\n if (!isUndefined(from._isUTC)) {\n to._isUTC = from._isUTC;\n }\n if (!isUndefined(from._offset)) {\n to._offset = from._offset;\n }\n if (!isUndefined(from._pf)) {\n to._pf = getParsingFlags(from);\n }\n if (!isUndefined(from._locale)) {\n to._locale = from._locale;\n }\n if (momentPropertiesLen > 0) {\n for (i = 0; i < momentPropertiesLen; i++) {\n prop = momentProperties[i];\n val = from[prop];\n if (!isUndefined(val)) {\n to[prop] = val;\n }\n }\n }\n return to;\n }\n\n // Moment prototype object\n function Moment(config) {\n copyConfig(this, config);\n this._d = new Date(config._d != null ? config._d.getTime() : NaN);\n if (!this.isValid()) {\n this._d = new Date(NaN);\n }\n // Prevent infinite loop in case updateOffset creates new moment\n // objects.\n if (updateInProgress === false) {\n updateInProgress = true;\n hooks.updateOffset(this);\n updateInProgress = false;\n }\n }\n function isMoment(obj) {\n return obj instanceof Moment || obj != null && obj._isAMomentObject != null;\n }\n function warn(msg) {\n if (hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) {\n console.warn('Deprecation warning: ' + msg);\n }\n }\n function deprecate(msg, fn) {\n var firstTime = true;\n return extend(function () {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(null, msg);\n }\n if (firstTime) {\n var args = [],\n arg,\n i,\n key,\n argLen = arguments.length;\n for (i = 0; i < argLen; i++) {\n arg = '';\n if (typeof arguments[i] === 'object') {\n arg += '\\n[' + i + '] ';\n for (key in arguments[0]) {\n if (hasOwnProp(arguments[0], key)) {\n arg += key + ': ' + arguments[0][key] + ', ';\n }\n }\n arg = arg.slice(0, -2); // Remove trailing comma and space\n } else {\n arg = arguments[i];\n }\n args.push(arg);\n }\n warn(msg + '\\nArguments: ' + Array.prototype.slice.call(args).join('') + '\\n' + new Error().stack);\n firstTime = false;\n }\n return fn.apply(this, arguments);\n }, fn);\n }\n var deprecations = {};\n function deprecateSimple(name, msg) {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(name, msg);\n }\n if (!deprecations[name]) {\n warn(msg);\n deprecations[name] = true;\n }\n }\n hooks.suppressDeprecationWarnings = false;\n hooks.deprecationHandler = null;\n function isFunction(input) {\n return typeof Function !== 'undefined' && input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';\n }\n function set(config) {\n var prop, i;\n for (i in config) {\n if (hasOwnProp(config, i)) {\n prop = config[i];\n if (isFunction(prop)) {\n this[i] = prop;\n } else {\n this['_' + i] = prop;\n }\n }\n }\n this._config = config;\n // Lenient ordinal parsing accepts just a number in addition to\n // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n this._dayOfMonthOrdinalParseLenient = new RegExp((this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + '|' + /\\d{1,2}/.source);\n }\n function mergeConfigs(parentConfig, childConfig) {\n var res = extend({}, parentConfig),\n prop;\n for (prop in childConfig) {\n if (hasOwnProp(childConfig, prop)) {\n if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {\n res[prop] = {};\n extend(res[prop], parentConfig[prop]);\n extend(res[prop], childConfig[prop]);\n } else if (childConfig[prop] != null) {\n res[prop] = childConfig[prop];\n } else {\n delete res[prop];\n }\n }\n }\n for (prop in parentConfig) {\n if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop])) {\n // make sure changes to properties don't modify parent config\n res[prop] = extend({}, res[prop]);\n }\n }\n return res;\n }\n function Locale(config) {\n if (config != null) {\n this.set(config);\n }\n }\n var keys;\n if (Object.keys) {\n keys = Object.keys;\n } else {\n keys = function (obj) {\n var i,\n res = [];\n for (i in obj) {\n if (hasOwnProp(obj, i)) {\n res.push(i);\n }\n }\n return res;\n };\n }\n var defaultCalendar = {\n sameDay: '[Today at] LT',\n nextDay: '[Tomorrow at] LT',\n nextWeek: 'dddd [at] LT',\n lastDay: '[Yesterday at] LT',\n lastWeek: '[Last] dddd [at] LT',\n sameElse: 'L'\n };\n function calendar(key, mom, now) {\n var output = this._calendar[key] || this._calendar['sameElse'];\n return isFunction(output) ? output.call(mom, now) : output;\n }\n function zeroFill(number, targetLength, forceSign) {\n var absNumber = '' + Math.abs(number),\n zerosToFill = targetLength - absNumber.length,\n sign = number >= 0;\n return (sign ? forceSign ? '+' : '' : '-') + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;\n }\n var formattingTokens = /(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,\n localFormattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,\n formatFunctions = {},\n formatTokenFunctions = {};\n\n // token: 'M'\n // padded: ['MM', 2]\n // ordinal: 'Mo'\n // callback: function () { this.month() + 1 }\n function addFormatToken(token, padded, ordinal, callback) {\n var func = callback;\n if (typeof callback === 'string') {\n func = function () {\n return this[callback]();\n };\n }\n if (token) {\n formatTokenFunctions[token] = func;\n }\n if (padded) {\n formatTokenFunctions[padded[0]] = function () {\n return zeroFill(func.apply(this, arguments), padded[1], padded[2]);\n };\n }\n if (ordinal) {\n formatTokenFunctions[ordinal] = function () {\n return this.localeData().ordinal(func.apply(this, arguments), token);\n };\n }\n }\n function removeFormattingTokens(input) {\n if (input.match(/\\[[\\s\\S]/)) {\n return input.replace(/^\\[|\\]$/g, '');\n }\n return input.replace(/\\\\/g, '');\n }\n function makeFormatFunction(format) {\n var array = format.match(formattingTokens),\n i,\n length;\n for (i = 0, length = array.length; i < length; i++) {\n if (formatTokenFunctions[array[i]]) {\n array[i] = formatTokenFunctions[array[i]];\n } else {\n array[i] = removeFormattingTokens(array[i]);\n }\n }\n return function (mom) {\n var output = '',\n i;\n for (i = 0; i < length; i++) {\n output += isFunction(array[i]) ? array[i].call(mom, format) : array[i];\n }\n return output;\n };\n }\n\n // format date using native date object\n function formatMoment(m, format) {\n if (!m.isValid()) {\n return m.localeData().invalidDate();\n }\n format = expandFormat(format, m.localeData());\n formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);\n return formatFunctions[format](m);\n }\n function expandFormat(format, locale) {\n var i = 5;\n function replaceLongDateFormatTokens(input) {\n return locale.longDateFormat(input) || input;\n }\n localFormattingTokens.lastIndex = 0;\n while (i >= 0 && localFormattingTokens.test(format)) {\n format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);\n localFormattingTokens.lastIndex = 0;\n i -= 1;\n }\n return format;\n }\n var defaultLongDateFormat = {\n LTS: 'h:mm:ss A',\n LT: 'h:mm A',\n L: 'MM/DD/YYYY',\n LL: 'MMMM D, YYYY',\n LLL: 'MMMM D, YYYY h:mm A',\n LLLL: 'dddd, MMMM D, YYYY h:mm A'\n };\n function longDateFormat(key) {\n var format = this._longDateFormat[key],\n formatUpper = this._longDateFormat[key.toUpperCase()];\n if (format || !formatUpper) {\n return format;\n }\n this._longDateFormat[key] = formatUpper.match(formattingTokens).map(function (tok) {\n if (tok === 'MMMM' || tok === 'MM' || tok === 'DD' || tok === 'dddd') {\n return tok.slice(1);\n }\n return tok;\n }).join('');\n return this._longDateFormat[key];\n }\n var defaultInvalidDate = 'Invalid date';\n function invalidDate() {\n return this._invalidDate;\n }\n var defaultOrdinal = '%d',\n defaultDayOfMonthOrdinalParse = /\\d{1,2}/;\n function ordinal(number) {\n return this._ordinal.replace('%d', number);\n }\n var defaultRelativeTime = {\n future: 'in %s',\n past: '%s ago',\n s: 'a few seconds',\n ss: '%d seconds',\n m: 'a minute',\n mm: '%d minutes',\n h: 'an hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days',\n w: 'a week',\n ww: '%d weeks',\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years'\n };\n function relativeTime(number, withoutSuffix, string, isFuture) {\n var output = this._relativeTime[string];\n return isFunction(output) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number);\n }\n function pastFuture(diff, output) {\n var format = this._relativeTime[diff > 0 ? 'future' : 'past'];\n return isFunction(format) ? format(output) : format.replace(/%s/i, output);\n }\n var aliases = {\n D: 'date',\n dates: 'date',\n date: 'date',\n d: 'day',\n days: 'day',\n day: 'day',\n e: 'weekday',\n weekdays: 'weekday',\n weekday: 'weekday',\n E: 'isoWeekday',\n isoweekdays: 'isoWeekday',\n isoweekday: 'isoWeekday',\n DDD: 'dayOfYear',\n dayofyears: 'dayOfYear',\n dayofyear: 'dayOfYear',\n h: 'hour',\n hours: 'hour',\n hour: 'hour',\n ms: 'millisecond',\n milliseconds: 'millisecond',\n millisecond: 'millisecond',\n m: 'minute',\n minutes: 'minute',\n minute: 'minute',\n M: 'month',\n months: 'month',\n month: 'month',\n Q: 'quarter',\n quarters: 'quarter',\n quarter: 'quarter',\n s: 'second',\n seconds: 'second',\n second: 'second',\n gg: 'weekYear',\n weekyears: 'weekYear',\n weekyear: 'weekYear',\n GG: 'isoWeekYear',\n isoweekyears: 'isoWeekYear',\n isoweekyear: 'isoWeekYear',\n w: 'week',\n weeks: 'week',\n week: 'week',\n W: 'isoWeek',\n isoweeks: 'isoWeek',\n isoweek: 'isoWeek',\n y: 'year',\n years: 'year',\n year: 'year'\n };\n function normalizeUnits(units) {\n return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;\n }\n function normalizeObjectUnits(inputObject) {\n var normalizedInput = {},\n normalizedProp,\n prop;\n for (prop in inputObject) {\n if (hasOwnProp(inputObject, prop)) {\n normalizedProp = normalizeUnits(prop);\n if (normalizedProp) {\n normalizedInput[normalizedProp] = inputObject[prop];\n }\n }\n }\n return normalizedInput;\n }\n var priorities = {\n date: 9,\n day: 11,\n weekday: 11,\n isoWeekday: 11,\n dayOfYear: 4,\n hour: 13,\n millisecond: 16,\n minute: 14,\n month: 8,\n quarter: 7,\n second: 15,\n weekYear: 1,\n isoWeekYear: 1,\n week: 5,\n isoWeek: 5,\n year: 1\n };\n function getPrioritizedUnits(unitsObj) {\n var units = [],\n u;\n for (u in unitsObj) {\n if (hasOwnProp(unitsObj, u)) {\n units.push({\n unit: u,\n priority: priorities[u]\n });\n }\n }\n units.sort(function (a, b) {\n return a.priority - b.priority;\n });\n return units;\n }\n var match1 = /\\d/,\n // 0 - 9\n match2 = /\\d\\d/,\n // 00 - 99\n match3 = /\\d{3}/,\n // 000 - 999\n match4 = /\\d{4}/,\n // 0000 - 9999\n match6 = /[+-]?\\d{6}/,\n // -999999 - 999999\n match1to2 = /\\d\\d?/,\n // 0 - 99\n match3to4 = /\\d\\d\\d\\d?/,\n // 999 - 9999\n match5to6 = /\\d\\d\\d\\d\\d\\d?/,\n // 99999 - 999999\n match1to3 = /\\d{1,3}/,\n // 0 - 999\n match1to4 = /\\d{1,4}/,\n // 0 - 9999\n match1to6 = /[+-]?\\d{1,6}/,\n // -999999 - 999999\n matchUnsigned = /\\d+/,\n // 0 - inf\n matchSigned = /[+-]?\\d+/,\n // -inf - inf\n matchOffset = /Z|[+-]\\d\\d:?\\d\\d/gi,\n // +00:00 -00:00 +0000 -0000 or Z\n matchShortOffset = /Z|[+-]\\d\\d(?::?\\d\\d)?/gi,\n // +00 -00 +00:00 -00:00 +0000 -0000 or Z\n matchTimestamp = /[+-]?\\d+(\\.\\d{1,3})?/,\n // 123456789 123456789.123\n // any word (or two) characters or numbers including two/three word month in arabic.\n // includes scottish gaelic two word and hyphenated months\n matchWord = /[0-9]{0,256}['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFF07\\uFF10-\\uFFEF]{1,256}|[\\u0600-\\u06FF\\/]{1,256}(\\s*?[\\u0600-\\u06FF]{1,256}){1,2}/i,\n match1to2NoLeadingZero = /^[1-9]\\d?/,\n // 1-99\n match1to2HasZero = /^([1-9]\\d|\\d)/,\n // 0-99\n regexes;\n regexes = {};\n function addRegexToken(token, regex, strictRegex) {\n regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {\n return isStrict && strictRegex ? strictRegex : regex;\n };\n }\n function getParseRegexForToken(token, config) {\n if (!hasOwnProp(regexes, token)) {\n return new RegExp(unescapeFormat(token));\n }\n return regexes[token](config._strict, config._locale);\n }\n\n // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript\n function unescapeFormat(s) {\n return regexEscape(s.replace('\\\\', '').replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g, function (matched, p1, p2, p3, p4) {\n return p1 || p2 || p3 || p4;\n }));\n }\n function regexEscape(s) {\n return s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n }\n function absFloor(number) {\n if (number < 0) {\n // -0 -> 0\n return Math.ceil(number) || 0;\n } else {\n return Math.floor(number);\n }\n }\n function toInt(argumentForCoercion) {\n var coercedNumber = +argumentForCoercion,\n value = 0;\n if (coercedNumber !== 0 && isFinite(coercedNumber)) {\n value = absFloor(coercedNumber);\n }\n return value;\n }\n var tokens = {};\n function addParseToken(token, callback) {\n var i,\n func = callback,\n tokenLen;\n if (typeof token === 'string') {\n token = [token];\n }\n if (isNumber(callback)) {\n func = function (input, array) {\n array[callback] = toInt(input);\n };\n }\n tokenLen = token.length;\n for (i = 0; i < tokenLen; i++) {\n tokens[token[i]] = func;\n }\n }\n function addWeekParseToken(token, callback) {\n addParseToken(token, function (input, array, config, token) {\n config._w = config._w || {};\n callback(input, config._w, config, token);\n });\n }\n function addTimeToArrayFromToken(token, input, config) {\n if (input != null && hasOwnProp(tokens, token)) {\n tokens[token](input, config._a, config, token);\n }\n }\n function isLeapYear(year) {\n return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;\n }\n var YEAR = 0,\n MONTH = 1,\n DATE = 2,\n HOUR = 3,\n MINUTE = 4,\n SECOND = 5,\n MILLISECOND = 6,\n WEEK = 7,\n WEEKDAY = 8;\n\n // FORMATTING\n\n addFormatToken('Y', 0, 0, function () {\n var y = this.year();\n return y <= 9999 ? zeroFill(y, 4) : '+' + y;\n });\n addFormatToken(0, ['YY', 2], 0, function () {\n return this.year() % 100;\n });\n addFormatToken(0, ['YYYY', 4], 0, 'year');\n addFormatToken(0, ['YYYYY', 5], 0, 'year');\n addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');\n\n // PARSING\n\n addRegexToken('Y', matchSigned);\n addRegexToken('YY', match1to2, match2);\n addRegexToken('YYYY', match1to4, match4);\n addRegexToken('YYYYY', match1to6, match6);\n addRegexToken('YYYYYY', match1to6, match6);\n addParseToken(['YYYYY', 'YYYYYY'], YEAR);\n addParseToken('YYYY', function (input, array) {\n array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);\n });\n addParseToken('YY', function (input, array) {\n array[YEAR] = hooks.parseTwoDigitYear(input);\n });\n addParseToken('Y', function (input, array) {\n array[YEAR] = parseInt(input, 10);\n });\n\n // HELPERS\n\n function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n }\n\n // HOOKS\n\n hooks.parseTwoDigitYear = function (input) {\n return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n };\n\n // MOMENTS\n\n var getSetYear = makeGetSet('FullYear', true);\n function getIsLeapYear() {\n return isLeapYear(this.year());\n }\n function makeGetSet(unit, keepTime) {\n return function (value) {\n if (value != null) {\n set$1(this, unit, value);\n hooks.updateOffset(this, keepTime);\n return this;\n } else {\n return get(this, unit);\n }\n };\n }\n function get(mom, unit) {\n if (!mom.isValid()) {\n return NaN;\n }\n var d = mom._d,\n isUTC = mom._isUTC;\n switch (unit) {\n case 'Milliseconds':\n return isUTC ? d.getUTCMilliseconds() : d.getMilliseconds();\n case 'Seconds':\n return isUTC ? d.getUTCSeconds() : d.getSeconds();\n case 'Minutes':\n return isUTC ? d.getUTCMinutes() : d.getMinutes();\n case 'Hours':\n return isUTC ? d.getUTCHours() : d.getHours();\n case 'Date':\n return isUTC ? d.getUTCDate() : d.getDate();\n case 'Day':\n return isUTC ? d.getUTCDay() : d.getDay();\n case 'Month':\n return isUTC ? d.getUTCMonth() : d.getMonth();\n case 'FullYear':\n return isUTC ? d.getUTCFullYear() : d.getFullYear();\n default:\n return NaN;\n // Just in case\n }\n }\n function set$1(mom, unit, value) {\n var d, isUTC, year, month, date;\n if (!mom.isValid() || isNaN(value)) {\n return;\n }\n d = mom._d;\n isUTC = mom._isUTC;\n switch (unit) {\n case 'Milliseconds':\n return void (isUTC ? d.setUTCMilliseconds(value) : d.setMilliseconds(value));\n case 'Seconds':\n return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value));\n case 'Minutes':\n return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value));\n case 'Hours':\n return void (isUTC ? d.setUTCHours(value) : d.setHours(value));\n case 'Date':\n return void (isUTC ? d.setUTCDate(value) : d.setDate(value));\n // case 'Day': // Not real\n // return void (isUTC ? d.setUTCDay(value) : d.setDay(value));\n // case 'Month': // Not used because we need to pass two variables\n // return void (isUTC ? d.setUTCMonth(value) : d.setMonth(value));\n case 'FullYear':\n break;\n // See below ...\n default:\n return;\n // Just in case\n }\n year = value;\n month = mom.month();\n date = mom.date();\n date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date;\n void (isUTC ? d.setUTCFullYear(year, month, date) : d.setFullYear(year, month, date));\n }\n\n // MOMENTS\n\n function stringGet(units) {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units]();\n }\n return this;\n }\n function stringSet(units, value) {\n if (typeof units === 'object') {\n units = normalizeObjectUnits(units);\n var prioritized = getPrioritizedUnits(units),\n i,\n prioritizedLen = prioritized.length;\n for (i = 0; i < prioritizedLen; i++) {\n this[prioritized[i].unit](units[prioritized[i].unit]);\n }\n } else {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units](value);\n }\n }\n return this;\n }\n function mod(n, x) {\n return (n % x + x) % x;\n }\n var indexOf;\n if (Array.prototype.indexOf) {\n indexOf = Array.prototype.indexOf;\n } else {\n indexOf = function (o) {\n // I know\n var i;\n for (i = 0; i < this.length; ++i) {\n if (this[i] === o) {\n return i;\n }\n }\n return -1;\n };\n }\n function daysInMonth(year, month) {\n if (isNaN(year) || isNaN(month)) {\n return NaN;\n }\n var modMonth = mod(month, 12);\n year += (month - modMonth) / 12;\n return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2;\n }\n\n // FORMATTING\n\n addFormatToken('M', ['MM', 2], 'Mo', function () {\n return this.month() + 1;\n });\n addFormatToken('MMM', 0, 0, function (format) {\n return this.localeData().monthsShort(this, format);\n });\n addFormatToken('MMMM', 0, 0, function (format) {\n return this.localeData().months(this, format);\n });\n\n // PARSING\n\n addRegexToken('M', match1to2, match1to2NoLeadingZero);\n addRegexToken('MM', match1to2, match2);\n addRegexToken('MMM', function (isStrict, locale) {\n return locale.monthsShortRegex(isStrict);\n });\n addRegexToken('MMMM', function (isStrict, locale) {\n return locale.monthsRegex(isStrict);\n });\n addParseToken(['M', 'MM'], function (input, array) {\n array[MONTH] = toInt(input) - 1;\n });\n addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {\n var month = config._locale.monthsParse(input, token, config._strict);\n // if we didn't find a month name, mark the date as invalid.\n if (month != null) {\n array[MONTH] = month;\n } else {\n getParsingFlags(config).invalidMonth = input;\n }\n });\n\n // LOCALES\n\n var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),\n defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n MONTHS_IN_FORMAT = /D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?/,\n defaultMonthsShortRegex = matchWord,\n defaultMonthsRegex = matchWord;\n function localeMonths(m, format) {\n if (!m) {\n return isArray(this._months) ? this._months : this._months['standalone'];\n }\n return isArray(this._months) ? this._months[m.month()] : this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];\n }\n function localeMonthsShort(m, format) {\n if (!m) {\n return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort['standalone'];\n }\n return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];\n }\n function handleStrictParse(monthName, format, strict) {\n var i,\n ii,\n mom,\n llc = monthName.toLocaleLowerCase();\n if (!this._monthsParse) {\n // this is not used\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n for (i = 0; i < 12; ++i) {\n mom = createUTC([2000, i]);\n this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();\n this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();\n }\n }\n if (strict) {\n if (format === 'MMM') {\n ii = indexOf.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'MMM') {\n ii = indexOf.call(this._shortMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._longMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n function localeMonthsParse(monthName, format, strict) {\n var i, mom, regex;\n if (this._monthsParseExact) {\n return handleStrictParse.call(this, monthName, format, strict);\n }\n if (!this._monthsParse) {\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n }\n\n // TODO: add sorting\n // Sorting makes sure if one month (or abbr) is a prefix of another\n // see sorting in computeMonthsParse\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n if (strict && !this._longMonthsParse[i]) {\n this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');\n this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');\n }\n if (!strict && !this._monthsParse[i]) {\n regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');\n this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {\n return i;\n } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {\n return i;\n } else if (!strict && this._monthsParse[i].test(monthName)) {\n return i;\n }\n }\n }\n\n // MOMENTS\n\n function setMonth(mom, value) {\n if (!mom.isValid()) {\n // No op\n return mom;\n }\n if (typeof value === 'string') {\n if (/^\\d+$/.test(value)) {\n value = toInt(value);\n } else {\n value = mom.localeData().monthsParse(value);\n // TODO: Another silent failure?\n if (!isNumber(value)) {\n return mom;\n }\n }\n }\n var month = value,\n date = mom.date();\n date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month));\n void (mom._isUTC ? mom._d.setUTCMonth(month, date) : mom._d.setMonth(month, date));\n return mom;\n }\n function getSetMonth(value) {\n if (value != null) {\n setMonth(this, value);\n hooks.updateOffset(this, true);\n return this;\n } else {\n return get(this, 'Month');\n }\n }\n function getDaysInMonth() {\n return daysInMonth(this.year(), this.month());\n }\n function monthsShortRegex(isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsShortStrictRegex;\n } else {\n return this._monthsShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsShortRegex')) {\n this._monthsShortRegex = defaultMonthsShortRegex;\n }\n return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex;\n }\n }\n function monthsRegex(isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsStrictRegex;\n } else {\n return this._monthsRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsRegex')) {\n this._monthsRegex = defaultMonthsRegex;\n }\n return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex;\n }\n }\n function computeMonthsParse() {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n var shortPieces = [],\n longPieces = [],\n mixedPieces = [],\n i,\n mom,\n shortP,\n longP;\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n shortP = regexEscape(this.monthsShort(mom, ''));\n longP = regexEscape(this.months(mom, ''));\n shortPieces.push(shortP);\n longPieces.push(longP);\n mixedPieces.push(longP);\n mixedPieces.push(shortP);\n }\n // Sorting makes sure if one month (or abbr) is a prefix of another it\n // will match the longer piece.\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._monthsShortRegex = this._monthsRegex;\n this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');\n this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');\n }\n function createDate(y, m, d, h, M, s, ms) {\n // can't just apply() to create a date:\n // https://stackoverflow.com/q/181348\n var date;\n // the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n date = new Date(y + 400, m, d, h, M, s, ms);\n if (isFinite(date.getFullYear())) {\n date.setFullYear(y);\n }\n } else {\n date = new Date(y, m, d, h, M, s, ms);\n }\n return date;\n }\n function createUTCDate(y) {\n var date, args;\n // the Date.UTC function remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n args = Array.prototype.slice.call(arguments);\n // preserve leap years using a full 400 year cycle, then reset\n args[0] = y + 400;\n date = new Date(Date.UTC.apply(null, args));\n if (isFinite(date.getUTCFullYear())) {\n date.setUTCFullYear(y);\n }\n } else {\n date = new Date(Date.UTC.apply(null, arguments));\n }\n return date;\n }\n\n // start-of-first-week - start-of-year\n function firstWeekOffset(year, dow, doy) {\n var\n // first-week day -- which january is always in the first week (4 for iso, 1 for other)\n fwd = 7 + dow - doy,\n // first-week day local weekday -- which local weekday is fwd\n fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;\n return -fwdlw + fwd - 1;\n }\n\n // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday\n function dayOfYearFromWeeks(year, week, weekday, dow, doy) {\n var localWeekday = (7 + weekday - dow) % 7,\n weekOffset = firstWeekOffset(year, dow, doy),\n dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,\n resYear,\n resDayOfYear;\n if (dayOfYear <= 0) {\n resYear = year - 1;\n resDayOfYear = daysInYear(resYear) + dayOfYear;\n } else if (dayOfYear > daysInYear(year)) {\n resYear = year + 1;\n resDayOfYear = dayOfYear - daysInYear(year);\n } else {\n resYear = year;\n resDayOfYear = dayOfYear;\n }\n return {\n year: resYear,\n dayOfYear: resDayOfYear\n };\n }\n function weekOfYear(mom, dow, doy) {\n var weekOffset = firstWeekOffset(mom.year(), dow, doy),\n week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,\n resWeek,\n resYear;\n if (week < 1) {\n resYear = mom.year() - 1;\n resWeek = week + weeksInYear(resYear, dow, doy);\n } else if (week > weeksInYear(mom.year(), dow, doy)) {\n resWeek = week - weeksInYear(mom.year(), dow, doy);\n resYear = mom.year() + 1;\n } else {\n resYear = mom.year();\n resWeek = week;\n }\n return {\n week: resWeek,\n year: resYear\n };\n }\n function weeksInYear(year, dow, doy) {\n var weekOffset = firstWeekOffset(year, dow, doy),\n weekOffsetNext = firstWeekOffset(year + 1, dow, doy);\n return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;\n }\n\n // FORMATTING\n\n addFormatToken('w', ['ww', 2], 'wo', 'week');\n addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');\n\n // PARSING\n\n addRegexToken('w', match1to2, match1to2NoLeadingZero);\n addRegexToken('ww', match1to2, match2);\n addRegexToken('W', match1to2, match1to2NoLeadingZero);\n addRegexToken('WW', match1to2, match2);\n addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {\n week[token.substr(0, 1)] = toInt(input);\n });\n\n // HELPERS\n\n // LOCALES\n\n function localeWeek(mom) {\n return weekOfYear(mom, this._week.dow, this._week.doy).week;\n }\n var defaultLocaleWeek = {\n dow: 0,\n // Sunday is the first day of the week.\n doy: 6 // The week that contains Jan 6th is the first week of the year.\n };\n function localeFirstDayOfWeek() {\n return this._week.dow;\n }\n function localeFirstDayOfYear() {\n return this._week.doy;\n }\n\n // MOMENTS\n\n function getSetWeek(input) {\n var week = this.localeData().week(this);\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n function getSetISOWeek(input) {\n var week = weekOfYear(this, 1, 4).week;\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n\n // FORMATTING\n\n addFormatToken('d', 0, 'do', 'day');\n addFormatToken('dd', 0, 0, function (format) {\n return this.localeData().weekdaysMin(this, format);\n });\n addFormatToken('ddd', 0, 0, function (format) {\n return this.localeData().weekdaysShort(this, format);\n });\n addFormatToken('dddd', 0, 0, function (format) {\n return this.localeData().weekdays(this, format);\n });\n addFormatToken('e', 0, 0, 'weekday');\n addFormatToken('E', 0, 0, 'isoWeekday');\n\n // PARSING\n\n addRegexToken('d', match1to2);\n addRegexToken('e', match1to2);\n addRegexToken('E', match1to2);\n addRegexToken('dd', function (isStrict, locale) {\n return locale.weekdaysMinRegex(isStrict);\n });\n addRegexToken('ddd', function (isStrict, locale) {\n return locale.weekdaysShortRegex(isStrict);\n });\n addRegexToken('dddd', function (isStrict, locale) {\n return locale.weekdaysRegex(isStrict);\n });\n addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {\n var weekday = config._locale.weekdaysParse(input, token, config._strict);\n // if we didn't get a weekday name, mark the date as invalid\n if (weekday != null) {\n week.d = weekday;\n } else {\n getParsingFlags(config).invalidWeekday = input;\n }\n });\n addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {\n week[token] = toInt(input);\n });\n\n // HELPERS\n\n function parseWeekday(input, locale) {\n if (typeof input !== 'string') {\n return input;\n }\n if (!isNaN(input)) {\n return parseInt(input, 10);\n }\n input = locale.weekdaysParse(input);\n if (typeof input === 'number') {\n return input;\n }\n return null;\n }\n function parseIsoWeekday(input, locale) {\n if (typeof input === 'string') {\n return locale.weekdaysParse(input) % 7 || 7;\n }\n return isNaN(input) ? null : input;\n }\n\n // LOCALES\n function shiftWeekdays(ws, n) {\n return ws.slice(n, 7).concat(ws.slice(0, n));\n }\n var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n defaultWeekdaysRegex = matchWord,\n defaultWeekdaysShortRegex = matchWord,\n defaultWeekdaysMinRegex = matchWord;\n function localeWeekdays(m, format) {\n var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(format) ? 'format' : 'standalone'];\n return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays;\n }\n function localeWeekdaysShort(m) {\n return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort;\n }\n function localeWeekdaysMin(m) {\n return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin;\n }\n function handleStrictParse$1(weekdayName, format, strict) {\n var i,\n ii,\n mom,\n llc = weekdayName.toLocaleLowerCase();\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._minWeekdaysParse = [];\n for (i = 0; i < 7; ++i) {\n mom = createUTC([2000, 1]).day(i);\n this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();\n this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();\n this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();\n }\n }\n if (strict) {\n if (format === 'dddd') {\n ii = indexOf.call(this._weekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'dddd') {\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._minWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n function localeWeekdaysParse(weekdayName, format, strict) {\n var i, mom, regex;\n if (this._weekdaysParseExact) {\n return handleStrictParse$1.call(this, weekdayName, format, strict);\n }\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._minWeekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._fullWeekdaysParse = [];\n }\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n\n mom = createUTC([2000, 1]).day(i);\n if (strict && !this._fullWeekdaysParse[i]) {\n this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\\\\.?') + '$', 'i');\n this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\\\\.?') + '$', 'i');\n this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\\\\.?') + '$', 'i');\n }\n if (!this._weekdaysParse[i]) {\n regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');\n this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {\n return i;\n }\n }\n }\n\n // MOMENTS\n\n function getSetDayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var day = get(this, 'Day');\n if (input != null) {\n input = parseWeekday(input, this.localeData());\n return this.add(input - day, 'd');\n } else {\n return day;\n }\n }\n function getSetLocaleDayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;\n return input == null ? weekday : this.add(input - weekday, 'd');\n }\n function getSetISODayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n\n // behaves the same as moment#day except\n // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)\n // as a setter, sunday should belong to the previous week.\n\n if (input != null) {\n var weekday = parseIsoWeekday(input, this.localeData());\n return this.day(this.day() % 7 ? weekday : weekday - 7);\n } else {\n return this.day() || 7;\n }\n }\n function weekdaysRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysStrictRegex;\n } else {\n return this._weekdaysRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n this._weekdaysRegex = defaultWeekdaysRegex;\n }\n return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex;\n }\n }\n function weekdaysShortRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysShortStrictRegex;\n } else {\n return this._weekdaysShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysShortRegex')) {\n this._weekdaysShortRegex = defaultWeekdaysShortRegex;\n }\n return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex;\n }\n }\n function weekdaysMinRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysMinStrictRegex;\n } else {\n return this._weekdaysMinRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysMinRegex')) {\n this._weekdaysMinRegex = defaultWeekdaysMinRegex;\n }\n return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex;\n }\n }\n function computeWeekdaysParse() {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n var minPieces = [],\n shortPieces = [],\n longPieces = [],\n mixedPieces = [],\n i,\n mom,\n minp,\n shortp,\n longp;\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, 1]).day(i);\n minp = regexEscape(this.weekdaysMin(mom, ''));\n shortp = regexEscape(this.weekdaysShort(mom, ''));\n longp = regexEscape(this.weekdays(mom, ''));\n minPieces.push(minp);\n shortPieces.push(shortp);\n longPieces.push(longp);\n mixedPieces.push(minp);\n mixedPieces.push(shortp);\n mixedPieces.push(longp);\n }\n // Sorting makes sure if one weekday (or abbr) is a prefix of another it\n // will match the longer piece.\n minPieces.sort(cmpLenRev);\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._weekdaysShortRegex = this._weekdaysRegex;\n this._weekdaysMinRegex = this._weekdaysRegex;\n this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');\n this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');\n this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');\n }\n\n // FORMATTING\n\n function hFormat() {\n return this.hours() % 12 || 12;\n }\n function kFormat() {\n return this.hours() || 24;\n }\n addFormatToken('H', ['HH', 2], 0, 'hour');\n addFormatToken('h', ['hh', 2], 0, hFormat);\n addFormatToken('k', ['kk', 2], 0, kFormat);\n addFormatToken('hmm', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);\n });\n addFormatToken('hmmss', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);\n });\n addFormatToken('Hmm', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2);\n });\n addFormatToken('Hmmss', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);\n });\n function meridiem(token, lowercase) {\n addFormatToken(token, 0, 0, function () {\n return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);\n });\n }\n meridiem('a', true);\n meridiem('A', false);\n\n // PARSING\n\n function matchMeridiem(isStrict, locale) {\n return locale._meridiemParse;\n }\n addRegexToken('a', matchMeridiem);\n addRegexToken('A', matchMeridiem);\n addRegexToken('H', match1to2, match1to2HasZero);\n addRegexToken('h', match1to2, match1to2NoLeadingZero);\n addRegexToken('k', match1to2, match1to2NoLeadingZero);\n addRegexToken('HH', match1to2, match2);\n addRegexToken('hh', match1to2, match2);\n addRegexToken('kk', match1to2, match2);\n addRegexToken('hmm', match3to4);\n addRegexToken('hmmss', match5to6);\n addRegexToken('Hmm', match3to4);\n addRegexToken('Hmmss', match5to6);\n addParseToken(['H', 'HH'], HOUR);\n addParseToken(['k', 'kk'], function (input, array, config) {\n var kInput = toInt(input);\n array[HOUR] = kInput === 24 ? 0 : kInput;\n });\n addParseToken(['a', 'A'], function (input, array, config) {\n config._isPm = config._locale.isPM(input);\n config._meridiem = input;\n });\n addParseToken(['h', 'hh'], function (input, array, config) {\n array[HOUR] = toInt(input);\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmmss', function (input, array, config) {\n var pos1 = input.length - 4,\n pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('Hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n });\n addParseToken('Hmmss', function (input, array, config) {\n var pos1 = input.length - 4,\n pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n });\n\n // LOCALES\n\n function localeIsPM(input) {\n // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays\n // Using charAt should be more compatible.\n return (input + '').toLowerCase().charAt(0) === 'p';\n }\n var defaultLocaleMeridiemParse = /[ap]\\.?m?\\.?/i,\n // Setting the hour should keep the time, because the user explicitly\n // specified which hour they want. So trying to maintain the same hour (in\n // a new timezone) makes sense. Adding/subtracting hours does not follow\n // this rule.\n getSetHour = makeGetSet('Hours', true);\n function localeMeridiem(hours, minutes, isLower) {\n if (hours > 11) {\n return isLower ? 'pm' : 'PM';\n } else {\n return isLower ? 'am' : 'AM';\n }\n }\n var baseConfig = {\n calendar: defaultCalendar,\n longDateFormat: defaultLongDateFormat,\n invalidDate: defaultInvalidDate,\n ordinal: defaultOrdinal,\n dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,\n relativeTime: defaultRelativeTime,\n months: defaultLocaleMonths,\n monthsShort: defaultLocaleMonthsShort,\n week: defaultLocaleWeek,\n weekdays: defaultLocaleWeekdays,\n weekdaysMin: defaultLocaleWeekdaysMin,\n weekdaysShort: defaultLocaleWeekdaysShort,\n meridiemParse: defaultLocaleMeridiemParse\n };\n\n // internal storage for locale config files\n var locales = {},\n localeFamilies = {},\n globalLocale;\n function commonPrefix(arr1, arr2) {\n var i,\n minl = Math.min(arr1.length, arr2.length);\n for (i = 0; i < minl; i += 1) {\n if (arr1[i] !== arr2[i]) {\n return i;\n }\n }\n return minl;\n }\n function normalizeLocale(key) {\n return key ? key.toLowerCase().replace('_', '-') : key;\n }\n\n // pick the locale from the array\n // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n function chooseLocale(names) {\n var i = 0,\n j,\n next,\n locale,\n split;\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && commonPrefix(split, next) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }\n function isLocaleNameSane(name) {\n // Prevent names that look like filesystem paths, i.e contain '/' or '\\'\n // Ensure name is available and function returns boolean\n return !!(name && name.match('^[^/\\\\\\\\]*$'));\n }\n function loadLocale(name) {\n var oldLocale = null,\n aliasedRequire;\n // TODO: Find a better way to register and load all the locales in Node\n if (locales[name] === undefined && typeof module !== 'undefined' && module && module.exports && isLocaleNameSane(name)) {\n try {\n oldLocale = globalLocale._abbr;\n aliasedRequire = require;\n aliasedRequire('./locale/' + name);\n getSetGlobalLocale(oldLocale);\n } catch (e) {\n // mark as not found to avoid repeating expensive file require call causing high CPU\n // when trying to find en-US, en_US, en-us for every format call\n locales[name] = null; // null means not found\n }\n }\n return locales[name];\n }\n\n // This function will load locale and then set the global locale. If\n // no arguments are passed in, it will simply return the current global\n // locale key.\n function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n return globalLocale._abbr;\n }\n function defineLocale(name, config) {\n if (config !== null) {\n var locale,\n parentConfig = baseConfig;\n config.abbr = name;\n if (locales[name] != null) {\n deprecateSimple('defineLocaleOverride', 'use moment.updateLocale(localeName, config) to change ' + 'an existing locale. moment.defineLocale(localeName, ' + 'config) should only be used for creating a new locale ' + 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');\n parentConfig = locales[name]._config;\n } else if (config.parentLocale != null) {\n if (locales[config.parentLocale] != null) {\n parentConfig = locales[config.parentLocale]._config;\n } else {\n locale = loadLocale(config.parentLocale);\n if (locale != null) {\n parentConfig = locale._config;\n } else {\n if (!localeFamilies[config.parentLocale]) {\n localeFamilies[config.parentLocale] = [];\n }\n localeFamilies[config.parentLocale].push({\n name: name,\n config: config\n });\n return null;\n }\n }\n }\n locales[name] = new Locale(mergeConfigs(parentConfig, config));\n if (localeFamilies[name]) {\n localeFamilies[name].forEach(function (x) {\n defineLocale(x.name, x.config);\n });\n }\n\n // backwards compat for now: also set the locale\n // make sure we set the locale AFTER all child locales have been\n // created, so we won't end up with the child locale set.\n getSetGlobalLocale(name);\n return locales[name];\n } else {\n // useful for testing\n delete locales[name];\n return null;\n }\n }\n function updateLocale(name, config) {\n if (config != null) {\n var locale,\n tmpLocale,\n parentConfig = baseConfig;\n if (locales[name] != null && locales[name].parentLocale != null) {\n // Update existing child locale in-place to avoid memory-leaks\n locales[name].set(mergeConfigs(locales[name]._config, config));\n } else {\n // MERGE\n tmpLocale = loadLocale(name);\n if (tmpLocale != null) {\n parentConfig = tmpLocale._config;\n }\n config = mergeConfigs(parentConfig, config);\n if (tmpLocale == null) {\n // updateLocale is called for creating a new locale\n // Set abbr so it will have a name (getters return\n // undefined otherwise).\n config.abbr = name;\n }\n locale = new Locale(config);\n locale.parentLocale = locales[name];\n locales[name] = locale;\n }\n\n // backwards compat for now: also set the locale\n getSetGlobalLocale(name);\n } else {\n // pass null for config to unupdate, useful for tests\n if (locales[name] != null) {\n if (locales[name].parentLocale != null) {\n locales[name] = locales[name].parentLocale;\n if (name === getSetGlobalLocale()) {\n getSetGlobalLocale(name);\n }\n } else if (locales[name] != null) {\n delete locales[name];\n }\n }\n }\n return locales[name];\n }\n\n // returns locale data\n function getLocale(key) {\n var locale;\n if (key && key._locale && key._locale._abbr) {\n key = key._locale._abbr;\n }\n if (!key) {\n return globalLocale;\n }\n if (!isArray(key)) {\n //short-circuit everything else\n locale = loadLocale(key);\n if (locale) {\n return locale;\n }\n key = [key];\n }\n return chooseLocale(key);\n }\n function listLocales() {\n return keys(locales);\n }\n function checkOverflow(m) {\n var overflow,\n a = m._a;\n if (a && getParsingFlags(m).overflow === -2) {\n overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1;\n if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {\n overflow = DATE;\n }\n if (getParsingFlags(m)._overflowWeeks && overflow === -1) {\n overflow = WEEK;\n }\n if (getParsingFlags(m)._overflowWeekday && overflow === -1) {\n overflow = WEEKDAY;\n }\n getParsingFlags(m).overflow = overflow;\n }\n return m;\n }\n\n // iso 8601 regex\n // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)\n var extendedIsoRegex = /^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,\n basicIsoRegex = /^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d|))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,\n tzRegex = /Z|[+-]\\d\\d(?::?\\d\\d)?/,\n isoDates = [['YYYYYY-MM-DD', /[+-]\\d{6}-\\d\\d-\\d\\d/], ['YYYY-MM-DD', /\\d{4}-\\d\\d-\\d\\d/], ['GGGG-[W]WW-E', /\\d{4}-W\\d\\d-\\d/], ['GGGG-[W]WW', /\\d{4}-W\\d\\d/, false], ['YYYY-DDD', /\\d{4}-\\d{3}/], ['YYYY-MM', /\\d{4}-\\d\\d/, false], ['YYYYYYMMDD', /[+-]\\d{10}/], ['YYYYMMDD', /\\d{8}/], ['GGGG[W]WWE', /\\d{4}W\\d{3}/], ['GGGG[W]WW', /\\d{4}W\\d{2}/, false], ['YYYYDDD', /\\d{7}/], ['YYYYMM', /\\d{6}/, false], ['YYYY', /\\d{4}/, false]],\n // iso time formats and regexes\n isoTimes = [['HH:mm:ss.SSSS', /\\d\\d:\\d\\d:\\d\\d\\.\\d+/], ['HH:mm:ss,SSSS', /\\d\\d:\\d\\d:\\d\\d,\\d+/], ['HH:mm:ss', /\\d\\d:\\d\\d:\\d\\d/], ['HH:mm', /\\d\\d:\\d\\d/], ['HHmmss.SSSS', /\\d\\d\\d\\d\\d\\d\\.\\d+/], ['HHmmss,SSSS', /\\d\\d\\d\\d\\d\\d,\\d+/], ['HHmmss', /\\d\\d\\d\\d\\d\\d/], ['HHmm', /\\d\\d\\d\\d/], ['HH', /\\d\\d/]],\n aspNetJsonRegex = /^\\/?Date\\((-?\\d+)/i,\n // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3\n rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/,\n obsOffsets = {\n UT: 0,\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60\n };\n\n // date from iso format\n function configFromISO(config) {\n var i,\n l,\n string = config._i,\n match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),\n allowTime,\n dateFormat,\n timeFormat,\n tzFormat,\n isoDatesLen = isoDates.length,\n isoTimesLen = isoTimes.length;\n if (match) {\n getParsingFlags(config).iso = true;\n for (i = 0, l = isoDatesLen; i < l; i++) {\n if (isoDates[i][1].exec(match[1])) {\n dateFormat = isoDates[i][0];\n allowTime = isoDates[i][2] !== false;\n break;\n }\n }\n if (dateFormat == null) {\n config._isValid = false;\n return;\n }\n if (match[3]) {\n for (i = 0, l = isoTimesLen; i < l; i++) {\n if (isoTimes[i][1].exec(match[3])) {\n // match[2] should be 'T' or space\n timeFormat = (match[2] || ' ') + isoTimes[i][0];\n break;\n }\n }\n if (timeFormat == null) {\n config._isValid = false;\n return;\n }\n }\n if (!allowTime && timeFormat != null) {\n config._isValid = false;\n return;\n }\n if (match[4]) {\n if (tzRegex.exec(match[4])) {\n tzFormat = 'Z';\n } else {\n config._isValid = false;\n return;\n }\n }\n config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n configFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }\n function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n var result = [untruncateYear(yearStr), defaultLocaleMonthsShort.indexOf(monthStr), parseInt(dayStr, 10), parseInt(hourStr, 10), parseInt(minuteStr, 10)];\n if (secondStr) {\n result.push(parseInt(secondStr, 10));\n }\n return result;\n }\n function untruncateYear(yearStr) {\n var year = parseInt(yearStr, 10);\n if (year <= 49) {\n return 2000 + year;\n } else if (year <= 999) {\n return 1900 + year;\n }\n return year;\n }\n function preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s.replace(/\\([^()]*\\)|[\\n\\t]/g, ' ').replace(/(\\s\\s+)/g, ' ').replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n }\n function checkWeekday(weekdayStr, parsedInput, config) {\n if (weekdayStr) {\n // TODO: Replace the vanilla JS Date object with an independent day-of-week check.\n var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),\n weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay();\n if (weekdayProvided !== weekdayActual) {\n getParsingFlags(config).weekdayMismatch = true;\n config._isValid = false;\n return false;\n }\n }\n return true;\n }\n function calculateOffset(obsOffset, militaryOffset, numOffset) {\n if (obsOffset) {\n return obsOffsets[obsOffset];\n } else if (militaryOffset) {\n // the only allowed military tz is Z\n return 0;\n } else {\n var hm = parseInt(numOffset, 10),\n m = hm % 100,\n h = (hm - m) / 100;\n return h * 60 + m;\n }\n }\n\n // date and time from ref 2822 format\n function configFromRFC2822(config) {\n var match = rfc2822.exec(preprocessRFC2822(config._i)),\n parsedArray;\n if (match) {\n parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]);\n if (!checkWeekday(match[1], parsedArray, config)) {\n return;\n }\n config._a = parsedArray;\n config._tzm = calculateOffset(match[8], match[9], match[10]);\n config._d = createUTCDate.apply(null, config._a);\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n getParsingFlags(config).rfc2822 = true;\n } else {\n config._isValid = false;\n }\n }\n\n // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict\n function configFromString(config) {\n var matched = aspNetJsonRegex.exec(config._i);\n if (matched !== null) {\n config._d = new Date(+matched[1]);\n return;\n }\n configFromISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n configFromRFC2822(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n if (config._strict) {\n config._isValid = false;\n } else {\n // Final attempt, use Input Fallback\n hooks.createFromInputFallback(config);\n }\n }\n hooks.createFromInputFallback = deprecate('value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + 'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.', function (config) {\n config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));\n });\n\n // Pick the first defined of two or three arguments.\n function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }\n function currentDateArray(config) {\n // hooks is actually the exported moment object\n var nowValue = new Date(hooks.now());\n if (config._useUTC) {\n return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];\n }\n return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];\n }\n\n // convert an array to a date.\n // the array should mirror the parameters below\n // note: all values past the year are optional and will default to the lowest possible value.\n // [year, month, day , hour, minute, second, millisecond]\n function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n expectedWeekday,\n yearToUse;\n if (config._d) {\n return;\n }\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();\n\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }\n function dayOfYearFromWeekInfo(config) {\n var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;\n w = config._w;\n if (w.GG != null || w.W != null || w.E != null) {\n dow = 1;\n doy = 4;\n\n // TODO: We need to take the current isoWeekYear, but that depends on\n // how we interpret now (local, utc, fixed offset). So create\n // a now version of current config (take local/utc/offset flags, and\n // create now).\n weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);\n week = defaults(w.W, 1);\n weekday = defaults(w.E, 1);\n if (weekday < 1 || weekday > 7) {\n weekdayOverflow = true;\n }\n } else {\n dow = config._locale._week.dow;\n doy = config._locale._week.doy;\n curWeek = weekOfYear(createLocal(), dow, doy);\n weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);\n\n // Default to current week.\n week = defaults(w.w, curWeek.week);\n if (w.d != null) {\n // weekday -- low day numbers are considered next week\n weekday = w.d;\n if (weekday < 0 || weekday > 6) {\n weekdayOverflow = true;\n }\n } else if (w.e != null) {\n // local weekday -- counting starts from beginning of week\n weekday = w.e + dow;\n if (w.e < 0 || w.e > 6) {\n weekdayOverflow = true;\n }\n } else {\n // default to beginning of week\n weekday = dow;\n }\n }\n if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {\n getParsingFlags(config)._overflowWeeks = true;\n } else if (weekdayOverflow != null) {\n getParsingFlags(config)._overflowWeekday = true;\n } else {\n temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);\n config._a[YEAR] = temp.year;\n config._dayOfYear = temp.dayOfYear;\n }\n }\n\n // constant that refers to the ISO standard\n hooks.ISO_8601 = function () {};\n\n // constant that refers to the RFC 2822 form\n hooks.RFC_2822 = function () {};\n\n // date from string and format string\n function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i,\n parsedInput,\n tokens,\n token,\n skipped,\n stringLength = string.length,\n totalParsedInputLength = 0,\n era,\n tokenLen;\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n tokenLen = tokens.length;\n for (i = 0; i < tokenLen; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n } else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n } else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n // handle era\n era = getParsingFlags(config).era;\n if (era !== null) {\n config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);\n }\n configFromArray(config);\n checkOverflow(config);\n }\n function meridiemFixWrap(locale, hour, meridiem) {\n var isPm;\n if (meridiem == null) {\n // nothing to do\n return hour;\n }\n if (locale.meridiemHour != null) {\n return locale.meridiemHour(hour, meridiem);\n } else if (locale.isPM != null) {\n // Fallback\n isPm = locale.isPM(meridiem);\n if (isPm && hour < 12) {\n hour += 12;\n }\n if (!isPm && hour === 12) {\n hour = 0;\n }\n return hour;\n } else {\n // this is not supposed to happen\n return hour;\n }\n }\n\n // date from string and array of format strings\n function configFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n scoreToBeat,\n i,\n currentScore,\n validFormatFound,\n bestFormatIsValid = false,\n configfLen = config._f.length;\n if (configfLen === 0) {\n getParsingFlags(config).invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n for (i = 0; i < configfLen; i++) {\n currentScore = 0;\n validFormatFound = false;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._f = config._f[i];\n configFromStringAndFormat(tempConfig);\n if (isValid(tempConfig)) {\n validFormatFound = true;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += getParsingFlags(tempConfig).charsLeftOver;\n\n //or tokens\n currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;\n getParsingFlags(tempConfig).score = currentScore;\n if (!bestFormatIsValid) {\n if (scoreToBeat == null || currentScore < scoreToBeat || validFormatFound) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n if (validFormatFound) {\n bestFormatIsValid = true;\n }\n }\n } else {\n if (currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n }\n extend(config, bestMoment || tempConfig);\n }\n function configFromObject(config) {\n if (config._d) {\n return;\n }\n var i = normalizeObjectUnits(config._i),\n dayOrDate = i.day === undefined ? i.date : i.day;\n config._a = map([i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond], function (obj) {\n return obj && parseInt(obj, 10);\n });\n configFromArray(config);\n }\n function createFromConfig(config) {\n var res = new Moment(checkOverflow(prepareConfig(config)));\n if (res._nextDay) {\n // Adding is smart enough around DST\n res.add(1, 'd');\n res._nextDay = undefined;\n }\n return res;\n }\n function prepareConfig(config) {\n var input = config._i,\n format = config._f;\n config._locale = config._locale || getLocale(config._l);\n if (input === null || format === undefined && input === '') {\n return createInvalid({\n nullInput: true\n });\n }\n if (typeof input === 'string') {\n config._i = input = config._locale.preparse(input);\n }\n if (isMoment(input)) {\n return new Moment(checkOverflow(input));\n } else if (isDate(input)) {\n config._d = input;\n } else if (isArray(format)) {\n configFromStringAndArray(config);\n } else if (format) {\n configFromStringAndFormat(config);\n } else {\n configFromInput(config);\n }\n if (!isValid(config)) {\n config._d = null;\n }\n return config;\n }\n function configFromInput(config) {\n var input = config._i;\n if (isUndefined(input)) {\n config._d = new Date(hooks.now());\n } else if (isDate(input)) {\n config._d = new Date(input.valueOf());\n } else if (typeof input === 'string') {\n configFromString(config);\n } else if (isArray(input)) {\n config._a = map(input.slice(0), function (obj) {\n return parseInt(obj, 10);\n });\n configFromArray(config);\n } else if (isObject(input)) {\n configFromObject(config);\n } else if (isNumber(input)) {\n // from milliseconds\n config._d = new Date(input);\n } else {\n hooks.createFromInputFallback(config);\n }\n }\n function createLocalOrUTC(input, format, locale, strict, isUTC) {\n var c = {};\n if (format === true || format === false) {\n strict = format;\n format = undefined;\n }\n if (locale === true || locale === false) {\n strict = locale;\n locale = undefined;\n }\n if (isObject(input) && isObjectEmpty(input) || isArray(input) && input.length === 0) {\n input = undefined;\n }\n // object construction must be done this way.\n // https://github.com/moment/moment/issues/1423\n c._isAMomentObject = true;\n c._useUTC = c._isUTC = isUTC;\n c._l = locale;\n c._i = input;\n c._f = format;\n c._strict = strict;\n return createFromConfig(c);\n }\n function createLocal(input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, false);\n }\n var prototypeMin = deprecate('moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other < this ? this : other;\n } else {\n return createInvalid();\n }\n }),\n prototypeMax = deprecate('moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other > this ? this : other;\n } else {\n return createInvalid();\n }\n });\n\n // Pick a moment m from moments so that m[fn](other) is true for all\n // other. This relies on the function fn to be transitive.\n //\n // moments should either be an array of moment objects or an array, whose\n // first element is an array of moment objects.\n function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }\n\n // TODO: Use [].sort instead?\n function min() {\n var args = [].slice.call(arguments, 0);\n return pickBy('isBefore', args);\n }\n function max() {\n var args = [].slice.call(arguments, 0);\n return pickBy('isAfter', args);\n }\n var now = function () {\n return Date.now ? Date.now() : +new Date();\n };\n var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];\n function isDurationValid(m) {\n var key,\n unitHasDecimal = false,\n i,\n orderLen = ordering.length;\n for (key in m) {\n if (hasOwnProp(m, key) && !(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) {\n return false;\n }\n }\n for (i = 0; i < orderLen; ++i) {\n if (m[ordering[i]]) {\n if (unitHasDecimal) {\n return false; // only allow non-integers for smallest unit\n }\n if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {\n unitHasDecimal = true;\n }\n }\n }\n return true;\n }\n function isValid$1() {\n return this._isValid;\n }\n function createInvalid$1() {\n return createDuration(NaN);\n }\n function Duration(duration) {\n var normalizedInput = normalizeObjectUnits(duration),\n years = normalizedInput.year || 0,\n quarters = normalizedInput.quarter || 0,\n months = normalizedInput.month || 0,\n weeks = normalizedInput.week || normalizedInput.isoWeek || 0,\n days = normalizedInput.day || 0,\n hours = normalizedInput.hour || 0,\n minutes = normalizedInput.minute || 0,\n seconds = normalizedInput.second || 0,\n milliseconds = normalizedInput.millisecond || 0;\n this._isValid = isDurationValid(normalizedInput);\n\n // representation for dateAddRemove\n this._milliseconds = +milliseconds + seconds * 1e3 +\n // 1000\n minutes * 6e4 +\n // 1000 * 60\n hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978\n // Because of dateAddRemove treats 24 hours as different from a\n // day when working around DST, we need to store them separately\n this._days = +days + weeks * 7;\n // It is impossible to translate months into days without knowing\n // which months you are are talking about, so we have to store\n // it separately.\n this._months = +months + quarters * 3 + years * 12;\n this._data = {};\n this._locale = getLocale();\n this._bubble();\n }\n function isDuration(obj) {\n return obj instanceof Duration;\n }\n function absRound(number) {\n if (number < 0) {\n return Math.round(-1 * number) * -1;\n } else {\n return Math.round(number);\n }\n }\n\n // compare two arrays, return the number of differences\n function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (dontConvert && array1[i] !== array2[i] || !dontConvert && toInt(array1[i]) !== toInt(array2[i])) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }\n\n // FORMATTING\n\n function offset(token, separator) {\n addFormatToken(token, 0, 0, function () {\n var offset = this.utcOffset(),\n sign = '+';\n if (offset < 0) {\n offset = -offset;\n sign = '-';\n }\n return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~offset % 60, 2);\n });\n }\n offset('Z', ':');\n offset('ZZ', '');\n\n // PARSING\n\n addRegexToken('Z', matchShortOffset);\n addRegexToken('ZZ', matchShortOffset);\n addParseToken(['Z', 'ZZ'], function (input, array, config) {\n config._useUTC = true;\n config._tzm = offsetFromString(matchShortOffset, input);\n });\n\n // HELPERS\n\n // timezone chunker\n // '+10:00' > ['10', '00']\n // '-1530' > ['-15', '30']\n var chunkOffset = /([\\+\\-]|\\d\\d)/gi;\n function offsetFromString(matcher, string) {\n var matches = (string || '').match(matcher),\n chunk,\n parts,\n minutes;\n if (matches === null) {\n return null;\n }\n chunk = matches[matches.length - 1] || [];\n parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];\n minutes = +(parts[1] * 60) + toInt(parts[2]);\n return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;\n }\n\n // Return a moment from input, that is local/utc/zone equivalent to model.\n function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(res._d.valueOf() + diff);\n hooks.updateOffset(res, false);\n return res;\n } else {\n return createLocal(input).local();\n }\n }\n function getDateOffset(m) {\n // On Firefox.24 Date#getTimezoneOffset returns a floating point.\n // https://github.com/moment/moment/pull/1871\n return -Math.round(m._d.getTimezoneOffset());\n }\n\n // HOOKS\n\n // This function will be called whenever a moment is mutated.\n // It is intended to keep the offset in sync with the timezone.\n hooks.updateOffset = function () {};\n\n // MOMENTS\n\n // keepLocalTime = true means only change the timezone, without\n // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->\n // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset\n // +0200, so we adjust the time as needed, to be valid.\n //\n // Keeping the time actually adds/subtracts (one hour)\n // from the actual represented time. That is why we call updateOffset\n // a second time. In case it wants us to change the offset again\n // _changeInProgress == true case, then we have to adjust, because\n // there is no such time in the given timezone.\n function getSetOffset(input, keepLocalTime, keepMinutes) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16 && !keepMinutes) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }\n function getSetZone(input, keepLocalTime) {\n if (input != null) {\n if (typeof input !== 'string') {\n input = -input;\n }\n this.utcOffset(input, keepLocalTime);\n return this;\n } else {\n return -this.utcOffset();\n }\n }\n function setOffsetToUTC(keepLocalTime) {\n return this.utcOffset(0, keepLocalTime);\n }\n function setOffsetToLocal(keepLocalTime) {\n if (this._isUTC) {\n this.utcOffset(0, keepLocalTime);\n this._isUTC = false;\n if (keepLocalTime) {\n this.subtract(getDateOffset(this), 'm');\n }\n }\n return this;\n }\n function setOffsetToParsedOffset() {\n if (this._tzm != null) {\n this.utcOffset(this._tzm, false, true);\n } else if (typeof this._i === 'string') {\n var tZone = offsetFromString(matchOffset, this._i);\n if (tZone != null) {\n this.utcOffset(tZone);\n } else {\n this.utcOffset(0, true);\n }\n }\n return this;\n }\n function hasAlignedHourOffset(input) {\n if (!this.isValid()) {\n return false;\n }\n input = input ? createLocal(input).utcOffset() : 0;\n return (this.utcOffset() - input) % 60 === 0;\n }\n function isDaylightSavingTime() {\n return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset();\n }\n function isDaylightSavingTimeShifted() {\n if (!isUndefined(this._isDSTShifted)) {\n return this._isDSTShifted;\n }\n var c = {},\n other;\n copyConfig(c, this);\n c = prepareConfig(c);\n if (c._a) {\n other = c._isUTC ? createUTC(c._a) : createLocal(c._a);\n this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0;\n } else {\n this._isDSTShifted = false;\n }\n return this._isDSTShifted;\n }\n function isLocal() {\n return this.isValid() ? !this._isUTC : false;\n }\n function isUtcOffset() {\n return this.isValid() ? this._isUTC : false;\n }\n function isUtc() {\n return this.isValid() ? this._isUTC && this._offset === 0 : false;\n }\n\n // ASP.NET json date format regex\n var aspNetRegex = /^(-|\\+)?(?:(\\d*)[. ])?(\\d+):(\\d+)(?::(\\d+)(\\.\\d*)?)?$/,\n // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html\n // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere\n // and further modified to allow for strings containing both week and day\n isoRegex = /^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;\n function createDuration(input, key) {\n var duration = input,\n // matching against regexp is expensive, do it on demand\n match = null,\n sign,\n ret,\n diffRes;\n if (isDuration(input)) {\n duration = {\n ms: input._milliseconds,\n d: input._days,\n M: input._months\n };\n } else if (isNumber(input) || !isNaN(+input)) {\n duration = {};\n if (key) {\n duration[key] = +input;\n } else {\n duration.milliseconds = +input;\n }\n } else if (match = aspNetRegex.exec(input)) {\n sign = match[1] === '-' ? -1 : 1;\n duration = {\n y: 0,\n d: toInt(match[DATE]) * sign,\n h: toInt(match[HOUR]) * sign,\n m: toInt(match[MINUTE]) * sign,\n s: toInt(match[SECOND]) * sign,\n ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match\n };\n } else if (match = isoRegex.exec(input)) {\n sign = match[1] === '-' ? -1 : 1;\n duration = {\n y: parseIso(match[2], sign),\n M: parseIso(match[3], sign),\n w: parseIso(match[4], sign),\n d: parseIso(match[5], sign),\n h: parseIso(match[6], sign),\n m: parseIso(match[7], sign),\n s: parseIso(match[8], sign)\n };\n } else if (duration == null) {\n // checks for null or undefined\n duration = {};\n } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {\n diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));\n duration = {};\n duration.ms = diffRes.milliseconds;\n duration.M = diffRes.months;\n }\n ret = new Duration(duration);\n if (isDuration(input) && hasOwnProp(input, '_locale')) {\n ret._locale = input._locale;\n }\n if (isDuration(input) && hasOwnProp(input, '_isValid')) {\n ret._isValid = input._isValid;\n }\n return ret;\n }\n createDuration.fn = Duration.prototype;\n createDuration.invalid = createInvalid$1;\n function parseIso(inp, sign) {\n // We'd normally use ~~inp for this, but unfortunately it also\n // converts floats to ints.\n // inp may be undefined, so careful calling replace on it.\n var res = inp && parseFloat(inp.replace(',', '.'));\n // apply sign while we're at it\n return (isNaN(res) ? 0 : res) * sign;\n }\n function positiveMomentsDifference(base, other) {\n var res = {};\n res.months = other.month() - base.month() + (other.year() - base.year()) * 12;\n if (base.clone().add(res.months, 'M').isAfter(other)) {\n --res.months;\n }\n res.milliseconds = +other - +base.clone().add(res.months, 'M');\n return res;\n }\n function momentsDifference(base, other) {\n var res;\n if (!(base.isValid() && other.isValid())) {\n return {\n milliseconds: 0,\n months: 0\n };\n }\n other = cloneWithOffset(other, base);\n if (base.isBefore(other)) {\n res = positiveMomentsDifference(base, other);\n } else {\n res = positiveMomentsDifference(other, base);\n res.milliseconds = -res.milliseconds;\n res.months = -res.months;\n }\n return res;\n }\n\n // TODO: remove 'name' arg after deprecation is removed\n function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n tmp = val;\n val = period;\n period = tmp;\n }\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }\n function addSubtract(mom, duration, isAdding, updateOffset) {\n var milliseconds = duration._milliseconds,\n days = absRound(duration._days),\n months = absRound(duration._months);\n if (!mom.isValid()) {\n // No op\n return;\n }\n updateOffset = updateOffset == null ? true : updateOffset;\n if (months) {\n setMonth(mom, get(mom, 'Month') + months * isAdding);\n }\n if (days) {\n set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);\n }\n if (milliseconds) {\n mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);\n }\n if (updateOffset) {\n hooks.updateOffset(mom, days || months);\n }\n }\n var add = createAdder(1, 'add'),\n subtract = createAdder(-1, 'subtract');\n function isString(input) {\n return typeof input === 'string' || input instanceof String;\n }\n\n // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined\n function isMomentInput(input) {\n return isMoment(input) || isDate(input) || isString(input) || isNumber(input) || isNumberOrStringArray(input) || isMomentInputObject(input) || input === null || input === undefined;\n }\n function isMomentInputObject(input) {\n var objectTest = isObject(input) && !isObjectEmpty(input),\n propertyTest = false,\n properties = ['years', 'year', 'y', 'months', 'month', 'M', 'days', 'day', 'd', 'dates', 'date', 'D', 'hours', 'hour', 'h', 'minutes', 'minute', 'm', 'seconds', 'second', 's', 'milliseconds', 'millisecond', 'ms'],\n i,\n property,\n propertyLen = properties.length;\n for (i = 0; i < propertyLen; i += 1) {\n property = properties[i];\n propertyTest = propertyTest || hasOwnProp(input, property);\n }\n return objectTest && propertyTest;\n }\n function isNumberOrStringArray(input) {\n var arrayTest = isArray(input),\n dataTypeTest = false;\n if (arrayTest) {\n dataTypeTest = input.filter(function (item) {\n return !isNumber(item) && isString(input);\n }).length === 0;\n }\n return arrayTest && dataTypeTest;\n }\n function isCalendarSpec(input) {\n var objectTest = isObject(input) && !isObjectEmpty(input),\n propertyTest = false,\n properties = ['sameDay', 'nextDay', 'lastDay', 'nextWeek', 'lastWeek', 'sameElse'],\n i,\n property;\n for (i = 0; i < properties.length; i += 1) {\n property = properties[i];\n propertyTest = propertyTest || hasOwnProp(input, property);\n }\n return objectTest && propertyTest;\n }\n function getCalendarFormat(myMoment, now) {\n var diff = myMoment.diff(now, 'days', true);\n return diff < -6 ? 'sameElse' : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse';\n }\n function calendar$1(time, formats) {\n // Support for single parameter, formats only overload to the calendar function\n if (arguments.length === 1) {\n if (!arguments[0]) {\n time = undefined;\n formats = undefined;\n } else if (isMomentInput(arguments[0])) {\n time = arguments[0];\n formats = undefined;\n } else if (isCalendarSpec(arguments[0])) {\n formats = arguments[0];\n time = undefined;\n }\n }\n // We want to compare the start of today, vs this.\n // Getting start-of-today depends on whether we're local/utc/offset or not.\n var now = time || createLocal(),\n sod = cloneWithOffset(now, this).startOf('day'),\n format = hooks.calendarFormat(this, sod) || 'sameElse',\n output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);\n return this.format(output || this.localeData().calendar(format, this, createLocal(now)));\n }\n function clone() {\n return new Moment(this);\n }\n function isAfter(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() > localInput.valueOf();\n } else {\n return localInput.valueOf() < this.clone().startOf(units).valueOf();\n }\n }\n function isBefore(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() < localInput.valueOf();\n } else {\n return this.clone().endOf(units).valueOf() < localInput.valueOf();\n }\n }\n function isBetween(from, to, units, inclusivity) {\n var localFrom = isMoment(from) ? from : createLocal(from),\n localTo = isMoment(to) ? to : createLocal(to);\n if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {\n return false;\n }\n inclusivity = inclusivity || '()';\n return (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units));\n }\n function isSame(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input),\n inputMs;\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() === localInput.valueOf();\n } else {\n inputMs = localInput.valueOf();\n return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();\n }\n }\n function isSameOrAfter(input, units) {\n return this.isSame(input, units) || this.isAfter(input, units);\n }\n function isSameOrBefore(input, units) {\n return this.isSame(input, units) || this.isBefore(input, units);\n }\n function diff(input, units, asFloat) {\n var that, zoneDelta, output;\n if (!this.isValid()) {\n return NaN;\n }\n that = cloneWithOffset(input, this);\n if (!that.isValid()) {\n return NaN;\n }\n zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;\n units = normalizeUnits(units);\n switch (units) {\n case 'year':\n output = monthDiff(this, that) / 12;\n break;\n case 'month':\n output = monthDiff(this, that);\n break;\n case 'quarter':\n output = monthDiff(this, that) / 3;\n break;\n case 'second':\n output = (this - that) / 1e3;\n break;\n // 1000\n case 'minute':\n output = (this - that) / 6e4;\n break;\n // 1000 * 60\n case 'hour':\n output = (this - that) / 36e5;\n break;\n // 1000 * 60 * 60\n case 'day':\n output = (this - that - zoneDelta) / 864e5;\n break;\n // 1000 * 60 * 60 * 24, negate dst\n case 'week':\n output = (this - that - zoneDelta) / 6048e5;\n break;\n // 1000 * 60 * 60 * 24 * 7, negate dst\n default:\n output = this - that;\n }\n return asFloat ? output : absFloor(output);\n }\n function monthDiff(a, b) {\n if (a.date() < b.date()) {\n // end-of-month calculations work correct when the start month has more\n // days than the end month.\n return -monthDiff(b, a);\n }\n // difference in months\n var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),\n // b is in (anchor - 1 month, anchor + 1 month)\n anchor = a.clone().add(wholeMonthDiff, 'months'),\n anchor2,\n adjust;\n if (b - anchor < 0) {\n anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor - anchor2);\n } else {\n anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor2 - anchor);\n }\n\n //check for negative zero, return zero if negative zero\n return -(wholeMonthDiff + adjust) || 0;\n }\n hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';\n hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';\n function toString() {\n return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');\n }\n function toISOString(keepOffset) {\n if (!this.isValid()) {\n return null;\n }\n var utc = keepOffset !== true,\n m = utc ? this.clone().utc() : this;\n if (m.year() < 0 || m.year() > 9999) {\n return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ');\n }\n if (isFunction(Date.prototype.toISOString)) {\n // native implementation is ~50x faster, use it when we can\n if (utc) {\n return this.toDate().toISOString();\n } else {\n return new Date(this.valueOf() + this.utcOffset() * 60 * 1000).toISOString().replace('Z', formatMoment(m, 'Z'));\n }\n }\n return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ');\n }\n\n /**\n * Return a human readable representation of a moment that can\n * also be evaluated to get a new moment which is the same\n *\n * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects\n */\n function inspect() {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment',\n zone = '',\n prefix,\n year,\n datetime,\n suffix;\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n prefix = '[' + func + '(\"]';\n year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';\n datetime = '-MM-DD[T]HH:mm:ss.SSS';\n suffix = zone + '[\")]';\n return this.format(prefix + year + datetime + suffix);\n }\n function format(inputString) {\n if (!inputString) {\n inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;\n }\n var output = formatMoment(this, inputString);\n return this.localeData().postformat(output);\n }\n function from(time, withoutSuffix) {\n if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {\n return createDuration({\n to: this,\n from: time\n }).locale(this.locale()).humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n function fromNow(withoutSuffix) {\n return this.from(createLocal(), withoutSuffix);\n }\n function to(time, withoutSuffix) {\n if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {\n return createDuration({\n from: this,\n to: time\n }).locale(this.locale()).humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n function toNow(withoutSuffix) {\n return this.to(createLocal(), withoutSuffix);\n }\n\n // If passed a locale key, it will set the locale for this\n // instance. Otherwise, it will return the locale configuration\n // variables for this instance.\n function locale(key) {\n var newLocaleData;\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n }\n var lang = deprecate('moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', function (key) {\n if (key === undefined) {\n return this.localeData();\n } else {\n return this.locale(key);\n }\n });\n function localeData() {\n return this._locale;\n }\n var MS_PER_SECOND = 1000,\n MS_PER_MINUTE = 60 * MS_PER_SECOND,\n MS_PER_HOUR = 60 * MS_PER_MINUTE,\n MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;\n\n // actual modulo - handles negative numbers (for dates before 1970):\n function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }\n function localStartOfDate(y, m, d) {\n // the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n return new Date(y + 400, m, d) - MS_PER_400_YEARS;\n } else {\n return new Date(y, m, d).valueOf();\n }\n }\n function utcStartOfDate(y, m, d) {\n // Date.UTC remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;\n } else {\n return Date.UTC(y, m, d);\n }\n }\n function startOf(units) {\n var time, startOfDate;\n units = normalizeUnits(units);\n if (units === undefined || units === 'millisecond' || !this.isValid()) {\n return this;\n }\n startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n switch (units) {\n case 'year':\n time = startOfDate(this.year(), 0, 1);\n break;\n case 'quarter':\n time = startOfDate(this.year(), this.month() - this.month() % 3, 1);\n break;\n case 'month':\n time = startOfDate(this.year(), this.month(), 1);\n break;\n case 'week':\n time = startOfDate(this.year(), this.month(), this.date() - this.weekday());\n break;\n case 'isoWeek':\n time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1));\n break;\n case 'day':\n case 'date':\n time = startOfDate(this.year(), this.month(), this.date());\n break;\n case 'hour':\n time = this._d.valueOf();\n time -= mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR);\n break;\n case 'minute':\n time = this._d.valueOf();\n time -= mod$1(time, MS_PER_MINUTE);\n break;\n case 'second':\n time = this._d.valueOf();\n time -= mod$1(time, MS_PER_SECOND);\n break;\n }\n this._d.setTime(time);\n hooks.updateOffset(this, true);\n return this;\n }\n function endOf(units) {\n var time, startOfDate;\n units = normalizeUnits(units);\n if (units === undefined || units === 'millisecond' || !this.isValid()) {\n return this;\n }\n startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n switch (units) {\n case 'year':\n time = startOfDate(this.year() + 1, 0, 1) - 1;\n break;\n case 'quarter':\n time = startOfDate(this.year(), this.month() - this.month() % 3 + 3, 1) - 1;\n break;\n case 'month':\n time = startOfDate(this.year(), this.month() + 1, 1) - 1;\n break;\n case 'week':\n time = startOfDate(this.year(), this.month(), this.date() - this.weekday() + 7) - 1;\n break;\n case 'isoWeek':\n time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1;\n break;\n case 'day':\n case 'date':\n time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;\n break;\n case 'hour':\n time = this._d.valueOf();\n time += MS_PER_HOUR - mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR) - 1;\n break;\n case 'minute':\n time = this._d.valueOf();\n time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;\n break;\n case 'second':\n time = this._d.valueOf();\n time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;\n break;\n }\n this._d.setTime(time);\n hooks.updateOffset(this, true);\n return this;\n }\n function valueOf() {\n return this._d.valueOf() - (this._offset || 0) * 60000;\n }\n function unix() {\n return Math.floor(this.valueOf() / 1000);\n }\n function toDate() {\n return new Date(this.valueOf());\n }\n function toArray() {\n var m = this;\n return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];\n }\n function toObject() {\n var m = this;\n return {\n years: m.year(),\n months: m.month(),\n date: m.date(),\n hours: m.hours(),\n minutes: m.minutes(),\n seconds: m.seconds(),\n milliseconds: m.milliseconds()\n };\n }\n function toJSON() {\n // new Date(NaN).toJSON() === null\n return this.isValid() ? this.toISOString() : null;\n }\n function isValid$2() {\n return isValid(this);\n }\n function parsingFlags() {\n return extend({}, getParsingFlags(this));\n }\n function invalidAt() {\n return getParsingFlags(this).overflow;\n }\n function creationData() {\n return {\n input: this._i,\n format: this._f,\n locale: this._locale,\n isUTC: this._isUTC,\n strict: this._strict\n };\n }\n addFormatToken('N', 0, 0, 'eraAbbr');\n addFormatToken('NN', 0, 0, 'eraAbbr');\n addFormatToken('NNN', 0, 0, 'eraAbbr');\n addFormatToken('NNNN', 0, 0, 'eraName');\n addFormatToken('NNNNN', 0, 0, 'eraNarrow');\n addFormatToken('y', ['y', 1], 'yo', 'eraYear');\n addFormatToken('y', ['yy', 2], 0, 'eraYear');\n addFormatToken('y', ['yyy', 3], 0, 'eraYear');\n addFormatToken('y', ['yyyy', 4], 0, 'eraYear');\n addRegexToken('N', matchEraAbbr);\n addRegexToken('NN', matchEraAbbr);\n addRegexToken('NNN', matchEraAbbr);\n addRegexToken('NNNN', matchEraName);\n addRegexToken('NNNNN', matchEraNarrow);\n addParseToken(['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (input, array, config, token) {\n var era = config._locale.erasParse(input, token, config._strict);\n if (era) {\n getParsingFlags(config).era = era;\n } else {\n getParsingFlags(config).invalidEra = input;\n }\n });\n addRegexToken('y', matchUnsigned);\n addRegexToken('yy', matchUnsigned);\n addRegexToken('yyy', matchUnsigned);\n addRegexToken('yyyy', matchUnsigned);\n addRegexToken('yo', matchEraYearOrdinal);\n addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR);\n addParseToken(['yo'], function (input, array, config, token) {\n var match;\n if (config._locale._eraYearOrdinalRegex) {\n match = input.match(config._locale._eraYearOrdinalRegex);\n }\n if (config._locale.eraYearOrdinalParse) {\n array[YEAR] = config._locale.eraYearOrdinalParse(input, match);\n } else {\n array[YEAR] = parseInt(input, 10);\n }\n });\n function localeEras(m, format) {\n var i,\n l,\n date,\n eras = this._eras || getLocale('en')._eras;\n for (i = 0, l = eras.length; i < l; ++i) {\n switch (typeof eras[i].since) {\n case 'string':\n // truncate time\n date = hooks(eras[i].since).startOf('day');\n eras[i].since = date.valueOf();\n break;\n }\n switch (typeof eras[i].until) {\n case 'undefined':\n eras[i].until = +Infinity;\n break;\n case 'string':\n // truncate time\n date = hooks(eras[i].until).startOf('day').valueOf();\n eras[i].until = date.valueOf();\n break;\n }\n }\n return eras;\n }\n function localeErasParse(eraName, format, strict) {\n var i,\n l,\n eras = this.eras(),\n name,\n abbr,\n narrow;\n eraName = eraName.toUpperCase();\n for (i = 0, l = eras.length; i < l; ++i) {\n name = eras[i].name.toUpperCase();\n abbr = eras[i].abbr.toUpperCase();\n narrow = eras[i].narrow.toUpperCase();\n if (strict) {\n switch (format) {\n case 'N':\n case 'NN':\n case 'NNN':\n if (abbr === eraName) {\n return eras[i];\n }\n break;\n case 'NNNN':\n if (name === eraName) {\n return eras[i];\n }\n break;\n case 'NNNNN':\n if (narrow === eraName) {\n return eras[i];\n }\n break;\n }\n } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {\n return eras[i];\n }\n }\n }\n function localeErasConvertYear(era, year) {\n var dir = era.since <= era.until ? +1 : -1;\n if (year === undefined) {\n return hooks(era.since).year();\n } else {\n return hooks(era.since).year() + (year - era.offset) * dir;\n }\n }\n function getEraName() {\n var i,\n l,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n // truncate time\n val = this.clone().startOf('day').valueOf();\n if (eras[i].since <= val && val <= eras[i].until) {\n return eras[i].name;\n }\n if (eras[i].until <= val && val <= eras[i].since) {\n return eras[i].name;\n }\n }\n return '';\n }\n function getEraNarrow() {\n var i,\n l,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n // truncate time\n val = this.clone().startOf('day').valueOf();\n if (eras[i].since <= val && val <= eras[i].until) {\n return eras[i].narrow;\n }\n if (eras[i].until <= val && val <= eras[i].since) {\n return eras[i].narrow;\n }\n }\n return '';\n }\n function getEraAbbr() {\n var i,\n l,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n // truncate time\n val = this.clone().startOf('day').valueOf();\n if (eras[i].since <= val && val <= eras[i].until) {\n return eras[i].abbr;\n }\n if (eras[i].until <= val && val <= eras[i].since) {\n return eras[i].abbr;\n }\n }\n return '';\n }\n function getEraYear() {\n var i,\n l,\n dir,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n dir = eras[i].since <= eras[i].until ? +1 : -1;\n\n // truncate time\n val = this.clone().startOf('day').valueOf();\n if (eras[i].since <= val && val <= eras[i].until || eras[i].until <= val && val <= eras[i].since) {\n return (this.year() - hooks(eras[i].since).year()) * dir + eras[i].offset;\n }\n }\n return this.year();\n }\n function erasNameRegex(isStrict) {\n if (!hasOwnProp(this, '_erasNameRegex')) {\n computeErasParse.call(this);\n }\n return isStrict ? this._erasNameRegex : this._erasRegex;\n }\n function erasAbbrRegex(isStrict) {\n if (!hasOwnProp(this, '_erasAbbrRegex')) {\n computeErasParse.call(this);\n }\n return isStrict ? this._erasAbbrRegex : this._erasRegex;\n }\n function erasNarrowRegex(isStrict) {\n if (!hasOwnProp(this, '_erasNarrowRegex')) {\n computeErasParse.call(this);\n }\n return isStrict ? this._erasNarrowRegex : this._erasRegex;\n }\n function matchEraAbbr(isStrict, locale) {\n return locale.erasAbbrRegex(isStrict);\n }\n function matchEraName(isStrict, locale) {\n return locale.erasNameRegex(isStrict);\n }\n function matchEraNarrow(isStrict, locale) {\n return locale.erasNarrowRegex(isStrict);\n }\n function matchEraYearOrdinal(isStrict, locale) {\n return locale._eraYearOrdinalRegex || matchUnsigned;\n }\n function computeErasParse() {\n var abbrPieces = [],\n namePieces = [],\n narrowPieces = [],\n mixedPieces = [],\n i,\n l,\n erasName,\n erasAbbr,\n erasNarrow,\n eras = this.eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n erasName = regexEscape(eras[i].name);\n erasAbbr = regexEscape(eras[i].abbr);\n erasNarrow = regexEscape(eras[i].narrow);\n namePieces.push(erasName);\n abbrPieces.push(erasAbbr);\n narrowPieces.push(erasNarrow);\n mixedPieces.push(erasName);\n mixedPieces.push(erasAbbr);\n mixedPieces.push(erasNarrow);\n }\n this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');\n this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');\n this._erasNarrowRegex = new RegExp('^(' + narrowPieces.join('|') + ')', 'i');\n }\n\n // FORMATTING\n\n addFormatToken(0, ['gg', 2], 0, function () {\n return this.weekYear() % 100;\n });\n addFormatToken(0, ['GG', 2], 0, function () {\n return this.isoWeekYear() % 100;\n });\n function addWeekYearFormatToken(token, getter) {\n addFormatToken(0, [token, token.length], 0, getter);\n }\n addWeekYearFormatToken('gggg', 'weekYear');\n addWeekYearFormatToken('ggggg', 'weekYear');\n addWeekYearFormatToken('GGGG', 'isoWeekYear');\n addWeekYearFormatToken('GGGGG', 'isoWeekYear');\n\n // ALIASES\n\n // PARSING\n\n addRegexToken('G', matchSigned);\n addRegexToken('g', matchSigned);\n addRegexToken('GG', match1to2, match2);\n addRegexToken('gg', match1to2, match2);\n addRegexToken('GGGG', match1to4, match4);\n addRegexToken('gggg', match1to4, match4);\n addRegexToken('GGGGG', match1to6, match6);\n addRegexToken('ggggg', match1to6, match6);\n addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {\n week[token.substr(0, 2)] = toInt(input);\n });\n addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {\n week[token] = hooks.parseTwoDigitYear(input);\n });\n\n // MOMENTS\n\n function getSetWeekYear(input) {\n return getSetWeekYearHelper.call(this, input, this.week(), this.weekday() + this.localeData()._week.dow, this.localeData()._week.dow, this.localeData()._week.doy);\n }\n function getSetISOWeekYear(input) {\n return getSetWeekYearHelper.call(this, input, this.isoWeek(), this.isoWeekday(), 1, 4);\n }\n function getISOWeeksInYear() {\n return weeksInYear(this.year(), 1, 4);\n }\n function getISOWeeksInISOWeekYear() {\n return weeksInYear(this.isoWeekYear(), 1, 4);\n }\n function getWeeksInYear() {\n var weekInfo = this.localeData()._week;\n return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);\n }\n function getWeeksInWeekYear() {\n var weekInfo = this.localeData()._week;\n return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);\n }\n function getSetWeekYearHelper(input, week, weekday, dow, doy) {\n var weeksTarget;\n if (input == null) {\n return weekOfYear(this, dow, doy).year;\n } else {\n weeksTarget = weeksInYear(input, dow, doy);\n if (week > weeksTarget) {\n week = weeksTarget;\n }\n return setWeekAll.call(this, input, week, weekday, dow, doy);\n }\n }\n function setWeekAll(weekYear, week, weekday, dow, doy) {\n var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),\n date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);\n this.year(date.getUTCFullYear());\n this.month(date.getUTCMonth());\n this.date(date.getUTCDate());\n return this;\n }\n\n // FORMATTING\n\n addFormatToken('Q', 0, 'Qo', 'quarter');\n\n // PARSING\n\n addRegexToken('Q', match1);\n addParseToken('Q', function (input, array) {\n array[MONTH] = (toInt(input) - 1) * 3;\n });\n\n // MOMENTS\n\n function getSetQuarter(input) {\n return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);\n }\n\n // FORMATTING\n\n addFormatToken('D', ['DD', 2], 'Do', 'date');\n\n // PARSING\n\n addRegexToken('D', match1to2, match1to2NoLeadingZero);\n addRegexToken('DD', match1to2, match2);\n addRegexToken('Do', function (isStrict, locale) {\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n return isStrict ? locale._dayOfMonthOrdinalParse || locale._ordinalParse : locale._dayOfMonthOrdinalParseLenient;\n });\n addParseToken(['D', 'DD'], DATE);\n addParseToken('Do', function (input, array) {\n array[DATE] = toInt(input.match(match1to2)[0]);\n });\n\n // MOMENTS\n\n var getSetDayOfMonth = makeGetSet('Date', true);\n\n // FORMATTING\n\n addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');\n\n // PARSING\n\n addRegexToken('DDD', match1to3);\n addRegexToken('DDDD', match3);\n addParseToken(['DDD', 'DDDD'], function (input, array, config) {\n config._dayOfYear = toInt(input);\n });\n\n // HELPERS\n\n // MOMENTS\n\n function getSetDayOfYear(input) {\n var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;\n return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');\n }\n\n // FORMATTING\n\n addFormatToken('m', ['mm', 2], 0, 'minute');\n\n // PARSING\n\n addRegexToken('m', match1to2, match1to2HasZero);\n addRegexToken('mm', match1to2, match2);\n addParseToken(['m', 'mm'], MINUTE);\n\n // MOMENTS\n\n var getSetMinute = makeGetSet('Minutes', false);\n\n // FORMATTING\n\n addFormatToken('s', ['ss', 2], 0, 'second');\n\n // PARSING\n\n addRegexToken('s', match1to2, match1to2HasZero);\n addRegexToken('ss', match1to2, match2);\n addParseToken(['s', 'ss'], SECOND);\n\n // MOMENTS\n\n var getSetSecond = makeGetSet('Seconds', false);\n\n // FORMATTING\n\n addFormatToken('S', 0, 0, function () {\n return ~~(this.millisecond() / 100);\n });\n addFormatToken(0, ['SS', 2], 0, function () {\n return ~~(this.millisecond() / 10);\n });\n addFormatToken(0, ['SSS', 3], 0, 'millisecond');\n addFormatToken(0, ['SSSS', 4], 0, function () {\n return this.millisecond() * 10;\n });\n addFormatToken(0, ['SSSSS', 5], 0, function () {\n return this.millisecond() * 100;\n });\n addFormatToken(0, ['SSSSSS', 6], 0, function () {\n return this.millisecond() * 1000;\n });\n addFormatToken(0, ['SSSSSSS', 7], 0, function () {\n return this.millisecond() * 10000;\n });\n addFormatToken(0, ['SSSSSSSS', 8], 0, function () {\n return this.millisecond() * 100000;\n });\n addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {\n return this.millisecond() * 1000000;\n });\n\n // PARSING\n\n addRegexToken('S', match1to3, match1);\n addRegexToken('SS', match1to3, match2);\n addRegexToken('SSS', match1to3, match3);\n var token, getSetMillisecond;\n for (token = 'SSSS'; token.length <= 9; token += 'S') {\n addRegexToken(token, matchUnsigned);\n }\n function parseMs(input, array) {\n array[MILLISECOND] = toInt(('0.' + input) * 1000);\n }\n for (token = 'S'; token.length <= 9; token += 'S') {\n addParseToken(token, parseMs);\n }\n getSetMillisecond = makeGetSet('Milliseconds', false);\n\n // FORMATTING\n\n addFormatToken('z', 0, 0, 'zoneAbbr');\n addFormatToken('zz', 0, 0, 'zoneName');\n\n // MOMENTS\n\n function getZoneAbbr() {\n return this._isUTC ? 'UTC' : '';\n }\n function getZoneName() {\n return this._isUTC ? 'Coordinated Universal Time' : '';\n }\n var proto = Moment.prototype;\n proto.add = add;\n proto.calendar = calendar$1;\n proto.clone = clone;\n proto.diff = diff;\n proto.endOf = endOf;\n proto.format = format;\n proto.from = from;\n proto.fromNow = fromNow;\n proto.to = to;\n proto.toNow = toNow;\n proto.get = stringGet;\n proto.invalidAt = invalidAt;\n proto.isAfter = isAfter;\n proto.isBefore = isBefore;\n proto.isBetween = isBetween;\n proto.isSame = isSame;\n proto.isSameOrAfter = isSameOrAfter;\n proto.isSameOrBefore = isSameOrBefore;\n proto.isValid = isValid$2;\n proto.lang = lang;\n proto.locale = locale;\n proto.localeData = localeData;\n proto.max = prototypeMax;\n proto.min = prototypeMin;\n proto.parsingFlags = parsingFlags;\n proto.set = stringSet;\n proto.startOf = startOf;\n proto.subtract = subtract;\n proto.toArray = toArray;\n proto.toObject = toObject;\n proto.toDate = toDate;\n proto.toISOString = toISOString;\n proto.inspect = inspect;\n if (typeof Symbol !== 'undefined' && Symbol.for != null) {\n proto[Symbol.for('nodejs.util.inspect.custom')] = function () {\n return 'Moment<' + this.format() + '>';\n };\n }\n proto.toJSON = toJSON;\n proto.toString = toString;\n proto.unix = unix;\n proto.valueOf = valueOf;\n proto.creationData = creationData;\n proto.eraName = getEraName;\n proto.eraNarrow = getEraNarrow;\n proto.eraAbbr = getEraAbbr;\n proto.eraYear = getEraYear;\n proto.year = getSetYear;\n proto.isLeapYear = getIsLeapYear;\n proto.weekYear = getSetWeekYear;\n proto.isoWeekYear = getSetISOWeekYear;\n proto.quarter = proto.quarters = getSetQuarter;\n proto.month = getSetMonth;\n proto.daysInMonth = getDaysInMonth;\n proto.week = proto.weeks = getSetWeek;\n proto.isoWeek = proto.isoWeeks = getSetISOWeek;\n proto.weeksInYear = getWeeksInYear;\n proto.weeksInWeekYear = getWeeksInWeekYear;\n proto.isoWeeksInYear = getISOWeeksInYear;\n proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;\n proto.date = getSetDayOfMonth;\n proto.day = proto.days = getSetDayOfWeek;\n proto.weekday = getSetLocaleDayOfWeek;\n proto.isoWeekday = getSetISODayOfWeek;\n proto.dayOfYear = getSetDayOfYear;\n proto.hour = proto.hours = getSetHour;\n proto.minute = proto.minutes = getSetMinute;\n proto.second = proto.seconds = getSetSecond;\n proto.millisecond = proto.milliseconds = getSetMillisecond;\n proto.utcOffset = getSetOffset;\n proto.utc = setOffsetToUTC;\n proto.local = setOffsetToLocal;\n proto.parseZone = setOffsetToParsedOffset;\n proto.hasAlignedHourOffset = hasAlignedHourOffset;\n proto.isDST = isDaylightSavingTime;\n proto.isLocal = isLocal;\n proto.isUtcOffset = isUtcOffset;\n proto.isUtc = isUtc;\n proto.isUTC = isUtc;\n proto.zoneAbbr = getZoneAbbr;\n proto.zoneName = getZoneName;\n proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);\n proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);\n proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);\n proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);\n proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);\n function createUnix(input) {\n return createLocal(input * 1000);\n }\n function createInZone() {\n return createLocal.apply(null, arguments).parseZone();\n }\n function preParsePostFormat(string) {\n return string;\n }\n var proto$1 = Locale.prototype;\n proto$1.calendar = calendar;\n proto$1.longDateFormat = longDateFormat;\n proto$1.invalidDate = invalidDate;\n proto$1.ordinal = ordinal;\n proto$1.preparse = preParsePostFormat;\n proto$1.postformat = preParsePostFormat;\n proto$1.relativeTime = relativeTime;\n proto$1.pastFuture = pastFuture;\n proto$1.set = set;\n proto$1.eras = localeEras;\n proto$1.erasParse = localeErasParse;\n proto$1.erasConvertYear = localeErasConvertYear;\n proto$1.erasAbbrRegex = erasAbbrRegex;\n proto$1.erasNameRegex = erasNameRegex;\n proto$1.erasNarrowRegex = erasNarrowRegex;\n proto$1.months = localeMonths;\n proto$1.monthsShort = localeMonthsShort;\n proto$1.monthsParse = localeMonthsParse;\n proto$1.monthsRegex = monthsRegex;\n proto$1.monthsShortRegex = monthsShortRegex;\n proto$1.week = localeWeek;\n proto$1.firstDayOfYear = localeFirstDayOfYear;\n proto$1.firstDayOfWeek = localeFirstDayOfWeek;\n proto$1.weekdays = localeWeekdays;\n proto$1.weekdaysMin = localeWeekdaysMin;\n proto$1.weekdaysShort = localeWeekdaysShort;\n proto$1.weekdaysParse = localeWeekdaysParse;\n proto$1.weekdaysRegex = weekdaysRegex;\n proto$1.weekdaysShortRegex = weekdaysShortRegex;\n proto$1.weekdaysMinRegex = weekdaysMinRegex;\n proto$1.isPM = localeIsPM;\n proto$1.meridiem = localeMeridiem;\n function get$1(format, index, field, setter) {\n var locale = getLocale(),\n utc = createUTC().set(setter, index);\n return locale[field](utc, format);\n }\n function listMonthsImpl(format, index, field) {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n format = format || '';\n if (index != null) {\n return get$1(format, index, field, 'month');\n }\n var i,\n out = [];\n for (i = 0; i < 12; i++) {\n out[i] = get$1(format, i, field, 'month');\n }\n return out;\n }\n\n // ()\n // (5)\n // (fmt, 5)\n // (fmt)\n // (true)\n // (true, 5)\n // (true, fmt, 5)\n // (true, fmt)\n function listWeekdaysImpl(localeSorted, format, index, field) {\n if (typeof localeSorted === 'boolean') {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n format = format || '';\n } else {\n format = localeSorted;\n index = format;\n localeSorted = false;\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n format = format || '';\n }\n var locale = getLocale(),\n shift = localeSorted ? locale._week.dow : 0,\n i,\n out = [];\n if (index != null) {\n return get$1(format, (index + shift) % 7, field, 'day');\n }\n for (i = 0; i < 7; i++) {\n out[i] = get$1(format, (i + shift) % 7, field, 'day');\n }\n return out;\n }\n function listMonths(format, index) {\n return listMonthsImpl(format, index, 'months');\n }\n function listMonthsShort(format, index) {\n return listMonthsImpl(format, index, 'monthsShort');\n }\n function listWeekdays(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdays');\n }\n function listWeekdaysShort(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');\n }\n function listWeekdaysMin(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');\n }\n getSetGlobalLocale('en', {\n eras: [{\n since: '0001-01-01',\n until: +Infinity,\n offset: 1,\n name: 'Anno Domini',\n narrow: 'AD',\n abbr: 'AD'\n }, {\n since: '0000-12-31',\n until: -Infinity,\n offset: 1,\n name: 'Before Christ',\n narrow: 'BC',\n abbr: 'BC'\n }],\n dayOfMonthOrdinalParse: /\\d{1,2}(th|st|nd|rd)/,\n ordinal: function (number) {\n var b = number % 10,\n output = toInt(number % 100 / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th';\n return number + output;\n }\n });\n\n // Side effect imports\n\n hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);\n hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);\n var mathAbs = Math.abs;\n function abs() {\n var data = this._data;\n this._milliseconds = mathAbs(this._milliseconds);\n this._days = mathAbs(this._days);\n this._months = mathAbs(this._months);\n data.milliseconds = mathAbs(data.milliseconds);\n data.seconds = mathAbs(data.seconds);\n data.minutes = mathAbs(data.minutes);\n data.hours = mathAbs(data.hours);\n data.months = mathAbs(data.months);\n data.years = mathAbs(data.years);\n return this;\n }\n function addSubtract$1(duration, input, value, direction) {\n var other = createDuration(input, value);\n duration._milliseconds += direction * other._milliseconds;\n duration._days += direction * other._days;\n duration._months += direction * other._months;\n return duration._bubble();\n }\n\n // supports only 2.0-style add(1, 's') or add(duration)\n function add$1(input, value) {\n return addSubtract$1(this, input, value, 1);\n }\n\n // supports only 2.0-style subtract(1, 's') or subtract(duration)\n function subtract$1(input, value) {\n return addSubtract$1(this, input, value, -1);\n }\n function absCeil(number) {\n if (number < 0) {\n return Math.floor(number);\n } else {\n return Math.ceil(number);\n }\n }\n function bubble() {\n var milliseconds = this._milliseconds,\n days = this._days,\n months = this._months,\n data = this._data,\n seconds,\n minutes,\n hours,\n years,\n monthsFromDays;\n\n // if we have a mix of positive and negative values, bubble down first\n // check: https://github.com/moment/moment/issues/2166\n if (!(milliseconds >= 0 && days >= 0 && months >= 0 || milliseconds <= 0 && days <= 0 && months <= 0)) {\n milliseconds += absCeil(monthsToDays(months) + days) * 864e5;\n days = 0;\n months = 0;\n }\n\n // The following code bubbles up values, see the tests for\n // examples of what that means.\n data.milliseconds = milliseconds % 1000;\n seconds = absFloor(milliseconds / 1000);\n data.seconds = seconds % 60;\n minutes = absFloor(seconds / 60);\n data.minutes = minutes % 60;\n hours = absFloor(minutes / 60);\n data.hours = hours % 24;\n days += absFloor(hours / 24);\n\n // convert days to months\n monthsFromDays = absFloor(daysToMonths(days));\n months += monthsFromDays;\n days -= absCeil(monthsToDays(monthsFromDays));\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n data.days = days;\n data.months = months;\n data.years = years;\n return this;\n }\n function daysToMonths(days) {\n // 400 years have 146097 days (taking into account leap year rules)\n // 400 years have 12 months === 4800\n return days * 4800 / 146097;\n }\n function monthsToDays(months) {\n // the reverse of daysToMonths\n return months * 146097 / 4800;\n }\n function as(units) {\n if (!this.isValid()) {\n return NaN;\n }\n var days,\n months,\n milliseconds = this._milliseconds;\n units = normalizeUnits(units);\n if (units === 'month' || units === 'quarter' || units === 'year') {\n days = this._days + milliseconds / 864e5;\n months = this._months + daysToMonths(days);\n switch (units) {\n case 'month':\n return months;\n case 'quarter':\n return months / 3;\n case 'year':\n return months / 12;\n }\n } else {\n // handle milliseconds separately because of floating point math errors (issue #1867)\n days = this._days + Math.round(monthsToDays(this._months));\n switch (units) {\n case 'week':\n return days / 7 + milliseconds / 6048e5;\n case 'day':\n return days + milliseconds / 864e5;\n case 'hour':\n return days * 24 + milliseconds / 36e5;\n case 'minute':\n return days * 1440 + milliseconds / 6e4;\n case 'second':\n return days * 86400 + milliseconds / 1000;\n // Math.floor prevents floating point math errors here\n case 'millisecond':\n return Math.floor(days * 864e5) + milliseconds;\n default:\n throw new Error('Unknown unit ' + units);\n }\n }\n }\n function makeAs(alias) {\n return function () {\n return this.as(alias);\n };\n }\n var asMilliseconds = makeAs('ms'),\n asSeconds = makeAs('s'),\n asMinutes = makeAs('m'),\n asHours = makeAs('h'),\n asDays = makeAs('d'),\n asWeeks = makeAs('w'),\n asMonths = makeAs('M'),\n asQuarters = makeAs('Q'),\n asYears = makeAs('y'),\n valueOf$1 = asMilliseconds;\n function clone$1() {\n return createDuration(this);\n }\n function get$2(units) {\n units = normalizeUnits(units);\n return this.isValid() ? this[units + 's']() : NaN;\n }\n function makeGetter(name) {\n return function () {\n return this.isValid() ? this._data[name] : NaN;\n };\n }\n var milliseconds = makeGetter('milliseconds'),\n seconds = makeGetter('seconds'),\n minutes = makeGetter('minutes'),\n hours = makeGetter('hours'),\n days = makeGetter('days'),\n months = makeGetter('months'),\n years = makeGetter('years');\n function weeks() {\n return absFloor(this.days() / 7);\n }\n var round = Math.round,\n thresholds = {\n ss: 44,\n // a few seconds to seconds\n s: 45,\n // seconds to minute\n m: 45,\n // minutes to hour\n h: 22,\n // hours to day\n d: 26,\n // days to month/week\n w: null,\n // weeks to month\n M: 11 // months to year\n };\n\n // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize\n function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n }\n function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) {\n var duration = createDuration(posNegDuration).abs(),\n seconds = round(duration.as('s')),\n minutes = round(duration.as('m')),\n hours = round(duration.as('h')),\n days = round(duration.as('d')),\n months = round(duration.as('M')),\n weeks = round(duration.as('w')),\n years = round(duration.as('y')),\n a = seconds <= thresholds.ss && ['s', seconds] || seconds < thresholds.s && ['ss', seconds] || minutes <= 1 && ['m'] || minutes < thresholds.m && ['mm', minutes] || hours <= 1 && ['h'] || hours < thresholds.h && ['hh', hours] || days <= 1 && ['d'] || days < thresholds.d && ['dd', days];\n if (thresholds.w != null) {\n a = a || weeks <= 1 && ['w'] || weeks < thresholds.w && ['ww', weeks];\n }\n a = a || months <= 1 && ['M'] || months < thresholds.M && ['MM', months] || years <= 1 && ['y'] || ['yy', years];\n a[2] = withoutSuffix;\n a[3] = +posNegDuration > 0;\n a[4] = locale;\n return substituteTimeAgo.apply(null, a);\n }\n\n // This function allows you to set the rounding function for relative time strings\n function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof roundingFunction === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }\n\n // This function allows you to set a threshold for relative time strings\n function getSetRelativeTimeThreshold(threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n }\n function humanize(argWithSuffix, argThresholds) {\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n var withSuffix = false,\n th = thresholds,\n locale,\n output;\n if (typeof argWithSuffix === 'object') {\n argThresholds = argWithSuffix;\n argWithSuffix = false;\n }\n if (typeof argWithSuffix === 'boolean') {\n withSuffix = argWithSuffix;\n }\n if (typeof argThresholds === 'object') {\n th = Object.assign({}, thresholds, argThresholds);\n if (argThresholds.s != null && argThresholds.ss == null) {\n th.ss = argThresholds.s - 1;\n }\n }\n locale = this.localeData();\n output = relativeTime$1(this, !withSuffix, th, locale);\n if (withSuffix) {\n output = locale.pastFuture(+this, output);\n }\n return locale.postformat(output);\n }\n var abs$1 = Math.abs;\n function sign(x) {\n return (x > 0) - (x < 0) || +x;\n }\n function toISOString$1() {\n // for ISO strings we do not use the normal bubbling rules:\n // * milliseconds bubble up until they become hours\n // * days do not bubble at all\n // * months bubble up until they become years\n // This is because there is no context-free conversion between hours and days\n // (think of clock changes)\n // and also not between days and months (28-31 days per month)\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n var seconds = abs$1(this._milliseconds) / 1000,\n days = abs$1(this._days),\n months = abs$1(this._months),\n minutes,\n hours,\n years,\n s,\n total = this.asSeconds(),\n totalSign,\n ymSign,\n daysSign,\n hmsSign;\n if (!total) {\n // this is the same as C#'s (Noda) and python (isodate)...\n // but not other JS (goog.date)\n return 'P0D';\n }\n\n // 3600 seconds -> 60 minutes -> 1 hour\n minutes = absFloor(seconds / 60);\n hours = absFloor(minutes / 60);\n seconds %= 60;\n minutes %= 60;\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js\n s = seconds ? seconds.toFixed(3).replace(/\\.?0+$/, '') : '';\n totalSign = total < 0 ? '-' : '';\n ymSign = sign(this._months) !== sign(total) ? '-' : '';\n daysSign = sign(this._days) !== sign(total) ? '-' : '';\n hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';\n return totalSign + 'P' + (years ? ymSign + years + 'Y' : '') + (months ? ymSign + months + 'M' : '') + (days ? daysSign + days + 'D' : '') + (hours || minutes || seconds ? 'T' : '') + (hours ? hmsSign + hours + 'H' : '') + (minutes ? hmsSign + minutes + 'M' : '') + (seconds ? hmsSign + s + 'S' : '');\n }\n var proto$2 = Duration.prototype;\n proto$2.isValid = isValid$1;\n proto$2.abs = abs;\n proto$2.add = add$1;\n proto$2.subtract = subtract$1;\n proto$2.as = as;\n proto$2.asMilliseconds = asMilliseconds;\n proto$2.asSeconds = asSeconds;\n proto$2.asMinutes = asMinutes;\n proto$2.asHours = asHours;\n proto$2.asDays = asDays;\n proto$2.asWeeks = asWeeks;\n proto$2.asMonths = asMonths;\n proto$2.asQuarters = asQuarters;\n proto$2.asYears = asYears;\n proto$2.valueOf = valueOf$1;\n proto$2._bubble = bubble;\n proto$2.clone = clone$1;\n proto$2.get = get$2;\n proto$2.milliseconds = milliseconds;\n proto$2.seconds = seconds;\n proto$2.minutes = minutes;\n proto$2.hours = hours;\n proto$2.days = days;\n proto$2.weeks = weeks;\n proto$2.months = months;\n proto$2.years = years;\n proto$2.humanize = humanize;\n proto$2.toISOString = toISOString$1;\n proto$2.toString = toISOString$1;\n proto$2.toJSON = toISOString$1;\n proto$2.locale = locale;\n proto$2.localeData = localeData;\n proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);\n proto$2.lang = lang;\n\n // FORMATTING\n\n addFormatToken('X', 0, 0, 'unix');\n addFormatToken('x', 0, 0, 'valueOf');\n\n // PARSING\n\n addRegexToken('x', matchSigned);\n addRegexToken('X', matchTimestamp);\n addParseToken('X', function (input, array, config) {\n config._d = new Date(parseFloat(input) * 1000);\n });\n addParseToken('x', function (input, array, config) {\n config._d = new Date(toInt(input));\n });\n\n //! moment.js\n\n hooks.version = '2.30.1';\n setHookCallback(createLocal);\n hooks.fn = proto;\n hooks.min = min;\n hooks.max = max;\n hooks.now = now;\n hooks.utc = createUTC;\n hooks.unix = createUnix;\n hooks.months = listMonths;\n hooks.isDate = isDate;\n hooks.locale = getSetGlobalLocale;\n hooks.invalid = createInvalid;\n hooks.duration = createDuration;\n hooks.isMoment = isMoment;\n hooks.weekdays = listWeekdays;\n hooks.parseZone = createInZone;\n hooks.localeData = getLocale;\n hooks.isDuration = isDuration;\n hooks.monthsShort = listMonthsShort;\n hooks.weekdaysMin = listWeekdaysMin;\n hooks.defineLocale = defineLocale;\n hooks.updateLocale = updateLocale;\n hooks.locales = listLocales;\n hooks.weekdaysShort = listWeekdaysShort;\n hooks.normalizeUnits = normalizeUnits;\n hooks.relativeTimeRounding = getSetRelativeTimeRounding;\n hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;\n hooks.calendarFormat = getCalendarFormat;\n hooks.prototype = proto;\n\n // currently HTML5 input type only supports 24-hour formats\n hooks.HTML5_FMT = {\n DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm',\n // \n DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss',\n // \n DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS',\n // \n DATE: 'YYYY-MM-DD',\n // \n TIME: 'HH:mm',\n // \n TIME_SECONDS: 'HH:mm:ss',\n // \n TIME_MS: 'HH:mm:ss.SSS',\n // \n WEEK: 'GGGG-[W]WW',\n // \n MONTH: 'YYYY-MM' // \n };\n return hooks;\n});","'use strict';\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\nfunction adler32(adler, buf, len, pos) {\n var s1 = adler & 0xffff | 0,\n s2 = adler >>> 16 & 0xffff | 0,\n n = 0;\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n do {\n s1 = s1 + buf[pos++] | 0;\n s2 = s2 + s1 | 0;\n } while (--n);\n s1 %= 65521;\n s2 %= 65521;\n }\n return s1 | s2 << 16 | 0;\n}\nmodule.exports = adler32;"],"sourceRoot":""}