@fudanda/admin-antd 0.0.0-stage → 2.20261024.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +58 -3
- package/THIRD_PARTY_NOTICES.md +55 -0
- package/dist/assets/libarchive-DxGirPmi.wasm +0 -0
- package/dist/assets/pdfium-BJ2Yip8Q.wasm +0 -0
- package/dist/assets/ppt-font-cjk-DxgKpThH.otf +0 -0
- package/dist/assets/ppt-native-Cz5DBbag.wasm +0 -0
- package/dist/assets/pptx.worker-CtaL8LO_.js +30 -0
- package/dist/assets/worker-C5LZNsKY.mjs +1650 -0
- package/dist/assets/worker-CDeo9jS-.js +40 -0
- package/dist/assets/worker-bundle-Dx5mKZOL.js +6 -0
- package/dist/automation.d.ts +3 -0
- package/dist/automation.js +15 -0
- package/dist/chunks/App-DNjXLysb.js +79 -0
- package/dist/chunks/AppModal-DJzQA6FR.js +1 -0
- package/dist/chunks/ArcBaseAdmin-BZrHGq2f.js +1 -0
- package/dist/chunks/ConfigurableTable-DzmZDd8F.js +55 -0
- package/dist/chunks/DashboardPage-BohGodSl.js +22 -0
- package/dist/chunks/DataScopePanel-B2-x8Jcz.js +1 -0
- package/dist/chunks/DateTimeText-CIt0Qy45.js +1 -0
- package/dist/chunks/DepartmentsPage-DMWY__Y_.js +1 -0
- package/dist/chunks/DictTag-2-adKbYg.js +1 -0
- package/dist/chunks/DictsPage-DILDyHi-.js +15 -0
- package/dist/chunks/EditFormModal-DNHOZHxM.js +1 -0
- package/dist/chunks/EmptyIllustration-DUC3RZmF.js +1 -0
- package/dist/chunks/EntityContextRuntime-DMklAv-k.js +1 -0
- package/dist/chunks/EntityContextRuntime-sslBZqYD.js +1 -0
- package/dist/chunks/EntityRelationButton-DWn1rC2J.js +8 -0
- package/dist/chunks/ExportButton-AzH4D0oW.js +1 -0
- package/dist/chunks/FileNameCell-DPyi64Rv.js +1 -0
- package/dist/chunks/FileStorageConfigsPage-CzuOgeK0.js +15 -0
- package/dist/chunks/FileTypeIcon-DIih3XQG.js +1 -0
- package/dist/chunks/FileViewerPreviewPanel-CMqVtGCr.js +41 -0
- package/dist/chunks/FilesPage-BaEBCOCs.js +43 -0
- package/dist/chunks/IdentitySecurityPage-BO7nY8id.js +1 -0
- package/dist/chunks/JsonPreviewPanel-Dhbza-Uu.js +1 -0
- package/dist/chunks/LogStatsScaffold-CLycj3da.js +1 -0
- package/dist/chunks/LoginLogsPage-DTmHi8u0.js +1 -0
- package/dist/chunks/LoginLogsTable-DVmHnC6V.js +1 -0
- package/dist/chunks/MarkdownPreviewPanel-DoiaAeRv.js +51 -0
- package/dist/chunks/MasterDetailLayout-sjPWw8BI.js +8 -0
- package/dist/chunks/MemberAssignmentSheet-Czbt6_zv.js +1 -0
- package/dist/chunks/MenuCommandPalette-BCOzf-Kq.js +8 -0
- package/dist/chunks/MenusPage-DN8DTGB1.js +1 -0
- package/dist/chunks/ModalFooter-RMlvqrO9.js +1 -0
- package/dist/chunks/MonacoPreviewPanel-Dnz7xpWP.js +1 -0
- package/dist/chunks/NavListPanel-vjIOIqK0.js +1 -0
- package/dist/chunks/OnlineSessionsPage-FoHYZKlR.js +1 -0
- package/dist/chunks/OperationLogsPage-BeRnGcBJ.js +1 -0
- package/dist/chunks/OperationLogsTable-COI-Lp-y.js +1 -0
- package/dist/chunks/PDFPreviewPanel-BIQuBnZZ.js +37 -0
- package/dist/chunks/PasswordInput-DGEJO9yx.js +1 -0
- package/dist/chunks/PositionsPage-DohI0luX.js +1 -0
- package/dist/chunks/PreferencesSheetBody-B9niQABW.js +43 -0
- package/dist/chunks/ProfilePage-CVTRv7xb.js +15 -0
- package/dist/chunks/RelationPanel-B1X6AVaM.js +36 -0
- package/dist/chunks/ResponsiveTableActions-y54aSdhs.js +1 -0
- package/dist/chunks/RolesPage-CtUw93L8.js +1 -0
- package/dist/chunks/ScrollArea-DqjJmHDN.js +11 -0
- package/dist/chunks/SearchToolbar-CvgYKUjr.js +1 -0
- package/dist/chunks/SessionClientTag-DIwnYodW.js +22 -0
- package/dist/chunks/SessionConflictModal-BLNuDsN_.js +1 -0
- package/dist/chunks/SettingRow-DVNmTJWC.js +1 -0
- package/dist/chunks/SettingsPage-BRnCxYQm.js +26 -0
- package/dist/chunks/StatCard-Czjfs0fa.js +4 -0
- package/dist/chunks/UTIF-QUtClmQd.js +1 -0
- package/dist/chunks/UserAvatar-B8CFnTCn.js +1 -0
- package/dist/chunks/UserDisplay-J0Re8z-7.js +1 -0
- package/dist/chunks/UserGroupsPage-CNwbejx-.js +1 -0
- package/dist/chunks/UserLogsPanels-BHeSxWrk.js +36 -0
- package/dist/chunks/UserTransferSelect-CAeyxdor.js +22 -0
- package/dist/chunks/UsersPage-BXt9fOru.js +36 -0
- package/dist/chunks/abnfDiagram-VCTEODGH-Z6OhNjoW.js +1 -0
- package/dist/chunks/activity-DBu4axwF.js +8 -0
- package/dist/chunks/arc-B3K1fDeF.js +1 -0
- package/dist/chunks/architecture-7GRP2DOG-CMtoOwin.js +1 -0
- package/dist/chunks/architectureDiagram-5GKGNRK7-V5A7S5fY.js +36 -0
- package/dist/chunks/archive-B_IKvysI.js +72 -0
- package/dist/chunks/array-BrHhzP_A.js +1 -0
- package/dist/chunks/arrow-left-CsxBMzKY.js +8 -0
- package/dist/chunks/avsc-C0VoJRmm.js +160 -0
- package/dist/chunks/blockDiagram-I7D4REHJ-CFKGJkc_.js +129 -0
- package/dist/chunks/browser-BKLM0ThC-mnGPrtB_.js +1 -0
- package/dist/chunks/browser-index-JqxD-45S.js +1 -0
- package/dist/chunks/builtin_esm-external-require-react-BsBndGeN.js +1 -0
- package/dist/chunks/bundle-DbfUnEV1.js +29 -0
- package/dist/chunks/c4Diagram-7LVT6UL2-BqYYoXPe.js +38 -0
- package/dist/chunks/channel-C9Dr7Z-W.js +1 -0
- package/dist/chunks/chart-data-DImT_Mzn.js +5 -0
- package/dist/chunks/chart-renderer-k-Rd8vdL.js +7 -0
- package/dist/chunks/chevron-down-mn2tSKQd.js +8 -0
- package/dist/chunks/chevron-right-EBApfX6q.js +15 -0
- package/dist/chunks/chevrons-up-down-2M6hY6wt.js +15 -0
- package/dist/chunks/chunk-2E4U76K2-DNbbdpCx.js +1 -0
- package/dist/chunks/chunk-2Q5K7J3B-CmAE3Vs0.js +1 -0
- package/dist/chunks/chunk-2ZTRR5NV-BjsSRgBv.js +2 -0
- package/dist/chunks/chunk-3Z5EZCMW-uYiqz-6y.js +1 -0
- package/dist/chunks/chunk-4HAMMTFA-Aw59LwS3.js +62 -0
- package/dist/chunks/chunk-5V3GS4D5-B_CVcJic.js +1 -0
- package/dist/chunks/chunk-5VM5RSS4-DMlsEAcl.js +15 -0
- package/dist/chunks/chunk-6AZGARVD-CgAiC5mV.js +1 -0
- package/dist/chunks/chunk-6EIED4P4-CXz5D9B0.js +1 -0
- package/dist/chunks/chunk-6K3QC6MW-DtaQ52mY.js +1 -0
- package/dist/chunks/chunk-6TQVIW2G-D0YDxefI.js +1 -0
- package/dist/chunks/chunk-747NJXEK-DGoElbDa.js +2 -0
- package/dist/chunks/chunk-75Z2AOVW-IO9R6faP.js +2 -0
- package/dist/chunks/chunk-CLGD4ZFX-tRS89bnq.js +1 -0
- package/dist/chunks/chunk-DU6HZSFF-Bx48E1rg.js +125 -0
- package/dist/chunks/chunk-F27PBJKO-DtLva7y0.js +1 -0
- package/dist/chunks/chunk-FOHPRMQF-B8MMrnxV.js +255 -0
- package/dist/chunks/chunk-GMAD6QVW-D41KnniX.js +72 -0
- package/dist/chunks/chunk-GVQU2GXP-CVzgM_ui.js +1 -0
- package/dist/chunks/chunk-I5DQTOEV-CoecQT42.js +1 -0
- package/dist/chunks/chunk-ICYGCRZG-lH3opfCY.js +1 -0
- package/dist/chunks/chunk-IH6LHLGP-tD-j3Rsy.js +1 -0
- package/dist/chunks/chunk-IMKFNOWR-CL9pLQhV.js +231 -0
- package/dist/chunks/chunk-JWPE2WC7-Wk0BVLn5.js +1 -0
- package/dist/chunks/chunk-KI3K4JFJ-C-3Y_9er.js +1 -0
- package/dist/chunks/chunk-L3NEJ4N5-CmvrS7Dt.js +1 -0
- package/dist/chunks/chunk-LNGE3PJU-BP1fsJRz.js +34 -0
- package/dist/chunks/chunk-OSK3NFVY-C9uWOXTC.js +10 -0
- package/dist/chunks/chunk-OUJLGHUK-Cm55l9bx.js +2 -0
- package/dist/chunks/chunk-P2QGCYS3-C9bc1yiM.js +1 -0
- package/dist/chunks/chunk-POPQ4Y6H-P1s5xaxM.js +1 -0
- package/dist/chunks/chunk-PWAF6VOD-IORmPx9D.js +1 -0
- package/dist/chunks/chunk-SHT3W25Y-Bip4melZ.js +168 -0
- package/dist/chunks/chunk-SVP7TREG-BKCgUOuy.js +88 -0
- package/dist/chunks/chunk-TICWLB2K-12W2EmSx.js +206 -0
- package/dist/chunks/chunk-TLUHSLCS-DsqF476v.js +1 -0
- package/dist/chunks/chunk-UY3FDG6J-71d_M6t3.js +1 -0
- package/dist/chunks/chunk-XHIXRSVI-C2X1-xC6.js +1 -0
- package/dist/chunks/chunk-XXDRQBXY-Bl6AoSZF.js +1 -0
- package/dist/chunks/chunk-Y2CYZVJY-DjEHBC-3.js +1 -0
- package/dist/chunks/circle-check-RKAno__V.js +8 -0
- package/dist/chunks/circle-x-BB5x-D-8.js +8 -0
- package/dist/chunks/classDiagram-ZZMXUADV-CZrpYcfK.js +1 -0
- package/dist/chunks/classDiagram-v2-VYDZK3BY-CZrpYcfK.js +1 -0
- package/dist/chunks/clipboard-ERcMSMRH.js +1 -0
- package/dist/chunks/clock-CniP1gZS.js +8 -0
- package/dist/chunks/confirm-BtBBEqk8.js +1 -0
- package/dist/chunks/controls-C5dPckUT.js +1 -0
- package/dist/chunks/copy-ofLPH1I0.js +8 -0
- package/dist/chunks/cose-bilkent-JH36ORCC-D9OUqkk5.js +1 -0
- package/dist/chunks/createLucideIcon-BtwfYE6A.js +83 -0
- package/dist/chunks/cynefin-OW5HDTMX-B8_kUynj.js +1 -0
- package/dist/chunks/cynefinDiagram-5FMLGOSQ-DhQChnCg.js +62 -0
- package/dist/chunks/cytoscape.esm-wDUnleWx.js +339 -0
- package/dist/chunks/dagre-GXQ25YYZ-CfbwC_a5.js +4 -0
- package/dist/chunks/dagre-ZVAWSfFw.js +1 -0
- package/dist/chunks/data-B05HzECj.js +28 -0
- package/dist/chunks/date-picker-CPUxgHVv.js +1 -0
- package/dist/chunks/defaultLocale-BvxIcb9Y.js +1 -0
- package/dist/chunks/deleteAction-CCocr5uV.js +1 -0
- package/dist/chunks/diagram-D9cwc7QH.js +5 -0
- package/dist/chunks/diagram-S7CK7UJ4-DVPbdtMm.js +30 -0
- package/dist/chunks/diagram-UQ7AKVKN-D_ZBhGLL.js +41 -0
- package/dist/chunks/diagram-VSXAHHWV-Dqypp-OX.js +3 -0
- package/dist/chunks/diagram-VX7I27RA-CbWJVJ_L.js +24 -0
- package/dist/chunks/diagram-Z3DM3KII-CUyP4-RY.js +24 -0
- package/dist/chunks/direct-engine-thps0u7R.js +5 -0
- package/dist/chunks/dist-Bauqz5on.js +1 -0
- package/dist/chunks/dist-CWj_XYki.js +1 -0
- package/dist/chunks/dist-D_KGQS7-.js +11 -0
- package/dist/chunks/dist-DdW4yNBK.js +1 -0
- package/dist/chunks/docx-preview-CPN81HCr.js +11 -0
- package/dist/chunks/download--5IybXxz.js +8 -0
- package/dist/chunks/drawing-D2Qrun-P.js +48 -0
- package/dist/chunks/ebnfDiagram-PWID7BFC-C5NMigjm.js +1 -0
- package/dist/chunks/ellipsis-Dux1Nxa5.js +8 -0
- package/dist/chunks/email-ByshRsFv.js +61 -0
- package/dist/chunks/emailHtml-BAKcRhSm.js +1 -0
- package/dist/chunks/erDiagram-RLTQ6QDP-B5rUHJPJ.js +99 -0
- package/dist/chunks/eventmodeling-NTZA5JFV-C74no5BH.js +1 -0
- package/dist/chunks/export-BkwewH6Q.js +1 -0
- package/dist/chunks/export-DlTz5dc2.js +341 -0
- package/dist/chunks/eye-off-BtJoIT5n.js +8 -0
- package/dist/chunks/feedback-BnjMKZpz.js +1 -0
- package/dist/chunks/file-utils-DyvnVEoH.js +1 -0
- package/dist/chunks/fit-CsnhEncA.js +1 -0
- package/dist/chunks/flowDiagram-HODETNUW-BuMvaSeo.js +1 -0
- package/dist/chunks/form-CQutQFiD.js +1 -0
- package/dist/chunks/funnel-BwQjQI4Y.js +8 -0
- package/dist/chunks/ganttDiagram-EL5Y4UJY-DIAlbvVg.js +292 -0
- package/dist/chunks/geo-DR0fL7r2.js +38 -0
- package/dist/chunks/gitGraph-4MIJSDKK-Ce5mOfp1.js +1 -0
- package/dist/chunks/gitGraphDiagram-WWUBYQGX-DN3G9xiQ.js +106 -0
- package/dist/chunks/graphlib-CYBMTUbW.js +1 -0
- package/dist/chunks/icons-CbRx5Om7.js +1 -0
- package/dist/chunks/illustrations-DT1eq6jI.js +1 -0
- package/dist/chunks/image-ez9hvzKT.js +17 -0
- package/dist/chunks/index.es-OAWlVkoK.js +16 -0
- package/dist/chunks/info-A6RAGUB7-BP6lMBIR.js +1 -0
- package/dist/chunks/info-BQa8C31Y.js +8 -0
- package/dist/chunks/infoDiagram-27XIBGKW-BhQtr_Ti.js +2 -0
- package/dist/chunks/init-Ca_Ibf4y.js +1 -0
- package/dist/chunks/ishikawaDiagram-5VMMS53U-CLR6CAi4.js +70 -0
- package/dist/chunks/journeyDiagram-3NMN7TZE-_-Q7sjsP.js +139 -0
- package/dist/chunks/json-viewer-DHYRjY8I.js +1 -0
- package/dist/chunks/jszip.min-hNOoGCeG.js +14 -0
- package/dist/chunks/kanban-definition-UXKFOSKX-D97mHeUZ.js +89 -0
- package/dist/chunks/katex-D5qu7EYh.js +257 -0
- package/dist/chunks/layout-grid-Bp9bwiQZ.js +8 -0
- package/dist/chunks/lib-BlRm3nk1.js +15 -0
- package/dist/chunks/lib-C1nFUu19.js +4 -0
- package/dist/chunks/lib-CqYXBtHb.js +1 -0
- package/dist/chunks/libarchive-DRzzJvQl.js +7 -0
- package/dist/chunks/line-BV7qVRkM.js +1 -0
- package/dist/chunks/line-qVHaOdPp.js +1 -0
- package/dist/chunks/linear-DXABSWHW.js +1 -0
- package/dist/chunks/list-0CbyOlT9.js +1 -0
- package/dist/chunks/list-DCcWnjUg.js +8 -0
- package/dist/chunks/listTableProps-DDynsnLF.js +1 -0
- package/dist/chunks/log-in-OzbNes8i.js +8 -0
- package/dist/chunks/lucide-react-VfAPsQQ5.js +8 -0
- package/dist/chunks/maplibre-gl-Bxi83GUP.js +819 -0
- package/dist/chunks/maplibre-shared-Oo0L8Lll.js +6 -0
- package/dist/chunks/maximize-CnmQ11E7.js +8 -0
- package/dist/chunks/media-DoGe_p4O.js +1 -0
- package/dist/chunks/menu-mQgsexFx.js +15 -0
- package/dist/chunks/mermaid-parser.core-DvCAQkzY.js +3 -0
- package/dist/chunks/mermaid.core-CxOC6yPr.js +15 -0
- package/dist/chunks/messages-CFyOVxEM.js +1 -0
- package/dist/chunks/mindmap-definition-YA3MSWOX-A2UgnMwx.js +96 -0
- package/dist/chunks/minimize-Bpau_zCe.js +8 -0
- package/dist/chunks/msg-BzZbudMm.js +7 -0
- package/dist/chunks/ofd-C7DKqJ6Z.js +33 -0
- package/dist/chunks/ofd-DrJyXIpS.js +14 -0
- package/dist/chunks/openDocument-DGzqlyJg.js +12 -0
- package/dist/chunks/options-B65xkxOY.js +1 -0
- package/dist/chunks/ordinal-NuFkISw7.js +1 -0
- package/dist/chunks/packet-AYTQ26CC-DS6h3a5l.js +1 -0
- package/dist/chunks/panzoom.es-DnuzxUQi.js +1 -0
- package/dist/chunks/parse-6ZQGx714.js +1 -0
- package/dist/chunks/parser-DC3PvpL4.js +72 -0
- package/dist/chunks/path-VUNELGFR.js +1 -0
- package/dist/chunks/pegDiagram-XKGWAZYB-DxQqpKfh.js +1 -0
- package/dist/chunks/pie-WAS4IAKB-BsaegmNA.js +1 -0
- package/dist/chunks/pieDiagram-E7YTZNPT-BUsnkTkJ.js +39 -0
- package/dist/chunks/postal-mime-DMcA5b7k.js +28 -0
- package/dist/chunks/ppt-B0WY5Gks.js +30 -0
- package/dist/chunks/ppt-BIiNnCyj.js +1 -0
- package/dist/chunks/pptx-DX5KDFZ7.js +109 -0
- package/dist/chunks/preload-helper-C-73SErw.js +1 -0
- package/dist/chunks/print-mask-Dguzv0rv.js +17 -0
- package/dist/chunks/printLayout-oeudvFkr.js +34 -0
- package/dist/chunks/printMask-LefOTJqk.js +8 -0
- package/dist/chunks/psd-hjeNFQZ-.js +36 -0
- package/dist/chunks/purify.es-BsWMI_aG.js +5 -0
- package/dist/chunks/quadrantDiagram-AXDQQJYC-BmQNSzhY.js +7 -0
- package/dist/chunks/radar-RG4KPBEZ-BoHdw2h7.js +1 -0
- package/dist/chunks/railroad-74A4TZTK-BifJffb4.js +1 -0
- package/dist/chunks/railroad-abnf-HS5TGJTU-CMEPumRO.js +1 -0
- package/dist/chunks/railroad-ebnf-LZEXJU2U-B06BgAeN.js +1 -0
- package/dist/chunks/railroad-peg-WCYAUIDC-CMjriUEs.js +1 -0
- package/dist/chunks/railroadDiagram-O6MQD6OU-B2t5KY26.js +1 -0
- package/dist/chunks/react-runtime-x2lFbSKq.js +11 -0
- package/dist/chunks/refresh-cw-Dz8O9-Hp.js +8 -0
- package/dist/chunks/rendered-slot-YhfmcMJr.js +1 -0
- package/dist/chunks/requirementDiagram-BXWQKSXE-CBBfNOAp.js +84 -0
- package/dist/chunks/rolldown-runtime-BKuNeK48.js +1 -0
- package/dist/chunks/rotate-ccw-D2__Zisi.js +8 -0
- package/dist/chunks/rotate-cw-BSTVLlWY.js +8 -0
- package/dist/chunks/rough.esm-CVrpq1dW.js +1 -0
- package/dist/chunks/sankeyDiagram-P5KCCOFB-Cp8SrFyb.js +40 -0
- package/dist/chunks/save-w-NwiMMY.js +8 -0
- package/dist/chunks/search-DYZU68h1.js +8 -0
- package/dist/chunks/search-filters-CRIhZ0gL.js +1 -0
- package/dist/chunks/sequenceDiagram-WJ2MYXX4-PDtVfEoj.js +162 -0
- package/dist/chunks/shield-alert-De_Hx56I.js +8 -0
- package/dist/chunks/sizeCapture-INFHLROL-DA-kAaXB.js +1 -0
- package/dist/chunks/skeleton-CrjMjJNr.js +1 -0
- package/dist/chunks/spreadsheet-BzbBEhmY.js +1 -0
- package/dist/chunks/spreadsheet-LR3SOG-x.js +58 -0
- package/dist/chunks/sql-wasm-browser-CFddXd9f.js +2 -0
- package/dist/chunks/src-C1iDJpBK.js +1 -0
- package/dist/chunks/src-vLpLkuQx.js +1 -0
- package/dist/chunks/stateDiagram-D77RDMKH-C1Sx8KUD.js +1 -0
- package/dist/chunks/stateDiagram-v2-MP3YSRHH-7wYLSzBX.js +1 -0
- package/dist/chunks/swimlanes-42K2YHIH-BmybX9eL.js +1 -0
- package/dist/chunks/swimlanesDiagram-VR7AAH4N-DxhXklfm.js +8 -0
- package/dist/chunks/tabs-BobA_IcO.js +1 -0
- package/dist/chunks/theme-controller-D-ATwFal.js +1 -0
- package/dist/chunks/timeline-definition-24CTP7MA-QS9QNm2i.js +120 -0
- package/dist/chunks/tinycolor-CG1wnM-U.js +1 -0
- package/dist/chunks/togeojson.es-BE8iM7U6.js +1 -0
- package/dist/chunks/toolbar-controls-CThS0xuP.js +15 -0
- package/dist/chunks/trash-tHBT8Mpw.js +8 -0
- package/dist/chunks/treeView-Q6P3EWNA-CN0l7whJ.js +1 -0
- package/dist/chunks/treemap-WGGIJYW6-C4P1fQxS.js +1 -0
- package/dist/chunks/typography-DKK_iHcj.js +1 -0
- package/dist/chunks/ui-BFsHoY7a.js +1 -0
- package/dist/chunks/ui-utils-ClxYogUQ.js +1 -0
- package/dist/chunks/upload-M-n6woFv.js +8 -0
- package/dist/chunks/useCrudOperationColumn-D935tixd.js +1 -0
- package/dist/chunks/useListPage-CbcOQG4m.js +1 -0
- package/dist/chunks/useModalViewport-HF7te75S.js +1 -0
- package/dist/chunks/useRowSelection-4GOMFmjG.js +1 -0
- package/dist/chunks/useStatusToggle-B2qZaoc-.js +1 -0
- package/dist/chunks/user-round-kYfBkPNu.js +15 -0
- package/dist/chunks/users-BXZLb4TY.js +8 -0
- package/dist/chunks/vennDiagram-4TSXK5OY-CVd73ycc.js +34 -0
- package/dist/chunks/view-B8ZvC8z3.js +1 -0
- package/dist/chunks/viewer-Ct88ypIL.js +24 -0
- package/dist/chunks/wardley-WFR3VGLG-cG9pRFwD.js +1 -0
- package/dist/chunks/wardleyDiagram-VM6X3IG4-B42d0Gqz.js +78 -0
- package/dist/chunks/wordDoc-BZY3ZnxN.js +152 -0
- package/dist/chunks/wordDocx-Bt2mlB3C.js +77 -0
- package/dist/chunks/wordMl-Y_ghyTZ8.js +1 -0
- package/dist/chunks/worker-engine-B4e92GsN.js +17369 -0
- package/dist/chunks/x-Ak9hw1R9.js +8 -0
- package/dist/chunks/xmind-CF9YwkOD.js +58 -0
- package/dist/chunks/xychartDiagram-S5SC5T6Z-B_Owv9Ho.js +7 -0
- package/dist/file-viewer/flyfish-viewer-assets.json +46 -0
- package/dist/file-viewer/vendor/docx/docx.worker.js +5 -0
- package/dist/file-viewer/vendor/docx/jszip.min.js +13 -0
- package/dist/file-viewer/vendor/xlsx/sheet.worker.js +107 -0
- package/dist/file-viewer/wasm/data/sql-wasm.wasm +0 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +1 -0
- package/dist/public/avatars/avatar-01.svg +1 -0
- package/dist/public/avatars/avatar-02.svg +1 -0
- package/dist/public/avatars/avatar-03.svg +1 -0
- package/dist/public/avatars/avatar-04.svg +1 -0
- package/dist/public/avatars/avatar-05.svg +1 -0
- package/dist/public/avatars/avatar-06.svg +1 -0
- package/dist/public/avatars/avatar-07.svg +1 -0
- package/dist/public/avatars/avatar-08.svg +1 -0
- package/dist/public/avatars/avatar-09.svg +1 -0
- package/dist/public/avatars/avatar-10.svg +1 -0
- package/dist/public/avatars/avatar-11.svg +1 -0
- package/dist/public/avatars/avatar-12.svg +1 -0
- package/dist/public/monaco/vs/abap-D-t0cyap.js +1 -0
- package/dist/public/monaco/vs/apex-CcIm7xu6.js +1 -0
- package/dist/public/monaco/vs/assets/css.worker-URu8fCFR.js +97 -0
- package/dist/public/monaco/vs/assets/editor.worker-lj3bdIIn.js +30 -0
- package/dist/public/monaco/vs/assets/editorWebWorkerMain-CA_vMoUU.js +30 -0
- package/dist/public/monaco/vs/assets/html.worker-D1SL3iM8.js +474 -0
- package/dist/public/monaco/vs/assets/json.worker-CoJx_OPf.js +62 -0
- package/dist/public/monaco/vs/assets/ts.worker-BWKtMYOk.js +67722 -0
- package/dist/public/monaco/vs/azcli-BA0tQDCg.js +1 -0
- package/dist/public/monaco/vs/basic-languages/monaco.contribution.js +1 -0
- package/dist/public/monaco/vs/bat-C397hTD6.js +1 -0
- package/dist/public/monaco/vs/bicep-DF5aW17k.js +2 -0
- package/dist/public/monaco/vs/cameligo-plsz8qhj.js +1 -0
- package/dist/public/monaco/vs/clojure-Y2auQMzK.js +1 -0
- package/dist/public/monaco/vs/coffee-Bu45yuWE.js +1 -0
- package/dist/public/monaco/vs/cpp-CkKPQIni.js +1 -0
- package/dist/public/monaco/vs/csharp-CX28MZyh.js +1 -0
- package/dist/public/monaco/vs/csp-D8uWnyxW.js +1 -0
- package/dist/public/monaco/vs/css-CaeNmE3S.js +3 -0
- package/dist/public/monaco/vs/css.worker-CyhWkhHo.js +1 -0
- package/dist/public/monaco/vs/cssMode-CV6Ay48H.js +1 -0
- package/dist/public/monaco/vs/cypher-DVThT8BS.js +1 -0
- package/dist/public/monaco/vs/dart-CmGfCvrO.js +1 -0
- package/dist/public/monaco/vs/dockerfile-CZqqYdch.js +1 -0
- package/dist/public/monaco/vs/ecl-30fUercY.js +1 -0
- package/dist/public/monaco/vs/editor/editor.main.css +1 -0
- package/dist/public/monaco/vs/editor/editor.main.js +1 -0
- package/dist/public/monaco/vs/editor-KLE6jdfb.js +831 -0
- package/dist/public/monaco/vs/editor.js +1 -0
- package/dist/public/monaco/vs/editorWorkerHost-fVE1cjcC.js +35 -0
- package/dist/public/monaco/vs/elixir-xjPaIfzF.js +1 -0
- package/dist/public/monaco/vs/flow9-DqtmStfK.js +1 -0
- package/dist/public/monaco/vs/freemarker2-FWreY7v7.js +3 -0
- package/dist/public/monaco/vs/fsharp-BOMdg4U1.js +1 -0
- package/dist/public/monaco/vs/go-D_hbi-Jt.js +1 -0
- package/dist/public/monaco/vs/graphql-CKUU4kLG.js +1 -0
- package/dist/public/monaco/vs/handlebars-CZi4pHCH.js +1 -0
- package/dist/public/monaco/vs/hcl-DTaboeZW.js +1 -0
- package/dist/public/monaco/vs/html-j_7ZTNRU.js +1 -0
- package/dist/public/monaco/vs/html.worker-CA3iAimZ.js +1 -0
- package/dist/public/monaco/vs/htmlMode-27by_KM4.js +1 -0
- package/dist/public/monaco/vs/index-049xrXrp.js +1 -0
- package/dist/public/monaco/vs/index-CBVt3dzv.js +5 -0
- package/dist/public/monaco/vs/index.js +1 -0
- package/dist/public/monaco/vs/ini-CsNwO04R.js +1 -0
- package/dist/public/monaco/vs/initialize-DL0l1TGY.js +1 -0
- package/dist/public/monaco/vs/java-CI4ZMsH9.js +1 -0
- package/dist/public/monaco/vs/javascript-DTJl4Jn1.js +1 -0
- package/dist/public/monaco/vs/json.worker-BizpAl9O.js +1 -0
- package/dist/public/monaco/vs/jsonMode-DLUiMUrI.js +1 -0
- package/dist/public/monaco/vs/julia-BwzEvaQw.js +1 -0
- package/dist/public/monaco/vs/kotlin-IUYPiTV8.js +1 -0
- package/dist/public/monaco/vs/language/css/monaco.contribution.js +1 -0
- package/dist/public/monaco/vs/language/html/monaco.contribution.js +1 -0
- package/dist/public/monaco/vs/language/json/monaco.contribution.js +1 -0
- package/dist/public/monaco/vs/language/typescript/monaco.contribution.js +1 -0
- package/dist/public/monaco/vs/less-C0eDYdqa.js +2 -0
- package/dist/public/monaco/vs/lexon-iON-Kj97.js +1 -0
- package/dist/public/monaco/vs/liquid-CLJYelW6.js +1 -0
- package/dist/public/monaco/vs/loader.js +1368 -0
- package/dist/public/monaco/vs/lspLanguageFeatures-BIkJOWLw.js +2 -0
- package/dist/public/monaco/vs/lua-DtygF91M.js +1 -0
- package/dist/public/monaco/vs/m3-CsR4AuFi.js +1 -0
- package/dist/public/monaco/vs/main-BEx-Fmlo.js +15 -0
- package/dist/public/monaco/vs/main-DsK8pnKg.js +3 -0
- package/dist/public/monaco/vs/markdown-C_rD0bIw.js +1 -0
- package/dist/public/monaco/vs/mdx-CpzZIPHF.js +1 -0
- package/dist/public/monaco/vs/mips-CiYP61RB.js +1 -0
- package/dist/public/monaco/vs/monaco.contribution-9cKT3C7t.js +1 -0
- package/dist/public/monaco/vs/monaco.contribution-BE88ZNGY.js +1 -0
- package/dist/public/monaco/vs/monaco.contribution-BPhsneLd.js +1 -0
- package/dist/public/monaco/vs/monaco.contribution-BgRy6xDf.js +1 -0
- package/dist/public/monaco/vs/msdax-C38-sJlp.js +1 -0
- package/dist/public/monaco/vs/mysql-CdtbpvbG.js +1 -0
- package/dist/public/monaco/vs/nls/lang/cs.d.ts +1 -0
- package/dist/public/monaco/vs/nls/lang/cs.js +9 -0
- package/dist/public/monaco/vs/nls/lang/de.d.ts +1 -0
- package/dist/public/monaco/vs/nls/lang/de.js +9 -0
- package/dist/public/monaco/vs/nls/lang/es.d.ts +1 -0
- package/dist/public/monaco/vs/nls/lang/es.js +9 -0
- package/dist/public/monaco/vs/nls/lang/fr.d.ts +1 -0
- package/dist/public/monaco/vs/nls/lang/fr.js +9 -0
- package/dist/public/monaco/vs/nls/lang/it.d.ts +1 -0
- package/dist/public/monaco/vs/nls/lang/it.js +9 -0
- package/dist/public/monaco/vs/nls/lang/ja.d.ts +1 -0
- package/dist/public/monaco/vs/nls/lang/ja.js +9 -0
- package/dist/public/monaco/vs/nls/lang/ko.d.ts +1 -0
- package/dist/public/monaco/vs/nls/lang/ko.js +9 -0
- package/dist/public/monaco/vs/nls/lang/pl.d.ts +1 -0
- package/dist/public/monaco/vs/nls/lang/pl.js +9 -0
- package/dist/public/monaco/vs/nls/lang/pt-br.d.ts +1 -0
- package/dist/public/monaco/vs/nls/lang/pt-br.js +9 -0
- package/dist/public/monaco/vs/nls/lang/ru.d.ts +1 -0
- package/dist/public/monaco/vs/nls/lang/ru.js +9 -0
- package/dist/public/monaco/vs/nls/lang/tr.d.ts +1 -0
- package/dist/public/monaco/vs/nls/lang/tr.js +9 -0
- package/dist/public/monaco/vs/nls/lang/zh-cn.d.ts +1 -0
- package/dist/public/monaco/vs/nls/lang/zh-cn.js +9 -0
- package/dist/public/monaco/vs/nls/lang/zh-tw.d.ts +1 -0
- package/dist/public/monaco/vs/nls/lang/zh-tw.js +9 -0
- package/dist/public/monaco/vs/nls.messages-loader.js +1 -0
- package/dist/public/monaco/vs/objective-c-CntZFaHX.js +1 -0
- package/dist/public/monaco/vs/pascal-r6kuqfl_.js +1 -0
- package/dist/public/monaco/vs/pascaligo-BiXoTmXh.js +1 -0
- package/dist/public/monaco/vs/perl-DABw_TcH.js +1 -0
- package/dist/public/monaco/vs/pgsql-me_jFXeX.js +1 -0
- package/dist/public/monaco/vs/php-D_kh-9LK.js +1 -0
- package/dist/public/monaco/vs/pla-VfZjczW0.js +1 -0
- package/dist/public/monaco/vs/postiats-BBSzz8Pk.js +1 -0
- package/dist/public/monaco/vs/powerquery-Dt-g_2cc.js +1 -0
- package/dist/public/monaco/vs/powershell-B-7ap1zc.js +1 -0
- package/dist/public/monaco/vs/protobuf-BmtuEB1A.js +2 -0
- package/dist/public/monaco/vs/pug-BRpRNeEb.js +1 -0
- package/dist/public/monaco/vs/python-CqWUUgfu.js +1 -0
- package/dist/public/monaco/vs/qsharp-BzsFaUU9.js +1 -0
- package/dist/public/monaco/vs/r-f8dDdrp4.js +1 -0
- package/dist/public/monaco/vs/razor-hok5y9Km.js +1 -0
- package/dist/public/monaco/vs/redis-fvZQY4PI.js +1 -0
- package/dist/public/monaco/vs/redshift-45Et0LQi.js +1 -0
- package/dist/public/monaco/vs/restructuredtext-C7UUFKFD.js +1 -0
- package/dist/public/monaco/vs/ruby-CZO8zYTz.js +1 -0
- package/dist/public/monaco/vs/rust-Bfetafyc.js +1 -0
- package/dist/public/monaco/vs/sb-3GYllVck.js +1 -0
- package/dist/public/monaco/vs/scala-foMgrKo1.js +1 -0
- package/dist/public/monaco/vs/scheme-CHdMtr7p.js +1 -0
- package/dist/public/monaco/vs/scss-C1cmLt9V.js +3 -0
- package/dist/public/monaco/vs/shell-ClXCKCEW.js +1 -0
- package/dist/public/monaco/vs/solidity-MZ6ExpPy.js +1 -0
- package/dist/public/monaco/vs/sophia-DWkuSsPQ.js +1 -0
- package/dist/public/monaco/vs/sparql-AUGFYSyk.js +1 -0
- package/dist/public/monaco/vs/sql-32GpJSV2.js +1 -0
- package/dist/public/monaco/vs/st-CuDFIVZ_.js +1 -0
- package/dist/public/monaco/vs/swift-t-PfMj7W.js +1 -0
- package/dist/public/monaco/vs/systemverilog-Ch4vA8Yt.js +1 -0
- package/dist/public/monaco/vs/tcl-D74tq1nH.js +1 -0
- package/dist/public/monaco/vs/toggleHighContrast-qGX7E9o7.js +61 -0
- package/dist/public/monaco/vs/ts.worker-2QLmBukE.js +1 -0
- package/dist/public/monaco/vs/tsMode-B0S_kp2q.js +11 -0
- package/dist/public/monaco/vs/twig-C6taOxMV.js +1 -0
- package/dist/public/monaco/vs/typescript-_2t_511t.js +1 -0
- package/dist/public/monaco/vs/typespec-8OfoLt6R.js +1 -0
- package/dist/public/monaco/vs/vb-Dyb2648j.js +1 -0
- package/dist/public/monaco/vs/wgsl-BhLXMOR0.js +298 -0
- package/dist/public/monaco/vs/workers-BBttULjf.js +1 -0
- package/dist/public/monaco/vs/xml-cZjNDqDT.js +1 -0
- package/dist/public/monaco/vs/yaml-A1fOIdH6.js +1 -0
- package/dist/src-LbWcrSWe.js +3 -0
- package/dist/styles.css +2 -0
- package/dist/styles.d.ts +1 -0
- package/dist/types.d.ts +1 -0
- package/package.json +113 -4
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import{i as e,t}from"./rolldown-runtime-BKuNeK48.js";var n=/* @__PURE__ */ t(((t,n)=>{(function(e){if(typeof t==`object`&&n!==void 0)n.exports=e();else if(typeof define==`function`&&define.amd)define([],e);else{var r=typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this;r.agPsd=e()}})(function(){return(function(){function t(n,r,i){function a(s,c){if(!r[s]){if(!n[s]){var l=typeof e==`function`&&e;if(!c&&l)return l(s,!0);if(o)return o(s,!0);var u=/* @__PURE__ */ Error(`Cannot find module '`+s+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=r[s]={exports:{}};n[s][0].call(d.exports,function(e){var t=n[s][1][e];return a(t||e)},d,d.exports,t,n,r,i)}return r[s].exports}for(var o=typeof e==`function`&&e,s=0;s<i.length;s++)a(i[s]);return a}return t})()({1:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.readAbr=void 0;let r=e("./descriptor"),i=e("./psdReader"),a=[`off`,`fade`,`pen pressure`,`pen tilt`,`stylus wheel`,`initial direction`,`direction`,`initial rotation`,`rotation`],o=[`round point`,`round blunt`,`round curve`,`round angle`,`round fan`,`flat point`,`flat blunt`,`flat curve`,`flat angle`,`flat fan`],s=[`erodible point`,`erodible flat`,`erodible round`,`erodible square`,`erodible triangle`,`custom`],c={_:`brush`,MixB:`mixer brush`,SmTl:`smudge brush`};function l(e){return{control:a[e.bVTy],steps:e.fStp,jitter:(0,r.parsePercent)(e.jitter),minimum:(0,r.parsePercent)(e[`Mnm `])}}function u(t){switch(t._classID){case`computedBrush`:return{type:`computed`,size:(0,r.parseUnitsToNumber)(t.Dmtr,`Pixels`),angle:(0,r.parseAngle)(t.Angl),roundness:(0,r.parsePercent)(t.Rndn),spacingOn:t.Intr,spacing:(0,r.parsePercent)(t.Spcn),flipX:t.flipX,flipY:t.flipY,hardness:(0,r.parsePercent)(t.Hrdn)};case`sampledBrush`:return{type:`sampled`,size:(0,r.parseUnitsToNumber)(t.Dmtr,`Pixels`),angle:(0,r.parseAngle)(t.Angl),roundness:(0,r.parsePercent)(t.Rndn),spacingOn:t.Intr,spacing:(0,r.parsePercent)(t.Spcn),flipX:t.flipX,flipY:t.flipY,name:t[`Nm `],sampledData:t.sampledData};case`dBrush`:return{type:`dynamic`,shape:o[t[`Shp `]],angle:(0,r.parseAngle)(t.Angl),size:(0,r.parseUnitsToNumber)(t.Dmtr,`Pixels`),density:(0,r.parsePercent)(t.Dnst),length:(0,r.parsePercent)(t.Lngt),clumping:(0,r.parsePercent)(t.clumping),thickness:(0,r.parsePercent)(t.thickness),stiffness:(0,r.parsePercent)(t.stiffness),physics:t.physics,spacing:(0,r.parsePercent)(t.Spcn),spacingOn:t.Intr,flipX:t.flipX,flipY:t.flipY};case`dTips`:return Object.assign(Object.assign({type:`tips`,angle:(0,r.parseAngle)(t.Angl),size:(0,r.parseUnitsToNumber)(t.Dmtr,`Pixels`),shape:o[t[`Shp `]],physics:t.physics,spacing:(0,r.parsePercent)(t.Spcn),spacingOn:t.Intr,flipX:t.flipX,flipY:t.flipY,tipsType:s[t.dtipsType],tipsLengthRatio:(0,r.parsePercent)(t.dtipsLengthRatio),tipsHardness:(0,r.parsePercent)(t.dtipsHardness)},t.dtipsGridSize&&t.dtipsErodibleTipHeightMap?{tipsGridSize:t.dtipsGridSize,tipsErodibleTipHeightMap:d(t.dtipsErodibleTipHeightMap)}:{}),{tipsAirbrushCutoffAngle:t.dtipsAirbrushCutoffAngle,tipsAirbrushGranularity:(0,r.parsePercent)(t.dtipsAirbrushGranularity),tipsAirbrushStreakiness:(0,r.parsePercent)(t.dtipsAirbrushStreakiness),tipsAirbrushSplatSize:(0,r.parsePercent)(t.dtipsAirbrushSplatSize),tipsAirbrushSplatCount:t.dtipsAirbrushSplatCount});default:throw console.log(e("util").inspect(t,!1,99,!0)),Error(`Unknown brush classId: ${t._classID}`)}}function d(e){let t=[];for(let n=0;n<e.byteLength;n++)t.push(e[n]);return t}function f(e,t={}){let n=(0,i.createReader)(e.buffer,e.byteOffset,e.byteLength),a=(0,i.readInt16)(n),o=[],s=[],d=[];if(a===1||a===2)throw Error(`Unsupported ABR version (${a})`);if(a===6||a===7||a===9||a===10){let e=(0,i.readInt16)(n);if(e!==1&&e!==2)throw Error(`Unsupported ABR minor version`);for(;n.offset<n.view.byteLength;){(0,i.checkSignature)(n,`8BIM`);let a=(0,i.readSignature)(n),f=(0,i.readUint32)(n),p=n.offset+f;switch(a){case`samp`:for(;n.offset<p;){let t=(0,i.readUint32)(n);for(;t&3;)t++;let r=n.offset+t,a=(0,i.readPascalString)(n,1);(0,i.skipBytes)(n,e===1?10:264);let s=(0,i.readInt32)(n),c=(0,i.readInt32)(n),l=(0,i.readInt32)(n)-s,u=(0,i.readInt32)(n)-c;if(u<=0||l<=0)throw Error(`Invalid bounds`);let d=(0,i.readInt16)(n),f=(0,i.readUint8)(n),p=new Uint8Array(u*l);if(d===8){if(f===0)p.set((0,i.readBytes)(n,p.byteLength));else if(f===1)(0,i.readDataRLE)(n,{width:u,height:l,data:p},u,l,d,1,[0],!1);else throw Error(`Invalid compression`)}else if(d===16){if(f===0)for(let e=0;e<p.byteLength;e++)p[e]=(0,i.readUint16)(n)>>8;else if(f===1)throw Error(`not implemented (16bit RLE)`);else throw Error(`Invalid compression`)}else throw Error(`Invalid depth`);o.push({id:a,bounds:{x:c,y:s,w:u,h:l},alpha:p}),n.offset=r}break;case`desc`:{let e=(0,r.readVersionAndDescriptor)(n,!0);for(let t of e.Brsh){let e={name:t[`Nm `],shape:u(t.Brsh),spacing:(0,r.parsePercent)(t.Spcn),wetEdges:t.Wtdg,noise:t.Nose,useBrushSize:t.useBrushSize};t.interpretation!=null&&(e.interpretation=t.interpretation),t.protectTexture!=null&&(e.protectTexture=t.protectTexture),t.useTipDynamics&&(e.shapeDynamics={tiltScale:(0,r.parsePercent)(t.tiltScale),sizeDynamics:l(t.szVr),angleDynamics:l(t.angleDynamics),roundnessDynamics:l(t.roundnessDynamics),flipX:t.flipX,flipY:t.flipY,brushProjection:t.brushProjection,minimumDiameter:(0,r.parsePercent)(t.minimumDiameter),minimumRoundness:(0,r.parsePercent)(t.minimumRoundness)}),t.useScatter&&(e.scatter={count:t[`Cnt `],bothAxes:t.bothAxes,countDynamics:l(t.countDynamics),scatterDynamics:l(t.scatterDynamics)}),t.useTexture&&t.Txtr&&(e.texture={id:t.Txtr.Idnt,name:t.Txtr[`Nm `],blendMode:r.BlnM.decode(t.textureBlendMode),depth:(0,r.parsePercent)(t.textureDepth),depthMinimum:(0,r.parsePercent)(t.minimumDepth),depthDynamics:l(t.textureDepthDynamics),scale:(0,r.parsePercent)(t.textureScale),invert:t.InvT,brightness:t.textureBrightness,contrast:t.textureContrast,textureEachTip:!!t.TxtC});let n=t.dualBrush;n&&n.useDualBrush&&(e.dualBrush={flip:n.Flip,shape:u(n.Brsh),blendMode:r.BlnM.decode(n.BlnM),useScatter:n.useScatter,spacing:(0,r.parsePercent)(n.Spcn),count:n[`Cnt `],bothAxes:n.bothAxes,countDynamics:l(n.countDynamics),scatterDynamics:l(n.scatterDynamics)}),t.useColorDynamics&&(e.colorDynamics={foregroundBackground:l(t.clVr),hue:(0,r.parsePercent)(t[`H `]),saturation:(0,r.parsePercent)(t.Strt),brightness:(0,r.parsePercent)(t.Brgh),purity:(0,r.parsePercent)(t.purity),perTip:t.colorDynamicsPerTip}),t.usePaintDynamics&&(e.transfer={flowDynamics:l(t.prVr),opacityDynamics:l(t.opVr),wetnessDynamics:l(t.wtVr),mixDynamics:l(t.mxVr)}),t.useBrushPose&&(e.brushPose={overrideAngle:t.overridePoseAngle,overrideTiltX:t.overridePoseTiltX,overrideTiltY:t.overridePoseTiltY,overridePressure:t.overridePosePressure,pressure:(0,r.parsePercent)(t.brushPosePressure),tiltX:t.brushPoseTiltX,tiltY:t.brushPoseTiltY,angle:t.brushPoseAngle});let i=t.toolOptions;i&&(e.toolOptions={type:c[i._classID]||`brush`,brushPreset:i.brushPreset,flow:i.flow??100,smooth:i.Smoo??0,mode:r.BlnM.decode(i[`Md `]||`BlnM.Nrml`),opacity:i.Opct??100,smoothing:!!i.smoothing,smoothingValue:i.smoothingValue||0,smoothingRadiusMode:!!i.smoothingRadiusMode,smoothingCatchup:!!i.smoothingCatchup,smoothingCatchupAtEnd:!!i.smoothingCatchupAtEnd,smoothingZoomCompensation:!!i.smoothingZoomCompensation,pressureSmoothing:!!i.pressureSmoothing,usePressureOverridesSize:!!i.usePressureOverridesSize,usePressureOverridesOpacity:!!i.usePressureOverridesOpacity,useLegacy:!!i.useLegacy},i.prVr&&(e.toolOptions.flowDynamics=l(i.prVr)),i.opVr&&(e.toolOptions.opacityDynamics=l(i.opVr)),i.szVr&&(e.toolOptions.sizeDynamics=l(i.szVr)),`wetness`in i&&(e.toolOptions.wetness=i.wetness),`dryness`in i&&(e.toolOptions.dryness=i.dryness),`mix`in i&&(e.toolOptions.mix=i.mix),`autoFill`in i&&(e.toolOptions.autoFill=i.autoFill),`autoClean`in i&&(e.toolOptions.autoClean=i.autoClean),`loadSolidColorOnly`in i&&(e.toolOptions.loadSolidColorOnly=i.loadSolidColorOnly),`sampleAllLayers`in i&&(e.toolOptions.sampleAllLayers=i.sampleAllLayers),`SmdF`in i&&(e.toolOptions.smudgeFingerPainting=i.SmdF),`SmdS`in i&&(e.toolOptions.smudgeSampleAllLayers=i.SmdS),`Prs `in i&&(e.toolOptions.strength=i[`Prs `]),`SmdF`in i&&(e.toolOptions.smudgeFingerPainting=i.SmdF),`SmdS`in i&&(e.toolOptions.smudgeSampleAllLayers=i.SmdS)),s.push(e)}break}case`patt`:for(;n.offset<p;)d.push((0,i.readPattern)(n));n.offset=p;break;case`phry`:{let e=(0,r.readVersionAndDescriptor)(n);t.logMissingFeatures&&e.hierarchy?.length;break}default:throw Error(`Invalid brush type: ${a}`)}for(;f%4;)n.offset++,f++}}else throw Error(`Unsupported ABR version (${a})`);return{samples:o,patterns:d,brushes:s}}n.readAbr=f},{"./descriptor":4,"./psdReader":13,util:55}],2:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.hasMultiEffects=n.readVectorMask=n.booleanOperations=n.readBezierKnot=n.infoHandlersMap=n.infoHandlers=void 0;let r=e("base64-js"),i=e("./effectsHelpers"),a=e("./helpers"),o=e("./psdReader"),s=e("./psdWriter"),c=e("./descriptor"),l=e("./engineData"),u=e("./text"),d=e("./engineData2"),f=`abcdefghijklmnopqrstuvwxyz`;n.infoHandlers=[],n.infoHandlersMap={};function p(e,t,r,i){let a={key:e,has:t,read:r,write:i};n.infoHandlers.push(a),n.infoHandlersMap[a.key]=a}function m(e,t){n.infoHandlersMap[e]=n.infoHandlersMap[t]}function h(e){return t=>t[e]!==void 0}function g(e){if((0,o.readUint32)(e))throw Error(`Resource size above 4 GB limit at ${e.offset.toString(16)}`);return(0,o.readUint32)(e)}function _(e,t){(0,s.writeUint32)(e,0),(0,s.writeUint32)(e,t)}p(`TySh`,h(`text`),(e,t,n)=>{if((0,o.readInt16)(e)!==1)throw Error(`Invalid TySh version`);let r=[];for(let t=0;t<6;t++)r.push((0,o.readFloat64)(e));if((0,o.readInt16)(e)!==50)throw Error(`Invalid TySh text version`);let i=(0,c.readVersionAndDescriptor)(e);if((0,o.readInt16)(e)!==1)throw Error(`Invalid TySh warp version`);let a=(0,c.readVersionAndDescriptor)(e);if(t.text={transform:r,left:(0,o.readFloat32)(e),top:(0,o.readFloat32)(e),right:(0,o.readFloat32)(e),bottom:(0,o.readFloat32)(e),text:i[`Txt `].replace(/\r/g,`
|
|
2
|
+
`),index:i.TextIndex||0,gridding:c.textGridding.decode(i.textGridding),antiAlias:c.Annt.decode(i.AntA),orientation:c.Ornt.decode(i.Ornt),warp:{style:c.warpStyle.decode(a.warpStyle),value:a.warpValue||0,perspective:a.warpPerspective||0,perspectiveOther:a.warpPerspectiveOther||0,rotate:c.Ornt.decode(a.warpRotate)}},i.bounds&&(t.text.bounds=(0,c.descBoundsToBounds)(i.bounds)),i.boundingBox&&(t.text.boundingBox=(0,c.descBoundsToBounds)(i.boundingBox)),i.EngineData){let e=(0,l.parseEngineData)(i.EngineData),n=(0,u.decodeEngineData)(e);t.text=Object.assign(Object.assign({},t.text),n)}(0,o.skipBytes)(e,n())},(e,t)=>{let n=t.text,r=n.warp||{},i=n.transform||[1,0,0,1,0,0],a=Object.assign(Object.assign(Object.assign({"Txt ":(n.text||``).replace(/\r?\n/g,`\r`),textGridding:c.textGridding.encode(n.gridding),Ornt:c.Ornt.encode(n.orientation),AntA:c.Annt.encode(n.antiAlias)},n.bounds?{bounds:(0,c.boundsToDescBounds)(n.bounds)}:{}),n.boundingBox?{boundingBox:(0,c.boundsToDescBounds)(n.boundingBox)}:{}),{TextIndex:n.index||0,EngineData:(0,l.serializeEngineData)((0,u.encodeEngineData)(n))});(0,s.writeInt16)(e,1);for(let t=0;t<6;t++)(0,s.writeFloat64)(e,i[t]);(0,s.writeInt16)(e,50),(0,c.writeVersionAndDescriptor)(e,``,`TxLr`,a,`text`),(0,s.writeInt16)(e,1),(0,c.writeVersionAndDescriptor)(e,``,`warp`,w(r)),(0,s.writeFloat32)(e,n.left),(0,s.writeFloat32)(e,n.top),(0,s.writeFloat32)(e,n.right),(0,s.writeFloat32)(e,n.bottom)}),p(`SoCo`,e=>e.vectorFill!==void 0&&e.vectorStroke===void 0&&e.vectorFill.type===`color`,(e,t)=>{let n=(0,c.readVersionAndDescriptor)(e);t.vectorFill=(0,c.parseVectorContent)(n)},(e,t)=>{let{descriptor:n}=(0,c.serializeVectorContent)(t.vectorFill);(0,c.writeVersionAndDescriptor)(e,``,`null`,n)}),p(`GdFl`,e=>e.vectorFill!==void 0&&e.vectorStroke===void 0&&(e.vectorFill.type===`solid`||e.vectorFill.type===`noise`),(e,t,n)=>{let r=(0,c.readVersionAndDescriptor)(e);t.vectorFill=(0,c.parseVectorContent)(r),(0,o.skipBytes)(e,n())},(e,t)=>{let{descriptor:n}=(0,c.serializeVectorContent)(t.vectorFill);(0,c.writeVersionAndDescriptor)(e,``,`null`,n)}),p(`PtFl`,e=>e.vectorFill!==void 0&&e.vectorStroke===void 0&&e.vectorFill.type===`pattern`,(e,t)=>{let n=(0,c.readVersionAndDescriptor)(e);t.vectorFill=(0,c.parseVectorContent)(n)},(e,t)=>{let{descriptor:n}=(0,c.serializeVectorContent)(t.vectorFill);(0,c.writeVersionAndDescriptor)(e,``,`null`,n)}),p(`vscg`,e=>e.vectorFill!==void 0&&e.vectorStroke!==void 0,(e,t,n)=>{(0,o.readSignature)(e);let r=(0,c.readVersionAndDescriptor)(e);t.vectorFill=(0,c.parseVectorContent)(r),(0,o.skipBytes)(e,n())},(e,t)=>{let{descriptor:n,key:r}=(0,c.serializeVectorContent)(t.vectorFill);(0,s.writeSignature)(e,r),(0,c.writeVersionAndDescriptor)(e,``,`null`,n)});function v(e,t,n){let r=(0,o.readFixedPointPath32)(e)*n,i=(0,o.readFixedPointPath32)(e)*t,a=(0,o.readFixedPointPath32)(e)*n,s=(0,o.readFixedPointPath32)(e)*t,c=(0,o.readFixedPointPath32)(e)*n;return[i,r,s,a,(0,o.readFixedPointPath32)(e)*t,c]}n.readBezierKnot=v;function y(e,t,n,r){(0,s.writeFixedPointPath32)(e,t[1]/r),(0,s.writeFixedPointPath32)(e,t[0]/n),(0,s.writeFixedPointPath32)(e,t[3]/r),(0,s.writeFixedPointPath32)(e,t[2]/n),(0,s.writeFixedPointPath32)(e,t[5]/r),(0,s.writeFixedPointPath32)(e,t[4]/n)}n.booleanOperations=[`exclude`,`combine`,`subtract`,`intersect`];function b(e,t,r,i,a){let s=e.offset+a,c=t.paths,l;for(;s-e.offset>=26;){let a=(0,o.readUint16)(e);switch(a){case 0:case 3:{(0,o.readUint16)(e);let t=(0,o.readInt16)(e),r=(0,o.readUint16)(e);(0,o.skipBytes)(e,18),l={open:a===3,knots:[],fillRule:r===2?`non-zero`:`even-odd`},t!==-1&&(l.operation=n.booleanOperations[t]),c.push(l);break}case 1:case 2:case 4:case 5:l.knots.push({linked:a===1||a===4,points:v(e,r,i)});break;case 6:(0,o.skipBytes)(e,24);break;case 7:{let n=(0,o.readFixedPointPath32)(e),r=(0,o.readFixedPointPath32)(e),i=(0,o.readFixedPointPath32)(e),a=(0,o.readFixedPointPath32)(e),s=(0,o.readFixedPointPath32)(e);(0,o.skipBytes)(e,4),t.clipboard={top:n,left:r,bottom:i,right:a,resolution:s};break}case 8:t.fillStartsWithAllPixels=!!(0,o.readUint16)(e),(0,o.skipBytes)(e,22);break;default:throw Error(`Invalid vmsk section`)}}return c}n.readVectorMask=b,p(`vmsk`,h(`vectorMask`),(e,t,n,{width:r,height:i})=>{if((0,o.readUint32)(e)!==3)throw Error(`Invalid vmsk version`);t.vectorMask={paths:[]};let a=t.vectorMask,s=(0,o.readUint32)(e);a.invert=!!(s&1),a.notLink=!!(s&2),a.disable=!!(s&4),b(e,a,r,i,n()),(0,o.skipBytes)(e,n())},(e,t,{width:r,height:i})=>{let a=t.vectorMask,o=+!!a.invert|(a.notLink?2:0)|(a.disable?4:0);(0,s.writeUint32)(e,3),(0,s.writeUint32)(e,o),(0,s.writeUint16)(e,6),(0,s.writeZeros)(e,24);let c=a.clipboard;c&&((0,s.writeUint16)(e,7),(0,s.writeFixedPointPath32)(e,c.top),(0,s.writeFixedPointPath32)(e,c.left),(0,s.writeFixedPointPath32)(e,c.bottom),(0,s.writeFixedPointPath32)(e,c.right),(0,s.writeFixedPointPath32)(e,c.resolution),(0,s.writeZeros)(e,4)),(0,s.writeUint16)(e,8),(0,s.writeUint16)(e,+!!a.fillStartsWithAllPixels),(0,s.writeZeros)(e,22);for(let t of a.paths){(0,s.writeUint16)(e,t.open?3:0),(0,s.writeUint16)(e,t.knots.length),(0,s.writeUint16)(e,t.operation?n.booleanOperations.indexOf(t.operation):-1),(0,s.writeUint16)(e,t.fillRule===`non-zero`?2:1),(0,s.writeZeros)(e,18);let a=t.open?4:1,o=t.open?5:2;for(let{linked:n,points:c}of t.knots)(0,s.writeUint16)(e,n?a:o),y(e,c,r,i)}}),m(`vsms`,`vmsk`),p(`vowv`,h(`vowv`),(e,t)=>{t.vowv=(0,o.readUint32)(e)},(e,t)=>{(0,s.writeUint32)(e,t.vowv)}),p(`vogk`,h(`vectorOrigination`),(e,t,n)=>{if((0,o.readInt32)(e)!==1)throw Error(`Invalid vogk version`);let r=(0,c.readVersionAndDescriptor)(e);t.vectorOrigination={keyDescriptorList:[]};for(let e of r.keyDescriptorList){let n={};e.keyShapeInvalidated!=null&&(n.keyShapeInvalidated=e.keyShapeInvalidated),e.keyOriginType!=null&&(n.keyOriginType=e.keyOriginType),e.keyOriginResolution!=null&&(n.keyOriginResolution=e.keyOriginResolution),e.keyOriginShapeBBox&&(n.keyOriginShapeBoundingBox={top:(0,c.parseUnitsOrNumber)(e.keyOriginShapeBBox[`Top `]),left:(0,c.parseUnitsOrNumber)(e.keyOriginShapeBBox.Left),bottom:(0,c.parseUnitsOrNumber)(e.keyOriginShapeBBox.Btom),right:(0,c.parseUnitsOrNumber)(e.keyOriginShapeBBox.Rght)});let r=e.keyOriginRRectRadii;r&&(n.keyOriginRRectRadii={topRight:(0,c.parseUnits)(r.topRight),topLeft:(0,c.parseUnits)(r.topLeft),bottomLeft:(0,c.parseUnits)(r.bottomLeft),bottomRight:(0,c.parseUnits)(r.bottomRight)});let i=e.keyOriginBoxCorners;i&&(n.keyOriginBoxCorners=[{x:i.rectangleCornerA.Hrzn,y:i.rectangleCornerA.Vrtc},{x:i.rectangleCornerB.Hrzn,y:i.rectangleCornerB.Vrtc},{x:i.rectangleCornerC.Hrzn,y:i.rectangleCornerC.Vrtc},{x:i.rectangleCornerD.Hrzn,y:i.rectangleCornerD.Vrtc}]);let a=e.Trnf;a&&(n.transform=[a.xx,a.xy,a.yx,a.yy,a.tx,a.ty]),t.vectorOrigination.keyDescriptorList.push(n)}(0,o.skipBytes)(e,n())},(e,t)=>{let n=t.vectorOrigination,r={keyDescriptorList:[]};for(let e=0;e<n.keyDescriptorList.length;e++){let t=n.keyDescriptorList[e];r.keyDescriptorList.push({});let i=r.keyDescriptorList[r.keyDescriptorList.length-1];t.keyOriginType!=null&&(i.keyOriginType=t.keyOriginType),t.keyOriginResolution!=null&&(i.keyOriginResolution=t.keyOriginResolution);let a=t.keyOriginRRectRadii;a&&(i.keyOriginRRectRadii={unitValueQuadVersion:1,topRight:(0,c.unitsValue)(a.topRight,`topRight`),topLeft:(0,c.unitsValue)(a.topLeft,`topLeft`),bottomLeft:(0,c.unitsValue)(a.bottomLeft,`bottomLeft`),bottomRight:(0,c.unitsValue)(a.bottomRight,`bottomRight`)});let o=t.keyOriginShapeBoundingBox;o&&(i.keyOriginShapeBBox={unitValueQuadVersion:1,"Top ":(0,c.unitsValue)(o.top,`top`),Left:(0,c.unitsValue)(o.left,`left`),Btom:(0,c.unitsValue)(o.bottom,`bottom`),Rght:(0,c.unitsValue)(o.right,`right`)});let s=t.keyOriginBoxCorners;s&&s.length===4&&(i.keyOriginBoxCorners={rectangleCornerA:{Hrzn:s[0].x,Vrtc:s[0].y},rectangleCornerB:{Hrzn:s[1].x,Vrtc:s[1].y},rectangleCornerC:{Hrzn:s[2].x,Vrtc:s[2].y},rectangleCornerD:{Hrzn:s[3].x,Vrtc:s[3].y}});let l=t.transform;l&&l.length===6&&(i.Trnf={xx:l[0],xy:l[1],yx:l[2],yy:l[3],tx:l[4],ty:l[5]}),t.keyShapeInvalidated!=null&&(i.keyShapeInvalidated=t.keyShapeInvalidated),i.keyOriginIndex=e}(0,s.writeInt32)(e,1),(0,c.writeVersionAndDescriptor)(e,``,`null`,r)}),p(`lmfx`,e=>e.effects!==void 0&&Y(e.effects),(e,t,n)=>{if((0,o.readUint32)(e)!==0)throw Error(`Invalid lmfx version`);let r=(0,c.readVersionAndDescriptor)(e);t.effects=(0,c.parseEffects)(r,!!e.logMissingFeatures),(0,o.skipBytes)(e,n())},(e,t,n,r)=>{let i=(0,c.serializeEffects)(t.effects,!!r.logMissingFeatures,!0);(0,s.writeUint32)(e,0),(0,c.writeVersionAndDescriptor)(e,``,`null`,i)}),p(`lrFX`,h(`effects`),(e,t,n)=>{t.effects||=(0,i.readEffects)(e),(0,o.skipBytes)(e,n())},(e,t)=>{(0,i.writeEffects)(e,t.effects)}),p(`luni`,h(`name`),(e,t,n)=>{if(n()>4){let r=(0,o.readUint32)(e);n()>=r*2?t.name=(0,o.readUnicodeStringWithLength)(e,r):e.logDevFeatures&&e.log(`name in luni section is too long`)}else e.logDevFeatures&&e.log(`empty luni section`);(0,o.skipBytes)(e,n())},(e,t)=>{(0,s.writeUnicodeString)(e,t.name)}),p(`lnsr`,h(`nameSource`),(e,t)=>t.nameSource=(0,o.readSignature)(e),(e,t)=>(0,s.writeSignature)(e,t.nameSource)),p(`lyid`,h(`id`),(e,t)=>{t.id=(0,o.readUint32)(e)},(e,t,n,r)=>{let i=t.id;for(;r.layerIds.has(i);)i+=100;(0,s.writeUint32)(e,i),r.layerIds.add(i),r.layerToId.set(t,i)}),p(`lsct`,h(`sectionDivider`),(e,t,n)=>{t.sectionDivider={type:(0,o.readUint32)(e)},n()&&((0,o.checkSignature)(e,`8BIM`),t.sectionDivider.key=(0,o.readSignature)(e)),n()&&(t.sectionDivider.subType=(0,o.readUint32)(e))},(e,t)=>{(0,s.writeUint32)(e,t.sectionDivider.type),t.sectionDivider.key&&((0,s.writeSignature)(e,`8BIM`),(0,s.writeSignature)(e,t.sectionDivider.key),t.sectionDivider.subType!==void 0&&(0,s.writeUint32)(e,t.sectionDivider.subType))}),m(`lsdk`,`lsct`),p(`clbl`,h(`blendClippendElements`),(e,t)=>{t.blendClippendElements=!!(0,o.readUint8)(e),(0,o.skipBytes)(e,3)},(e,t)=>{(0,s.writeUint8)(e,+!!t.blendClippendElements),(0,s.writeZeros)(e,3)}),p(`infx`,h(`blendInteriorElements`),(e,t)=>{t.blendInteriorElements=!!(0,o.readUint8)(e),(0,o.skipBytes)(e,3)},(e,t)=>{(0,s.writeUint8)(e,+!!t.blendInteriorElements),(0,s.writeZeros)(e,3)}),p(`knko`,h(`knockout`),(e,t)=>{t.knockout=!!(0,o.readUint8)(e),(0,o.skipBytes)(e,3)},(e,t)=>{(0,s.writeUint8)(e,+!!t.knockout),(0,s.writeZeros)(e,3)}),p(`lmgm`,h(`layerMaskAsGlobalMask`),(e,t)=>{t.layerMaskAsGlobalMask=!!(0,o.readUint8)(e),(0,o.skipBytes)(e,3)},(e,t)=>{(0,s.writeUint8)(e,+!!t.layerMaskAsGlobalMask),(0,s.writeZeros)(e,3)}),p(`lspf`,h(`protected`),(e,t)=>{let n=(0,o.readUint32)(e);t.protected={transparency:!!(n&1),composite:!!(n&2),position:!!(n&4)},n&8&&(t.protected.artboards=!0)},(e,t)=>{let n=+!!t.protected.transparency|(t.protected.composite?2:0)|(t.protected.position?4:0)|(t.protected.artboards?8:0);(0,s.writeUint32)(e,n)}),p(`lclr`,h(`layerColor`),(e,t)=>{let n=(0,o.readUint16)(e);(0,o.skipBytes)(e,6),t.layerColor=a.layerColors[n]},(e,t)=>{let n=a.layerColors.indexOf(t.layerColor);(0,s.writeUint16)(e,n===-1?0:n),(0,s.writeZeros)(e,6)}),p(`shmd`,e=>e.timestamp!==void 0||e.animationFrames!==void 0||e.animationFrameFlags!==void 0||e.timeline!==void 0||e.comps!==void 0,(e,t,n)=>{let r=(0,o.readUint32)(e);for(let n=0;n<r;n++){(0,o.checkSignature)(e,`8BIM`);let n=(0,o.readSignature)(e);(0,o.readUint8)(e),(0,o.skipBytes)(e,3),(0,o.readSection)(e,1,r=>{if(n===`cust`){let n=(0,c.readVersionAndDescriptor)(e);n.layerTime!==void 0&&(t.timestamp=n.layerTime)}else if(n===`mlst`){let n=(0,c.readVersionAndDescriptor)(e);t.animationFrames=[];for(let r=0;r<n.LaSt.length;r++){let i=n.LaSt[r],a={frames:i.FrLs};i.enab!==void 0&&(a.enable=i.enab),i.Ofst&&(a.offset=(0,c.horzVrtcToXY)(i.Ofst)),i.FXRf&&(a.referencePoint=(0,c.horzVrtcToXY)(i.FXRf)),i.Lefx&&(a.effects=(0,c.parseEffects)(i.Lefx,!!e.logMissingFeatures)),i.blendOptions&&i.blendOptions.Opct&&(a.opacity=(0,c.parsePercent)(i.blendOptions.Opct)),t.animationFrames.push(a)}}else if(n===`mdyn`){(0,o.readUint16)(e);let n=(0,o.readUint8)(e),r=(0,o.readUint8)(e);t.animationFrameFlags={propagateFrameOne:!n,unifyLayerPosition:!!(r&1),unifyLayerStyle:!!(r&2),unifyLayerVisibility:!!(r&4)}}else if(n===`tmln`){let n=(0,c.readVersionAndDescriptor)(e),r=n.timeScope,i={start:(0,c.frac)(r.Strt),duration:(0,c.frac)(r.duration),inTime:(0,c.frac)(r.inTime),outTime:(0,c.frac)(r.outTime),autoScope:n.autoScope,audioLevel:n.audioLevel};n.trackList&&(i.tracks=(0,c.parseTrackList)(n.trackList,!!e.logMissingFeatures)),t.timeline=i}else if(n===`cmls`){let n=(0,c.readVersionAndDescriptor)(e);t.comps={settings:[]},n.origFXRefPoint&&(t.comps.originalEffectsReferencePoint={x:n.origFXRefPoint.Hrzn,y:n.origFXRefPoint.Vrtc});for(let e of n.layerSettings){t.comps.settings.push({compList:e.compList});let n=t.comps.settings[t.comps.settings.length-1];`enab`in e&&(n.enabled=e.enab),e.Ofst&&(n.offset={x:e.Ofst.Hrzn,y:e.Ofst.Vrtc}),e.FXRefPoint&&(n.effectsReferencePoint={x:e.FXRefPoint.Hrzn,y:e.FXRefPoint.Vrtc})}}else n===`extn`&&(0,c.readVersionAndDescriptor)(e),e.logMissingFeatures&&e.log(`Unhandled "shmd" section key`,n);(0,o.skipBytes)(e,r())})}(0,o.skipBytes)(e,n())},(e,t,n,r)=>{let{animationFrames:i,animationFrameFlags:a,timestamp:o,timeline:l,comps:u}=t,d=0;i&&d++,a&&d++,l&&d++,o!==void 0&&d++,u&&d++,(0,s.writeUint32)(e,d),i&&((0,s.writeSignature)(e,`8BIM`),(0,s.writeSignature)(e,`mlst`),(0,s.writeUint8)(e,0),(0,s.writeZeros)(e,3),(0,s.writeSection)(e,2,()=>{let n={LaID:t.id??0,LaSt:[]};for(let e=0;e<i.length;e++){let t=i[e],r={};t.enable!==void 0&&(r.enab=t.enable),r.FrLs=t.frames,t.offset&&(r.Ofst=(0,c.xyToHorzVrtc)(t.offset)),t.referencePoint&&(r.FXRf=(0,c.xyToHorzVrtc)(t.referencePoint)),t.effects&&(r.Lefx=(0,c.serializeEffects)(t.effects,!1,!1)),t.opacity!==void 0&&(r.blendOptions={Opct:(0,c.unitsPercent)(t.opacity)}),n.LaSt.push(r)}(0,c.writeVersionAndDescriptor)(e,``,`null`,n)},!0)),a&&((0,s.writeSignature)(e,`8BIM`),(0,s.writeSignature)(e,`mdyn`),(0,s.writeUint8)(e,0),(0,s.writeZeros)(e,3),(0,s.writeSection)(e,2,()=>{(0,s.writeUint16)(e,0),(0,s.writeUint8)(e,a.propagateFrameOne?0:15),(0,s.writeUint8)(e,+!!a.unifyLayerPosition|(a.unifyLayerStyle?2:0)|(a.unifyLayerVisibility?4:0))})),l&&((0,s.writeSignature)(e,`8BIM`),(0,s.writeSignature)(e,`tmln`),(0,s.writeUint8)(e,0),(0,s.writeZeros)(e,3),(0,s.writeSection)(e,2,()=>{let n={Vrsn:1,timeScope:{Vrsn:1,Strt:l.start,duration:l.duration,inTime:l.inTime,outTime:l.outTime},autoScope:l.autoScope,audioLevel:l.audioLevel};l.tracks&&(n.trackList=(0,c.serializeTrackList)(l.tracks));let i=r.layerToId.get(t)||t.id;if(!i)throw Error(`You need to provide layer.id value whan writing document with animations`);n.LyrI=i,(0,c.writeVersionAndDescriptor)(e,``,`null`,n,`anim`)},!0)),o!==void 0&&((0,s.writeSignature)(e,`8BIM`),(0,s.writeSignature)(e,`cust`),(0,s.writeUint8)(e,0),(0,s.writeZeros)(e,3),(0,s.writeSection)(e,2,()=>{let t={layerTime:o};(0,c.writeVersionAndDescriptor)(e,``,`metadata`,t)},!0)),u&&((0,s.writeSignature)(e,`8BIM`),(0,s.writeSignature)(e,`cmls`),(0,s.writeUint8)(e,0),(0,s.writeZeros)(e,3),(0,s.writeSection)(e,2,()=>{let n=r.layerToId.get(t)||t.id;if(!n)throw Error(`You need to provide layer.id value whan writing document with layer comps`);let i={};u.originalEffectsReferencePoint&&(i.origFXRefPoint={Hrzn:u.originalEffectsReferencePoint.x,Vrtc:u.originalEffectsReferencePoint.y}),i.LyrI=n,i.layerSettings=[];for(let e of u.settings){let t={};e.enabled!==void 0&&(t.enab=e.enabled),e.offset&&(t.Ofst={Hrzn:e.offset.x,Vrtc:e.offset.y}),e.effectsReferencePoint&&(t.FXRefPoint={Hrzn:e.effectsReferencePoint.x,Vrtc:e.effectsReferencePoint.y}),t.compList=e.compList,i.layerSettings.push(t)}(0,c.writeVersionAndDescriptor)(e,``,`null`,i)},!0))}),p(`PxSc`,()=>!1,(e,t)=>{let n=(0,c.readVersionAndDescriptor)(e,!0);n.pixelSourceType===1986285651?t.pixelSource={type:`vdPS`,origin:{x:n.origin.Hrzn,y:n.origin.Vrtc},interpretation:{interpretAlpha:n.interpretation.interpretAlpha.split(`.`)[1],profile:n.interpretation.profile},frameReader:{type:`QTFR`,link:{name:n.frameReader[`Lnk `][`Nm `],fullPath:n.frameReader[`Lnk `].fullPath,originalPath:n.frameReader[`Lnk `].originalPath,relativePath:n.frameReader[`Lnk `].relPath,alias:n.frameReader[`Lnk `].alis},mediaDescriptor:n.frameReader.mediaDescriptor},showAlteredVideo:n.showAlteredVideo}:e.log(`Unknown pixelSourceType`)},(e,t)=>{let n=t.pixelSource,r={_name:``,_classID:`PixelSource`,pixelSourceType:1986285651,descVersion:1,origin:{Hrzn:n.origin.x,Vrtc:n.origin.y},interpretation:{_name:``,_classID:`footageInterpretation`,Vrsn:1,interpretAlpha:`alphaInterpretation.${n.interpretation.interpretAlpha}`,profile:n.interpretation.profile},frameReader:{_name:``,_classID:`FrameReader`,frameReaderType:1364477522,descVersion:1,"Lnk ":{_name:``,_classID:`ExternalFileLink`,descVersion:2,"Nm ":n.frameReader.link.name,fullPath:n.frameReader.link.fullPath,originalPath:n.frameReader.link.originalPath,alis:n.frameReader.link.alias,relPath:n.frameReader.link.relativePath},mediaDescriptor:n.frameReader.mediaDescriptor},showAlteredVideo:n.showAlteredVideo};(0,c.writeVersionAndDescriptor)(e,``,`PixelSource`,r)}),p(`vstk`,h(`vectorStroke`),(e,t,n)=>{let r=(0,c.readVersionAndDescriptor)(e);t.vectorStroke={strokeEnabled:r.strokeEnabled,fillEnabled:r.fillEnabled,lineWidth:(0,c.parseUnits)(r.strokeStyleLineWidth),lineDashOffset:(0,c.parseUnits)(r.strokeStyleLineDashOffset),miterLimit:r.strokeStyleMiterLimit,lineCapType:c.strokeStyleLineCapType.decode(r.strokeStyleLineCapType),lineJoinType:c.strokeStyleLineJoinType.decode(r.strokeStyleLineJoinType),lineAlignment:c.strokeStyleLineAlignment.decode(r.strokeStyleLineAlignment),scaleLock:r.strokeStyleScaleLock,strokeAdjust:r.strokeStyleStrokeAdjust,lineDashSet:r.strokeStyleLineDashSet.map(c.parseUnits),blendMode:c.BlnM.decode(r.strokeStyleBlendMode),opacity:(0,c.parsePercent)(r.strokeStyleOpacity),content:(0,c.parseVectorContent)(r.strokeStyleContent),resolution:r.strokeStyleResolution},(0,o.skipBytes)(e,n())},(e,t)=>{let n=t.vectorStroke,r={strokeStyleVersion:2,strokeEnabled:!!n.strokeEnabled,fillEnabled:!!n.fillEnabled,strokeStyleLineWidth:n.lineWidth||{value:3,units:`Points`},strokeStyleLineDashOffset:n.lineDashOffset||{value:0,units:`Points`},strokeStyleMiterLimit:n.miterLimit??100,strokeStyleLineCapType:c.strokeStyleLineCapType.encode(n.lineCapType),strokeStyleLineJoinType:c.strokeStyleLineJoinType.encode(n.lineJoinType),strokeStyleLineAlignment:c.strokeStyleLineAlignment.encode(n.lineAlignment),strokeStyleScaleLock:!!n.scaleLock,strokeStyleStrokeAdjust:!!n.strokeAdjust,strokeStyleLineDashSet:n.lineDashSet||[],strokeStyleBlendMode:c.BlnM.encode(n.blendMode),strokeStyleOpacity:(0,c.unitsPercent)(n.opacity??1),strokeStyleContent:(0,c.serializeVectorContent)(n.content||{type:`color`,color:{r:0,g:0,b:0}}).descriptor,strokeStyleResolution:n.resolution??72};(0,c.writeVersionAndDescriptor)(e,``,`strokeStyle`,r)}),p(`artb`,h(`artboard`),(e,t,n)=>{let r=(0,c.readVersionAndDescriptor)(e),i=r.artboardRect;t.artboard={rect:{top:i[`Top `],left:i.Left,bottom:i.Btom,right:i.Rght},guideIndices:r.guideIndeces,presetName:r.artboardPresetName,color:(0,c.parseColor)(r[`Clr `]),backgroundType:r.artboardBackgroundType},(0,o.skipBytes)(e,n())},(e,t)=>{let n=t.artboard,r=n.rect,i={artboardRect:{"Top ":r.top,Left:r.left,Btom:r.bottom,Rght:r.right},guideIndeces:n.guideIndices||[],artboardPresetName:n.presetName||``,"Clr ":(0,c.serializeColor)(n.color),artboardBackgroundType:n.backgroundType??1};(0,c.writeVersionAndDescriptor)(e,``,`artboard`,i)}),p(`sn2P`,h(`usingAlignedRendering`),(e,t)=>t.usingAlignedRendering=!!(0,o.readUint32)(e),(e,t)=>(0,s.writeUint32)(e,+!!t.usingAlignedRendering));let x=[`unknown`,`vector`,`raster`,`image stack`];function S(e){let t=Object.assign(Object.assign({style:c.warpStyle.decode(e.warpStyle)},e.warpValues?{values:e.warpValues}:{value:e.warpValue||0}),{perspective:e.warpPerspective||0,perspectiveOther:e.warpPerspectiveOther||0,rotate:c.Ornt.decode(e.warpRotate),bounds:e.bounds&&{top:(0,c.parseUnitsOrNumber)(e.bounds[`Top `]),left:(0,c.parseUnitsOrNumber)(e.bounds.Left),bottom:(0,c.parseUnitsOrNumber)(e.bounds.Btom),right:(0,c.parseUnitsOrNumber)(e.bounds.Rght)},uOrder:e.uOrder,vOrder:e.vOrder});(e.deformNumRows!=null||e.deformNumCols!=null)&&(t.deformNumRows=e.deformNumRows,t.deformNumCols=e.deformNumCols);let n=e.customEnvelopeWarp;if(n){t.customEnvelopeWarp={meshPoints:[]};let e=n.meshPoints.find(e=>e.type===`Hrzn`)?.values||[],r=n.meshPoints.find(e=>e.type===`Vrtc`)?.values||[];for(let n=0;n<e.length;n++)t.customEnvelopeWarp.meshPoints.push({x:e[n],y:r[n]});(n.quiltSliceX||n.quiltSliceY)&&(t.customEnvelopeWarp.quiltSliceX=n.quiltSliceX?.[0]?.values||[],t.customEnvelopeWarp.quiltSliceY=n.quiltSliceY?.[0]?.values||[])}return t}function C(e){return e.deformNumCols!=null||e.deformNumRows!=null||e.customEnvelopeWarp?.quiltSliceX||e.customEnvelopeWarp?.quiltSliceY}function w(e){let t=e.bounds,n=Object.assign(Object.assign({warpStyle:c.warpStyle.encode(e.style)},e.values?{warpValues:e.values}:{warpValue:e.value||0}),{warpPerspective:e.perspective||0,warpPerspectiveOther:e.perspectiveOther||0,warpRotate:c.Ornt.encode(e.rotate),bounds:{"Top ":(0,c.unitsValue)(t&&t.top||{units:`Pixels`,value:0},`bounds.top`),Left:(0,c.unitsValue)(t&&t.left||{units:`Pixels`,value:0},`bounds.left`),Btom:(0,c.unitsValue)(t&&t.bottom||{units:`Pixels`,value:0},`bounds.bottom`),Rght:(0,c.unitsValue)(t&&t.right||{units:`Pixels`,value:0},`bounds.right`)},uOrder:e.uOrder||0,vOrder:e.vOrder||0}),r=C(e);if(r){let t=n;t.deformNumRows=e.deformNumRows||0,t.deformNumCols=e.deformNumCols||0}let i=e.customEnvelopeWarp;if(i){let e=i.meshPoints||[];if(r){let t=n;t.customEnvelopeWarp={_name:``,_classID:`customEnvelopeWarp`,quiltSliceX:[{type:`quiltSliceX`,values:i.quiltSliceX||[]}],quiltSliceY:[{type:`quiltSliceY`,values:i.quiltSliceY||[]}],meshPoints:[{type:`Hrzn`,values:e.map(e=>e.x)},{type:`Vrtc`,values:e.map(e=>e.y)}]}}else n.customEnvelopeWarp={_name:``,_classID:`customEnvelopeWarp`,meshPoints:[{type:`Hrzn`,values:e.map(e=>e.x)},{type:`Vrtc`,values:e.map(e=>e.y)}]}}return n}p(`PlLd`,h(`placedLayer`),(e,t,n)=>{if((0,o.readSignature)(e)!==`plcL`)throw Error(`Invalid PlLd signature`);if((0,o.readInt32)(e)!==3)throw Error(`Invalid PlLd version`);let r=(0,o.readPascalString)(e,1),i=(0,o.readInt32)(e),a=(0,o.readInt32)(e);(0,o.readInt32)(e);let s=(0,o.readInt32)(e);if(!x[s])throw Error(`Invalid PlLd type`);let l=[];for(let t=0;t<8;t++)l.push((0,o.readFloat64)(e));let u=(0,o.readInt32)(e);if(u!==0)throw Error(`Invalid Warp version ${u}`);let d=(0,c.readVersionAndDescriptor)(e);t.placedLayer=t.placedLayer||{id:r,type:x[s],pageNumber:i,totalPages:a,transform:l,warp:S(d)},(0,o.skipBytes)(e,n())},(e,t)=>{let n=t.placedLayer;if((0,s.writeSignature)(e,`plcL`),(0,s.writeInt32)(e,3),!n.id||typeof n.id!=`string`||!/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/.test(n.id))throw Error(`Placed layer ID must be in a GUID format (example: 20953ddb-9391-11ec-b4f1-c15674f50bc4)`);if((0,s.writePascalString)(e,n.id,1),(0,s.writeInt32)(e,1),(0,s.writeInt32)(e,1),(0,s.writeInt32)(e,16),x.indexOf(n.type)===-1)throw Error(`Invalid placedLayer type`);(0,s.writeInt32)(e,x.indexOf(n.type));for(let t=0;t<8;t++)(0,s.writeFloat64)(e,n.transform[t]);(0,s.writeInt32)(e,0);let r=L(n),i=C(r)?`quiltWarp`:`warp`;(0,c.writeVersionAndDescriptor)(e,``,i,w(r),i)});function T(e){return new Float32Array(e.buffer.slice(e.byteOffset),0,e.byteLength/4)}function E(e){return new Uint32Array(e.buffer.slice(e.byteOffset),0,e.byteLength/4)}function D(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function O(e){let t=[];for(let n=0;n<e.length;n+=2)t.push({x:e[n],y:e[n+1]});return t}function k(e){let t=[];for(let n=0;n<e.length;n++)t.push(e[n].x,e[n].y);return t}function A(e){return O(T(e))}function j(e){return{x:(0,c.parseUnits)(e.Hrzn),y:(0,c.parseUnits)(e.Vrtc)}}function M(e){return{_name:``,_classID:`Pnt `,Hrzn:(0,c.unitsValue)(e.x,`x`),Vrtc:(0,c.unitsValue)(e.y,`y`)}}function N(e,t){let n={name:e[`Nm `],opacity:(0,c.parsePercent)(e.blendOptions.Opct),blendMode:c.BlnM.decode(e.blendOptions[`Md `]),enabled:e.enab,hasOptions:e.hasoptions,foregroundColor:(0,c.parseColor)(e.FrgC),backgroundColor:(0,c.parseColor)(e.BckC)};if(`Fltr`in e)switch(e.Fltr._classID){case`boxblur`:return Object.assign(Object.assign({},n),{type:`box blur`,filter:{radius:(0,c.parseUnits)(e.Fltr[`Rds `])}});case`GsnB`:return Object.assign(Object.assign({},n),{type:`gaussian blur`,filter:{radius:(0,c.parseUnits)(e.Fltr[`Rds `])}});case`MtnB`:return Object.assign(Object.assign({},n),{type:`motion blur`,filter:{angle:e.Fltr.Angl,distance:(0,c.parseUnits)(e.Fltr.Dstn)}});case`RdlB`:return Object.assign(Object.assign({},n),{type:`radial blur`,filter:{amount:e.Fltr.Amnt,method:c.BlrM.decode(e.Fltr.BlrM),quality:c.BlrQ.decode(e.Fltr.BlrQ)}});case`shapeBlur`:return Object.assign(Object.assign({},n),{type:`shape blur`,filter:{radius:(0,c.parseUnits)(e.Fltr[`Rds `]),customShape:{name:e.Fltr.customShape[`Nm `],id:e.Fltr.customShape.Idnt}}});case`SmrB`:return Object.assign(Object.assign({},n),{type:`smart blur`,filter:{radius:e.Fltr[`Rds `],threshold:e.Fltr.Thsh,quality:c.SmBQ.decode(e.Fltr.SmBQ),mode:c.SmBM.decode(e.Fltr.SmBM)}});case`surfaceBlur`:return Object.assign(Object.assign({},n),{type:`surface blur`,filter:{radius:(0,c.parseUnits)(e.Fltr[`Rds `]),threshold:e.Fltr.Thsh}});case`Dspl`:return Object.assign(Object.assign({},n),{type:`displace`,filter:{horizontalScale:e.Fltr.HrzS,verticalScale:e.Fltr.VrtS,displacementMap:c.DspM.decode(e.Fltr.DspM),undefinedAreas:c.UndA.decode(e.Fltr.UndA),displacementFile:{signature:e.Fltr.DspF.sig,path:e.Fltr.DspF.path}}});case`Pnch`:return Object.assign(Object.assign({},n),{type:`pinch`,filter:{amount:e.Fltr.Amnt}});case`Plr `:return Object.assign(Object.assign({},n),{type:`polar coordinates`,filter:{conversion:c.Cnvr.decode(e.Fltr.Cnvr)}});case`Rple`:return Object.assign(Object.assign({},n),{type:`ripple`,filter:{amount:e.Fltr.Amnt,size:c.RplS.decode(e.Fltr.RplS)}});case`Shr `:return Object.assign(Object.assign({},n),{type:`shear`,filter:{shearPoints:e.Fltr.ShrP.map(e=>({x:e.Hrzn,y:e.Vrtc})),shearStart:e.Fltr.ShrS,shearEnd:e.Fltr.ShrE,undefinedAreas:c.UndA.decode(e.Fltr.UndA)}});case`Sphr`:return Object.assign(Object.assign({},n),{type:`spherize`,filter:{amount:e.Fltr.Amnt,mode:c.SphM.decode(e.Fltr.SphM)}});case`Twrl`:return Object.assign(Object.assign({},n),{type:`twirl`,filter:{angle:e.Fltr.Angl}});case`Wave`:return Object.assign(Object.assign({},n),{type:`wave`,filter:{numberOfGenerators:e.Fltr.NmbG,type:c.Wvtp.decode(e.Fltr.Wvtp),wavelength:{min:e.Fltr.WLMn,max:e.Fltr.WLMx},amplitude:{min:e.Fltr.AmMn,max:e.Fltr.AmMx},scale:{x:e.Fltr.SclH,y:e.Fltr.SclV},randomSeed:e.Fltr.RndS,undefinedAreas:c.UndA.decode(e.Fltr.UndA)}});case`ZgZg`:return Object.assign(Object.assign({},n),{type:`zigzag`,filter:{amount:e.Fltr.Amnt,ridges:e.Fltr.NmbR,style:c.ZZTy.decode(e.Fltr.ZZTy)}});case`AdNs`:return Object.assign(Object.assign({},n),{type:`add noise`,filter:{amount:(0,c.parsePercent)(e.Fltr.Nose),distribution:c.Dstr.decode(e.Fltr.Dstr),monochromatic:e.Fltr.Mnch,randomSeed:e.Fltr.FlRs}});case`DstS`:return Object.assign(Object.assign({},n),{type:`dust and scratches`,filter:{radius:e.Fltr[`Rds `],threshold:e.Fltr.Thsh}});case`Mdn `:return Object.assign(Object.assign({},n),{type:`median`,filter:{radius:(0,c.parseUnits)(e.Fltr[`Rds `])}});case`denoise`:return Object.assign(Object.assign({},n),{type:`reduce noise`,filter:{preset:e.Fltr.preset,removeJpegArtifact:e.Fltr.removeJPEGArtifact,reduceColorNoise:(0,c.parsePercent)(e.Fltr.ClNs),sharpenDetails:(0,c.parsePercent)(e.Fltr.Shrp),channelDenoise:e.Fltr.channelDenoise.map(e=>Object.assign({channels:e.Chnl.map(c.Chnl.decode),amount:e.Amnt},e.EdgF?{preserveDetails:e.EdgF}:{}))}});case`ClrH`:return Object.assign(Object.assign({},n),{type:`color halftone`,filter:{radius:e.Fltr[`Rds `],angle1:e.Fltr.Ang1,angle2:e.Fltr.Ang2,angle3:e.Fltr.Ang3,angle4:e.Fltr.Ang4}});case`Crst`:return Object.assign(Object.assign({},n),{type:`crystallize`,filter:{cellSize:e.Fltr.ClSz,randomSeed:e.Fltr.FlRs}});case`Mztn`:return Object.assign(Object.assign({},n),{type:`mezzotint`,filter:{type:c.MztT.decode(e.Fltr.MztT),randomSeed:e.Fltr.FlRs}});case`Msc `:return Object.assign(Object.assign({},n),{type:`mosaic`,filter:{cellSize:(0,c.parseUnits)(e.Fltr.ClSz)}});case`Pntl`:return Object.assign(Object.assign({},n),{type:`pointillize`,filter:{cellSize:e.Fltr.ClSz,randomSeed:e.Fltr.FlRs}});case`Clds`:return Object.assign(Object.assign({},n),{type:`clouds`,filter:{randomSeed:e.Fltr.FlRs}});case`DfrC`:return Object.assign(Object.assign({},n),{type:`difference clouds`,filter:{randomSeed:e.Fltr.FlRs}});case`Fbrs`:return Object.assign(Object.assign({},n),{type:`fibers`,filter:{variance:e.Fltr.Vrnc,strength:e.Fltr.Strg,randomSeed:e.Fltr.RndS}});case`LnsF`:return Object.assign(Object.assign({},n),{type:`lens flare`,filter:{brightness:e.Fltr.Brgh,position:{x:e.Fltr.FlrC.Hrzn,y:e.Fltr.FlrC.Vrtc},lensType:c.Lns.decode(e.Fltr[`Lns `])}});case`smartSharpen`:return Object.assign(Object.assign({},n),{type:`smart sharpen`,filter:{amount:(0,c.parsePercent)(e.Fltr.Amnt),radius:(0,c.parseUnits)(e.Fltr[`Rds `]),threshold:e.Fltr.Thsh,angle:e.Fltr.Angl,moreAccurate:e.Fltr.moreAccurate,blur:c.blurType.decode(e.Fltr.blur),preset:e.Fltr.preset,shadow:{fadeAmount:(0,c.parsePercent)(e.Fltr.sdwM.Amnt),tonalWidth:(0,c.parsePercent)(e.Fltr.sdwM.Wdth),radius:e.Fltr.sdwM[`Rds `]},highlight:{fadeAmount:(0,c.parsePercent)(e.Fltr.hglM.Amnt),tonalWidth:(0,c.parsePercent)(e.Fltr.hglM.Wdth),radius:e.Fltr.hglM[`Rds `]}}});case`UnsM`:return Object.assign(Object.assign({},n),{type:`unsharp mask`,filter:{amount:(0,c.parsePercent)(e.Fltr.Amnt),radius:(0,c.parseUnits)(e.Fltr[`Rds `]),threshold:e.Fltr.Thsh}});case`Dfs `:return Object.assign(Object.assign({},n),{type:`diffuse`,filter:{mode:c.DfsM.decode(e.Fltr[`Md `]),randomSeed:e.Fltr.FlRs}});case`Embs`:return Object.assign(Object.assign({},n),{type:`emboss`,filter:{angle:e.Fltr.Angl,height:e.Fltr.Hght,amount:e.Fltr.Amnt}});case`Extr`:return Object.assign(Object.assign({},n),{type:`extrude`,filter:{type:c.ExtT.decode(e.Fltr.ExtT),size:e.Fltr.ExtS,depth:e.Fltr.ExtD,depthMode:c.ExtR.decode(e.Fltr.ExtR),randomSeed:e.Fltr.FlRs,solidFrontFaces:e.Fltr.ExtF,maskIncompleteBlocks:e.Fltr.ExtM}});case`Tls `:return Object.assign(Object.assign({},n),{type:`tiles`,filter:{numberOfTiles:e.Fltr.TlNm,maximumOffset:e.Fltr.TlOf,fillEmptyAreaWith:c.FlCl.decode(e.Fltr.FlCl),randomSeed:e.Fltr.FlRs}});case`TrcC`:return Object.assign(Object.assign({},n),{type:`trace contour`,filter:{level:e.Fltr[`Lvl `],edge:c.CntE.decode(e.Fltr[`Edg `])}});case`Wnd `:return Object.assign(Object.assign({},n),{type:`wind`,filter:{method:c.WndM.decode(e.Fltr.WndM),direction:c.Drct.decode(e.Fltr.Drct)}});case`Dntr`:return Object.assign(Object.assign({},n),{type:`de-interlace`,filter:{eliminate:c.IntE.decode(e.Fltr.IntE),newFieldsBy:c.IntC.decode(e.Fltr.IntC)}});case`Cstm`:return Object.assign(Object.assign({},n),{type:`custom`,filter:{scale:e.Fltr[`Scl `],offset:e.Fltr.Ofst,matrix:e.Fltr.Mtrx}});case`HghP`:return Object.assign(Object.assign({},n),{type:`high pass`,filter:{radius:(0,c.parseUnits)(e.Fltr[`Rds `])}});case`Mxm `:return Object.assign(Object.assign({},n),{type:`maximum`,filter:{radius:(0,c.parseUnits)(e.Fltr[`Rds `])}});case`Mnm `:return Object.assign(Object.assign({},n),{type:`minimum`,filter:{radius:(0,c.parseUnits)(e.Fltr[`Rds `])}});case`Ofst`:return Object.assign(Object.assign({},n),{type:`offset`,filter:{horizontal:e.Fltr.Hrzn,vertical:e.Fltr.Vrtc,undefinedAreas:c.FlMd.decode(e.Fltr[`Fl `])}});case`rigidTransform`:return Object.assign(Object.assign({},n),{type:`puppet`,filter:{rigidType:e.Fltr.rigidType,bounds:[{x:e.Fltr.PuX0,y:e.Fltr.PuY0},{x:e.Fltr.PuX1,y:e.Fltr.PuY1},{x:e.Fltr.PuX2,y:e.Fltr.PuY2},{x:e.Fltr.PuX3,y:e.Fltr.PuY3}],puppetShapeList:e.Fltr.puppetShapeList.map(e=>({rigidType:e.rigidType,originalVertexArray:A(e.originalVertexArray),deformedVertexArray:A(e.deformedVertexArray),indexArray:Array.from(E(e.indexArray)),pinOffsets:O(e.pinOffsets),posFinalPins:O(e.posFinalPins),pinVertexIndices:e.pinVertexIndices,selectedPin:e.selectedPin,pinPosition:O(e.PinP),pinRotation:e.PnRt,pinOverlay:e.PnOv,pinDepth:e.PnDp,meshQuality:e.meshQuality,meshExpansion:e.meshExpansion,meshRigidity:e.meshRigidity,imageResolution:e.imageResolution,meshBoundaryPath:{pathComponents:e.meshBoundaryPath.pathComponents.map(e=>({shapeOperation:e.shapeOperation.split(`.`)[1],paths:e.SbpL.map(e=>({closed:e.Clsp,points:e[`Pts `].map(e=>({anchor:j(e.Anch),forward:j(e[`Fwd `]),backward:j(e[`Bwd `]),smooth:e.Smoo}))}))}))}}))}});case`PbPl`:{let t=[],r=e.Fltr;for(let e=0;e<26&&r[`PN${f[e]}a`];e++)for(let n=0;n<26&&r[`PN${f[e]}${f[n]}`];n++)t.push({name:r[`PN${f[e]}${f[n]}`],value:r[`PF${f[e]}${f[n]}`]});return Object.assign(Object.assign({},n),{type:`oil paint plugin`,filter:{name:e.Fltr.KnNm,gpu:e.Fltr.GpuY,lighting:e.Fltr.LIWy,parameters:t}})}case`HsbP`:return Object.assign(Object.assign({},n),{type:`hsb/hsl`,filter:{inputMode:c.ClrS.decode(e.Fltr.Inpt),rowOrder:c.ClrS.decode(e.Fltr.Otpt)}});case`oilPaint`:return Object.assign(Object.assign({},n),{type:`oil paint`,filter:{lightingOn:e.Fltr.lightingOn,stylization:e.Fltr.stylization,cleanliness:e.Fltr.cleanliness,brushScale:e.Fltr.brushScale,microBrush:e.Fltr.microBrush,lightDirection:e.Fltr.LghD,specularity:e.Fltr.specularity}});case`LqFy`:return Object.assign(Object.assign({},n),{type:`liquify`,filter:{liquifyMesh:e.Fltr.LqMe}});case`perspectiveWarpTransform`:return Object.assign(Object.assign({},n),{type:`perspective warp`,filter:{vertices:e.Fltr.vertices.map(j),warpedVertices:e.Fltr.warpedVertices.map(j),quads:e.Fltr.quads.map(e=>e.indices)}});case`Crvs`:return Object.assign(Object.assign({},n),{type:`curves`,filter:Object.assign({presetKind:c.presetKindType.decode(e.Fltr.presetKind)},e.Fltr.Adjs?{adjustments:e.Fltr.Adjs.map(e=>{let t=e.Chnl.map(c.Chnl.decode);if(e[`Crv `])return{channels:t,curve:e[`Crv `].map(e=>{let t={x:e.Hrzn,y:e.Vrtc};return e.Cnty&&(t.curved=!0),t})};if(e.Mpng)return{channels:t,values:e.Mpng};throw Error(`Unknown curve adjustment`)})}:{})});case`BrgC`:return Object.assign(Object.assign({},n),{type:`brightness/contrast`,filter:{brightness:e.Fltr.Brgh,contrast:e.Fltr.Cntr,useLegacy:!!e.Fltr.useLegacy}});default:if(t.throwForMissingFeatures)throw Error(`Unknown filter classId: ${e.Fltr._classID}`);return}else switch(e.filterID){case 1098281575:return Object.assign(Object.assign({},n),{type:`average`});case 1114403360:return Object.assign(Object.assign({},n),{type:`blur`});case 1114403405:return Object.assign(Object.assign({},n),{type:`blur more`});case 1148416099:return Object.assign(Object.assign({},n),{type:`despeckle`});case 1180922912:return Object.assign(Object.assign({},n),{type:`facet`});case 1181902701:return Object.assign(Object.assign({},n),{type:`fragment`});case 1399353968:return Object.assign(Object.assign({},n),{type:`sharpen`});case 1399353925:return Object.assign(Object.assign({},n),{type:`sharpen edges`});case 1399353933:return Object.assign(Object.assign({},n),{type:`sharpen more`});case 1181639749:return Object.assign(Object.assign({},n),{type:`find edges`});case 1399616122:return Object.assign(Object.assign({},n),{type:`solarize`});case 1314149187:return Object.assign(Object.assign({},n),{type:`ntsc colors`});case 1231976050:return Object.assign(Object.assign({},n),{type:`invert`});default:if(t.throwForMissingFeatures)throw Error(`Unknown filterID: ${e.filterID}`)}}function P(e,t){return{enabled:e.enab,validAtPosition:e.validAtPosition,maskEnabled:e.filterMaskEnable,maskLinked:e.filterMaskLinked,maskExtendWithWhite:e.filterMaskExtendWithWhite,list:e.filterFXList.map(e=>N(e,t)).filter(e=>!!e)}}function F(e){return(0,c.unitsValue)(e.radius,`radius`)}function I(e){let t={_name:``,_classID:`filterFX`,"Nm ":e.name,blendOptions:{_name:``,_classID:`blendOptions`,Opct:(0,c.unitsPercentF)(e.opacity),"Md ":c.BlnM.encode(e.blendMode)},enab:e.enabled,hasoptions:e.hasOptions,FrgC:(0,c.serializeColor)(e.foregroundColor),BckC:(0,c.serializeColor)(e.backgroundColor)};switch(e.type){case`average`:return Object.assign(Object.assign({},t),{filterID:1098281575});case`blur`:return Object.assign(Object.assign({},t),{filterID:1114403360});case`blur more`:return Object.assign(Object.assign({},t),{filterID:1114403405});case`box blur`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Box Blur`,_classID:`boxblur`,"Rds ":F(e.filter)},filterID:697});case`gaussian blur`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Gaussian Blur`,_classID:`GsnB`,"Rds ":F(e.filter)},filterID:1198747202});case`motion blur`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Motion Blur`,_classID:`MtnB`,Angl:e.filter.angle,Dstn:(0,c.unitsValue)(e.filter.distance,`distance`)},filterID:1299476034});case`radial blur`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Radial Blur`,_classID:`RdlB`,Amnt:e.filter.amount,BlrM:c.BlrM.encode(e.filter.method),BlrQ:c.BlrQ.encode(e.filter.quality)},filterID:1382313026});case`shape blur`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Shape Blur`,_classID:`shapeBlur`,"Rds ":F(e.filter),customShape:{_name:``,_classID:`customShape`,"Nm ":e.filter.customShape.name,Idnt:e.filter.customShape.id}},filterID:702});case`smart blur`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Smart Blur`,_classID:`SmrB`,"Rds ":e.filter.radius,Thsh:e.filter.threshold,SmBQ:c.SmBQ.encode(e.filter.quality),SmBM:c.SmBM.encode(e.filter.mode)},filterID:1399681602});case`surface blur`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Surface Blur`,_classID:`surfaceBlur`,"Rds ":F(e.filter),Thsh:e.filter.threshold},filterID:701});case`displace`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Displace`,_classID:`Dspl`,HrzS:e.filter.horizontalScale,VrtS:e.filter.verticalScale,DspM:c.DspM.encode(e.filter.displacementMap),UndA:c.UndA.encode(e.filter.undefinedAreas),DspF:{sig:e.filter.displacementFile.signature,path:e.filter.displacementFile.path}},filterID:1148416108});case`pinch`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Pinch`,_classID:`Pnch`,Amnt:e.filter.amount},filterID:1349411688});case`polar coordinates`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Polar Coordinates`,_classID:`Plr `,Cnvr:c.Cnvr.encode(e.filter.conversion)},filterID:1349284384});case`ripple`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Ripple`,_classID:`Rple`,Amnt:e.filter.amount,RplS:c.RplS.encode(e.filter.size)},filterID:1383099493});case`shear`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Shear`,_classID:`Shr `,ShrP:e.filter.shearPoints.map(e=>({_name:``,_classID:`Pnt `,Hrzn:e.x,Vrtc:e.y})),UndA:c.UndA.encode(e.filter.undefinedAreas),ShrS:e.filter.shearStart,ShrE:e.filter.shearEnd},filterID:1399353888});case`spherize`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Spherize`,_classID:`Sphr`,Amnt:e.filter.amount,SphM:c.SphM.encode(e.filter.mode)},filterID:1399875698});case`twirl`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Twirl`,_classID:`Twrl`,Angl:e.filter.angle},filterID:1417114220});case`wave`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Wave`,_classID:`Wave`,Wvtp:c.Wvtp.encode(e.filter.type),NmbG:e.filter.numberOfGenerators,WLMn:e.filter.wavelength.min,WLMx:e.filter.wavelength.max,AmMn:e.filter.amplitude.min,AmMx:e.filter.amplitude.max,SclH:e.filter.scale.x,SclV:e.filter.scale.y,UndA:c.UndA.encode(e.filter.undefinedAreas),RndS:e.filter.randomSeed},filterID:1466005093});case`zigzag`:return Object.assign(Object.assign({},t),{Fltr:{_name:`ZigZag`,_classID:`ZgZg`,Amnt:e.filter.amount,NmbR:e.filter.ridges,ZZTy:c.ZZTy.encode(e.filter.style)},filterID:1516722791});case`add noise`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Add Noise`,_classID:`AdNs`,Dstr:c.Dstr.encode(e.filter.distribution),Nose:(0,c.unitsPercentF)(e.filter.amount),Mnch:e.filter.monochromatic,FlRs:e.filter.randomSeed},filterID:1097092723});case`despeckle`:return Object.assign(Object.assign({},t),{filterID:1148416099});case`dust and scratches`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Dust & Scratches`,_classID:`DstS`,"Rds ":e.filter.radius,Thsh:e.filter.threshold},filterID:1148417107});case`median`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Median`,_classID:`Mdn `,"Rds ":F(e.filter)},filterID:1298427424});case`reduce noise`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Reduce Noise`,_classID:`denoise`,ClNs:(0,c.unitsPercentF)(e.filter.reduceColorNoise),Shrp:(0,c.unitsPercentF)(e.filter.sharpenDetails),removeJPEGArtifact:e.filter.removeJpegArtifact,channelDenoise:e.filter.channelDenoise.map(e=>Object.assign({_name:``,_classID:`channelDenoiseParams`,Chnl:e.channels.map(e=>c.Chnl.encode(e)),Amnt:e.amount},e.preserveDetails?{EdgF:e.preserveDetails}:{})),preset:e.filter.preset},filterID:633});case`color halftone`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Color Halftone`,_classID:`ClrH`,"Rds ":e.filter.radius,Ang1:e.filter.angle1,Ang2:e.filter.angle2,Ang3:e.filter.angle3,Ang4:e.filter.angle4},filterID:1131180616});case`crystallize`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Crystallize`,_classID:`Crst`,ClSz:e.filter.cellSize,FlRs:e.filter.randomSeed},filterID:1131574132});case`facet`:return Object.assign(Object.assign({},t),{filterID:1180922912});case`fragment`:return Object.assign(Object.assign({},t),{filterID:1181902701});case`mezzotint`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Mezzotint`,_classID:`Mztn`,MztT:c.MztT.encode(e.filter.type),FlRs:e.filter.randomSeed},filterID:1299870830});case`mosaic`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Mosaic`,_classID:`Msc `,ClSz:(0,c.unitsValue)(e.filter.cellSize,`cellSize`)},filterID:1299407648});case`pointillize`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Pointillize`,_classID:`Pntl`,ClSz:e.filter.cellSize,FlRs:e.filter.randomSeed},filterID:1349416044});case`clouds`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Clouds`,_classID:`Clds`,FlRs:e.filter.randomSeed},filterID:1131177075});case`difference clouds`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Difference Clouds`,_classID:`DfrC`,FlRs:e.filter.randomSeed},filterID:1147564611});case`fibers`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Fibers`,_classID:`Fbrs`,Vrnc:e.filter.variance,Strg:e.filter.strength,RndS:e.filter.randomSeed},filterID:1180856947});case`lens flare`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Lens Flare`,_classID:`LnsF`,Brgh:e.filter.brightness,FlrC:{_name:``,_classID:`Pnt `,Hrzn:e.filter.position.x,Vrtc:e.filter.position.y},"Lns ":c.Lns.encode(e.filter.lensType)},filterID:1282306886});case`sharpen`:return Object.assign(Object.assign({},t),{filterID:1399353968});case`sharpen edges`:return Object.assign(Object.assign({},t),{filterID:1399353925});case`sharpen more`:return Object.assign(Object.assign({},t),{filterID:1399353933});case`smart sharpen`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Smart Sharpen`,_classID:`smartSharpen`,Amnt:(0,c.unitsPercentF)(e.filter.amount),"Rds ":F(e.filter),Thsh:e.filter.threshold,Angl:e.filter.angle,moreAccurate:e.filter.moreAccurate,blur:c.blurType.encode(e.filter.blur),preset:e.filter.preset,sdwM:{_name:`Parameters`,_classID:`adaptCorrectTones`,Amnt:(0,c.unitsPercentF)(e.filter.shadow.fadeAmount),Wdth:(0,c.unitsPercentF)(e.filter.shadow.tonalWidth),"Rds ":e.filter.shadow.radius},hglM:{_name:`Parameters`,_classID:`adaptCorrectTones`,Amnt:(0,c.unitsPercentF)(e.filter.highlight.fadeAmount),Wdth:(0,c.unitsPercentF)(e.filter.highlight.tonalWidth),"Rds ":e.filter.highlight.radius}},filterID:698});case`unsharp mask`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Unsharp Mask`,_classID:`UnsM`,Amnt:(0,c.unitsPercentF)(e.filter.amount),"Rds ":F(e.filter),Thsh:e.filter.threshold},filterID:1433301837});case`diffuse`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Diffuse`,_classID:`Dfs `,"Md ":c.DfsM.encode(e.filter.mode),FlRs:e.filter.randomSeed},filterID:1147564832});case`emboss`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Emboss`,_classID:`Embs`,Angl:e.filter.angle,Hght:e.filter.height,Amnt:e.filter.amount},filterID:1164796531});case`extrude`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Extrude`,_classID:`Extr`,ExtS:e.filter.size,ExtD:e.filter.depth,ExtF:e.filter.solidFrontFaces,ExtM:e.filter.maskIncompleteBlocks,ExtT:c.ExtT.encode(e.filter.type),ExtR:c.ExtR.encode(e.filter.depthMode),FlRs:e.filter.randomSeed},filterID:1165522034});case`find edges`:return Object.assign(Object.assign({},t),{filterID:1181639749});case`solarize`:return Object.assign(Object.assign({},t),{filterID:1399616122});case`tiles`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Tiles`,_classID:`Tls `,TlNm:e.filter.numberOfTiles,TlOf:e.filter.maximumOffset,FlCl:c.FlCl.encode(e.filter.fillEmptyAreaWith),FlRs:e.filter.randomSeed},filterID:1416393504});case`trace contour`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Trace Contour`,_classID:`TrcC`,"Lvl ":e.filter.level,"Edg ":c.CntE.encode(e.filter.edge)},filterID:1416782659});case`wind`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Wind`,_classID:`Wnd `,WndM:c.WndM.encode(e.filter.method),Drct:c.Drct.encode(e.filter.direction)},filterID:1466852384});case`de-interlace`:return Object.assign(Object.assign({},t),{Fltr:{_name:`De-Interlace`,_classID:`Dntr`,IntE:c.IntE.encode(e.filter.eliminate),IntC:c.IntC.encode(e.filter.newFieldsBy)},filterID:1148089458});case`ntsc colors`:return Object.assign(Object.assign({},t),{filterID:1314149187});case`invert`:return Object.assign(Object.assign({},t),{filterID:1231976050});case`custom`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Custom`,_classID:`Cstm`,"Scl ":e.filter.scale,Ofst:e.filter.offset,Mtrx:e.filter.matrix},filterID:1131639917});case`high pass`:return Object.assign(Object.assign({},t),{Fltr:{_name:`High Pass`,_classID:`HghP`,"Rds ":F(e.filter)},filterID:1214736464});case`maximum`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Maximum`,_classID:`Mxm `,"Rds ":F(e.filter)},filterID:1299737888});case`minimum`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Minimum`,_classID:`Mnm `,"Rds ":F(e.filter)},filterID:1299082528});case`offset`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Offset`,_classID:`Ofst`,Hrzn:e.filter.horizontal,Vrtc:e.filter.vertical,"Fl ":c.FlMd.encode(e.filter.undefinedAreas)},filterID:1332114292});case`puppet`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Rigid Transform`,_classID:`rigidTransform`,null:[`Ordn.Trgt`],rigidType:e.filter.rigidType,puppetShapeList:e.filter.puppetShapeList.map(e=>({_name:``,_classID:`puppetShape`,rigidType:e.rigidType,VrsM:1,VrsN:0,originalVertexArray:D(new Float32Array(k(e.originalVertexArray))),deformedVertexArray:D(new Float32Array(k(e.deformedVertexArray))),indexArray:D(new Uint32Array(e.indexArray)),pinOffsets:k(e.pinOffsets),posFinalPins:k(e.posFinalPins),pinVertexIndices:e.pinVertexIndices,PinP:k(e.pinPosition),PnRt:e.pinRotation,PnOv:e.pinOverlay,PnDp:e.pinDepth,meshQuality:e.meshQuality,meshExpansion:e.meshExpansion,meshRigidity:e.meshRigidity,imageResolution:e.imageResolution,meshBoundaryPath:{_name:``,_classID:`pathClass`,pathComponents:e.meshBoundaryPath.pathComponents.map(e=>({_name:``,_classID:`PaCm`,shapeOperation:`shapeOperation.${e.shapeOperation}`,SbpL:e.paths.map(e=>({_name:``,_classID:`Sbpl`,Clsp:e.closed,"Pts ":e.points.map(e=>({_name:``,_classID:`Pthp`,Anch:M(e.anchor),"Fwd ":M(e.forward),"Bwd ":M(e.backward),Smoo:e.smooth}))}))}))},selectedPin:e.selectedPin})),PuX0:e.filter.bounds[0].x,PuX1:e.filter.bounds[1].x,PuX2:e.filter.bounds[2].x,PuX3:e.filter.bounds[3].x,PuY0:e.filter.bounds[0].y,PuY1:e.filter.bounds[1].y,PuY2:e.filter.bounds[2].y,PuY3:e.filter.bounds[3].y},filterID:991});case`oil paint plugin`:{let n={};for(let t=0;t<e.filter.parameters.length;t++){let{name:r,value:i}=e.filter.parameters[t],a=`${f[Math.floor(t/26)]}${f[t%26]}`;n[`PN${a}`]=r,n[`PT${a}`]=0,n[`PF${a}`]=i}return Object.assign(Object.assign({},t),{Fltr:Object.assign({_name:`Oil Paint Plugin`,_classID:`PbPl`,KnNm:e.filter.name,GpuY:e.filter.gpu,LIWy:e.filter.lighting,FPth:`1`},n),filterID:1348620396})}case`oil paint`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Oil Paint`,_classID:`oilPaint`,lightingOn:e.filter.lightingOn,stylization:e.filter.stylization,cleanliness:e.filter.cleanliness,brushScale:e.filter.brushScale,microBrush:e.filter.microBrush,LghD:e.filter.lightDirection,specularity:e.filter.specularity},filterID:1122});case`liquify`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Liquify`,_classID:`LqFy`,LqMe:e.filter.liquifyMesh},filterID:1282492025});case`perspective warp`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Perspective Warp`,_classID:`perspectiveWarpTransform`,vertices:e.filter.vertices.map(M),warpedVertices:e.filter.warpedVertices.map(M),quads:e.filter.quads.map(e=>({indices:e}))},filterID:442});case`curves`:return Object.assign(Object.assign({},t),{Fltr:Object.assign({_name:`Curves`,_classID:`Crvs`,presetKind:c.presetKindType.encode(e.filter.presetKind)},e.filter.adjustments?{Adjs:e.filter.adjustments.map(e=>`curve`in e?{_name:``,_classID:`CrvA`,Chnl:e.channels.map(c.Chnl.encode),"Crv ":e.curve.map(e=>Object.assign({_name:``,_classID:`Pnt `,Hrzn:e.x,Vrtc:e.y},e.curved?{Cnty:!0}:{}))}:{_name:``,_classID:`CrvA`,Chnl:e.channels.map(c.Chnl.encode),Mpng:e.values})}:{}),filterID:1131574899});case`brightness/contrast`:return Object.assign(Object.assign({},t),{Fltr:{_name:`Brightness/Contrast`,_classID:`BrgC`,Brgh:e.filter.brightness,Cntr:e.filter.contrast,useLegacy:!!e.filter.useLegacy},filterID:1114793795});default:throw Error(`Unknow filter type: ${e.type}`)}}function L(e){if(e.warp)return e.warp;if(!e.width||!e.height)throw Error(`You must provide width and height of the linked image in placedLayer`);let t=e.width,n=e.height,r=t/3,i=t*2/3,a=t,o=n/3,s=n*2/3,c=n;return{style:`custom`,value:0,perspective:0,perspectiveOther:0,rotate:`horizontal`,bounds:{top:{value:0,units:`Pixels`},left:{value:0,units:`Pixels`},bottom:{value:n,units:`Pixels`},right:{value:t,units:`Pixels`}},uOrder:4,vOrder:4,customEnvelopeWarp:{meshPoints:[{x:0,y:0},{x:r,y:0},{x:i,y:0},{x:a,y:0},{x:0,y:o},{x:r,y:o},{x:i,y:o},{x:a,y:o},{x:0,y:s},{x:r,y:s},{x:i,y:s},{x:a,y:s},{x:0,y:c},{x:r,y:c},{x:i,y:c},{x:a,y:c}]}}}p(`SoLd`,h(`placedLayer`),(e,t,n)=>{if((0,o.readSignature)(e)!==`soLD`)throw Error(`Invalid SoLd type`);let r=(0,o.readInt32)(e);if(r!==4&&r!==5)throw Error(`Invalid SoLd version`);let i=(0,c.readVersionAndDescriptor)(e,!0);t.placedLayer={id:i.Idnt,placed:i.placed,type:x[i.Type],pageNumber:i.PgNm,totalPages:i.totalPages,frameStep:(0,c.frac)(i.frameStep),duration:(0,c.frac)(i.duration),frameCount:i.frameCount,transform:i.Trnf,width:i[`Sz `].Wdth,height:i[`Sz `].Hght,resolution:(0,c.parseUnits)(i.Rslt),warp:S(i.quiltWarp||i.warp)},i.nonAffineTransform&&i.nonAffineTransform.some((e,t)=>e!==i.Trnf[t])&&(t.placedLayer.nonAffineTransform=i.nonAffineTransform),i.Crop&&(t.placedLayer.crop=i.Crop),i.comp&&(t.placedLayer.comp=i.comp),i.compInfo&&(t.placedLayer.compInfo={compID:i.compInfo.compID,originalCompID:i.compInfo.originalCompID}),i.filterFX&&(t.placedLayer.filter=P(i.filterFX,e)),(0,o.skipBytes)(e,n())},(e,t)=>{(0,s.writeSignature)(e,`soLD`),(0,s.writeInt32)(e,4);let n=t.placedLayer;if(!n.id||typeof n.id!=`string`||!/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/.test(n.id))throw Error(`Placed layer ID must be in a GUID format (example: 20953ddb-9391-11ec-b4f1-c15674f50bc4)`);let r=Object.assign(Object.assign({Idnt:n.id,placed:n.placed??n.id,PgNm:n.pageNumber||1,totalPages:n.totalPages||1},n.crop?{Crop:n.crop}:{}),{frameStep:n.frameStep||{numerator:0,denominator:600},duration:n.duration||{numerator:0,denominator:600},frameCount:n.frameCount||0,Annt:16,Type:x.indexOf(n.type),Trnf:n.transform,nonAffineTransform:n.nonAffineTransform??n.transform,warp:w(L(n)),"Sz ":{_name:``,_classID:`Pnt `,Wdth:n.width||0,Hght:n.height||0},Rslt:n.resolution?(0,c.unitsValue)(n.resolution,`resolution`):{units:`Density`,value:72}});if(n.filter&&(r.filterFX={_name:``,_classID:`filterFXStyle`,enab:n.filter.enabled,validAtPosition:n.filter.validAtPosition,filterMaskEnable:n.filter.maskEnabled,filterMaskLinked:n.filter.maskLinked,filterMaskExtendWithWhite:n.filter.maskExtendWithWhite,filterFXList:n.filter.list.map(e=>I(e))}),n.warp&&C(n.warp)){let e=w(n.warp);r.quiltWarp=e,r.warp={warpStyle:`warpStyle.warpNone`,warpValue:e.warpValue,warpPerspective:e.warpPerspective,warpPerspectiveOther:e.warpPerspectiveOther,warpRotate:e.warpRotate,bounds:e.bounds,uOrder:e.uOrder,vOrder:e.vOrder}}else delete r.quiltWarp;n.comp&&(r.comp=n.comp),n.compInfo&&(r.compInfo=n.compInfo),(0,c.writeVersionAndDescriptor)(e,``,`null`,r,r.quiltWarp?`quiltWarp`:`warp`)}),m(`SoLE`,`SoLd`),p(`fxrp`,h(`referencePoint`),(e,t)=>{t.referencePoint={x:(0,o.readFloat64)(e),y:(0,o.readFloat64)(e)}},(e,t)=>{(0,s.writeFloat64)(e,t.referencePoint.x),(0,s.writeFloat64)(e,t.referencePoint.y)}),p(`Lr16`,()=>!1,(e,t,n,r,i)=>{(0,o.readLayerInfo)(e,r,i)},(e,t)=>{}),p(`Lr32`,()=>!1,(e,t,n,r,i)=>{(0,o.readLayerInfo)(e,r,i)},(e,t)=>{}),p(`LMsk`,h(`userMask`),(e,t)=>{if(t.userMask={colorSpace:(0,o.readColor)(e),opacity:(0,o.readUint16)(e)/255},(0,o.readUint8)(e)!==128)throw Error(`Invalid flag value`);(0,o.skipBytes)(e,1)},(e,t)=>{let n=t.userMask;(0,s.writeColor)(e,n.colorSpace),(0,s.writeUint16)(e,(0,a.clamp)(n.opacity,0,1)*255),(0,s.writeUint8)(e,128),(0,s.writeZeros)(e,1)}),a.MOCK_HANDLERS?p(`Patt`,e=>e._Patt!==void 0,(e,t,n)=>{t._Patt=(0,o.readBytes)(e,n())},(e,t)=>!1):p(`Patt`,e=>!!(e.patterns&&e.patterns.length>0),(e,t,n)=>{for(;n()>0;){let n=(0,o.readPattern)(e);t.patterns===void 0&&(t.patterns=[]),t.patterns.push(n)}},(e,t,n,r)=>{let i=t.patterns||[];for(let t of i)(0,s.writePattern)(e,t)}),m(`Pat2`,`Patt`),m(`Pat3`,`Patt`),a.MOCK_HANDLERS&&p(`CAI `,e=>e._CAI_!==void 0,(e,t,n)=>{t._CAI_=(0,o.readBytes)(e,n())},(e,t)=>{(0,s.writeBytes)(e,t._CAI_)}),a.MOCK_HANDLERS&&p(`OCIO`,e=>e._OCIO!==void 0,(e,t,n)=>{t._OCIO=(0,o.readBytes)(e,n())},(e,t)=>{(0,s.writeBytes)(e,t._OCIO)}),a.MOCK_HANDLERS&&p(`GenI`,e=>e._GenI!==void 0,(t,n,r)=>{let i=(0,c.readVersionAndDescriptor)(t,!0);console.log(`GenI`,e("util").inspect(i,!1,99,!0)),n._GenI=(0,o.readBytes)(t,r())},(e,t)=>{(0,s.writeBytes)(e,t._GenI)});function R(e){return{top:(0,o.readInt32)(e),left:(0,o.readInt32)(e),bottom:(0,o.readInt32)(e),right:(0,o.readInt32)(e)}}function ee(e,t){(0,s.writeInt32)(e,t.top),(0,s.writeInt32)(e,t.left),(0,s.writeInt32)(e,t.bottom),(0,s.writeInt32)(e,t.right)}p(`Anno`,e=>e.annotations!==void 0,(e,t,n)=>{let r=(0,o.readUint16)(e),i=(0,o.readUint16)(e);if(r!==2||i!==1)throw Error(`Invalid Anno version`);let a=(0,o.readUint32)(e),s=[];for(let t=0;t<a;t++){(0,o.readUint32)(e);let t=(0,o.readSignature)(e),n=!!(0,o.readUint8)(e);(0,o.readUint8)(e),(0,o.readUint16)(e);let r=R(e),i=R(e),a=(0,o.readColor)(e),c=(0,o.readPascalString)(e,2),l=(0,o.readPascalString)(e,2),u=(0,o.readPascalString)(e,2);(0,o.readUint32)(e),(0,o.readSignature)(e);let d=(0,o.readUint32)(e),f;if(t===`txtA`)d>=2&&(0,o.readUint16)(e)===65279?f=(0,o.readUnicodeStringWithLength)(e,(d-2)/2):(e.offset-=2,f=(0,o.readAsciiString)(e,d)),f=f.replace(/\r/g,`
|
|
3
|
+
`);else if(t===`sndA`)f=(0,o.readBytes)(e,d);else throw Error(`Unknown annotation type`);s.push({type:t===`txtA`?`text`:`sound`,open:n,iconLocation:r,popupLocation:i,color:a,author:c,name:l,date:u,data:f})}t.annotations=s,(0,o.skipBytes)(e,n())},(e,t)=>{let n=t.annotations;(0,s.writeUint16)(e,2),(0,s.writeUint16)(e,1),(0,s.writeUint32)(e,n.length);for(let t of n){let n=t.type===`sound`;if(n&&!(t.data instanceof Uint8Array))throw Error(`Sound annotation data should be Uint8Array`);if(!n&&typeof t.data!=`string`)throw Error(`Text annotation data should be string`);let r=e.offset;(0,s.writeUint32)(e,0),(0,s.writeSignature)(e,n?`sndA`:`txtA`),(0,s.writeUint8)(e,+!!t.open),(0,s.writeUint8)(e,28),(0,s.writeUint16)(e,1),ee(e,t.iconLocation),ee(e,t.popupLocation),(0,s.writeColor)(e,t.color),(0,s.writePascalString)(e,t.author||``,2),(0,s.writePascalString)(e,t.name||``,2),(0,s.writePascalString)(e,t.date||``,2);let i=e.offset;(0,s.writeUint32)(e,0),(0,s.writeSignature)(e,n?`sndM`:`txtC`),(0,s.writeUint32)(e,0);let a=e.offset;if(n)(0,s.writeBytes)(e,t.data);else{(0,s.writeUint16)(e,65279);let n=t.data.replace(/\n/g,`\r`);for(let t=0;t<n.length;t++)(0,s.writeUint16)(e,n.charCodeAt(t))}e.view.setUint32(r,e.offset-r,!1),e.view.setUint32(i,e.offset-i,!1),e.view.setUint32(a-4,e.offset-a,!1)}});function te(e){p(e,t=>{let n=t;return!(!n.linkedFiles||!n.linkedFiles.length||e===`lnkE`&&!n.linkedFiles.some(e=>e.linkedFile))},(t,n,r,i)=>{let a=n;for(a.linkedFiles=a.linkedFiles||[];r()>8;){let n=g(t),r=t.offset,i=(0,o.readSignature)(t),s=(0,o.readInt32)(t),l=(0,o.readPascalString)(t,1),u=(0,o.readUnicodeString)(t),d=(0,o.readSignature)(t).trim(),f=(0,o.readSignature)(t).trim(),p=g(t),m=(0,o.readUint8)(t)?(0,c.readVersionAndDescriptor)(t):void 0,h=i===`liFE`?(0,c.readVersionAndDescriptor)(t):void 0,_={id:l,name:u};if(d&&(_.type=d),f&&(_.creator=f),m&&(_.descriptor={compInfo:{compID:m.compInfo.compID,originalCompID:m.compInfo.originalCompID}}),i===`liFE`&&s>3){let e=(0,o.readInt32)(t),n=(0,o.readUint8)(t),r=(0,o.readUint8)(t),i=(0,o.readUint8)(t),a=(0,o.readUint8)(t),s=(0,o.readFloat64)(t),c=Math.floor(s),l=(s-c)*1e3;_.time=new Date(Date.UTC(e,n,r,i,a,c,l)).toISOString()}let v=i===`liFE`?g(t):0;for(i===`liFA`&&(0,o.skipBytes)(t,8),i===`liFD`&&(_.data=(0,o.readBytes)(t,p)),s>=5&&(_.childDocumentID=(0,o.readUnicodeString)(t)),s>=6&&(_.assetModTime=(0,o.readFloat64)(t)),s>=7&&(_.assetLockedState=(0,o.readUint8)(t)),i===`liFE`&&s===2&&(_.data=(0,o.readBytes)(t,v)),t.skipLinkedFilesData&&(_.data=void 0),e===`lnkE`&&(_.linkedFile={fileSize:v,name:h?.[`Nm `]||``,fullPath:h?.fullPath||``,originalPath:h?.originalPath||``,relativePath:h?.relPath||``}),a.linkedFiles.push(_);n%4;)n++;t.offset=r+n}(0,o.skipBytes)(t,r())},(t,n)=>{let r=n;for(let n of r.linkedFiles){if(e===`lnkE`!=!!n.linkedFile)continue;let r=2;n.assetLockedState==null?n.assetModTime==null?n.childDocumentID==null?e===`lnkE`&&(r=3):r=5:r=6:r=7,_(t,0);let i=t.offset;if((0,s.writeSignature)(t,e===`lnkE`?`liFE`:n.data?`liFD`:`liFA`),(0,s.writeInt32)(t,r),!n.id||typeof n.id!=`string`||!/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/.test(n.id))throw Error(`Linked file ID must be in a GUID format (example: 20953ddb-9391-11ec-b4f1-c15674f50bc4)`);if((0,s.writePascalString)(t,n.id,1),(0,s.writeUnicodeStringWithPadding)(t,n.name||``),(0,s.writeSignature)(t,n.type?`${n.type} `.substring(0,4):` `),(0,s.writeSignature)(t,n.creator?`${n.creator} `.substring(0,4):`\0\0\0\0`),_(t,n.data?n.data.byteLength:0),n.descriptor&&n.descriptor.compInfo){let e={compInfo:{compID:n.descriptor.compInfo.compID,originalCompID:n.descriptor.compInfo.originalCompID}};(0,s.writeUint8)(t,1),(0,c.writeVersionAndDescriptor)(t,``,`null`,e)}else(0,s.writeUint8)(t,0);if(e===`lnkE`){let e={descVersion:2,"Nm ":n.linkedFile?.name??``,fullPath:n.linkedFile?.fullPath??``,originalPath:n.linkedFile?.originalPath??``,relPath:n.linkedFile?.relativePath??``};(0,c.writeVersionAndDescriptor)(t,``,`ExternalFileLink`,e);let r=n.time?new Date(n.time):/* @__PURE__ */ new Date;(0,s.writeInt32)(t,r.getUTCFullYear()),(0,s.writeUint8)(t,r.getUTCMonth()),(0,s.writeUint8)(t,r.getUTCDate()),(0,s.writeUint8)(t,r.getUTCHours()),(0,s.writeUint8)(t,r.getUTCMinutes()),(0,s.writeFloat64)(t,r.getUTCSeconds()+r.getUTCMilliseconds()/1e3)}n.data?(0,s.writeBytes)(t,n.data):_(t,n.linkedFile?.fileSize||0),r>=5&&(0,s.writeUnicodeStringWithPadding)(t,n.childDocumentID||``),r>=6&&(0,s.writeFloat64)(t,n.assetModTime||0),r>=7&&(0,s.writeUint8)(t,n.assetLockedState||0);let a=t.offset-i;for(t.view.setUint32(i-4,a,!1);a%4;)a++,(0,s.writeUint8)(t,0)}})}te(`lnk2`),te(`lnkE`),m(`lnkD`,`lnk2`),m(`lnk3`,`lnk2`),p(`pths`,h(`pathList`),(e,t)=>{(0,c.readVersionAndDescriptor)(e,!0),t.pathList=[]},(e,t)=>{(0,c.writeVersionAndDescriptor)(e,``,`pathsDataClass`,{pathList:[]})}),p(`lyvr`,h(`version`),(e,t)=>t.version=(0,o.readUint32)(e),(e,t)=>(0,s.writeUint32)(e,t.version)),p(`lfxs`,()=>!1,(e,t,n)=>{if((0,o.readUint32)(e)!==0)throw Error(`Invalid lfxs version`);let r=(0,c.readVersionAndDescriptor)(e);t.effects=(0,c.parseEffects)(r,!!e.logMissingFeatures),(0,o.skipBytes)(e,n())},(e,t,n,r)=>{let i=(0,c.serializeEffects)(t.effects,!!r.logMissingFeatures,!0);(0,s.writeUint32)(e,0),(0,c.writeVersionAndDescriptor)(e,``,`null`,i)});function z(e){return t=>!!t.adjustment&&t.adjustment.type===e}p(`brit`,z(`brightness/contrast`),(e,t,n)=>{t.adjustment||={type:`brightness/contrast`,brightness:(0,o.readInt16)(e),contrast:(0,o.readInt16)(e),meanValue:(0,o.readInt16)(e),labColorOnly:!!(0,o.readUint8)(e),useLegacy:!0},(0,o.skipBytes)(e,n())},(e,t)=>{let n=t.adjustment;(0,s.writeInt16)(e,n.brightness||0),(0,s.writeInt16)(e,n.contrast||0),(0,s.writeInt16)(e,n.meanValue??127),(0,s.writeUint8)(e,+!!n.labColorOnly),(0,s.writeZeros)(e,1)});function B(e){return{shadowInput:(0,o.readInt16)(e),highlightInput:(0,o.readInt16)(e),shadowOutput:(0,o.readInt16)(e),highlightOutput:(0,o.readInt16)(e),midtoneInput:(0,o.readInt16)(e)/100}}function ne(e,t){(0,s.writeInt16)(e,t.shadowInput),(0,s.writeInt16)(e,t.highlightInput),(0,s.writeInt16)(e,t.shadowOutput),(0,s.writeInt16)(e,t.highlightOutput),(0,s.writeInt16)(e,Math.round(t.midtoneInput*100))}p(`levl`,z(`levels`),(e,t,n)=>{if((0,o.readUint16)(e)!==2)throw Error(`Invalid levl version`);t.adjustment=Object.assign(Object.assign({},t.adjustment),{type:`levels`,rgb:B(e),red:B(e),green:B(e),blue:B(e)}),(0,o.skipBytes)(e,n())},(e,t)=>{let n=t.adjustment,r={shadowInput:0,highlightInput:255,shadowOutput:0,highlightOutput:255,midtoneInput:1};(0,s.writeUint16)(e,2),ne(e,n.rgb||r),ne(e,n.red||r),ne(e,n.blue||r),ne(e,n.green||r);for(let t=0;t<59;t++)ne(e,r)});function re(e){let t=(0,o.readUint16)(e),n=[];for(let r=0;r<t;r++){let t=(0,o.readInt16)(e),r=(0,o.readInt16)(e);n.push({input:r,output:t})}return n}function ie(e,t){(0,s.writeUint16)(e,t.length);for(let n of t)(0,s.writeUint16)(e,n.output),(0,s.writeUint16)(e,n.input)}p(`curv`,z(`curves`),(e,t,n)=>{if((0,o.readUint8)(e),(0,o.readUint16)(e)!==1)throw Error(`Invalid curv version`);(0,o.readUint16)(e);let r=(0,o.readUint16)(e),i={type:`curves`};r&1&&(i.rgb=re(e)),r&2&&(i.red=re(e)),r&4&&(i.green=re(e)),r&8&&(i.blue=re(e)),t.adjustment=Object.assign(Object.assign({},t.adjustment),i),(0,o.skipBytes)(e,n())},(e,t)=>{let{rgb:n,red:r,green:i,blue:a}=t.adjustment,o=0,c=0;n&&n.length&&(o|=1,c++),r&&r.length&&(o|=2,c++),i&&i.length&&(o|=4,c++),a&&a.length&&(o|=8,c++),(0,s.writeUint8)(e,0),(0,s.writeUint16)(e,1),(0,s.writeUint16)(e,0),(0,s.writeUint16)(e,o),n&&n.length&&ie(e,n),r&&r.length&&ie(e,r),i&&i.length&&ie(e,i),a&&a.length&&ie(e,a),(0,s.writeSignature)(e,`Crv `),(0,s.writeUint16)(e,4),(0,s.writeUint16)(e,0),(0,s.writeUint16)(e,c),n&&n.length&&((0,s.writeUint16)(e,0),ie(e,n)),r&&r.length&&((0,s.writeUint16)(e,1),ie(e,r)),i&&i.length&&((0,s.writeUint16)(e,2),ie(e,i)),a&&a.length&&((0,s.writeUint16)(e,3),ie(e,a))}),p(`expA`,z(`exposure`),(e,t,n)=>{if((0,o.readUint16)(e)!==1)throw Error(`Invalid expA version`);t.adjustment=Object.assign(Object.assign({},t.adjustment),{type:`exposure`,exposure:(0,o.readFloat32)(e),offset:(0,o.readFloat32)(e),gamma:(0,o.readFloat32)(e)}),(0,o.skipBytes)(e,n())},(e,t)=>{let n=t.adjustment;(0,s.writeUint16)(e,1),(0,s.writeFloat32)(e,n.exposure),(0,s.writeFloat32)(e,n.offset),(0,s.writeFloat32)(e,n.gamma),(0,s.writeZeros)(e,2)}),p(`vibA`,z(`vibrance`),(e,t,n)=>{let r=(0,c.readVersionAndDescriptor)(e);t.adjustment={type:`vibrance`},r.vibrance!==void 0&&(t.adjustment.vibrance=r.vibrance),r.Strt!==void 0&&(t.adjustment.saturation=r.Strt),(0,o.skipBytes)(e,n())},(e,t)=>{let n=t.adjustment,r={};n.vibrance!==void 0&&(r.vibrance=n.vibrance),n.saturation!==void 0&&(r.Strt=n.saturation),(0,c.writeVersionAndDescriptor)(e,``,`null`,r)});function V(e){return{a:(0,o.readInt16)(e),b:(0,o.readInt16)(e),c:(0,o.readInt16)(e),d:(0,o.readInt16)(e),hue:(0,o.readInt16)(e),saturation:(0,o.readInt16)(e),lightness:(0,o.readInt16)(e)}}function H(e,t){let n=t||{};(0,s.writeInt16)(e,n.a||0),(0,s.writeInt16)(e,n.b||0),(0,s.writeInt16)(e,n.c||0),(0,s.writeInt16)(e,n.d||0),(0,s.writeInt16)(e,n.hue||0),(0,s.writeInt16)(e,n.saturation||0),(0,s.writeInt16)(e,n.lightness||0)}p(`hue2`,z(`hue/saturation`),(e,t,n)=>{if((0,o.readUint16)(e)!==2)throw Error(`Invalid hue2 version`);t.adjustment=Object.assign(Object.assign({},t.adjustment),{type:`hue/saturation`,master:V(e),reds:V(e),yellows:V(e),greens:V(e),cyans:V(e),blues:V(e),magentas:V(e)}),(0,o.skipBytes)(e,n())},(e,t)=>{let n=t.adjustment;(0,s.writeUint16)(e,2),H(e,n.master),H(e,n.reds),H(e,n.yellows),H(e,n.greens),H(e,n.cyans),H(e,n.blues),H(e,n.magentas)});function ae(e){return{cyanRed:(0,o.readInt16)(e),magentaGreen:(0,o.readInt16)(e),yellowBlue:(0,o.readInt16)(e)}}function oe(e,t){(0,s.writeInt16)(e,t.cyanRed||0),(0,s.writeInt16)(e,t.magentaGreen||0),(0,s.writeInt16)(e,t.yellowBlue||0)}p(`blnc`,z(`color balance`),(e,t,n)=>{t.adjustment={type:`color balance`,shadows:ae(e),midtones:ae(e),highlights:ae(e),preserveLuminosity:!!(0,o.readUint8)(e)},(0,o.skipBytes)(e,n())},(e,t)=>{let n=t.adjustment;oe(e,n.shadows||{}),oe(e,n.midtones||{}),oe(e,n.highlights||{}),(0,s.writeUint8)(e,+!!n.preserveLuminosity),(0,s.writeZeros)(e,1)}),p(`blwh`,z(`black & white`),(e,t,n)=>{let r=(0,c.readVersionAndDescriptor)(e);t.adjustment={type:`black & white`,reds:r[`Rd `],yellows:r.Yllw,greens:r[`Grn `],cyans:r[`Cyn `],blues:r[`Bl `],magentas:r.Mgnt,useTint:!!r.useTint,presetKind:r.bwPresetKind,presetFileName:r.blackAndWhitePresetFileName},r.tintColor!==void 0&&(t.adjustment.tintColor=(0,c.parseColor)(r.tintColor)),(0,o.skipBytes)(e,n())},(e,t)=>{let n=t.adjustment,r={"Rd ":n.reds||0,Yllw:n.yellows||0,"Grn ":n.greens||0,"Cyn ":n.cyans||0,"Bl ":n.blues||0,Mgnt:n.magentas||0,useTint:!!n.useTint,tintColor:(0,c.serializeColor)(n.tintColor),bwPresetKind:n.presetKind||0,blackAndWhitePresetFileName:n.presetFileName||``};(0,c.writeVersionAndDescriptor)(e,``,`null`,r)}),p(`phfl`,z(`photo filter`),(e,t,n)=>{let r=(0,o.readUint16)(e);if(r!==2&&r!==3)throw Error(`Invalid phfl version`);let i;i=r===2?(0,o.readColor)(e):{l:(0,o.readInt32)(e)/100,a:(0,o.readInt32)(e)/100,b:(0,o.readInt32)(e)/100},t.adjustment={type:`photo filter`,color:i,density:(0,o.readUint32)(e)/100,preserveLuminosity:!!(0,o.readUint8)(e)},(0,o.skipBytes)(e,n())},(e,t)=>{let n=t.adjustment;(0,s.writeUint16)(e,2),(0,s.writeColor)(e,n.color||{l:0,a:0,b:0}),(0,s.writeUint32)(e,(n.density||0)*100),(0,s.writeUint8)(e,+!!n.preserveLuminosity),(0,s.writeZeros)(e,3)});function U(e){let t=(0,o.readInt16)(e),n=(0,o.readInt16)(e),r=(0,o.readInt16)(e);return(0,o.skipBytes)(e,2),{red:t,green:n,blue:r,constant:(0,o.readInt16)(e)}}function W(e,t){let n=t||{};(0,s.writeInt16)(e,n.red),(0,s.writeInt16)(e,n.green),(0,s.writeInt16)(e,n.blue),(0,s.writeZeros)(e,2),(0,s.writeInt16)(e,n.constant)}p(`mixr`,z(`channel mixer`),(e,t,n)=>{if((0,o.readUint16)(e)!==1)throw Error(`Invalid mixr version`);let r=t.adjustment=Object.assign(Object.assign({},t.adjustment),{type:`channel mixer`,monochrome:!!(0,o.readUint16)(e)});r.monochrome||(r.red=U(e),r.green=U(e),r.blue=U(e)),r.gray=U(e),(0,o.skipBytes)(e,n())},(e,t)=>{let n=t.adjustment;(0,s.writeUint16)(e,1),(0,s.writeUint16)(e,+!!n.monochrome),n.monochrome?(W(e,n.gray),(0,s.writeZeros)(e,30)):(W(e,n.red),W(e,n.green),W(e,n.blue),W(e,n.gray))});let se=(0,a.createEnum)(`colorLookupType`,`3DLUT`,{"3dlut":`3DLUT`,abstractProfile:`abstractProfile`,deviceLinkProfile:`deviceLinkProfile`}),ce=(0,a.createEnum)(`LUTFormatType`,`look`,{look:`LUTFormatLOOK`,cube:`LUTFormatCUBE`,"3dl":`LUTFormat3DL`}),G=(0,a.createEnum)(`colorLookupOrder`,`rgb`,{rgb:`rgbOrder`,bgr:`bgrOrder`});p(`clrL`,z(`color lookup`),(e,t,n)=>{if((0,o.readUint16)(e)!==1)throw Error(`Invalid clrL version`);let r=(0,c.readVersionAndDescriptor)(e);t.adjustment={type:`color lookup`};let i=t.adjustment;r.lookupType!==void 0&&(i.lookupType=se.decode(r.lookupType)),r[`Nm `]!==void 0&&(i.name=r[`Nm `]),r.Dthr!==void 0&&(i.dither=r.Dthr),r.profile!==void 0&&(i.profile=r.profile),r.LUTFormat!==void 0&&(i.lutFormat=ce.decode(r.LUTFormat)),r.dataOrder!==void 0&&(i.dataOrder=G.decode(r.dataOrder)),r.tableOrder!==void 0&&(i.tableOrder=G.decode(r.tableOrder)),r.LUT3DFileData!==void 0&&(i.lut3DFileData=r.LUT3DFileData),r.LUT3DFileName!==void 0&&(i.lut3DFileName=r.LUT3DFileName),(0,o.skipBytes)(e,n())},(e,t)=>{let n=t.adjustment,r={};n.lookupType!==void 0&&(r.lookupType=se.encode(n.lookupType)),n.name!==void 0&&(r[`Nm `]=n.name),n.dither!==void 0&&(r.Dthr=n.dither),n.profile!==void 0&&(r.profile=n.profile),n.lutFormat!==void 0&&(r.LUTFormat=ce.encode(n.lutFormat)),n.dataOrder!==void 0&&(r.dataOrder=G.encode(n.dataOrder)),n.tableOrder!==void 0&&(r.tableOrder=G.encode(n.tableOrder)),n.lut3DFileData!==void 0&&(r.LUT3DFileData=n.lut3DFileData),n.lut3DFileName!==void 0&&(r.LUT3DFileName=n.lut3DFileName),(0,s.writeUint16)(e,1),(0,c.writeVersionAndDescriptor)(e,``,`null`,r)}),p(`nvrt`,z(`invert`),(e,t,n)=>{t.adjustment={type:`invert`},(0,o.skipBytes)(e,n())},()=>{}),p(`post`,z(`posterize`),(e,t,n)=>{t.adjustment={type:`posterize`,levels:(0,o.readUint16)(e)},(0,o.skipBytes)(e,n())},(e,t)=>{let n=t.adjustment;(0,s.writeUint16)(e,n.levels??4),(0,s.writeZeros)(e,2)}),p(`thrs`,z(`threshold`),(e,t,n)=>{t.adjustment={type:`threshold`,level:(0,o.readUint16)(e)},(0,o.skipBytes)(e,n())},(e,t)=>{let n=t.adjustment;(0,s.writeUint16)(e,n.level??128),(0,s.writeZeros)(e,2)});let le=[``,``,``,`rgb`,`hsb`,``,`lab`];p(`grdm`,z(`gradient map`),(e,t,n)=>{let r=(0,o.readUint16)(e);if(r!==1&&r!==3)throw Error(`Invalid grdm version`);let i={type:`gradient map`,gradientType:`solid`};i.reverse=!!(0,o.readUint8)(e),i.dither=!!(0,o.readUint8)(e);let a=!!(0,o.readUint8)(e);if(e.offset--,a){let t=(0,o.readSignature)(e);i.method=c.gradientInterpolationMethodType.decode(t)}i.name=(0,o.readUnicodeString)(e),i.colorStops=[],i.opacityStops=[];let s=(0,o.readUint16)(e);for(let t=0;t<s;t++)i.colorStops.push({location:(0,o.readUint32)(e),midpoint:(0,o.readUint32)(e)/100,color:(0,o.readColor)(e)}),(0,o.skipBytes)(e,2);let l=(0,o.readUint16)(e);for(let t=0;t<l;t++)i.opacityStops.push({location:(0,o.readUint32)(e),midpoint:(0,o.readUint32)(e)/100,opacity:(0,o.readUint16)(e)/255});if((0,o.readUint16)(e)!==2)throw Error(`Invalid grdm expansion count`);let u=(0,o.readUint16)(e);if(i.smoothness=u/4096,(0,o.readUint16)(e)!==32)throw Error(`Invalid grdm length`);i.gradientType=(0,o.readUint16)(e)?`noise`:`solid`,i.randomSeed=(0,o.readUint32)(e),i.addTransparency=!!(0,o.readUint16)(e),i.restrictColors=!!(0,o.readUint16)(e),i.roughness=(0,o.readUint32)(e)/4096,i.colorModel=le[(0,o.readUint16)(e)]||`rgb`,i.min=[(0,o.readUint16)(e)/32768,(0,o.readUint16)(e)/32768,(0,o.readUint16)(e)/32768,(0,o.readUint16)(e)/32768],i.max=[(0,o.readUint16)(e)/32768,(0,o.readUint16)(e)/32768,(0,o.readUint16)(e)/32768,(0,o.readUint16)(e)/32768],(0,o.skipBytes)(e,n());for(let e of i.colorStops)e.location/=u;for(let e of i.opacityStops)e.location/=u;t.adjustment=i},(e,t)=>{let n=t.adjustment;(0,s.writeUint16)(e,n.method===void 0?1:3),(0,s.writeUint8)(e,+!!n.reverse),(0,s.writeUint8)(e,+!!n.dither),n.method!==void 0&&(0,s.writeSignature)(e,c.gradientInterpolationMethodType.encode(n.method)),(0,s.writeUnicodeStringWithPadding)(e,n.name||``),(0,s.writeUint16)(e,n.colorStops&&n.colorStops.length||0);let r=Math.round((n.smoothness??1)*4096);for(let t of n.colorStops||[])(0,s.writeUint32)(e,Math.round(t.location*r)),(0,s.writeUint32)(e,Math.round(t.midpoint*100)),(0,s.writeColor)(e,t.color),(0,s.writeZeros)(e,2);(0,s.writeUint16)(e,n.opacityStops&&n.opacityStops.length||0);for(let t of n.opacityStops||[])(0,s.writeUint32)(e,Math.round(t.location*r)),(0,s.writeUint32)(e,Math.round(t.midpoint*100)),(0,s.writeUint16)(e,Math.round(t.opacity*255));(0,s.writeUint16)(e,2),(0,s.writeUint16)(e,r),(0,s.writeUint16)(e,32),(0,s.writeUint16)(e,+(n.gradientType===`noise`)),(0,s.writeUint32)(e,n.randomSeed||0),(0,s.writeUint16)(e,+!!n.addTransparency),(0,s.writeUint16)(e,+!!n.restrictColors),(0,s.writeUint32)(e,Math.round((n.roughness??1)*4096));let i=le.indexOf(n.colorModel??`rgb`);(0,s.writeUint16)(e,i===-1?3:i);for(let t=0;t<4;t++)(0,s.writeUint16)(e,Math.round((n.min&&n.min[t]||0)*32768));for(let t=0;t<4;t++)(0,s.writeUint16)(e,Math.round((n.max&&n.max[t]||0)*32768));(0,s.writeZeros)(e,4)});function K(e){return{c:(0,o.readInt16)(e),m:(0,o.readInt16)(e),y:(0,o.readInt16)(e),k:(0,o.readInt16)(e)}}function q(e,t){let n=t||{};(0,s.writeInt16)(e,n.c),(0,s.writeInt16)(e,n.m),(0,s.writeInt16)(e,n.y),(0,s.writeInt16)(e,n.k)}p(`selc`,z(`selective color`),(e,t)=>{if((0,o.readUint16)(e)!==1)throw Error(`Invalid selc version`);let n=(0,o.readUint16)(e)?`absolute`:`relative`;(0,o.skipBytes)(e,8),t.adjustment={type:`selective color`,mode:n,reds:K(e),yellows:K(e),greens:K(e),cyans:K(e),blues:K(e),magentas:K(e),whites:K(e),neutrals:K(e),blacks:K(e)}},(e,t)=>{let n=t.adjustment;(0,s.writeUint16)(e,1),(0,s.writeUint16)(e,+(n.mode===`absolute`)),(0,s.writeZeros)(e,8),q(e,n.reds),q(e,n.yellows),q(e,n.greens),q(e,n.cyans),q(e,n.blues),q(e,n.magentas),q(e,n.whites),q(e,n.neutrals),q(e,n.blacks)}),p(`CgEd`,e=>{let t=e.adjustment;return t?t.type===`brightness/contrast`&&!t.useLegacy||(t.type===`levels`||t.type===`curves`||t.type===`exposure`||t.type===`channel mixer`||t.type===`hue/saturation`)&&t.presetFileName!==void 0:!1},(e,t,n)=>{let r=(0,c.readVersionAndDescriptor)(e);if(r.Vrsn!==1)throw Error(`Invalid CgEd version`);t.adjustment=`presetFileName`in r?Object.assign(Object.assign({},t.adjustment),{presetKind:r.presetKind,presetFileName:r.presetFileName}):`curvesPresetFileName`in r?Object.assign(Object.assign({},t.adjustment),{presetKind:r.curvesPresetKind,presetFileName:r.curvesPresetFileName}):`mixerPresetFileName`in r?Object.assign(Object.assign({},t.adjustment),{presetKind:r.mixerPresetKind,presetFileName:r.mixerPresetFileName}):{type:`brightness/contrast`,brightness:r.Brgh,contrast:r.Cntr,meanValue:r.means,useLegacy:!!r.useLegacy,labColorOnly:!!r[`Lab `],auto:!!r.Auto},(0,o.skipBytes)(e,n())},(e,t)=>{let n=t.adjustment;if(n.type===`levels`||n.type===`exposure`||n.type===`hue/saturation`){let t={Vrsn:1,presetKind:n.presetKind??1,presetFileName:n.presetFileName||``};(0,c.writeVersionAndDescriptor)(e,``,`null`,t)}else if(n.type===`curves`){let t={Vrsn:1,curvesPresetKind:n.presetKind??1,curvesPresetFileName:n.presetFileName||``};(0,c.writeVersionAndDescriptor)(e,``,`null`,t)}else if(n.type===`channel mixer`){let t={Vrsn:1,mixerPresetKind:n.presetKind??1,mixerPresetFileName:n.presetFileName||``};(0,c.writeVersionAndDescriptor)(e,``,`null`,t)}else if(n.type===`brightness/contrast`){let t={Vrsn:1,Brgh:n.brightness||0,Cntr:n.contrast||0,means:n.meanValue??127,"Lab ":!!n.labColorOnly,useLegacy:!!n.useLegacy,Auto:!!n.auto};(0,c.writeVersionAndDescriptor)(e,``,`null`,t)}else throw Error(`Unhandled CgEd case`)});function J(e){let t=[];function n(e){if(e.children)for(let r of e.children)r.text?.index!==void 0&&(t[r.text.index]=r),n(r)}return n(e),t}p(`Txt2`,h(`engineData`),(e,t,n,i)=>{let a=(0,o.readBytes)(e,n());t.engineData=(0,r.fromByteArray)(a);let s=J(i),c=(0,l.parseEngineData)(a),u=(0,d.decodeEngineData2)(c).ResourceDict.TextFrameSet;if(u)for(let e=0;e<u.length;e++){let t=s[e];u[e].path&&t?.text&&(t.text.textPath=u[e].path)}},(e,t)=>{let n=(0,r.toByteArray)(t.engineData);(0,s.writeBytes)(e,n)}),p(`FEid`,h(`filterEffectsMasks`),(e,t,n)=>{let r=(0,o.readInt32)(e);if(r<1||r>3)throw Error(`Invalid filterEffects version ${r}`);for(t.filterEffectsMasks=[];n()>8;){if((0,o.readUint32)(e))throw Error(`filterEffects: 64 bit length is not supported`);let n=(0,o.readUint32)(e),r=e.offset+n,i=(0,o.readPascalString)(e,1),a=(0,o.readInt32)(e);if(a!==1)throw Error(`Invalid filterEffect version ${a}`);if((0,o.readUint32)(e))throw Error(`filterEffect: 64 bit length is not supported`);(0,o.readUint32)(e);let s=(0,o.readInt32)(e),c=(0,o.readInt32)(e),l=(0,o.readInt32)(e),u=(0,o.readInt32)(e),d=(0,o.readInt32)(e),f=(0,o.readInt32)(e),p=[];for(let t=0;t<f+2;t++)if((0,o.readInt32)(e)){if((0,o.readUint32)(e))throw Error(`filterEffect: 64 bit length is not supported`);let t=(0,o.readUint32)(e);if(!t)throw Error(`filterEffect: Empty channel`);let n=(0,o.readUint16)(e),r=(0,o.readBytes)(e,t-2);p.push({compressionMode:n,data:r})}else p.push(void 0);if(t.filterEffectsMasks.push({id:i,top:s,left:c,bottom:l,right:u,depth:d,channels:p}),e.offset<r&&(0,o.readUint8)(e)){let n=(0,o.readInt32)(e),r=(0,o.readInt32)(e),i=(0,o.readInt32)(e),a=(0,o.readInt32)(e);if((0,o.readUint32)(e))throw Error(`filterEffect: 64 bit length is not supported`);let s=(0,o.readUint32)(e),c=(0,o.readUint16)(e),l=(0,o.readBytes)(e,s-2);t.filterEffectsMasks[t.filterEffectsMasks.length-1].extra={top:n,left:r,bottom:i,right:a,compressionMode:c,data:l}}e.offset=r;let m=n;for(;m%4;)e.offset++,m++}},(e,t)=>{(0,s.writeInt32)(e,3);for(let n of t.filterEffectsMasks){(0,s.writeUint32)(e,0),(0,s.writeUint32)(e,0);let r=e.offset;(0,s.writePascalString)(e,n.id,1),(0,s.writeInt32)(e,1),(0,s.writeUint32)(e,0),(0,s.writeUint32)(e,0);let i=e.offset;(0,s.writeInt32)(e,n.top),(0,s.writeInt32)(e,n.left),(0,s.writeInt32)(e,n.bottom),(0,s.writeInt32)(e,n.right),(0,s.writeInt32)(e,n.depth);let a=Math.max(0,n.channels.length-2);(0,s.writeInt32)(e,a);for(let t=0;t<a+2;t++){let r=n.channels[t];(0,s.writeInt32)(e,+!!r),r&&((0,s.writeUint32)(e,0),(0,s.writeUint32)(e,r.data.length+2),(0,s.writeUint16)(e,r.compressionMode),(0,s.writeBytes)(e,r.data))}e.view.setUint32(i-4,e.offset-i,!1);let o=t.filterEffectsMasks[t.filterEffectsMasks.length-1]?.extra;o&&((0,s.writeUint8)(e,1),(0,s.writeInt32)(e,o.top),(0,s.writeInt32)(e,o.left),(0,s.writeInt32)(e,o.bottom),(0,s.writeInt32)(e,o.right),(0,s.writeUint32)(e,0),(0,s.writeUint32)(e,o.data.byteLength+2),(0,s.writeUint16)(e,o.compressionMode),(0,s.writeBytes)(e,o.data));let c=e.offset-r;for(e.view.setUint32(r-4,c,!1);c%4;)(0,s.writeZeros)(e,1),c++}}),m(`FXid`,`FEid`),p(`FMsk`,h(`filterMask`),(e,t)=>{t.filterMask={colorSpace:(0,o.readColor)(e),opacity:(0,o.readUint16)(e)/255}},(e,t)=>{(0,s.writeColor)(e,t.filterMask.colorSpace),(0,s.writeUint16)(e,(0,a.clamp)(t.filterMask.opacity??1,0,1)*255)}),p(`artd`,e=>e.artboards!==void 0,(e,t,n)=>{let r=(0,c.readVersionAndDescriptor)(e);t.artboards={count:r[`Cnt `],autoExpandOffset:{horizontal:r.autoExpandOffset.Hrzn,vertical:r.autoExpandOffset.Vrtc},origin:{horizontal:r.origin.Hrzn,vertical:r.origin.Vrtc},autoExpandEnabled:r.autoExpandEnabled,autoNestEnabled:r.autoNestEnabled,autoPositionEnabled:r.autoPositionEnabled,shrinkwrapOnSaveEnabled:!!r.shrinkwrapOnSaveEnabled,docDefaultNewArtboardBackgroundColor:(0,c.parseColor)(r.docDefaultNewArtboardBackgroundColor),docDefaultNewArtboardBackgroundType:r.docDefaultNewArtboardBackgroundType},(0,o.skipBytes)(e,n())},(e,t)=>{let n=t.artboards,r={"Cnt ":n.count,autoExpandOffset:n.autoExpandOffset?{Hrzn:n.autoExpandOffset.horizontal,Vrtc:n.autoExpandOffset.vertical}:{Hrzn:0,Vrtc:0},origin:n.origin?{Hrzn:n.origin.horizontal,Vrtc:n.origin.vertical}:{Hrzn:0,Vrtc:0},autoExpandEnabled:n.autoExpandEnabled??!0,autoNestEnabled:n.autoNestEnabled??!0,autoPositionEnabled:n.autoPositionEnabled??!0,shrinkwrapOnSaveEnabled:n.shrinkwrapOnSaveEnabled??!0,docDefaultNewArtboardBackgroundColor:(0,c.serializeColor)(n.docDefaultNewArtboardBackgroundColor),docDefaultNewArtboardBackgroundType:n.docDefaultNewArtboardBackgroundType??1};(0,c.writeVersionAndDescriptor)(e,``,`null`,r,`artd`)});function Y(e){return Object.keys(e).map(t=>e[t]).some(e=>Array.isArray(e)&&e.length>1)}n.hasMultiEffects=Y,p(`lfx2`,e=>e.effects!==void 0&&!Y(e.effects),(e,t,n)=>{if((0,o.readUint32)(e)!==0)throw Error(`Invalid lfx2 version`);let r=(0,c.readVersionAndDescriptor)(e);t.effects=(0,c.parseEffects)(r,!!e.logMissingFeatures),(0,o.skipBytes)(e,n())},(e,t,n,r)=>{let i=(0,c.serializeEffects)(t.effects,!!r.logMissingFeatures,!0);(0,s.writeUint32)(e,0),(0,c.writeVersionAndDescriptor)(e,``,`null`,i)}),p(`cinf`,h(`compositorUsed`),(e,t,n)=>{let r=(0,c.readVersionAndDescriptor)(e);function i(e){return e.split(`.`)[1]}t.compositorUsed={description:r.description,reason:r.reason,engine:i(r.Engn)},r.Vrsn&&(t.compositorUsed.version=r.Vrsn),r.psVersion&&(t.compositorUsed.photoshopVersion=r.psVersion),r.enableCompCore&&(t.compositorUsed.enableCompCore=i(r.enableCompCore)),r.enableCompCoreGPU&&(t.compositorUsed.enableCompCoreGPU=i(r.enableCompCoreGPU)),r.enableCompCoreThreads&&(t.compositorUsed.enableCompCoreThreads=i(r.enableCompCoreThreads)),r.compCoreSupport&&(t.compositorUsed.compCoreSupport=i(r.compCoreSupport)),r.compCoreGPUSupport&&(t.compositorUsed.compCoreGPUSupport=i(r.compCoreGPUSupport)),(0,o.skipBytes)(e,n())},(e,t)=>{let n=t.compositorUsed,r={Vrsn:n.version||{major:1,minor:0,fix:0}};n.photoshopVersion&&(r.psVersion=n.photoshopVersion),r.description=n.description,r.reason=n.reason,r.Engn=`Engn.${n.engine}`,n.enableCompCore&&(r.enableCompCore=`enable.${n.enableCompCore}`),n.enableCompCoreGPU&&(r.enableCompCoreGPU=`enable.${n.enableCompCoreGPU}`),n.enableCompCoreThreads&&(r.enableCompCoreThreads=`enable.${n.enableCompCoreThreads}`),n.compCoreSupport&&(r.compCoreSupport=`reason.${n.compCoreSupport}`),n.compCoreGPUSupport&&(r.compCoreGPUSupport=`reason.${n.compCoreGPUSupport}`),(0,c.writeVersionAndDescriptor)(e,``,`null`,r)}),p(`extn`,e=>e._extn!==void 0,(e,t)=>{let n=(0,c.readVersionAndDescriptor)(e);a.MOCK_HANDLERS&&(t._extn=n)},(e,t)=>{a.MOCK_HANDLERS&&(0,c.writeVersionAndDescriptor)(e,``,`null`,t._extn)}),p(`iOpa`,h(`fillOpacity`),(e,t)=>{t.fillOpacity=(0,o.readUint8)(e)/255,(0,o.skipBytes)(e,3)},(e,t)=>{(0,s.writeUint8)(e,t.fillOpacity*255),(0,s.writeZeros)(e,3)}),p(`brst`,h(`channelBlendingRestrictions`),(e,t,n)=>{for(t.channelBlendingRestrictions=[];n()>4;)t.channelBlendingRestrictions.push((0,o.readInt32)(e))},(e,t)=>{for(let n of t.channelBlendingRestrictions)(0,s.writeInt32)(e,n)}),p(`tsly`,h(`transparencyShapesLayer`),(e,t)=>{t.transparencyShapesLayer=!!(0,o.readUint8)(e),(0,o.skipBytes)(e,3)},(e,t)=>{(0,s.writeUint8)(e,+!!t.transparencyShapesLayer),(0,s.writeZeros)(e,3)})},{"./descriptor":4,"./effectsHelpers":5,"./engineData":6,"./engineData2":7,"./helpers":8,"./psdReader":13,"./psdWriter":14,"./text":15,"base64-js":19,util:55}],3:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.readCsh=void 0;let r=e("./additionalInfo"),i=e("./psdReader");function a(e){let t=(0,i.createReader)(e.buffer,e.byteOffset,e.byteLength),n={shapes:[]};if((0,i.checkSignature)(t,`cush`),(0,i.readUint32)(t)!==2)throw Error(`Invalid version`);let a=(0,i.readUint32)(t);for(let e=0;e<a;e++){let e=(0,i.readUnicodeString)(t);for(;t.offset%4;)t.offset++;if((0,i.readUint32)(t)!==1)throw Error(`Invalid shape version`);let a=(0,i.readUint32)(t),o=t.offset+a,s=(0,i.readPascalString)(t,1),c=(0,i.readUint32)(t),l=(0,i.readUint32)(t),u=(0,i.readUint32)(t),d=(0,i.readUint32)(t)-l,f=u-c,p={paths:[]};(0,r.readVectorMask)(t,p,d,f,o-t.offset),n.shapes.push(Object.assign({name:e,id:s,width:d,height:f},p)),t.offset=o}return n}n.readCsh=a},{"./additionalInfo":2,"./psdReader":13}],4:[function(e,t,n){var r=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(n,"__esModule",{value:!0}),n.ESliceOrigin=n.ESliceVertAlign=n.ESliceHorzAlign=n.ESliceType=n.FrFl=n.FStl=n.ClrS=n.gradientInterpolationMethodType=n.stdTrackID=n.animInterpStyleEnum=n.GrdT=n.IGSr=n.BETE=n.BESs=n.bvlT=n.BESl=n.BlnM=n.warpStyle=n.Annt=n.Ornt=n.textGridding=n.frac=n.unitsValue=n.unitsPercentF=n.unitsPercent=n.unitsAngle=n.parseUnitsToNumber=n.parseUnitsOrNumber=n.parseUnits=n.parsePercentOrAngle=n.parsePercent=n.parseAngle=n.serializeColor=n.parseColor=n.serializeVectorContent=n.parseVectorContent=n.serializeTrackList=n.parseTrackList=n.parseEffects=n.serializeEffects=n.boundsToDescBounds=n.descBoundsToBounds=n.xyToHorzVrtc=n.horzVrtcToXY=n.writeVersionAndDescriptor=n.readVersionAndDescriptor=n.writeDescriptorStructure=n.readDescriptorStructure=n.readAsciiStringOrClassId=n.setLogErrors=void 0,n.presetKindType=n.prjM=n.FlMd=n.IntC=n.IntE=n.Drct=n.WndM=n.CntE=n.FlCl=n.ExtR=n.ExtT=n.DfsM=n.blurType=n.Lns=n.MztT=n.Chnl=n.Dstr=n.ZZTy=n.Wvtp=n.SphM=n.RplS=n.Cnvr=n.UndA=n.DspM=n.SmBQ=n.SmBM=n.BlrQ=n.BlrM=n.strokeStyleLineAlignment=n.strokeStyleLineJoinType=n.strokeStyleLineCapType=n.ESliceBGColorType=void 0;let i=e("./helpers"),a=e("./psdReader"),o=e("./psdWriter");function s(e){let t={};return Object.keys(e).forEach(n=>t[e[n]]=n),t}let c={"#Ang":`Angle`,"#Rsl":`Density`,"#Rlt":`Distance`,"#Nne":`None`,"#Prc":`Percent`,"#Pxl":`Pixels`,"#Mlm":`Millimeters`,"#Pnt":`Points`,RrPi:`Picas`,RrIn:`Inches`,RrCm:`Centimeters`},l=s(c),u=!1;function d(e){u=e}n.setLogErrors=d;function f(e,t){return{name:e,classID:t}}let p=f(``,`null`),m={strokeStyleContent:f(``,`solidColorLayer`),printProofSetup:f(`Proof Setup`,`proofSetup`),Grad:f(`Gradient`,`Grdn`),Trnf:f(`Transform`,`Trnf`),patternFill:f(``,`patternFill`),ebbl:f(``,`ebbl`),SoFi:f(``,`SoFi`),GrFl:f(``,`GrFl`),sdwC:f(``,`RGBC`),hglC:f(``,`RGBC`),"Clr ":f(``,`RGBC`),tintColor:f(``,`RGBC`),Ofst:f(``,`Pnt `),ChFX:f(``,`ChFX`),MpgS:f(``,`ShpC`),DrSh:f(``,`DrSh`),IrSh:f(``,`IrSh`),OrGl:f(``,`OrGl`),IrGl:f(``,`IrGl`),TrnS:f(``,`ShpC`),Ptrn:f(``,`Ptrn`),FrFX:f(``,`FrFX`),phase:f(``,`Pnt `),frameStep:p,duration:p,workInTime:p,workOutTime:p,audioClipGroupList:p,bounds:f(``,`Rctn`),customEnvelopeWarp:f(``,`customEnvelopeWarp`),warp:f(``,`warp`),"Sz ":f(``,`Pnt `),origin:f(``,`Pnt `),autoExpandOffset:f(``,`Pnt `),keyOriginShapeBBox:f(``,`unitRect`),Vrsn:p,psVersion:p,docDefaultNewArtboardBackgroundColor:f(``,`RGBC`),artboardRect:f(``,`classFloatRect`),keyOriginRRectRadii:f(``,`radii`),keyOriginBoxCorners:p,rectangleCornerA:f(``,`Pnt `),rectangleCornerB:f(``,`Pnt `),rectangleCornerC:f(``,`Pnt `),rectangleCornerD:f(``,`Pnt `),compInfo:p,quiltWarp:f(``,`quiltWarp`),generatorSettings:p,crema:p,FrIn:p,blendOptions:p,FXRf:p,Lefx:p,time:p,animKey:p,timeScope:p,inTime:p,outTime:p,sheetStyle:p,translation:p,Skew:p,boundingBox:f(``,`boundingBox`),"Lnk ":f(``,`ExternalFileLink`),frameReader:f(``,`FrameReader`),effectParams:f(``,`motionTrackEffectParams`),Impr:f(`None`,`none`),Anch:f(``,`Pnt `),"Fwd ":f(``,`Pnt `),"Bwd ":f(``,`Pnt `),FlrC:f(``,`Pnt `),meshBoundaryPath:f(``,`pathClass`),filterFX:f(``,`filterFXStyle`),Fltr:f(``,`rigidTransform`),FrgC:f(``,`RGBC`),BckC:f(``,`RGBC`),sdwM:f(`Parameters`,`adaptCorrectTones`),hglM:f(`Parameters`,`adaptCorrectTones`),customShape:f(``,`customShape`),origFXRefPoint:p,FXRefPoint:p,ClMg:f(``,`ClMg`)},h={"Crv ":f(``,`CrPt`),Clrs:f(``,`Clrt`),Trns:f(``,`TrnS`),keyDescriptorList:p,solidFillMulti:f(``,`SoFi`),gradientFillMulti:f(``,`GrFl`),dropShadowMulti:f(``,`DrSh`),innerShadowMulti:f(``,`IrSh`),frameFXMulti:f(``,`FrFX`),FrIn:p,FSts:p,LaSt:p,sheetTimelineOptions:p,trackList:f(``,`animationTrack`),globalTrackList:f(``,`animationTrack`),keyList:p,audioClipGroupList:p,audioClipList:p,countObjectList:f(``,`countObject`),countGroupList:f(``,`countGroup`),slices:f(``,`slice`),"Pts ":f(``,`Pthp`),SbpL:f(``,`SbpL`),pathComponents:f(``,`PaCm`),filterFXList:f(``,`filterFX`),puppetShapeList:f(``,`puppetShape`),channelDenoise:f(``,`channelDenoiseParams`),ShrP:f(``,`Pnt `),layerSettings:p,list:p,Adjs:f(``,`CrvA`)},g={TEXT:/* @__PURE__ */ `Txt .printerName.Nm .Idnt.blackAndWhitePresetFileName.LUT3DFileName.presetFileName.curvesPresetFileName.mixerPresetFileName.placed.description.reason.artboardPresetName.json.clipID.relPath.fullPath.mediaDescriptor.Msge.altTag.url.cellText.preset.KnNm.FPth.comment.originalPath`.split(`.`),tdta:[`EngineData`,`LUT3DFileData`,`indexArray`,`originalVertexArray`,`deformedVertexArray`,`LqMe`],long:/* @__PURE__ */ `TextIndex.RndS.Mdpn.Smth.Lctn.strokeStyleVersion.LaID.Vrsn.Cnt .Brgh.Cntr.means.vibrance.Strt.bwPresetKind.comp.compID.originalCompID.curvesPresetKind.mixerPresetKind.uOrder.vOrder.PgNm.totalPages.Crop.numerator.denominator.frameCount.Annt.keyOriginType.unitValueQuadVersion.keyOriginIndex.major.minor.fix.docDefaultNewArtboardBackgroundType.artboardBackgroundType.numModifyingFX.deformNumRows.deformNumCols.FrID.FrDl.FsID.LCnt.AFrm.AFSt.numBefore.numAfter.Spcn.minOpacity.maxOpacity.BlnM.sheetID.gblA.globalAltitude.descVersion.frameReaderType.LyrI.zoomOrigin.fontSize.Rds .sliceID.topOutset.leftOutset.bottomOutset.rightOutset.filterID.meshQuality.meshExpansion.meshRigidity.VrsM.VrsN.NmbG.WLMn.WLMx.AmMn.AmMx.SclH.SclV.Lvl .TlNm.TlOf.FlRs.Thsh.ShrS.ShrE.FlRs.Vrnc.Strg.ExtS.ExtD.HrzS.VrtS.NmbR.EdgF.Ang1.Ang2.Ang3.Ang4.lastAppliedComp.capturedInfo`.split(`.`),enum:/* @__PURE__ */ `textGridding.Ornt.warpStyle.warpRotate.Inte.Bltn.ClrS.BlrQ.bvlT.bvlS.bvlD.Md .glwS.GrdF.GlwT.RplS.BlrM.SmBM.strokeStyleLineCapType.strokeStyleLineJoinType.strokeStyleLineAlignment.strokeStyleBlendMode.PntT.Styl.lookupType.LUTFormat.dataOrder.tableOrder.enableCompCore.enableCompCoreGPU.compCoreSupport.compCoreGPUSupport.Engn.enableCompCoreThreads.gs99.FrDs.trackID.animInterpStyle.horzAlign.vertAlign.bgColorType.shapeOperation.UndA.Wvtp.Drct.WndM.Edg .FlCl.IntE.IntC.Cnvr.Fl .Dstr.MztT.Lns .ExtT.DspM.ExtR.ZZTy.SphM.SmBQ.placedLayerOCIOConversion.gradientsInterpolationMethod`.split(`.`),bool:/* @__PURE__ */ `PstS.printSixteenBit.masterFXSwitch.enab.uglg.antialiasGloss.useShape.useTexture.uglg.antialiasGloss.useShape.Vsbl.useTexture.Algn.Rvrs.Dthr.Invr.VctC.ShTr.layerConceals.strokeEnabled.fillEnabled.strokeStyleScaleLock.strokeStyleStrokeAdjust.hardProof.MpBl.paperWhite.useLegacy.Auto.Lab .useTint.keyShapeInvalidated.autoExpandEnabled.autoNestEnabled.autoPositionEnabled.shrinkwrapOnSaveEnabled.present.showInDialog.overprint.sheetDisclosed.lightsDisclosed.meshesDisclosed.materialsDisclosed.hasMotion.muted.Effc.selected.autoScope.fillCanvas.cellTextIsHTML.Smoo.Clsp.validAtPosition.rigidType.hasoptions.filterMaskEnable.filterMaskLinked.filterMaskExtendWithWhite.removeJPEGArtifact.Mnch.ExtF.ExtM.moreAccurate.GpuY.LIWy.Cnty`.split(`.`),doub:/* @__PURE__ */ `warpValue.warpPerspective.warpPerspectiveOther.Intr.Wdth.Hght.strokeStyleMiterLimit.strokeStyleResolution.layerTime.keyOriginResolution.xx.xy.yx.yy.tx.ty.FrGA.frameRate.audioLevel.rotation.X .Y .redFloat.greenFloat.blueFloat.imageResolution.PuX0.PuX1.PuX2.PuX3.PuY0.PuY1.PuY2.PuY3`.split(`.`),UntF:/* @__PURE__ */ `sdwO.hglO.lagl.Lald.srgR.blur.Sftn.Opct.Dstn.Angl.Ckmt.Nose.Inpr.ShdN.strokeStyleLineWidth.strokeStyleLineDashOffset.strokeStyleOpacity.H .Top .Left.Btom.Rght.Rslt.topRight.topLeft.bottomLeft.bottomRight.ClNs.Shrp`.split(`.`),VlLs:/* @__PURE__ */ `Crv .Clrs.Mnm .Mxm .Trns.pathList.strokeStyleLineDashSet.FrLs.slices.LaSt.Trnf.nonAffineTransform.keyDescriptorList.guideIndeces.gradientFillMulti.solidFillMulti.frameFXMulti.innerShadowMulti.dropShadowMulti.FrIn.FSts.FsFr.sheetTimelineOptions.audioClipList.trackList.globalTrackList.keyList.audioClipList.warpValues.selectedPin.Pts .SbpL.pathComponents.pinOffsets.posFinalPins.pinVertexIndices.PinP.PnRt.PnOv.PnDp.filterFXList.puppetShapeList.ShrP.channelDenoise.Mtrx.layerSettings.list.compList.Adjs`.split(`.`),ObAr:[`meshPoints`,`quiltSliceX`,`quiltSliceY`],"obj ":[`null`,`Chnl`],"Pth ":[`DspF`]},_=[`Rd `,`Grn `,`Bl `,`Yllw`,`Ylw `,`Cyn `,`Mgnt`,`Blck`,`Gry `,`Lmnc`,`A `,`B `],v={"Mnm ":`long`,"Mxm ":`long`,FrLs:`long`,strokeStyleLineDashSet:`UntF`,Trnf:`doub`,nonAffineTransform:`doub`,keyDescriptorList:`Objc`,gradientFillMulti:`Objc`,solidFillMulti:`Objc`,frameFXMulti:`Objc`,innerShadowMulti:`Objc`,dropShadowMulti:`Objc`,LaSt:`Objc`,FrIn:`Objc`,FSts:`Objc`,FsFr:`long`,blendOptions:`Objc`,sheetTimelineOptions:`Objc`,keyList:`Objc`,warpValues:`doub`,selectedPin:`long`,"Pts ":`Objc`,SbpL:`Objc`,pathComponents:`Objc`,pinOffsets:`doub`,posFinalPins:`doub`,pinVertexIndices:`long`,PinP:`doub`,PnRt:`long`,PnOv:`bool`,PnDp:`doub`,filterFXList:`Objc`,puppetShapeList:`Objc`,ShrP:`Objc`,channelDenoise:`Objc`,Mtrx:`long`,compList:`long`,Chnl:`enum`},y={};for(let e of Object.keys(g))for(let t of g[e])y[t]=e;for(let e of Object.keys(m))y[e]||(y[e]=`Objc`);for(let e of Object.keys(h))v[e]=`Objc`;function b(e,t,n,r){return e===`presetKind`?typeof t==`string`?`enum`:`long`:e===`null`&&n===`slices`?`TEXT`:e===`groupID`?n===`slices`?`long`:`TEXT`:e===`Sz `?`Wdth`in t?`Objc`:`units`in t?`UntF`:`doub`:e===`Type`?typeof t==`string`?`enum`:`long`:e===`AntA`?typeof t==`string`?`enum`:`bool`:(e===`Hrzn`||e===`Vrtc`)&&(r.Type===`keyType.Pstn`||r._classID===`Ofst`)?`long`:e===`Hrzn`||e===`Vrtc`||e===`Top `||e===`Left`||e===`Btom`||e===`Rght`?n===`slices`?`long`:typeof t==`number`?`doub`:`UntF`:e===`Vrsn`?typeof t==`number`?`long`:`Objc`:e===`Rd `||e===`Grn `||e===`Bl `?n===`artd`?`long`:`doub`:e===`Trnf`?Array.isArray(t)?`VlLs`:`Objc`:y[e]}function x(e){let t=(0,a.readInt32)(e);return(0,a.readAsciiString)(e,t||4)}n.readAsciiStringOrClassId=x;function S(e,t){if(t.length===4&&t!==`warp`&&t!==`time`&&t!==`hold`&&t!==`list`)(0,o.writeInt32)(e,0),(0,o.writeSignature)(e,t);else{(0,o.writeInt32)(e,t.length);for(let n=0;n<t.length;n++)(0,o.writeUint8)(e,t.charCodeAt(n))}}function C(e,t){let n=A(e),r=t?{_name:n.name,_classID:n.classID}:{},i=(0,a.readUint32)(e);for(let n=0;n<i;n++){let n=x(e);r[n]=T(e,(0,a.readSignature)(e),t)}return r}n.readDescriptorStructure=C;function w(e,t,n,r,i){u&&!n&&console.log(`Missing classId for: `,t,n,r),(0,o.writeUnicodeStringWithPadding)(e,t),S(e,n);let a=Object.keys(r),s=a.length;`_name`in r&&s--,`_classID`in r&&s--,(0,o.writeUint32)(e,s);for(let t of a){if(t===`_name`||t===`_classID`)continue;let s=b(t,r[t],i,r),c=m[t];t===`bounds`&&i===`text`?c=f(``,`bounds`):t===`origin`?s=i===`slices`?`enum`:`Objc`:(t===`Cyn `||t===`Mgnt`||t===`Ylw `||t===`Blck`)&&r._classID===`CMYC`?s=`doub`:/^PN[a-z][a-z]$/.test(t)?s=`TEXT`:/^PT[a-z][a-z]$/.test(t)?s=`long`:/^PF[a-z][a-z]$/.test(t)||(t===`Rds `||t===`Thsh`)&&typeof r[t]==`number`&&r._classID===`SmrB`?s=`doub`:t===`ClSz`||t===`Rds `||t===`Amnt`?s=typeof r[t]==`number`?`long`:`UntF`:(t===`sdwM`||t===`hglM`)&&typeof r[t]==`string`||t===`blur`&&typeof r[t]==`string`?s=`enum`:t===`Hght`&&typeof r[t]==`number`&&r._classID===`Embs`||t===`Angl`&&typeof r[t]==`number`&&(r._classID===`Embs`||r._classID===`smartSharpen`||r._classID===`Twrl`||r._classID===`MtnB`)?s=`long`:t===`Angl`&&typeof r[t]==`number`?s=`doub`:t===`bounds`&&i===`slices`?(s=`Objc`,c=f(``,`Rct1`)):t===`Scl `?typeof r[t]==`object`&&`Hrzn`in r[t]?(s=`Objc`,c=p):s=typeof r[t]==`number`?`long`:`UntF`:t===`audioClipGroupList`&&a.length===1?s=`VlLs`:(t===`Strt`||t===`Brgh`)&&`H `in r?s=`doub`:t===`Wdth`&&typeof r[t]==`object`?s=`UntF`:t===`Ofst`&&typeof r[t]==`number`?s=`long`:t===`Strt`&&typeof r[t]==`object`?(s=`Objc`,c=p):_.indexOf(t)===-1?t===`profile`?s=n===`printOutput`?`TEXT`:`tdta`:t===`strokeStyleContent`?r[t][`Clr `]?c=f(``,`solidColorLayer`):r[t].Grad?c=f(``,`gradientLayer`):r[t].Ptrn?c=f(``,`patternLayer`):u&&console.log(`Invalid strokeStyleContent value`,r[t]):t===`bounds`&&i===`quiltWarp`&&(c=f(``,`classFloatRect`)):s=n===`RGBC`&&i!==`artd`?`doub`:`long`,c&&c.classID===`RGBC`&&`H `in r[t]&&(c={classID:`HSBC`,name:``}),S(e,t),(0,o.writeSignature)(e,s||`long`),D(e,s||`long`,r[t],t,c,i),u&&!s&&console.log(`Missing descriptor field type for: '${t}' in`,r)}}n.writeDescriptorStructure=w;function T(e,t,n){switch(t){case`obj `:return O(e);case`Objc`:case`GlbO`:return C(e,n);case`VlLs`:{let t=(0,a.readInt32)(e),r=[];for(let i=0;i<t;i++){let t=(0,a.readSignature)(e);r.push(T(e,t,n))}return r}case`doub`:return(0,a.readFloat64)(e);case`UntF`:{let t=(0,a.readSignature)(e),n=(0,a.readFloat64)(e);if(!c[t])throw Error(`Invalid units: ${t}`);return{units:c[t],value:n}}case`UnFl`:{let t=(0,a.readSignature)(e),n=(0,a.readFloat32)(e);if(!c[t])throw Error(`Invalid units: ${t}`);return{units:c[t],value:n}}case`TEXT`:return(0,a.readUnicodeString)(e);case`enum`:return`${x(e)}.${x(e)}`;case`long`:return(0,a.readInt32)(e);case`comp`:return{low:(0,a.readUint32)(e),high:(0,a.readUint32)(e)};case`bool`:return!!(0,a.readUint8)(e);case`type`:case`GlbC`:return A(e);case`alis`:{let t=(0,a.readInt32)(e);return(0,a.readAsciiString)(e,t)}case`tdta`:{let t=(0,a.readInt32)(e);return(0,a.readBytes)(e,t)}case`ObAr`:{(0,a.readInt32)(e),(0,a.readUnicodeString)(e),x(e);let t=(0,a.readInt32)(e),n=[];for(let r=0;r<t;r++){let t=x(e);(0,a.readSignature)(e),(0,a.readSignature)(e);let r=(0,a.readInt32)(e),i=[];for(let t=0;t<r;t++)i.push((0,a.readFloat64)(e));n.push({type:t,values:i})}return n}case`Pth `:{(0,a.readInt32)(e);let t=(0,a.readSignature)(e);(0,a.readInt32LE)(e);let n=(0,a.readInt32LE)(e);return{sig:t,path:(0,a.readUnicodeStringWithLengthLE)(e,n)}}default:throw Error(`Invalid TySh descriptor OSType: ${t} at ${e.offset.toString(16)}`)}}let E={meshPoints:`rationalPoint`,quiltSliceX:`UntF`,quiltSliceY:`UntF`};function D(e,t,n,r,i,a){switch(t){case`obj `:k(e,r,n);break;case`Objc`:case`GlbO`:if(typeof n!=`object`)throw Error(`Invalid struct value: ${JSON.stringify(n)}, key: ${r}`);if(!i)throw Error(`Missing ext type for: '${r}' (${JSON.stringify(n)})`);w(e,n._name||i.name,n._classID||i.classID,n,a);break;case`VlLs`:if(!Array.isArray(n))throw Error(`Invalid list value: ${JSON.stringify(n)}, key: ${r}`);(0,o.writeInt32)(e,n.length);for(let t=0;t<n.length;t++){let i=v[r];(0,o.writeSignature)(e,i||`long`),D(e,i||`long`,n[t],`${r}[]`,h[r],a),u&&!i&&console.log(`Missing descriptor array type for: '${r}' in`,n)}break;case`doub`:if(typeof n!=`number`)throw Error(`Invalid number value: ${JSON.stringify(n)}, key: ${r}`);(0,o.writeFloat64)(e,n);break;case`UntF`:if(!l[n.units])throw Error(`Invalid units: ${n.units} in ${r}`);(0,o.writeSignature)(e,l[n.units]),(0,o.writeFloat64)(e,n.value);break;case`UnFl`:if(!l[n.units])throw Error(`Invalid units: ${n.units} in ${r}`);(0,o.writeSignature)(e,l[n.units]),(0,o.writeFloat32)(e,n.value);break;case`TEXT`:(0,o.writeUnicodeStringWithPadding)(e,n);break;case`enum`:{if(typeof n!=`string`)throw Error(`Invalid enum value: ${JSON.stringify(n)}, key: ${r}`);let[t,i]=n.split(`.`);S(e,t),S(e,i);break}case`long`:if(typeof n!=`number`)throw Error(`Invalid integer value: ${JSON.stringify(n)}, key: ${r}`);(0,o.writeInt32)(e,n);break;case`bool`:if(typeof n!=`boolean`)throw Error(`Invalid boolean value: ${JSON.stringify(n)}, key: ${r}`);(0,o.writeUint8)(e,+!!n);break;case`tdta`:(0,o.writeInt32)(e,n.byteLength),(0,o.writeBytes)(e,n);break;case`ObAr`:{(0,o.writeInt32)(e,16),(0,o.writeUnicodeStringWithPadding)(e,``);let t=E[r];if(!t)throw Error(`Not implemented ObArType for: ${r}`);S(e,t),(0,o.writeInt32)(e,n.length);for(let t=0;t<n.length;t++){S(e,n[t].type),(0,o.writeSignature)(e,`UnFl`),(0,o.writeSignature)(e,`#Pxl`),(0,o.writeInt32)(e,n[t].values.length);for(let r=0;r<n[t].values.length;r++)(0,o.writeFloat64)(e,n[t].values[r])}break}case`Pth `:{let t=12+n.path.length*2;(0,o.writeInt32)(e,t),(0,o.writeSignature)(e,n.sig),(0,o.writeInt32LE)(e,t),(0,o.writeInt32LE)(e,n.path.length),(0,o.writeUnicodeStringWithoutLengthLE)(e,n.path);break}default:throw Error(`Not implemented descriptor OSType: ${t}`)}}function O(e){let t=(0,a.readInt32)(e),n=[];for(let r=0;r<t;r++){let t=(0,a.readSignature)(e);switch(t){case`prop`:{A(e);let t=x(e);n.push(t);break}case`Clss`:n.push(A(e));break;case`Enmr`:{A(e);let t=x(e),r=x(e);n.push(`${t}.${r}`);break}case`rele`:A(e),n.push((0,a.readUint32)(e));break;case`Idnt`:n.push((0,a.readInt32)(e));break;case`indx`:n.push((0,a.readInt32)(e));break;case`name`:A(e),n.push((0,a.readUnicodeString)(e));break;default:throw Error(`Invalid descriptor reference type: ${t}`)}}return n}function k(e,t,n){(0,o.writeInt32)(e,n.length);for(let t=0;t<n.length;t++){let r=n[t],i=`unknown`;switch(typeof r==`string`&&(i=/^[a-z ]+\.[a-z ]+$/i.test(r)?`Enmr`:`name`),(0,o.writeSignature)(e,i),i){case`Enmr`:{let[t,n]=r.split(`.`);j(e,`\0`,t),S(e,t),S(e,n);break}case`name`:j(e,`\0`,`Lyr `),(0,o.writeUnicodeString)(e,r+`\0`);break;default:throw Error(`Invalid descriptor reference type: ${i}`)}}return n}function A(e){return{name:(0,a.readUnicodeString)(e),classID:x(e)}}function j(e,t,n){(0,o.writeUnicodeString)(e,t),S(e,n)}function M(e,t=!1){let n=(0,a.readUint32)(e);if(n!==16)throw Error(`Invalid descriptor version: ${n}`);return C(e,t)}n.readVersionAndDescriptor=M;function N(e,t,n,r,i=``){(0,o.writeUint32)(e,16),w(e,t,n,r,i)}n.writeVersionAndDescriptor=N;function P(e){return{x:e.Hrzn,y:e.Vrtc}}n.horzVrtcToXY=P;function F(e){return{Hrzn:e.x,Vrtc:e.y}}n.xyToHorzVrtc=F;function I(e){return{top:de(e[`Top `]),left:de(e.Left),right:de(e.Rght),bottom:de(e.Btom)}}n.descBoundsToBounds=I;function L(e){return{Left:Q(e.left,`bounds.left`),"Top ":Q(e.top,`bounds.top`),Rght:Q(e.right,`bounds.right`),Btom:Q(e.bottom,`bounds.bottom`)}}n.boundsToDescBounds=L;function R(e){let t={enabled:!!e.enab,position:n.FStl.decode(e.Styl),fillType:n.FrFl.decode(e.PntT),blendMode:n.BlnM.decode(e[`Md `]),opacity:Y(e.Opct),size:de(e[`Sz `])};return e.present!==void 0&&(t.present=e.present),e.showInDialog!==void 0&&(t.showInDialog=e.showInDialog),e.overprint!==void 0&&(t.overprint=e.overprint),e[`Clr `]&&(t.color=K(e[`Clr `])),e.Grad&&(t.gradient=U(e)),e.Ptrn&&(t.pattern=W(e)),t}function ee(e){let t={};return t.enab=!!e.enabled,e.present!==void 0&&(t.present=!!e.present),e.showInDialog!==void 0&&(t.showInDialog=!!e.showInDialog),t.Styl=n.FStl.encode(e.position),t.PntT=n.FrFl.encode(e.fillType),t[`Md `]=n.BlnM.encode(e.blendMode),t.Opct=pe(e.opacity),t[`Sz `]=Q(e.size,`size`),e.color&&(t[`Clr `]=q(e.color)),e.gradient&&(t=Object.assign(Object.assign({},t),ce(e.gradient))),e.pattern&&(t=Object.assign(Object.assign({},t),G(e.pattern))),e.overprint!==void 0&&(t.overprint=!!e.overprint),t}function te(e,t,n){let r=n?{"Scl ":me(e.scale??1),masterFXSwitch:!e.disabled}:{masterFXSwitch:!e.disabled,"Scl ":me(e.scale??1)};for(let t of[`dropShadow`,`innerShadow`,`solidFill`,`gradientOverlay`,`stroke`])if(e[t]&&!Array.isArray(e[t]))throw Error(`${t} should be an array`);let i=e=>!!e&&e.length>1&&n,a=e=>!!e&&e.length>=1&&(!n||e.length===1);if(a(e.dropShadow)&&(r.DrSh=H(e.dropShadow[0],`dropShadow`,t)),i(e.dropShadow)&&(r.dropShadowMulti=e.dropShadow.map(e=>H(e,`dropShadow`,t))),a(e.innerShadow)&&(r.IrSh=H(e.innerShadow[0],`innerShadow`,t)),i(e.innerShadow)&&(r.innerShadowMulti=e.innerShadow.map(e=>H(e,`innerShadow`,t))),e.outerGlow&&(r.OrGl=H(e.outerGlow,`outerGlow`,t)),i(e.solidFill)&&(r.solidFillMulti=e.solidFill.map(e=>H(e,`solidFill`,t))),i(e.gradientOverlay)&&(r.gradientFillMulti=e.gradientOverlay.map(e=>H(e,`gradientOverlay`,t))),i(e.stroke)&&(r.frameFXMulti=e.stroke.map(e=>ee(e))),e.innerGlow&&(r.IrGl=H(e.innerGlow,`innerGlow`,t)),e.bevel&&(r.ebbl=H(e.bevel,`bevel`,t)),a(e.solidFill)&&(r.SoFi=H(e.solidFill[0],`solidFill`,t)),e.patternOverlay&&(r.patternFill=H(e.patternOverlay,`patternOverlay`,t)),a(e.gradientOverlay)&&(r.GrFl=H(e.gradientOverlay[0],`gradientOverlay`,t)),e.satin&&(r.ChFX=H(e.satin,`satin`,t)),a(e.stroke)&&(r.FrFX=ee(e.stroke?.[0])),n){r.numModifyingFX=0;for(let t of Object.keys(e)){let n=e[t];if(Array.isArray(n))for(let e of n)e.enabled&&r.numModifyingFX++;else n.enabled&&r.numModifyingFX++}}return r}n.serializeEffects=te;function z(e,t){let n={},{masterFXSwitch:i,DrSh:a,dropShadowMulti:o,IrSh:s,innerShadowMulti:c,OrGl:l,IrGl:u,ebbl:d,SoFi:f,solidFillMulti:p,patternFill:m,GrFl:h,gradientFillMulti:g,ChFX:_,FrFX:v,frameFXMulti:y,numModifyingFX:b}=e,x=r(e,[`masterFXSwitch`,`DrSh`,`dropShadowMulti`,`IrSh`,`innerShadowMulti`,`OrGl`,`IrGl`,`ebbl`,`SoFi`,`solidFillMulti`,`patternFill`,`GrFl`,`gradientFillMulti`,`ChFX`,`FrFX`,`frameFXMulti`,`numModifyingFX`]);return i||(n.disabled=!0),e[`Scl `]&&(n.scale=Y(e[`Scl `])),a&&(n.dropShadow=[V(a,t)]),o&&(n.dropShadow=o.map(e=>V(e,t))),s&&(n.innerShadow=[V(s,t)]),c&&(n.innerShadow=c.map(e=>V(e,t))),l&&(n.outerGlow=V(l,t)),u&&(n.innerGlow=V(u,t)),d&&(n.bevel=V(d,t)),f&&(n.solidFill=[V(f,t)]),p&&(n.solidFill=p.map(e=>V(e,t))),m&&(n.patternOverlay=V(m,t)),h&&(n.gradientOverlay=[V(h,t)]),g&&(n.gradientOverlay=g.map(e=>V(e,t))),_&&(n.satin=V(_,t)),v&&(n.stroke=[R(v)]),y&&(n.stroke=y.map(e=>R(e))),t&&Object.keys(x).length>1&&console.log(`Unhandled effect keys:`,x),n}n.parseEffects=z;function B(e,t){let r=[];for(let i=0;i<e.length;i++){let a=e[i],{time:{denominator:o,numerator:s},selected:c,animKey:l}=a,u={numerator:s,denominator:o},d=n.animInterpStyleEnum.decode(a.animInterpStyle);switch(l.Type){case`keyType.Opct`:r.push({interpolation:d,time:u,selected:c,type:`opacity`,value:Y(l.Opct)});break;case`keyType.Pstn`:r.push({interpolation:d,time:u,selected:c,type:`position`,x:l.Hrzn,y:l.Vrtc});break;case`keyType.Trnf`:r.push({interpolation:d,time:u,selected:c,type:`transform`,scale:P(l[`Scl `]),skew:P(l.Skew),rotation:l.rotation,translation:P(l.translation)});break;case`keyType.sheetStyle`:{let e={interpolation:d,time:u,selected:c,type:`style`};l.sheetStyle.Lefx&&(e.style=z(l.sheetStyle.Lefx,t)),r.push(e);break}case`keyType.globalLighting`:r.push({interpolation:d,time:u,selected:c,type:`globalLighting`,globalAngle:l.gblA,globalAltitude:l.globalAltitude});break;default:throw Error(`Unsupported keyType value`)}}return r}function ne(e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],{time:a,selected:o=!1,interpolation:s}=i,c=n.animInterpStyleEnum.encode(s),l;switch(i.type){case`opacity`:l={Type:`keyType.Opct`,Opct:pe(i.value)};break;case`position`:l={Type:`keyType.Pstn`,Hrzn:i.x,Vrtc:i.y};break;case`transform`:l={Type:`keyType.Trnf`,"Scl ":F(i.scale),Skew:F(i.skew),rotation:i.rotation,translation:F(i.translation)};break;case`style`:l={Type:`keyType.sheetStyle`,sheetStyle:{Vrsn:1,blendOptions:{}}},i.style&&(l.sheetStyle={Vrsn:1,Lefx:te(i.style,!1,!1),blendOptions:{}});break;case`globalLighting`:l={Type:`keyType.globalLighting`,gblA:i.globalAngle,globalAltitude:i.globalAltitude};break;default:throw Error(`Unsupported keyType value`)}t.push({Vrsn:1,animInterpStyle:c,time:a,animKey:l,selected:o})}return t}function re(e,t){let r=[];for(let i=0;i<e.length;i++){let a=e[i],o={type:n.stdTrackID.decode(a.trackID),enabled:a.enab,keys:B(a.keyList,t)};a.effectParams&&(o.effectParams={fillCanvas:a.effectParams.fillCanvas,zoomOrigin:a.effectParams.zoomOrigin,keys:B(a.effectParams.keyList,t)}),r.push(o)}return r}n.parseTrackList=re;function ie(e){let t=[];for(let r=0;r<e.length;r++){let i=e[r];t.push(Object.assign(Object.assign({trackID:n.stdTrackID.encode(i.type),Vrsn:1,enab:!!i.enabled,Effc:!!i.effectParams},i.effectParams?{effectParams:{keyList:ne(i.keys),fillCanvas:i.effectParams.fillCanvas,zoomOrigin:i.effectParams.zoomOrigin}}:{}),{keyList:ne(i.keys)}))}return t}n.serializeTrackList=ie;function V(e,t){let r={};for(let i of Object.keys(e)){let a=e[i];switch(i){case`enab`:r.enabled=!!a;break;case`uglg`:r.useGlobalLight=!!a;break;case`AntA`:r.antialiased=!!a;break;case`Algn`:r.align=!!a;break;case`Dthr`:r.dither=!!a;break;case`Invr`:r.invert=!!a;break;case`Rvrs`:r.reverse=!!a;break;case`Clr `:r.color=K(a);break;case`hglC`:r.highlightColor=K(a);break;case`sdwC`:r.shadowColor=K(a);break;case`Styl`:r.position=n.FStl.decode(a);break;case`Md `:r.blendMode=n.BlnM.decode(a);break;case`hglM`:r.highlightBlendMode=n.BlnM.decode(a);break;case`sdwM`:r.shadowBlendMode=n.BlnM.decode(a);break;case`bvlS`:r.style=n.BESl.decode(a);break;case`bvlD`:r.direction=n.BESs.decode(a);break;case`bvlT`:r.technique=n.bvlT.decode(a);break;case`GlwT`:r.technique=n.BETE.decode(a);break;case`glwS`:r.source=n.IGSr.decode(a);break;case`Type`:r.type=n.GrdT.decode(a);break;case`gs99`:r.interpolationMethod=n.gradientInterpolationMethodType.decode(a);break;case`Opct`:r.opacity=Y(a);break;case`hglO`:r.highlightOpacity=Y(a);break;case`sdwO`:r.shadowOpacity=Y(a);break;case`lagl`:r.angle=J(a);break;case`Angl`:r.angle=J(a);break;case`Lald`:r.altitude=J(a);break;case`Sftn`:r.soften=de(a);break;case`srgR`:r.strength=Y(a);break;case`blur`:r.size=de(a);break;case`Nose`:r.noise=Y(a);break;case`Inpr`:r.range=Y(a);break;case`Ckmt`:r.choke=de(a);break;case`ShdN`:r.jitter=Y(a);break;case`Dstn`:r.distance=de(a);break;case`Scl `:r.scale=Y(a);break;case`Ptrn`:r.pattern={name:a[`Nm `],id:a.Idnt};break;case`phase`:r.phase={x:a.Hrzn,y:a.Vrtc};break;case`Ofst`:r.offset={x:Y(a.Hrzn),y:Y(a.Vrtc)};break;case`MpgS`:case`TrnS`:r.contour={name:a[`Nm `],curve:a[`Crv `].map(e=>({x:e.Hrzn,y:e.Vrtc}))};break;case`Grad`:r.gradient=ae(a);break;case`useTexture`:case`useShape`:case`layerConceals`:case`present`:case`showInDialog`:case`antialiasGloss`:r[i]=a;break;case`_name`:case`_classID`:break;default:t&&console.log(`Invalid effect key: '${i}', value:`,a)}}return r}function H(e,t,r){let i={enab:!1};t===`dropShadow`&&(i.TrnS={"Nm ":``,"Crv ":[]});for(let a of Object.keys(e)){let o=a,s=e[o];switch(o){case`enabled`:i.enab=!!s;break;case`useGlobalLight`:i.uglg=!!s;break;case`antialiased`:i.AntA=!!s;break;case`align`:i.Algn=!!s;break;case`dither`:i.Dthr=!!s;break;case`invert`:i.Invr=!!s;break;case`reverse`:i.Rvrs=!!s;break;case`color`:i[`Clr `]=q(s);break;case`highlightColor`:i.hglC=q(s);break;case`shadowColor`:i.sdwC=q(s);break;case`position`:i.Styl=n.FStl.encode(s);break;case`blendMode`:i[`Md `]=n.BlnM.encode(s);break;case`highlightBlendMode`:i.hglM=n.BlnM.encode(s);break;case`shadowBlendMode`:i.sdwM=n.BlnM.encode(s);break;case`style`:i.bvlS=n.BESl.encode(s);break;case`direction`:i.bvlD=n.BESs.encode(s);break;case`technique`:t===`bevel`?i.bvlT=n.bvlT.encode(s):i.GlwT=n.BETE.encode(s);break;case`source`:i.glwS=n.IGSr.encode(s);break;case`type`:i.Type=n.GrdT.encode(s);break;case`interpolationMethod`:i.gs99=n.gradientInterpolationMethodType.encode(s);break;case`opacity`:i.Opct=pe(s);break;case`highlightOpacity`:i.hglO=pe(s);break;case`shadowOpacity`:i.sdwO=pe(s);break;case`angle`:t===`gradientOverlay`||t===`patternFill`?i.Angl=Z(s):i.lagl=Z(s);break;case`altitude`:i.Lald=Z(s);break;case`soften`:i.Sftn=Q(s,o);break;case`strength`:i.srgR=pe(s);break;case`size`:i.blur=Q(s,o);break;case`noise`:i.Nose=pe(s);break;case`range`:i.Inpr=pe(s);break;case`choke`:i.Ckmt=Q(s,o);break;case`jitter`:i.ShdN=pe(s);break;case`distance`:i.Dstn=Q(s,o);break;case`scale`:i[`Scl `]=pe(s);break;case`pattern`:i.Ptrn={"Nm ":s.name,Idnt:s.id};break;case`phase`:i.phase={Hrzn:s.x,Vrtc:s.y};break;case`offset`:i.Ofst={Hrzn:pe(s.x),Vrtc:pe(s.y)};break;case`contour`:i[t===`satin`?`MpgS`:`TrnS`]={"Nm ":s.name,"Crv ":s.curve.map(e=>({Hrzn:e.x,Vrtc:e.y}))};break;case`gradient`:i.Grad=oe(s);break;case`useTexture`:case`useShape`:case`layerConceals`:case`present`:case`showInDialog`:case`antialiasGloss`:i[o]=s;break;default:r&&console.log(`Invalid effect key: '${o}', value:`,s)}}return i}function ae(e){if(e.GrdF===`GrdF.CstS`){let t=e.Intr||4096;return{type:`solid`,name:e[`Nm `],smoothness:e.Intr/4096,colorStops:e.Clrs.map(e=>({color:K(e[`Clr `]),location:e.Lctn/t,midpoint:e.Mdpn/100})),opacityStops:e.Trns.map(e=>({opacity:Y(e.Opct),location:e.Lctn/t,midpoint:e.Mdpn/100}))}}return{type:`noise`,name:e[`Nm `],roughness:e.Smth/4096,colorModel:n.ClrS.decode(e.ClrS),randomSeed:e.RndS,restrictColors:!!e.VctC,addTransparency:!!e.ShTr,min:e[`Mnm `].map(e=>e/100),max:e[`Mxm `].map(e=>e/100)}}function oe(e){if(e.type===`solid`){let t=Math.round((e.smoothness??1)*4096);return{"Nm ":e.name||``,GrdF:`GrdF.CstS`,Intr:t,Clrs:e.colorStops.map(e=>({"Clr ":q(e.color),Type:`Clry.UsrS`,Lctn:Math.round(e.location*t),Mdpn:Math.round((e.midpoint??.5)*100)})),Trns:e.opacityStops.map(e=>({Opct:pe(e.opacity),Lctn:Math.round(e.location*t),Mdpn:Math.round((e.midpoint??.5)*100)}))}}return{GrdF:`GrdF.ClNs`,"Nm ":e.name||``,ShTr:!!e.addTransparency,VctC:!!e.restrictColors,ClrS:n.ClrS.encode(e.colorModel),RndS:e.randomSeed||0,Smth:Math.round((e.roughness??1)*4096),"Mnm ":(e.min||[0,0,0,0]).map(e=>e*100),"Mxm ":(e.max||[1,1,1,1]).map(e=>e*100)}}function U(e){let t=ae(e.Grad);return t.style=n.GrdT.decode(e.Type),e.Dthr!==void 0&&(t.dither=e.Dthr),e.gradientsInterpolationMethod!==void 0&&(t.interpolationMethod=n.gradientInterpolationMethodType.decode(e.gradientsInterpolationMethod)),e.Rvrs!==void 0&&(t.reverse=e.Rvrs),e.Angl!==void 0&&(t.angle=J(e.Angl)),e[`Scl `]!==void 0&&(t.scale=Y(e[`Scl `])),e.Algn!==void 0&&(t.align=e.Algn),e.Ofst!==void 0&&(t.offset={x:Y(e.Ofst.Hrzn),y:Y(e.Ofst.Vrtc)}),t}function W(e){let t={name:e.Ptrn[`Nm `],id:e.Ptrn.Idnt};return e.Lnkd!==void 0&&(t.linked=e.Lnkd),e.phase!==void 0&&(t.phase={x:e.phase.Hrzn,y:e.phase.Vrtc}),t}function se(e){if(`Grad`in e)return U(e);if(`Ptrn`in e)return Object.assign({type:`pattern`},W(e));if(`Clr `in e)return{type:`color`,color:K(e[`Clr `])};throw Error(`Invalid vector content`)}n.parseVectorContent=se;function ce(e){let t={};return e.dither!==void 0&&(t.Dthr=e.dither),e.interpolationMethod!==void 0&&(t.gradientsInterpolationMethod=n.gradientInterpolationMethodType.encode(e.interpolationMethod)),e.reverse!==void 0&&(t.Rvrs=e.reverse),e.angle!==void 0&&(t.Angl=Z(e.angle)),t.Type=n.GrdT.encode(e.style),e.align!==void 0&&(t.Algn=e.align),e.scale!==void 0&&(t[`Scl `]=pe(e.scale)),e.offset&&(t.Ofst={Hrzn:pe(e.offset.x),Vrtc:pe(e.offset.y)}),t.Grad=oe(e),t}function G(e){let t={Ptrn:{"Nm ":e.name||``,Idnt:e.id||``}};return e.linked!==void 0&&(t.Lnkd=!!e.linked),e.phase!==void 0&&(t.phase={Hrzn:e.phase.x,Vrtc:e.phase.y}),t}function le(e){return e.type===`color`?{key:`SoCo`,descriptor:{"Clr ":q(e.color)}}:e.type===`pattern`?{key:`PtFl`,descriptor:G(e)}:{key:`GdFl`,descriptor:ce(e)}}n.serializeVectorContent=le;function K(e){if(`H `in e)return{h:ue(e[`H `]),s:e.Strt,b:e.Brgh};if(`Rd `in e)return{r:e[`Rd `],g:e[`Grn `],b:e[`Bl `]};if(`Cyn `in e)return{c:e[`Cyn `],m:e.Mgnt,y:e[`Ylw `],k:e.Blck};if(`Gry `in e)return{k:e[`Gry `]};if(`Lmnc`in e)return{l:e.Lmnc,a:e[`A `],b:e[`B `]};if(`redFloat`in e)return{fr:e.redFloat,fg:e.greenFloat,fb:e.blueFloat};throw Error(`Unsupported color descriptor`)}n.parseColor=K;function q(e){if(!e)return{_name:``,_classID:`RGBC`,"Rd ":0,"Grn ":0,"Bl ":0};if(`r`in e)return{_name:``,_classID:`RGBC`,"Rd ":e.r||0,"Grn ":e.g||0,"Bl ":e.b||0};if(`fr`in e)return{_name:``,_classID:`RGBC`,redFloat:e.fr,greenFloat:e.fg,blueFloat:e.fb};if(`h`in e)return{_name:``,_classID:`HSBC`,"H ":Z(e.h*360),Strt:e.s||0,Brgh:e.b||0};if(`c`in e)return{_name:``,_classID:`CMYC`,"Cyn ":e.c||0,Mgnt:e.m||0,"Ylw ":e.y||0,Blck:e.k||0};if(`l`in e)return{_name:``,_classID:`LABC`,Lmnc:e.l||0,"A ":e.a||0,"B ":e.b||0};if(`k`in e)return{_name:``,_classID:`GRYC`,"Gry ":e.k};throw Error(`Invalid color value`)}n.serializeColor=q;function J(e){if(e===void 0)return 0;if(e.units!==`Angle`)throw Error(`Invalid units: ${e.units}`);return e.value}n.parseAngle=J;function Y(e){if(e===void 0)return 1;if(e.units!==`Percent`)throw Error(`Invalid units: ${e.units}`);return e.value/100}n.parsePercent=Y;function ue(e){if(e===void 0)return 1;if(e.units===`Percent`)return e.value/100;if(e.units===`Angle`)return e.value/360;throw Error(`Invalid units: ${e.units}`)}n.parsePercentOrAngle=ue;function de({units:e,value:t}){if(e!==`Pixels`&&e!==`Millimeters`&&e!==`Points`&&e!==`None`&&e!==`Picas`&&e!==`Inches`&&e!==`Centimeters`&&e!==`Density`)throw Error(`Invalid units: ${JSON.stringify({units:e,value:t})}`);return{value:t,units:e}}n.parseUnits=de;function fe(e,t=`Pixels`){return typeof e==`number`?{value:e,units:t}:de(e)}n.parseUnitsOrNumber=fe;function X({units:e,value:t},n){if(e!==n)throw Error(`Invalid units: ${JSON.stringify({units:e,value:t})}`);return t}n.parseUnitsToNumber=X;function Z(e){return{units:`Angle`,value:e||0}}n.unitsAngle=Z;function pe(e){return{units:`Percent`,value:Math.round((e||0)*100)}}n.unitsPercent=pe;function me(e){return{units:`Percent`,value:(e||0)*100}}n.unitsPercentF=me;function Q(e,t){if(e==null)return{units:`Pixels`,value:0};if(typeof e!=`object`)throw Error(`Invalid value: ${JSON.stringify(e)} (key: ${t}) (should have value and units)`);let{units:n,value:r}=e;if(typeof r!=`number`)throw Error(`Invalid value in ${JSON.stringify(e)} (key: ${t})`);if(n!==`Pixels`&&n!==`Millimeters`&&n!==`Points`&&n!==`None`&&n!==`Picas`&&n!==`Inches`&&n!==`Centimeters`&&n!==`Density`)throw Error(`Invalid units in ${JSON.stringify(e)} (key: ${t})`);return{units:n,value:r}}n.unitsValue=Q;function $({numerator:e,denominator:t}){return{numerator:e,denominator:t}}n.frac=$,n.textGridding=(0,i.createEnum)(`textGridding`,`none`,{none:`None`,round:`Rnd `}),n.Ornt=(0,i.createEnum)(`Ornt`,`horizontal`,{horizontal:`Hrzn`,vertical:`Vrtc`}),n.Annt=(0,i.createEnum)(`Annt`,`sharp`,{none:`Anno`,sharp:`antiAliasSharp`,crisp:`AnCr`,strong:`AnSt`,smooth:`AnSm`,platform:`antiAliasPlatformGray`,platformLCD:`antiAliasPlatformLCD`}),n.warpStyle=(0,i.createEnum)(`warpStyle`,`none`,{none:`warpNone`,arc:`warpArc`,arcLower:`warpArcLower`,arcUpper:`warpArcUpper`,arch:`warpArch`,bulge:`warpBulge`,shellLower:`warpShellLower`,shellUpper:`warpShellUpper`,flag:`warpFlag`,wave:`warpWave`,fish:`warpFish`,rise:`warpRise`,fisheye:`warpFisheye`,inflate:`warpInflate`,squeeze:`warpSqueeze`,twist:`warpTwist`,cylinder:`warpCylinder`,custom:`warpCustom`}),n.BlnM=(0,i.createEnum)(`BlnM`,`normal`,{normal:`Nrml`,dissolve:`Dslv`,darken:`Drkn`,multiply:`Mltp`,"color burn":`CBrn`,"linear burn":`linearBurn`,"darker color":`darkerColor`,lighten:`Lghn`,screen:`Scrn`,"color dodge":`CDdg`,"linear dodge":`linearDodge`,"lighter color":`lighterColor`,overlay:`Ovrl`,"soft light":`SftL`,"hard light":`HrdL`,"vivid light":`vividLight`,"linear light":`linearLight`,"pin light":`pinLight`,"hard mix":`hardMix`,difference:`Dfrn`,exclusion:`Xclu`,subtract:`blendSubtraction`,divide:`blendDivide`,hue:`H `,saturation:`Strt`,color:`Clr `,luminosity:`Lmns`,"linear height":`linearHeight`,height:`Hght`,subtraction:`Sbtr`}),n.BESl=(0,i.createEnum)(`BESl`,`inner bevel`,{"inner bevel":`InrB`,"outer bevel":`OtrB`,emboss:`Embs`,"pillow emboss":`PlEb`,"stroke emboss":`strokeEmboss`}),n.bvlT=(0,i.createEnum)(`bvlT`,`smooth`,{smooth:`SfBL`,"chisel hard":`PrBL`,"chisel soft":`Slmt`}),n.BESs=(0,i.createEnum)(`BESs`,`up`,{up:`In `,down:`Out `}),n.BETE=(0,i.createEnum)(`BETE`,`softer`,{softer:`SfBL`,precise:`PrBL`}),n.IGSr=(0,i.createEnum)(`IGSr`,`edge`,{edge:`SrcE`,center:`SrcC`}),n.GrdT=(0,i.createEnum)(`GrdT`,`linear`,{linear:`Lnr `,radial:`Rdl `,angle:`Angl`,reflected:`Rflc`,diamond:`Dmnd`}),n.animInterpStyleEnum=(0,i.createEnum)(`animInterpStyle`,`linear`,{linear:`Lnr `,hold:`hold`}),n.stdTrackID=(0,i.createEnum)(`stdTrackID`,`opacity`,{opacity:`opacityTrack`,style:`styleTrack`,sheetTransform:`sheetTransformTrack`,sheetPosition:`sheetPositionTrack`,globalLighting:`globalLightingTrack`}),n.gradientInterpolationMethodType=(0,i.createEnum)(`gradientInterpolationMethodType`,`perceptual`,{perceptual:`Perc`,linear:`Lnr `,classic:`Gcls`,smooth:`Smoo`}),n.ClrS=(0,i.createEnum)(`ClrS`,`rgb`,{rgb:`RGBC`,hsb:`HSBl`,lab:`LbCl`,hsl:`HSLC`}),n.FStl=(0,i.createEnum)(`FStl`,`outside`,{outside:`OutF`,center:`CtrF`,inside:`InsF`}),n.FrFl=(0,i.createEnum)(`FrFl`,`color`,{color:`SClr`,gradient:`GrFl`,pattern:`Ptrn`}),n.ESliceType=(0,i.createEnum)(`ESliceType`,`image`,{image:`Img `,noImage:`noImage`}),n.ESliceHorzAlign=(0,i.createEnum)(`ESliceHorzAlign`,`default`,{default:`default`}),n.ESliceVertAlign=(0,i.createEnum)(`ESliceVertAlign`,`default`,{default:`default`}),n.ESliceOrigin=(0,i.createEnum)(`ESliceOrigin`,`userGenerated`,{userGenerated:`userGenerated`,autoGenerated:`autoGenerated`,layer:`layer`}),n.ESliceBGColorType=(0,i.createEnum)(`ESliceBGColorType`,`none`,{none:`None`,matte:`matte`,color:`Clr `}),n.strokeStyleLineCapType=(0,i.createEnum)(`strokeStyleLineCapType`,`butt`,{butt:`strokeStyleButtCap`,round:`strokeStyleRoundCap`,square:`strokeStyleSquareCap`}),n.strokeStyleLineJoinType=(0,i.createEnum)(`strokeStyleLineJoinType`,`miter`,{miter:`strokeStyleMiterJoin`,round:`strokeStyleRoundJoin`,bevel:`strokeStyleBevelJoin`}),n.strokeStyleLineAlignment=(0,i.createEnum)(`strokeStyleLineAlignment`,`inside`,{inside:`strokeStyleAlignInside`,center:`strokeStyleAlignCenter`,outside:`strokeStyleAlignOutside`}),n.BlrM=(0,i.createEnum)(`BlrM`,`ispinmage`,{spin:`Spn `,zoom:`Zm `}),n.BlrQ=(0,i.createEnum)(`BlrQ`,`good`,{draft:`Drft`,good:`Gd `,best:`Bst `}),n.SmBM=(0,i.createEnum)(`SmBM`,`normal`,{normal:`SBMN`,"edge only":`SBME`,"overlay edge":`SBMO`}),n.SmBQ=(0,i.createEnum)(`SmBQ`,`medium`,{low:`SBQL`,medium:`SBQM`,high:`SBQH`}),n.DspM=(0,i.createEnum)(`DspM`,`stretch to fit`,{"stretch to fit":`StrF`,tile:`Tile`}),n.UndA=(0,i.createEnum)(`UndA`,`repeat edge pixels`,{"wrap around":`WrpA`,"repeat edge pixels":`RptE`}),n.Cnvr=(0,i.createEnum)(`Cnvr`,`rectangular to polar`,{"rectangular to polar":`RctP`,"polar to rectangular":`PlrR`}),n.RplS=(0,i.createEnum)(`RplS`,`medium`,{small:`Sml `,medium:`Mdm `,large:`Lrg `}),n.SphM=(0,i.createEnum)(`SphM`,`normal`,{normal:`Nrml`,"horizontal only":`HrzO`,"vertical only":`VrtO`}),n.Wvtp=(0,i.createEnum)(`Wvtp`,`sine`,{sine:`WvSn`,triangle:`WvTr`,square:`WvSq`}),n.ZZTy=(0,i.createEnum)(`ZZTy`,`pond ripples`,{"around center":`ArnC`,"out from center":`OtFr`,"pond ripples":`PndR`}),n.Dstr=(0,i.createEnum)(`Dstr`,`uniform`,{uniform:`Unfr`,gaussian:`Gsn `}),n.Chnl=(0,i.createEnum)(`Chnl`,`composite`,{red:`Rd `,green:`Grn `,blue:`Bl `,composite:`Cmps`}),n.MztT=(0,i.createEnum)(`MztT`,`fine dots`,{"fine dots":`FnDt`,"medium dots":`MdmD`,"grainy dots":`GrnD`,"coarse dots":`CrsD`,"short lines":`ShrL`,"medium lines":`MdmL`,"long lines":`LngL`,"short strokes":`ShSt`,"medium strokes":`MdmS`,"long strokes":`LngS`}),n.Lns=(0,i.createEnum)(`Lns `,`50-300mm zoom`,{"50-300mm zoom":`Zm `,"32mm prime":`Nkn `,"105mm prime":`Nkn1`,"movie prime":`PnVs`}),n.blurType=(0,i.createEnum)(`blurType`,`gaussian blur`,{"gaussian blur":`GsnB`,"lens blur":`lensBlur`,"motion blur":`MtnB`}),n.DfsM=(0,i.createEnum)(`DfsM`,`normal`,{normal:`Nrml`,"darken only":`DrkO`,"lighten only":`LghO`,anisotropic:`anisotropic`}),n.ExtT=(0,i.createEnum)(`ExtT`,`blocks`,{blocks:`Blks`,pyramids:`Pyrm`}),n.ExtR=(0,i.createEnum)(`ExtR`,`random`,{random:`Rndm`,"level-based":`LvlB`}),n.FlCl=(0,i.createEnum)(`FlCl`,`background color`,{"background color":`FlBc`,"foreground color":`FlFr`,"inverse image":`FlIn`,"unaltered image":`FlSm`}),n.CntE=(0,i.createEnum)(`CntE`,`upper`,{lower:`Lwr `,upper:`Upr `}),n.WndM=(0,i.createEnum)(`WndM`,`wind`,{wind:`Wnd `,blast:`Blst`,stagger:`Stgr`}),n.Drct=(0,i.createEnum)(`Drct`,`from the right`,{left:`Left`,right:`Rght`}),n.IntE=(0,i.createEnum)(`IntE`,`odd lines`,{"odd lines":`ElmO`,"even lines":`ElmE`}),n.IntC=(0,i.createEnum)(`IntC`,`interpolation`,{duplication:`CrtD`,interpolation:`CrtI`}),n.FlMd=(0,i.createEnum)(`FlMd`,`wrap around`,{"set to transparent":`Bckg`,"repeat edge pixels":`Rpt `,"wrap around":`Wrp `}),n.prjM=(0,i.createEnum)(`prjM`,`fisheye`,{fisheye:`fisP`,perspective:`perP`,auto:`auto`,"full spherical":`fusP`}),n.presetKindType=(0,i.createEnum)(`presetKindType`,`presetKindCustom`,{custom:`presetKindCustom`,default:`presetKindDefault`})},{"./helpers":8,"./psdReader":13,"./psdWriter":14}],5:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.writeEffects=n.readEffects=void 0;let r=e("./helpers"),i=e("./psdReader"),a=e("./psdWriter"),o=[void 0,`outer bevel`,`inner bevel`,`emboss`,`pillow emboss`,`stroke emboss`];function s(e){return(0,i.checkSignature)(e,`8BIM`),r.toBlendMode[(0,i.readSignature)(e)]||`normal`}function c(e,t){(0,a.writeSignature)(e,`8BIM`),(0,a.writeSignature)(e,r.fromBlendMode[t]||`norm`)}function l(e){return(0,i.readUint8)(e)/255}function u(e,t){(0,a.writeUint8)(e,Math.round(t*255)|0)}function d(e){let t=(0,i.readUint16)(e);if(t!==0)throw Error(`Invalid effects layer version: ${t}`);let n=(0,i.readUint16)(e),r={};for(let t=0;t<n;t++){(0,i.checkSignature)(e,`8BIM`);let t=(0,i.readSignature)(e);switch(t){case`cmnS`:{let t=(0,i.readUint32)(e),n=(0,i.readUint32)(e),r=!!(0,i.readUint8)(e);if((0,i.skipBytes)(e,2),t!==7||n!==0||!r)throw Error(`Invalid effects common state`);break}case`dsdw`:case`isdw`:{let n=(0,i.readUint32)(e),a=(0,i.readUint32)(e);if(n!==41&&n!==51)throw Error(`Invalid shadow size: ${n}`);if(a!==0&&a!==2)throw Error(`Invalid shadow version: ${a}`);let o=(0,i.readFixedPoint32)(e);(0,i.readFixedPoint32)(e);let c=(0,i.readFixedPoint32)(e),u=(0,i.readFixedPoint32)(e),d=(0,i.readColor)(e),f=s(e),p=!!(0,i.readUint8)(e),m=!!(0,i.readUint8)(e),h=l(e);n>=51&&(0,i.readColor)(e);let g={size:{units:`Pixels`,value:o},distance:{units:`Pixels`,value:u},angle:c,color:d,blendMode:f,enabled:p,useGlobalLight:m,opacity:h};t===`dsdw`?r.dropShadow=[g]:r.innerShadow=[g];break}case`oglw`:{let t=(0,i.readUint32)(e),n=(0,i.readUint32)(e);if(t!==32&&t!==42)throw Error(`Invalid outer glow size: ${t}`);if(n!==0&&n!==2)throw Error(`Invalid outer glow version: ${n}`);let a=(0,i.readFixedPoint32)(e);(0,i.readFixedPoint32)(e);let o=(0,i.readColor)(e),c=s(e),u=!!(0,i.readUint8)(e),d=l(e);t>=42&&(0,i.readColor)(e),r.outerGlow={size:{units:`Pixels`,value:a},color:o,blendMode:c,enabled:u,opacity:d};break}case`iglw`:{let t=(0,i.readUint32)(e),n=(0,i.readUint32)(e);if(t!==32&&t!==43)throw Error(`Invalid inner glow size: ${t}`);if(n!==0&&n!==2)throw Error(`Invalid inner glow version: ${n}`);let a=(0,i.readFixedPoint32)(e);(0,i.readFixedPoint32)(e);let o=(0,i.readColor)(e),c=s(e),u=!!(0,i.readUint8)(e),d=l(e);t>=43&&((0,i.readUint8)(e),(0,i.readColor)(e)),r.innerGlow={size:{units:`Pixels`,value:a},color:o,blendMode:c,enabled:u,opacity:d};break}case`bevl`:{let t=(0,i.readUint32)(e),n=(0,i.readUint32)(e);if(t!==58&&t!==78)throw Error(`Invalid bevel size: ${t}`);if(n!==0&&n!==2)throw Error(`Invalid bevel version: ${n}`);let a=(0,i.readFixedPoint32)(e),c=(0,i.readFixedPoint32)(e),u=(0,i.readFixedPoint32)(e),d=s(e),f=s(e),p=(0,i.readColor)(e),m=(0,i.readColor)(e),h=o[(0,i.readUint8)(e)]||`inner bevel`,g=l(e),_=l(e),v=!!(0,i.readUint8)(e),y=!!(0,i.readUint8)(e),b=(0,i.readUint8)(e)?`down`:`up`;t>=78&&((0,i.readColor)(e),(0,i.readColor)(e)),r.bevel={size:{units:`Pixels`,value:u},angle:a,strength:c,highlightBlendMode:d,shadowBlendMode:f,highlightColor:p,shadowColor:m,style:h,highlightOpacity:g,shadowOpacity:_,enabled:v,useGlobalLight:y,direction:b};break}case`sofi`:{let t=(0,i.readUint32)(e),n=(0,i.readUint32)(e);if(t!==34)throw Error(`Invalid effects solid fill info size: ${t}`);if(n!==2)throw Error(`Invalid effects solid fill info version: ${n}`);let a=s(e),o=(0,i.readColor)(e),c=l(e),u=!!(0,i.readUint8)(e);(0,i.readColor)(e),r.solidFill=[{blendMode:a,color:o,opacity:c,enabled:u}];break}default:throw Error(`Invalid effect type: '${t}'`)}}return r}n.readEffects=d;function f(e,t){(0,a.writeUint32)(e,51),(0,a.writeUint32)(e,2),(0,a.writeFixedPoint32)(e,t.size&&t.size.value||0),(0,a.writeFixedPoint32)(e,0),(0,a.writeFixedPoint32)(e,t.angle||0),(0,a.writeFixedPoint32)(e,t.distance&&t.distance.value||0),(0,a.writeColor)(e,t.color),c(e,t.blendMode),(0,a.writeUint8)(e,+!!t.enabled),(0,a.writeUint8)(e,+!!t.useGlobalLight),u(e,t.opacity??1),(0,a.writeColor)(e,t.color)}function p(e,t){let n=t.dropShadow?.[0],r=t.innerShadow?.[0],i=t.outerGlow,s=t.innerGlow,l=t.bevel,d=t.solidFill?.[0],p=1;if(n&&p++,r&&p++,i&&p++,s&&p++,l&&p++,d&&p++,(0,a.writeUint16)(e,0),(0,a.writeUint16)(e,p),(0,a.writeSignature)(e,`8BIM`),(0,a.writeSignature)(e,`cmnS`),(0,a.writeUint32)(e,7),(0,a.writeUint32)(e,0),(0,a.writeUint8)(e,1),(0,a.writeZeros)(e,2),n&&((0,a.writeSignature)(e,`8BIM`),(0,a.writeSignature)(e,`dsdw`),f(e,n)),r&&((0,a.writeSignature)(e,`8BIM`),(0,a.writeSignature)(e,`isdw`),f(e,r)),i&&((0,a.writeSignature)(e,`8BIM`),(0,a.writeSignature)(e,`oglw`),(0,a.writeUint32)(e,42),(0,a.writeUint32)(e,2),(0,a.writeFixedPoint32)(e,i.size?.value||0),(0,a.writeFixedPoint32)(e,0),(0,a.writeColor)(e,i.color),c(e,i.blendMode),(0,a.writeUint8)(e,+!!i.enabled),u(e,i.opacity||0),(0,a.writeColor)(e,i.color)),s&&((0,a.writeSignature)(e,`8BIM`),(0,a.writeSignature)(e,`iglw`),(0,a.writeUint32)(e,43),(0,a.writeUint32)(e,2),(0,a.writeFixedPoint32)(e,s.size?.value||0),(0,a.writeFixedPoint32)(e,0),(0,a.writeColor)(e,s.color),c(e,s.blendMode),(0,a.writeUint8)(e,+!!s.enabled),u(e,s.opacity||0),(0,a.writeUint8)(e,0),(0,a.writeColor)(e,s.color)),l){(0,a.writeSignature)(e,`8BIM`),(0,a.writeSignature)(e,`bevl`),(0,a.writeUint32)(e,78),(0,a.writeUint32)(e,2),(0,a.writeFixedPoint32)(e,l.angle||0),(0,a.writeFixedPoint32)(e,l.strength||0),(0,a.writeFixedPoint32)(e,l.size?.value||0),c(e,l.highlightBlendMode),c(e,l.shadowBlendMode),(0,a.writeColor)(e,l.highlightColor),(0,a.writeColor)(e,l.shadowColor);let t=o.indexOf(l.style);(0,a.writeUint8)(e,t<=0?1:t),u(e,l.highlightOpacity||0),u(e,l.shadowOpacity||0),(0,a.writeUint8)(e,+!!l.enabled),(0,a.writeUint8)(e,+!!l.useGlobalLight),(0,a.writeUint8)(e,+(l.direction===`down`)),(0,a.writeColor)(e,l.highlightColor),(0,a.writeColor)(e,l.shadowColor)}d&&((0,a.writeSignature)(e,`8BIM`),(0,a.writeSignature)(e,`sofi`),(0,a.writeUint32)(e,34),(0,a.writeUint32)(e,2),c(e,d.blendMode),(0,a.writeColor)(e,d.color),u(e,d.opacity||0),(0,a.writeUint8)(e,+!!d.enabled),(0,a.writeColor)(e,d.color))}n.writeEffects=p},{"./helpers":8,"./psdReader":13,"./psdWriter":14}],6:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.serializeEngineData=n.parseEngineData=void 0;function r(e){return e===32||e===10||e===13||e===9}function i(e){return e>=48&&e<=57||e===46||e===45}function a(e){let t=0;function n(){for(;t<e.length&&r(e[t]);)t++}function a(){let n=e[t];return t++,n===92&&(n=e[t],t++),n}function o(){let n=``;if(e[t]===41)return t++,n;if(e[t]!==254||e[t+1]!==255)throw Error(`Invalid utf-16 BOM`);for(t+=2;t<e.length&&e[t]!==41;){let e=a(),t=a(),r=e<<8|t;n+=String.fromCharCode(r)}return t++,n}let s=null,c=[];function l(e){c.length?(u(e),c.push(e)):(c.push(e),s=e)}function u(e){if(!c.length)throw Error(`Invalid data`);let t=c[c.length-1];if(typeof t==`string`)c[c.length-2][t]=e,f();else if(Array.isArray(t))t.push(e);else throw Error(`Invalid data`)}function d(e){c.length||l({});let t=c[c.length-1];if(t&&typeof t==`string`)u(e===`nil`?null:`/${e}`);else if(t&&typeof t==`object`)c.push(e);else throw Error(`Invalid data`)}function f(){if(!c.length)throw Error(`Invalid data`);c.pop()}n();let p=e.length;for(;p>0&&e[p-1]===0;)p--;for(;t<p;){let a=t,s=e[a];if(s===60&&e[a+1]===60)t+=2,l({});else if(s===62&&e[a+1]===62)t+=2,f();else if(s===47){t+=1;let n=t;for(;t<e.length&&!r(e[t]);)t++;let i=``;for(let r=n;r<t;r++)i+=String.fromCharCode(e[r]);d(i)}else if(s===40)t+=1,u(o());else if(s===91)t+=1,l([]);else if(s===93)t+=1,f();else if(s===110&&e[a+1]===117&&e[a+2]===108&&e[a+3]===108)t+=4,u(null);else if(s===116&&e[a+1]===114&&e[a+2]===117&&e[a+3]===101)t+=4,u(!0);else if(s===102&&e[a+1]===97&&e[a+2]===108&&e[a+3]===115&&e[a+4]===101)t+=5,u(!1);else if(i(s)){let n=``;for(;t<e.length&&i(e[t]);)n+=String.fromCharCode(e[t]),t++;u(parseFloat(n))}else t+=1,console.log(`Invalid token '${String.fromCharCode(s)}' (${s}) at ${t}`);n()}return s}n.parseEngineData=a;let o=/* @__PURE__ */ `Axis.XY.Zone.WordSpacing.FirstLineIndent.GlyphSpacing.StartIndent.EndIndent.SpaceBefore.SpaceAfter.LetterSpacing.Values.GridSize.GridLeading.PointBase.BoxBounds.TransformPoint0.TransformPoint1.TransformPoint2.FontSize.Leading.HorizontalScale.VerticalScale.BaselineShift.Tsume.OutlineWidth.AutoLeading`.split(`.`),s=[`RunLengthArray`];function c(e,t=!1){let n=/* @__PURE__ */ new Uint8Array(1024),r=0,i=0;function a(e){if(r>=n.length){let e=new Uint8Array(n.length*2);e.set(n),n=e}n[r]=e,r++}function c(e){for(let t=0;t<e.length;t++)a(e.charCodeAt(t))}function l(){if(t)c(` `);else for(let e=0;e<i;e++)c(` `)}function u(e,n){l(),c(`/${e}`),g(n,e,!0),t||c(`
|
|
4
|
+
`)}function d(e){return e.toString()}function f(e){return e.toFixed(5).replace(/(\d)0+$/g,`$1`).replace(/^0+\.([1-9])/g,`.$1`).replace(/^-0+\.0(\d)/g,`-.0$1`)}function p(e,t){return t&&o.indexOf(t)!==-1||(e|0)!==e?f(e):d(e)}function m(e){let t=Object.keys(e);return t.indexOf(`98`)!==-1&&t.unshift(...t.splice(t.indexOf(`99`),1)),t.indexOf(`99`)!==-1&&t.unshift(...t.splice(t.indexOf(`99`),1)),t}function h(e){(e===40||e===41||e===92)&&a(92),a(e)}function g(e,n,r=!1){function o(){r?c(` `):l()}if(e===null)o(),c(t?`/nil`:`null`);else if(typeof e==`number`)o(),c(p(e,n));else if(typeof e==`boolean`)o(),c(e?`true`:`false`);else if(typeof e==`string`){if(o(),(n===`99`||n===`98`)&&e.charAt(0)===`/`)c(e);else{c(`(`),a(254),a(255);for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);h(n>>8&255),h(n&255)}c(`)`)}}else if(Array.isArray(e)){if(o(),e.every(e=>typeof e==`number`)){c(`[`);let t=s.indexOf(n)!==-1;for(let n of e)c(` `),c(t?p(n):f(n));c(` ]`)}else{c(`[`),t||c(`
|
|
5
|
+
`);for(let r of e)g(r,n),t||c(`
|
|
6
|
+
`);l(),c(`]`)}}else if(typeof e==`object`){r&&!t&&c(`
|
|
7
|
+
`),l(),c(`<<`),t||c(`
|
|
8
|
+
`),i++;for(let t of m(e))u(t,e[t]);i--,l(),c(`>>`)}}if(t){if(typeof e==`object`)for(let t of m(e))u(t,e[t])}else c(`
|
|
9
|
+
|
|
10
|
+
`),g(e);return n.slice(0,r)}n.serializeEngineData=c},{}],7:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.decodeEngineData2=void 0;let r={0:{uproot:!0,children:{0:{name:`Type`},1:{name:`Values`}}}},i={0:{name:`Font`},1:{name:`FontSize`},2:{name:`FauxBold`},3:{name:`FauxItalic`},4:{name:`AutoLeading`},5:{name:`Leading`},6:{name:`HorizontalScale`},7:{name:`VerticalScale`},8:{name:`Tracking`},9:{name:`BaselineShift`},11:{name:`Kerning?`},12:{name:`FontCaps`},13:{name:`FontBaseline`},15:{name:`Strikethrough?`},16:{name:`Underline?`},18:{name:`Ligatures`},19:{name:`DLigatures`},23:{name:`Fractions`},24:{name:`Ordinals`},28:{name:`StylisticAlternates`},30:{name:`OldStyle?`},35:{name:`BaselineDirection`},38:{name:`Language`},52:{name:`NoBreak`},53:{name:`FillColor`,children:r},54:{name:`StrokeColor`,children:r},55:{children:{99:{uproot:!0}}},79:{children:r}},a={0:{name:`Justification`},1:{name:`FirstLineIndent`},2:{name:`StartIndent`},3:{name:`EndIndent`},4:{name:`SpaceBefore`},5:{name:`SpaceAfter`},7:{name:`AutoLeading`},9:{name:`AutoHyphenate`},10:{name:`HyphenatedWordSize`},11:{name:`PreHyphen`},12:{name:`PostHyphen`},13:{name:`ConsecutiveHyphens?`},14:{name:`Zone`},15:{name:`HypenateCapitalizedWords`},17:{name:`WordSpacing`},18:{name:`LetterSpacing`},19:{name:`GlyphSpacing`},32:{name:`StyleSheet`,children:i}},o={name:`StyleSheetData`,children:i},s={0:{name:`ResourceDict`,children:{1:{name:`FontSet`,children:{0:{uproot:!0,children:{0:{uproot:!0,children:{0:{uproot:!0,children:{0:{name:`Name`},2:{name:`FontType`}}}}}}}}},2:{name:`2`,children:{}},3:{name:`MojiKumiSet`,children:{0:{uproot:!0,children:{0:{uproot:!0,children:{0:{name:`InternalName`}}}}}}},4:{name:`KinsokuSet`,children:{0:{uproot:!0,children:{0:{uproot:!0,children:{0:{name:`Name`},5:{uproot:!0,children:{0:{name:`NoStart`},1:{name:`NoEnd`},2:{name:`Keep`},3:{name:`Hanging`},4:{name:`Name`}}}}}}}}},5:{name:`StyleSheetSet`,children:{0:{uproot:!0,children:{0:{uproot:!0,children:{0:{name:`Name`},6:o}}}}}},6:{name:`ParagraphSheetSet`,children:{0:{uproot:!0,children:{0:{uproot:!0,children:{0:{name:`Name`},5:{name:`Properties`,children:a},6:{name:`DefaultStyleSheet`}}}}}}},8:{name:`TextFrameSet`,children:{0:{uproot:!0,children:{0:{name:`path`,children:{0:{name:`name`},1:{name:`bezierCurve`,children:{0:{name:`controlPoints`}}},2:{name:`data`,children:{0:{name:`type`},1:{name:`orientation`},2:{name:`frameMatrix`},4:{name:`4`},6:{name:`textRange`},7:{name:`rowGutter`},8:{name:`columnGutter`},9:{name:`9`},10:{name:`baselineAlignment`,children:{0:{name:`flag`},1:{name:`min`}}},11:{name:`pathData`,children:{1:{name:`1`},0:{name:`reversed`},2:{name:`2`},3:{name:`3`},4:{name:`spacing`},5:{name:`5`},6:{name:`6`},7:{name:`7`},18:{name:`18`}}},12:{name:`12`},13:{name:`13`}}},3:{name:`3`},97:{name:`uuid`}}}}}}},9:{name:`Predefined`,children:{0:{children:{0:{uproot:!0}}},1:{children:{0:{uproot:!0}}}}}}},1:{name:`EngineDict`,children:{0:{name:`0`,children:{3:{name:`SuperscriptSize`},4:{name:`SuperscriptPosition`},5:{name:`SubscriptSize`},6:{name:`SubscriptPosition`},7:{name:`SmallCapSize`},8:{name:`UseFractionalGlyphWidths`},15:{children:{0:{uproot:!0}}}}},1:{name:`Editors?`,children:{0:{name:`Editor`,children:{0:{name:`Text`},5:{name:`ParagraphRun`,children:{0:{name:`RunArray`,children:{0:{name:`ParagraphSheet`,children:{0:{uproot:!0,children:{0:{name:`0`},5:{name:`5`,children:a},6:{name:`6`}}}}},1:{name:`RunLength`}}}}},6:{name:`StyleRun`,children:{0:{name:`RunArray`,children:{0:{name:`StyleSheet`,children:{0:{uproot:!0,children:{6:o}}}},1:{name:`RunLength`}}}}}}},1:{name:`FontVectorData ???`}}},2:{name:`StyleSheet`,children:i},3:{name:`ParagraphSheet`,children:a}}}};function c(e,t){if(e===null)return e;if(Array.isArray(e))return e.map(e=>c(e,t));if(typeof e!=`object`)return e;let n={};for(let r of Object.keys(e))if(t[r]){if(t[r].uproot){r!==`99`&&(n=c(e[r],t[r].children??{})),e[99]&&(n._type=e[99]);break}n[t[r].name||r]=c(e[r],t[r].children??{})}else r===`99`?n._type=e[r]:n[r]=c(e[r],{});return n}function l(e){return c(e,s)}n.decodeEngineData2=l},{}],8:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.initializeCanvas=n.createImageData=n.createCanvas=n.createCanvasFromData=n.writeDataZipWithoutPrediction=n.writeDataRLE=n.writeDataRaw=n.decodeBitmap=n.imageDataToCanvas=n.resetImageData=n.hasAlpha=n.clamp=n.offsetForChannel=n.MaskParams=n.LayerMaskFlags=n.ColorSpace=n.createEnum=n.revMap=n.largeAdditionalInfoKeys=n.layerColors=n.toBlendMode=n.fromBlendMode=n.RAW_IMAGE_DATA=n.MOCK_HANDLERS=void 0;let r=e("pako"),i=e("./jpeg");n.MOCK_HANDLERS=!1,n.RAW_IMAGE_DATA=!1,n.fromBlendMode={},n.toBlendMode={pass:`pass through`,norm:`normal`,diss:`dissolve`,dark:`darken`,"mul ":`multiply`,idiv:`color burn`,lbrn:`linear burn`,dkCl:`darker color`,lite:`lighten`,scrn:`screen`,"div ":`color dodge`,lddg:`linear dodge`,lgCl:`lighter color`,over:`overlay`,sLit:`soft light`,hLit:`hard light`,vLit:`vivid light`,lLit:`linear light`,pLit:`pin light`,hMix:`hard mix`,diff:`difference`,smud:`exclusion`,fsub:`subtract`,fdiv:`divide`,"hue ":`hue`,"sat ":`saturation`,colr:`color`,"lum ":`luminosity`},Object.keys(n.toBlendMode).forEach(e=>n.fromBlendMode[n.toBlendMode[e]]=e),n.layerColors=[`none`,`red`,`orange`,`yellow`,`green`,`blue`,`violet`,`gray`],n.largeAdditionalInfoKeys=[`LMsk`,`Lr16`,`Lr32`,`Layr`,`Mt16`,`Mt32`,`Mtrn`,`Alph`,`FMsk`,`lnk2`,`FEid`,`FXid`,`PxSD`,`cinf`];function a(e){let t={};return Object.keys(e).forEach(n=>t[e[n]]=n),t}n.revMap=a;function o(e,t,n){let r=a(n);return{decode:e=>{let n=e.split(`.`)[1];if(n&&!r[n])throw Error(`Unrecognized value for enum: '${e}'`);return r[n]||t},encode:r=>{if(r&&!n[r])throw Error(`Invalid value for enum: '${r}'`);return`${e}.${n[r]||n[t]}`}}}n.createEnum=o,(function(e){e[e.RGB=0]=`RGB`,e[e.HSB=1]=`HSB`,e[e.CMYK=2]=`CMYK`,e[e.Lab=7]=`Lab`,e[e.Grayscale=8]=`Grayscale`})(n.ColorSpace||={}),(function(e){e[e.PositionRelativeToLayer=1]=`PositionRelativeToLayer`,e[e.LayerMaskDisabled=2]=`LayerMaskDisabled`,e[e.InvertLayerMaskWhenBlending=4]=`InvertLayerMaskWhenBlending`,e[e.LayerMaskFromRenderingOtherData=8]=`LayerMaskFromRenderingOtherData`,e[e.MaskHasParametersAppliedToIt=16]=`MaskHasParametersAppliedToIt`})(n.LayerMaskFlags||={}),(function(e){e[e.UserMaskDensity=1]=`UserMaskDensity`,e[e.UserMaskFeather=2]=`UserMaskFeather`,e[e.VectorMaskDensity=4]=`VectorMaskDensity`,e[e.VectorMaskFeather=8]=`VectorMaskFeather`})(n.MaskParams||={});function s(e,t){switch(e){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return t?3:e+1;case-1:return t?4:3;default:return e+1}}n.offsetForChannel=s;function c(e,t,n){return e<t?t:e>n?n:e}n.clamp=c;function l(e){let t=e.width*e.height*4;for(let n=3;n<t;n+=4)if(e.data[n]!==255)return!0;return!1}n.hasAlpha=l;function u({data:e}){let t=e instanceof Float32Array?1:e instanceof Uint16Array?65535:255;for(let n=0,r=e.length|0;n<r;n=n+4|0)e[n+0]=0,e[n+1]=0,e[n+2]=0,e[n+3]=t}n.resetImageData=u;function d(e){let t=(0,n.createCanvas)(e.width,e.height),r;if(e.data instanceof Uint8ClampedArray)r=e;else{r=(0,n.createImageData)(e.width,e.height);let t=e.data,i=r.data;if(t instanceof Float32Array)for(let e=0,n=t.length;e<n;e+=4)i[e+0]=Math.round(t[e+0]**(1/2.2)*255),i[e+1]=Math.round(t[e+1]**(1/2.2)*255),i[e+2]=Math.round(t[e+2]**(1/2.2)*255),i[e+3]=Math.round(t[e+3]*255);else{let e=t instanceof Uint16Array?8:0;for(let n=0,r=t.length;n<r;n++)i[n]=t[n]>>>e}}return t.getContext(`2d`).putImageData(r,0,0),t}n.imageDataToCanvas=d;function f(e,t,n,r){if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw Error(`Invalid bit depth`);for(let i=0,a=0,o=0;i<r;i++)for(let r=0;r<n;){let i=e[o++];for(let e=0;e<8&&r<n;e++,r++,a+=4){let e=i&128?0:255;i<<=1,t[a+0]=e,t[a+1]=e,t[a+2]=e,t[a+3]=255}}}n.decodeBitmap=f;function p(e,t,n,r){if(!n||!r)return;let i=new Uint8Array(n*r);for(let n=0;n<i.length;n++)i[n]=e.data[n*4+t];return i}n.writeDataRaw=p;function m(e,{data:t,width:n,height:r},i,a){if(!n||!r)return;let o=4*n|0,s=0,c=i.length*(a?4:2)*r|0;for(let n of i)for(let i=0,l=n|0;i<r;i++){let r=i*o|0,u=r+o|0,d=u+n-4|0,f=d-4|0,p=c;for(l=r+n|0;l<u;l=l+4|0)if(l<f){let n=t[l];l=l+4|0;let r=t[l];l=l+4|0;let i=t[l];if(n===r&&n===i){let r=3;for(;r<128&&l<d&&t[l+4|0]===n;)r=r+1|0,l=l+4|0;e[c++]=1-r,e[c++]=n}else{let a=c,o=!0,s=1;for(e[c++]=0,e[c++]=n;l<d&&s<128;){if(l=l+4|0,n=r,r=i,i=t[l],n===r&&n===i){l=l-12|0,o=!1;break}s++,e[c++]=n}o&&(s<127?(e[c++]=r,e[c++]=i,s+=2):s<128?(e[c++]=r,s++,l=l-4|0):l=l-8|0),e[a]=s-1}}else l===d?(e[c++]=0,e[c++]=t[l]):(e[c++]=1,e[c++]=t[l],l=l+4|0,e[c++]=t[l]);let m=c-p;a&&(e[s++]=m>>24&255,e[s++]=m>>16&255),e[s++]=m>>8&255,e[s++]=m&255}return e.slice(0,c)}n.writeDataRLE=m;function h({data:e,width:t,height:n},i){let a=t*n,o=new Uint8Array(a),s=[],c=0;for(let t of i){for(let n=0,r=t;n<a;n++,r+=4)o[n]=e[r];let n=(0,r.deflate)(o);s.push(n),c+=n.byteLength}if(s.length>0){let e=new Uint8Array(c),t=0;for(let n of s)e.set(n,t),t+=n.byteLength;return e}return s[0]}n.writeDataZipWithoutPrediction=h;function g(e){let t=(0,n.createCanvas)(100,100);try{let n=t.getContext(`2d`),r=(0,i.decodeJpeg)(e,(e,t)=>n.createImageData(e,t));t.width=r.width,t.height=r.height,n.putImageData(r,0,0)}catch(e){console.error(`JPEG decompression error`,e.message)}return t}n.createCanvasFromData=g,n.createCanvas=()=>{throw Error(`Canvas not initialized, use initializeCanvas method to set up createCanvas method`)};let _;n.createImageData=(e,t)=>(_||=(0,n.createCanvas)(1,1),_.getContext(`2d`).createImageData(e,t)),typeof document<`u`&&(n.createCanvas=(e,t)=>{let n=document.createElement(`canvas`);return n.width=e,n.height=t,n});function v(e,t){n.createCanvas=e,n.createImageData=t||n.createImageData}n.initializeCanvas=v},{"./jpeg":11,pako:36}],9:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.resourceHandlersMap=n.resourceHandlers=void 0;let r=e("base64-js"),i=e("./psdReader"),a=e("./psdWriter"),o=e("./helpers"),s=e("./utf8"),c=e("./descriptor");n.resourceHandlers=[],n.resourceHandlersMap={};function l(e,t,r,i){let a={key:e,has:t,read:r,write:i};n.resourceHandlers.push(a),n.resourceHandlersMap[a.key]=a}let u=[void 0,`PPI`,`PPCM`],d=[void 0,`Inches`,`Centimeters`,`Points`,`Picas`,`Columns`],f=`0123456789abcdef`;function p(e){return e<=57?e-48:e-87}function m(e,t){return p(e.charCodeAt(t))<<4|p(e.charCodeAt(t+1))}function h(e,t){let n=(0,i.readBytes)(e,t);return(0,s.decodeString)(n)}function g(e,t){let n=(0,s.encodeString)(t);(0,a.writeBytes)(e,n)}function _(e){let t=(0,i.readUint8)(e),n=(0,i.readBytes)(e,t),r=!1;for(let e=0;e<n.byteLength;e++)if(n[e]&128){r=!0;break}return r?new TextDecoder(`gbk`).decode(n):(0,s.decodeString)(n)}function v(e,t){let n=``;for(let e=0,r=t.codePointAt(e++);r!==void 0;r=t.codePointAt(e++))n+=r>127?`?`:String.fromCodePoint(r);let r=(0,s.encodeString)(n);(0,a.writeUint8)(e,r.byteLength),(0,a.writeBytes)(e,r)}o.MOCK_HANDLERS&&l(1028,e=>e._ir1028!==void 0,(e,t,n)=>{t._ir1028=(0,i.readBytes)(e,n())},(e,t)=>{(0,a.writeBytes)(e,t._ir1028)}),l(1061,e=>e.captionDigest!==void 0,(e,t)=>{let n=``;for(let t=0;t<16;t++){let t=(0,i.readUint8)(e);n+=f[t>>4],n+=f[t&15]}t.captionDigest=n},(e,t)=>{for(let n=0;n<16;n++)(0,a.writeUint8)(e,m(t.captionDigest,n*2))}),l(1060,e=>e.xmpMetadata!==void 0,(e,t,n)=>{t.xmpMetadata=h(e,n())},(e,t)=>{g(e,t.xmpMetadata)});let y=(0,o.createEnum)(`Inte`,`perceptual`,{perceptual:`Img `,saturation:`Grp `,"relative colorimetric":`Clrm`,"absolute colorimetric":`AClr`});o.MOCK_HANDLERS&&l(1085,e=>e._ir1085!==void 0,(e,t,n)=>{t._ir1085=(0,i.readBytes)(e,n())},(e,t)=>{(0,a.writeBytes)(e,t._ir1085)}),l(1082,e=>e.printInformation!==void 0,(e,t)=>{let n=(0,c.readVersionAndDescriptor)(e);t.printInformation={printerName:n.printerName||``,renderingIntent:y.decode(n.Inte??`Inte.Img `)};let r=t.printInformation;n.PstS!==void 0&&(r.printerManagesColors=n.PstS),n[`Nm `]!==void 0&&(r.printerProfile=n[`Nm `]),n.MpBl!==void 0&&(r.blackPointCompensation=n.MpBl),n.printSixteenBit!==void 0&&(r.printSixteenBit=n.printSixteenBit),n.hardProof!==void 0&&(r.hardProof=n.hardProof),n.printProofSetup&&(r.proofSetup=`Bltn`in n.printProofSetup?{builtin:n.printProofSetup.Bltn.split(`.`)[1]}:{profile:n.printProofSetup.profile,renderingIntent:y.decode(n.printProofSetup.Inte??`Inte.Img `),blackPointCompensation:!!n.printProofSetup.MpBl,paperWhite:!!n.printProofSetup.paperWhite})},(e,t)=>{let n=t.printInformation,r={};n.printerManagesColors?r.PstS=!0:(n.hardProof!==void 0&&(r.hardProof=!!n.hardProof),r.ClrS=`ClrS.RGBC`,r[`Nm `]=n.printerProfile??`CIE RGB`),r.Inte=y.encode(n.renderingIntent),n.printerManagesColors||(r.MpBl=!!n.blackPointCompensation),r.printSixteenBit=!!n.printSixteenBit,r.printerName=n.printerName||``,r.printProofSetup=n.proofSetup&&`profile`in n.proofSetup?{profile:n.proofSetup.profile||``,Inte:y.encode(n.proofSetup.renderingIntent),MpBl:!!n.proofSetup.blackPointCompensation,paperWhite:!!n.proofSetup.paperWhite}:{Bltn:n.proofSetup?.builtin?`builtinProof.${n.proofSetup.builtin}`:`builtinProof.proofCMYK`},(0,c.writeVersionAndDescriptor)(e,``,`printOutput`,r)}),o.MOCK_HANDLERS&&l(1083,e=>e._ir1083!==void 0,(e,t,n)=>{t._ir1083=(0,i.readBytes)(e,n())},(e,t)=>{(0,a.writeBytes)(e,t._ir1083)}),l(1005,e=>e.resolutionInfo!==void 0,(e,t)=>{let n=(0,i.readFixedPoint32)(e),r=(0,i.readUint16)(e),a=(0,i.readUint16)(e),o=(0,i.readFixedPoint32)(e),s=(0,i.readUint16)(e),c=(0,i.readUint16)(e);t.resolutionInfo={horizontalResolution:n,horizontalResolutionUnit:u[r]||`PPI`,widthUnit:d[a]||`Inches`,verticalResolution:o,verticalResolutionUnit:u[s]||`PPI`,heightUnit:d[c]||`Inches`}},(e,t)=>{let n=t.resolutionInfo;(0,a.writeFixedPoint32)(e,n.horizontalResolution||0),(0,a.writeUint16)(e,Math.max(1,u.indexOf(n.horizontalResolutionUnit))),(0,a.writeUint16)(e,Math.max(1,d.indexOf(n.widthUnit))),(0,a.writeFixedPoint32)(e,n.verticalResolution||0),(0,a.writeUint16)(e,Math.max(1,u.indexOf(n.verticalResolutionUnit))),(0,a.writeUint16)(e,Math.max(1,d.indexOf(n.heightUnit)))});let b=[`centered`,`size to fit`,`user defined`];l(1062,e=>e.printScale!==void 0,(e,t)=>{t.printScale={style:b[(0,i.readInt16)(e)],x:(0,i.readFloat32)(e),y:(0,i.readFloat32)(e),scale:(0,i.readFloat32)(e)}},(e,t)=>{let{style:n,x:r,y:i,scale:o}=t.printScale;(0,a.writeInt16)(e,Math.max(0,b.indexOf(n))),(0,a.writeFloat32)(e,r||0),(0,a.writeFloat32)(e,i||0),(0,a.writeFloat32)(e,o||0)}),l(1006,e=>e.alphaChannelNames!==void 0,(e,t,n)=>{if(t.alphaChannelNames)(0,i.skipBytes)(e,n());else for(t.alphaChannelNames=[];n()>0;){let n=_(e);t.alphaChannelNames.push(n)}},(e,t)=>{for(let n of t.alphaChannelNames)v(e,n)}),l(1045,e=>e.alphaChannelNames!==void 0,(e,t,n)=>{for(t.alphaChannelNames=[];n()>0;)t.alphaChannelNames.push((0,i.readUnicodeString)(e))},(e,t)=>{for(let n of t.alphaChannelNames)(0,a.writeUnicodeStringWithPadding)(e,n)}),o.MOCK_HANDLERS&&l(1077,e=>e._ir1077!==void 0,(e,t,n)=>{t._ir1077=(0,i.readBytes)(e,n())},(e,t)=>{(0,a.writeBytes)(e,t._ir1077)}),l(1053,e=>e.alphaIdentifiers!==void 0,(e,t,n)=>{for(t.alphaIdentifiers=[];n()>=4;)t.alphaIdentifiers.push((0,i.readUint32)(e))},(e,t)=>{for(let n of t.alphaIdentifiers)(0,a.writeUint32)(e,n)}),l(1010,e=>e.backgroundColor!==void 0,(e,t)=>t.backgroundColor=(0,i.readColor)(e),(e,t)=>(0,a.writeColor)(e,t.backgroundColor)),l(1037,e=>e.globalAngle!==void 0,(e,t)=>t.globalAngle=(0,i.readInt32)(e),(e,t)=>(0,a.writeInt32)(e,t.globalAngle)),l(1049,e=>e.globalAltitude!==void 0,(e,t)=>t.globalAltitude=(0,i.readUint32)(e),(e,t)=>(0,a.writeUint32)(e,t.globalAltitude)),l(1011,e=>e.printFlags!==void 0,(e,t)=>{t.printFlags={labels:!!(0,i.readUint8)(e),cropMarks:!!(0,i.readUint8)(e),colorBars:!!(0,i.readUint8)(e),registrationMarks:!!(0,i.readUint8)(e),negative:!!(0,i.readUint8)(e),flip:!!(0,i.readUint8)(e),interpolate:!!(0,i.readUint8)(e),caption:!!(0,i.readUint8)(e),printFlags:!!(0,i.readUint8)(e)}},(e,t)=>{let n=t.printFlags;(0,a.writeUint8)(e,+!!n.labels),(0,a.writeUint8)(e,+!!n.cropMarks),(0,a.writeUint8)(e,+!!n.colorBars),(0,a.writeUint8)(e,+!!n.registrationMarks),(0,a.writeUint8)(e,+!!n.negative),(0,a.writeUint8)(e,+!!n.flip),(0,a.writeUint8)(e,+!!n.interpolate),(0,a.writeUint8)(e,+!!n.caption),(0,a.writeUint8)(e,+!!n.printFlags)}),l(1034,e=>e.copyrighted!==void 0,(e,t)=>{t.copyrighted=!!(0,i.readUint8)(e)},(e,t)=>{(0,a.writeUint8)(e,+!!t.copyrighted)}),l(1035,e=>e.url!==void 0,(e,t,n)=>{t.url=(0,i.readAsciiString)(e,n())},(e,t)=>{(0,a.writeAsciiString)(e,t.url)}),o.MOCK_HANDLERS&&l(1e4,e=>e._ir10000!==void 0,(e,t,n)=>{t._ir10000=(0,i.readBytes)(e,n())},(e,t)=>{(0,a.writeBytes)(e,t._ir10000)}),o.MOCK_HANDLERS&&l(1013,e=>e._ir1013!==void 0,(e,t,n)=>{t._ir1013=(0,i.readBytes)(e,n())},(e,t)=>{(0,a.writeBytes)(e,t._ir1013)}),o.MOCK_HANDLERS&&l(1016,e=>e._ir1016!==void 0,(e,t,n)=>{t._ir1016=(0,i.readBytes)(e,n())},(e,t)=>{(0,a.writeBytes)(e,t._ir1016)}),l(1080,e=>e.countInformation!==void 0,(e,t)=>{t.countInformation=(0,c.readVersionAndDescriptor)(e).countGroupList.map(e=>({color:{r:e[`Rd `],g:e[`Grn `],b:e[`Bl `]},name:e[`Nm `],size:e[`Rds `],fontSize:e.fontSize,visible:e.Vsbl,points:e.countObjectList.map(e=>({x:e[`X `],y:e[`Y `]}))}))},(e,t)=>{let n={Vrsn:1,countGroupList:t.countInformation.map(e=>({"Rd ":e.color.r,"Grn ":e.color.g,"Bl ":e.color.b,"Nm ":e.name,"Rds ":e.size,fontSize:e.fontSize,Vsbl:e.visible,countObjectList:e.points.map(e=>({"X ":e.x,"Y ":e.y}))}))};(0,c.writeVersionAndDescriptor)(e,``,`Cnt `,n)}),l(1024,e=>e.layerState!==void 0,(e,t)=>t.layerState=(0,i.readUint16)(e),(e,t)=>(0,a.writeUint16)(e,t.layerState)),l(1026,e=>e.layersGroup!==void 0,(e,t,n)=>{for(t.layersGroup=[];n()>0;)t.layersGroup.push((0,i.readUint16)(e))},(e,t)=>{for(let n of t.layersGroup)(0,a.writeUint16)(e,n)}),l(1072,e=>e.layerGroupsEnabledId!==void 0,(e,t,n)=>{for(t.layerGroupsEnabledId=[];n()>0;)t.layerGroupsEnabledId.push((0,i.readUint8)(e))},(e,t)=>{for(let n of t.layerGroupsEnabledId)(0,a.writeUint8)(e,n)}),l(1069,e=>e.layerSelectionIds!==void 0,(e,t)=>{let n=(0,i.readUint16)(e);for(t.layerSelectionIds=[];n--;)t.layerSelectionIds.push((0,i.readUint32)(e))},(e,t)=>{(0,a.writeUint16)(e,t.layerSelectionIds.length);for(let n of t.layerSelectionIds)(0,a.writeUint32)(e,n)}),l(1032,e=>e.gridAndGuidesInformation!==void 0,(e,t)=>{let n=(0,i.readUint32)(e),r=(0,i.readUint32)(e),a=(0,i.readUint32)(e),o=(0,i.readUint32)(e);if(n!==1)throw Error(`Invalid 1032 resource version: ${n}`);t.gridAndGuidesInformation={grid:{horizontal:r,vertical:a},guides:[]};for(let n=0;n<o;n++)t.gridAndGuidesInformation.guides.push({location:(0,i.readUint32)(e)/32,direction:(0,i.readUint8)(e)?`horizontal`:`vertical`})},(e,t)=>{let n=t.gridAndGuidesInformation,r=n.grid||{horizontal:576,vertical:576},i=n.guides||[];(0,a.writeUint32)(e,1),(0,a.writeUint32)(e,r.horizontal),(0,a.writeUint32)(e,r.vertical),(0,a.writeUint32)(e,i.length);for(let t of i)(0,a.writeUint32)(e,t.location*32),(0,a.writeUint8)(e,+(t.direction===`horizontal`))}),l(1065,e=>e.layerComps!==void 0,(e,t)=>{let n=(0,c.readVersionAndDescriptor)(e,!0);t.layerComps={list:[]};for(let e of n.list)t.layerComps.list.push({id:e.compID,name:e[`Nm `],capturedInfo:e.capturedInfo}),`comment`in e&&(t.layerComps.list[t.layerComps.list.length-1].comment=e.comment);`lastAppliedComp`in n&&(t.layerComps.lastApplied=n.lastAppliedComp)},(e,t)=>{let n=t.layerComps,r={list:[]};for(let e of n.list){let t={};t._classID=`Comp`,t[`Nm `]=e.name,`comment`in e&&(t.comment=e.comment),t.compID=e.id,t.capturedInfo=e.capturedInfo,r.list.push(t)}`lastApplied`in n&&(r.lastAppliedComp=n.lastApplied),(0,c.writeVersionAndDescriptor)(e,``,`CompList`,r)}),o.MOCK_HANDLERS&&l(1092,e=>e._ir1092!==void 0,(e,t,n)=>{t._ir1092=(0,i.readBytes)(e,n())},(e,t)=>{(0,a.writeBytes)(e,t._ir1092)});let x=[`normal`,void 0,void 0,void 0,void 0,void 0,void 0,`multiply`,`screen`,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,`difference`];l(1078,e=>e.onionSkins!==void 0,(e,t)=>{let n=(0,c.readVersionAndDescriptor)(e);t.onionSkins={enabled:n.enab,framesBefore:n.numBefore,framesAfter:n.numAfter,frameSpacing:n.Spcn,minOpacity:n.minOpacity/100,maxOpacity:n.maxOpacity/100,blendMode:x[n.BlnM]||`normal`}},(e,t)=>{let n=t.onionSkins,r={Vrsn:1,enab:n.enabled,numBefore:n.framesBefore,numAfter:n.framesAfter,Spcn:n.frameSpacing,minOpacity:n.minOpacity*100|0,maxOpacity:n.maxOpacity*100|0,BlnM:Math.max(0,x.indexOf(n.blendMode))};(0,c.writeVersionAndDescriptor)(e,``,`null`,r)}),l(1075,e=>e.timelineInformation!==void 0,(e,t)=>{let n=(0,c.readVersionAndDescriptor)(e);t.timelineInformation={enabled:n.enab,frameStep:(0,c.frac)(n.frameStep),frameRate:n.frameRate,time:(0,c.frac)(n.time),duration:(0,c.frac)(n.duration),workInTime:(0,c.frac)(n.workInTime),workOutTime:(0,c.frac)(n.workOutTime),repeats:n.LCnt,hasMotion:n.hasMotion,globalTracks:(0,c.parseTrackList)(n.globalTrackList,!!e.logMissingFeatures)},n.audioClipGroupList?.audioClipGroupList?.length&&(t.timelineInformation.audioClipGroups=n.audioClipGroupList.audioClipGroupList.map(e=>({id:e.groupID,muted:e.muted,audioClips:e.audioClipList.map(({clipID:e,timeScope:t,muted:n,audioLevel:r,frameReader:i})=>({id:e,start:(0,c.frac)(t.Strt),duration:(0,c.frac)(t.duration),inTime:(0,c.frac)(t.inTime),outTime:(0,c.frac)(t.outTime),muted:n,audioLevel:r,frameReader:{type:i.frameReaderType,mediaDescriptor:i.mediaDescriptor,link:{name:i[`Lnk `][`Nm `],fullPath:i[`Lnk `].fullPath,relativePath:i[`Lnk `].relPath}}}))})))},(e,t)=>{let n=t.timelineInformation,r={Vrsn:1,enab:n.enabled,frameStep:n.frameStep,frameRate:n.frameRate,time:n.time,duration:n.duration,workInTime:n.workInTime,workOutTime:n.workOutTime,LCnt:n.repeats,globalTrackList:(0,c.serializeTrackList)(n.globalTracks),audioClipGroupList:{audioClipGroupList:n.audioClipGroups?.map(e=>({groupID:e.id,muted:e.muted,audioClipList:e.audioClips.map(e=>({clipID:e.id,timeScope:{Vrsn:1,Strt:e.start,duration:e.duration,inTime:e.inTime,outTime:e.outTime},frameReader:{frameReaderType:e.frameReader.type,descVersion:1,"Lnk ":{descVersion:1,"Nm ":e.frameReader.link.name,fullPath:e.frameReader.link.fullPath,relPath:e.frameReader.link.relativePath},mediaDescriptor:e.frameReader.mediaDescriptor},muted:e.muted,audioLevel:e.audioLevel}))}))},hasMotion:n.hasMotion};(0,c.writeVersionAndDescriptor)(e,``,`null`,r,`anim`)}),l(1076,e=>e.sheetDisclosure!==void 0,(e,t)=>{let n=(0,c.readVersionAndDescriptor)(e);t.sheetDisclosure={},n.sheetTimelineOptions&&(t.sheetDisclosure.sheetTimelineOptions=n.sheetTimelineOptions.map(e=>({sheetID:e.sheetID,sheetDisclosed:e.sheetDisclosed,lightsDisclosed:e.lightsDisclosed,meshesDisclosed:e.meshesDisclosed,materialsDisclosed:e.materialsDisclosed})))},(e,t)=>{let n=t.sheetDisclosure,r={Vrsn:1};n.sheetTimelineOptions&&(r.sheetTimelineOptions=n.sheetTimelineOptions.map(e=>({Vrsn:2,sheetID:e.sheetID,sheetDisclosed:e.sheetDisclosed,lightsDisclosed:e.lightsDisclosed,meshesDisclosed:e.meshesDisclosed,materialsDisclosed:e.materialsDisclosed}))),(0,c.writeVersionAndDescriptor)(e,``,`null`,r)}),l(1054,e=>e.urlsList!==void 0,(e,t)=>{let n=(0,i.readUint32)(e);t.urlsList=[];for(let r=0;r<n;r++){if((0,i.readSignature)(e)!==`slic`&&e.throwForMissingFeatures)throw Error(`Unknown long`);let n=(0,i.readUint32)(e),r=(0,i.readUnicodeString)(e);t.urlsList.push({id:n,url:r,ref:`slice`})}},(e,t)=>{let n=t.urlsList;(0,a.writeUint32)(e,n.length);for(let t=0;t<n.length;t++)(0,a.writeSignature)(e,`slic`),(0,a.writeUint32)(e,n[t].id),(0,a.writeUnicodeString)(e,n[t].url)});function S(e){return{"Top ":e.top,Left:e.left,Btom:e.bottom,Rght:e.right}}function C(e){return{top:e[`Top `],left:e.Left,bottom:e.Btom,right:e.Rght}}function w(e,t){return e[Math.max(0,Math.min(e.length-1,t))]}let T=[`autoGenerated`,`layer`,`userGenerated`],E=[`noImage`,`image`],D=[`default`];l(1050,e=>e.slices?e.slices.length:0,(e,t)=>{let n=(0,i.readUint32)(e);if(n===6){t.slices||=[];let n=(0,i.readInt32)(e),r=(0,i.readInt32)(e),a=(0,i.readInt32)(e),o=(0,i.readInt32)(e),s=(0,i.readUnicodeString)(e),l=(0,i.readUint32)(e);t.slices.push({bounds:{top:n,left:r,bottom:a,right:o},groupName:s,slices:[]});let u=t.slices[t.slices.length-1].slices;for(let t=0;t<l;t++){let t=(0,i.readUint32)(e),n=(0,i.readUint32)(e),r=w(T,(0,i.readUint32)(e)),a=r==`layer`?(0,i.readUint32)(e):0,o=(0,i.readUnicodeString)(e),s=w(E,(0,i.readUint32)(e)),c=(0,i.readInt32)(e),l=(0,i.readInt32)(e),d=(0,i.readInt32)(e),f=(0,i.readInt32)(e),p=(0,i.readUnicodeString)(e),m=(0,i.readUnicodeString)(e),h=(0,i.readUnicodeString)(e),g=(0,i.readUnicodeString)(e),_=!!(0,i.readUint8)(e),v=(0,i.readUnicodeString)(e),y=w(D,(0,i.readUint32)(e)),b=w(D,(0,i.readUint32)(e)),x=(0,i.readUint8)(e),S=(0,i.readUint8)(e),C=(0,i.readUint8)(e),O=(0,i.readUint8)(e),k=x+S+C+O===0?`none`:x===0?`matte`:`color`;u.push({id:t,groupId:n,origin:r,associatedLayerId:a,name:o,target:m,message:h,altTag:g,cellTextIsHTML:_,cellText:v,horizontalAlignment:y,verticalAlignment:b,type:s,url:p,bounds:{top:l,left:c,bottom:f,right:d},backgroundColorType:k,backgroundColor:{r:S,g:C,b:O,a:x}})}(0,c.readVersionAndDescriptor)(e).slices.forEach(e=>{let t=u.find(t=>e.sliceID==t.id);t&&(t.topOutset=e.topOutset,t.leftOutset=e.leftOutset,t.bottomOutset=e.bottomOutset,t.rightOutset=e.rightOutset)})}else if(n===7||n===8){let n=(0,c.readVersionAndDescriptor)(e);t.slices||=[],t.slices.push({groupName:n.baseName,bounds:C(n.bounds),slices:n.slices.map(e=>Object.assign(Object.assign({},e[`Nm `]?{name:e[`Nm `]}:{}),{id:e.sliceID,groupId:e.groupID,associatedLayerId:0,origin:c.ESliceOrigin.decode(e.origin),type:c.ESliceType.decode(e.Type),bounds:C(e.bounds),url:e.url,target:e.null,message:e.Msge,altTag:e.altTag,cellTextIsHTML:e.cellTextIsHTML,cellText:e.cellText,horizontalAlignment:c.ESliceHorzAlign.decode(e.horzAlign),verticalAlignment:c.ESliceVertAlign.decode(e.vertAlign),backgroundColorType:c.ESliceBGColorType.decode(e.bgColorType),backgroundColor:e.bgColor?{r:e.bgColor[`Rd `],g:e.bgColor[`Grn `],b:e.bgColor[`Bl `],a:e.bgColor.alpha}:{r:0,g:0,b:0,a:0},topOutset:e.topOutset||0,leftOutset:e.leftOutset||0,bottomOutset:e.bottomOutset||0,rightOutset:e.rightOutset||0}))})}else throw Error(`Invalid slices version (${n})`)},(e,t,n)=>{let{bounds:r,groupName:i,slices:o}=t.slices[n];(0,a.writeUint32)(e,6),(0,a.writeInt32)(e,r.top),(0,a.writeInt32)(e,r.left),(0,a.writeInt32)(e,r.bottom),(0,a.writeInt32)(e,r.right),(0,a.writeUnicodeString)(e,i),(0,a.writeUint32)(e,o.length);for(let t=0;t<o.length;t++){let n=o[t],{a:r,r:i,g:s,b:c}=n.backgroundColor;n.backgroundColorType===`none`?r=i=s=c=0:n.backgroundColorType===`matte`&&(r=0,i=s=c=255),(0,a.writeUint32)(e,n.id),(0,a.writeUint32)(e,n.groupId),(0,a.writeUint32)(e,T.indexOf(n.origin)),n.origin===`layer`&&(0,a.writeUint32)(e,n.associatedLayerId),(0,a.writeUnicodeString)(e,n.name||``),(0,a.writeUint32)(e,E.indexOf(n.type)),(0,a.writeInt32)(e,n.bounds.left),(0,a.writeInt32)(e,n.bounds.top),(0,a.writeInt32)(e,n.bounds.right),(0,a.writeInt32)(e,n.bounds.bottom),(0,a.writeUnicodeString)(e,n.url),(0,a.writeUnicodeString)(e,n.target),(0,a.writeUnicodeString)(e,n.message),(0,a.writeUnicodeString)(e,n.altTag),(0,a.writeUint8)(e,+!!n.cellTextIsHTML),(0,a.writeUnicodeString)(e,n.cellText),(0,a.writeUint32)(e,D.indexOf(n.horizontalAlignment)),(0,a.writeUint32)(e,D.indexOf(n.verticalAlignment)),(0,a.writeUint8)(e,r),(0,a.writeUint8)(e,i),(0,a.writeUint8)(e,s),(0,a.writeUint8)(e,c)}let s={bounds:S(r),slices:[]};o.forEach(e=>{let t=Object.assign(Object.assign({sliceID:e.id,groupID:e.groupId,origin:c.ESliceOrigin.encode(e.origin),Type:c.ESliceType.encode(e.type),bounds:S(e.bounds)},e.name?{"Nm ":e.name}:{}),{url:e.url,null:e.target,Msge:e.message,altTag:e.altTag,cellTextIsHTML:e.cellTextIsHTML,cellText:e.cellText,horzAlign:c.ESliceHorzAlign.encode(e.horizontalAlignment),vertAlign:c.ESliceVertAlign.encode(e.verticalAlignment),bgColorType:c.ESliceBGColorType.encode(e.backgroundColorType)});if(e.backgroundColorType===`color`){let{r:n,g:r,b:i,a}=e.backgroundColor;t.bgColor={"Rd ":n,"Grn ":r,"Bl ":i,alpha:a}}t.topOutset=e.topOutset||0,t.leftOutset=e.leftOutset||0,t.bottomOutset=e.bottomOutset||0,t.rightOutset=e.rightOutset||0,s.slices.push(t)}),(0,c.writeVersionAndDescriptor)(e,``,`null`,s,`slices`)}),l(1064,e=>e.pixelAspectRatio!==void 0,(e,t)=>{if((0,i.readUint32)(e)>2)throw Error(`Invalid pixelAspectRatio version`);t.pixelAspectRatio={aspect:(0,i.readFloat64)(e)}},(e,t)=>{(0,a.writeUint32)(e,2),(0,a.writeFloat64)(e,t.pixelAspectRatio.aspect)}),l(1041,e=>e.iccUntaggedProfile!==void 0,(e,t)=>{t.iccUntaggedProfile=!!(0,i.readUint8)(e)},(e,t)=>{(0,a.writeUint8)(e,+!!t.iccUntaggedProfile)}),o.MOCK_HANDLERS&&l(1039,e=>e._ir1039!==void 0,(e,t,n)=>{t._ir1039=(0,i.readBytes)(e,n())},(e,t)=>{(0,a.writeBytes)(e,t._ir1039)}),l(1044,e=>e.idsSeedNumber!==void 0,(e,t)=>t.idsSeedNumber=(0,i.readUint32)(e),(e,t)=>(0,a.writeUint32)(e,t.idsSeedNumber)),l(1036,e=>e.thumbnail!==void 0||e.thumbnailRaw!==void 0,(e,t,n)=>{let r=(0,i.readUint32)(e),a=(0,i.readUint32)(e),s=(0,i.readUint32)(e);(0,i.readUint32)(e),(0,i.readUint32)(e),(0,i.readUint32)(e);let c=(0,i.readUint16)(e),l=(0,i.readUint16)(e);if(r!==1||c!==24||l!==1){e.logMissingFeatures&&e.log(`Invalid thumbnail data (format: ${r}, bitsPerPixel: ${c}, planes: ${l})`),(0,i.skipBytes)(e,n());return}let u=n(),d=(0,i.readBytes)(e,u);e.useRawThumbnail?t.thumbnailRaw={width:a,height:s,data:d}:d.byteLength&&(t.thumbnail=(0,o.createCanvasFromData)(d))},(e,t)=>{let n=0,i=0,o=/* @__PURE__ */ new Uint8Array;if(t.thumbnailRaw)n=t.thumbnailRaw.width,i=t.thumbnailRaw.height,o=t.thumbnailRaw.data;else try{let e=t.thumbnail.toDataURL(`image/jpeg`,1)?.substring(23);e&&(o=(0,r.toByteArray)(e),n=t.thumbnail.width,i=t.thumbnail.height)}catch{}let s=Math.floor((n*24+31)/32)*4,c=s*i*1,l=o.length;(0,a.writeUint32)(e,1),(0,a.writeUint32)(e,n),(0,a.writeUint32)(e,i),(0,a.writeUint32)(e,s),(0,a.writeUint32)(e,c),(0,a.writeUint32)(e,l),(0,a.writeUint16)(e,24),(0,a.writeUint16)(e,1),(0,a.writeBytes)(e,o)}),l(1057,e=>e.versionInfo!==void 0,(e,t,n)=>{if((0,i.readUint32)(e)!==1)throw Error(`Invalid versionInfo version`);t.versionInfo={hasRealMergedData:!!(0,i.readUint8)(e),writerName:(0,i.readUnicodeString)(e),readerName:(0,i.readUnicodeString)(e),fileVersion:(0,i.readUint32)(e)},(0,i.skipBytes)(e,n())},(e,t)=>{let n=t.versionInfo;(0,a.writeUint32)(e,1),(0,a.writeUint8)(e,+!!n.hasRealMergedData),(0,a.writeUnicodeString)(e,n.writerName),(0,a.writeUnicodeString)(e,n.readerName),(0,a.writeUint32)(e,n.fileVersion)}),o.MOCK_HANDLERS&&l(1058,e=>e._ir1058!==void 0,(e,t,n)=>{t._ir1058=(0,i.readBytes)(e,n())},(e,t)=>{(0,a.writeBytes)(e,t._ir1058)}),l(7e3,e=>e.imageReadyVariables!==void 0,(e,t,n)=>{t.imageReadyVariables=h(e,n())},(e,t)=>{g(e,t.imageReadyVariables)}),l(7001,e=>e.imageReadyDataSets!==void 0,(e,t,n)=>{t.imageReadyDataSets=h(e,n())},(e,t)=>{g(e,t.imageReadyDataSets)}),l(1088,e=>e.pathSelectionState!==void 0,(e,t,n)=>{t.pathSelectionState=(0,c.readVersionAndDescriptor)(e).null},(e,t)=>{let n={null:t.pathSelectionState};(0,c.writeVersionAndDescriptor)(e,``,`null`,n)}),o.MOCK_HANDLERS&&l(1025,e=>e._ir1025!==void 0,(e,t,n)=>{t._ir1025=(0,i.readBytes)(e,n())},(e,t)=>{(0,a.writeBytes)(e,t._ir1025)});let O=(0,o.createEnum)(`FrmD`,``,{auto:`Auto`,none:`None`,dispose:`Disp`});l(4e3,e=>e.animations!==void 0,(e,t,n)=>{let r=(0,i.readSignature)(e);if(r===`mani`)(0,i.checkSignature)(e,`IRFR`),(0,i.readSection)(e,1,n=>{for(;n()>0;){(0,i.checkSignature)(e,`8BIM`);let n=(0,i.readSignature)(e);(0,i.readSection)(e,1,r=>{if(n===`AnDs`){let n=(0,c.readVersionAndDescriptor)(e);t.animations={frames:n.FrIn.map(e=>({id:e.FrID,delay:(e.FrDl||0)/100,dispose:e.FrDs?O.decode(e.FrDs):`auto`})),animations:n.FSts.map(e=>({id:e.FsID,frames:e.FsFr,repeats:e.LCnt,activeFrame:e.AFrm||0}))}}else if(n===`Roll`){let t=(0,i.readBytes)(e,r());e.logDevFeatures&&e.log(`#4000 Roll`,t)}else e.logMissingFeatures&&e.log(`Unhandled subsection in #4000`,n)})}});else if(r===`mopt`){let t=(0,i.readBytes)(e,n());e.logDevFeatures&&e.log(`#4000 mopt`,t)}else e.logMissingFeatures&&e.log(`Unhandled key in #4000:`,r)},(e,t)=>{t.animations&&((0,a.writeSignature)(e,`mani`),(0,a.writeSignature)(e,`IRFR`),(0,a.writeSection)(e,1,()=>{(0,a.writeSignature)(e,`8BIM`),(0,a.writeSignature)(e,`AnDs`),(0,a.writeSection)(e,1,()=>{let n={FrIn:[],FSts:[]};for(let e=0;e<t.animations.frames.length;e++){let r=t.animations.frames[e],i={FrID:r.id};r.delay&&(i.FrDl=r.delay*100|0),i.FrDs=O.encode(r.dispose),n.FrIn.push(i)}for(let e=0;e<t.animations.animations.length;e++){let r=t.animations.animations[e],i={FsID:r.id,AFrm:r.activeFrame|0,FsFr:r.frames,LCnt:r.repeats|0};n.FSts.push(i)}(0,c.writeVersionAndDescriptor)(e,``,`null`,n)})}))}),o.MOCK_HANDLERS&&l(4001,e=>e._ir4001!==void 0,(e,t,n)=>{if(o.MOCK_HANDLERS){t._ir4001=(0,i.readBytes)(e,n());return}let r=(0,i.readSignature)(e);if(r===`mfri`){if((0,i.readUint32)(e)!==2)throw Error(`Invalid mfri version`);let t=(0,i.readUint32)(e),n=(0,i.readBytes)(e,t);e.logDevFeatures&&e.log(`mfri`,n)}else if(r===`mset`){let t=(0,c.readVersionAndDescriptor)(e);e.logDevFeatures&&e.log(`mset`,t)}else e.logMissingFeatures&&e.log(`Unhandled key in #4001`,r)},(e,t)=>{(0,a.writeBytes)(e,t._ir4001)}),o.MOCK_HANDLERS&&l(4002,e=>e._ir4002!==void 0,(e,t,n)=>{t._ir4002=(0,i.readBytes)(e,n())},(e,t)=>{(0,a.writeBytes)(e,t._ir4002)})},{"./descriptor":4,"./helpers":8,"./psdReader":13,"./psdWriter":14,"./utf8":16,"base64-js":19}],10:[function(e,t,n){(function(t){(function(){var r=this&&this.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i=this&&this.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(n,"__esModule",{value:!0}),n.decodeLayerPixels=n.writePsdBuffer=n.writePsdUint8Array=n.writePsd=n.readPsd=n.byteArrayToBase64=n.initializeCanvas=void 0;let a=e("./psdWriter"),o=e("./psdReader"),s=e("base64-js");i(e("./abr"),n),i(e("./csh"),n);var c=e("./helpers");Object.defineProperty(n,"initializeCanvas",{enumerable:!0,get:function(){return c.initializeCanvas}}),i(e("./psd"),n),n.byteArrayToBase64=s.fromByteArray;function l(e,t){let n=`buffer`in e?(0,o.createReader)(e.buffer,e.byteOffset,e.byteLength):(0,o.createReader)(e);return(0,o.readPsd)(n,t)}n.readPsd=l;function u(e,t){let n=(0,a.createWriter)();return(0,a.writePsd)(n,e,t),(0,a.getWriterBuffer)(n)}n.writePsd=u;function d(e,t){let n=(0,a.createWriter)();return(0,a.writePsd)(n,e,t),(0,a.getWriterBufferNoCopy)(n)}n.writePsdUint8Array=d;function f(e,n){if(t===void 0)throw Error(`Buffer not supported on this platform`);return t.from(d(e,n))}n.writePsdBuffer=f;function p(e,t){(0,o.decodeLayerImageData)(e,t)}n.decodeLayerPixels=p}).call(this)}).call(this,e("buffer").Buffer)},{"./abr":1,"./csh":3,"./helpers":8,"./psd":12,"./psdReader":13,"./psdWriter":14,"base64-js":19,buffer:20}],11:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.decodeJpeg=void 0;let r=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),i=4017,a=3406,o=2276,s=1567,c=3784,l=5793,u=2896,d=67108864,f=0;function p(e){let t=f+e;if(t>d){let e=Math.ceil((t-d)/1024/1024);throw Error(`Max memory limit exceeded by at least ${e}MB`)}f=t}function m(e,t){let n=16;for(;n>0&&!e[n-1];)n--;let r=[{children:[],index:0}],i=0,a=r[0];for(let o=0;o<n;o++){for(let n=0;n<e[o];n++){for(a=r.pop(),a.children[a.index]=t[i];a.index>0;){if(r.length===0)throw Error(`Could not recreate Huffman Table`);a=r.pop()}for(a.index++,r.push(a);r.length<=o;){let e={children:[],index:0};r.push(e),a.children[a.index]=e.children,a=e}i++}if(o+1<n){let e={children:[],index:0};r.push(e),a.children[a.index]=e.children,a=e}}return r[0].children}function h(e,t,n,i,a,o,s,c,l){let u=n.mcusPerLine,d=n.progressive,f=t,p=0,m=0;function h(){if(m>0)return m--,p>>m&1;if(p=e[t++],p==255){let n=e[t++];if(n)throw Error(`unexpected marker: ${(p<<8|n).toString(16)}`)}return m=7,p>>>7}function g(e){let t=e;for(;;){if(t=t[h()],typeof t==`number`)return t;if(t===void 0)throw Error(`invalid huffman sequence`)}}function _(e){let t=0;for(;e>0;)t=t<<1|h(),e--;return t}function v(e){let t=_(e);return t>=1<<e-1?t:t+(-1<<e)+1}function y(e,t){let n=g(e.huffmanTableDC),i=n===0?0:v(n);t[0]=e.pred+=i;let a=1;for(;a<64;){let n=g(e.huffmanTableAC),i=n&15,o=n>>4;if(i===0){if(o<15)break;a+=16;continue}a+=o;let s=r[a];t[s]=v(i),a++}}function b(e,t){let n=g(e.huffmanTableDC),r=n===0?0:v(n)<<l;t[0]=e.pred+=r}function x(e,t){t[0]|=h()<<l}let S=0;function C(e,t){if(S>0){S--;return}let n=o,i=s;for(;n<=i;){let i=g(e.huffmanTableAC),a=i&15,o=i>>4;if(a===0){if(o<15){S=_(o)+(1<<o)-1;break}n+=16;continue}n+=o;let s=r[n];t[s]=v(a)*(1<<l),n++}}let w=0,T=0;function E(e,t){let n=o,i=s,a=0;for(;n<=i;){let i=r[n],o=t[i]<0?-1:1;switch(w){case 0:let n=g(e.huffmanTableAC),r=n&15;if(a=n>>4,r===0)a<15?(S=_(a)+(1<<a),w=4):(a=16,w=1);else{if(r!==1)throw Error(`invalid ACn encoding`);T=v(r),w=a?2:3}continue;case 1:case 2:t[i]?t[i]+=(h()<<l)*o:(a--,a===0&&(w=w==2?3:0));break;case 3:t[i]?t[i]+=(h()<<l)*o:(t[i]=T<<l,w=0);break;case 4:t[i]&&(t[i]+=(h()<<l)*o)}n++}w===4&&(S--,S===0&&(w=0))}function D(e,t,n,r,i){let a=n/u|0,o=n%u,s=a*e.v+r,c=o*e.h+i;e.blocks[s]!==void 0&&t(e,e.blocks[s][c])}function O(e,t,n){let r=n/e.blocksPerLine|0,i=n%e.blocksPerLine;e.blocks[r]!==void 0&&t(e,e.blocks[r][i])}let k=i.length,A,j;j=d?o===0?c===0?b:x:c===0?C:E:y;let M=0,N;N=k==1?i[0].blocksPerLine*i[0].blocksPerColumn:u*n.mcusPerColumn,a||=N;let P,F,I;for(;M<N;){for(let e=0;e<k;e++)i[e].pred=0;if(S=0,k==1){A=i[0];for(let e=0;e<a;e++)O(A,j,M),M++}else for(let e=0;e<a;e++){for(let e=0;e<k;e++){A=i[e],P=A.h,F=A.v;for(let e=0;e<F;e++)for(let t=0;t<P;t++)D(A,j,M,e,t)}if(M++,M===N)break}if(M===N)do{if(e[t]===255&&e[t+1]!==0)break;t+=1}while(t<e.length-2);if(m=0,I=e[t]<<8|e[t+1],I<65280)throw Error(`marker was not found`);if(I>=65488&&I<=65495)t+=2;else break}return t-f}function g(e){let t=[],n=e.blocksPerLine,r=e.blocksPerColumn,d=n<<3,f=/* @__PURE__ */ new Int32Array(64),m=/* @__PURE__ */ new Uint8Array(64);function h(t,n,r){let d=e.quantizationTable,f=r;for(let e=0;e<64;e++)f[e]=t[e]*d[e];for(let e=0;e<8;++e){let t=8*e;if(f[1+t]==0&&f[2+t]==0&&f[3+t]==0&&f[4+t]==0&&f[5+t]==0&&f[6+t]==0&&f[7+t]==0){let e=l*f[0+t]+512>>10;f[0+t]=e,f[1+t]=e,f[2+t]=e,f[3+t]=e,f[4+t]=e,f[5+t]=e,f[6+t]=e,f[7+t]=e;continue}let n=l*f[0+t]+128>>8,r=l*f[4+t]+128>>8,d=f[2+t],p=f[6+t],m=u*(f[1+t]-f[7+t])+128>>8,h=u*(f[1+t]+f[7+t])+128>>8,g=f[3+t]<<4,_=f[5+t]<<4,v=n-r+1>>1;n=n+r+1>>1,r=v,v=d*c+p*s+128>>8,d=d*s-p*c+128>>8,p=v,v=m-_+1>>1,m=m+_+1>>1,_=v,v=h+g+1>>1,g=h-g+1>>1,h=v,v=n-p+1>>1,n=n+p+1>>1,p=v,v=r-d+1>>1,r=r+d+1>>1,d=v,v=m*o+h*a+2048>>12,m=m*a-h*o+2048>>12,h=v,v=g*799+_*i+2048>>12,g=g*i-_*799+2048>>12,_=v,f[0+t]=n+h,f[7+t]=n-h,f[1+t]=r+_,f[6+t]=r-_,f[2+t]=d+g,f[5+t]=d-g,f[3+t]=p+m,f[4+t]=p-m}for(let e=0;e<8;++e){let t=e;if(f[8+t]==0&&f[16+t]==0&&f[24+t]==0&&f[32+t]==0&&f[40+t]==0&&f[48+t]==0&&f[56+t]==0){let n=l*r[e+0]+8192>>14;f[0+t]=n,f[8+t]=n,f[16+t]=n,f[24+t]=n,f[32+t]=n,f[40+t]=n,f[48+t]=n,f[56+t]=n;continue}let n=l*f[0+t]+2048>>12,d=l*f[32+t]+2048>>12,p=f[16+t],m=f[48+t],h=u*(f[8+t]-f[56+t])+2048>>12,g=u*(f[8+t]+f[56+t])+2048>>12,_=f[24+t],v=f[40+t],y=n-d+1>>1;n=n+d+1>>1,d=y,y=p*c+m*s+2048>>12,p=p*s-m*c+2048>>12,m=y,y=h-v+1>>1,h=h+v+1>>1,v=y,y=g+_+1>>1,_=g-_+1>>1,g=y,y=n-m+1>>1,n=n+m+1>>1,m=y,y=d-p+1>>1,d=d+p+1>>1,p=y,y=h*o+g*a+2048>>12,h=h*a-g*o+2048>>12,g=y,y=_*799+v*i+2048>>12,_=_*i-v*799+2048>>12,v=y,f[0+t]=n+g,f[56+t]=n-g,f[8+t]=d+v,f[48+t]=d-v,f[16+t]=p+_,f[40+t]=p-_,f[24+t]=m+h,f[32+t]=m-h}for(let e=0;e<64;++e){let t=128+(f[e]+8>>4);n[e]=t<0?0:t>255?255:t}}p(d*r*8);for(let i=0;i<r;i++){let r=i<<3;for(let e=0;e<8;e++)t.push(new Uint8Array(d));for(let a=0;a<n;a++){h(e.blocks[i][a],m,f);let n=0,o=a<<3;for(let e=0;e<8;e++){let i=t[r+e];for(let e=0;e<8;e++)i[o+e]=m[n++]}}}return t}function _(e){return e<0?0:e>255?255:e}function v(e){let t={width:0,height:0,comments:[],adobe:void 0,components:[],exifBuffer:void 0,jfif:void 0},n=1e8,i=0;function a(){let t=e[i]<<8|e[i+1];return i+=2,t}function o(){let t=a(),n=e.subarray(i,i+t-2);return i+=n.length,n}function s(e){let t=0,n=0;for(let r in e.components)if(e.components.hasOwnProperty(r)){let i=e.components[r];t<i.h&&(t=i.h),n<i.v&&(n=i.v)}let r=Math.ceil(e.samplesPerLine/8/t),i=Math.ceil(e.scanLines/8/n);for(let a in e.components)if(e.components.hasOwnProperty(a)){let o=e.components[a],s=Math.ceil(Math.ceil(e.samplesPerLine/8)*o.h/t),c=Math.ceil(Math.ceil(e.scanLines/8)*o.v/n),l=r*o.h,u=i*o.v,d=u*l,f=[];p(d*256);for(let e=0;e<u;e++){let e=[];for(let t=0;t<l;t++)e.push(/* @__PURE__ */ new Int32Array(64));f.push(e)}o.blocksPerLine=s,o.blocksPerColumn=c,o.blocks=f}e.maxH=t,e.maxV=n,e.mcusPerLine=r,e.mcusPerColumn=i}let c=null,l=null,u,d=0,f=[],_=[],v=[],y=[],b=a(),x=-1;if(b!=65496)throw Error(`SOI not found`);for(b=a();b!=65497;){switch(b){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:{let e=o();if(b===65534){let n=``;for(let t=0;t<e.byteLength;t++)n+=String.fromCharCode(e[t]);t.comments.push(n)}b===65504&&e[0]===74&&e[1]===70&&e[2]===73&&e[3]===70&&e[4]===0&&(c={version:{major:e[5],minor:e[6]},densityUnits:e[7],xDensity:e[8]<<8|e[9],yDensity:e[10]<<8|e[11],thumbWidth:e[12],thumbHeight:e[13],thumbData:e.subarray(14,14+3*e[12]*e[13])}),b===65505&&e[0]===69&&e[1]===120&&e[2]===105&&e[3]===102&&e[4]===0&&(t.exifBuffer=e.subarray(5,e.length)),b===65518&&e[0]===65&&e[1]===100&&e[2]===111&&e[3]===98&&e[4]===101&&e[5]===0&&(l={version:e[6],flags0:e[7]<<8|e[8],flags1:e[9]<<8|e[10],transformCode:e[11]});break}case 65499:{let t=a()+i-2;for(;i<t;){let t=e[i++];p(256);let n=/* @__PURE__ */ new Int32Array(64);if(!(t>>4))for(let t=0;t<64;t++){let a=r[t];n[a]=e[i++]}else if(t>>4==1)for(let e=0;e<64;e++){let t=r[e];n[t]=a()}else throw Error(`DQT: invalid table spec`);f[t&15]=n}break}case 65472:case 65473:case 65474:{a(),u={extended:b===65473,progressive:b===65474,precision:e[i++],scanLines:a(),samplesPerLine:a(),components:{},componentsOrder:[],maxH:0,maxV:0,mcusPerLine:0,mcusPerColumn:0};let t=u.scanLines*u.samplesPerLine;if(t>n){let e=Math.ceil((t-n)/1e6);throw Error(`maxResolutionInMP limit exceeded by ${e}MP`)}let r=e[i++];for(let t=0;t<r;t++){let t=e[i],n=e[i+1]>>4,r=e[i+1]&15,a=e[i+2];u.componentsOrder.push(t),u.components[t]={h:n,v:r,quantizationIdx:a,blocksPerColumn:0,blocksPerLine:0,blocks:[],pred:0},i+=3}s(u),_.push(u);break}case 65476:{let t=a();for(let n=2;n<t;){let t=e[i++],r=/* @__PURE__ */ new Uint8Array(16),a=0;for(let t=0;t<16;t++,i++)a+=r[t]=e[i];p(16+a);let o=new Uint8Array(a);for(let t=0;t<a;t++,i++)o[t]=e[i];n+=17+a;let s=t&15,c=t>>4?v:y;c[s]=m(r,o)}break}case 65501:a(),d=a();break;case 65500:a(),a();break;case 65498:{a();let t=e[i++],n=[];for(let r=0;r<t;r++){let t=u.components[e[i++]],r=e[i++];t.huffmanTableDC=y[r>>4],t.huffmanTableAC=v[r&15],n.push(t)}let r=e[i++],o=e[i++],s=e[i++],c=h(e,i,u,n,d,r,o,s>>4,s&15);i+=c;break}case 65535:e[i]!==255&&i--;break;default:if(e[i-3]==255&&e[i-2]>=192&&e[i-2]<=254){i-=3;break}if(b===224||b==225){if(x!==-1)throw Error(`first unknown JPEG marker at offset ${x.toString(16)}, second unknown JPEG marker ${b.toString(16)} at offset ${(i-1).toString(16)}`);x=i-1;let t=a();if(e[i+t-2]===255){i+=t-2;break}}throw Error(`unknown JPEG marker `+b.toString(16))}b=a()}if(_.length!=1)throw Error(`only single frame JPEGs supported`);for(let e=0;e<_.length;e++){let t=_[e].components;for(let e in t)t[e].quantizationTable=f[t[e].quantizationIdx],delete t[e].quantizationIdx}t.width=u.samplesPerLine,t.height=u.scanLines,t.jfif=c,t.adobe=l,t.components=[];for(let e=0;e<u.componentsOrder.length;e++){let n=u.components[u.componentsOrder[e]];t.components.push({lines:g(n),scaleX:n.h/u.maxH,scaleY:n.v/u.maxV})}return t}function y(e){let t=0,n=!1,r=e.width,i=e.height,a=r*i*e.components.length;p(a);let o=new Uint8Array(a);switch(e.components.length){case 1:{let n=e.components[0];for(let e=0;e<i;e++){let i=n.lines[0|e*n.scaleY];for(let e=0;e<r;e++){let r=i[0|e*n.scaleX];o[t++]=r}}break}case 2:{let n=e.components[0],a=e.components[1];for(let e=0;e<i;e++){let i=n.lines[0|e*n.scaleY],s=a.lines[0|e*a.scaleY];for(let e=0;e<r;e++){let r=i[0|e*n.scaleX];o[t++]=r;let c=s[0|e*a.scaleX];o[t++]=c}}break}case 3:{n=!0,e.adobe&&e.adobe.transformCode&&(n=!0);let a=e.components[0],s=e.components[1],c=e.components[2];for(let e=0;e<i;e++){let i=a.lines[0|e*a.scaleY],l=s.lines[0|e*s.scaleY],u=c.lines[0|e*c.scaleY];for(let e=0;e<r;e++){let r,d,f,p,m,h;n?(r=i[0|e*a.scaleX],d=l[0|e*s.scaleX],f=u[0|e*c.scaleX],p=_(r+1.402*(f-128)),m=_(r-.3441363*(d-128)-.71413636*(f-128)),h=_(r+1.772*(d-128))):(p=i[0|e*a.scaleX],m=l[0|e*s.scaleX],h=u[0|e*c.scaleX]),o[t++]=p,o[t++]=m,o[t++]=h}}break}case 4:{if(!e.adobe)throw Error(`Unsupported color mode (4 components)`);n=!1,e.adobe&&e.adobe.transformCode&&(n=!0);let a=e.components[0],s=e.components[1],c=e.components[2],l=e.components[3];for(let e=0;e<i;e++){let i=a.lines[0|e*a.scaleY],u=s.lines[0|e*s.scaleY],d=c.lines[0|e*c.scaleY],f=l.lines[0|e*l.scaleY];for(let e=0;e<r;e++){let r,p,m,h,g,v,y;n?(r=i[0|e*a.scaleX],p=u[0|e*s.scaleX],m=d[0|e*c.scaleX],h=f[0|e*l.scaleX],g=255-_(r+1.402*(m-128)),v=255-_(r-.3441363*(p-128)-.71413636*(m-128)),y=255-_(r+1.772*(p-128))):(g=i[0|e*a.scaleX],v=u[0|e*s.scaleX],y=d[0|e*c.scaleX],h=f[0|e*l.scaleX]),o[t++]=255-g,o[t++]=255-v,o[t++]=255-y,o[t++]=255-h}}break}default:throw Error(`Unsupported color mode`)}return o}function b(e,t){if(f=0,e.length===0)throw Error(`Empty jpeg buffer`);let n=v(e);p(n.width*n.height*4);let r=y(n),i=t(n.width,n.height),a=i.width,o=i.height,s=i.data,c=0,l=0;switch(n.components.length){case 1:for(let e=0;e<o;e++)for(let e=0;e<a;e++){let e=r[c++];s[l++]=e,s[l++]=e,s[l++]=e,s[l++]=255}break;case 3:for(let e=0;e<o;e++)for(let e=0;e<a;e++){let e=r[c++],t=r[c++],n=r[c++];s[l++]=e,s[l++]=t,s[l++]=n,s[l++]=255}break;case 4:for(let e=0;e<o;e++)for(let e=0;e<a;e++){let e=r[c++],t=r[c++],n=r[c++],i=r[c++],a=255-_(e*(1-i/255)+i),o=255-_(t*(1-i/255)+i),u=255-_(n*(1-i/255)+i);s[l++]=a,s[l++]=o,s[l++]=u,s[l++]=255}break;default:throw Error(`Unsupported color mode`)}return i}n.decodeJpeg=b},{}],12:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.Compression=n.ChannelID=n.LayerCompCapturedInfo=n.SectionDividerType=n.ColorMode=void 0,(function(e){e[e.Bitmap=0]=`Bitmap`,e[e.Grayscale=1]=`Grayscale`,e[e.Indexed=2]=`Indexed`,e[e.RGB=3]=`RGB`,e[e.CMYK=4]=`CMYK`,e[e.Multichannel=7]=`Multichannel`,e[e.Duotone=8]=`Duotone`,e[e.Lab=9]=`Lab`})(n.ColorMode||={}),(function(e){e[e.Other=0]=`Other`,e[e.OpenFolder=1]=`OpenFolder`,e[e.ClosedFolder=2]=`ClosedFolder`,e[e.BoundingSectionDivider=3]=`BoundingSectionDivider`})(n.SectionDividerType||={}),(function(e){e[e.None=0]=`None`,e[e.Visibility=1]=`Visibility`,e[e.Position=2]=`Position`,e[e.Appearance=4]=`Appearance`})(n.LayerCompCapturedInfo||={}),(function(e){e[e.Color0=0]=`Color0`,e[e.Color1=1]=`Color1`,e[e.Color2=2]=`Color2`,e[e.Color3=3]=`Color3`,e[e.Transparency=-1]=`Transparency`,e[e.UserMask=-2]=`UserMask`,e[e.RealUserMask=-3]=`RealUserMask`})(n.ChannelID||={}),(function(e){e[e.RawData=0]=`RawData`,e[e.RleCompressed=1]=`RleCompressed`,e[e.ZipWithoutPrediction=2]=`ZipWithoutPrediction`,e[e.ZipWithPrediction=3]=`ZipWithPrediction`})(n.Compression||={})},{}],13:[function(e,t,n){var r=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(n,"__esModule",{value:!0}),n.readPattern=n.readColor=n.readSection=n.readDataRLE=n.readDataZip=n.createImageDataBitDepth=n.readAdditionalLayerInfo=n.readGlobalLayerMaskInfo=n.decodeLayerImageData=n.readLayerInfo=n.readPsd=n.checkSignature=n.skipBytes=n.readAsciiString=n.readUnicodeStringWithLengthLE=n.readUnicodeStringWithLength=n.readUnicodeString=n.readPascalString=n.validSignatureAt=n.readSignature=n.readBytes=n.readFixedPointPath32=n.readFixedPoint32=n.readFloat64=n.readFloat32=n.readUint32=n.readInt32LE=n.readInt32=n.readUint16LE=n.readUint16=n.readInt16=n.peekUint8=n.readUint8=n.warnOrThrow=n.createReader=n.supportedColorModes=void 0;let i=e("pako"),a=e("./helpers"),o=e("./additionalInfo"),s=e("./imageResources");n.supportedColorModes=[0,1,3,2];let c=[`bitmap`,`grayscale`,`indexed`,`RGB`,`CMYK`,`multichannel`,`duotone`,`lab`];function l(e){let t=e.width*e.height*4;for(let n=0;n<t;n+=4){let t=e.data[n];e.data[n+1]=t,e.data[n+2]=t}}function u(e,t,n){return{view:new DataView(e,t,n),offset:0,strict:!1,debug:!1,large:!1,globalAlpha:!1,log:console.log}}n.createReader=u;function d(e,t){if(e.strict)throw Error(t);e.debug&&e.log(t)}n.warnOrThrow=d;function f(e){return e.offset+=1,e.view.getUint8(e.offset-1)}n.readUint8=f;function p(e){return e.view.getUint8(e.offset)}n.peekUint8=p;function m(e){return e.offset+=2,e.view.getInt16(e.offset-2,!1)}n.readInt16=m;function h(e){return e.offset+=2,e.view.getUint16(e.offset-2,!1)}n.readUint16=h;function g(e){return e.offset+=2,e.view.getUint16(e.offset-2,!0)}n.readUint16LE=g;function _(e){return e.offset+=4,e.view.getInt32(e.offset-4,!1)}n.readInt32=_;function v(e){return e.offset+=4,e.view.getInt32(e.offset-4,!0)}n.readInt32LE=v;function y(e){return e.offset+=4,e.view.getUint32(e.offset-4,!1)}n.readUint32=y;function b(e){return e.offset+=4,e.view.getFloat32(e.offset-4,!1)}n.readFloat32=b;function x(e){return e.offset+=8,e.view.getFloat64(e.offset-8,!1)}n.readFloat64=x;function S(e){return _(e)/65536}n.readFixedPoint32=S;function C(e){return _(e)/(1<<24)}n.readFixedPointPath32=C;function w(e,t){let n=e.view.byteOffset+e.offset;if(e.offset+=t,n+t>e.view.buffer.byteLength){if(d(e,`Reading bytes exceeding buffer length`),t>104857600)throw Error(`Reading past end of file`);let r=new Uint8Array(t),i=Math.min(t,e.view.byteLength-n);return i>0&&r.set(new Uint8Array(e.view.buffer,n,i)),r}return new Uint8Array(e.view.buffer,n,t)}n.readBytes=w;function T(e){return P(e,4)}n.readSignature=T;function E(e,t){let n=String.fromCharCode(e.view.getUint8(t))+String.fromCharCode(e.view.getUint8(t+1))+String.fromCharCode(e.view.getUint8(t+2))+String.fromCharCode(e.view.getUint8(t+3));return n==`8BIM`||n==`8B64`}n.validSignatureAt=E;function D(e,t){let n=f(e),r=n?P(e,n):``;for(;++n%t;)e.offset++;return r}n.readPascalString=D;function O(e){return k(e,y(e))}n.readUnicodeString=O;function k(e,t){let n=``;for(;t--;){let r=h(e);(r||t>0)&&(n+=String.fromCharCode(r))}return n}n.readUnicodeStringWithLength=k;function A(e,t){let n=``;for(;t--;){let r=g(e);(r||t>0)&&(n+=String.fromCharCode(r))}return n}n.readUnicodeStringWithLengthLE=A;function j(e,t){let n=``;for(;t--;)n+=String.fromCharCode(f(e));return n}n.readAsciiString=j;function M(e,t){e.offset+=t}n.skipBytes=M;function N(e,t,n){let r=e.offset,i=T(e);if(i!==t&&i!==n)throw Error(`Invalid signature: '${i}' at 0x${r.toString(16)}`)}n.checkSignature=N;function P(e,t){let n=w(e,t),r=``;for(let e=0;e<n.length;e++)r+=String.fromCharCode(n[e]);return r}function F(e){return e===`8BIM`||e===`MeSa`||e===`AgHg`||e===`PHUT`||e===`DCSR`}function I(e,t={}){N(e,`8BPS`);let i=h(e);if(i!==1&&i!==2)throw Error(`Invalid PSD file version: ${i}`);M(e,6);let a=h(e),o=y(e),l=y(e),u=h(e),d=h(e),m=i===1?3e4:3e5;if(l>m||o>m)throw Error(`Invalid size: ${l}x${o}`);if(a>16)throw Error(`Invalid channel count: ${a}`);if(![1,8,16,32].includes(u))throw Error(`Invalid bitsPerChannel: ${u}`);if(n.supportedColorModes.indexOf(d)===-1)throw Error(`Color mode not supported: ${c[d]??d}`);let g={width:l,height:o,channels:a,bitsPerChannel:u,colorMode:d};Object.assign(e,t),e.large=i===2,e.globalAlpha=!1,fe(e,1,t=>{if(t()){if(d===2){if(t()!=768)throw Error(`Invalid color palette size`);g.palette=[];for(let t=0;t<256;t++)g.palette.push({r:f(e),g:0,b:0});for(let t=0;t<256;t++)g.palette[t].g=f(e);for(let t=0;t<256;t++)g.palette[t].b=f(e)}M(e,t())}});let _={};fe(e,1,t=>{for(;t()>0;){ae(e,F);let t=h(e);D(e,2),fe(e,2,n=>{let r=s.resourceHandlersMap[t],i=t===1036&&!!e.skipThumbnail;if(r&&!i)try{r.read(e,_,n)}catch(t){if(e.throwForMissingFeatures)throw t;M(e,n())}else M(e,n())})}});let{layersGroup:v,layerGroupsEnabledId:b}=_,x=r(_,[`layersGroup`,`layerGroupsEnabledId`]);Object.keys(x)&&(g.imageResources=x),fe(e,1,t=>{if(fe(e,2,t=>{L(e,g,_),M(e,t())},void 0,e.large),t()>0){let t=V(e);t&&(g.globalLayerMaskInfo=t)}else M(e,t());for(;t()>0;){for(;t()&&p(e)===0;)M(e,1);t()>=12?U(e,g,g,_):M(e,t())}},void 0,e.large);let S=g.children&&g.children.length;return e.skipCompositeImageData&&(e.skipLayerImageData||S)||se(e,g),g}n.readPsd=I;function L(e,t,n){let{layersGroup:r=[],layerGroupsEnabledId:i=[]}=n,o=m(e);o<0&&(e.globalAlpha=!0,o=-o);let s=[],c=[];for(let a=0;a<o;a++){let{layer:o,channels:l}=R(e,t,n);r[a]!==void 0&&(o.linkGroup=r[a]),i[a]!==void 0&&(o.linkGroupEnabled=!!i[a]),s.push(o),c.push(l)}for(let n=0;n<o;n++)B(e,t,s[n],c[n]);t.children||=[];let l=[t];for(let e=s.length-1;e>=0;e--){let t=s[e],n=t.sectionDivider?t.sectionDivider.type:0;n===1||n===2?(t.opened=n===1,t.children=[],t.sectionDivider?.key&&(t.blendMode=a.toBlendMode[t.sectionDivider.key]??t.blendMode),l[l.length-1].children.unshift(t),l.push(t)):n===3?l.pop():l[l.length-1].children.unshift(t)}}n.readLayerInfo=L;function R(e,t,n){let r={};r.top=_(e),r.left=_(e),r.bottom=_(e),r.right=_(e);let i=h(e),o=[];for(let t=0;t<i;t++){let t=m(e),n=y(e);if(e.large){if(n!==0)throw Error(`Sizes larger than 4GB are not supported`);n=y(e)}o.push({id:t,length:n})}N(e,`8BIM`);let s=T(e);if(!a.toBlendMode[s])throw Error(`Invalid blend mode: '${s}'`);r.blendMode=a.toBlendMode[s],r.opacity=f(e)/255,r.clipping=f(e)===1;let c=f(e);return r.transparencyProtected=!!(c&1),r.hidden=!!(c&2),c&32&&(r.effectsOpen=!0),M(e,1),fe(e,1,i=>{ee(e,r);let a=z(e);for(a&&(r.blendingRanges=a),r.name=D(e,1);i()>4&&!E(e,e.offset);)e.offset++;for(;i()>=12;)U(e,r,t,n);M(e,i())}),{layer:r,channels:o}}function ee(e,t){return fe(e,1,n=>{if(!n())return;let r={};t.mask=r,r.top=_(e),r.left=_(e),r.bottom=_(e),r.right=_(e),r.defaultColor=f(e);let i=f(e);if(r.positionRelativeToLayer=!!(i&1),r.disabled=!!(i&2),r.fromVectorData=!!(i&8),n()>=18){let n={};t.realMask=n;let r=f(e);n.positionRelativeToLayer=!!(r&1),n.disabled=!!(r&2),n.fromVectorData=!!(r&8),n.defaultColor=f(e),n.top=_(e),n.left=_(e),n.bottom=_(e),n.right=_(e)}if(i&16){let t=f(e);t&1&&(r.userMaskDensity=f(e)/255),t&2&&(r.userMaskFeather=x(e)),t&4&&(r.vectorMaskDensity=f(e)/255),t&8&&(r.vectorMaskFeather=x(e))}M(e,n())})}function te(e){return[f(e),f(e),f(e),f(e)]}function z(e){return fe(e,1,t=>{let n=te(e),r=te(e),i=[];for(;t()>0;){let t=te(e),n=te(e);i.push({sourceRange:t,destRange:n})}return{compositeGrayBlendSource:n,compositeGraphBlendDestinationRange:r,ranges:i}})}function B(e,t,n,r){if(e.skipLayerImageData)return;let{colorMode:i=3,bitsPerChannel:a=8}=t;n.rawData={colorMode:i,bitsPerChannel:a,channels:[],large:e.large};for(let t of r){let r=e.offset,i=0,a;if(t.length===1)throw Error(`Invalid channel length`);if(t.length){if(i=h(e),i>3&&(--e.offset,i=h(e)),i>3&&(e.offset-=3,i=h(e)),i>3)throw Error(`Invalid compression: ${i}`);t.length>2&&(a=w(e,t.length-2))}e.offset=r+t.length,n.rawData.channels.push({id:t.id,compression:i,data:a})}e.useRawData||re(n,!!e.useImageData,!!e.throwForMissingFeatures)}function ne({data:e},t){let n=e instanceof Float32Array?1:e instanceof Uint16Array?65535:255,r=(t?4:3)|0,i=e.length|0,a=(t?5:4)|0;for(let t=r;t<i;t=t+a|0)e[t]=n}function re(e,t,n){if(!e.rawData)return;let{colorMode:r,bitsPerChannel:i,channels:o,large:s}=e.rawData,c=(e.right||0)-(e.left||0),d=(e.bottom||0)-(e.top||0),f=r===4,p,m=!1;if(c&&d){if(f){if(i!==8)throw Error(`bitsPerChannel Not supproted`);p={width:c,height:d,data:new Uint8ClampedArray(c*d*5)}}else p=W(c,d,i)}a.RAW_IMAGE_DATA&&(e.imageDataRaw=[],e.imageDataRawCompression=[]);for(let{id:h,compression:g,data:_}of o){if(!_)continue;let o=u(_.buffer,_.byteOffset,_.byteLength);if(h===-2||h===-3){let n=h===-2?e.mask:e.realMask;if(!n)throw Error(`Missing layer ${h===-2?`mask`:`real mask`} data`);let r=(n.right||0)-(n.left||0),c=(n.bottom||0)-(n.top||0);if(r<0||c<0||r>3e4||c>3e4)throw Error(`Invalid mask size`);if(r&&c){let u=W(r,c,i);ie(o,_.byteLength,u,g,r,c,i,0,s,4),a.RAW_IMAGE_DATA&&(h===-2?(e.maskDataRawCompression=g,e.maskDataRaw=_):(e.realMaskDataRawCompression=g,e.realMaskDataRaw=_)),l(u),ne(u,!1),t?n.imageData=u:n.canvas=(0,a.imageDataToCanvas)(u)}}else{let t=(0,a.offsetForChannel)(h,f),u=p;if(t<0&&(u=void 0,n))throw Error(`Channel not supported: ${h}`);ie(o,_.byteLength,u,g,c,d,i,t,s,f?5:4),a.RAW_IMAGE_DATA&&(e.imageDataRawCompression[h]=g,e.imageDataRaw[h]=_),u&&r===1&&l(u)}h===-1&&(m=!0)}if(p){if(m||ne(p,f),f){let e=p;p=(0,a.createImageData)(e.width,e.height),ce(e,p,!1)}t?e.imageData=p:e.canvas=(0,a.imageDataToCanvas)(p)}delete e.rawData}n.decodeLayerImageData=re;function ie(e,t,n,r,i,a,o,s,c,l){if(t){if(r===0)t!==i*a*Math.floor(o/8)&&e.log(`Invalid length (${t}, ${i*a*Math.floor(o/8)})`),J(w(e,t),n,o,l,s);else if(r===1)de(e,n,i,a,o,l,[s],c);else if(r===2)ue(w(e,t),n,i,a,o,l,s,!1);else if(r===3)ue(w(e,t),n,i,a,o,l,s,!0);else throw Error(`Invalid Compression type: ${r}`)}}function V(e){return fe(e,1,t=>{if(!t())return;let n=h(e),r=h(e),i=h(e),a=h(e),o=h(e),s=h(e)/255,c=f(e);return M(e,t()),{overlayColorSpace:n,colorSpace1:r,colorSpace2:i,colorSpace3:a,colorSpace4:o,opacity:s,kind:c}})}n.readGlobalLayerMaskInfo=V;let H=[0,1,-1,2,-2,3,-3,4,-4];function ae(e,t){let n=e.offset,r=``;for(let i of H){try{e.offset=n+i,r=T(e)}catch{}if(t(r))break}if(!t(r))throw Error(`Invalid signature: '${r}' at 0x${n.toString(16)}`);return r}function oe(e){return e===`8BIM`||e===`8B64`}function U(e,t,n,r){let i=ae(e,oe),s=T(e);fe(e,2,i=>{let a=o.infoHandlersMap[s];if(a)try{a.read(e,t,i,n,r)}catch(t){if(e.throwForMissingFeatures)throw t}else e.logMissingFeatures&&e.log(`Unhandled additional info: ${s}`),M(e,i());i()&&(e.logMissingFeatures&&e.log(`Unread ${i()} bytes left for additional info: ${s}`),M(e,i()))},!1,i===`8B64`||e.large&&a.largeAdditionalInfoKeys.indexOf(s)!==-1)}n.readAdditionalLayerInfo=U;function W(e,t,n,r=4){if(n===1||n===8)return r===4?(0,a.createImageData)(e,t):{width:e,height:t,data:new Uint8ClampedArray(e*t*r)};if(n===16)return{width:e,height:t,data:new Uint16Array(e*t*r)};if(n===32)return{width:e,height:t,data:new Float32Array(e*t*r)};throw Error(`Invalid bitDepth (${n})`)}n.createImageDataBitDepth=W;function se(e,t){let r=h(e),i=t.bitsPerChannel??8;if(n.supportedColorModes.indexOf(t.colorMode)===-1)throw Error(`Color mode not supported: ${t.colorMode}`);if(r!==0&&r!==1)throw Error(`Compression type not supported: ${r}`);let o=W(t.width,t.height,i);switch((0,a.resetImageData)(o),t.colorMode){case 0:{if(i!==1)throw Error(`Invalid bitsPerChannel for bitmap color mode`);let n;if(r===0)n=w(e,Math.ceil(t.width/8)*t.height);else if(r===1)n=new Uint8Array(t.width*t.height),de(e,{data:n,width:t.width,height:t.height},t.width,t.height,8,1,[0],e.large);else throw Error(`Bitmap compression not supported: ${r}`);(0,a.decodeBitmap)(n,o.data,t.width,t.height);break}case 3:case 1:{let n=t.colorMode===1?[0]:[0,1,2];if(t.channels&&t.channels>3)for(let e=3;e<t.channels;e++)n.push(e);else e.globalAlpha&&n.push(3);if(r===0)for(let r=0;r<n.length;r++)J(w(e,t.width*t.height*Math.floor(i/8)),o,i,4,n[r]);else if(r===1){let r=e.offset;de(e,o,t.width,t.height,i,4,n,e.large),a.RAW_IMAGE_DATA&&(t.imageDataRaw=new Uint8Array(e.view.buffer,e.view.byteOffset+r,e.offset-r))}t.colorMode===1&&l(o);break}case 2:if(i!==8)throw Error(`bitsPerChannel Not supproted`);if(t.channels!==1)throw Error(`Invalid channel count`);if(!t.palette)throw Error(`Missing color palette`);if(r===0)throw Error(`Not implemented`);if(r===1){let n={width:o.width,height:o.height,data:new Uint8Array(o.width*o.height)};de(e,n,t.width,t.height,i,1,[0],e.large),G(n,o,t.palette)}else throw Error(`Not implemented`);break;case 4:{if(i!==8)throw Error(`bitsPerChannel Not supproted`);if(t.channels!==4)throw Error(`Invalid channel count`);let n=[0,1,2,3];if(e.globalAlpha&&n.push(4),r===0)throw Error(`Not implemented`);if(r===1){let r={width:o.width,height:o.height,data:new Uint8Array(o.width*o.height*5)},s=e.offset;de(e,r,t.width,t.height,i,5,n,e.large),ce(r,o,!0),a.RAW_IMAGE_DATA&&(t.imageDataRaw=new Uint8Array(e.view.buffer,e.view.byteOffset+s,e.offset-s))}else throw Error(`Not implemented`);break}default:throw Error(`Color mode not supported: ${t.colorMode}`)}if(e.globalAlpha){if(t.bitsPerChannel!==8)throw Error(`bitsPerChannel Not supproted`);let e=o.data,n=o.width*o.height*4;for(let t=0;t<n;t+=4){let n=e[t+3];if(n!=0&&n!=255){let r=1/(n/255),i=255*(1-r);e[t+0]=e[t+0]*r+i,e[t+1]=e[t+1]*r+i,e[t+2]=e[t+2]*r+i}}}e.useImageData?t.imageData=o:t.canvas=(0,a.imageDataToCanvas)(o)}function ce(e,t,n){let r=t.width*t.height*4,i=e.data,a=t.data;for(let e=0,t=0;t<r;e+=5,t+=4){let r=i[e],o=i[e+1],s=i[e+2],c=i[e+3];a[t]=(r*c|0)/255|0,a[t+1]=(o*c|0)/255|0,a[t+2]=(s*c|0)/255|0,a[t+3]=n?255-i[e+4]:i[e+4]}}function G(e,t,n){let r=e.width*e.height,i=e.data,a=t.data;for(let e=0,t=0;e<r;e++,t+=4){let r=n[i[e]];a[t+0]=r.r,a[t+1]=r.g,a[t+2]=r.b,a[t+3]=255}}function le(e,t){if(e.byteLength/e.length!==t.byteLength/t.length)throw Error(`Invalid array types`)}function K(e,t){if(t===8)return e;if(t===16){for(let t=0;t<e.byteLength;t+=2){let n=e[t];e[t]=e[t+1],e[t+1]=n}if(e.byteOffset%2){let t=new Uint16Array(e.byteLength/2);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength).set(e),t}return new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2)}if(t===32){if(e.byteOffset%4){let t=new Float32Array(e.byteLength/4);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength).set(e),t}return new Float32Array(e.buffer,e.byteOffset,e.byteLength/4)}throw Error(`Invalid bitDepth (${t})`)}function q(e,t,n,r){le(e.data,t);let i=e.width*e.height,a=e.data;for(let e=0,o=n|0;e<i;e++,o=o+r|0)a[o]=t[e]}function J(e,t,n,r,i){if(n==32)for(let t=0;t<e.byteLength;t+=4){let n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3];e[t+0]=a,e[t+1]=i,e[t+2]=r,e[t+3]=n}let a=K(e,n);t&&i<r&&q(t,a,i,r)}function Y(e,t,n,r){for(let i=0;i<n;i++){let n=i*t;for(let i=1,a=n+1;i<t;i++,a++)e[a]=(e[a-1]+e[a])%r}}function ue(e,t,n,r,a,o,s,c){let l=(0,i.inflate)(e);if(t&&s<o){let e=K(l,a);if(a===8)c&&Y(l,n,r,256),q(t,l,s,o);else if(a===16)c&&Y(e,n,r,65536),q(t,e,s,o);else if(a===32){c&&Y(l,n*4,r,256);let e=s,i=new Uint32Array(t.data.buffer,t.data.byteOffset,t.data.length);for(let t=0;t<r;t++){let r=n*4*t;for(let t=0;t<n;t++,r++,e+=o){let t=r+n,a=t+n,o=a+n;i[e]=(l[r]<<24|l[t]<<16|l[a]<<8|l[o])>>>0}}}else throw Error(`Invalid bitDepth`)}}n.readDataZip=ue;function de(e,t,n,r,i,a,o,s){let c=t&&t.data,l;if(s){l=new Uint32Array(o.length*r);for(let t=0,n=0;t<o.length;t++)for(let t=0;t<r;t++,n++)l[n]=y(e)}else{l=new Uint16Array(o.length*r);for(let t=0,n=0;t<o.length;t++)for(let t=0;t<r;t++,n++)l[n]=h(e)}let u=a-1|0;for(let t=0,i=0;t<o.length;t++){let s=o[t]|0;if(!c||t>u||s>u)for(let t=0;t<r;t++,i++)M(e,l[i]);else for(let t=0,o=s|0;t<r;t++,i++){let t=l[i],r=w(e,t);for(let e=0,i=0;e<t;e++){let t=r[e];if(t>128){let s=r[++e];t=256-t|0;for(let e=0;e<=t&&i<n;e=e+1|0,i=i+1|0)c[o]=s,o=o+a|0}else if(t<128)for(let s=0;s<=t&&i<n;s=s+1|0,i=i+1|0)c[o]=r[++e],o=o+a|0}}}}n.readDataRLE=de;function fe(e,t,n,r=!0,i=!1){let a=y(e);if(i){if(a!==0)throw Error(`Sizes larger than 4GB are not supported`);a=y(e)}if(a<=0&&r)return;let o=e.offset+a;if(o>e.view.byteLength)throw Error(`Section exceeds file size`);let s=n(()=>o-e.offset);for(e.offset!==o&&(e.offset>o?d(e,`Exceeded section limits`):d(e,`Unread section data`));a%t;)a++,o++;return e.offset=o,s}n.readSection=fe;function X(e){switch(h(e)){case 0:{let t=h(e)/257,n=h(e)/257,r=h(e)/257;return M(e,2),{r:t,g:n,b:r}}case 1:{let t=h(e)/65535,n=h(e)/65535,r=h(e)/65535;return M(e,2),{h:t,s:n,b:r}}case 2:return{c:h(e)/257,m:h(e)/257,y:h(e)/257,k:h(e)/257};case 7:{let t=m(e)/1e4,n=m(e),r=m(e),i=n<0?n/12800:n/12700,a=r<0?r/12800:r/12700;return M(e,2),{l:t,a:i,b:a}}case 8:{let t=h(e)*255/1e4;return M(e,6),{k:t}}default:throw Error(`Invalid color space`)}}n.readColor=X;function Z(e){let t=y(e);for(;t%4;)t++;let n=e.offset+t,r=y(e);if(r!==1)throw Error(`Invalid pattern version: ${r}`);let i=y(e),a=m(e),o=m(e);if(i!==3&&i!==1&&i!==2)throw Error(`Unsupported pattern color mode: ${i}`);let s=O(e),c=D(e,1),d=[];if(i===2){for(let t=0;t<256;t++)d.push({r:f(e),g:f(e),b:f(e)});M(e,4)}let p=y(e);if(p!==3)throw Error(`Invalid pattern VMAL version: ${p}`);y(e);let g=y(e),_=y(e),v=y(e),b=y(e),x=y(e),S=b-_,C=v-g,T=new Uint8Array(S*C*4);for(let e=3;e<T.byteLength;e+=4)T[e]=255;for(let t=0,n=0;t<x+2;t++){if(!y(e))continue;let t=y(e),r=y(e),a=y(e),o=y(e),s=y(e),c=y(e),d=h(e),p=f(e),m=w(e,t-23);if(r!==8||d!==8)throw Error(`16bit pixel depth not supported for patterns`);let v=c-o,b=s-a,x=o-_,E=a-g;if(p===0){if(i===3&&n<3)for(let e=0;e<b;e++)for(let t=0;t<v;t++){let r=t+e*v,i=(x+t+(e+E)*S)*4;T[i+n]=m[r]}if(i===1&&n<1)for(let e=0;e<b;e++)for(let t=0;t<v;t++){let n=t+e*v,r=(x+t+(e+E)*S)*4,i=m[n];T[r+0]=i,T[r+1]=i,T[r+2]=i}if(i===2)throw Error(`Indexed pattern color mode not implemented`)}else if(p===1){let e={data:T,width:S,height:C},t={data:new Uint8Array(v*b),width:v,height:b},r=u(m.buffer,m.byteOffset,m.byteLength);if(i===3&&n<3&&(de(r,t,v,b,8,1,[0],!1),pe(t,e,x,E,n)),i===1&&n<1&&(de(r,t,v,b,8,1,[0],!1),pe(t,e,x,E,0),l(e)),i===2)throw Error(`Indexed pattern color mode not implemented`)}else throw Error(`Invalid pattern compression mode`);n++}return e.offset=n,{id:c,name:s,x:a,y:o,bounds:{x:_,y:g,w:S,h:C},data:T}}n.readPattern=Z;function pe(e,t,n,r,i){let a=e.width,o=e.height,s=t.width;for(let c=0;c<o;c++)for(let o=0;o<a;o++){let l=o+c*a,u=(n+o+(c+r)*s)*4,d=e.data[l];t.data[u+i]=d}}},{"./additionalInfo":2,"./helpers":8,"./imageResources":9,pako:36}],14:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.writePattern=n.writeColor=n.writePsd=n.writeSection=n.writeUnicodeStringWithPadding=n.writeUnicodeString=n.writeUnicodeStringWithoutLengthLE=n.writeUnicodeStringWithoutLength=n.writePascalString=n.writeAsciiString=n.writeSignature=n.writeZeros=n.writeBytes=n.writeFixedPointPath32=n.writeFixedPoint32=n.writeFloat64=n.writeFloat32=n.writeUint32=n.writeInt32LE=n.writeInt32=n.writeUint16LE=n.writeUint16=n.writeInt16=n.writeUint8=n.getWriterBufferNoCopy=n.getWriterBuffer=n.createWriter=void 0;let r=e("./helpers"),i=e("./additionalInfo"),a=e("./imageResources");function o(e=4096){let t=new ArrayBuffer(e);return{buffer:t,view:new DataView(t),offset:0,tempBuffer:void 0}}n.createWriter=o;function s(e){return e.buffer.slice(0,e.offset)}n.getWriterBuffer=s;function c(e){return new Uint8Array(e.buffer,0,e.offset)}n.getWriterBufferNoCopy=c;function l(e,t){let n=B(e,1);e.view.setUint8(n,t)}n.writeUint8=l;function u(e,t){let n=B(e,2);e.view.setInt16(n,t,!1)}n.writeInt16=u;function d(e,t){let n=B(e,2);e.view.setUint16(n,t,!1)}n.writeUint16=d;function f(e,t){let n=B(e,2);e.view.setUint16(n,t,!0)}n.writeUint16LE=f;function p(e,t){let n=B(e,4);e.view.setInt32(n,t,!1)}n.writeInt32=p;function m(e,t){let n=B(e,4);e.view.setInt32(n,t,!0)}n.writeInt32LE=m;function h(e,t){let n=B(e,4);e.view.setUint32(n,t,!1)}n.writeUint32=h;function g(e,t){let n=B(e,4);e.view.setFloat32(n,t,!1)}n.writeFloat32=g;function _(e,t){let n=B(e,8);e.view.setFloat64(n,t,!1)}n.writeFloat64=_;function v(e,t){p(e,t*65536)}n.writeFixedPoint32=v;function y(e,t){p(e,t*(1<<24))}n.writeFixedPointPath32=y;function b(e,t){t&&(z(e,e.offset+t.length),new Uint8Array(e.buffer).set(t,e.offset),e.offset+=t.length)}n.writeBytes=b;function x(e,t){for(let n=0;n<t;n++)l(e,0)}n.writeZeros=x;function S(e,t){if(t.length!==4)throw Error(`Invalid signature: '${t}'`);for(let n=0;n<4;n++)l(e,t.charCodeAt(n))}n.writeSignature=S;function C(e,t){for(let n=0;n<t.length;n++)l(e,t.charCodeAt(n))}n.writeAsciiString=C;function w(e,t,n){let r=t.length;if(r>255)throw Error(`String too long`);l(e,r);for(let n=0;n<r;n++){let r=t.charCodeAt(n);l(e,r<128?r:63)}for(;++r%n;)l(e,0)}n.writePascalString=w;function T(e,t){for(let n=0;n<t.length;n++)d(e,t.charCodeAt(n))}n.writeUnicodeStringWithoutLength=T;function E(e,t){for(let n=0;n<t.length;n++)f(e,t.charCodeAt(n))}n.writeUnicodeStringWithoutLengthLE=E;function D(e,t){h(e,t.length),T(e,t)}n.writeUnicodeString=D;function O(e,t){h(e,t.length+1);for(let n=0;n<t.length;n++)d(e,t.charCodeAt(n));d(e,0)}n.writeUnicodeStringWithPadding=O;function k(e=[]){let t=0;for(let n of e){if(n.canvas||n.imageData){let{width:e,height:r}=V(n);t=Math.max(t,2*r+2*e*r)}n.children&&(t=Math.max(t,k(n.children)))}return t}function A(e,t,n,r=!1,i=!1){i&&h(e,0);let a=e.offset;h(e,0),n();let o=e.offset-a-4,s=o;for(;s%t;)l(e,0),s++;r&&(o=s),e.view.setUint32(a,o,!1)}n.writeSection=A;function j(e){var t;(t=e.children)==null||t.forEach(j);let n=e.imageData;if(n&&(n.data instanceof Uint32Array||n.data instanceof Uint16Array))throw Error(`imageData has incorrect bitDepth`);if(`mask`in e&&e.mask){let t=e.mask.imageData;if(t&&(t.data instanceof Uint32Array||t.data instanceof Uint16Array))throw Error(`mask imageData has incorrect bitDepth`)}}function M(e,t,n={}){if(!(+t.width>0&&+t.height>0))throw Error(`Invalid document size`);if((t.width>3e4||t.height>3e4)&&!n.psb)throw Error(`Document size is too large (max is 30000x30000, use PSB format instead)`);let i=t.bitsPerChannel??8;if(i!==8)throw Error(`bitsPerChannel other than 8 are not supported for writing`);j(t);let o=Object.assign({},t.imageResources),s=Object.assign(Object.assign({},n),{layerIds:/* @__PURE__ */ new Set,layerToId:/* @__PURE__ */ new Map});s.generateThumbnail&&(o.thumbnail=ne(t));let c=t.imageData;if(!c&&t.canvas&&(c=t.canvas.getContext(`2d`).getImageData(0,0,t.canvas.width,t.canvas.height)),c&&(t.width!==c.width||t.height!==c.height))throw Error(`Document canvas must have the same size as document`);let u=!!c&&(0,r.hasAlpha)(c),f=Math.max(k(t.children),8*t.width*t.height+2*t.height);e.tempBuffer=new Uint8Array(f),S(e,`8BPS`),d(e,n.psb?2:1),x(e,6),d(e,u?4:3),h(e,t.height),h(e,t.width),d(e,i),d(e,3),A(e,1,()=>{if(t.palette){for(let n=0;n<256;n++)l(e,t.palette[n]?.r||0);for(let n=0;n<256;n++)l(e,t.palette[n]?.g||0);for(let n=0;n<256;n++)l(e,t.palette[n]?.b||0)}});let p=[];ee(p,t.children),p.length||p.push({}),o.layersGroup=p.map(e=>e.linkGroup||0),o.layerGroupsEnabledId=p.map(e=>e.linkGroupEnabled==0?0:1),A(e,1,()=>{for(let t of a.resourceHandlers){let n=t.has(o),r=n===!1?0:n===!0?1:n;for(let n=0;n<r;n++)S(e,`8BIM`),d(e,t.key),w(e,``,2),A(e,2,()=>t.write(e,o,n))}}),A(e,2,()=>{N(e,p,t,u,s),L(e,t.globalLayerMaskInfo),R(e,t,t,s)},void 0,!!s.psb);let m=u?[0,1,2,3]:[0,1,2],g=c?c.width:t.width,_=c?c.height:t.height,v={data:new Uint8Array(g*_*4),width:g,height:_};if(d(e,1),r.RAW_IMAGE_DATA&&t.imageDataRaw)console.log(`writing raw image data`),b(e,t.imageDataRaw);else{if(c&&v.data.set(new Uint8Array(c.data.buffer,c.data.byteOffset,c.data.byteLength)),u){let e=v.width*v.height*4,t=v.data;for(let n=0;n<e;n+=4){let e=t[n+3];if(e!=0&&e!=255){let r=e/255,i=255*(1-r);t[n+0]=t[n+0]*r+i,t[n+1]=t[n+1]*r+i,t[n+2]=t[n+2]*r+i}}}b(e,(0,r.writeDataRLE)(e.tempBuffer,v,m,!!n.psb))}}n.writePsd=M;function N(e,t,n,i,a){A(e,4,()=>{u(e,i?-t.length:t.length);let o=t.map((t,n)=>ie(e.tempBuffer,t,n===0,a));for(let t of o){let{layer:i,top:o,left:s,bottom:c,right:f,channels:m}=t;p(e,o),p(e,s),p(e,c),p(e,f),d(e,m.length);for(let t of m)u(e,t.channelId),a.psb&&h(e,0),h(e,t.length);S(e,`8BIM`),S(e,r.fromBlendMode[i.blendMode]||`norm`),l(e,Math.round((0,r.clamp)(i.opacity??1,0,1)*255)),l(e,+!!i.clipping);let g=8;i.transparencyProtected&&(g|=1),i.hidden&&(g|=2),(i.vectorMask||i.sectionDivider&&i.sectionDivider.type!==0||i.adjustment)&&(g|=16),i.effectsOpen&&(g|=32),l(e,g),l(e,0),A(e,1,()=>{P(e,i,t),I(e,i),w(e,(i.name||``).substring(0,255),4),R(e,i,n,a)})}for(let t of o)for(let n of t.channels)d(e,n.compression),n.buffer&&b(e,n.buffer)},!0,a.psb)}function P(e,{mask:t,realMask:n},r){A(e,1,()=>{if(!t&&!n)return;let i=0,a=0,o=0;t&&(t.userMaskDensity!==void 0&&(i|=1),t.userMaskFeather!==void 0&&(i|=2),t.vectorMaskDensity!==void 0&&(i|=4),t.vectorMaskFeather!==void 0&&(i|=8),t.disabled&&(a|=2),t.positionRelativeToLayer&&(a|=1),t.fromVectorData&&(a|=8),i&&(a|=16));let s=r.mask||{};if(p(e,s.top||0),p(e,s.left||0),p(e,s.bottom||0),p(e,s.right||0),l(e,t&&t.defaultColor||0),l(e,a),n){n.disabled&&(o|=2),n.positionRelativeToLayer&&(o|=1),n.fromVectorData&&(o|=8);let t=r.realMask||{};l(e,o),l(e,n.defaultColor||0),p(e,t.top||0),p(e,t.left||0),p(e,t.bottom||0),p(e,t.right||0)}i&&t&&(l(e,i),t.userMaskDensity!==void 0&&l(e,Math.round(t.userMaskDensity*255)),t.userMaskFeather!==void 0&&_(e,t.userMaskFeather),t.vectorMaskDensity!==void 0&&l(e,Math.round(t.vectorMaskDensity*255)),t.vectorMaskFeather!==void 0&&_(e,t.vectorMaskFeather)),x(e,2)})}function F(e,t){l(e,t[0]),l(e,t[1]),l(e,t[2]),l(e,t[3])}function I(e,t){A(e,1,()=>{let n=t.blendingRanges;if(n){F(e,n.compositeGrayBlendSource),F(e,n.compositeGraphBlendDestinationRange);for(let t of n.ranges)F(e,t.sourceRange),F(e,t.destRange)}})}function L(e,t){A(e,1,()=>{t&&(d(e,t.overlayColorSpace),d(e,t.colorSpace1),d(e,t.colorSpace2),d(e,t.colorSpace3),d(e,t.colorSpace4),d(e,t.opacity*255),l(e,t.kind),x(e,3))})}function R(e,t,n,a){for(let o of i.infoHandlers){let i=o.key;if(!(i===`Txt2`&&a.invalidateTextLayers)&&(i===`vmsk`&&a.psb&&(i=`vsms`),o.has(t))){let s=a.psb&&r.largeAdditionalInfoKeys.indexOf(i)!==-1,c=i!==`Txt2`&&i!==`cinf`&&i!==`extn`&&i!==`CAI `&&i!==`OCIO`,l=i===`Txt2`||i===`luni`||i===`vmsk`||i===`artb`||i===`artd`||i===`vogk`||i===`SoLd`||i===`lnk2`||i===`vscg`||i===`vsms`||i===`GdFl`||i===`lmfx`||i===`lrFX`||i===`cinf`||i===`PlLd`||i===`Anno`||i===`CAI `||i===`OCIO`||i===`GenI`||i===`FEid`||i===`curv`||i===`CgEd`||i===`vibA`||i===`blwh`||i===`grdm`;S(e,s?`8B64`:`8BIM`),S(e,i),A(e,l?4:2,()=>{o.write(e,t,n,a)},c,s)}}}function ee(e,t){if(t)for(let n of t){if(n.children&&n.canvas)throw Error(`Invalid layer, cannot have both 'canvas' and 'children' properties`);if(n.children&&n.imageData)throw Error(`Invalid layer, cannot have both 'imageData' and 'children' properties`);n.children?(e.push({name:`</Layer group>`,sectionDivider:{type:3}}),ee(e,n.children),e.push(Object.assign(Object.assign({},n),{blendMode:n.blendMode===`pass through`?`normal`:n.blendMode,sectionDivider:{type:n.opened===!1?2:1,key:r.fromBlendMode[n.blendMode]||`pass`,subType:0}}))):e.push(Object.assign({},n))}}function te(e,t){let n=e.buffer.byteLength;do n*=2;while(t>n);let r=new ArrayBuffer(n),i=new Uint8Array(r),a=new Uint8Array(e.buffer);i.set(a),e.buffer=r,e.view=new DataView(e.buffer)}function z(e,t){t>e.buffer.byteLength&&te(e,t)}function B(e,t){let n=e.offset;return z(e,e.offset+=t),n}function ne(e){let t=(0,r.createCanvas)(10,10),n=1;e.width>e.height?(t.width=160,t.height=Math.floor(e.height*(t.width/e.width)),n=t.width/e.width):(t.height=160,t.width=Math.floor(e.width*(t.height/e.height)),n=t.height/e.height);let i=t.getContext(`2d`);return i.scale(n,n),e.imageData?i.drawImage((0,r.imageDataToCanvas)(e.imageData),0,0):e.canvas&&i.drawImage(e.canvas,0,0),t}function re(e,t,n,i,a,o){let s=i.top|0,c=i.left|0,l=i.right|0,u=i.bottom|0,{width:d,height:f}=V(i),p=i.imageData;if(!p&&i.canvas&&d&&f&&(p=i.canvas.getContext(`2d`).getImageData(0,0,d,f)),p&&(p.width!==d||p.height!==f))throw Error(`Invalid imageData dimentions`);l=c+d,u=s+f;let m,h;r.RAW_IMAGE_DATA&&n[o?`realMaskDataRaw`:`maskDataRaw`]?(m=n[o?`realMaskDataRaw`:`maskDataRaw`],h=n[o?`realMaskDataRawCompression`:`maskDataRawCompression`]):p?a.compress?(m=(0,r.writeDataZipWithoutPrediction)(p,[0]),h=2):(m=(0,r.writeDataRLE)(e,p,[0],!!a.psb),h=1):(m=/* @__PURE__ */ new Uint8Array,h=1),t.channels.push({channelId:o?-3:-2,compression:h,buffer:m,length:2+m.length}),t[o?`realMask`:`mask`]={top:s,left:c,right:l,bottom:u}}function ie(e,t,n,r){let i=ae(e,t,n,r);return t.mask&&re(e,i,t,t.mask,r,!1),t.realMask&&re(e,i,t,t.realMask,r,!0),i}function V({canvas:e,imageData:t}){return{width:t?.width??e?.width??0,height:t?.height??e?.height??0}}function H(e,t,n,i,a){if(e.data instanceof Uint32Array||e.data instanceof Uint16Array)throw Error(`imageData has incorrect bit depth`);let o=(0,r.createImageData)(i,a),s=e.data,c=o.data;for(let r=0;r<a;r++)for(let a=0;a<i;a++){let o=(a+t+(r+n)*e.width)*4,l=(a+r*i)*4;c[l]=s[o],c[l+1]=s[o+1],c[l+2]=s[o+2],c[l+3]=s[o+3]}return o}function ae(e,t,n,i){let a=t.top|0,o=t.left|0,s=t.right|0,c=t.bottom|0,l=[{channelId:-1,compression:0,buffer:void 0,length:2},{channelId:0,compression:0,buffer:void 0,length:2},{channelId:1,compression:0,buffer:void 0,length:2},{channelId:2,compression:0,buffer:void 0,length:2}],{width:u,height:d}=V(t);if(!(t.canvas||t.imageData)||!u||!d)return s=o,c=a,{layer:t,top:a,left:o,right:s,bottom:c,channels:l};s=o+u,c=a+d;let f=t.imageData||t.canvas.getContext(`2d`).getImageData(0,0,u,d);if(i.trimImageData){let e=W(f);if(e.left!==0||e.top!==0||e.right!==f.width||e.bottom!==f.height){if(o+=e.left,a+=e.top,s-=f.width-e.right,c-=f.height-e.bottom,u=s-o,d=c-a,!u||!d)return{layer:t,top:a,left:o,right:s,bottom:c,channels:l};f=H(f,e.left,e.top,u,d)}}let p=[0,1,2];return(!n||i.noBackground||t.mask||(0,r.hasAlpha)(f)||r.RAW_IMAGE_DATA&&t.imageDataRaw?.[-1])&&p.unshift(-1),l=p.map(n=>{let a=(0,r.offsetForChannel)(n,!1),o,s;return r.RAW_IMAGE_DATA&&t.imageDataRaw?(o=t.imageDataRaw[n],s=t.imageDataRawCompression[n]):i.compress?(o=(0,r.writeDataZipWithoutPrediction)(f,[a]),s=2):(o=(0,r.writeDataRLE)(e,f,[a],!!i.psb),s=1),{channelId:n,compression:s,buffer:o,length:2+o.length}}),{layer:t,top:a,left:o,right:s,bottom:c,channels:l}}function oe({data:e,width:t},n,r,i){let a=(n*t+r)*4+3|0,o=a+(i-r)*4|0;for(let t=a;t<o;t=t+4|0)if(e[t]!==0)return!1;return!0}function U({data:e,width:t},n,r,i){let a=t*4|0,o=r*a+n*4+3|0;for(let t=r,n=o;t<i;t++,n=n+a|0)if(e[n]!==0)return!1;return!0}function W(e){let t=0,n=0,r=e.width,i=e.height;for(;t<i&&oe(e,t,n,r);)t++;for(;i>t&&oe(e,i-1,n,r);)i--;for(;n<r&&U(e,n,t,i);)n++;for(;r>n&&U(e,r-1,t,i);)r--;return{top:t,left:n,right:r,bottom:i}}function se(e,t){t?`r`in t?(d(e,0),d(e,Math.round(t.r*257)),d(e,Math.round(t.g*257)),d(e,Math.round(t.b*257)),d(e,0)):`fr`in t?(d(e,0),d(e,Math.round(t.fr*255*257)),d(e,Math.round(t.fg*255*257)),d(e,Math.round(t.fb*255*257)),d(e,0)):`l`in t?(d(e,7),u(e,Math.round(t.l*1e4)),u(e,Math.round(t.a<0?t.a*12800:t.a*12700)),u(e,Math.round(t.b<0?t.b*12800:t.b*12700)),d(e,0)):`h`in t?(d(e,1),d(e,Math.round(t.h*65535)),d(e,Math.round(t.s*65535)),d(e,Math.round(t.b*65535)),d(e,0)):`c`in t?(d(e,2),d(e,Math.round(t.c*257)),d(e,Math.round(t.m*257)),d(e,Math.round(t.y*257)),d(e,Math.round(t.k*257))):(d(e,8),d(e,Math.round(t.k*1e4/255)),x(e,6)):(d(e,0),x(e,8))}n.writeColor=se;function ce(e,t){let n=t.bounds.w,i=t.bounds.h,a={width:n,height:i,data:t.data};h(e,0);let o=e.offset;h(e,1),h(e,3),u(e,t.x),u(e,t.y),D(e,t.name+`\0`),w(e,t.id,1),h(e,3),h(e,0);let s=e.offset,c=t.bounds.y,f=t.bounds.x,p=c+i,m=f+n;h(e,c),h(e,f),h(e,p),h(e,m),h(e,24);for(let t=0;t<26;t++){let o=t<3?t:t===25?3:-1;if(o<0){h(e,0);continue}let s=new Uint8Array(n*i+2*i+2*n+16),u=(0,r.writeDataRLE)(s,a,[o],!1);h(e,1),h(e,u.length+4+16+2+1),h(e,8),h(e,c),h(e,f),h(e,p),h(e,m),d(e,8),l(e,1),b(e,u)}let g=e.offset-s,_=e.offset-o;for(;_%4;)x(e,1),_++;e.view.setUint32(s-4,g,!1),e.view.setUint32(o-4,_,!1)}n.writePattern=ce},{"./additionalInfo":2,"./helpers":8,"./imageResources":9}],15:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.encodeEngineData=n.decodeEngineData=void 0;let r={name:`MyriadPro-Regular`,script:0,type:0,synthetic:0},i={justification:`left`,firstLineIndent:0,startIndent:0,endIndent:0,spaceBefore:0,spaceAfter:0,autoHyphenate:!0,hyphenatedWordSize:6,preHyphen:2,postHyphen:2,consecutiveHyphens:8,zone:36,wordSpacing:[.8,1,1.33],letterSpacing:[0,0,0],glyphSpacing:[1,1,1],autoLeading:1.2,leadingType:0,hanging:!1,burasagari:!1,kinsokuOrder:0,everyLineComposer:!1},a={font:r,fontSize:12,fauxBold:!1,fauxItalic:!1,autoLeading:!0,leading:0,horizontalScale:1,verticalScale:1,tracking:0,autoKerning:!0,kerning:0,baselineShift:0,fontCaps:0,fontBaseline:0,underline:!1,strikethrough:!1,ligatures:!0,dLigatures:!1,baselineDirection:2,tsume:0,styleRunAlignment:2,language:0,noBreak:!1,fillColor:{r:0,g:0,b:0},strokeColor:{r:0,g:0,b:0},fillFlag:!0,strokeFlag:!1,fillFirst:!0,yUnderline:1,outlineWidth:1,characterDirection:0,hindiNumbers:!1,kashida:1,diacriticPos:2},o={isOn:!1,show:!1,size:18,leading:22,color:{r:0,g:0,b:255},leadingFillColor:{r:0,g:0,b:255},alignLineHeightToGridFlags:!1},s=[`justification`,`firstLineIndent`,`startIndent`,`endIndent`,`spaceBefore`,`spaceAfter`,`autoHyphenate`,`hyphenatedWordSize`,`preHyphen`,`postHyphen`,`consecutiveHyphens`,`zone`,`wordSpacing`,`letterSpacing`,`glyphSpacing`,`autoLeading`,`leadingType`,`hanging`,`burasagari`,`kinsokuOrder`,`everyLineComposer`],c=/* @__PURE__ */ `font.fontSize.fauxBold.fauxItalic.autoLeading.leading.horizontalScale.verticalScale.tracking.autoKerning.kerning.baselineShift.fontCaps.fontBaseline.underline.strikethrough.ligatures.dLigatures.baselineDirection.tsume.styleRunAlignment.language.noBreak.fillColor.strokeColor.fillFlag.strokeFlag.fillFirst.yUnderline.outlineWidth.characterDirection.hindiNumbers.kashida.diacriticPos`.split(`.`),l=[`none`,`crisp`,`strong`,`smooth`,`sharp`],u=[`left`,`right`,`center`,`justify-left`,`justify-right`,`justify-center`,`justify-all`];function d(e){return e.substring(0,1).toUpperCase()+e.substring(1)}function f(e){let t=e.Values;switch(e.Type){case 0:return{k:t[1]*255};case 1:return t[0]===1?{r:t[1]*255,g:t[2]*255,b:t[3]*255}:{r:t[1]*255,g:t[2]*255,b:t[3]*255,a:t[0]*255};case 2:return{c:t[1]*255,m:t[2]*255,y:t[3]*255,k:t[4]*255};default:throw Error(`Unknown color type in text layer`)}}function p(e){if(!e)return{Type:1,Values:[0,0,0,0]};if(`r`in e)return{Type:1,Values:[`a`in e?e.a/255:1,e.r/255,e.g/255,e.b/255]};if(`c`in e)return{Type:2,Values:[1,e.c/255,e.m/255,e.y/255,e.k/255]};if(`k`in e)return{Type:0,Values:[1,e.k/255]};throw Error(`Invalid color type in text layer`)}function m(e,t){if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function h(e,t){if(!e||!t)return!1;for(let n of Object.keys(e))if(e[n]!==t[n])return!1;for(let n of Object.keys(t))if(e[n]!==t[n])return!1;return!0}function g(e,t){for(let n=0;n<e.length;n++)if(e[n].name===t.name)return n;return e.push(t),e.length-1}function _(e,t,n){let r={};for(let i of t){let t=d(i);e[t]!==void 0&&(r[i]=i===`justification`?u[e[t]]:i===`font`?n[e[t]]:i===`fillColor`||i===`strokeColor`?f(e[t]):e[t])}return r}function v(e,t,n){let r={};for(let i of t){let t=d(i);e[i]!==void 0&&(r[t]=i===`justification`?u.indexOf(e[i]??`left`):i===`font`?g(n,e[i]):i===`fillColor`||i===`strokeColor`?p(e[i]):e[i])}return r}function y(e,t){return _(e,s,t)}function b(e,t){return _(e,c,t)}function x(e,t){return v(e,s,t)}function S(e,t){return v(e,c,t)}function C(e,t,n){if(t.length){for(let r of n){let n=t[0].style[r];if(n!==void 0){let i=!1;i=Array.isArray(n)?t.every(e=>m(e.style[r],n)):typeof n==`object`?t.every(e=>h(e.style[r],n)):t.every(e=>e.style[r]===n),i&&(e[r]=n)}if(e[r]!==void 0)for(let e of t){let t=!1;t=Array.isArray(n)?m(e.style[r],n):typeof n==`object`?h(e.style[r],n):e.style[r]===n,t&&delete e.style[r]}}t.every(e=>Object.keys(e.style).length===0)&&(t.length=0)}}function w(e){let t=e.EngineDict,n=e.ResourceDict,r=n.FontSet.map(e=>({name:e.Name,script:e.Script,type:e.FontType,synthetic:e.Synthetic})),i=t.Editor.Text.replace(/\r/g,`
|
|
11
|
+
`),a=0;for(;/\n$/.test(i);)i=i.substring(0,i.length-1),a++;let o={text:i,antiAlias:l[t.AntiAlias]??`smooth`,useFractionalGlyphWidths:!!t.UseFractionalGlyphWidths,superscriptSize:n.SuperscriptSize,superscriptPosition:n.SuperscriptPosition,subscriptSize:n.SubscriptSize,subscriptPosition:n.SubscriptPosition,smallCapSize:n.SmallCapSize},u=t.Rendered?.Shapes?.Children?.[0]?.Cookie?.Photoshop;u&&(o.shapeType=u.ShapeType===1?`box`:`point`,u.PointBase&&(o.pointBase=u.PointBase),u.BoxBounds&&(o.boxBounds=u.BoxBounds));let d=t.ParagraphRun;o.paragraphStyle={},o.paragraphStyleRuns=[];for(let e=0;e<d.RunArray.length;e++){let t=d.RunArray[e],n=d.RunLengthArray[e],i=y(t.ParagraphSheet.Properties,r);o.paragraphStyleRuns.push({length:n,style:i})}for(let e=a;o.paragraphStyleRuns.length&&e>0;e--)--o.paragraphStyleRuns[o.paragraphStyleRuns.length-1].length===0&&o.paragraphStyleRuns.pop();C(o.paragraphStyle,o.paragraphStyleRuns,s),o.paragraphStyleRuns.length||delete o.paragraphStyleRuns;let f=t.StyleRun;o.style={},o.styleRuns=[];for(let e=0;e<f.RunArray.length;e++){let t=f.RunLengthArray[e],n=b(f.RunArray[e].StyleSheet.StyleSheetData,r);n.font||=r[0],o.styleRuns.push({length:t,style:n})}for(let e=a;o.styleRuns.length&&e>0;e--)--o.styleRuns[o.styleRuns.length-1].length===0&&o.styleRuns.pop();return C(o.style,o.styleRuns,c),o.styleRuns.length||delete o.styleRuns,o}n.decodeEngineData=w;function T(e){let t=`${(e.text||``).replace(/\r?\n/g,`\r`)}\r`,n=[{name:`AdobeInvisFont`,script:0,type:0,synthetic:0}],s=e.style?.font||(e.styleRuns?.find(e=>e.style.font))?.style.font||r,c=[],u=[],d=e.paragraphStyleRuns;if(d&&d.length){let r=t.length;for(let t of d){let a=Math.min(t.length,r);r-=a,a&&(r===1&&t===d[d.length-1]&&(a++,r--),u.push(a),c.push({ParagraphSheet:{DefaultStyleSheet:0,Properties:x(Object.assign(Object.assign(Object.assign({},i),e.paragraphStyle),t.style),n)},Adjustments:{Axis:[1,0,1],XY:[0,0]}}))}r&&(u.push(r),c.push({ParagraphSheet:{DefaultStyleSheet:0,Properties:x(Object.assign(Object.assign({},i),e.paragraphStyle),n)},Adjustments:{Axis:[1,0,1],XY:[0,0]}}))}else for(let r=0,a=0;r<t.length;r++)t.charCodeAt(r)===13&&(u.push(r-a+1),c.push({ParagraphSheet:{DefaultStyleSheet:0,Properties:x(Object.assign(Object.assign({},i),e.paragraphStyle),n)},Adjustments:{Axis:[1,0,1],XY:[0,0]}}),a=r+1);let f=S(Object.assign(Object.assign({},a),{font:s}),n),m=e.styleRuns||[{length:t.length,style:e.style||{}}],h=[],g=[],_=t.length;for(let t of m){let r=Math.min(t.length,_);_-=r,r&&(_===1&&t===m[m.length-1]&&(r++,_--),g.push(r),h.push({StyleSheet:{StyleSheetData:S(Object.assign(Object.assign({kerning:0,autoKerning:!0,fillColor:{r:0,g:0,b:0}},e.style),t.style),n)}}))}_&&m.length&&(g.push(_),h.push({StyleSheet:{StyleSheetData:S(Object.assign({kerning:0,autoKerning:!0,fillColor:{r:0,g:0,b:0}},e.style),n)}}));let v=Object.assign(Object.assign({},o),e.gridInfo),y=e.orientation===`vertical`?2:0,b=+(e.orientation===`vertical`),C=+(e.shapeType===`box`),w={ShapeType:C};C===0?w.PointBase=e.pointBase||[0,0]:w.BoxBounds=e.boxBounds||[0,0,0,0],w.Base={ShapeType:C,TransformPoint0:[1,0],TransformPoint1:[0,1],TransformPoint2:[0,0]};let T={KinsokuSet:[{Name:`PhotoshopKinsokuHard`,NoStart:`、。,.・:;?!ー―’”)〕]}〉》」』】ヽヾゝゞ々ぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮヵヶ゛゜?!)]},.:;℃℉¢%‰`,NoEnd:`‘“(〔[{〈《「『【([{¥$£@§〒#`,Keep:`―‥`,Hanging:`、。.,`},{Name:`PhotoshopKinsokuSoft`,NoStart:`、。,.・:;?!’”)〕]}〉》」』】ヽヾゝゞ々`,NoEnd:`‘“(〔[{〈《「『【`,Keep:`―‥`,Hanging:`、。.,`}],MojiKumiSet:[{InternalName:`Photoshop6MojiKumiSet1`},{InternalName:`Photoshop6MojiKumiSet2`},{InternalName:`Photoshop6MojiKumiSet3`},{InternalName:`Photoshop6MojiKumiSet4`}],TheNormalStyleSheet:0,TheNormalParagraphSheet:0,ParagraphSheetSet:[{Name:`Normal RGB`,DefaultStyleSheet:0,Properties:x(Object.assign(Object.assign({},i),e.paragraphStyle),n)}],StyleSheetSet:[{Name:`Normal RGB`,StyleSheetData:f}],FontSet:n.map(e=>({Name:e.name,Script:e.script||0,FontType:e.type||0,Synthetic:e.synthetic||0})),SuperscriptSize:e.superscriptSize??.583,SuperscriptPosition:e.superscriptPosition??.333,SubscriptSize:e.subscriptSize??.583,SubscriptPosition:e.subscriptPosition??.333,SmallCapSize:e.smallCapSize??.7};return{EngineDict:{Editor:{Text:t},ParagraphRun:{DefaultRunData:{ParagraphSheet:{DefaultStyleSheet:0,Properties:{}},Adjustments:{Axis:[1,0,1],XY:[0,0]}},RunArray:c,RunLengthArray:u,IsJoinable:1},StyleRun:{DefaultRunData:{StyleSheet:{StyleSheetData:{}}},RunArray:h,RunLengthArray:g,IsJoinable:2},GridInfo:{GridIsOn:!!v.isOn,ShowGrid:!!v.show,GridSize:v.size??18,GridLeading:v.leading??22,GridColor:p(v.color),GridLeadingFillColor:p(v.color),AlignLineHeightToGridFlags:!!v.alignLineHeightToGridFlags},AntiAlias:l.indexOf(e.antiAlias??`sharp`),UseFractionalGlyphWidths:e.useFractionalGlyphWidths??!0,Rendered:{Version:1,Shapes:{WritingDirection:y,Children:[{ShapeType:C,Procession:b,Lines:{WritingDirection:y,Children:[]},Cookie:{Photoshop:w}}]}}},ResourceDict:Object.assign({},T),DocumentResources:Object.assign({},T)}}n.encodeEngineData=T},{}],16:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.decodeString=n.encodeString=n.encodeStringTo=n.stringLengthInBytes=void 0;function r(e){return e&4294967168?e&4294965248?e&4294901760?4:3:2:1}function i(e){let t=0;for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);if(i>=55296&&i<=56319){if(n+1<e.length){let a=e.charCodeAt(n+1);(a&64512)==56320&&(n++,t+=r(((i&1023)<<10)+(a&1023)+65536))}}else t+=r(i)}return t}n.stringLengthInBytes=i;function a(e,t,n){let i=r(n);switch(i){case 1:e[t]=n;break;case 2:e[t]=n>>6&31|192,e[t+1]=n&63|128;break;case 3:e[t]=n>>12&15|224,e[t+1]=n>>6&63|128,e[t+2]=n&63|128;break;default:e[t]=n>>18&7|240,e[t+1]=n>>12&63|128,e[t+2]=n>>6&63|128,e[t+3]=n&63|128}return i}function o(e,t,n){for(let r=0;r<n.length;r++){let i=n.charCodeAt(r);if(i>=55296&&i<=56319){if(r+1<n.length){let o=n.charCodeAt(r+1);if((o&64512)==56320){r++;let n=((i&1023)<<10)+(o&1023)+65536;t+=a(e,t,n)}}}else t+=a(e,t,i)}return t}n.encodeStringTo=o;function s(e){if(e.length>1e3&&typeof TextEncoder<`u`)return new TextEncoder().encode(e);let t=new Uint8Array(i(e));return o(t,0,e),t}n.encodeString=s;function c(e,t){if(t>=e.length)throw Error(`Invalid byte index`);let n=e[t];if((n&192)==128)return n&63;throw Error(`Invalid continuation byte`)}function l(e){if(e.byteLength>1e3&&typeof TextDecoder<`u`)return new TextDecoder().decode(e);let t=[];for(let n=0;n<e.length;){let r=e[n++],i;if(!(r&128))i=r;else if((r&224)==192){let t=c(e,n++);if(i=(r&31)<<6|t,i<128)throw Error(`Invalid continuation byte`)}else if((r&240)==224){let t=c(e,n++),a=c(e,n++);if(i=(r&15)<<12|t<<6|a,i<2048)throw Error(`Invalid continuation byte`);if(i>=55296&&i<=57343)throw Error(`Lone surrogate U+${i.toString(16).toUpperCase()} is not a scalar value`)}else if((r&248)==240){let t=c(e,n++),a=c(e,n++),o=c(e,n++);if(i=(r&15)<<18|t<<12|a<<6|o,i<65536||i>1114111)throw Error(`Invalid continuation byte`)}else throw Error(`Invalid UTF-8 detected`);i>65535&&(i-=65536,t.push(String.fromCharCode(i>>>10&1023|55296)),i=56320|i&1023),t.push(String.fromCharCode(i))}return t.join(``)}n.decodeString=l},{}],17:[function(e,t,n){t.exports=function(e,t,n){if(e.filter)return e.filter(t,n);if(e==null||typeof t!=`function`)throw TypeError();for(var i=[],a=0;a<e.length;a++)if(r.call(e,a)){var o=e[a];t.call(n,o,a,e)&&i.push(o)}return i};var r=Object.prototype.hasOwnProperty},{}],18:[function(e,t,n){(function(n){(function(){var r=e("array-filter");t.exports=function(){return r([`BigInt64Array`,`BigUint64Array`,`Float32Array`,`Float64Array`,`Int16Array`,`Int32Array`,`Int8Array`,`Uint16Array`,`Uint32Array`,`Uint8Array`,`Uint8ClampedArray`],function(e){return typeof n[e]==`function`})}}).call(this)}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{"array-filter":17}],19:[function(e,t,n){n.byteLength=u,n.toByteArray=f,n.fromByteArray=h;for(var r=[],i=[],a=typeof Uint8Array<`u`?Uint8Array:Array,o=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,s=0,c=o.length;s<c;++s)r[s]=o[s],i[o.charCodeAt(s)]=s;i[45]=62,i[95]=63;function l(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function u(e){var t=l(e),n=t[0],r=t[1];return(n+r)*3/4-r}function d(e,t,n){return(t+n)*3/4-n}function f(e){for(var t,n=l(e),r=n[0],o=n[1],s=new a(d(e,r,o)),c=0,u=o>0?r-4:r,f=0;f<u;f+=4)t=i[e.charCodeAt(f)]<<18|i[e.charCodeAt(f+1)]<<12|i[e.charCodeAt(f+2)]<<6|i[e.charCodeAt(f+3)],s[c++]=t>>16&255,s[c++]=t>>8&255,s[c++]=t&255;return o===2&&(t=i[e.charCodeAt(f)]<<2|i[e.charCodeAt(f+1)]>>4,s[c++]=t&255),o===1&&(t=i[e.charCodeAt(f)]<<10|i[e.charCodeAt(f+1)]<<4|i[e.charCodeAt(f+2)]>>2,s[c++]=t>>8&255,s[c++]=t&255),s}function p(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[e&63]}function m(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(p(r));return i.join(``)}function h(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,c=n-i;s<c;s+=o)a.push(m(e,s,s+o>c?c:s+o));return i===1?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+`==`)):i===2&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+`=`)),a.join(``)}},{}],20:[function(e,t,n){(function(t){(function(){
|
|
12
|
+
/*!
|
|
13
|
+
* The buffer module from node.js, for the browser.
|
|
14
|
+
*
|
|
15
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
16
|
+
* @license MIT
|
|
17
|
+
*/
|
|
18
|
+
var t=e("base64-js"),r=e("ieee754");n.Buffer=s,n.SlowBuffer=_,n.INSPECT_MAX_BYTES=50;var i=2147483647;n.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=a(),!s.TYPED_ARRAY_SUPPORT&&typeof console<`u`&&typeof console.error==`function`&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{var e=/* @__PURE__ */ new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},e.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(e){if(e>i)throw RangeError(`The value "`+e+`" is invalid for option "size"`);var t=new Uint8Array(e);return t.__proto__=s.prototype,t}function s(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return d(e)}return c(e,t,n)}typeof Symbol<`u`&&Symbol.species!=null&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),s.poolSize=8192;function c(e,t,n){if(typeof e==`string`)return f(e,t);if(ArrayBuffer.isView(e))return p(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(U(e,ArrayBuffer)||e&&U(e.buffer,ArrayBuffer))return m(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);var r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return s.from(r,t,n);var i=h(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return s.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}s.from=function(e,t,n){return c(e,t,n)},s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array;function l(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function u(e,t,n){return l(e),e<=0||t===void 0?o(e):typeof n==`string`?o(e).fill(t,n):o(e).fill(t)}s.alloc=function(e,t,n){return u(e,t,n)};function d(e){return l(e),o(e<0?0:g(e)|0)}s.allocUnsafe=function(e){return d(e)},s.allocUnsafeSlow=function(e){return d(e)};function f(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!s.isEncoding(t))throw TypeError(`Unknown encoding: `+t);var n=v(e,t)|0,r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function p(e){for(var t=e.length<0?0:g(e.length)|0,n=o(t),r=0;r<t;r+=1)n[r]=e[r]&255;return n}function m(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);var r=t===void 0&&n===void 0?new Uint8Array(e):n===void 0?new Uint8Array(e,t):new Uint8Array(e,t,n);return r.__proto__=s.prototype,r}function h(e){if(s.isBuffer(e)){var t=g(e.length)|0,n=o(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||W(e.length)?o(0):p(e);if(e.type===`Buffer`&&Array.isArray(e.data))return p(e.data)}function g(e){if(e>=i)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+i.toString(16)+` bytes`);return e|0}function _(e){return+e!=e&&(e=0),s.alloc(+e)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype},s.compare=function(e,t){if(U(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),U(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:+(r<n)},s.isEncoding=function(e){switch(String(e).toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`latin1`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return s.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=s.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(U(a,Uint8Array)&&(a=s.from(a)),!s.isBuffer(a))throw TypeError(`"list" argument must be an Array of Buffers`);a.copy(r,i),i+=a.length}return r};function v(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||U(e,ArrayBuffer))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);var n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;for(var i=!1;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return ie(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return ae(e).length;default:if(i)return r?-1:ie(e).length;t=(``+t).toLowerCase(),i=!0}}s.byteLength=v;function y(e,t,n){var r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return F(this,t,n);case`utf8`:case`utf-8`:return A(this,t,n);case`ascii`:return N(this,t,n);case`latin1`:case`binary`:return P(this,t,n);case`base64`:return k(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return I(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}s.prototype._isBuffer=!0;function b(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}s.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(var t=0;t<e;t+=2)b(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(var t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},s.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(var t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},s.prototype.toString=function(){var e=this.length;return e===0?``:arguments.length===0?A(this,0,e):y.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e||s.compare(this,e)===0},s.prototype.inspect=function(){var e=``,t=n.INSPECT_MAX_BYTES;return e=this.toString(`hex`,0,t).replace(/(.{2})/g,`$1 `).trim(),this.length>t&&(e+=` ... `),`<Buffer `+e+`>`},s.prototype.compare=function(e,t,n,r,i){if(U(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var a=i-r,o=n-t,c=Math.min(a,o),l=this.slice(r,i),u=e.slice(t,n),d=0;d<c;++d)if(l[d]!==u[d]){a=l[d],o=u[d];break}return a<o?-1:+(o<a)};function x(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,W(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(i)n=0;else return-1}if(typeof t==`string`&&(t=s.from(t,r)),s.isBuffer(t))return t.length===0?-1:S(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof Uint8Array.prototype.indexOf==`function`?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):S(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function S(e,t,n,r,i){var a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}var l;if(i){var u=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,u===-1?0:l-u)){if(u===-1&&(u=l),l-u+1===s)return u*a}else u!==-1&&(l-=l-u),u=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){for(var d=!0,f=0;f<s;f++)if(c(e,l+f)!==c(t,f)){d=!1;break}if(d)return l}return-1}s.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},s.prototype.indexOf=function(e,t,n){return x(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return x(this,e,t,n,!1)};function C(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var a=t.length;r>a/2&&(r=a/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(o*2,2),16);if(W(s))return o;e[n+o]=s}return o}function w(e,t,n,r){return oe(ie(t,e.length-n),e,n,r)}function T(e,t,n,r){return oe(V(t),e,n,r)}function E(e,t,n,r){return T(e,t,n,r)}function D(e,t,n,r){return oe(ae(t),e,n,r)}function O(e,t,n,r){return oe(H(t,e.length-n),e,n,r)}s.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);var i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;for(var a=!1;;)switch(r){case`hex`:return C(this,e,t,n);case`utf8`:case`utf-8`:return w(this,e,t,n);case`ascii`:return T(this,e,t,n);case`latin1`:case`binary`:return E(this,e,t,n);case`base64`:return D(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return O(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function k(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function A(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a=e[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=n){var c,l,u,d;switch(s){case 1:a<128&&(o=a);break;case 2:c=e[i+1],(c&192)==128&&(d=(a&31)<<6|c&63,d>127&&(o=d));break;case 3:c=e[i+1],l=e[i+2],(c&192)==128&&(l&192)==128&&(d=(a&15)<<12|(c&63)<<6|l&63,d>2047&&(d<55296||d>57343)&&(o=d));break;case 4:c=e[i+1],l=e[i+2],u=e[i+3],(c&192)==128&&(l&192)==128&&(u&192)==128&&(d=(a&15)<<18|(c&63)<<12|(l&63)<<6|u&63,d>65535&&d<1114112&&(o=d))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|o&1023),r.push(o),i+=s}return M(r)}var j=4096;function M(e){var t=e.length;if(t<=j)return String.fromCharCode.apply(String,e);for(var n=``,r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=j));return n}function N(e,t,n){var r=``;n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function P(e,t,n){var r=``;n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function F(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i=``,a=t;a<n;++a)i+=re(e[a]);return i}function I(e,t,n){for(var r=e.slice(t,n),i=``,a=0;a<r.length;a+=2)i+=String.fromCharCode(r[a]+r[a+1]*256);return i}s.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return r.__proto__=s.prototype,r};function L(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},s.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},s.prototype.readUInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},s.prototype.readInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||L(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||L(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return e>>>=0,t||L(e,4,this.length),r.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||L(e,4,this.length),r.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||L(e,8,this.length),r.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||L(e,8,this.length),r.read(this,e,!1,52,8)};function R(e,t,n,r,i,a){if(!s.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}s.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){var i=2**(8*n)-1;R(this,e,t,n,i,0)}var a=1,o=0;for(this[t]=e&255;++o<n&&(a*=256);)this[t+o]=e/a&255;return t+n},s.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){var i=2**(8*n)-1;R(this,e,t,n,i,0)}var a=n-1,o=1;for(this[t+a]=e&255;--a>=0&&(o*=256);)this[t+a]=e/o&255;return t+n},s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,255,0),this[t]=e&255,t+1},s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=2**(8*n-1);R(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=e&255;++a<n&&(o*=256);)e<0&&s===0&&this[t+a-1]!==0&&(s=1),this[t+a]=(e/o|0)-s&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=2**(8*n-1);R(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=e&255;--a>=0&&(o*=256);)e<0&&s===0&&this[t+a+1]!==0&&(s=1),this[t+a]=(e/o|0)-s&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function ee(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function te(e,t,n,i,a){return t=+t,n>>>=0,a||ee(e,t,n,4,34028234663852886e22,-34028234663852886e22),r.write(e,t,n,i,23,4),n+4}s.prototype.writeFloatLE=function(e,t,n){return te(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return te(this,e,t,!1,n)};function z(e,t,n,i,a){return t=+t,n>>>=0,a||ee(e,t,n,8,17976931348623157e292,-17976931348623157e292),r.write(e,t,n,i,52,8),n+8}s.prototype.writeDoubleLE=function(e,t,n){return z(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return z(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i=r-n;if(this===e&&typeof Uint8Array.prototype.copyWithin==`function`)this.copyWithin(t,n,r);else if(this===e&&n<t&&t<r)for(var a=i-1;a>=0;--a)e[a+t]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,r),t);return i},s.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!s.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){var i=e.charCodeAt(0);(r===`utf8`&&i<128||r===`latin1`)&&(e=i)}}else typeof e==`number`&&(e&=255);if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;var a;if(typeof e==`number`)for(a=t;a<n;++a)this[a]=e;else{var o=s.isBuffer(e)?e:s.from(e,r),c=o.length;if(c===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(a=0;a<n-t;++a)this[a+t]=o[a%c]}return this};var B=/[^+/0-9A-Za-z-_]/g;function ne(e){if(e=e.split(`=`)[0],e=e.trim().replace(B,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function re(e){return e<16?`0`+e.toString(16):e.toString(16)}function ie(e,t){t||=1/0;for(var n,r=e.length,i=null,a=[],o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319||o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function V(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function H(e,t){for(var n,r,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function ae(e){return t.toByteArray(ne(e))}function oe(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function U(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function W(e){return e!==e}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":19,buffer:20,ieee754:31}],21:[function(e,t,n){var r=e("get-intrinsic"),i=e("./"),a=i(r(`String.prototype.indexOf`));t.exports=function(e,t){var n=r(e,!!t);return typeof n==`function`&&a(e,`.prototype.`)>-1?i(n):n}},{"./":22,"get-intrinsic":27}],22:[function(e,t,n){var r=e("function-bind"),i=e("get-intrinsic"),a=i(`%Function.prototype.apply%`),o=i(`%Function.prototype.call%`),s=i(`%Reflect.apply%`,!0)||r.call(o,a),c=i(`%Object.getOwnPropertyDescriptor%`,!0),l=i(`%Object.defineProperty%`,!0),u=i(`%Math.max%`);if(l)try{l({},`a`,{value:1})}catch{l=null}t.exports=function(e){var t=s(r,o,arguments);return c&&l&&c(t,`length`).configurable&&l(t,`length`,{value:1+u(0,e.length-(arguments.length-1))}),t};var d=function(){return s(r,a,arguments)};l?l(t.exports,`apply`,{value:d}):t.exports.apply=d},{"function-bind":26,"get-intrinsic":27}],23:[function(e,t,n){var r=e("get-intrinsic")(`%Object.getOwnPropertyDescriptor%`,!0);if(r)try{r([],`length`)}catch{r=null}t.exports=r},{"get-intrinsic":27}],24:[function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString;t.exports=function(e,t,n){if(i.call(t)!==`[object Function]`)throw TypeError(`iterator must be a function`);var a=e.length;if(a===+a)for(var o=0;o<a;o++)t.call(n,e[o],o,e);else for(var s in e)r.call(e,s)&&t.call(n,e[s],s,e)}},{}],25:[function(e,t,n){var r=Object.prototype.toString,i=Math.max,a=`[object Function]`,o=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var i=0;i<t.length;i+=1)n[i+e.length]=t[i];return n},s=function(e,t){for(var n=[],r=t||0,i=0;r<e.length;r+=1,i+=1)n[i]=e[r];return n},c=function(e,t){for(var n=``,r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n};t.exports=function(e){var t=this;if(typeof t!=`function`||r.apply(t)!==a)throw TypeError(`Function.prototype.bind called on incompatible `+t);for(var n=s(arguments,1),l,u=function(){if(this instanceof l){var r=t.apply(this,o(n,arguments));return Object(r)===r?r:this}return t.apply(e,o(n,arguments))},d=i(0,t.length-n.length),f=[],p=0;p<d;p++)f[p]=`$`+p;if(l=Function(`binder`,`return function (`+c(f,`,`)+`){ return binder.apply(this,arguments); }`)(u),t.prototype){var m=function(){};m.prototype=t.prototype,l.prototype=new m,m.prototype=null}return l}},{}],26:[function(e,t,n){var r=e("./implementation");t.exports=Function.prototype.bind||r},{"./implementation":25}],27:[function(e,t,n){var r,i=SyntaxError,a=Function,o=TypeError,s=function(e){try{return a(`"use strict"; return (`+e+`).constructor;`)()}catch{}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},``)}catch{c=null}var l=function(){throw new o},u=c?function(){try{return arguments.callee,l}catch{try{return c(arguments,`callee`).get}catch{return l}}}():l,d=e("has-symbols")(),f=Object.getPrototypeOf||function(e){return e.__proto__},p={},m=typeof Uint8Array>`u`?r:f(Uint8Array),h={"%AggregateError%":typeof AggregateError>`u`?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>`u`?r:ArrayBuffer,"%ArrayIteratorPrototype%":d?f([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":typeof Atomics>`u`?r:Atomics,"%BigInt%":typeof BigInt>`u`?r:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>`u`?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>`u`?r:Float32Array,"%Float64Array%":typeof Float64Array>`u`?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>`u`?r:FinalizationRegistry,"%Function%":a,"%GeneratorFunction%":p,"%Int8Array%":typeof Int8Array>`u`?r:Int8Array,"%Int16Array%":typeof Int16Array>`u`?r:Int16Array,"%Int32Array%":typeof Int32Array>`u`?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":d?f(f([][Symbol.iterator]())):r,"%JSON%":typeof JSON==`object`?JSON:r,"%Map%":typeof Map>`u`?r:Map,"%MapIteratorPrototype%":typeof Map>`u`||!d?r:f((/* @__PURE__ */ new Map())[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>`u`?r:Promise,"%Proxy%":typeof Proxy>`u`?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>`u`?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>`u`?r:Set,"%SetIteratorPrototype%":typeof Set>`u`||!d?r:f((/* @__PURE__ */ new Set())[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>`u`?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":d?f(``[Symbol.iterator]()):r,"%Symbol%":d?Symbol:r,"%SyntaxError%":i,"%ThrowTypeError%":u,"%TypedArray%":m,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>`u`?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>`u`?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>`u`?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>`u`?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>`u`?r:WeakMap,"%WeakRef%":typeof WeakRef>`u`?r:WeakRef,"%WeakSet%":typeof WeakSet>`u`?r:WeakSet},g=function e(t){var n;if(t===`%AsyncFunction%`)n=s(`async function () {}`);else if(t===`%GeneratorFunction%`)n=s(`function* () {}`);else if(t===`%AsyncGeneratorFunction%`)n=s(`async function* () {}`);else if(t===`%AsyncGenerator%`){var r=e(`%AsyncGeneratorFunction%`);r&&(n=r.prototype)}else if(t===`%AsyncIteratorPrototype%`){var i=e(`%AsyncGenerator%`);i&&(n=f(i.prototype))}return h[t]=n,n},_={"%ArrayBufferPrototype%":[`ArrayBuffer`,`prototype`],"%ArrayPrototype%":[`Array`,`prototype`],"%ArrayProto_entries%":[`Array`,`prototype`,`entries`],"%ArrayProto_forEach%":[`Array`,`prototype`,`forEach`],"%ArrayProto_keys%":[`Array`,`prototype`,`keys`],"%ArrayProto_values%":[`Array`,`prototype`,`values`],"%AsyncFunctionPrototype%":[`AsyncFunction`,`prototype`],"%AsyncGenerator%":[`AsyncGeneratorFunction`,`prototype`],"%AsyncGeneratorPrototype%":[`AsyncGeneratorFunction`,`prototype`,`prototype`],"%BooleanPrototype%":[`Boolean`,`prototype`],"%DataViewPrototype%":[`DataView`,`prototype`],"%DatePrototype%":[`Date`,`prototype`],"%ErrorPrototype%":[`Error`,`prototype`],"%EvalErrorPrototype%":[`EvalError`,`prototype`],"%Float32ArrayPrototype%":[`Float32Array`,`prototype`],"%Float64ArrayPrototype%":[`Float64Array`,`prototype`],"%FunctionPrototype%":[`Function`,`prototype`],"%Generator%":[`GeneratorFunction`,`prototype`],"%GeneratorPrototype%":[`GeneratorFunction`,`prototype`,`prototype`],"%Int8ArrayPrototype%":[`Int8Array`,`prototype`],"%Int16ArrayPrototype%":[`Int16Array`,`prototype`],"%Int32ArrayPrototype%":[`Int32Array`,`prototype`],"%JSONParse%":[`JSON`,`parse`],"%JSONStringify%":[`JSON`,`stringify`],"%MapPrototype%":[`Map`,`prototype`],"%NumberPrototype%":[`Number`,`prototype`],"%ObjectPrototype%":[`Object`,`prototype`],"%ObjProto_toString%":[`Object`,`prototype`,`toString`],"%ObjProto_valueOf%":[`Object`,`prototype`,`valueOf`],"%PromisePrototype%":[`Promise`,`prototype`],"%PromiseProto_then%":[`Promise`,`prototype`,`then`],"%Promise_all%":[`Promise`,`all`],"%Promise_reject%":[`Promise`,`reject`],"%Promise_resolve%":[`Promise`,`resolve`],"%RangeErrorPrototype%":[`RangeError`,`prototype`],"%ReferenceErrorPrototype%":[`ReferenceError`,`prototype`],"%RegExpPrototype%":[`RegExp`,`prototype`],"%SetPrototype%":[`Set`,`prototype`],"%SharedArrayBufferPrototype%":[`SharedArrayBuffer`,`prototype`],"%StringPrototype%":[`String`,`prototype`],"%SymbolPrototype%":[`Symbol`,`prototype`],"%SyntaxErrorPrototype%":[`SyntaxError`,`prototype`],"%TypedArrayPrototype%":[`TypedArray`,`prototype`],"%TypeErrorPrototype%":[`TypeError`,`prototype`],"%Uint8ArrayPrototype%":[`Uint8Array`,`prototype`],"%Uint8ClampedArrayPrototype%":[`Uint8ClampedArray`,`prototype`],"%Uint16ArrayPrototype%":[`Uint16Array`,`prototype`],"%Uint32ArrayPrototype%":[`Uint32Array`,`prototype`],"%URIErrorPrototype%":[`URIError`,`prototype`],"%WeakMapPrototype%":[`WeakMap`,`prototype`],"%WeakSetPrototype%":[`WeakSet`,`prototype`]},v=e("function-bind"),y=e("has"),b=v.call(Function.call,Array.prototype.concat),x=v.call(Function.apply,Array.prototype.splice),S=v.call(Function.call,String.prototype.replace),C=v.call(Function.call,String.prototype.slice),w=v.call(Function.call,RegExp.prototype.exec),T=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,E=/\\(\\)?/g,D=function(e){var t=C(e,0,1),n=C(e,-1);if(t===`%`&&n!==`%`)throw new i("invalid intrinsic syntax, expected closing `%`");if(n===`%`&&t!==`%`)throw new i("invalid intrinsic syntax, expected opening `%`");var r=[];return S(e,T,function(e,t,n,i){r[r.length]=n?S(i,E,`$1`):t||e}),r},O=function(e,t){var n=e,r;if(y(_,n)&&(r=_[n],n=`%`+r[0]+`%`),y(h,n)){var a=h[n];if(a===p&&(a=g(n)),a===void 0&&!t)throw new o(`intrinsic `+e+` exists, but is not available. Please file an issue!`);return{alias:r,name:n,value:a}}throw new i(`intrinsic `+e+` does not exist!`)};t.exports=function(e,t){if(typeof e!=`string`||e.length===0)throw new o(`intrinsic name must be a non-empty string`);if(arguments.length>1&&typeof t!=`boolean`)throw new o(`"allowMissing" argument must be a boolean`);if(w(/^%?[^%]*%?$/g,e)===null)throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=D(e),r=n.length>0?n[0]:``,a=O(`%`+r+`%`,t),s=a.name,l=a.value,u=!1,d=a.alias;d&&(r=d[0],x(n,b([0,1],d)));for(var f=1,p=!0;f<n.length;f+=1){var m=n[f],g=C(m,0,1),_=C(m,-1);if((g===`"`||g===`'`||g==="`"||_===`"`||_===`'`||_==="`")&&g!==_)throw new i(`property names with quotes must have matching quotes`);if((m===`constructor`||!p)&&(u=!0),r+=`.`+m,s=`%`+r+`%`,y(h,s))l=h[s];else if(l!=null){if(!(m in l)){if(!t)throw new o(`base intrinsic for `+e+` exists, but the property is not available.`);return}if(c&&f+1>=n.length){var v=c(l,m);p=!!v,l=p&&`get`in v&&!(`originalValue`in v.get)?v.get:l[m]}else p=y(l,m),l=l[m];p&&!u&&(h[s]=l)}}return l}},{"function-bind":26,has:30,"has-symbols":28}],28:[function(e,t,n){var r=typeof Symbol<`u`&&Symbol,i=e("./shams");t.exports=function(){return typeof r!=`function`||typeof Symbol!=`function`||typeof r(`foo`)!=`symbol`||typeof Symbol(`bar`)!=`symbol`?!1:i()}},{"./shams":29}],29:[function(e,t,n){t.exports=function(){if(typeof Symbol!=`function`||typeof Object.getOwnPropertySymbols!=`function`)return!1;if(typeof Symbol.iterator==`symbol`)return!0;var e={},t=Symbol(`test`),n=Object(t);if(typeof t==`string`||Object.prototype.toString.call(t)!==`[object Symbol]`||Object.prototype.toString.call(n)!==`[object Symbol]`)return!1;var r=42;for(t in e[t]=r,e)return!1;if(typeof Object.keys==`function`&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames==`function`&&Object.getOwnPropertyNames(e).length!==0)return!1;var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor==`function`){var a=Object.getOwnPropertyDescriptor(e,t);if(a.value!==r||a.enumerable!==!0)return!1}return!0}},{}],30:[function(e,t,n){t.exports=e("function-bind").call(Function.call,Object.prototype.hasOwnProperty)},{"function-bind":26}],31:[function(e,t,n){
|
|
19
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
20
|
+
n.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else if(a===c)return o?NaN:(p?-1:1)*(1/0);else o+=2**r,a-=l;return(p?-1:1)*o*2**(a-r)},n.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=+(t<0||t===0&&1/t<0);for(t=Math.abs(t),isNaN(t)||t===1/0?(s=+!!isNaN(t),o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128}},{}],32:[function(e,t,n){t.exports=typeof Object.create==`function`?function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],33:[function(e,t,n){var r=typeof Symbol==`function`&&typeof Symbol.toStringTag==`symbol`,i=e("call-bind/callBound")(`Object.prototype.toString`),a=function(e){return r&&e&&typeof e==`object`&&Symbol.toStringTag in e?!1:i(e)===`[object Arguments]`},o=function(e){return a(e)?!0:typeof e==`object`&&!!e&&typeof e.length==`number`&&e.length>=0&&i(e)!==`[object Array]`&&i(e.callee)===`[object Function]`},s=function(){return a(arguments)}();a.isLegacyArguments=o,t.exports=s?a:o},{"call-bind/callBound":21}],34:[function(e,t,n){var r=Object.prototype.toString,i=Function.prototype.toString,a=/^\s*(?:function)?\*/,o=typeof Symbol==`function`&&typeof Symbol.toStringTag==`symbol`,s=Object.getPrototypeOf,c=function(){if(!o)return!1;try{return Function(`return function*() {}`)()}catch{}}(),l=s&&c?s(c):!1;t.exports=function(e){return typeof e==`function`?a.test(i.call(e))?!0:o?s&&s(e)===l:r.call(e)===`[object GeneratorFunction]`:!1}},{}],35:[function(e,t,n){(function(n){(function(){var r=e("foreach"),i=e("available-typed-arrays"),a=e("call-bind/callBound"),o=a(`Object.prototype.toString`),s=e("has-symbols")()&&typeof Symbol.toStringTag==`symbol`,c=i(),l=a(`Array.prototype.indexOf`,!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},u=a(`String.prototype.slice`),d={},f=e("es-abstract/helpers/getOwnPropertyDescriptor"),p=Object.getPrototypeOf;s&&f&&p&&r(c,function(e){var t=new n[e];if(!(Symbol.toStringTag in t))throw EvalError(`this engine has support for Symbol.toStringTag, but `+e+` does not have the property! Please report this.`);var r=p(t),i=f(r,Symbol.toStringTag);i||=f(p(r),Symbol.toStringTag),d[e]=i.get});var m=function(e){var t=!1;return r(d,function(n,r){if(!t)try{t=n.call(e)===r}catch{}}),t};t.exports=function(e){return!e||typeof e!=`object`?!1:s?f?m(e):!1:l(c,u(o(e),8,-1))>-1}}).call(this)}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{"available-typed-arrays":18,"call-bind/callBound":21,"es-abstract/helpers/getOwnPropertyDescriptor":23,foreach:24,"has-symbols":28}],36:[function(e,t,n){let{Deflate:r,deflate:i,deflateRaw:a,gzip:o}=e("./lib/deflate"),{Inflate:s,inflate:c,inflateRaw:l,ungzip:u}=e("./lib/inflate"),d=e("./lib/zlib/constants");t.exports.Deflate=r,t.exports.deflate=i,t.exports.deflateRaw=a,t.exports.gzip=o,t.exports.Inflate=s,t.exports.inflate=c,t.exports.inflateRaw=l,t.exports.ungzip=u,t.exports.constants=d},{"./lib/deflate":37,"./lib/inflate":38,"./lib/zlib/constants":42}],37:[function(e,t,n){let r=e("./zlib/deflate"),i=e("./utils/common"),a=e("./utils/strings"),o=e("./zlib/messages"),s=e("./zlib/zstream"),c=Object.prototype.toString,{Z_NO_FLUSH:l,Z_SYNC_FLUSH:u,Z_FULL_FLUSH:d,Z_FINISH:f,Z_OK:p,Z_STREAM_END:m,Z_DEFAULT_COMPRESSION:h,Z_DEFAULT_STRATEGY:g,Z_DEFLATED:_}=e("./zlib/constants");function v(e){this.options=i.assign({level:h,method:_,chunkSize:16384,windowBits:15,memLevel:8,strategy:g},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;let n=r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==p)throw Error(o[n]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e=typeof t.dictionary==`string`?a.string2buf(t.dictionary):c.call(t.dictionary)===`[object ArrayBuffer]`?new Uint8Array(t.dictionary):t.dictionary,n=r.deflateSetDictionary(this.strm,e),n!==p)throw Error(o[n]);this._dict_set=!0}}v.prototype.push=function(e,t){let n=this.strm,i=this.options.chunkSize,o,s;if(this.ended)return!1;for(s=t===~~t?t:t===!0?f:l,n.input=typeof e==`string`?a.string2buf(e):c.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,n.next_in=0,n.avail_in=n.input.length;;)if(n.avail_out===0&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),(s===u||s===d)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(o=r.deflate(n,s),o===m)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),o=r.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===p;if(n.avail_out===0)this.onData(n.output);else if(s>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(n.avail_in===0)break}return!0},v.prototype.onData=function(e){this.chunks.push(e)},v.prototype.onEnd=function(e){e===p&&(this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function y(e,t){let n=new v(t);if(n.push(e,!0),n.err)throw n.msg||o[n.err];return n.result}function b(e,t){return t||={},t.raw=!0,y(e,t)}function x(e,t){return t||={},t.gzip=!0,y(e,t)}t.exports.Deflate=v,t.exports.deflate=y,t.exports.deflateRaw=b,t.exports.gzip=x,t.exports.constants=e("./zlib/constants")},{"./utils/common":39,"./utils/strings":40,"./zlib/constants":42,"./zlib/deflate":44,"./zlib/messages":49,"./zlib/zstream":51}],38:[function(e,t,n){let r=e("./zlib/inflate"),i=e("./utils/common"),a=e("./utils/strings"),o=e("./zlib/messages"),s=e("./zlib/zstream"),c=e("./zlib/gzheader"),l=Object.prototype.toString,{Z_NO_FLUSH:u,Z_FINISH:d,Z_OK:f,Z_STREAM_END:p,Z_NEED_DICT:m,Z_STREAM_ERROR:h,Z_DATA_ERROR:g,Z_MEM_ERROR:_}=e("./zlib/constants");function v(e){this.options=i.assign({chunkSize:65536,windowBits:15,to:``},e||{});let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;let n=r.inflateInit2(this.strm,t.windowBits);if(n!==f||(this.header=new c,r.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary==`string`?t.dictionary=a.string2buf(t.dictionary):l.call(t.dictionary)===`[object ArrayBuffer]`&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=r.inflateSetDictionary(this.strm,t.dictionary),n!==f))))throw Error(o[n])}v.prototype.push=function(e,t){let n=this.strm,i=this.options.chunkSize,o=this.options.dictionary,s,c,v;if(this.ended)return!1;for(c=t===~~t?t:t===!0?d:u,n.input=l.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),s=r.inflate(n,c),s===m&&o&&(s=r.inflateSetDictionary(n,o),s===f?s=r.inflate(n,c):s===g&&(s=m));n.avail_in>0&&s===p&&n.state.wrap>0&&e[n.next_in]!==0;)r.inflateReset(n),s=r.inflate(n,c);switch(s){case h:case g:case m:case _:return this.onEnd(s),this.ended=!0,!1}if(v=n.avail_out,n.next_out&&(n.avail_out===0||s===p)){if(this.options.to===`string`){let e=a.utf8border(n.output,n.next_out),t=n.next_out-e,r=a.buf2string(n.output,e);n.next_out=t,n.avail_out=i-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(r)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out))}if(s!==f||v!==0){if(s===p)return s=r.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(n.avail_in===0)break}}return!0},v.prototype.onData=function(e){this.chunks.push(e)},v.prototype.onEnd=function(e){e===f&&(this.result=this.options.to===`string`?this.chunks.join(``):i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function y(e,t){let n=new v(t);if(n.push(e),n.err)throw n.msg||o[n.err];return n.result}function b(e,t){return t||={},t.raw=!0,y(e,t)}t.exports.Inflate=v,t.exports.inflate=y,t.exports.inflateRaw=b,t.exports.ungzip=y,t.exports.constants=e("./zlib/constants")},{"./utils/common":39,"./utils/strings":40,"./zlib/constants":42,"./zlib/gzheader":45,"./zlib/inflate":47,"./zlib/messages":49,"./zlib/zstream":51}],39:[function(e,t,n){let r=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);t.exports.assign=function(e){let t=Array.prototype.slice.call(arguments,1);for(;t.length;){let n=t.shift();if(n){if(typeof n!=`object`)throw TypeError(n+`must be non-object`);for(let t in n)r(n,t)&&(e[t]=n[t])}}return e},t.exports.flattenChunks=e=>{let t=0;for(let n=0,r=e.length;n<r;n++)t+=e[n].length;let n=new Uint8Array(t);for(let t=0,r=0,i=e.length;t<i;t++){let i=e[t];n.set(i,r),r+=i.length}return n}},{}],40:[function(e,t,n){let r=!0;try{String.fromCharCode.apply(null,/* @__PURE__ */ new Uint8Array(1))}catch{r=!1}let i=/* @__PURE__ */ new Uint8Array(256);for(let e=0;e<256;e++)i[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;i[254]=i[254]=1,t.exports.string2buf=e=>{if(typeof TextEncoder==`function`&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,i,a,o=e.length,s=0;for(i=0;i<o;i++)n=e.charCodeAt(i),(n&64512)==55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)==56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),a=0,i=0;a<s;i++)n=e.charCodeAt(i),(n&64512)==55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)==56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|n&63):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|n&63):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|n&63);return t};let a=(e,t)=>{if(t<65534&&e.subarray&&r)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n=``;for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n};t.exports.buf2string=(e,t)=>{let n=t||e.length;if(typeof TextDecoder==`function`&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,o,s=Array(n*2);for(o=0,r=0;r<n;){let t=e[r++];if(t<128){s[o++]=t;continue}let a=i[t];if(a>4)s[o++]=65533,r+=a-1;else{for(t&=a===2?31:a===3?15:7;a>1&&r<n;)t=t<<6|e[r++]&63,a--;a>1?s[o++]=65533:t<65536?s[o++]=t:(t-=65536,s[o++]=55296|t>>10&1023,s[o++]=56320|t&1023)}}return a(s,o)},t.exports.utf8border=(e,t)=>{t||=e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)==128;)n--;return n<0||n===0?t:n+i[e[n]]>t?n:t}},{}],41:[function(e,t,n){t.exports=(e,t,n,r)=>{let i=e&65535,a=e>>>16&65535,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16}},{}],42:[function(e,t,n){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],43:[function(e,t,n){let r=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t})());t.exports=(e,t,n,i)=>{let a=r,o=i+n;e^=-1;for(let n=i;n<o;n++)e=e>>>8^a[(e^t[n])&255];return e^-1}},{}],44:[function(e,t,n){let{_tr_init:r,_tr_stored_block:i,_tr_flush_block:a,_tr_tally:o,_tr_align:s}=e("./trees"),c=e("./adler32"),l=e("./crc32"),u=e("./messages"),{Z_NO_FLUSH:d,Z_PARTIAL_FLUSH:f,Z_FULL_FLUSH:p,Z_FINISH:m,Z_BLOCK:h,Z_OK:g,Z_STREAM_END:_,Z_STREAM_ERROR:v,Z_DATA_ERROR:y,Z_BUF_ERROR:b,Z_DEFAULT_COMPRESSION:x,Z_FILTERED:S,Z_HUFFMAN_ONLY:C,Z_RLE:w,Z_FIXED:T,Z_DEFAULT_STRATEGY:E,Z_UNKNOWN:D,Z_DEFLATED:O}=e("./constants"),k=(e,t)=>(e.msg=u[t],t),A=e=>e*2-(e>4?9:0),j=e=>{let t=e.length;for(;--t>=0;)e[t]=0},M=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)},N=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,P=e=>{let t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},F=(e,t)=>{a(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,P(e.strm)},I=(e,t)=>{e.pending_buf[e.pending++]=t},L=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},R=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=c(e.adler,t,i,n):e.state.wrap===2&&(e.adler=l(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},ee=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+258,p=l[r+o-1],m=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,l[i+o]===m&&l[i+o-1]===p&&l[i]===l[r]&&l[++i]===l[r+1]){r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<f);if(a=258-(f-r),r=f-258,a>o){if(e.match_start=t,o=a,a>=s)break;p=l[r+o-1],m=l[r+o]}}while((t=d[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead},te=e=>{let t=e.w_size,n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-262)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),M(e),r+=t),e.strm.avail_in===0)break;if(n=R(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=N(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=N(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<262&&e.strm.avail_in!==0)},z=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,a,o,s=0,c=e.strm.avail_in;do{if(r=65535,o=e.bi_valid+42>>3,e.strm.avail_out<o||(o=e.strm.avail_out-o,a=e.strstart-e.block_start,r>a+e.strm.avail_in&&(r=a+e.strm.avail_in),r>o&&(r=o),r<n&&(r===0&&t!==m||t===d||r!==a+e.strm.avail_in)))break;s=+(t===m&&r===a+e.strm.avail_in),i(e,0,0,s),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,P(e.strm),a&&(a>r&&(a=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+a),e.strm.next_out),e.strm.next_out+=a,e.strm.avail_out-=a,e.strm.total_out+=a,e.block_start+=a,r-=a),r&&(R(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(s===0);return c-=e.strm.avail_in,c&&(c>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=c&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-c,e.strm.next_in),e.strstart),e.strstart+=c,e.insert+=c>e.w_size-e.insert?e.w_size-e.insert:c),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),s?4:t!==d&&t!==m&&e.strm.avail_in===0&&e.strstart===e.block_start?2:(o=e.window_size-e.strstart,e.strm.avail_in>o&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,o+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),o>e.strm.avail_in&&(o=e.strm.avail_in),o&&(R(e.strm,e.window,e.strstart,o),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.high_water<e.strstart&&(e.high_water=e.strstart),o=e.bi_valid+42>>3,o=e.pending_buf_size-o>65535?65535:e.pending_buf_size-o,n=o>e.w_size?e.w_size:o,a=e.strstart-e.block_start,(a>=n||(a||t===m)&&t!==d&&e.strm.avail_in===0&&a<=o)&&(r=a>o?o:a,s=+(t===m&&e.strm.avail_in===0&&r===a),i(e,e.block_start,r,s),e.block_start+=r,P(e.strm)),s?3:1)},B=(e,t)=>{let n,r;for(;;){if(e.lookahead<262){if(te(e),e.lookahead<262&&t===d)return 1;if(e.lookahead===0)break}if(n=0,e.lookahead>=3&&(e.ins_h=N(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-262&&(e.match_length=ee(e,n)),e.match_length>=3){if(r=o(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do e.strstart++,e.ins_h=N(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=N(e,e.ins_h,e.window[e.strstart+1])}else r=o(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(F(e,!1),e.strm.avail_out===0))return 1}return e.insert=e.strstart<2?e.strstart:2,t===m?(F(e,!0),e.strm.avail_out===0?3:4):e.sym_next&&(F(e,!1),e.strm.avail_out===0)?1:2},ne=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<262){if(te(e),e.lookahead<262&&t===d)return 1;if(e.lookahead===0)break}if(n=0,e.lookahead>=3&&(e.ins_h=N(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-262&&(e.match_length=ee(e,n),e.match_length<=5&&(e.strategy===S||e.match_length===3&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,r=o(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=N(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(F(e,!1),e.strm.avail_out===0))return 1}else if(e.match_available){if(r=o(e,0,e.window[e.strstart-1]),r&&F(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(r=o(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<2?e.strstart:2,t===m?(F(e,!0),e.strm.avail_out===0?3:4):e.sym_next&&(F(e,!1),e.strm.avail_out===0)?1:2},re=(e,t)=>{let n,r,i,a,s=e.window;for(;;){if(e.lookahead<=258){if(te(e),e.lookahead<=258&&t===d)return 1;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,r=s[i],r===s[++i]&&r===s[++i]&&r===s[++i])){a=e.strstart+258;do;while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&i<a);e.match_length=258-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=o(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=o(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(F(e,!1),e.strm.avail_out===0))return 1}return e.insert=0,t===m?(F(e,!0),e.strm.avail_out===0?3:4):e.sym_next&&(F(e,!1),e.strm.avail_out===0)?1:2},ie=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(te(e),e.lookahead===0)){if(t===d)return 1;break}if(e.match_length=0,n=o(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(F(e,!1),e.strm.avail_out===0))return 1}return e.insert=0,t===m?(F(e,!0),e.strm.avail_out===0?3:4):e.sym_next&&(F(e,!1),e.strm.avail_out===0)?1:2};function V(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}let H=[new V(0,0,0,0,z),new V(4,4,8,4,B),new V(4,5,16,8,B),new V(4,6,32,32,B),new V(4,4,16,16,ne),new V(8,16,32,32,ne),new V(8,16,128,128,ne),new V(8,32,128,256,ne),new V(32,128,258,1024,ne),new V(32,258,258,4096,ne)],ae=e=>{e.window_size=2*e.w_size,j(e.head),e.max_lazy_match=H[e.level].max_lazy,e.good_match=H[e.level].good_length,e.nice_match=H[e.level].nice_length,e.max_chain_length=H[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0};function oe(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=O,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=/* @__PURE__ */ new Uint16Array(1146),this.dyn_dtree=/* @__PURE__ */ new Uint16Array(122),this.bl_tree=/* @__PURE__ */ new Uint16Array(78),j(this.dyn_ltree),j(this.dyn_dtree),j(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=/* @__PURE__ */ new Uint16Array(16),this.heap=/* @__PURE__ */ new Uint16Array(573),j(this.heap),this.heap_len=0,this.heap_max=0,this.depth=/* @__PURE__ */ new Uint16Array(573),j(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}let U=e=>{if(!e)return 1;let t=e.state;return+(!t||t.strm!==e||t.status!==42&&t.status!==57&&t.status!==69&&t.status!==73&&t.status!==91&&t.status!==103&&t.status!==113&&t.status!==666)},W=e=>{if(U(e))return k(e,v);e.total_in=e.total_out=0,e.data_type=D;let t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?57:t.wrap?42:113,e.adler=t.wrap===2?0:1,t.last_flush=-2,r(t),g},se=e=>{let t=W(e);return t===g&&ae(e.state),t},ce=(e,t)=>U(e)||e.state.wrap!==2?v:(e.state.gzhead=t,g),G=(e,t,n,r,i,a)=>{if(!e)return v;let o=1;if(t===x&&(t=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>9||n!==O||r<8||r>15||t<0||t>9||a<0||a>T||r===8&&o!==1)return k(e,v);r===8&&(r=9);let s=new oe;return e.state=s,s.strm=e,s.status=42,s.wrap=o,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=t,s.strategy=a,s.method=n,se(e)},le=(e,t)=>G(e,t,O,15,8,E),K=(e,t)=>{if(U(e)||t>h||t<0)return e?k(e,v):v;let n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===666&&t!==m)return k(e,e.avail_out===0?b:v);let r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(P(e),e.avail_out===0)return n.last_flush=-1,g}else if(e.avail_in===0&&A(t)<=A(r)&&t!==m)return k(e,b);if(n.status===666&&e.avail_in!==0)return k(e,b);if(n.status===42&&n.wrap===0&&(n.status=113),n.status===42){let t=O+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=C||n.level<2?0:n.level<6?1:n.level===6?2:3,t|=r<<6,n.strstart!==0&&(t|=32),t+=31-t%31,L(n,t),n.strstart!==0&&(L(n,e.adler>>>16),L(n,e.adler&65535)),e.adler=1,n.status=113,P(e),n.pending!==0)return n.last_flush=-1,g}if(n.status===57){if(e.adler=0,I(n,31),I(n,139),I(n,8),n.gzhead)I(n,+!!n.gzhead.text+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),I(n,n.gzhead.time&255),I(n,n.gzhead.time>>8&255),I(n,n.gzhead.time>>16&255),I(n,n.gzhead.time>>24&255),I(n,n.level===9?2:n.strategy>=C||n.level<2?4:0),I(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(I(n,n.gzhead.extra.length&255),I(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=l(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(I(n,0),I(n,0),I(n,0),I(n,0),I(n,0),I(n,n.level===9?2:n.strategy>=C||n.level<2?4:0),I(n,3),n.status=113,P(e),n.pending!==0)return n.last_flush=-1,g}if(n.status===69){if(n.gzhead.extra){let t=n.pending,r=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=l(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=i,P(e),n.pending!==0)return n.last_flush=-1,g;t=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>t&&(e.adler=l(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=73}if(n.status===73){if(n.gzhead.name){let t=n.pending,r;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(e.adler=l(e.adler,n.pending_buf,n.pending-t,t)),P(e),n.pending!==0)return n.last_flush=-1,g;t=0}r=n.gzindex<n.gzhead.name.length?n.gzhead.name.charCodeAt(n.gzindex++)&255:0,I(n,r)}while(r!==0);n.gzhead.hcrc&&n.pending>t&&(e.adler=l(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=91}if(n.status===91){if(n.gzhead.comment){let t=n.pending,r;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(e.adler=l(e.adler,n.pending_buf,n.pending-t,t)),P(e),n.pending!==0)return n.last_flush=-1,g;t=0}r=n.gzindex<n.gzhead.comment.length?n.gzhead.comment.charCodeAt(n.gzindex++)&255:0,I(n,r)}while(r!==0);n.gzhead.hcrc&&n.pending>t&&(e.adler=l(e.adler,n.pending_buf,n.pending-t,t))}n.status=103}if(n.status===103){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(P(e),n.pending!==0))return n.last_flush=-1,g;I(n,e.adler&255),I(n,e.adler>>8&255),e.adler=0}if(n.status=113,P(e),n.pending!==0)return n.last_flush=-1,g}if(e.avail_in!==0||n.lookahead!==0||t!==d&&n.status!==666){let r=n.level===0?z(n,t):n.strategy===C?ie(n,t):n.strategy===w?re(n,t):H[n.level].func(n,t);if((r===3||r===4)&&(n.status=666),r===1||r===3)return e.avail_out===0&&(n.last_flush=-1),g;if(r===2&&(t===f?s(n):t!==h&&(i(n,0,0,!1),t===p&&(j(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),P(e),e.avail_out===0))return n.last_flush=-1,g}return t===m?n.wrap<=0?_:(n.wrap===2?(I(n,e.adler&255),I(n,e.adler>>8&255),I(n,e.adler>>16&255),I(n,e.adler>>24&255),I(n,e.total_in&255),I(n,e.total_in>>8&255),I(n,e.total_in>>16&255),I(n,e.total_in>>24&255)):(L(n,e.adler>>>16),L(n,e.adler&65535)),P(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending===0?_:g):g},q=e=>{if(U(e))return v;let t=e.state.status;return e.state=null,t===113?k(e,y):g},J=(e,t)=>{let n=t.length;if(U(e))return v;let r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==42||r.lookahead)return v;if(i===1&&(e.adler=c(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(j(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}let a=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,te(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do r.ins_h=N(r,r.ins_h,r.window[e+3-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++;while(--t);r.strstart=e,r.lookahead=2,te(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,r.wrap=i,g};t.exports.deflateInit=le,t.exports.deflateInit2=G,t.exports.deflateReset=se,t.exports.deflateResetKeep=W,t.exports.deflateSetHeader=ce,t.exports.deflate=K,t.exports.deflateEnd=q,t.exports.deflateSetDictionary=J,t.exports.deflateInfo=`pako deflate (from Nodeca project)`},{"./adler32":41,"./constants":42,"./crc32":43,"./messages":49,"./trees":50}],45:[function(e,t,n){function r(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=``,this.comment=``,this.hcrc=0,this.done=!1}t.exports=r},{}],46:[function(e,t,n){let r=16209;t.exports=function(e,t){let n,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D=e.state;n=e.next_in,T=e.input,i=n+(e.avail_in-5),a=e.next_out,E=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),c=D.dmax,l=D.wsize,u=D.whave,d=D.wnext,f=D.window,p=D.hold,m=D.bits,h=D.lencode,g=D.distcode,_=(1<<D.lenbits)-1,v=(1<<D.distbits)-1;top:do{m<15&&(p+=T[n++]<<m,m+=8,p+=T[n++]<<m,m+=8),y=h[p&_];dolen:for(;;){if(b=y>>>24,p>>>=b,m-=b,b=y>>>16&255,b===0)E[a++]=y&65535;else if(b&16){x=y&65535,b&=15,b&&(m<b&&(p+=T[n++]<<m,m+=8),x+=p&(1<<b)-1,p>>>=b,m-=b),m<15&&(p+=T[n++]<<m,m+=8,p+=T[n++]<<m,m+=8),y=g[p&v];dodist:for(;;){if(b=y>>>24,p>>>=b,m-=b,b=y>>>16&255,b&16){if(S=y&65535,b&=15,m<b&&(p+=T[n++]<<m,m+=8,m<b&&(p+=T[n++]<<m,m+=8)),S+=p&(1<<b)-1,S>c){e.msg=`invalid distance too far back`,D.mode=r;break top}if(p>>>=b,m-=b,b=a-o,S>b){if(b=S-b,b>u&&D.sane){e.msg=`invalid distance too far back`,D.mode=r;break top}if(C=0,w=f,d===0){if(C+=l-b,b<x){x-=b;do E[a++]=f[C++];while(--b);C=a-S,w=E}}else if(d<b){if(C+=l+d-b,b-=d,b<x){x-=b;do E[a++]=f[C++];while(--b);if(C=0,d<x){b=d,x-=b;do E[a++]=f[C++];while(--b);C=a-S,w=E}}}else if(C+=d-b,b<x){x-=b;do E[a++]=f[C++];while(--b);C=a-S,w=E}for(;x>2;)E[a++]=w[C++],E[a++]=w[C++],E[a++]=w[C++],x-=3;x&&(E[a++]=w[C++],x>1&&(E[a++]=w[C++]))}else{C=a-S;do E[a++]=E[C++],E[a++]=E[C++],E[a++]=E[C++],x-=3;while(x>2);x&&(E[a++]=E[C++],x>1&&(E[a++]=E[C++]))}}else if(b&64){e.msg=`invalid distance code`,D.mode=r;break top}else{y=g[(y&65535)+(p&(1<<b)-1)];continue dodist}break}}else if(!(b&64)){y=h[(y&65535)+(p&(1<<b)-1)];continue dolen}else if(b&32){D.mode=16191;break top}else{e.msg=`invalid literal/length code`,D.mode=r;break top}break}}while(n<i&&a<s);x=m>>3,n-=x,m-=x<<3,p&=(1<<m)-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?5+(i-n):5-(n-i),e.avail_out=a<s?257+(s-a):257-(a-s),D.hold=p,D.bits=m}},{}],47:[function(e,t,n){let r=e("./adler32"),i=e("./crc32"),a=e("./inffast"),o=e("./inftrees"),{Z_FINISH:s,Z_BLOCK:c,Z_TREES:l,Z_OK:u,Z_STREAM_END:d,Z_NEED_DICT:f,Z_STREAM_ERROR:p,Z_DATA_ERROR:m,Z_MEM_ERROR:h,Z_BUF_ERROR:g,Z_DEFLATED:_}=e("./constants"),v=16180,y=16181,b=16182,x=16183,S=16184,C=16185,w=16186,T=16187,E=16188,D=16189,O=16190,k=16191,A=16192,j=16193,M=16194,N=16195,P=16196,F=16197,I=16198,L=16199,R=16200,ee=16201,te=16202,z=16203,B=16204,ne=16205,re=16206,ie=16207,V=16208,H=16209,ae=16210,oe=16211,U=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function W(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=/* @__PURE__ */ new Uint16Array(320),this.work=/* @__PURE__ */ new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}let se=e=>{if(!e)return 1;let t=e.state;return+(!t||t.strm!==e||t.mode<v||t.mode>oe)},ce=e=>{if(se(e))return p;let t=e.state;return e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=t.wrap&1),t.mode=v,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=/* @__PURE__ */ new Int32Array(852),t.distcode=t.distdyn=/* @__PURE__ */ new Int32Array(592),t.sane=1,t.back=-1,u},G=e=>{if(se(e))return p;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,ce(e)},le=(e,t)=>{let n;if(se(e))return p;let r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?p:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,G(e))},K=(e,t)=>{if(!e)return p;let n=new W;e.state=n,n.strm=e,n.window=null,n.mode=v;let r=le(e,t);return r!==u&&(e.state=null),r},q=e=>K(e,15),J=!0,Y,ue,de=e=>{if(J){Y=/* @__PURE__ */ new Int32Array(512),ue=/* @__PURE__ */ new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(o(1,e.lens,0,288,Y,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;o(2,e.lens,0,32,ue,0,e.work,{bits:5}),J=!1}e.lencode=Y,e.lenbits=9,e.distcode=ue,e.distbits=5},fe=(e,t,n,r)=>{let i,a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),r>=a.wsize?(a.window.set(t.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),a.window.set(t.subarray(n-r,n-r+i),a.wnext),r-=i,r?(a.window.set(t.subarray(n-r,n),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},X=(e,t)=>{let n,W,ce,G,le,K,q,J,Y,ue,X,Z,pe,me,Q=0,$,he,ge,_e,ve,ye,be,xe,Se=/* @__PURE__ */ new Uint8Array(4),Ce,we,Te=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(se(e)||!e.output||!e.input&&e.avail_in!==0)return p;n=e.state,n.mode===k&&(n.mode=A),le=e.next_out,ce=e.output,q=e.avail_out,G=e.next_in,W=e.input,K=e.avail_in,J=n.hold,Y=n.bits,ue=K,X=q,xe=u;inf_leave:for(;;)switch(n.mode){case v:if(n.wrap===0){n.mode=A;break}for(;Y<16;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(n.wrap&2&&J===35615){n.wbits===0&&(n.wbits=15),n.check=0,Se[0]=J&255,Se[1]=J>>>8&255,n.check=i(n.check,Se,2,0),J=0,Y=0,n.mode=y;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((J&255)<<8)+(J>>8))%31){e.msg=`incorrect header check`,n.mode=H;break}if((J&15)!==_){e.msg=`unknown compression method`,n.mode=H;break}if(J>>>=4,Y-=4,be=(J&15)+8,n.wbits===0&&(n.wbits=be),be>15||be>n.wbits){e.msg=`invalid window size`,n.mode=H;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=J&512?D:k,J=0,Y=0;break;case y:for(;Y<16;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(n.flags=J,(n.flags&255)!==_){e.msg=`unknown compression method`,n.mode=H;break}if(n.flags&57344){e.msg=`unknown header flags set`,n.mode=H;break}n.head&&(n.head.text=J>>8&1),n.flags&512&&n.wrap&4&&(Se[0]=J&255,Se[1]=J>>>8&255,n.check=i(n.check,Se,2,0)),J=0,Y=0,n.mode=b;case b:for(;Y<32;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}n.head&&(n.head.time=J),n.flags&512&&n.wrap&4&&(Se[0]=J&255,Se[1]=J>>>8&255,Se[2]=J>>>16&255,Se[3]=J>>>24&255,n.check=i(n.check,Se,4,0)),J=0,Y=0,n.mode=x;case x:for(;Y<16;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}n.head&&(n.head.xflags=J&255,n.head.os=J>>8),n.flags&512&&n.wrap&4&&(Se[0]=J&255,Se[1]=J>>>8&255,n.check=i(n.check,Se,2,0)),J=0,Y=0,n.mode=S;case S:if(n.flags&1024){for(;Y<16;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}n.length=J,n.head&&(n.head.extra_len=J),n.flags&512&&n.wrap&4&&(Se[0]=J&255,Se[1]=J>>>8&255,n.check=i(n.check,Se,2,0)),J=0,Y=0}else n.head&&(n.head.extra=null);n.mode=C;case C:if(n.flags&1024&&(Z=n.length,Z>K&&(Z=K),Z&&(n.head&&(be=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(W.subarray(G,G+Z),be)),n.flags&512&&n.wrap&4&&(n.check=i(n.check,W,Z,G)),K-=Z,G+=Z,n.length-=Z),n.length))break inf_leave;n.length=0,n.mode=w;case w:if(n.flags&2048){if(K===0)break inf_leave;Z=0;do be=W[G+Z++],n.head&&be&&n.length<65536&&(n.head.name+=String.fromCharCode(be));while(be&&Z<K);if(n.flags&512&&n.wrap&4&&(n.check=i(n.check,W,Z,G)),K-=Z,G+=Z,be)break inf_leave}else n.head&&(n.head.name=null);n.length=0,n.mode=T;case T:if(n.flags&4096){if(K===0)break inf_leave;Z=0;do be=W[G+Z++],n.head&&be&&n.length<65536&&(n.head.comment+=String.fromCharCode(be));while(be&&Z<K);if(n.flags&512&&n.wrap&4&&(n.check=i(n.check,W,Z,G)),K-=Z,G+=Z,be)break inf_leave}else n.head&&(n.head.comment=null);n.mode=E;case E:if(n.flags&512){for(;Y<16;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(n.wrap&4&&J!==(n.check&65535)){e.msg=`header crc mismatch`,n.mode=H;break}J=0,Y=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=k;break;case D:for(;Y<32;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}e.adler=n.check=U(J),J=0,Y=0,n.mode=O;case O:if(n.havedict===0)return e.next_out=le,e.avail_out=q,e.next_in=G,e.avail_in=K,n.hold=J,n.bits=Y,f;e.adler=n.check=1,n.mode=k;case k:if(t===c||t===l)break inf_leave;case A:if(n.last){J>>>=Y&7,Y-=Y&7,n.mode=re;break}for(;Y<3;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}switch(n.last=J&1,J>>>=1,--Y,J&3){case 0:n.mode=j;break;case 1:if(de(n),n.mode=L,t===l){J>>>=2,Y-=2;break inf_leave}break;case 2:n.mode=P;break;case 3:e.msg=`invalid block type`,n.mode=H}J>>>=2,Y-=2;break;case j:for(J>>>=Y&7,Y-=Y&7;Y<32;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if((J&65535)!=(J>>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=H;break}if(n.length=J&65535,J=0,Y=0,n.mode=M,t===l)break inf_leave;case M:n.mode=N;case N:if(Z=n.length,Z){if(Z>K&&(Z=K),Z>q&&(Z=q),Z===0)break inf_leave;ce.set(W.subarray(G,G+Z),le),K-=Z,G+=Z,q-=Z,le+=Z,n.length-=Z;break}n.mode=k;break;case P:for(;Y<14;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(n.nlen=(J&31)+257,J>>>=5,Y-=5,n.ndist=(J&31)+1,J>>>=5,Y-=5,n.ncode=(J&15)+4,J>>>=4,Y-=4,n.nlen>286||n.ndist>30){e.msg=`too many length or distance symbols`,n.mode=H;break}n.have=0,n.mode=F;case F:for(;n.have<n.ncode;){for(;Y<3;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}n.lens[Te[n.have++]]=J&7,J>>>=3,Y-=3}for(;n.have<19;)n.lens[Te[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,Ce={bits:n.lenbits},xe=o(0,n.lens,0,19,n.lencode,0,n.work,Ce),n.lenbits=Ce.bits,xe){e.msg=`invalid code lengths set`,n.mode=H;break}n.have=0,n.mode=I;case I:for(;n.have<n.nlen+n.ndist;){for(;Q=n.lencode[J&(1<<n.lenbits)-1],$=Q>>>24,he=Q>>>16&255,ge=Q&65535,!($<=Y);){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(ge<16)J>>>=$,Y-=$,n.lens[n.have++]=ge;else{if(ge===16){for(we=$+2;Y<we;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(J>>>=$,Y-=$,n.have===0){e.msg=`invalid bit length repeat`,n.mode=H;break}be=n.lens[n.have-1],Z=3+(J&3),J>>>=2,Y-=2}else if(ge===17){for(we=$+3;Y<we;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}J>>>=$,Y-=$,be=0,Z=3+(J&7),J>>>=3,Y-=3}else{for(we=$+7;Y<we;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}J>>>=$,Y-=$,be=0,Z=11+(J&127),J>>>=7,Y-=7}if(n.have+Z>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=H;break}for(;Z--;)n.lens[n.have++]=be}}if(n.mode===H)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=H;break}if(n.lenbits=9,Ce={bits:n.lenbits},xe=o(1,n.lens,0,n.nlen,n.lencode,0,n.work,Ce),n.lenbits=Ce.bits,xe){e.msg=`invalid literal/lengths set`,n.mode=H;break}if(n.distbits=6,n.distcode=n.distdyn,Ce={bits:n.distbits},xe=o(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,Ce),n.distbits=Ce.bits,xe){e.msg=`invalid distances set`,n.mode=H;break}if(n.mode=L,t===l)break inf_leave;case L:n.mode=R;case R:if(K>=6&&q>=258){e.next_out=le,e.avail_out=q,e.next_in=G,e.avail_in=K,n.hold=J,n.bits=Y,a(e,X),le=e.next_out,ce=e.output,q=e.avail_out,G=e.next_in,W=e.input,K=e.avail_in,J=n.hold,Y=n.bits,n.mode===k&&(n.back=-1);break}for(n.back=0;Q=n.lencode[J&(1<<n.lenbits)-1],$=Q>>>24,he=Q>>>16&255,ge=Q&65535,!($<=Y);){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(he&&!(he&240)){for(_e=$,ve=he,ye=ge;Q=n.lencode[ye+((J&(1<<_e+ve)-1)>>_e)],$=Q>>>24,he=Q>>>16&255,ge=Q&65535,!(_e+$<=Y);){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}J>>>=_e,Y-=_e,n.back+=_e}if(J>>>=$,Y-=$,n.back+=$,n.length=ge,he===0){n.mode=ne;break}if(he&32){n.back=-1,n.mode=k;break}if(he&64){e.msg=`invalid literal/length code`,n.mode=H;break}n.extra=he&15,n.mode=ee;case ee:if(n.extra){for(we=n.extra;Y<we;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}n.length+=J&(1<<n.extra)-1,J>>>=n.extra,Y-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=te;case te:for(;Q=n.distcode[J&(1<<n.distbits)-1],$=Q>>>24,he=Q>>>16&255,ge=Q&65535,!($<=Y);){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(!(he&240)){for(_e=$,ve=he,ye=ge;Q=n.distcode[ye+((J&(1<<_e+ve)-1)>>_e)],$=Q>>>24,he=Q>>>16&255,ge=Q&65535,!(_e+$<=Y);){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}J>>>=_e,Y-=_e,n.back+=_e}if(J>>>=$,Y-=$,n.back+=$,he&64){e.msg=`invalid distance code`,n.mode=H;break}n.offset=ge,n.extra=he&15,n.mode=z;case z:if(n.extra){for(we=n.extra;Y<we;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}n.offset+=J&(1<<n.extra)-1,J>>>=n.extra,Y-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=H;break}n.mode=B;case B:if(q===0)break inf_leave;if(Z=X-q,n.offset>Z){if(Z=n.offset-Z,Z>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=H;break}Z>n.wnext?(Z-=n.wnext,pe=n.wsize-Z):pe=n.wnext-Z,Z>n.length&&(Z=n.length),me=n.window}else me=ce,pe=le-n.offset,Z=n.length;Z>q&&(Z=q),q-=Z,n.length-=Z;do ce[le++]=me[pe++];while(--Z);n.length===0&&(n.mode=R);break;case ne:if(q===0)break inf_leave;ce[le++]=n.length,q--,n.mode=R;break;case re:if(n.wrap){for(;Y<32;){if(K===0)break inf_leave;K--,J|=W[G++]<<Y,Y+=8}if(X-=q,e.total_out+=X,n.total+=X,n.wrap&4&&X&&(e.adler=n.check=n.flags?i(n.check,ce,X,le-X):r(n.check,ce,X,le-X)),X=q,n.wrap&4&&(n.flags?J:U(J))!==n.check){e.msg=`incorrect data check`,n.mode=H;break}J=0,Y=0}n.mode=ie;case ie:if(n.wrap&&n.flags){for(;Y<32;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(n.wrap&4&&J!==(n.total|0)){e.msg=`incorrect length check`,n.mode=H;break}J=0,Y=0}n.mode=V;case V:xe=d;break inf_leave;case H:xe=m;break inf_leave;case ae:return h;case oe:default:return p}return e.next_out=le,e.avail_out=q,e.next_in=G,e.avail_in=K,n.hold=J,n.bits=Y,(n.wsize||X!==e.avail_out&&n.mode<H&&(n.mode<re||t!==s))&&fe(e,e.output,e.next_out,X-e.avail_out)?(n.mode=ae,h):(ue-=e.avail_in,X-=e.avail_out,e.total_in+=ue,e.total_out+=X,n.total+=X,n.wrap&4&&X&&(e.adler=n.check=n.flags?i(n.check,ce,X,e.next_out-X):r(n.check,ce,X,e.next_out-X)),e.data_type=n.bits+(n.last?64:0)+(n.mode===k?128:0)+(n.mode===L||n.mode===M?256:0),(ue===0&&X===0||t===s)&&xe===u&&(xe=g),xe)},Z=e=>{if(se(e))return p;let t=e.state;return t.window&&=null,e.state=null,u},pe=(e,t)=>{if(se(e))return p;let n=e.state;return n.wrap&2?(n.head=t,t.done=!1,u):p},me=(e,t)=>{let n=t.length,i,a,o;return se(e)||(i=e.state,i.wrap!==0&&i.mode!==O)?p:i.mode===O&&(a=1,a=r(a,t,n,0),a!==i.check)?m:(o=fe(e,t,n,n),o?(i.mode=ae,h):(i.havedict=1,u))};t.exports.inflateReset=G,t.exports.inflateReset2=le,t.exports.inflateResetKeep=ce,t.exports.inflateInit=q,t.exports.inflateInit2=K,t.exports.inflate=X,t.exports.inflateEnd=Z,t.exports.inflateGetHeader=pe,t.exports.inflateSetDictionary=me,t.exports.inflateInfo=`pako inflate (from Nodeca project)`},{"./adler32":41,"./constants":42,"./crc32":43,"./inffast":46,"./inftrees":48}],48:[function(e,t,n){let r=new Uint16Array([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,0,0]),i=new Uint8Array([16,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]),a=new Uint16Array([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,0,0]),o=new Uint8Array([16,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]);t.exports=(e,t,n,s,c,l,u,d)=>{let f=d.bits,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C,w,T,E,D,O=null,k,A=/* @__PURE__ */ new Uint16Array(16),j=/* @__PURE__ */ new Uint16Array(16),M=null,N,P,F;for(p=0;p<=15;p++)A[p]=0;for(m=0;m<s;m++)A[t[n+m]]++;for(_=f,g=15;g>=1&&A[g]===0;g--);if(_>g&&(_=g),g===0)return c[l++]=20971520,c[l++]=20971520,d.bits=1,0;for(h=1;h<g&&A[h]===0;h++);for(_<h&&(_=h),b=1,p=1;p<=15;p++)if(b<<=1,b-=A[p],b<0)return-1;if(b>0&&(e===0||g!==1))return-1;for(j[1]=0,p=1;p<15;p++)j[p+1]=j[p]+A[p];for(m=0;m<s;m++)t[n+m]!==0&&(u[j[t[n+m]]++]=m);if(e===0?(O=M=u,k=20):e===1?(O=r,M=i,k=257):(O=a,M=o,k=0),S=0,m=0,p=h,D=l,v=_,y=0,T=-1,x=1<<_,E=x-1,e===1&&x>852||e===2&&x>592)return 1;for(;;){N=p-y,u[m]+1<k?(P=0,F=u[m]):u[m]>=k?(P=M[u[m]-k],F=O[u[m]-k]):(P=96,F=0),C=1<<p-y,w=1<<v,h=w;do w-=C,c[D+(S>>y)+w]=N<<24|P<<16|F;while(w!==0);for(C=1<<p-1;S&C;)C>>=1;if(C===0?S=0:(S&=C-1,S+=C),m++,--A[p]===0){if(p===g)break;p=t[n+u[m]]}if(p>_&&(S&E)!==T){for(y===0&&(y=_),D+=h,v=p-y,b=1<<v;v+y<g&&(b-=A[v+y],!(b<=0));)v++,b<<=1;if(x+=1<<v,e===1&&x>852||e===2&&x>592)return 1;T=S&E,c[T]=_<<24|v<<16|D-l}}return S!==0&&(c[D+S]=p-y<<24|4194304),d.bits=_,0}},{}],49:[function(e,t,n){t.exports={2:`need dictionary`,1:`stream end`,0:``,"-1":`file error`,"-2":`stream error`,"-3":`data error`,"-4":`insufficient memory`,"-5":`buffer error`,"-6":`incompatible version`}},{}],50:[function(e,t,n){function r(e){let t=e.length;for(;--t>=0;)e[t]=0}let i=new Uint8Array([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]),a=new Uint8Array([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]),o=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),s=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),c=Array(576);r(c);let l=Array(60);r(l);let u=Array(512);r(u);let d=Array(256);r(d);let f=Array(29);r(f);let p=Array(30);r(p);function m(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let h,g,_;function v(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}let y=e=>e<256?u[e]:u[256+(e>>>7)],b=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},x=(e,t,n)=>{e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,b(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},S=(e,t,n)=>{x(e,n[t*2],n[t*2+1])},C=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},w=e=>{e.bi_valid===16?(b(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},T=(e,t)=>{let n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,l,u,d,f,p,m,h=0;for(f=0;f<=15;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<573;l++)u=e.heap[l],f=n[n[u*2+1]*2+1]+1,f>c&&(f=c,h++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,p=0,u>=s&&(p=o[u-s]),m=n[u*2],e.opt_len+=m*(f+p),a&&(e.static_len+=m*(i[u*2+1]+p)));if(h!==0){do{for(f=c-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,h-=2}while(h>0);for(f=c;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--l],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}},E=(e,t,n)=>{let r=Array(16),i=0,a,o;for(a=1;a<=15;a++)i=i+n[a-1]<<1,r[a]=i;for(o=0;o<=t;o++){let t=e[o*2+1];t!==0&&(e[o*2]=C(r[t]++,t))}},D=()=>{let e,t,n,r,s,v=Array(16);for(n=0,r=0;r<28;r++)for(f[r]=n,e=0;e<1<<i[r];e++)d[n++]=r;for(d[n-1]=r,s=0,r=0;r<16;r++)for(p[r]=s,e=0;e<1<<a[r];e++)u[s++]=r;for(s>>=7;r<30;r++)for(p[r]=s<<7,e=0;e<1<<a[r]-7;e++)u[256+s++]=r;for(t=0;t<=15;t++)v[t]=0;for(e=0;e<=143;)c[e*2+1]=8,e++,v[8]++;for(;e<=255;)c[e*2+1]=9,e++,v[9]++;for(;e<=279;)c[e*2+1]=7,e++,v[7]++;for(;e<=287;)c[e*2+1]=8,e++,v[8]++;for(E(c,287,v),e=0;e<30;e++)l[e*2+1]=5,l[e*2]=C(e,5);h=new m(c,i,257,286,15),g=new m(l,a,0,30,15),_=new m([],o,0,19,7)},O=e=>{let t=0;for(;t<286;t++)e.dyn_ltree[t*2]=0;for(t=0;t<30;t++)e.dyn_dtree[t*2]=0;for(t=0;t<19;t++)e.bl_tree[t*2]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},k=e=>{e.bi_valid>8?b(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},A=(e,t,n,r)=>{let i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]},j=(e,t,n)=>{let r=e.heap[n],i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&A(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!A(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},M=(e,t,n)=>{let r,o,s=0,c,l;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+s++]&255,r+=(e.pending_buf[e.sym_buf+s++]&255)<<8,o=e.pending_buf[e.sym_buf+s++],r===0?S(e,o,t):(c=d[o],S(e,c+256+1,t),l=i[c],l!==0&&(o-=f[c],x(e,o,l)),r--,c=y(r),S(e,c,n),l=a[c],l!==0&&(r-=p[c],x(e,r,l)));while(s<e.sym_next);S(e,256,t)},N=(e,t)=>{let n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,c=-1,l;for(e.heap_len=0,e.heap_max=573,o=0;o<a;o++)n[o*2]===0?n[o*2+1]=0:(e.heap[++e.heap_len]=c=o,e.depth[o]=0);for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)j(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],j(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,j(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],T(e,t),E(n,c,e.bl_count)},P=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a===0?s<=10?e.bl_tree[34]++:e.bl_tree[36]++:(a!==i&&e.bl_tree[a*2]++,e.bl_tree[32]++),s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))},F=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do S(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(S(e,17,e.bl_tree),x(e,s-3,3)):(S(e,18,e.bl_tree),x(e,s-11,7)):(a!==i&&(S(e,a,e.bl_tree),s--),S(e,16,e.bl_tree),x(e,s-3,2));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}},I=e=>{let t;for(P(e,e.dyn_ltree,e.l_desc.max_code),P(e,e.dyn_dtree,e.d_desc.max_code),N(e,e.bl_desc),t=18;t>=3&&e.bl_tree[s[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},L=(e,t,n,r)=>{let i;for(x(e,t-257,5),x(e,n-1,5),x(e,r-4,4),i=0;i<r;i++)x(e,e.bl_tree[s[i]*2+1],3);F(e,e.dyn_ltree,t-1),F(e,e.dyn_dtree,n-1)},R=e=>{let t=4093624447,n=0;for(;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return 0;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return 1;for(n=32;n<256;n++)if(e.dyn_ltree[n*2]!==0)return 1;return 0},ee=!1,te=e=>{ee||=(D(),!0),e.l_desc=new v(e.dyn_ltree,h),e.d_desc=new v(e.dyn_dtree,g),e.bl_desc=new v(e.bl_tree,_),e.bi_buf=0,e.bi_valid=0,O(e)},z=(e,t,n,r)=>{x(e,0+ +!!r,3),k(e),b(e,n),b(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},B=e=>{x(e,2,3),S(e,256,c),w(e)},ne=(e,t,n,r)=>{let i,a,o=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=R(e)),N(e,e.l_desc),N(e,e.d_desc),o=I(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?z(e,t,n,r):e.strategy===4||a===i?(x(e,2+ +!!r,3),M(e,c,l)):(x(e,4+ +!!r,3),L(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),M(e,e.dyn_ltree,e.dyn_dtree)),O(e),r&&k(e)},re=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(d[n]+256+1)*2]++,e.dyn_dtree[y(t)*2]++),e.sym_next===e.sym_end);t.exports._tr_init=te,t.exports._tr_stored_block=z,t.exports._tr_flush_block=ne,t.exports._tr_tally=re,t.exports._tr_align=B},{}],51:[function(e,t,n){function r(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}t.exports=r},{}],52:[function(e,t,n){var r=t.exports={},i,a;function o(){throw Error(`setTimeout has not been defined`)}function s(){throw Error(`clearTimeout has not been defined`)}(function(){try{i=typeof setTimeout==`function`?setTimeout:o}catch{i=o}try{a=typeof clearTimeout==`function`?clearTimeout:s}catch{a=s}})();function c(e){if(i===setTimeout)return setTimeout(e,0);if((i===o||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch{try{return i.call(null,e,0)}catch{return i.call(this,e,0)}}}function l(e){if(a===clearTimeout)return clearTimeout(e);if((a===s||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(e);try{return a(e)}catch{try{return a.call(null,e)}catch{return a.call(this,e)}}}var u=[],d=!1,f,p=-1;function m(){d&&f&&(d=!1,f.length?u=f.concat(u):p=-1,u.length&&h())}function h(){if(!d){var e=c(m);d=!0;for(var t=u.length;t;){for(f=u,u=[];++p<t;)f&&f[p].run();p=-1,t=u.length}f=null,d=!1,l(e)}}r.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new g(e,t)),u.length===1&&!d&&c(h)};function g(e,t){this.fun=e,this.array=t}g.prototype.run=function(){this.fun.apply(null,this.array)},r.title=`browser`,r.browser=!0,r.env={},r.argv=[],r.version=``,r.versions={};function _(){}r.on=_,r.addListener=_,r.once=_,r.off=_,r.removeListener=_,r.removeAllListeners=_,r.emit=_,r.prependListener=_,r.prependOnceListener=_,r.listeners=function(e){return[]},r.binding=function(e){throw Error(`process.binding is not supported`)},r.cwd=function(){return`/`},r.chdir=function(e){throw Error(`process.chdir is not supported`)},r.umask=function(){return 0}},{}],53:[function(e,t,n){t.exports=function(e){return e&&typeof e==`object`&&typeof e.copy==`function`&&typeof e.fill==`function`&&typeof e.readUInt8==`function`}},{}],54:[function(e,t,n){var r=e("is-arguments"),i=e("is-generator-function"),a=e("which-typed-array"),o=e("is-typed-array");function s(e){return e.call.bind(e)}var c=typeof BigInt<`u`,l=typeof Symbol<`u`,u=s(Object.prototype.toString),d=s(Number.prototype.valueOf),f=s(String.prototype.valueOf),p=s(Boolean.prototype.valueOf);if(c)var m=s(BigInt.prototype.valueOf);if(l)var h=s(Symbol.prototype.valueOf);function g(e,t){if(typeof e!=`object`)return!1;try{return t(e),!0}catch{return!1}}n.isArgumentsObject=r,n.isGeneratorFunction=i,n.isTypedArray=o;function _(e){return typeof Promise<`u`&&e instanceof Promise||typeof e==`object`&&!!e&&typeof e.then==`function`&&typeof e.catch==`function`}n.isPromise=_;function v(e){return typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):o(e)||z(e)}n.isArrayBufferView=v;function y(e){return a(e)===`Uint8Array`}n.isUint8Array=y;function b(e){return a(e)===`Uint8ClampedArray`}n.isUint8ClampedArray=b;function x(e){return a(e)===`Uint16Array`}n.isUint16Array=x;function S(e){return a(e)===`Uint32Array`}n.isUint32Array=S;function C(e){return a(e)===`Int8Array`}n.isInt8Array=C;function w(e){return a(e)===`Int16Array`}n.isInt16Array=w;function T(e){return a(e)===`Int32Array`}n.isInt32Array=T;function E(e){return a(e)===`Float32Array`}n.isFloat32Array=E;function D(e){return a(e)===`Float64Array`}n.isFloat64Array=D;function O(e){return a(e)===`BigInt64Array`}n.isBigInt64Array=O;function k(e){return a(e)===`BigUint64Array`}n.isBigUint64Array=k;function A(e){return u(e)===`[object Map]`}A.working=typeof Map<`u`&&A(/* @__PURE__ */ new Map);function j(e){return typeof Map>`u`?!1:A.working?A(e):e instanceof Map}n.isMap=j;function M(e){return u(e)===`[object Set]`}M.working=typeof Set<`u`&&M(/* @__PURE__ */ new Set);function N(e){return typeof Set>`u`?!1:M.working?M(e):e instanceof Set}n.isSet=N;function P(e){return u(e)===`[object WeakMap]`}P.working=typeof WeakMap<`u`&&P(/* @__PURE__ */ new WeakMap);function F(e){return typeof WeakMap>`u`?!1:P.working?P(e):e instanceof WeakMap}n.isWeakMap=F;function I(e){return u(e)===`[object WeakSet]`}I.working=typeof WeakSet<`u`&&I(/* @__PURE__ */ new WeakSet);function L(e){return I(e)}n.isWeakSet=L;function R(e){return u(e)===`[object ArrayBuffer]`}R.working=typeof ArrayBuffer<`u`&&R(/* @__PURE__ */ new ArrayBuffer);function ee(e){return typeof ArrayBuffer>`u`?!1:R.working?R(e):e instanceof ArrayBuffer}n.isArrayBuffer=ee;function te(e){return u(e)===`[object DataView]`}te.working=typeof ArrayBuffer<`u`&&typeof DataView<`u`&&te(new DataView(/* @__PURE__ */ new ArrayBuffer(1),0,1));function z(e){return typeof DataView>`u`?!1:te.working?te(e):e instanceof DataView}n.isDataView=z;function B(e){return u(e)===`[object SharedArrayBuffer]`}B.working=typeof SharedArrayBuffer<`u`&&B(new SharedArrayBuffer);function ne(e){return typeof SharedArrayBuffer>`u`?!1:B.working?B(e):e instanceof SharedArrayBuffer}n.isSharedArrayBuffer=ne;function re(e){return u(e)===`[object AsyncFunction]`}n.isAsyncFunction=re;function ie(e){return u(e)===`[object Map Iterator]`}n.isMapIterator=ie;function V(e){return u(e)===`[object Set Iterator]`}n.isSetIterator=V;function H(e){return u(e)===`[object Generator]`}n.isGeneratorObject=H;function ae(e){return u(e)===`[object WebAssembly.Module]`}n.isWebAssemblyCompiledModule=ae;function oe(e){return g(e,d)}n.isNumberObject=oe;function U(e){return g(e,f)}n.isStringObject=U;function W(e){return g(e,p)}n.isBooleanObject=W;function se(e){return c&&g(e,m)}n.isBigIntObject=se;function ce(e){return l&&g(e,h)}n.isSymbolObject=ce;function G(e){return oe(e)||U(e)||W(e)||se(e)||ce(e)}n.isBoxedPrimitive=G;function le(e){return typeof Uint8Array<`u`&&(ee(e)||ne(e))}n.isAnyArrayBuffer=le,[`isProxy`,`isExternal`,`isModuleNamespaceObject`].forEach(function(e){Object.defineProperty(n,e,{enumerable:!1,value:function(){throw Error(e+` is not supported in userland`)}})})},{"is-arguments":33,"is-generator-function":34,"is-typed-array":35,"which-typed-array":56}],55:[function(e,t,n){(function(t){(function(){var r=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},i=/%[sdj%]/g;n.format=function(e){if(!C(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(c(arguments[n]));return t.join(` `)}for(var n=1,r=arguments,a=r.length,o=String(e).replace(i,function(e){if(e===`%%`)return`%`;if(n>=a)return e;switch(e){case`%s`:return String(r[n++]);case`%d`:return Number(r[n++]);case`%j`:try{return JSON.stringify(r[n++])}catch{return`[Circular]`}default:return e}}),s=r[n];n<a;s=r[++n])b(s)||!D(s)?o+=` `+s:o+=` `+c(s);return o},n.deprecate=function(e,r){if(t!==void 0&&t.noDeprecation===!0)return e;if(t===void 0)return function(){return n.deprecate(e,r).apply(this,arguments)};var i=!1;function a(){if(!i){if(t.throwDeprecation)throw Error(r);t.traceDeprecation?console.trace(r):console.error(r),i=!0}return e.apply(this,arguments)}return a};var a={},o=/^$/;if(t.env.NODE_DEBUG){var s=t.env.NODE_DEBUG;s=s.replace(/[|\\{}()[\]^$+?.]/g,`\\$&`).replace(/\*/g,`.*`).replace(/,/g,`$|^`).toUpperCase(),o=RegExp(`^`+s+`$`,`i`)}n.debuglog=function(e){if(e=e.toUpperCase(),!a[e]){if(o.test(e)){var r=t.pid;a[e]=function(){var t=n.format.apply(n,arguments);console.error(`%s %d: %s`,e,r,t)}}else a[e]=function(){}}return a[e]};function c(e,t){var r={seen:[],stylize:u};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),y(t)?r.showHidden=t:t&&n._extend(r,t),T(r.showHidden)&&(r.showHidden=!1),T(r.depth)&&(r.depth=2),T(r.colors)&&(r.colors=!1),T(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=l),f(r,e,r.depth)}n.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:`cyan`,number:`yellow`,boolean:`yellow`,undefined:`grey`,null:`bold`,string:`green`,date:`magenta`,regexp:`red`};function l(e,t){var n=c.styles[t];return n?`\x1B[`+c.colors[n][0]+`m`+e+`\x1B[`+c.colors[n][1]+`m`:e}function u(e,t){return e}function d(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function f(e,t,r){if(e.customInspect&&t&&A(t.inspect)&&t.inspect!==n.inspect&&!(t.constructor&&t.constructor.prototype===t)){var i=t.inspect(r,e);return C(i)||(i=f(e,i,r)),i}var a=p(e,t);if(a)return a;var o=Object.keys(t),s=d(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),k(t)&&(o.indexOf(`message`)>=0||o.indexOf(`description`)>=0))return m(t);if(o.length===0){if(A(t)){var c=t.name?`: `+t.name:``;return e.stylize(`[Function`+c+`]`,`special`)}if(E(t))return e.stylize(RegExp.prototype.toString.call(t),`regexp`);if(O(t))return e.stylize(Date.prototype.toString.call(t),`date`);if(k(t))return m(t)}var l=``,u=!1,y=[`{`,`}`];if(v(t)&&(u=!0,y=[`[`,`]`]),A(t)&&(l=` [Function`+(t.name?`: `+t.name:``)+`]`),E(t)&&(l=` `+RegExp.prototype.toString.call(t)),O(t)&&(l=` `+Date.prototype.toUTCString.call(t)),k(t)&&(l=` `+m(t)),o.length===0&&(!u||t.length==0))return y[0]+l+y[1];if(r<0)return E(t)?e.stylize(RegExp.prototype.toString.call(t),`regexp`):e.stylize(`[Object]`,`special`);e.seen.push(t);var b=u?h(e,t,r,s,o):o.map(function(n){return g(e,t,r,s,n,u)});return e.seen.pop(),_(b,l,y)}function p(e,t){if(T(t))return e.stylize(`undefined`,`undefined`);if(C(t)){var n=`'`+JSON.stringify(t).replace(/^"|"$/g,``).replace(/'/g,`\\'`).replace(/\\"/g,`"`)+`'`;return e.stylize(n,`string`)}if(S(t))return e.stylize(``+t,`number`);if(y(t))return e.stylize(``+t,`boolean`);if(b(t))return e.stylize(`null`,`null`)}function m(e){return`[`+Error.prototype.toString.call(e)+`]`}function h(e,t,n,r,i){for(var a=[],o=0,s=t.length;o<s;++o)I(t,String(o))?a.push(g(e,t,n,r,String(o),!0)):a.push(``);return i.forEach(function(i){i.match(/^\d+$/)||a.push(g(e,t,n,r,i,!0))}),a}function g(e,t,n,r,i,a){var o,s,c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]};if(c.get?s=c.set?e.stylize(`[Getter/Setter]`,`special`):e.stylize(`[Getter]`,`special`):c.set&&(s=e.stylize(`[Setter]`,`special`)),I(r,i)||(o=`[`+i+`]`),s||(e.seen.indexOf(c.value)<0?(s=b(n)?f(e,c.value,null):f(e,c.value,n-1),s.indexOf(`
|
|
21
|
+
`)>-1&&(s=a?s.split(`
|
|
22
|
+
`).map(function(e){return` `+e}).join(`
|
|
23
|
+
`).substr(2):`
|
|
24
|
+
`+s.split(`
|
|
25
|
+
`).map(function(e){return` `+e}).join(`
|
|
26
|
+
`))):s=e.stylize(`[Circular]`,`special`)),T(o)){if(a&&i.match(/^\d+$/))return s;o=JSON.stringify(``+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,`name`)):(o=o.replace(/'/g,`\\'`).replace(/\\"/g,`"`).replace(/(^"|"$)/g,`'`),o=e.stylize(o,`string`))}return o+`: `+s}function _(e,t,n){var r=0;return e.reduce(function(e,t){return r++,t.indexOf(`
|
|
27
|
+
`)>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,``).length+1},0)>60?n[0]+(t===``?``:t+`
|
|
28
|
+
`)+` `+e.join(`,
|
|
29
|
+
`)+` `+n[1]:n[0]+t+` `+e.join(`, `)+` `+n[1]}n.types=e("./support/types");function v(e){return Array.isArray(e)}n.isArray=v;function y(e){return typeof e==`boolean`}n.isBoolean=y;function b(e){return e===null}n.isNull=b;function x(e){return e==null}n.isNullOrUndefined=x;function S(e){return typeof e==`number`}n.isNumber=S;function C(e){return typeof e==`string`}n.isString=C;function w(e){return typeof e==`symbol`}n.isSymbol=w;function T(e){return e===void 0}n.isUndefined=T;function E(e){return D(e)&&M(e)===`[object RegExp]`}n.isRegExp=E,n.types.isRegExp=E;function D(e){return typeof e==`object`&&!!e}n.isObject=D;function O(e){return D(e)&&M(e)===`[object Date]`}n.isDate=O,n.types.isDate=O;function k(e){return D(e)&&(M(e)===`[object Error]`||e instanceof Error)}n.isError=k,n.types.isNativeError=k;function A(e){return typeof e==`function`}n.isFunction=A;function j(e){return e===null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`||typeof e==`symbol`||e===void 0}n.isPrimitive=j,n.isBuffer=e("./support/isBuffer");function M(e){return Object.prototype.toString.call(e)}function N(e){return e<10?`0`+e.toString(10):e.toString(10)}var P=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function F(){var e=/* @__PURE__ */ new Date,t=[N(e.getHours()),N(e.getMinutes()),N(e.getSeconds())].join(`:`);return[e.getDate(),P[e.getMonth()],t].join(` `)}n.log=function(){console.log(`%s - %s`,F(),n.format.apply(n,arguments))},n.inherits=e("inherits"),n._extend=function(e,t){if(!t||!D(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var L=typeof Symbol<`u`?Symbol(`util.promisify.custom`):void 0;n.promisify=function(e){if(typeof e!=`function`)throw TypeError(`The "original" argument must be of type Function`);if(L&&e[L]){var t=e[L];if(typeof t!=`function`)throw TypeError(`The "util.promisify.custom" argument must be of type Function`);return Object.defineProperty(t,L,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise(function(e,r){t=e,n=r}),i=[],a=0;a<arguments.length;a++)i.push(arguments[a]);i.push(function(e,r){e?n(e):t(r)});try{e.apply(this,i)}catch(e){n(e)}return r}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),L&&Object.defineProperty(t,L,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,r(e))},n.promisify.custom=L;function R(e,t){if(!e){var n=/* @__PURE__ */ Error(`Promise was rejected with a falsy value`);n.reason=e,e=n}return t(e)}function ee(e){if(typeof e!=`function`)throw TypeError(`The "original" argument must be of type Function`);function n(){for(var n=[],r=0;r<arguments.length;r++)n.push(arguments[r]);var i=n.pop();if(typeof i!=`function`)throw TypeError(`The last argument must be of type Function`);var a=this,o=function(){return i.apply(a,arguments)};e.apply(this,n).then(function(e){t.nextTick(o.bind(null,null,e))},function(e){t.nextTick(R.bind(null,e,o))})}return Object.setPrototypeOf(n,Object.getPrototypeOf(e)),Object.defineProperties(n,r(e)),n}n.callbackify=ee}).call(this)}).call(this,e("_process"))},{"./support/isBuffer":53,"./support/types":54,_process:52,inherits:32}],56:[function(e,t,n){(function(n){(function(){var r=e("foreach"),i=e("available-typed-arrays"),a=e("call-bind/callBound"),o=a(`Object.prototype.toString`),s=e("has-symbols")()&&typeof Symbol.toStringTag==`symbol`,c=i(),l=a(`String.prototype.slice`),u={},d=e("es-abstract/helpers/getOwnPropertyDescriptor"),f=Object.getPrototypeOf;s&&d&&f&&r(c,function(e){if(typeof n[e]==`function`){var t=new n[e];if(!(Symbol.toStringTag in t))throw EvalError(`this engine has support for Symbol.toStringTag, but `+e+` does not have the property! Please report this.`);var r=f(t),i=d(r,Symbol.toStringTag);i||=d(f(r),Symbol.toStringTag),u[e]=i.get}});var p=function(e){var t=!1;return r(u,function(n,r){if(!t)try{var i=n.call(e);i===r&&(t=i)}catch{}}),t},m=e("is-typed-array");t.exports=function(e){return m(e)?s?p(e):l(o(e),8,-1):!1}}).call(this)}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{"available-typed-arrays":18,"call-bind/callBound":21,"es-abstract/helpers/getOwnPropertyDescriptor":23,foreach:24,"has-symbols":28,"is-typed-array":35}]},{},[10])(10)})}));export default n();
|