chalkbridge 1.0.0
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 +27 -0
- package/README.md +66 -0
- package/THIRD-PARTY-NOTICES.md +438 -0
- package/dist/ar-SA-G6X2FPQ2-IHRIDPR4.js +20 -0
- package/dist/az-AZ-76LH7QW2-FWR3DD2C.js +20 -0
- package/dist/bg-BG-XCXSNQG7-IJ7WAACU.js +20 -0
- package/dist/bn-BD-2XOGV67Q-QYVETSYP.js +20 -0
- package/dist/ca-ES-6MX7JW3Y-SOBVUEZY.js +20 -0
- package/dist/canvas-roundrect-polyfill-H6Z5O4YN.js +20 -0
- package/dist/chunk-7D4SUZUM.js +35 -0
- package/dist/chunk-EAE6IZ6E.js +17692 -0
- package/dist/chunk-HFKCLTVU.js +1494 -0
- package/dist/chunk-OSMXI5VA.js +1638 -0
- package/dist/chunk-QGOK75XS.js +31 -0
- package/dist/cli.js +6159 -0
- package/dist/cs-CZ-2BRQDIVT-WY37XCXG.js +20 -0
- package/dist/da-DK-5WZEPLOC-OEXDYHXX.js +20 -0
- package/dist/de-DE-XR44H4JA-CHYMDV52.js +20 -0
- package/dist/directory-open-01563666-QRZ2F5WT.js +18 -0
- package/dist/directory-open-4ed118d0-YYFT6KAI.js +59 -0
- package/dist/el-GR-BZB4AONW-PFUEAYDI.js +20 -0
- package/dist/en-B4ZKOASM-RQVXIIF2.js +20 -0
- package/dist/es-ES-U4NZUMDT-U4COLEPD.js +20 -0
- package/dist/eu-ES-A7QVB2H4-2A3YPN4B.js +20 -0
- package/dist/fa-IR-HGAKTJCU-K3A3VMB3.js +20 -0
- package/dist/fi-FI-Z5N7JZ37-OAX5327W.js +20 -0
- package/dist/file-open-002ab408-3W4GHKWC.js +22 -0
- package/dist/file-open-7c801643-GAYNVN2D.js +19 -0
- package/dist/file-save-3189631c-N4WBRA7X.js +27 -0
- package/dist/file-save-745eba88-76KHW454.js +29 -0
- package/dist/fr-FR-RHASNOE6-VN34DFEI.js +20 -0
- package/dist/gl-ES-HMX3MZ6V-ZKLDSE57.js +20 -0
- package/dist/he-IL-6SHJWFNN-DVWDKP5N.js +20 -0
- package/dist/hi-IN-IWLTKZ5I-MXIXSFZQ.js +20 -0
- package/dist/hu-HU-A5ZG7DT2-UUR52ECU.js +20 -0
- package/dist/id-ID-SAP4L64H-DHYFFGCD.js +20 -0
- package/dist/image-GAAHSSAO-CFWZUGEZ.js +5 -0
- package/dist/image-blob-reduce-ZKP25K2R.js +20 -0
- package/dist/index.js +4 -0
- package/dist/it-IT-JPQ66NNP-FHS6FPFA.js +20 -0
- package/dist/ja-JP-DBVTYXUO-AMIMDPTA.js +20 -0
- package/dist/kaa-6HZHGXH3-BH4ZWU4H.js +20 -0
- package/dist/kab-KAB-ZGHBKWFO-HM6Q2QFU.js +20 -0
- package/dist/kk-KZ-P5N5QNE5-ZMSMI2MP.js +20 -0
- package/dist/km-KH-HSX4SM5Z-7WSA4RPS.js +20 -0
- package/dist/ko-KR-MTYHY66A-7D3G6L2U.js +20 -0
- package/dist/ku-TR-6OUDTVRD-OEGBBNNA.js +20 -0
- package/dist/lt-LT-XHIRWOB4-2IXXZF7J.js +20 -0
- package/dist/lv-LV-5QDEKY6T-54IAHK7L.js +20 -0
- package/dist/mermaid-to-excalidraw-F5UABDGX.js +20 -0
- package/dist/mr-IN-CRQNXWMA-Z54WQJ7P.js +20 -0
- package/dist/my-MM-5M5IBNSE-7NVT6WZR.js +20 -0
- package/dist/nb-NO-T6EIAALU-Y47L7MXQ.js +20 -0
- package/dist/nl-NL-IS3SIHDZ-SVJTPE6M.js +20 -0
- package/dist/nn-NO-6E72VCQL-IATBYLUX.js +20 -0
- package/dist/oc-FR-POXYY2M6-T6O6NZ6A.js +20 -0
- package/dist/pa-IN-N4M65BXN-CQTFKR27.js +20 -0
- package/dist/percentages-BXMCSKIN-F5SZRLIW.js +20 -0
- package/dist/pica-OHNN3T33.js +20 -0
- package/dist/pl-PL-T2D74RX3-H62G547Q.js +20 -0
- package/dist/prod-KHI2WQT3.js +43228 -0
- package/dist/pt-BR-5N22H2LF-IOFFSIBR.js +20 -0
- package/dist/pt-PT-UZXXM6DQ-Z3JYHPJA.js +20 -0
- package/dist/ro-RO-JPDTUUEW-TNJOBCBY.js +20 -0
- package/dist/ru-RU-B4JR7IUQ-LQHFF6I5.js +20 -0
- package/dist/si-LK-N5RQ5JYF-7AJ6QJ6S.js +20 -0
- package/dist/sk-SK-C5VTKIMK-UOMPMDMS.js +20 -0
- package/dist/sl-SI-NN7IZMDC-GCLRUNU3.js +20 -0
- package/dist/subset-shared.chunk-RYC3QF4F.js +5 -0
- package/dist/subset-worker.chunk-TIUZJQSN.js +18 -0
- package/dist/sv-SE-XGPEYMSR-3B5GU363.js +20 -0
- package/dist/ta-IN-2NMHFXQM-53HPRXR6.js +20 -0
- package/dist/th-TH-HPSO5L25-QHD7HILB.js +20 -0
- package/dist/tr-TR-DEFEU3FU-Q22C3NWC.js +20 -0
- package/dist/uk-UA-QMV73CPH-LREVZK2B.js +20 -0
- package/dist/vi-VN-M7AON7JQ-2CB5FIZH.js +20 -0
- package/dist/zh-CN-LNUGB5OW-A3VGS2O7.js +20 -0
- package/dist/zh-HK-E62DVLB3-3PKQ62NI.js +20 -0
- package/dist/zh-TW-RAJ6MFWO-2XI3I7Z6.js +20 -0
- package/guides/arrows.md +85 -0
- package/guides/elements.md +92 -0
- package/guides/icons.md +111 -0
- package/guides/layout.md +75 -0
- package/guides/styling.md +85 -0
- package/package.json +56 -0
- package/packs/generic/LICENSE +26 -0
- package/packs/generic/chalk-pack.json +115 -0
- package/packs/generic/svg/alert.svg +1 -0
- package/packs/generic/svg/api.svg +1 -0
- package/packs/generic/svg/browser.svg +1 -0
- package/packs/generic/svg/bucket.svg +1 -0
- package/packs/generic/svg/cache.svg +1 -0
- package/packs/generic/svg/cloud.svg +1 -0
- package/packs/generic/svg/cron.svg +1 -0
- package/packs/generic/svg/database.svg +1 -0
- package/packs/generic/svg/file.svg +1 -0
- package/packs/generic/svg/folder.svg +1 -0
- package/packs/generic/svg/globe.svg +1 -0
- package/packs/generic/svg/key.svg +1 -0
- package/packs/generic/svg/load-balancer.svg +1 -0
- package/packs/generic/svg/lock.svg +1 -0
- package/packs/generic/svg/metrics.svg +1 -0
- package/packs/generic/svg/mobile.svg +1 -0
- package/packs/generic/svg/queue.svg +1 -0
- package/packs/generic/svg/server.svg +1 -0
- package/packs/generic/svg/user.svg +1 -0
- package/packs/generic/svg/users.svg +1 -0
- package/packs/generic/svg/worker.svg +1 -0
- package/packs/recipes/aws.yml +63 -0
- package/packs/recipes/azure.yml +49 -0
- package/packs/recipes/devicon.yml +54 -0
- package/packs/recipes/gcp.yml +48 -0
- package/packs/recipes/simple-icons.yml +31 -0
- package/ui-dist/assets/Assistant-Bold-gm-uSS1B.woff2 +0 -0
- package/ui-dist/assets/Assistant-Medium-DrcxCXg3.woff2 +0 -0
- package/ui-dist/assets/Assistant-Regular-DVxZuzxb.woff2 +0 -0
- package/ui-dist/assets/Assistant-SemiBold-SCI4bEL9.woff2 +0 -0
- package/ui-dist/assets/abnfDiagram-VCTEODGH-BJtEDuNS.js +1 -0
- package/ui-dist/assets/ar-SA-G6X2FPQ2-B6obDqD5.js +10 -0
- package/ui-dist/assets/arc-DgcGdgmL.js +1 -0
- package/ui-dist/assets/architecture-7GRP2DOG-8nO9N-PA.js +1 -0
- package/ui-dist/assets/architectureDiagram-5GKGNRK7-CvbQe1_v.js +36 -0
- package/ui-dist/assets/array-BifhSqXX.js +1 -0
- package/ui-dist/assets/az-AZ-76LH7QW2-CfV9ZZWy.js +1 -0
- package/ui-dist/assets/bg-BG-XCXSNQG7-DUA8YPCl.js +5 -0
- package/ui-dist/assets/blockDiagram-NRAW4CY4-DocsEmiD.js +129 -0
- package/ui-dist/assets/bn-BD-2XOGV67Q-DvE_tajm.js +5 -0
- package/ui-dist/assets/c4Diagram-UCG6FXSJ-Tx_g_cO9.js +38 -0
- package/ui-dist/assets/ca-ES-6MX7JW3Y-DHdtT9lh.js +8 -0
- package/ui-dist/assets/channel-uzdT5KPV.js +1 -0
- package/ui-dist/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
- package/ui-dist/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
- package/ui-dist/assets/chunk-75Z2AOVW-LAZTrfqO.js +2 -0
- package/ui-dist/assets/chunk-DU6HZSFF-DYQVLGqe.js +127 -0
- package/ui-dist/assets/chunk-EIO257PC-B41AYx2_.js +22 -0
- package/ui-dist/assets/chunk-F27PBJKO-BTHkH7Vo.js +1 -0
- package/ui-dist/assets/chunk-FOHPRMQF-DHwB1DNv.js +161 -0
- package/ui-dist/assets/chunk-G27WJ6UU-BBBWLXXO.js +231 -0
- package/ui-dist/assets/chunk-GMAD6QVW-BkvPd3CL.js +72 -0
- package/ui-dist/assets/chunk-JQ64N6SF-CKrtUr61.js +1 -0
- package/ui-dist/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
- package/ui-dist/assets/chunk-LCL6LL3I-B4K72jRj.js +206 -0
- package/ui-dist/assets/chunk-OBVCFTLP-CMCEQnr_.js +1 -0
- package/ui-dist/assets/chunk-P2QGCYS3-BNpg6XHk.js +1 -0
- package/ui-dist/assets/chunk-POPQ4Y6H-BaAoqHUX.js +1 -0
- package/ui-dist/assets/chunk-PWAF6VOD-CGQ4p70E.js +1 -0
- package/ui-dist/assets/chunk-R7TYR2AO-B2S7-r2z.js +10 -0
- package/ui-dist/assets/chunk-RHFEMEQ7-C_ziruXk.js +168 -0
- package/ui-dist/assets/chunk-SVP7TREG-FJEPEsgF.js +88 -0
- package/ui-dist/assets/chunk-TEH6E4GO-BvKV-yBX.js +62 -0
- package/ui-dist/assets/chunk-XXDRQBXY-BvKO0v-W.js +1 -0
- package/ui-dist/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
- package/ui-dist/assets/classDiagram-DTDB5LWJ-CodHh4yt.js +1 -0
- package/ui-dist/assets/classDiagram-v2-JRS7N3AN-CodHh4yt.js +1 -0
- package/ui-dist/assets/cose-bilkent-JH36ORCC-Ch8c5TQK.js +1 -0
- package/ui-dist/assets/cs-CZ-2BRQDIVT-BamYs5wC.js +11 -0
- package/ui-dist/assets/cynefin-OW5HDTMX-Cj_nyyy3.js +1 -0
- package/ui-dist/assets/cynefinDiagram-5FMLGOSQ-B3Rm8-dE.js +62 -0
- package/ui-dist/assets/cytoscape.esm-C2x7inlt.js +321 -0
- package/ui-dist/assets/da-DK-5WZEPLOC-B8baJSus.js +5 -0
- package/ui-dist/assets/dagre-3AP2YEHR-BesdyiUo.js +4 -0
- package/ui-dist/assets/dagre-PrKaheQc.js +1 -0
- package/ui-dist/assets/de-DE-XR44H4JA-DKPtPOlk.js +8 -0
- package/ui-dist/assets/defaultLocale-BFoDCU3G.js +1 -0
- package/ui-dist/assets/diagram-S7CK7UJ4-jeIUYTnQ.js +30 -0
- package/ui-dist/assets/diagram-UQ7AKVKN-BmAlHtLI.js +41 -0
- package/ui-dist/assets/diagram-VSXAHHWV-B-S5XoGb.js +3 -0
- package/ui-dist/assets/diagram-VX7I27RA--KrWarId.js +24 -0
- package/ui-dist/assets/diagram-Z3DM3KII-B7MnKinD.js +24 -0
- package/ui-dist/assets/directory-open-01563666-D4xXyWb_.js +1 -0
- package/ui-dist/assets/directory-open-4ed118d0-1i309Asm.js +1 -0
- package/ui-dist/assets/dist-B_J_HbC0.js +1 -0
- package/ui-dist/assets/dist-C2o0r0se.js +62 -0
- package/ui-dist/assets/ebnfDiagram-PWID7BFC-C20WACav.js +1 -0
- package/ui-dist/assets/el-GR-BZB4AONW-FSgeiYUW.js +10 -0
- package/ui-dist/assets/en-B4ZKOASM-BAWBMIE-.js +1 -0
- package/ui-dist/assets/erDiagram-SSCWMZ5O-DU4Qz6qu.js +99 -0
- package/ui-dist/assets/es-ES-U4NZUMDT-CZ9XqqCk.js +9 -0
- package/ui-dist/assets/eu-ES-A7QVB2H4-CNagAo_o.js +11 -0
- package/ui-dist/assets/eventmodeling-NTZA5JFV-CLxW34Y6.js +1 -0
- package/ui-dist/assets/fa-IR-HGAKTJCU-CGpX3K56.js +8 -0
- package/ui-dist/assets/fi-FI-Z5N7JZ37-D8ErPXQZ.js +6 -0
- package/ui-dist/assets/file-open-002ab408-BHUWm0Sh.js +1 -0
- package/ui-dist/assets/file-open-7c801643-DZtJT5zp.js +1 -0
- package/ui-dist/assets/file-save-3189631c-CO9S4HFW.js +1 -0
- package/ui-dist/assets/file-save-745eba88-Bwdfz6OZ.js +1 -0
- package/ui-dist/assets/flowDiagram-A5DVABFB-mMONVpxe.js +1 -0
- package/ui-dist/assets/fr-FR-RHASNOE6-CgP9qmF-.js +9 -0
- package/ui-dist/assets/ganttDiagram-EL5Y4UJY-CNqGfKGy.js +292 -0
- package/ui-dist/assets/gitGraph-4MIJSDKK-Cjg2l4tr.js +1 -0
- package/ui-dist/assets/gitGraphDiagram-WWUBYQGX-C1RblGyv.js +106 -0
- package/ui-dist/assets/gl-ES-HMX3MZ6V-D64w31ga.js +10 -0
- package/ui-dist/assets/graphlib-DS17s2tU.js +1 -0
- package/ui-dist/assets/he-IL-6SHJWFNN-prTy1rRE.js +10 -0
- package/ui-dist/assets/hi-IN-IWLTKZ5I-uvdg8ovV.js +4 -0
- package/ui-dist/assets/hu-HU-A5ZG7DT2-OIhzhh7g.js +7 -0
- package/ui-dist/assets/id-ID-SAP4L64H-Bs8DbFR5.js +10 -0
- package/ui-dist/assets/image-GAAHSSAO-D1P4Y62B.js +1 -0
- package/ui-dist/assets/image-blob-reduce.esm-Dj7YBvMv.js +2 -0
- package/ui-dist/assets/index-4BcZoMTG.css +1 -0
- package/ui-dist/assets/index-CknJbzCM.js +269 -0
- package/ui-dist/assets/info-A6RAGUB7-DdLeprH9.js +1 -0
- package/ui-dist/assets/infoDiagram-RXCK75RN-B1aPG_BB.js +2 -0
- package/ui-dist/assets/init-C-OQMol4.js +1 -0
- package/ui-dist/assets/ishikawaDiagram-5VMMS53U-ChG5EVuT.js +70 -0
- package/ui-dist/assets/it-IT-JPQ66NNP-CVy3c_Ht.js +11 -0
- package/ui-dist/assets/ja-JP-DBVTYXUO-EcX4mq4z.js +8 -0
- package/ui-dist/assets/journeyDiagram-EYS64GPL-BZ4Ytc1U.js +139 -0
- package/ui-dist/assets/kaa-6HZHGXH3-BwP9az-p.js +1 -0
- package/ui-dist/assets/kab-KAB-ZGHBKWFO-By-AIEWs.js +8 -0
- package/ui-dist/assets/kanban-definition-3QL26DDD-Dm8bYrkM.js +89 -0
- package/ui-dist/assets/katex-CXMH3UgJ.js +257 -0
- package/ui-dist/assets/kk-KZ-P5N5QNE5-DYNjxBd-.js +1 -0
- package/ui-dist/assets/km-KH-HSX4SM5Z-DS2ZYG-3.js +11 -0
- package/ui-dist/assets/ko-KR-MTYHY66A-DOz4vl1z.js +9 -0
- package/ui-dist/assets/ku-TR-6OUDTVRD-CxEEWxJq.js +9 -0
- package/ui-dist/assets/line-B65qaCJb.js +1 -0
- package/ui-dist/assets/linear-n-3HSMUF.js +1 -0
- package/ui-dist/assets/lt-LT-XHIRWOB4-CkgB2O8i.js +3 -0
- package/ui-dist/assets/lv-LV-5QDEKY6T-BUDeq4Hb.js +7 -0
- package/ui-dist/assets/mermaid-parser.core-C60rNywA.js +7 -0
- package/ui-dist/assets/mindmap-definition-FBJOCRG2-DAu41qFN.js +96 -0
- package/ui-dist/assets/mr-IN-CRQNXWMA-DtuuryqC.js +13 -0
- package/ui-dist/assets/my-MM-5M5IBNSE-CC79-XBH.js +1 -0
- package/ui-dist/assets/nb-NO-T6EIAALU-CKNIbK-0.js +10 -0
- package/ui-dist/assets/nl-NL-IS3SIHDZ-B3dYZhvS.js +8 -0
- package/ui-dist/assets/nn-NO-6E72VCQL-CdPrOnP4.js +8 -0
- package/ui-dist/assets/oc-FR-POXYY2M6-DUmzGjKc.js +8 -0
- package/ui-dist/assets/ordinal-BDEzSJ7C.js +1 -0
- package/ui-dist/assets/pa-IN-N4M65BXN-DH39ZTHj.js +4 -0
- package/ui-dist/assets/packet-AYTQ26CC-DdR4jEOZ.js +1 -0
- package/ui-dist/assets/path-fybaL0A-.js +1 -0
- package/ui-dist/assets/pegDiagram-XKGWAZYB-Dx1lj8MV.js +1 -0
- package/ui-dist/assets/percentages-BXMCSKIN-d5p7s-wT.js +1 -0
- package/ui-dist/assets/pica-xkWDouSg.js +2 -0
- package/ui-dist/assets/pie-WAS4IAKB-cVrV21tR.js +1 -0
- package/ui-dist/assets/pieDiagram-E7YTZNPT-CcvgLYQz.js +39 -0
- package/ui-dist/assets/pl-PL-T2D74RX3-BNYpL8df.js +9 -0
- package/ui-dist/assets/pt-BR-5N22H2LF-RWmGHl_8.js +9 -0
- package/ui-dist/assets/pt-PT-UZXXM6DQ-smq6YmTY.js +9 -0
- package/ui-dist/assets/quadrantDiagram-AXDQQJYC-C4xDsL0E.js +7 -0
- package/ui-dist/assets/radar-RG4KPBEZ-DYaemlGZ.js +1 -0
- package/ui-dist/assets/railroad-74A4TZTK-BbRg5RPZ.js +1 -0
- package/ui-dist/assets/railroad-abnf-HS5TGJTU-BoiCOpxv.js +1 -0
- package/ui-dist/assets/railroad-ebnf-LZEXJU2U-ArFqgLSZ.js +1 -0
- package/ui-dist/assets/railroad-peg-WCYAUIDC-BAks8GCx.js +1 -0
- package/ui-dist/assets/railroadDiagram-O6MQD6OU-CR1fbGhX.js +1 -0
- package/ui-dist/assets/requirementDiagram-EFPCY7ZU-CFp52i96.js +84 -0
- package/ui-dist/assets/ro-RO-JPDTUUEW-BOjKaxCz.js +11 -0
- package/ui-dist/assets/rolldown-runtime-Dd_uD5pT.js +1 -0
- package/ui-dist/assets/rough.esm-Dy-Kn_BL.js +1 -0
- package/ui-dist/assets/roundRect-D01gJrlt.js +1 -0
- package/ui-dist/assets/ru-RU-B4JR7IUQ-DOK2ZlyX.js +9 -0
- package/ui-dist/assets/sankeyDiagram-P5KCCOFB-CZWdGNnS.js +40 -0
- package/ui-dist/assets/sequenceDiagram-WJ2MYXX4-D4X03yFA.js +162 -0
- package/ui-dist/assets/si-LK-N5RQ5JYF-BtKkEPfN.js +1 -0
- package/ui-dist/assets/sizeCapture-X5ZJPWSS-B0uUizjq.js +1 -0
- package/ui-dist/assets/sk-SK-C5VTKIMK-DehBWGkI.js +6 -0
- package/ui-dist/assets/sl-SI-NN7IZMDC-ClR46UYx.js +6 -0
- package/ui-dist/assets/src-oBChb5qS.js +1 -0
- package/ui-dist/assets/stateDiagram-HBIQ2CUA-Bg1Uy2K-.js +1 -0
- package/ui-dist/assets/stateDiagram-v2-4QOOHH4V-Ci4MD4Pt.js +1 -0
- package/ui-dist/assets/subset-shared.chunk-DQ-JqEaX.js +1 -0
- package/ui-dist/assets/subset-worker.chunk-BLppPGco.js +1 -0
- package/ui-dist/assets/sv-SE-XGPEYMSR-Cq54FLpH.js +10 -0
- package/ui-dist/assets/swimlanes-XN3QIQJK-Ca4vLBMp.js +1 -0
- package/ui-dist/assets/swimlanesDiagram-VK2B7HYN-BKiafpMh.js +8 -0
- package/ui-dist/assets/ta-IN-2NMHFXQM-SCh3n0lB.js +9 -0
- package/ui-dist/assets/th-TH-HPSO5L25-BotlAjVv.js +2 -0
- package/ui-dist/assets/timeline-definition-24CTP7MA-CjHCKN4P.js +120 -0
- package/ui-dist/assets/tr-TR-DEFEU3FU-B4u6Au2y.js +7 -0
- package/ui-dist/assets/treeView-Q6P3EWNA-CKMtikLc.js +1 -0
- package/ui-dist/assets/treemap-WGGIJYW6-B51xYeX7.js +1 -0
- package/ui-dist/assets/uk-UA-QMV73CPH-CtQkKgv_.js +6 -0
- package/ui-dist/assets/vennDiagram-4TSXK5OY-CSH3IvAD.js +34 -0
- package/ui-dist/assets/vi-VN-M7AON7JQ-CjZyv0HH.js +5 -0
- package/ui-dist/assets/wardley-WFR3VGLG-wnJkewtF.js +1 -0
- package/ui-dist/assets/wardleyDiagram-VM6X3IG4-BJuisjH-.js +78 -0
- package/ui-dist/assets/xychartDiagram-S5SC5T6Z-hiDu0XBA.js +7 -0
- package/ui-dist/assets/zh-CN-LNUGB5OW-DyyyDDxj.js +10 -0
- package/ui-dist/assets/zh-HK-E62DVLB3-Ch2pxiFR.js +1 -0
- package/ui-dist/assets/zh-TW-RAJ6MFWO-CSf1_B6H.js +9 -0
- package/ui-dist/fonts/Assistant/Assistant-Bold.woff2 +0 -0
- package/ui-dist/fonts/Assistant/Assistant-Medium.woff2 +0 -0
- package/ui-dist/fonts/Assistant/Assistant-Regular.woff2 +0 -0
- package/ui-dist/fonts/Assistant/Assistant-SemiBold.woff2 +0 -0
- package/ui-dist/fonts/Cascadia/CascadiaCode-Regular.woff2 +0 -0
- package/ui-dist/fonts/ComicShanns/ComicShanns-Regular-279a7b317d12eb88de06167bd672b4b4.woff2 +0 -0
- package/ui-dist/fonts/ComicShanns/ComicShanns-Regular-6e066e8de2ac57ea9283adb9c24d7f0c.woff2 +0 -0
- package/ui-dist/fonts/ComicShanns/ComicShanns-Regular-dc6a8806fa96795d7b3be5026f989a17.woff2 +0 -0
- package/ui-dist/fonts/ComicShanns/ComicShanns-Regular-fcb0fc02dcbee4c9846b3e2508668039.woff2 +0 -0
- package/ui-dist/fonts/Excalifont/Excalifont-Regular-349fac6ca4700ffec595a7150a0d1e1d.woff2 +0 -0
- package/ui-dist/fonts/Excalifont/Excalifont-Regular-3f2c5db56cc93c5a6873b1361d730c16.woff2 +0 -0
- package/ui-dist/fonts/Excalifont/Excalifont-Regular-41b173a47b57366892116a575a43e2b6.woff2 +0 -0
- package/ui-dist/fonts/Excalifont/Excalifont-Regular-623ccf21b21ef6b3a0d87738f77eb071.woff2 +0 -0
- package/ui-dist/fonts/Excalifont/Excalifont-Regular-a88b72a24fb54c9f94e3b5fdaa7481c9.woff2 +0 -0
- package/ui-dist/fonts/Excalifont/Excalifont-Regular-b9dcf9d2e50a1eaf42fc664b50a3fd0d.woff2 +0 -0
- package/ui-dist/fonts/Excalifont/Excalifont-Regular-be310b9bcd4f1a43f571c46df7809174.woff2 +0 -0
- package/ui-dist/fonts/Liberation/LiberationSans-Regular.woff2 +0 -0
- package/ui-dist/fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYE98RXi4EwSsbg.woff2 +0 -0
- package/ui-dist/fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYEF8RXi4EwQ.woff2 +0 -0
- package/ui-dist/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTA3j6zbXWjgevT5.woff2 +0 -0
- package/ui-dist/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTQ3j6zbXWjgeg.woff2 +0 -0
- package/ui-dist/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTk3j6zbXWjgevT5.woff2 +0 -0
- package/ui-dist/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTo3j6zbXWjgevT5.woff2 +0 -0
- package/ui-dist/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTs3j6zbXWjgevT5.woff2 +0 -0
- package/ui-dist/fonts/Virgil/Virgil-Regular.woff2 +0 -0
- package/ui-dist/index.html +14 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./subset-worker.chunk-BLppPGco.js","./chunk-EIO257PC-B41AYx2_.js","./subset-shared.chunk-DQ-JqEaX.js","./pica-xkWDouSg.js","./rolldown-runtime-Dd_uD5pT.js","./dist-C2o0r0se.js","./chunk-Y2CYZVJY-DsF7k-Jl.js","./src-oBChb5qS.js","./chunk-DU6HZSFF-DYQVLGqe.js","./chunk-75Z2AOVW-LAZTrfqO.js","./dist-B_J_HbC0.js","./chunk-P2QGCYS3-BNpg6XHk.js","./chunk-PWAF6VOD-CGQ4p70E.js","./chunk-GMAD6QVW-BkvPd3CL.js","./chunk-TEH6E4GO-BvKV-yBX.js","./rough.esm-Dy-Kn_BL.js","./chunk-OBVCFTLP-CMCEQnr_.js","./chunk-JQ64N6SF-CKrtUr61.js","./chunk-R7TYR2AO-B2S7-r2z.js","./line-B65qaCJb.js","./path-fybaL0A-.js","./array-BifhSqXX.js","./graphlib-DS17s2tU.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e,r as t,t as n}from"./rolldown-runtime-Dd_uD5pT.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var r=n((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var te=/\/+/g;function ne(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function re(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+ne(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(te,`$&/`)+`/`),re(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(te,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+ne(s,l);c+=re(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+ne(s,l++),c+=re(s,r,i,u,o);else if(s===`object`)throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`);return c}function ie(e,t,n){if(e==null)return e;var r=[],i=0;return re(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ae(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var oe={current:null},se={transition:null},ce={ReactCurrentDispatcher:oe,ReactCurrentBatchConfig:se,ReactCurrentOwner:C};function le(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:ie,forEach:function(e,t,n){ie(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ie(e,function(){t++}),t},toArray:function(e){return ie(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ce,e.act=le,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ae}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=se.transition;se.transition={};try{e()}finally{se.transition=t}},e.unstable_act=le,e.useCallback=function(e,t){return oe.current.useCallback(e,t)},e.useContext=function(e){return oe.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return oe.current.useDeferredValue(e)},e.useEffect=function(e,t){return oe.current.useEffect(e,t)},e.useId=function(){return oe.current.useId()},e.useImperativeHandle=function(e,t,n){return oe.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return oe.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return oe.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return oe.current.useMemo(e,t)},e.useReducer=function(e,t,n){return oe.current.useReducer(e,t,n)},e.useRef=function(e){return oe.current.useRef(e)},e.useState=function(e){return oe.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return oe.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return oe.current.useTransition()},e.version=`18.3.1`})),i=n(((e,t)=>{t.exports=r()})),a=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m){if(n(c)!==null)m=!0,ie(x);else{var t=n(l);t!==null&&ae(b,t.startTime-e)}}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&ae(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function ee(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?te():(S=!1,C=null)}}else S=!1}var te;if(typeof v==`function`)te=function(){v(ee)};else if(typeof MessageChannel<`u`){var ne=new MessageChannel,re=ne.port2;ne.port1.onmessage=ee,te=function(){re.postMessage(null)}}else te=function(){g(ee,0)};function ie(e){C=e,S||(S=!0,te())}function ae(t,n){w=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,ie(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,ae(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ie(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),o=n(((e,t)=>{t.exports=a()})),s=n((e=>{var t=i(),n=o();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var a=new Set,s={};function c(e,t){l(e,t),l(e+`Capture`,t)}function l(e,t){for(s[e]=t,e=0;e<t.length;e++)a.add(t[e])}var u=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),d=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},m={};function h(e){return d.call(m,e)?!0:d.call(p,e)?!1:f.test(e)?m[e]=!0:(p[e]=!0,!1)}function g(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function _(e,t,n,r){if(t==null||g(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function v(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new v(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(_(t,n,i,r)&&(n=null),r||i===null?h(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type!==3&&``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var C=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for(`react.element`),T=Symbol.for(`react.portal`),E=Symbol.for(`react.fragment`),D=Symbol.for(`react.strict_mode`),ee=Symbol.for(`react.profiler`),te=Symbol.for(`react.provider`),ne=Symbol.for(`react.context`),re=Symbol.for(`react.forward_ref`),ie=Symbol.for(`react.suspense`),ae=Symbol.for(`react.suspense_list`),oe=Symbol.for(`react.memo`),se=Symbol.for(`react.lazy`),ce=Symbol.for(`react.offscreen`),le=Symbol.iterator;function ue(e){return typeof e!=`object`||!e?null:(e=le&&e[le]||e[`@@iterator`],typeof e==`function`?e:null)}var de=Object.assign,fe;function pe(e){if(fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||``}return`
|
|
3
|
+
`+fe+e}var me=!1;function he(e,t){if(!e||me)return``;me=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t){if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
|
|
4
|
+
`),a=r.stack.split(`
|
|
5
|
+
`),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
|
|
6
|
+
`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(`<anonymous>`)&&(c=c.replace(`<anonymous>`,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{me=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?pe(e):``}function ge(e){switch(e.tag){case 5:return pe(e.type);case 16:return pe(`Lazy`);case 13:return pe(`Suspense`);case 19:return pe(`SuspenseList`);case 0:case 2:case 15:return e=he(e.type,!1),e;case 11:return e=he(e.type.render,!1),e;case 1:return e=he(e.type,!0),e;default:return``}}function _e(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case E:return`Fragment`;case T:return`Portal`;case ee:return`Profiler`;case D:return`StrictMode`;case ie:return`Suspense`;case ae:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case ne:return(e.displayName||`Context`)+`.Consumer`;case te:return(e._context.displayName||`Context`)+`.Provider`;case re:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case oe:return t=e.displayName||null,t===null?_e(e.type)||`Memo`:t;case se:t=e._payload,e=e._init;try{return _e(e(t))}catch{}}return null}function ve(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return _e(t);case 8:return t===D?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function ye(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function be(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function xe(e){var t=be(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Se(e){e._valueTracker||=xe(e)}function Ce(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=be(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function we(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Te(e,t){var n=t.checked;return de({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ee(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=ye(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function De(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function Oe(e,t){De(e,t);var n=ye(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?Ae(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&Ae(e,t.type,ye(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ke(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function Ae(e,t,n){(t!==`number`||we(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var je=Array.isArray;function Me(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+ye(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ne(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return de({},t,{value:void 0,defaultValue:void 0,children:``+e._wrapperState.initialValue})}function Pe(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(r(92));if(je(n)){if(1<n.length)throw Error(r(93));n=n[0]}t=n}t??=``,n=t}e._wrapperState={initialValue:ye(n)}}function Fe(e,t){var n=ye(t.value),r=ye(t.defaultValue);n!=null&&(n=``+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=``+r)}function Ie(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==``&&t!==null&&(e.value=t)}function Le(e){switch(e){case`svg`:return`http://www.w3.org/2000/svg`;case`math`:return`http://www.w3.org/1998/Math/MathML`;default:return`http://www.w3.org/1999/xhtml`}}function Re(e,t){return e==null||e===`http://www.w3.org/1999/xhtml`?Le(t):e===`http://www.w3.org/2000/svg`&&t===`foreignObject`?`http://www.w3.org/1999/xhtml`:e}var ze,Be=function(e){return typeof MSApp<`u`&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!==`http://www.w3.org/2000/svg`||`innerHTML`in e)e.innerHTML=t;else{for(ze||=document.createElement(`div`),ze.innerHTML=`<svg>`+t.valueOf().toString()+`</svg>`,t=ze.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ve(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var He={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ue=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(He).forEach(function(e){Ue.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),He[t]=He[e]})});function We(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||He.hasOwnProperty(e)&&He[e]?(``+t).trim():t+`px`}function Ge(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=We(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var Ke=de({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function qe(e,t){if(t){if(Ke[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function Je(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Ye=null;function Xe(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ze=null,Qe=null,$e=null;function et(e){if(e=ta(e)){if(typeof Ze!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=ra(t),Ze(e.stateNode,e.type,t))}}function tt(e){Qe?$e?$e.push(e):$e=[e]:Qe=e}function nt(){if(Qe){var e=Qe,t=$e;if($e=Qe=null,et(e),t)for(e=0;e<t.length;e++)et(t[e])}}function rt(e,t){return e(t)}function it(){}var at=!1;function ot(e,t,n){if(at)return e(t,n);at=!0;try{return rt(e,t,n)}finally{at=!1,(Qe!==null||$e!==null)&&(it(),nt())}}function st(e,t){var n=e.stateNode;if(n===null)return null;var i=ra(n);if(i===null)return null;n=i[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(i=!i.disabled)||(e=e.type,i=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!i;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(r(231,t,typeof n));return n}var ct=!1;if(u)try{var lt={};Object.defineProperty(lt,"passive",{get:function(){ct=!0}}),window.addEventListener(`test`,lt,lt),window.removeEventListener(`test`,lt,lt)}catch{ct=!1}function ut(e,t,n,r,i,a,o,s,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var dt=!1,ft=null,pt=!1,mt=null,ht={onError:function(e){dt=!0,ft=e}};function gt(e,t,n,r,i,a,o,s,c){dt=!1,ft=null,ut.apply(ht,arguments)}function _t(e,t,n,i,a,o,s,c,l){if(gt.apply(this,arguments),dt){if(dt){var u=ft;dt=!1,ft=null}else throw Error(r(198));pt||(pt=!0,mt=u)}}function vt(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function yt(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function bt(e){if(vt(e)!==e)throw Error(r(188))}function xt(e){var t=e.alternate;if(!t){if(t=vt(e),t===null)throw Error(r(188));return t===e?e:null}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return bt(a),e;if(o===i)return bt(a),t;o=o.sibling}throw Error(r(188))}if(n.return!==i.return)n=a,i=o;else{for(var s=!1,c=a.child;c;){if(c===n){s=!0,n=a,i=o;break}if(c===i){s=!0,i=a,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,i=a;break}if(c===i){s=!0,i=o,n=a;break}c=c.sibling}if(!s)throw Error(r(189))}}if(n.alternate!==i)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function St(e){return e=xt(e),e===null?null:Ct(e)}function Ct(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Ct(e);if(t!==null)return t;e=e.sibling}return null}var wt=n.unstable_scheduleCallback,Tt=n.unstable_cancelCallback,Et=n.unstable_shouldYield,Dt=n.unstable_requestPaint,Ot=n.unstable_now,kt=n.unstable_getCurrentPriorityLevel,At=n.unstable_ImmediatePriority,jt=n.unstable_UserBlockingPriority,Mt=n.unstable_NormalPriority,Nt=n.unstable_LowPriority,Pt=n.unstable_IdlePriority,Ft=null,It=null;function Lt(e){if(It&&typeof It.onCommitFiberRoot==`function`)try{It.onCommitFiberRoot(Ft,e,void 0,(e.current.flags&128)==128)}catch{}}var Rt=Math.clz32?Math.clz32:Vt,zt=Math.log,Bt=Math.LN2;function Vt(e){return e>>>=0,e===0?32:31-(zt(e)/Bt|0)|0}var Ht=64,Ut=4194304;function Wt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Gt(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=Wt(a))):r=Wt(s)}else o=n&~i,o===0?a!==0&&(r=Wt(a)):r=Wt(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Rt(t),i=1<<n,r|=e[n],t&=~i;return r}function Kt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qt(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Rt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Kt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function Jt(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function Yt(){var e=Ht;return Ht<<=1,!(Ht&4194240)&&(Ht=64),e}function Xt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Zt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Rt(t),e[t]=n}function Qt(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Rt(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function $t(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Rt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var en=0;function tn(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var nn,rn,an,on,sn,cn=!1,ln=[],un=null,dn=null,fn=null,pn=new Map,mn=new Map,hn=[],gn=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit`.split(` `);function _n(e,t){switch(e){case`focusin`:case`focusout`:un=null;break;case`dragenter`:case`dragleave`:dn=null;break;case`mouseover`:case`mouseout`:fn=null;break;case`pointerover`:case`pointerout`:pn.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:mn.delete(t.pointerId)}}function vn(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=ta(t),t!==null&&rn(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function yn(e,t,n,r,i){switch(t){case`focusin`:return un=vn(un,e,t,n,r,i),!0;case`dragenter`:return dn=vn(dn,e,t,n,r,i),!0;case`mouseover`:return fn=vn(fn,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return pn.set(a,vn(pn.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,mn.set(a,vn(mn.get(a)||null,e,t,n,r,i)),!0}return!1}function bn(e){var t=ea(e.target);if(t!==null){var n=vt(t);if(n!==null){if(t=n.tag,t===13){if(t=yt(n),t!==null){e.blockedOn=t,sn(e.priority,function(){an(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function xn(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Mn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ye=r,n.target.dispatchEvent(r),Ye=null}else return t=ta(n),t!==null&&rn(t),e.blockedOn=n,!1;t.shift()}return!0}function Sn(e,t,n){xn(e)&&n.delete(t)}function Cn(){cn=!1,un!==null&&xn(un)&&(un=null),dn!==null&&xn(dn)&&(dn=null),fn!==null&&xn(fn)&&(fn=null),pn.forEach(Sn),mn.forEach(Sn)}function wn(e,t){e.blockedOn===t&&(e.blockedOn=null,cn||(cn=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Cn)))}function Tn(e){function t(t){return wn(t,e)}if(0<ln.length){wn(ln[0],e);for(var n=1;n<ln.length;n++){var r=ln[n];r.blockedOn===e&&(r.blockedOn=null)}}for(un!==null&&wn(un,e),dn!==null&&wn(dn,e),fn!==null&&wn(fn,e),pn.forEach(t),mn.forEach(t),n=0;n<hn.length;n++)r=hn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<hn.length&&(n=hn[0],n.blockedOn===null);)bn(n),n.blockedOn===null&&hn.shift()}var En=C.ReactCurrentBatchConfig,Dn=!0;function On(e,t,n,r){var i=en,a=En.transition;En.transition=null;try{en=1,An(e,t,n,r)}finally{en=i,En.transition=a}}function kn(e,t,n,r){var i=en,a=En.transition;En.transition=null;try{en=4,An(e,t,n,r)}finally{en=i,En.transition=a}}function An(e,t,n,r){if(Dn){var i=Mn(e,t,n,r);if(i===null)Ei(e,t,r,jn,n),_n(e,r);else if(yn(i,e,t,n,r))r.stopPropagation();else if(_n(e,r),t&4&&-1<gn.indexOf(e)){for(;i!==null;){var a=ta(i);if(a!==null&&nn(a),a=Mn(e,t,n,r),a===null&&Ei(e,t,r,jn,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ei(e,t,r,null,n)}}var jn=null;function Mn(e,t,n,r){if(jn=null,e=Xe(r),e=ea(e),e!==null){if(t=vt(e),t===null)e=null;else if(n=t.tag,n===13){if(e=yt(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}return jn=e,null}function Nn(e){switch(e){case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 1;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`toggle`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 4;case`message`:switch(kt()){case At:return 1;case jt:return 4;case Mt:case Nt:return 16;case Pt:return 536870912;default:return 16}default:return 16}}var Pn=null,Fn=null,In=null;function Ln(){if(In)return In;var e,t=Fn,n=t.length,r,i=`value`in Pn?Pn.value:Pn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return In=i.slice(e,1<r?1-r:void 0)}function Rn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function zn(){return!0}function Bn(){return!1}function Vn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?zn:Bn,this.isPropagationStopped=Bn,this}return de(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=zn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=zn)},persist:function(){},isPersistent:zn}),t}var Hn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Un=Vn(Hn),Wn=de({},Hn,{view:0,detail:0}),Gn=Vn(Wn),Kn,qn,Jn,Yn=de({},Wn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:or,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Jn&&(Jn&&e.type===`mousemove`?(Kn=e.screenX-Jn.screenX,qn=e.screenY-Jn.screenY):qn=Kn=0,Jn=e),Kn)},movementY:function(e){return`movementY`in e?e.movementY:qn}}),Xn=Vn(Yn),Zn=Vn(de({},Yn,{dataTransfer:0})),Qn=Vn(de({},Wn,{relatedTarget:0})),$n=Vn(de({},Hn,{animationName:0,elapsedTime:0,pseudoElement:0})),er=Vn(de({},Hn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),tr=Vn(de({},Hn,{data:0})),nr={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},rr={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},ir={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function ar(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ir[e])?!!t[e]:!1}function or(){return ar}var sr=Vn(de({},Wn,{key:function(e){if(e.key){var t=nr[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Rn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?rr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:or,charCode:function(e){return e.type===`keypress`?Rn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Rn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),cr=Vn(de({},Yn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),lr=Vn(de({},Wn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:or})),ur=Vn(de({},Hn,{propertyName:0,elapsedTime:0,pseudoElement:0})),dr=Vn(de({},Yn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),fr=[9,13,27,32],pr=u&&`CompositionEvent`in window,mr=null;u&&`documentMode`in document&&(mr=document.documentMode);var hr=u&&`TextEvent`in window&&!mr,gr=u&&(!pr||mr&&8<mr&&11>=mr),_r=` `,vr=!1;function yr(e,t){switch(e){case`keyup`:return fr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function br(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var xr=!1;function Sr(e,t){switch(e){case`compositionend`:return br(t);case`keypress`:return t.which===32?(vr=!0,_r):null;case`textInput`:return e=t.data,e===_r&&vr?null:e;default:return null}}function Cr(e,t){if(xr)return e===`compositionend`||!pr&&yr(e,t)?(e=Ln(),In=Fn=Pn=null,xr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return gr&&t.locale!==`ko`?null:t.data;default:return null}}var wr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!wr[e.type]:t===`textarea`}function Er(e,t,n,r){tt(r),t=Oi(t,`onChange`),0<t.length&&(n=new Un(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Dr=null,Or=null;function kr(e){bi(e,0)}function Ar(e){if(Ce(na(e)))return e}function jr(e,t){if(e===`change`)return t}var Mr=!1;if(u){var Nr;if(u){var Pr=`oninput`in document;if(!Pr){var Fr=document.createElement(`div`);Fr.setAttribute(`oninput`,`return;`),Pr=typeof Fr.oninput==`function`}Nr=Pr}else Nr=!1;Mr=Nr&&(!document.documentMode||9<document.documentMode)}function Ir(){Dr&&(Dr.detachEvent(`onpropertychange`,Lr),Or=Dr=null)}function Lr(e){if(e.propertyName===`value`&&Ar(Or)){var t=[];Er(t,Or,e,Xe(e)),ot(kr,t)}}function Rr(e,t,n){e===`focusin`?(Ir(),Dr=t,Or=n,Dr.attachEvent(`onpropertychange`,Lr)):e===`focusout`&&Ir()}function zr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Ar(Or)}function Br(e,t){if(e===`click`)return Ar(t)}function Vr(e,t){if(e===`input`||e===`change`)return Ar(t)}function Hr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Ur=typeof Object.is==`function`?Object.is:Hr;function Wr(e,t){if(Ur(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!d.call(t,i)||!Ur(e[i],t[i]))return!1}return!0}function Gr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kr(e,t){var n=Gr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Gr(n)}}function qr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jr(){for(var e=window,t=we();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=we(e.document)}return t}function Yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function Xr(e){var t=Jr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&qr(n.ownerDocument.documentElement,n)){if(r!==null&&Yr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Kr(n,a);var o=Kr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Zr=u&&`documentMode`in document&&11>=document.documentMode,Qr=null,$r=null,ei=null,ti=!1;function ni(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ti||Qr==null||Qr!==we(r)||(r=Qr,`selectionStart`in r&&Yr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ei&&Wr(ei,r)||(ei=r,r=Oi($r,`onSelect`),0<r.length&&(t=new Un(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Qr)))}function ri(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ii={animationend:ri(`Animation`,`AnimationEnd`),animationiteration:ri(`Animation`,`AnimationIteration`),animationstart:ri(`Animation`,`AnimationStart`),transitionend:ri(`Transition`,`TransitionEnd`)},ai={},oi={};u&&(oi=document.createElement(`div`).style,`AnimationEvent`in window||(delete ii.animationend.animation,delete ii.animationiteration.animation,delete ii.animationstart.animation),`TransitionEvent`in window||delete ii.transitionend.transition);function si(e){if(ai[e])return ai[e];if(!ii[e])return e;var t=ii[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in oi)return ai[e]=t[n];return e}var ci=si(`animationend`),li=si(`animationiteration`),ui=si(`animationstart`),di=si(`transitionend`),fi=new Map,pi=`abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);function mi(e,t){fi.set(e,t),c(t,[e])}for(var hi=0;hi<pi.length;hi++){var gi=pi[hi];mi(gi.toLowerCase(),`on`+(gi[0].toUpperCase()+gi.slice(1)))}mi(ci,`onAnimationEnd`),mi(li,`onAnimationIteration`),mi(ui,`onAnimationStart`),mi(`dblclick`,`onDoubleClick`),mi(`focusin`,`onFocus`),mi(`focusout`,`onBlur`),mi(di,`onTransitionEnd`),l(`onMouseEnter`,[`mouseout`,`mouseover`]),l(`onMouseLeave`,[`mouseout`,`mouseover`]),l(`onPointerEnter`,[`pointerout`,`pointerover`]),l(`onPointerLeave`,[`pointerout`,`pointerover`]),c(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),c(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),c(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),c(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),c(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),c(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var _i=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),vi=new Set(`cancel close invalid load scroll toggle`.split(` `).concat(_i));function yi(e,t,n){var r=e.type||`unknown-event`;e.currentTarget=n,_t(r,t,void 0,e),e.currentTarget=null}function bi(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;yi(i,s,l),a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;yi(i,s,l),a=c}}}if(pt)throw e=mt,pt=!1,mt=null,e}function xi(e,t){var n=t[Zi];n===void 0&&(n=t[Zi]=new Set);var r=e+`__bubble`;n.has(r)||(Ti(t,e,2,!1),n.add(r))}function Si(e,t,n){var r=0;t&&(r|=4),Ti(n,e,r,t)}var Ci=`_reactListening`+Math.random().toString(36).slice(2);function wi(e){if(!e[Ci]){e[Ci]=!0,a.forEach(function(t){t!==`selectionchange`&&(vi.has(t)||Si(t,!1,e),Si(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ci]||(t[Ci]=!0,Si(`selectionchange`,!1,t))}}function Ti(e,t,n,r){switch(Nn(t)){case 1:var i=On;break;case 4:i=kn;break;default:i=An}n=i.bind(null,t,n,e),i=void 0,!ct||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Ei(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;s!==null;){if(o=ea(s),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue a}s=s.parentNode}}r=r.return}ot(function(){var r=a,i=Xe(n),o=[];a:{var s=fi.get(e);if(s!==void 0){var c=Un,l=e;switch(e){case`keypress`:if(Rn(n)===0)break a;case`keydown`:case`keyup`:c=sr;break;case`focusin`:l=`focus`,c=Qn;break;case`focusout`:l=`blur`,c=Qn;break;case`beforeblur`:case`afterblur`:c=Qn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=Xn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=Zn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=lr;break;case ci:case li:case ui:c=$n;break;case di:c=ur;break;case`scroll`:c=Gn;break;case`wheel`:c=dr;break;case`copy`:case`cut`:case`paste`:c=er;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=cr}var u=!!(t&4),d=!u&&e===`scroll`,f=u?s===null?null:s+`Capture`:s;u=[];for(var p=r,m;p!==null;){m=p;var h=m.stateNode;if(m.tag===5&&h!==null&&(m=h,f!==null&&(h=st(p,f),h!=null&&u.push(Di(p,h,m)))),d)break;p=p.return}0<u.length&&(s=new c(s,l,null,n,i),o.push({event:s,listeners:u}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==Ye&&(l=n.relatedTarget||n.fromElement)&&(ea(l)||l[Xi]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?ea(l):null,l!==null&&(d=vt(l),l!==d||l.tag!==5&&l.tag!==6)&&(l=null)):(c=null,l=r),c!==l)){if(u=Xn,h=`onMouseLeave`,f=`onMouseEnter`,p=`mouse`,(e===`pointerout`||e===`pointerover`)&&(u=cr,h=`onPointerLeave`,f=`onPointerEnter`,p=`pointer`),d=c==null?s:na(c),m=l==null?s:na(l),s=new u(h,p+`leave`,c,n,i),s.target=d,s.relatedTarget=m,h=null,ea(i)===r&&(u=new u(f,p+`enter`,l,n,i),u.target=m,u.relatedTarget=d,h=u),d=h,c&&l)b:{for(u=c,f=l,p=0,m=u;m;m=ki(m))p++;for(m=0,h=f;h;h=ki(h))m++;for(;0<p-m;)u=ki(u),p--;for(;0<m-p;)f=ki(f),m--;for(;p--;){if(u===f||f!==null&&u===f.alternate)break b;u=ki(u),f=ki(f)}u=null}else u=null;c!==null&&Ai(o,s,c,u,!1),l!==null&&d!==null&&Ai(o,d,l,u,!0)}}a:{if(s=r?na(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var g=jr;else if(Tr(s)){if(Mr)g=Vr;else{g=zr;var _=Rr}}else(c=s.nodeName)&&c.toLowerCase()===`input`&&(s.type===`checkbox`||s.type===`radio`)&&(g=Br);if(g&&=g(e,r)){Er(o,g,n,i);break a}_&&_(e,s,r),e===`focusout`&&(_=s._wrapperState)&&_.controlled&&s.type===`number`&&Ae(s,`number`,s.value)}switch(_=r?na(r):window,e){case`focusin`:(Tr(_)||_.contentEditable===`true`)&&(Qr=_,$r=r,ei=null);break;case`focusout`:ei=$r=Qr=null;break;case`mousedown`:ti=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ti=!1,ni(o,n,i);break;case`selectionchange`:if(Zr)break;case`keydown`:case`keyup`:ni(o,n,i)}var v;if(pr)b:{switch(e){case`compositionstart`:var y=`onCompositionStart`;break b;case`compositionend`:y=`onCompositionEnd`;break b;case`compositionupdate`:y=`onCompositionUpdate`;break b}y=void 0}else xr?yr(e,n)&&(y=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(y=`onCompositionStart`);y&&(gr&&n.locale!==`ko`&&(xr||y!==`onCompositionStart`?y===`onCompositionEnd`&&xr&&(v=Ln()):(Pn=i,Fn=`value`in Pn?Pn.value:Pn.textContent,xr=!0)),_=Oi(r,y),0<_.length&&(y=new tr(y,e,null,n,i),o.push({event:y,listeners:_}),v?y.data=v:(v=br(n),v!==null&&(y.data=v)))),(v=hr?Sr(e,n):Cr(e,n))&&(r=Oi(r,`onBeforeInput`),0<r.length&&(i=new tr(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:i,listeners:r}),i.data=v))}bi(o,t)})}function Di(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Oi(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=st(e,n),a!=null&&r.unshift(Di(e,a,i)),a=st(e,t),a!=null&&r.push(Di(e,a,i))),e=e.return}return r}function ki(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ai(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(c!==null&&c===r)break;s.tag===5&&l!==null&&(s=l,i?(c=st(n,a),c!=null&&o.unshift(Di(n,c,s))):i||(c=st(n,a),c!=null&&o.push(Di(n,c,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var ji=/\r\n?/g,Mi=/\u0000|\uFFFD/g;function Ni(e){return(typeof e==`string`?e:``+e).replace(ji,`
|
|
7
|
+
`).replace(Mi,``)}function Pi(e,t,n){if(t=Ni(t),Ni(e)!==t&&n)throw Error(r(425))}function Fi(){}var Ii=null,Li=null;function Ri(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var zi=typeof setTimeout==`function`?setTimeout:void 0,Bi=typeof clearTimeout==`function`?clearTimeout:void 0,Vi=typeof Promise==`function`?Promise:void 0,Hi=typeof queueMicrotask==`function`?queueMicrotask:Vi===void 0?zi:function(e){return Vi.resolve(null).then(e).catch(Ui)};function Ui(e){setTimeout(function(){throw e})}function Wi(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`){if(r===0){e.removeChild(i),Tn(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++}n=i}while(n);Tn(t)}function Gi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`)break;if(t===`/$`)return null}}return e}function Ki(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`){if(t===0)return e;t--}else n===`/$`&&t++}e=e.previousSibling}return null}var qi=Math.random().toString(36).slice(2),Ji=`__reactFiber$`+qi,Yi=`__reactProps$`+qi,Xi=`__reactContainer$`+qi,Zi=`__reactEvents$`+qi,Qi=`__reactListeners$`+qi,$i=`__reactHandles$`+qi;function ea(e){var t=e[Ji];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Xi]||n[Ji]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Ki(e);e!==null;){if(n=e[Ji])return n;e=Ki(e)}return t}e=n,n=e.parentNode}return null}function ta(e){return e=e[Ji]||e[Xi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function na(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function ra(e){return e[Yi]||null}var ia=[],aa=-1;function oa(e){return{current:e}}function sa(e){0>aa||(e.current=ia[aa],ia[aa]=null,aa--)}function ca(e,t){aa++,ia[aa]=e.current,e.current=t}var la={},ua=oa(la),da=oa(!1),fa=la;function pa(e,t){var n=e.type.contextTypes;if(!n)return la;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ma(e){return e=e.childContextTypes,e!=null}function ha(){sa(da),sa(ua)}function ga(e,t,n){if(ua.current!==la)throw Error(r(168));ca(ua,t),ca(da,n)}function _a(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,ve(e)||`Unknown`,a));return de({},n,i)}function va(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||la,fa=ua.current,ca(ua,e),ca(da,da.current),!0}function ya(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=_a(e,t,fa),i.__reactInternalMemoizedMergedChildContext=e,sa(da),sa(ua),ca(ua,e)):sa(da),ca(da,n)}var ba=null,xa=!1,Sa=!1;function Ca(e){ba===null?ba=[e]:ba.push(e)}function wa(e){xa=!0,Ca(e)}function Ta(){if(!Sa&&ba!==null){Sa=!0;var e=0,t=en;try{var n=ba;for(en=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ba=null,xa=!1}catch(t){throw ba!==null&&(ba=ba.slice(e+1)),wt(At,Ta),t}finally{en=t,Sa=!1}}return null}var Ea=[],Da=0,Oa=null,ka=0,Aa=[],ja=0,Ma=null,Na=1,Pa=``;function Fa(e,t){Ea[Da++]=ka,Ea[Da++]=Oa,Oa=e,ka=t}function Ia(e,t,n){Aa[ja++]=Na,Aa[ja++]=Pa,Aa[ja++]=Ma,Ma=e;var r=Na;e=Pa;var i=32-Rt(r)-1;r&=~(1<<i),n+=1;var a=32-Rt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Na=1<<32-Rt(t)+i|n<<i|r,Pa=a+e}else Na=1<<a|n<<i|r,Pa=e}function La(e){e.return!==null&&(Fa(e,1),Ia(e,1,0))}function Ra(e){for(;e===Oa;)Oa=Ea[--Da],Ea[Da]=null,ka=Ea[--Da],Ea[Da]=null;for(;e===Ma;)Ma=Aa[--ja],Aa[ja]=null,Pa=Aa[--ja],Aa[ja]=null,Na=Aa[--ja],Aa[ja]=null}var za=null,Ba=null,Va=!1,Ha=null;function Ua(e,t){var n=lu(5,null,null,0);n.elementType=`DELETED`,n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Wa(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null&&(e.stateNode=t,za=e,Ba=Gi(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t!==null&&(e.stateNode=t,za=e,Ba=null,!0);case 13:return t=t.nodeType===8?t:null,t!==null&&(n=Ma===null?null:{id:Na,overflow:Pa},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=lu(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,za=e,Ba=null,!0);default:return!1}}function Ga(e){return!!(e.mode&1)&&!(e.flags&128)}function Ka(e){if(Va){var t=Ba;if(t){var n=t;if(!Wa(e,t)){if(Ga(e))throw Error(r(418));t=Gi(n.nextSibling);var i=za;t&&Wa(e,t)?Ua(i,n):(e.flags=e.flags&-4097|2,Va=!1,za=e)}}else{if(Ga(e))throw Error(r(418));e.flags=e.flags&-4097|2,Va=!1,za=e}}}function qa(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;za=e}function Ja(e){if(e!==za)return!1;if(!Va)return qa(e),Va=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==`head`&&t!==`body`&&!Ri(e.type,e.memoizedProps)),t&&=Ba){if(Ga(e))throw Ya(),Error(r(418));for(;t;)Ua(e,t),t=Gi(t.nextSibling)}if(qa(e),e.tag===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(317));a:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`){if(t===0){Ba=Gi(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++}e=e.nextSibling}Ba=null}}else Ba=za?Gi(e.stateNode.nextSibling):null;return!0}function Ya(){for(var e=Ba;e;)e=Gi(e.nextSibling)}function Xa(){Ba=za=null,Va=!1}function Za(e){Ha===null?Ha=[e]:Ha.push(e)}var Qa=C.ReactCurrentBatchConfig;function $a(e,t,n){if(e=n.ref,e!==null&&typeof e!=`function`&&typeof e!=`object`){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(r(309));var i=n.stateNode}if(!i)throw Error(r(147,e));var a=i,o=``+e;return t!==null&&t.ref!==null&&typeof t.ref==`function`&&t.ref._stringRef===o?t.ref:(t=function(e){var t=a.refs;e===null?delete t[o]:t[o]=e},t._stringRef=o,t)}if(typeof e!=`string`)throw Error(r(284));if(!n._owner)throw Error(r(290,e))}return e}function eo(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function to(e){var t=e._init;return t(e._payload)}function no(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function i(e,t){for(e=new Map;t!==null;)t.key===null?e.set(t.index,t):e.set(t.key,t),t=t.sibling;return e}function a(e,t){return e=fu(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=2,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=2),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=gu(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===E?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===se&&to(i)===t.type)?(r=a(t,n.props),r.ref=$a(e,t,n),r.return=e,r):(r=pu(n.type,n.key,n.props,null,e.mode,r),r.ref=$a(e,t,n),r.return=e,r)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=L(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=mu(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`)return t=gu(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case w:return n=pu(t.type,t.key,t.props,null,e.mode,n),n.ref=$a(e,null,t),n.return=e,n;case T:return t=L(t,e.mode,n),t.return=e,t;case se:var r=t._init;return f(e,r(t._payload),n)}if(je(t)||ue(t))return t=mu(t,e.mode,n,null),t.return=e,t;eo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case w:return n.key===i?l(e,t,n,r):null;case T:return n.key===i?u(e,t,n,r):null;case se:return i=n._init,p(e,t,i(n._payload),r)}if(je(n)||ue(n))return i===null?d(e,t,n,r,null):null;eo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case w:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case T:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case se:var a=r._init;return m(e,t,n,a(r._payload),i)}if(je(r)||ue(r))return e=e.get(n)||null,d(t,e,r,i,null);eo(t,r)}return null}function h(r,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),Va&&Fa(r,h),l;if(d===null){for(;h<s.length;h++)d=f(r,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Va&&Fa(r,h),l}for(d=i(r,d);h<s.length;h++)g=m(d,r,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(r,e)}),Va&&Fa(r,h),l}function g(a,s,c,l){var u=ue(c);if(typeof u!=`function`)throw Error(r(150));if(c=u.call(c),c==null)throw Error(r(151));for(var d=u=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Va&&Fa(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Va&&Fa(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Va&&Fa(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===E&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case w:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===E){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===se&&to(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=$a(e,l,i),r.return=e,e=r;break a}n(e,l);break}t(e,l),l=l.sibling}i.type===E?(r=mu(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=pu(i.type,i.key,i.props,null,e.mode,o),o.ref=$a(e,r,i),o.return=e,e=o)}return s(e);case T:a:{for(l=i.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}n(e,r);break}t(e,r),r=r.sibling}r=L(i,e.mode,o),r.return=e,e=r}return s(e);case se:return l=i._init,_(e,r,l(i._payload),o)}if(je(i))return h(e,r,i,o);if(ue(i))return g(e,r,i,o);eo(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=gu(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var ro=no(!0),io=no(!1),ao=oa(null),oo=null,so=null,co=null;function lo(){co=so=oo=null}function uo(e){var t=ao.current;sa(ao),e._currentValue=t}function fo(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function po(e,t){oo=e,co=so=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&($s=!0),e.firstContext=null)}function mo(e){var t=e._currentValue;if(co!==e){if(e={context:e,memoizedValue:t,next:null},so===null){if(oo===null)throw Error(r(308));so=e,oo.dependencies={lanes:0,firstContext:e}}else so=so.next=e}return t}var ho=null;function go(e){ho===null?ho=[e]:ho.push(e)}function _o(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,go(t)):(n.next=i.next,i.next=n),t.interleaved=n,vo(e,r)}function vo(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var yo=!1;function bo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function xo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function So(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Co(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,sl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,vo(e,n)}return i=r.interleaved,i===null?(t.next=t,go(r)):(t.next=i.next,i.next=t),r.interleaved=t,vo(e,n)}function wo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$t(e,n)}}function To(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Eo(e,t,n,r){var i=e.updateQueue;yo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=de({},d,f);break a;case 2:yo=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);ml|=o,e.lanes=o,e.memoizedState=d}}function Do(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=n,typeof a!=`function`)throw Error(r(191,a));a.call(i)}}}var Oo={},ko=oa(Oo),Ao=oa(Oo),jo=oa(Oo);function Mo(e){if(e===Oo)throw Error(r(174));return e}function No(e,t){switch(ca(jo,t),ca(Ao,e),ca(ko,Oo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Re(null,``);break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Re(t,e)}sa(ko),ca(ko,t)}function Po(){sa(ko),sa(Ao),sa(jo)}function Fo(e){Mo(jo.current);var t=Mo(ko.current),n=Re(t,e.type);t!==n&&(ca(Ao,e),ca(ko,n))}function Io(e){Ao.current===e&&(sa(ko),sa(Ao))}var Lo=oa(0);function Ro(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data===`$?`||n.data===`$!`))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var zo=[];function Bo(){for(var e=0;e<zo.length;e++)zo[e]._workInProgressVersionPrimary=null;zo.length=0}var Vo=C.ReactCurrentDispatcher,O=C.ReactCurrentBatchConfig,Ho=0,k=null,Uo=null,Wo=null,Go=!1,Ko=!1,qo=0,Jo=0;function Yo(){throw Error(r(321))}function Xo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ur(e[n],t[n]))return!1;return!0}function Zo(e,t,n,i,a,o){if(Ho=o,k=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Vo.current=e===null||e.memoizedState===null?Ns:Ps,e=n(i,a),Ko){o=0;do{if(Ko=!1,qo=0,25<=o)throw Error(r(301));o+=1,Wo=Uo=null,t.updateQueue=null,Vo.current=Fs,e=n(i,a)}while(Ko)}if(Vo.current=Ms,t=Uo!==null&&Uo.next!==null,Ho=0,Wo=Uo=k=null,Go=!1,t)throw Error(r(300));return e}function Qo(){var e=qo!==0;return qo=0,e}function $o(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Wo===null?k.memoizedState=Wo=e:Wo=Wo.next=e,Wo}function es(){if(Uo===null){var e=k.alternate;e=e===null?null:e.memoizedState}else e=Uo.next;var t=Wo===null?k.memoizedState:Wo.next;if(t!==null)Wo=t,Uo=e;else{if(e===null)throw Error(r(310));Uo=e,e={memoizedState:Uo.memoizedState,baseState:Uo.baseState,baseQueue:Uo.baseQueue,queue:Uo.queue,next:null},Wo===null?k.memoizedState=Wo=e:Wo=Wo.next=e}return Wo}function ts(e,t){return typeof t==`function`?t(e):t}function ns(e){var t=es(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=Uo,a=i.baseQueue,o=n.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}i.baseQueue=a=o,n.pending=null}if(a!==null){o=a.next,i=i.baseState;var c=s=null,l=null,u=o;do{var d=u.lane;if((Ho&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(c=l=f,s=i):l=l.next=f,k.lanes|=d,ml|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=c,Ur(i,t.memoizedState)||($s=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=l,n.lastRenderedState=i}if(e=n.interleaved,e!==null){a=e;do o=a.lane,k.lanes|=o,ml|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function rs(e){var t=es(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Ur(o,t.memoizedState)||($s=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function is(){}function as(e,t){var n=k,i=es(),a=t(),o=!Ur(i.memoizedState,a);if(o&&(i.memoizedState=a,$s=!0),i=i.queue,gs(cs.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||Wo!==null&&Wo.memoizedState.tag&1){if(n.flags|=2048,A(9,ss.bind(null,n,i,a,t),void 0,null),cl===null)throw Error(r(349));Ho&30||os(n,t,a)}return a}function os(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=k.updateQueue,t===null?(t={lastEffect:null,stores:null},k.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ss(e,t,n,r){t.value=n,t.getSnapshot=r,ls(t)&&us(e)}function cs(e,t,n){return n(function(){ls(t)&&us(e)})}function ls(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ur(e,n)}catch{return!0}}function us(e){var t=vo(e,1);t!==null&&jl(t,e,1,-1)}function ds(e){var t=$o();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ts,lastRenderedState:e},t.queue=e,e=e.dispatch=Os.bind(null,k,e),[t.memoizedState,e]}function A(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=k.updateQueue,t===null?(t={lastEffect:null,stores:null},k.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function fs(){return es().memoizedState}function ps(e,t,n,r){var i=$o();k.flags|=e,i.memoizedState=A(1|t,n,void 0,r===void 0?null:r)}function ms(e,t,n,r){var i=es();r=r===void 0?null:r;var a=void 0;if(Uo!==null){var o=Uo.memoizedState;if(a=o.destroy,r!==null&&Xo(r,o.deps)){i.memoizedState=A(t,n,a,r);return}}k.flags|=e,i.memoizedState=A(1|t,n,a,r)}function hs(e,t){return ps(8390656,8,e,t)}function gs(e,t){return ms(2048,8,e,t)}function _s(e,t){return ms(4,2,e,t)}function vs(e,t){return ms(4,4,e,t)}function ys(e,t){if(typeof t==`function`)return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function bs(e,t,n){return n=n==null?null:n.concat([e]),ms(4,4,ys.bind(null,t,e),n)}function xs(){}function Ss(e,t){var n=es();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Xo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Cs(e,t){var n=es();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Xo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ws(e,t,n){return Ho&21?(Ur(n,t)||(n=Yt(),k.lanes|=n,ml|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,$s=!0),e.memoizedState=n)}function Ts(e,t){var n=en;en=n!==0&&4>n?n:4,e(!0);var r=O.transition;O.transition={};try{e(!1),t()}finally{en=n,O.transition=r}}function Es(){return es().memoizedState}function Ds(e,t,n){var r=I(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ks(e))As(t,n);else if(n=_o(e,t,n,r),n!==null){var i=Al();jl(n,e,r,i),js(n,t,r)}}function Os(e,t,n){var r=I(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ks(e))As(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Ur(s,o)){var c=t.interleaved;c===null?(i.next=i,go(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=_o(e,t,i,r),n!==null&&(i=Al(),jl(n,e,r,i),js(n,t,r))}}function ks(e){var t=e.alternate;return e===k||t!==null&&t===k}function As(e,t){Ko=Go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function js(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$t(e,n)}}var Ms={readContext:mo,useCallback:Yo,useContext:Yo,useEffect:Yo,useImperativeHandle:Yo,useInsertionEffect:Yo,useLayoutEffect:Yo,useMemo:Yo,useReducer:Yo,useRef:Yo,useState:Yo,useDebugValue:Yo,useDeferredValue:Yo,useTransition:Yo,useMutableSource:Yo,useSyncExternalStore:Yo,useId:Yo,unstable_isNewReconciler:!1},Ns={readContext:mo,useCallback:function(e,t){return $o().memoizedState=[e,t===void 0?null:t],e},useContext:mo,useEffect:hs,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),ps(4194308,4,ys.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ps(4194308,4,e,t)},useInsertionEffect:function(e,t){return ps(4,2,e,t)},useMemo:function(e,t){var n=$o();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=$o();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Ds.bind(null,k,e),[r.memoizedState,e]},useRef:function(e){var t=$o();return e={current:e},t.memoizedState=e},useState:ds,useDebugValue:xs,useDeferredValue:function(e){return $o().memoizedState=e},useTransition:function(){var e=ds(!1),t=e[0];return e=Ts.bind(null,e[1]),$o().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=k,a=$o();if(Va){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),cl===null)throw Error(r(349));Ho&30||os(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,hs(cs.bind(null,i,o,e),[e]),i.flags|=2048,A(9,ss.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=$o(),t=cl.identifierPrefix;if(Va){var n=Pa,r=Na;n=(r&~(1<<32-Rt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=qo++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=Jo++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},Ps={readContext:mo,useCallback:Ss,useContext:mo,useEffect:gs,useImperativeHandle:bs,useInsertionEffect:_s,useLayoutEffect:vs,useMemo:Cs,useReducer:ns,useRef:fs,useState:function(){return ns(ts)},useDebugValue:xs,useDeferredValue:function(e){return ws(es(),Uo.memoizedState,e)},useTransition:function(){return[ns(ts)[0],es().memoizedState]},useMutableSource:is,useSyncExternalStore:as,useId:Es,unstable_isNewReconciler:!1},Fs={readContext:mo,useCallback:Ss,useContext:mo,useEffect:gs,useImperativeHandle:bs,useInsertionEffect:_s,useLayoutEffect:vs,useMemo:Cs,useReducer:rs,useRef:fs,useState:function(){return rs(ts)},useDebugValue:xs,useDeferredValue:function(e){var t=es();return Uo===null?t.memoizedState=e:ws(t,Uo.memoizedState,e)},useTransition:function(){return[rs(ts)[0],es().memoizedState]},useMutableSource:is,useSyncExternalStore:as,useId:Es,unstable_isNewReconciler:!1};function Is(e,t){if(e&&e.defaultProps){for(var n in t=de({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ls(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:de({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Rs={isMounted:function(e){return(e=e._reactInternals)?vt(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Al(),i=I(e),a=So(r,i);a.payload=t,n!=null&&(a.callback=n),t=Co(e,a,i),t!==null&&(jl(t,e,i,r),wo(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Al(),i=I(e),a=So(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Co(e,a,i),t!==null&&(jl(t,e,i,r),wo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Al(),r=I(e),i=So(n,r);i.tag=2,t!=null&&(i.callback=t),t=Co(e,i,r),t!==null&&(jl(t,e,r,n),wo(t,e,r))}};function zs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Wr(n,r)||!Wr(i,a):!0}function Bs(e,t,n){var r=!1,i=la,a=t.contextType;return typeof a==`object`&&a?a=mo(a):(i=ma(t)?fa:ua.current,r=t.contextTypes,a=(r=r!=null)?pa(e,i):la),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Rs,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Vs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Rs.enqueueReplaceState(t,t.state,null)}function Hs(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},bo(e);var a=t.contextType;typeof a==`object`&&a?i.context=mo(a):(a=ma(t)?fa:ua.current,i.context=pa(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(Ls(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps==`function`||typeof i.getSnapshotBeforeUpdate==`function`||typeof i.UNSAFE_componentWillMount!=`function`&&typeof i.componentWillMount!=`function`||(t=i.state,typeof i.componentWillMount==`function`&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount==`function`&&i.UNSAFE_componentWillMount(),t!==i.state&&Rs.enqueueReplaceState(i,i.state,null),Eo(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function Us(e,t){try{var n=``,r=t;do n+=ge(r),r=r.return;while(r);var i=n}catch(e){i=`
|
|
8
|
+
Error generating stack: `+e.message+`
|
|
9
|
+
`+e.stack}return{value:e,source:t,stack:i,digest:null}}function Ws(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Gs(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var Ks=typeof WeakMap==`function`?WeakMap:Map;function qs(e,t,n){n=So(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){xl||(xl=!0,Sl=r),Gs(e,t)},n}function Js(e,t,n){n=So(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Gs(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){Gs(e,t),typeof r!=`function`&&(F===null?F=new Set([this]):F.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function Ys(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ks;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=nu.bind(null,e,t,n),t.then(e,e))}function Xs(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null||t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Zs(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=So(-1,1),t.tag=2,Co(n,t,1))),n.lanes|=1),e)}var Qs=C.ReactCurrentOwner,$s=!1;function ec(e,t,n,r){t.child=e===null?io(t,null,n,r):ro(t,e.child,n,r)}function tc(e,t,n,r,i){n=n.render;var a=t.ref;return po(t,i),r=Zo(e,t,n,r,a,i),n=Qo(),e!==null&&!$s?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,bc(e,t,i)):(Va&&n&&La(t),t.flags|=1,ec(e,t,r,i),t.child)}function nc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!uu(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,rc(e,t,a,r,i)):(e=pu(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?Wr:n,n(o,r)&&e.ref===t.ref)return bc(e,t,i)}return t.flags|=1,e=fu(a,r),e.ref=t.ref,e.return=t,t.child=e}function rc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Wr(a,r)&&e.ref===t.ref){if($s=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&($s=!0);else return t.lanes=e.lanes,bc(e,t,i)}}return oc(e,t,n,r,i)}function ic(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`){if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ca(dl,N),N|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ca(dl,N),N|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,ca(dl,N),N|=r}}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),ca(dl,N),N|=r;return ec(e,t,i,n),t.child}function ac(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function oc(e,t,n,r,i){var a=ma(n)?fa:ua.current;return a=pa(t,a),po(t,i),n=Zo(e,t,n,r,a,i),r=Qo(),e!==null&&!$s?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,bc(e,t,i)):(Va&&r&&La(t),t.flags|=1,ec(e,t,n,i),t.child)}function sc(e,t,n,r,i){if(ma(n)){var a=!0;va(t)}else a=!1;if(po(t,i),t.stateNode===null)yc(e,t),Bs(t,n,r),Hs(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=mo(l):(l=ma(n)?fa:ua.current,l=pa(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&Vs(t,o,r,l),yo=!1;var f=t.memoizedState;o.state=f,Eo(t,r,o,i),c=t.memoizedState,s!==r||f!==c||da.current||yo?(typeof u==`function`&&(Ls(t,n,u,r),c=t.memoizedState),(s=yo||zs(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,xo(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:Is(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=mo(c):(c=ma(n)?fa:ua.current,c=pa(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&Vs(t,o,r,c),yo=!1,f=t.memoizedState,o.state=f,Eo(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||da.current||yo?(typeof p==`function`&&(Ls(t,n,p,r),m=t.memoizedState),(l=yo||zs(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return cc(e,t,n,r,a,i)}function cc(e,t,n,r,i,a){ac(e,t);var o=!!(t.flags&128);if(!r&&!o)return i&&ya(t,n,!1),bc(e,t,a);r=t.stateNode,Qs.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=ro(t,e.child,null,a),t.child=ro(t,null,s,a)):ec(e,t,s,a),t.memoizedState=r.state,i&&ya(t,n,!0),t.child}function j(e){var t=e.stateNode;t.pendingContext?ga(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ga(e,t.context,!1),No(e,t.containerInfo)}function lc(e,t,n,r,i){return Xa(),Za(i),t.flags|=256,ec(e,t,n,r),t.child}var uc={dehydrated:null,treeContext:null,retryLane:0};function dc(e){return{baseLanes:e,cachePool:null,transitions:null}}function fc(e,t,n){var r=t.pendingProps,i=Lo.current,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(i&2)),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),ca(Lo,i&1),e===null)return Ka(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.lanes=t.mode&1?e.data===`$!`?8:1073741824:1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=hu(o,r,0,null),e=mu(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=dc(n),t.memoizedState=uc,e):pc(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return hc(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=fu(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=mu(a,o,n,null),a.flags|=2):a=fu(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?dc(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=uc,r}return a=e.child,e=a.sibling,r=fu(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function pc(e,t){return t=hu({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function mc(e,t,n,r){return r!==null&&Za(r),ro(t,e.child,null,n),e=pc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function hc(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=Ws(Error(r(422))),mc(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=hu({mode:`visible`,children:i.children},a,0,null),o=mu(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&ro(t,e.child,null,s),t.child.memoizedState=dc(s),t.memoizedState=uc,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return mc(e,t,s,null);if(a.data===`$!`){if(i=a.nextSibling&&a.nextSibling.dataset,i)var c=i.dgst;return i=c,o=Error(r(419)),i=Ws(o,i,void 0),mc(e,t,s,i)}if(c=(s&e.childLanes)!==0,$s||c){if(i=cl,i!==null){switch(s&-s){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|s))===0?a:0,a!==0&&a!==o.retryLane&&(o.retryLane=a,vo(e,a),jl(i,e,a,-1))}return Gl(),i=Ws(Error(r(421))),mc(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=iu.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,Ba=Gi(a.nextSibling),za=t,Va=!0,Ha=null,e!==null&&(Aa[ja++]=Na,Aa[ja++]=Pa,Aa[ja++]=Ma,Na=e.id,Pa=e.overflow,Ma=t),t=pc(t,i.children),t.flags|=4096,t)}function gc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),fo(e.return,t,n)}function _c(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function vc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(ec(e,t,r.children,n),r=Lo.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&gc(e,n,t);else if(e.tag===19)gc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ca(Lo,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Ro(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),_c(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ro(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}_c(t,!0,n,null,a);break;case`together`:_c(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function yc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function bc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ml|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=fu(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=fu(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function xc(e,t,n){switch(t.tag){case 3:j(t),Xa();break;case 5:Fo(t);break;case 1:ma(t.type)&&va(t);break;case 4:No(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;ca(ao,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(ca(Lo,Lo.current&1),e=bc(e,t,n),e===null?null:e.sibling):fc(e,t,n):(ca(Lo,Lo.current&1),t.flags|=128,null);ca(Lo,Lo.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return vc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ca(Lo,Lo.current),r)break;return null;case 22:case 23:return t.lanes=0,ic(e,t,n)}return bc(e,t,n)}var Sc=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Cc=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Mo(ko.current);var a=null;switch(n){case`input`:i=Te(e,i),r=Te(e,r),a=[];break;case`select`:i=de({},i,{value:void 0}),r=de({},r,{value:void 0}),a=[];break;case`textarea`:i=Ne(e,i),r=Ne(e,r),a=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=Fi)}qe(n,r);var o;for(u in n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null){if(u===`style`){var c=i[u];for(o in c)c.hasOwnProperty(o)&&(n||={},n[o]=``)}else u!==`dangerouslySetInnerHTML`&&u!==`children`&&u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&u!==`autoFocus`&&(s.hasOwnProperty(u)?a||=[]:(a||=[]).push(u,null))}for(u in r){var l=r[u];if(c=i?.[u],r.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null)){if(u===`style`){if(c){for(o in c)!c.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||={},n[o]=``);for(o in l)l.hasOwnProperty(o)&&c[o]!==l[o]&&(n||={},n[o]=l[o])}else n||(a||=[],a.push(u,n)),n=l}else u===`dangerouslySetInnerHTML`?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(a||=[]).push(u,l)):u===`children`?typeof l!=`string`&&typeof l!=`number`||(a||=[]).push(u,``+l):u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&(s.hasOwnProperty(u)?(l!=null&&u===`onScroll`&&xi(`scroll`,e),a||c===l||(a=[])):(a||=[]).push(u,l))}}n&&(a||=[]).push(`style`,n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}},wc=function(e,t,n,r){n!==r&&(t.flags|=4)};function Tc(e,t){if(!Va)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ec(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Dc(e,t,n){var i=t.pendingProps;switch(Ra(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ec(t),null;case 1:return ma(t.type)&&ha(),Ec(t),null;case 3:return i=t.stateNode,Po(),sa(da),sa(ua),Bo(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Ja(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ha!==null&&(Fl(Ha),Ha=null))),Ec(t),null;case 5:Io(t);var a=Mo(jo.current);if(n=t.type,e!==null&&t.stateNode!=null)Cc(e,t,n,i,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(r(166));return Ec(t),null}if(e=Mo(ko.current),Ja(t)){i=t.stateNode,n=t.type;var o=t.memoizedProps;switch(i[Ji]=t,i[Yi]=o,e=!!(t.mode&1),n){case`dialog`:xi(`cancel`,i),xi(`close`,i);break;case`iframe`:case`object`:case`embed`:xi(`load`,i);break;case`video`:case`audio`:for(a=0;a<_i.length;a++)xi(_i[a],i);break;case`source`:xi(`error`,i);break;case`img`:case`image`:case`link`:xi(`error`,i),xi(`load`,i);break;case`details`:xi(`toggle`,i);break;case`input`:Ee(i,o),xi(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!o.multiple},xi(`invalid`,i);break;case`textarea`:Pe(i,o),xi(`invalid`,i)}for(var c in qe(n,o),a=null,o)if(o.hasOwnProperty(c)){var l=o[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==o.suppressHydrationWarning&&Pi(i.textContent,l,e),a=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==o.suppressHydrationWarning&&Pi(i.textContent,l,e),a=[`children`,``+l]):s.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&xi(`scroll`,i)}switch(n){case`input`:Se(i),ke(i,o,!0);break;case`textarea`:Se(i),Ie(i);break;case`select`:case`option`:break;default:typeof o.onClick==`function`&&(i.onclick=Fi)}i=a,t.updateQueue=i,i!==null&&(t.flags|=4)}else{c=a.nodeType===9?a:a.ownerDocument,e===`http://www.w3.org/1999/xhtml`&&(e=Le(n)),e===`http://www.w3.org/1999/xhtml`?n===`script`?(e=c.createElement(`div`),e.innerHTML=`<script><\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[Ji]=t,e[Yi]=i,Sc(e,t,!1,!1),t.stateNode=e;a:{switch(c=Je(n,i),n){case`dialog`:xi(`cancel`,e),xi(`close`,e),a=i;break;case`iframe`:case`object`:case`embed`:xi(`load`,e),a=i;break;case`video`:case`audio`:for(a=0;a<_i.length;a++)xi(_i[a],e);a=i;break;case`source`:xi(`error`,e),a=i;break;case`img`:case`image`:case`link`:xi(`error`,e),xi(`load`,e),a=i;break;case`details`:xi(`toggle`,e),a=i;break;case`input`:Ee(e,i),a=Te(e,i),xi(`invalid`,e);break;case`option`:a=i;break;case`select`:e._wrapperState={wasMultiple:!!i.multiple},a=de({},i,{value:void 0}),xi(`invalid`,e);break;case`textarea`:Pe(e,i),a=Ne(e,i),xi(`invalid`,e);break;default:a=i}for(o in qe(n,a),l=a,l)if(l.hasOwnProperty(o)){var u=l[o];o===`style`?Ge(e,u):o===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&Be(e,u)):o===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&Ve(e,u):typeof u==`number`&&Ve(e,``+u):o!==`suppressContentEditableWarning`&&o!==`suppressHydrationWarning`&&o!==`autoFocus`&&(s.hasOwnProperty(o)?u!=null&&o===`onScroll`&&xi(`scroll`,e):u!=null&&S(e,o,u,c))}switch(n){case`input`:Se(e),ke(e,i,!1);break;case`textarea`:Se(e),Ie(e);break;case`option`:i.value!=null&&e.setAttribute(`value`,``+ye(i.value));break;case`select`:e.multiple=!!i.multiple,o=i.value,o==null?i.defaultValue!=null&&Me(e,!!i.multiple,i.defaultValue,!0):Me(e,!!i.multiple,o,!1);break;default:typeof a.onClick==`function`&&(e.onclick=Fi)}switch(n){case`button`:case`input`:case`select`:case`textarea`:i=!!i.autoFocus;break a;case`img`:i=!0;break a;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ec(t),null;case 6:if(e&&t.stateNode!=null)wc(e,t,e.memoizedProps,i);else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(n=Mo(jo.current),Mo(ko.current),Ja(t)){if(i=t.stateNode,n=t.memoizedProps,i[Ji]=t,(o=i.nodeValue!==n)&&(e=za,e!==null))switch(e.tag){case 3:Pi(i.nodeValue,n,!!(e.mode&1));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Pi(i.nodeValue,n,!!(e.mode&1))}o&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[Ji]=t,t.stateNode=i}return Ec(t),null;case 13:if(sa(Lo),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Va&&Ba!==null&&t.mode&1&&!(t.flags&128))Ya(),Xa(),t.flags|=98560,o=!1;else if(o=Ja(t),i!==null&&i.dehydrated!==null){if(e===null){if(!o)throw Error(r(318));if(o=t.memoizedState,o=o===null?null:o.dehydrated,!o)throw Error(r(317));o[Ji]=t}else Xa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ec(t),o=!1}else Ha!==null&&(Fl(Ha),Ha=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||Lo.current&1?fl===0&&(fl=3):Gl())),t.updateQueue!==null&&(t.flags|=4),Ec(t),null);case 4:return Po(),e===null&&wi(t.stateNode.containerInfo),Ec(t),null;case 10:return uo(t.type._context),Ec(t),null;case 17:return ma(t.type)&&ha(),Ec(t),null;case 19:if(sa(Lo),o=t.memoizedState,o===null)return Ec(t),null;if(i=!!(t.flags&128),c=o.rendering,c===null){if(i)Tc(o,!1);else{if(fl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=Ro(e),c!==null){for(t.flags|=128,Tc(o,!1),i=c.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)o=n,e=i,o.flags&=14680066,c=o.alternate,c===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=c.childLanes,o.lanes=c.lanes,o.child=c.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=c.memoizedProps,o.memoizedState=c.memoizedState,o.updateQueue=c.updateQueue,o.type=c.type,e=c.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ca(Lo,Lo.current&1|2),t.child}e=e.sibling}o.tail!==null&&Ot()>yl&&(t.flags|=128,i=!0,Tc(o,!1),t.lanes=4194304)}}else{if(!i){if(e=Ro(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Tc(o,!0),o.tail===null&&o.tailMode===`hidden`&&!c.alternate&&!Va)return Ec(t),null}else 2*Ot()-o.renderingStartTime>yl&&n!==1073741824&&(t.flags|=128,i=!0,Tc(o,!1),t.lanes=4194304)}o.isBackwards?(c.sibling=t.child,t.child=c):(n=o.last,n===null?t.child=c:n.sibling=c,o.last=c)}return o.tail===null?(Ec(t),null):(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ot(),t.sibling=null,n=Lo.current,ca(Lo,i?n&1|2:n&1),t);case 22:case 23:return Vl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?N&1073741824&&(Ec(t),t.subtreeFlags&6&&(t.flags|=8192)):Ec(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function Oc(e,t){switch(Ra(t),t.tag){case 1:return ma(t.type)&&ha(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Po(),sa(da),sa(ua),Bo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Io(t),null;case 13:if(sa(Lo),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Xa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return sa(Lo),null;case 4:return Po(),null;case 10:return uo(t.type._context),null;case 22:case 23:return Vl(),null;case 24:return null;default:return null}}var kc=!1,Ac=!1,jc=typeof WeakSet==`function`?WeakSet:Set,M=null;function Mc(e,t){var n=e.ref;if(n!==null){if(typeof n==`function`)try{n(null)}catch(n){tu(e,t,n)}else n.current=null}}function Nc(e,t,n){try{n()}catch(n){tu(e,t,n)}}var Pc=!1;function Fc(e,t){if(Ii=Dn,e=Jr(),Yr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Li={focusedElem:e,selectionRange:n},Dn=!1,M=t;M!==null;)if(t=M,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,M=e;else for(;M!==null;){t=M;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:Is(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){tu(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,M=e;break}M=t.return}return h=Pc,Pc=!1,h}function Ic(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Nc(t,n,a)}i=i.next}while(i!==r)}}function Lc(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Rc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function zc(e){var t=e.alternate;t!==null&&(e.alternate=null,zc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ji],delete t[Yi],delete t[Zi],delete t[Qi],delete t[$i])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Bc(e){return e.tag===5||e.tag===3||e.tag===4}function Vc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Bc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Hc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Fi));else if(r!==4&&(e=e.child,e!==null))for(Hc(e,t,n),e=e.sibling;e!==null;)Hc(e,t,n),e=e.sibling}function Uc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Uc(e,t,n),e=e.sibling;e!==null;)Uc(e,t,n),e=e.sibling}var Wc=null,Gc=!1;function Kc(e,t,n){for(n=n.child;n!==null;)qc(e,t,n),n=n.sibling}function qc(e,t,n){if(It&&typeof It.onCommitFiberUnmount==`function`)try{It.onCommitFiberUnmount(Ft,n)}catch{}switch(n.tag){case 5:Ac||Mc(n,t);case 6:var r=Wc,i=Gc;Wc=null,Kc(e,t,n),Wc=r,Gc=i,Wc!==null&&(Gc?(e=Wc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Wc.removeChild(n.stateNode));break;case 18:Wc!==null&&(Gc?(e=Wc,n=n.stateNode,e.nodeType===8?Wi(e.parentNode,n):e.nodeType===1&&Wi(e,n),Tn(e)):Wi(Wc,n.stateNode));break;case 4:r=Wc,i=Gc,Wc=n.stateNode.containerInfo,Gc=!0,Kc(e,t,n),Wc=r,Gc=i;break;case 0:case 11:case 14:case 15:if(!Ac&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Nc(n,t,o),i=i.next}while(i!==r)}Kc(e,t,n);break;case 1:if(!Ac&&(Mc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){tu(n,t,e)}Kc(e,t,n);break;case 21:Kc(e,t,n);break;case 22:n.mode&1?(Ac=(r=Ac)||n.memoizedState!==null,Kc(e,t,n),Ac=r):Kc(e,t,n);break;default:Kc(e,t,n)}}function Jc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new jc),t.forEach(function(t){var r=au.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Yc(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];try{var o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 5:Wc=c.stateNode,Gc=!1;break a;case 3:Wc=c.stateNode.containerInfo,Gc=!0;break a;case 4:Wc=c.stateNode.containerInfo,Gc=!0;break a}c=c.return}if(Wc===null)throw Error(r(160));qc(o,s,a),Wc=null,Gc=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(e){tu(a,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Xc(t,e),t=t.sibling}function Xc(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Yc(t,e),Zc(e),i&4){try{Ic(3,e,e.return),Lc(3,e)}catch(t){tu(e,e.return,t)}try{Ic(5,e,e.return)}catch(t){tu(e,e.return,t)}}break;case 1:Yc(t,e),Zc(e),i&512&&n!==null&&Mc(n,n.return);break;case 5:if(Yc(t,e),Zc(e),i&512&&n!==null&&Mc(n,n.return),e.flags&32){var a=e.stateNode;try{Ve(a,``)}catch(t){tu(e,e.return,t)}}if(i&4&&(a=e.stateNode,a!=null)){var o=e.memoizedProps,s=n===null?o:n.memoizedProps,c=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{c===`input`&&o.type===`radio`&&o.name!=null&&De(a,o),Je(c,s);var u=Je(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?Ge(a,f):d===`dangerouslySetInnerHTML`?Be(a,f):d===`children`?Ve(a,f):S(a,d,f,u)}switch(c){case`input`:Oe(a,o);break;case`textarea`:Fe(a,o);break;case`select`:var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m==null?p!==!!o.multiple&&(o.defaultValue==null?Me(a,!!o.multiple,o.multiple?[]:``,!1):Me(a,!!o.multiple,o.defaultValue,!0)):Me(a,!!o.multiple,m,!1)}a[Yi]=o}catch(t){tu(e,e.return,t)}}break;case 6:if(Yc(t,e),Zc(e),i&4){if(e.stateNode===null)throw Error(r(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){tu(e,e.return,t)}}break;case 3:if(Yc(t,e),Zc(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Tn(t.containerInfo)}catch(t){tu(e,e.return,t)}break;case 4:Yc(t,e),Zc(e);break;case 13:Yc(t,e),Zc(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(P=Ot())),i&4&&Jc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Ac=(u=Ac)||d,Yc(t,e),Ac=u):Yc(t,e),Zc(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(M=e,d=e.child;d!==null;){for(f=M=d;M!==null;){switch(p=M,m=p.child,p.tag){case 0:case 11:case 14:case 15:Ic(4,p,p.return);break;case 1:Mc(p,p.return);var h=p.stateNode;if(typeof h.componentWillUnmount==`function`){i=p,n=p.return;try{t=i,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){tu(i,n,e)}}break;case 5:Mc(p,p.return);break;case 22:if(p.memoizedState!==null){tl(f);continue}}m===null?tl(f):(m.return=p,M=m)}d=d.sibling}a:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(o=a.style,typeof o.setProperty==`function`?o.setProperty(`display`,`none`,`important`):o.display=`none`):(c=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty(`display`)?l.display:null,c.style.display=We(`display`,s))}catch(t){tu(e,e.return,t)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?``:f.memoizedProps}catch(t){tu(e,e.return,t)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break a;for(;f.sibling===null;){if(f.return===null||f.return===e)break a;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Yc(t,e),Zc(e),i&4&&Jc(e);break;case 21:break;default:Yc(t,e),Zc(e)}}function Zc(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(Bc(n)){var i=n;break a}n=n.return}throw Error(r(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(Ve(a,``),i.flags&=-33),Uc(e,Vc(e),a);break;case 3:case 4:var o=i.stateNode.containerInfo;Hc(e,Vc(e),o);break;default:throw Error(r(161))}}catch(t){tu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Qc(e,t,n){M=e,$c(e,t,n)}function $c(e,t,n){for(var r=!!(e.mode&1);M!==null;){var i=M,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||kc;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||Ac;s=kc;var l=Ac;if(kc=o,(Ac=c)&&!l)for(M=i;M!==null;)o=M,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?nl(i):(c.return=o,M=c);for(;a!==null;)M=a,$c(a,t,n),a=a.sibling;M=i,kc=s,Ac=l}el(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,M=a):el(e,t,n)}}function el(e){for(;M!==null;){var t=M;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ac||Lc(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!Ac){if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Is(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}}var o=t.updateQueue;o!==null&&Do(t,o,i);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Do(t,s,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var l=t.memoizedProps;switch(t.type){case`button`:case`input`:case`select`:case`textarea`:l.autoFocus&&n.focus();break;case`img`:l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&Tn(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Ac||t.flags&512&&Rc(t)}catch(e){tu(t,t.return,e)}}if(t===e){M=null;break}if(n=t.sibling,n!==null){n.return=t.return,M=n;break}M=t.return}}function tl(e){for(;M!==null;){var t=M;if(t===e){M=null;break}var n=t.sibling;if(n!==null){n.return=t.return,M=n;break}M=t.return}}function nl(e){for(;M!==null;){var t=M;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Lc(4,t)}catch(e){tu(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){tu(t,i,e)}}var a=t.return;try{Rc(t)}catch(e){tu(t,a,e)}break;case 5:var o=t.return;try{Rc(t)}catch(e){tu(t,o,e)}}}catch(e){tu(t,t.return,e)}if(t===e){M=null;break}var s=t.sibling;if(s!==null){s.return=t.return,M=s;break}M=t.return}}var rl=Math.ceil,il=C.ReactCurrentDispatcher,al=C.ReactCurrentOwner,ol=C.ReactCurrentBatchConfig,sl=0,cl=null,ll=null,ul=0,N=0,dl=oa(0),fl=0,pl=null,ml=0,hl=0,gl=0,_l=null,vl=null,P=0,yl=1/0,bl=null,xl=!1,Sl=null,F=null,Cl=!1,wl=null,Tl=0,El=0,Dl=null,Ol=-1,kl=0;function Al(){return sl&6?Ot():Ol===-1?Ol=Ot():Ol}function I(e){return e.mode&1?sl&2&&ul!==0?ul&-ul:Qa.transition===null?(e=en,e===0?(e=window.event,e=e===void 0?16:Nn(e.type),e):e):(kl===0&&(kl=Yt()),kl):1}function jl(e,t,n,i){if(50<El)throw El=0,Dl=null,Error(r(185));Zt(e,n,i),(!(sl&2)||e!==cl)&&(e===cl&&(!(sl&2)&&(hl|=n),fl===4&&Ll(e,ul)),Ml(e,i),n===1&&sl===0&&!(t.mode&1)&&(yl=Ot()+500,xa&&Ta()))}function Ml(e,t){var n=e.callbackNode;qt(e,t);var r=Gt(e,e===cl?ul:0);if(r===0)n!==null&&Tt(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Tt(n),t===1)e.tag===0?wa(Rl.bind(null,e)):Ca(Rl.bind(null,e)),Hi(function(){!(sl&6)&&Ta()}),n=null;else{switch(tn(r)){case 1:n=At;break;case 4:n=jt;break;case 16:n=Mt;break;case 536870912:n=Pt;break;default:n=Mt}n=su(n,Nl.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Nl(e,t){if(Ol=-1,kl=0,sl&6)throw Error(r(327));var n=e.callbackNode;if($l()&&e.callbackNode!==n)return null;var i=Gt(e,e===cl?ul:0);if(i===0)return null;if(i&30||(i&e.expiredLanes)!==0||t)t=Kl(e,i);else{t=i;var a=sl;sl|=2;var o=Wl();(cl!==e||ul!==t)&&(bl=null,yl=Ot()+500,Hl(e,t));do try{Jl();break}catch(t){Ul(e,t)}while(1);lo(),il.current=o,sl=a,ll===null?(cl=null,ul=0,t=fl):t=0}if(t!==0){if(t===2&&(a=Jt(e),a!==0&&(i=a,t=Pl(e,a))),t===1)throw n=pl,Hl(e,0),Ll(e,i),Ml(e,Ot()),n;if(t===6)Ll(e,i);else{if(a=e.current.alternate,!(i&30)&&!Il(a)&&(t=Kl(e,i),t===2&&(o=Jt(e),o!==0&&(i=o,t=Pl(e,o))),t===1))throw n=pl,Hl(e,0),Ll(e,i),Ml(e,Ot()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(r(345));case 2:Zl(e,vl,bl);break;case 3:if(Ll(e,i),(i&130023424)===i&&(t=P+500-Ot(),10<t)){if(Gt(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){Al(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=zi(Zl.bind(null,e,vl,bl),t);break}Zl(e,vl,bl);break;case 4:if(Ll(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var s=31-Rt(i);o=1<<s,s=t[s],s>a&&(a=s),i&=~o}if(i=a,i=Ot()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*rl(i/1960))-i,10<i){e.timeoutHandle=zi(Zl.bind(null,e,vl,bl),i);break}Zl(e,vl,bl);break;case 5:Zl(e,vl,bl);break;default:throw Error(r(329))}}}return Ml(e,Ot()),e.callbackNode===n?Nl.bind(null,e):null}function Pl(e,t){var n=_l;return e.current.memoizedState.isDehydrated&&(Hl(e,t).flags|=256),e=Kl(e,t),e!==2&&(t=vl,vl=n,t!==null&&Fl(t)),e}function Fl(e){vl===null?vl=e:vl.push.apply(vl,e)}function Il(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Ur(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ll(e,t){for(t&=~gl,t&=~hl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Rt(t),r=1<<n;e[n]=-1,t&=~r}}function Rl(e){if(sl&6)throw Error(r(327));$l();var t=Gt(e,0);if(!(t&1))return Ml(e,Ot()),null;var n=Kl(e,t);if(e.tag!==0&&n===2){var i=Jt(e);i!==0&&(t=i,n=Pl(e,i))}if(n===1)throw n=pl,Hl(e,0),Ll(e,t),Ml(e,Ot()),n;if(n===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Zl(e,vl,bl),Ml(e,Ot()),null}function zl(e,t){var n=sl;sl|=1;try{return e(t)}finally{sl=n,sl===0&&(yl=Ot()+500,xa&&Ta())}}function Bl(e){wl!==null&&wl.tag===0&&!(sl&6)&&$l();var t=sl;sl|=1;var n=ol.transition,r=en;try{if(ol.transition=null,en=1,e)return e()}finally{en=r,ol.transition=n,sl=t,!(sl&6)&&Ta()}}function Vl(){N=dl.current,sa(dl)}function Hl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Bi(n)),ll!==null)for(n=ll.return;n!==null;){var r=n;switch(Ra(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ha();break;case 3:Po(),sa(da),sa(ua),Bo();break;case 5:Io(r);break;case 4:Po();break;case 13:sa(Lo);break;case 19:sa(Lo);break;case 10:uo(r.type._context);break;case 22:case 23:Vl()}n=n.return}if(cl=e,ll=e=fu(e.current,null),ul=N=t,fl=0,pl=null,gl=hl=ml=0,vl=_l=null,ho!==null){for(t=0;t<ho.length;t++)if(n=ho[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}ho=null}return e}function Ul(e,t){do{var n=ll;try{if(lo(),Vo.current=Ms,Go){for(var i=k.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Go=!1}if(Ho=0,Wo=Uo=k=null,Ko=!1,qo=0,al.current=null,n===null||n.return===null){fl=1,pl=t,ll=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=ul,c.flags|=32768,typeof l==`object`&&l&&typeof l.then==`function`){var u=l,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Xs(s);if(m!==null){m.flags&=-257,Zs(m,s,c,o,t),m.mode&1&&Ys(o,u,t),t=m,l=u;var h=t.updateQueue;if(h===null){var g=new Set;g.add(l),t.updateQueue=g}else h.add(l);break a}if(!(t&1)){Ys(o,u,t),Gl();break a}l=Error(r(426))}else if(Va&&c.mode&1){var _=Xs(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Zs(_,s,c,o,t),Za(Us(l,c));break a}}o=l=Us(l,c),fl!==4&&(fl=2),_l===null?_l=[o]:_l.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=qs(o,l,t);To(o,v);break a;case 1:c=l;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError==`function`||b!==null&&typeof b.componentDidCatch==`function`&&(F===null||!F.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=Js(o,c,t);To(o,x);break a}}o=o.return}while(o!==null)}Xl(n)}catch(e){t=e,ll===n&&n!==null&&(ll=n=n.return);continue}break}while(1)}function Wl(){var e=il.current;return il.current=Ms,e===null?Ms:e}function Gl(){(fl===0||fl===3||fl===2)&&(fl=4),cl===null||!(ml&268435455)&&!(hl&268435455)||Ll(cl,ul)}function Kl(e,t){var n=sl;sl|=2;var i=Wl();(cl!==e||ul!==t)&&(bl=null,Hl(e,t));do try{ql();break}catch(t){Ul(e,t)}while(1);if(lo(),sl=n,il.current=i,ll!==null)throw Error(r(261));return cl=null,ul=0,fl}function ql(){for(;ll!==null;)Yl(ll)}function Jl(){for(;ll!==null&&!Et();)Yl(ll)}function Yl(e){var t=ou(e.alternate,e,N);e.memoizedProps=e.pendingProps,t===null?Xl(e):ll=t,al.current=null}function Xl(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Oc(n,t),n!==null){n.flags&=32767,ll=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{fl=6,ll=null;return}}else if(n=Dc(n,t,N),n!==null){ll=n;return}if(t=t.sibling,t!==null){ll=t;return}ll=t=e}while(t!==null);fl===0&&(fl=5)}function Zl(e,t,n){var r=en,i=ol.transition;try{ol.transition=null,en=1,Ql(e,t,n,r)}finally{ol.transition=i,en=r}return null}function Ql(e,t,n,i){do $l();while(wl!==null);if(sl&6)throw Error(r(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Qt(e,o),e===cl&&(ll=cl=null,ul=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Cl||(Cl=!0,su(Mt,function(){return $l(),null})),o=!!(n.flags&15990),n.subtreeFlags&15990||o){o=ol.transition,ol.transition=null;var s=en;en=1;var c=sl;sl|=4,al.current=null,Fc(e,n),Xc(n,e),Xr(Li),Dn=!!Ii,Li=Ii=null,e.current=n,Qc(n,e,a),Dt(),sl=c,en=s,ol.transition=o}else e.current=n;if(Cl&&(Cl=!1,wl=e,Tl=a),o=e.pendingLanes,o===0&&(F=null),Lt(n.stateNode,i),Ml(e,Ot()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],i(a.value,{componentStack:a.stack,digest:a.digest});if(xl)throw xl=!1,e=Sl,Sl=null,e;return Tl&1&&e.tag!==0&&$l(),o=e.pendingLanes,o&1?e===Dl?El++:(El=0,Dl=e):El=0,Ta(),null}function $l(){if(wl!==null){var e=tn(Tl),t=ol.transition,n=en;try{if(ol.transition=null,en=16>e?16:e,wl===null)var i=!1;else{if(e=wl,wl=null,Tl=0,sl&6)throw Error(r(331));var a=sl;for(sl|=4,M=e.current;M!==null;){var o=M,s=o.child;if(M.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(M=u;M!==null;){var d=M;switch(d.tag){case 0:case 11:case 15:Ic(8,d,o)}var f=d.child;if(f!==null)f.return=d,M=f;else for(;M!==null;){d=M;var p=d.sibling,m=d.return;if(zc(d),d===u){M=null;break}if(p!==null){p.return=m,M=p;break}M=m}}}var h=o.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}M=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,M=s;else b:for(;M!==null;){if(o=M,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Ic(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,M=v;break b}M=o.return}}var y=e.current;for(M=y;M!==null;){s=M;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,M=b;else b:for(s=y;M!==null;){if(c=M,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:Lc(9,c)}}catch(e){tu(c,c.return,e)}if(c===s){M=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,M=x;break b}M=c.return}}if(sl=a,Ta(),It&&typeof It.onPostCommitFiberRoot==`function`)try{It.onPostCommitFiberRoot(Ft,e)}catch{}i=!0}return i}finally{en=n,ol.transition=t}}return!1}function eu(e,t,n){t=Us(n,t),t=qs(e,t,1),e=Co(e,t,1),t=Al(),e!==null&&(Zt(e,1,t),Ml(e,t))}function tu(e,t,n){if(e.tag===3)eu(e,e,n);else for(;t!==null;){if(t.tag===3){eu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(F===null||!F.has(r))){e=Us(n,e),e=Js(t,e,1),t=Co(t,e,1),e=Al(),t!==null&&(Zt(t,1,e),Ml(t,e));break}}t=t.return}}function nu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Al(),e.pingedLanes|=e.suspendedLanes&n,cl===e&&(ul&n)===n&&(fl===4||fl===3&&(ul&130023424)===ul&&500>Ot()-P?Hl(e,0):gl|=n),Ml(e,t)}function ru(e,t){t===0&&(e.mode&1?(t=Ut,Ut<<=1,!(Ut&130023424)&&(Ut=4194304)):t=1);var n=Al();e=vo(e,t),e!==null&&(Zt(e,t,n),Ml(e,n))}function iu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ru(e,n)}function au(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),ru(e,n)}var ou=function(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps||da.current)$s=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return $s=!1,xc(e,t,n);$s=!!(e.flags&131072)}}else $s=!1,Va&&t.flags&1048576&&Ia(t,ka,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;yc(e,t),e=t.pendingProps;var a=pa(t,ua.current);po(t,n),a=Zo(null,t,i,e,a,n);var o=Qo();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ma(i)?(o=!0,va(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,bo(t),a.updater=Rs,t.stateNode=a,a._reactInternals=t,Hs(t,i,e,n),t=cc(null,t,i,!0,o,n)):(t.tag=0,Va&&o&&La(t),ec(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(yc(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=du(i),e=Is(i,e),a){case 0:t=oc(null,t,i,e,n);break a;case 1:t=sc(null,t,i,e,n);break a;case 11:t=tc(null,t,i,e,n);break a;case 14:t=nc(null,t,i,Is(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Is(i,a),oc(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Is(i,a),sc(e,t,i,a,n);case 3:a:{if(j(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,xo(e,t),Eo(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated){if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Us(Error(r(423)),t),t=lc(e,t,i,n,a);break a}if(i!==a){a=Us(Error(r(424)),t),t=lc(e,t,i,n,a);break a}for(Ba=Gi(t.stateNode.containerInfo.firstChild),za=t,Va=!0,Ha=null,n=io(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Xa(),i===a){t=bc(e,t,n);break a}ec(e,t,i,n)}t=t.child}return t;case 5:return Fo(t),e===null&&Ka(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,Ri(i,a)?s=null:o!==null&&Ri(i,o)&&(t.flags|=32),ac(e,t),ec(e,t,s,n),t.child;case 6:return e===null&&Ka(t),null;case 13:return fc(e,t,n);case 4:return No(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=ro(t,null,i,n):ec(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Is(i,a),tc(e,t,i,a,n);case 7:return ec(e,t,t.pendingProps,n),t.child;case 8:return ec(e,t,t.pendingProps.children,n),t.child;case 12:return ec(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,ca(ao,i._currentValue),i._currentValue=s,o!==null){if(Ur(o.value,s)){if(o.children===a.children&&!da.current){t=bc(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=So(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),fo(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),fo(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}}ec(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,po(t,n),a=mo(a),i=i(a),t.flags|=1,ec(e,t,i,n),t.child;case 14:return i=t.type,a=Is(i,t.pendingProps),a=Is(i.type,a),nc(e,t,i,a,n);case 15:return rc(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Is(i,a),yc(e,t),t.tag=1,ma(i)?(e=!0,va(t)):e=!1,po(t,n),Bs(t,i,a),Hs(t,i,a,n),cc(null,t,i,!0,e,n);case 19:return vc(e,t,n);case 22:return ic(e,t,n)}throw Error(r(156,t.tag))};function su(e,t){return wt(e,t)}function cu(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function lu(e,t,n,r){return new cu(e,t,n,r)}function uu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function du(e){if(typeof e==`function`)return+!!uu(e);if(e!=null){if(e=e.$$typeof,e===re)return 11;if(e===oe)return 14}return 2}function fu(e,t){var n=e.alternate;return n===null?(n=lu(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function pu(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)uu(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return mu(n.children,a,o,t);case D:s=8,a|=8;break;case ee:return e=lu(12,n,t,a|2),e.elementType=ee,e.lanes=o,e;case ie:return e=lu(13,n,t,a),e.elementType=ie,e.lanes=o,e;case ae:return e=lu(19,n,t,a),e.elementType=ae,e.lanes=o,e;case ce:return hu(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case te:s=10;break a;case ne:s=9;break a;case re:s=11;break a;case oe:s=14;break a;case se:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=lu(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function mu(e,t,n,r){return e=lu(7,e,r,t),e.lanes=n,e}function hu(e,t,n,r){return e=lu(22,e,r,t),e.elementType=ce,e.lanes=n,e.stateNode={isHidden:!1},e}function gu(e,t,n){return e=lu(6,e,null,t),e.lanes=n,e}function L(e,t,n){return t=lu(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function _u(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Xt(0),this.expirationTimes=Xt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function vu(e,t,n,r,i,a,o,s,c){return e=new _u(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=lu(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},bo(a),e}function yu(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}function bu(e){if(!e)return la;e=e._reactInternals;a:{if(vt(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break a;case 1:if(ma(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break a}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var n=e.type;if(ma(n))return _a(e,n,t)}return t}function xu(e,t,n,r,i,a,o,s,c){return e=vu(n,r,!0,e,i,a,o,s,c),e.context=bu(null),n=e.current,r=Al(),i=I(n),a=So(r,i),a.callback=t??null,Co(n,a,i),e.current.lanes=i,Zt(e,i,r),Ml(e,r),e}function Su(e,t,n,r){var i=t.current,a=Al(),o=I(i);return n=bu(n),t.context===null?t.context=n:t.pendingContext=n,t=So(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Co(i,t,o),e!==null&&(jl(e,i,o,a),wo(e,i,o)),o}function Cu(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function wu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Tu(e,t){wu(e,t),(e=e.alternate)&&wu(e,t)}function Eu(){return null}var Du=typeof reportError==`function`?reportError:function(e){console.error(e)};function Ou(e){this._internalRoot=e}ku.prototype.render=Ou.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));Su(e,t,null,null)},ku.prototype.unmount=Ou.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Bl(function(){Su(null,e,null,null)}),t[Xi]=null}};function ku(e){this._internalRoot=e}ku.prototype.unstable_scheduleHydration=function(e){if(e){var t=on();e={blockedOn:null,target:e,priority:t};for(var n=0;n<hn.length&&t!==0&&t<hn[n].priority;n++);hn.splice(n,0,e),n===0&&bn(e)}};function Au(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ju(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==` react-mount-point-unstable `))}function Mu(){}function Nu(e,t,n,r,i){if(i){if(typeof r==`function`){var a=r;r=function(){var e=Cu(o);a.call(e)}}var o=xu(t,r,e,0,null,!1,!1,``,Mu);return e._reactRootContainer=o,e[Xi]=o.current,wi(e.nodeType===8?e.parentNode:e),Bl(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r==`function`){var s=r;r=function(){var e=Cu(c);s.call(e)}}var c=vu(e,0,!1,null,null,!1,!1,``,Mu);return e._reactRootContainer=c,e[Xi]=c.current,wi(e.nodeType===8?e.parentNode:e),Bl(function(){Su(t,c,n,r)}),c}function Pu(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i==`function`){var s=i;i=function(){var e=Cu(o);s.call(e)}}Su(t,o,e,i)}else o=Nu(n,t,e,i,r);return Cu(o)}nn=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Wt(t.pendingLanes);n!==0&&($t(t,n|1),Ml(t,Ot()),!(sl&6)&&(yl=Ot()+500,Ta()))}break;case 13:Bl(function(){var t=vo(e,1);t!==null&&jl(t,e,1,Al())}),Tu(e,1)}},rn=function(e){if(e.tag===13){var t=vo(e,134217728);t!==null&&jl(t,e,134217728,Al()),Tu(e,134217728)}},an=function(e){if(e.tag===13){var t=I(e),n=vo(e,t);n!==null&&jl(n,e,t,Al()),Tu(e,t)}},on=function(){return en},sn=function(e,t){var n=en;try{return en=e,t()}finally{en=n}},Ze=function(e,t,n){switch(t){case`input`:if(Oe(e,n),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name=`+JSON.stringify(``+t)+`][type="radio"]`),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=ra(i);if(!a)throw Error(r(90));Ce(i),Oe(i,a)}}}break;case`textarea`:Fe(e,n);break;case`select`:t=n.value,t!=null&&Me(e,!!n.multiple,t,!1)}},rt=zl,it=Bl;var Fu={usingClientEntryPoint:!1,Events:[ta,na,ra,tt,nt,zl]},Iu={findFiberByHostInstance:ea,bundleType:0,version:`18.3.1`,rendererPackageName:`react-dom`},Lu={bundleType:Iu.bundleType,version:Iu.version,rendererPackageName:Iu.rendererPackageName,rendererConfig:Iu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=St(e),e===null?null:e.stateNode},findFiberByHostInstance:Iu.findFiberByHostInstance||Eu,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:`18.3.1-next-f1338f8080-20240426`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Ru=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ru.isDisabled&&Ru.supportsFiber)try{Ft=Ru.inject(Lu),It=Ru}catch{}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Fu,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Au(t))throw Error(r(200));return yu(e,t,null,n)},e.createRoot=function(e,t){if(!Au(e))throw Error(r(299));var n=!1,i=``,a=Du;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=vu(e,1,!1,null,null,n,!1,i,a),e[Xi]=t.current,wi(e.nodeType===8?e.parentNode:e),new Ou(t)},e.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(r(188)):(e=Object.keys(e).join(`,`),Error(r(268,e)));return e=St(t),e=e===null?null:e.stateNode,e},e.flushSync=function(e){return Bl(e)},e.hydrate=function(e,t,n){if(!ju(t))throw Error(r(200));return Pu(null,e,t,!0,n)},e.hydrateRoot=function(e,t,n){if(!Au(e))throw Error(r(405));var i=n!=null&&n.hydratedSources||null,a=!1,o=``,s=Du;if(n!=null&&(!0===n.unstable_strictMode&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=xu(t,null,e,1,n??null,a,!1,o,s),e[Xi]=t.current,wi(e),i)for(e=0;e<i.length;e++)n=i[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new ku(t)},e.render=function(e,t,n){if(!ju(t))throw Error(r(200));return Pu(null,e,t,!1,n)},e.unmountComponentAtNode=function(e){if(!ju(e))throw Error(r(40));return e._reactRootContainer?(Bl(function(){Pu(null,null,e,!1,function(){e._reactRootContainer=null,e[Xi]=null})}),!0):!1},e.unstable_batchedUpdates=zl,e.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!ju(n))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return Pu(e,t,n,!1,i)},e.version=`18.3.1-next-f1338f8080-20240426`})),c=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=s()})),l=n((e=>{var t=c();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),u=e(i(),1),d=l(),f={VITE_APP_BACKEND_V2_GET_URL:`https://json.excalidraw.com/api/v2/`,VITE_APP_BACKEND_V2_POST_URL:`https://json.excalidraw.com/api/v2/post/`,VITE_APP_LIBRARY_URL:`https://libraries.excalidraw.com`,VITE_APP_LIBRARY_BACKEND:`https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries`,VITE_APP_PLUS_LP:`https://plus.excalidraw.com`,VITE_APP_PLUS_APP:`https://app.excalidraw.com`,VITE_APP_AI_BACKEND:`https://oss-ai.excalidraw.com`,VITE_APP_WS_SERVER_URL:`https://oss-collab.excalidraw.com`,VITE_APP_FIREBASE_CONFIG:`{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}`,VITE_APP_ENABLE_TRACKING:`false`,VITE_APP_PLUS_EXPORT_PUBLIC_KEY:`MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApQ0jM9Qz8TdFLzcuAZZX
|
|
10
|
+
/WvuKSOJxiw6AR/ZcE3eFQWM/mbFdhQgyK8eHGkKQifKzH1xUZjCxyXcxW6ZO02t
|
|
11
|
+
kPOPxhz+nxUrIoWCD/V4NGmUA1lxwHuO21HN1gzKrN3xHg5EGjyouR9vibT9VDGF
|
|
12
|
+
gq6+4Ic/kJX+AD2MM7Yre2+FsOdysrmuW2Fu3ahuC1uQE7pOe1j0k7auNP0y1q53
|
|
13
|
+
PrB8Ts2LUpepWC1l7zIXFm4ViDULuyWXTEpUcHSsEH8vpd1tckjypxCwkipfZsXx
|
|
14
|
+
iPszy0o0Dx2iArPfWMXlFAI9mvyFCyFC3+nSvfyAUb2C4uZgCwAuyFh/ydPF4DEE
|
|
15
|
+
PQIDAQAB`,VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX:`false`,VITE_APP_COLLAPSE_OVERLAY:`false`,VITE_APP_ENABLE_ESLINT:`false`,PKG_NAME:`@excalidraw/excalidraw`,PKG_VERSION:`0.18.1`,PROD:!0},p=Object.defineProperty,m=(e,t,n)=>t in e?p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,h=(e=>typeof t<`u`?t:typeof Proxy<`u`?new Proxy(e,{get:(e,n)=>(typeof t<`u`?t:e)[n]}):e)(function(e){if(typeof t<`u`)return t.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),g=e=>t=>{var n=e[t];if(n)return n();throw Error(`Module not found in bundle: `+t)},_=(e,t)=>{for(var n in t)p(e,n,{get:t[n],enumerable:!0})},v=(e,t,n)=>(m(e,typeof t==`symbol`?t:t+``,n),n),y=n((e=>{(function(t){typeof DO_NOT_EXPORT_CRC>`u`?typeof e==`object`?t(e):typeof define==`function`&&define.amd?define(function(){var e={};return t(e),e}):t({}):t({})})(function(e){e.version=`0.3.0`;function t(){for(var e=0,t=Array(256),n=0;n!=256;++n)e=n,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,t[n]=e;return typeof Int32Array<`u`?new Int32Array(t):t}var n=t(),r=typeof Buffer<`u`;function i(e){if(e.length>32768&&r)return o(new Buffer(e));for(var t=-1,i=e.length-1,a=0;a<i;)t=n[(t^e.charCodeAt(a++))&255]^t>>>8,t=n[(t^e.charCodeAt(a++))&255]^t>>>8;return a===i&&(t=t>>>8^n[(t^e.charCodeAt(a))&255]),t^-1}function a(e){if(e.length>1e4)return o(e);for(var t=-1,r=0,i=e.length-3;r<i;)t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255];for(;r<i+3;)t=t>>>8^n[(t^e[r++])&255];return t^-1}function o(e){for(var t=-1,r=0,i=e.length-7;r<i;)t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255],t=t>>>8^n[(t^e[r++])&255];for(;r<i+7;)t=t>>>8^n[(t^e[r++])&255];return t^-1}function s(e){for(var t=-1,r=0,i=e.length,a,o;r<i;)a=e.charCodeAt(r++),a<128?t=t>>>8^n[(t^a)&255]:a<2048?(t=t>>>8^n[(t^(192|a>>6&31))&255],t=t>>>8^n[(t^(128|a&63))&255]):a>=55296&&a<57344?(a=(a&1023)+64,o=e.charCodeAt(r++)&1023,t=t>>>8^n[(t^(240|a>>8&7))&255],t=t>>>8^n[(t^(128|a>>2&63))&255],t=t>>>8^n[(t^(128|o>>6&15|a&3))&255],t=t>>>8^n[(t^(128|o&63))&255]):(t=t>>>8^n[(t^(224|a>>12&15))&255],t=t>>>8^n[(t^(128|a>>6&63))&255],t=t>>>8^n[(t^(128|a&63))&255]);return t^-1}e.table=n,e.bstr=i,e.buf=a,e.str=s})})),b=n(((e,t)=>{var n=y();t.exports=o;var r=new Uint8Array(4),i=new Int32Array(r.buffer),a=new Uint32Array(r.buffer);function o(e){if(e[0]!==137||e[1]!==80||e[2]!==78||e[3]!==71)throw Error(`Invalid .png file header`);if(e[4]!==13||e[5]!==10)throw Error(`Invalid .png file header: possibly caused by DOS-Unix line ending conversion?`);if(e[6]!==26)throw Error(`Invalid .png file header`);if(e[7]!==10)throw Error(`Invalid .png file header: possibly caused by DOS-Unix line ending conversion?`);for(var t=!1,o=[],s=8;s<e.length;){r[3]=e[s++],r[2]=e[s++],r[1]=e[s++],r[0]=e[s++];var c=a[0]+4,l=new Uint8Array(c);l[0]=e[s++],l[1]=e[s++],l[2]=e[s++],l[3]=e[s++];var u=String.fromCharCode(l[0])+String.fromCharCode(l[1])+String.fromCharCode(l[2])+String.fromCharCode(l[3]);if(!o.length&&u!==`IHDR`)throw Error(`IHDR header missing`);if(u===`IEND`){t=!0,o.push({name:u,data:new Uint8Array});break}for(var d=4;d<c;d++)l[d]=e[s++];r[3]=e[s++],r[2]=e[s++],r[1]=e[s++],r[0]=e[s++];var f=i[0];if(n.buf(l)!==f)throw Error(`CRC values for `+u+` header do not match, PNG file is likely corrupted`);var p=new Uint8Array(l.buffer.slice(4));o.push({name:u,data:p})}if(!t)throw Error(`.png file ended prematurely: no IEND header was found`);return o}})),x=n(((e,t)=>{t.exports=n;function n(e,t){if(e=String(e),t=String(t),!/^[\x00-\xFF]+$/.test(e)||!/^[\x00-\xFF]+$/.test(t))throw Error(`Only Latin-1 characters are permitted in PNG tEXt chunks. You might want to consider base64 encoding and/or zEXt compression`);if(e.length>=80)throw Error(`Keyword "`+e+`" is longer than the 79-character limit imposed by the PNG specification`);for(var n=e.length+t.length+1,r=new Uint8Array(n),i=0,a,o=0;o<e.length;o++){if(!(a=e.charCodeAt(o)))throw Error(`0x00 character is not permitted in tEXt keywords`);r[i++]=a}r[i++]=0;for(var s=0;s<t.length;s++){if(!(a=t.charCodeAt(s)))throw Error(`0x00 character is not permitted in tEXt content`);r[i++]=a}return{name:`tEXt`,data:r}}})),S=n(((e,t)=>{t.exports=n;function n(e){e.data&&e.name&&(e=e.data);for(var t=!0,n=``,r=``,i=0;i<e.length;i++){var a=e[i];if(t)a?r+=String.fromCharCode(a):t=!1;else if(a)n+=String.fromCharCode(a);else throw Error(`Invalid NULL character found. 0x00 character is not permitted in tEXt content`)}return{keyword:r,text:n}}})),C=n((e=>{e.encode=x(),e.decode=S()})),w=n(((e,t)=>{t.exports=function(e,t,n){var r=[],i=e.length;if(i===0)return r;var a=t<0?Math.max(0,t+i):t||0;for(n!==void 0&&(i=n<0?n+i:n);i-->a;)r[i-a]=e[i];return r}})),T=n(((e,t)=>{var n=w(),r=y();t.exports=s;var i=new Uint8Array(4),a=new Int32Array(i.buffer),o=new Uint32Array(i.buffer);function s(e){var t=8,s=t,c;for(c=0;c<e.length;c++)t+=e[c].data.length,t+=12;var l=new Uint8Array(t);for(l[0]=137,l[1]=80,l[2]=78,l[3]=71,l[4]=13,l[5]=10,l[6]=26,l[7]=10,c=0;c<e.length;c++){var u=e[c],d=u.name,f=u.data,p=f.length,m=[d.charCodeAt(0),d.charCodeAt(1),d.charCodeAt(2),d.charCodeAt(3)];o[0]=p,l[s++]=i[3],l[s++]=i[2],l[s++]=i[1],l[s++]=i[0],l[s++]=m[0],l[s++]=m[1],l[s++]=m[2],l[s++]=m[3];for(var h=0;h<p;)l[s++]=f[h++];var g=m.concat(n(f));a[0]=r.buf(g),l[s++]=i[3],l[s++]=i[2],l[s++]=i[1],l[s++]=i[0]}return l}})),E=e(b(),1),D=e(C(),1),ee=e(T(),1),te=4,ne=0,re=1,ie=2;function ae(e){let t=e.length;for(;--t>=0;)e[t]=0}var oe=29,se=256,ce=286,le=30,ue=19,de=573,fe=15,pe=16,me=7,he=256,ge=16,_e=17,ve=18,ye=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]),be=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]),xe=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Se=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ce=512,we=Array(576);ae(we);var Te=Array(60);ae(Te);var Ee=Array(Ce);ae(Ee);var De=Array(256);ae(De);var Oe=Array(oe);ae(Oe);var ke=Array(le);ae(ke);function Ae(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}var je,Me,Ne;function Pe(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}var Fe=e=>e<256?Ee[e]:Ee[256+(e>>>7)],Ie=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},Le=(e,t,n)=>{e.bi_valid>pe-n?(e.bi_buf|=t<<e.bi_valid&65535,Ie(e,e.bi_buf),e.bi_buf=t>>pe-e.bi_valid,e.bi_valid+=n-pe):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},Re=(e,t,n)=>{Le(e,n[t*2],n[t*2+1])},ze=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},Be=e=>{e.bi_valid===16?(Ie(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)},Ve=(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<=fe;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<de;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--)}},He=(e,t,n)=>{let r=Array(16),i=0,a,o;for(a=1;a<=fe;a++)r[a]=i=i+n[a-1]<<1;for(o=0;o<=t;o++){let t=e[o*2+1];t!==0&&(e[o*2]=ze(r[t]++,t))}},Ue=()=>{let e,t,n,r,i,a=Array(16);for(n=0,r=0;r<28;r++)for(Oe[r]=n,e=0;e<1<<ye[r];e++)De[n++]=r;for(De[n-1]=r,i=0,r=0;r<16;r++)for(ke[r]=i,e=0;e<1<<be[r];e++)Ee[i++]=r;for(i>>=7;r<le;r++)for(ke[r]=i<<7,e=0;e<1<<be[r]-7;e++)Ee[256+i++]=r;for(t=0;t<=fe;t++)a[t]=0;for(e=0;e<=143;)we[e*2+1]=8,e++,a[8]++;for(;e<=255;)we[e*2+1]=9,e++,a[9]++;for(;e<=279;)we[e*2+1]=7,e++,a[7]++;for(;e<=287;)we[e*2+1]=8,e++,a[8]++;for(He(we,287,a),e=0;e<le;e++)Te[e*2+1]=5,Te[e*2]=ze(e,5);je=new Ae(we,ye,257,ce,fe),Me=new Ae(Te,be,0,le,fe),Ne=new Ae([],xe,0,ue,me)},We=e=>{let t;for(t=0;t<ce;t++)e.dyn_ltree[t*2]=0;for(t=0;t<le;t++)e.dyn_dtree[t*2]=0;for(t=0;t<ue;t++)e.bl_tree[t*2]=0;e.dyn_ltree[he*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0},Ge=e=>{e.bi_valid>8?Ie(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Ke=(e,t,n,r)=>{Ge(e),r&&(Ie(e,n),Ie(e,~n)),e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},qe=(e,t,n,r)=>{let i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]},Je=(e,t,n)=>{let r=e.heap[n],i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&qe(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!qe(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},Ye=(e,t,n)=>{let r,i,a=0,o,s;if(e.last_lit!==0)do r=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1],i=e.pending_buf[e.l_buf+a],a++,r===0?Re(e,i,t):(o=De[i],Re(e,o+se+1,t),s=ye[o],s!==0&&(i-=Oe[o],Le(e,i,s)),r--,o=Fe(r),Re(e,o,n),s=be[o],s!==0&&(r-=ke[o],Le(e,r,s)));while(a<e.last_lit);Re(e,he,t)},Xe=(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=de,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--)Je(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Je(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++,Je(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Ve(e,t),He(n,c,e.bl_count)},Ze=(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))},Qe=(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 Re(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(Re(e,_e,e.bl_tree),Le(e,s-3,3)):(Re(e,ve,e.bl_tree),Le(e,s-11,7)):(a!==i&&(Re(e,a,e.bl_tree),s--),Re(e,ge,e.bl_tree),Le(e,s-3,2));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}},$e=e=>{let t;for(Ze(e,e.dyn_ltree,e.l_desc.max_code),Ze(e,e.dyn_dtree,e.d_desc.max_code),Xe(e,e.bl_desc),t=18;t>=3&&e.bl_tree[Se[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},et=(e,t,n,r)=>{let i;for(Le(e,t-257,5),Le(e,n-1,5),Le(e,r-4,4),i=0;i<r;i++)Le(e,e.bl_tree[Se[i]*2+1],3);Qe(e,e.dyn_ltree,t-1),Qe(e,e.dyn_dtree,n-1)},tt=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return ne;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return re;for(n=32;n<se;n++)if(e.dyn_ltree[n*2]!==0)return re;return ne},nt=!1,rt=e=>{nt||=(Ue(),!0),e.l_desc=new Pe(e.dyn_ltree,je),e.d_desc=new Pe(e.dyn_dtree,Me),e.bl_desc=new Pe(e.bl_tree,Ne),e.bi_buf=0,e.bi_valid=0,We(e)},it=(e,t,n,r)=>{Le(e,0+ +!!r,3),Ke(e,t,n,!0)},at={_tr_init:rt,_tr_stored_block:it,_tr_flush_block:(e,t,n,r)=>{let i,a,o=0;e.level>0?(e.strm.data_type===ie&&(e.strm.data_type=tt(e)),Xe(e,e.l_desc),Xe(e,e.d_desc),o=$e(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?it(e,t,n,r):e.strategy===te||a===i?(Le(e,2+ +!!r,3),Ye(e,we,Te)):(Le(e,4+ +!!r,3),et(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),Ye(e,e.dyn_ltree,e.dyn_dtree)),We(e),r&&Ge(e)},_tr_tally:(e,t,n)=>(e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(De[n]+se+1)*2]++,e.dyn_dtree[Fe(t)*2]++),e.last_lit===e.lit_bufsize-1),_tr_align:e=>{Le(e,2,3),Re(e,he,we),Be(e)}},ot=(e,t,n,r)=>{let i=e&65535|0,a=e>>>16&65535|0,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|0},st=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})()),ct=(e,t,n,r)=>{let i=st,a=r+n;e^=-1;for(let n=r;n<a;n++)e=e>>>8^i[(e^t[n])&255];return e^-1},lt={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`},ut={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},{_tr_init:dt,_tr_stored_block:ft,_tr_flush_block:pt,_tr_tally:mt,_tr_align:ht}=at,{Z_NO_FLUSH:gt,Z_PARTIAL_FLUSH:_t,Z_FULL_FLUSH:vt,Z_FINISH:yt,Z_BLOCK:bt,Z_OK:xt,Z_STREAM_END:St,Z_STREAM_ERROR:Ct,Z_DATA_ERROR:wt,Z_BUF_ERROR:Tt,Z_DEFAULT_COMPRESSION:Et,Z_FILTERED:Dt,Z_HUFFMAN_ONLY:Ot,Z_RLE:kt,Z_FIXED:At,Z_DEFAULT_STRATEGY:jt,Z_UNKNOWN:Mt,Z_DEFLATED:Nt}=ut,Pt=9,Ft=15,It=8,Lt=573,Rt=3,zt=258,Bt=262,Vt=32,Ht=42,Ut=69,Wt=73,Gt=91,Kt=103,qt=113,Jt=666,Yt=1,Xt=2,Zt=3,Qt=4,$t=3,en=(e,t)=>(e.msg=lt[t],t),tn=e=>(e<<1)-(e>4?9:0),nn=e=>{let t=e.length;for(;--t>=0;)e[t]=0},rn=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,an=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))},on=(e,t)=>{pt(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,an(e.strm)},sn=(e,t)=>{e.pending_buf[e.pending++]=t},cn=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},ln=(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=ot(e.adler,t,i,n):e.state.wrap===2&&(e.adler=ct(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},un=(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-Bt?e.strstart-(e.w_size-Bt):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+zt,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=zt-(f-r),r=f-zt,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},dn=e=>{let t=e.w_size,n,r,i,a,o;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Bt)){e.window.set(e.window.subarray(t,t+t),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,r=e.hash_size,n=r;do i=e.head[--n],e.head[n]=i>=t?i-t:0;while(--r);r=t,n=r;do i=e.prev[--n],e.prev[n]=i>=t?i-t:0;while(--r);a+=t}if(e.strm.avail_in===0)break;if(r=ln(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=r,e.lookahead+e.insert>=Rt)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=rn(e,e.ins_h,e.window[o+1]);e.insert&&(e.ins_h=rn(e,e.ins_h,e.window[o+Rt-1]),e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<Rt)););}while(e.lookahead<Bt&&e.strm.avail_in!==0)},fn=(e,t)=>{let n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(dn(e),e.lookahead===0&&t===gt)return Yt;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;let r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,on(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-Bt&&(on(e,!1),e.strm.avail_out===0))return Yt}return e.insert=0,t===yt?(on(e,!0),e.strm.avail_out===0?Zt:Qt):(e.strstart>e.block_start&&(on(e,!1),e.strm.avail_out),Yt)},pn=(e,t)=>{let n,r;for(;;){if(e.lookahead<Bt){if(dn(e),e.lookahead<Bt&&t===gt)return Yt;if(e.lookahead===0)break}if(n=0,e.lookahead>=Rt&&(e.ins_h=rn(e,e.ins_h,e.window[e.strstart+Rt-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-Bt&&(e.match_length=un(e,n)),e.match_length>=Rt){if(r=mt(e,e.strstart-e.match_start,e.match_length-Rt),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Rt){e.match_length--;do e.strstart++,e.ins_h=rn(e,e.ins_h,e.window[e.strstart+Rt-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=rn(e,e.ins_h,e.window[e.strstart+1])}else r=mt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(on(e,!1),e.strm.avail_out===0))return Yt}return e.insert=e.strstart<2?e.strstart:2,t===yt?(on(e,!0),e.strm.avail_out===0?Zt:Qt):e.last_lit&&(on(e,!1),e.strm.avail_out===0)?Yt:Xt},mn=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<Bt){if(dn(e),e.lookahead<Bt&&t===gt)return Yt;if(e.lookahead===0)break}if(n=0,e.lookahead>=Rt&&(e.ins_h=rn(e,e.ins_h,e.window[e.strstart+Rt-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-Bt&&(e.match_length=un(e,n),e.match_length<=5&&(e.strategy===Dt||e.match_length===Rt&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=Rt&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-Rt,r=mt(e,e.strstart-1-e.prev_match,e.prev_length-Rt),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=rn(e,e.ins_h,e.window[e.strstart+Rt-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&&(on(e,!1),e.strm.avail_out===0))return Yt}else if(e.match_available){if(r=mt(e,0,e.window[e.strstart-1]),r&&on(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Yt}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(r=mt(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<2?e.strstart:2,t===yt?(on(e,!0),e.strm.avail_out===0?Zt:Qt):e.last_lit&&(on(e,!1),e.strm.avail_out===0)?Yt:Xt},hn=(e,t)=>{let n,r,i,a,o=e.window;for(;;){if(e.lookahead<=zt){if(dn(e),e.lookahead<=zt&&t===gt)return Yt;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=Rt&&e.strstart>0&&(i=e.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){a=e.strstart+zt;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<a);e.match_length=zt-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Rt?(n=mt(e,1,e.match_length-Rt),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=mt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(on(e,!1),e.strm.avail_out===0))return Yt}return e.insert=0,t===yt?(on(e,!0),e.strm.avail_out===0?Zt:Qt):e.last_lit&&(on(e,!1),e.strm.avail_out===0)?Yt:Xt},gn=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(dn(e),e.lookahead===0)){if(t===gt)return Yt;break}if(e.match_length=0,n=mt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(on(e,!1),e.strm.avail_out===0))return Yt}return e.insert=0,t===yt?(on(e,!0),e.strm.avail_out===0?Zt:Qt):e.last_lit&&(on(e,!1),e.strm.avail_out===0)?Yt:Xt};function _n(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}var vn=[new _n(0,0,0,0,fn),new _n(4,4,8,4,pn),new _n(4,5,16,8,pn),new _n(4,6,32,32,pn),new _n(4,4,16,16,mn),new _n(8,16,32,32,mn),new _n(8,16,128,128,mn),new _n(8,32,128,256,mn),new _n(32,128,258,1024,mn),new _n(32,258,258,4096,mn)],yn=e=>{e.window_size=2*e.w_size,nn(e.head),e.max_lazy_match=vn[e.level].max_lazy,e.good_match=vn[e.level].good_length,e.nice_match=vn[e.level].nice_length,e.max_chain_length=vn[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 bn(){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=Nt,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=new Uint16Array(Lt*2),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),nn(this.dyn_ltree),nn(this.dyn_dtree),nn(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),nn(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),nn(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var xn=e=>{if(!e||!e.state)return en(e,Ct);e.total_in=e.total_out=0,e.data_type=Mt;let t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?Ht:qt,e.adler=t.wrap===2?0:1,t.last_flush=gt,dt(t),xt},Sn=e=>{let t=xn(e);return t===xt&&yn(e.state),t},Cn=(e,t)=>!e||!e.state||e.state.wrap!==2?Ct:(e.state.gzhead=t,xt),wn=(e,t,n,r,i,a)=>{if(!e)return Ct;let o=1;if(t===Et&&(t=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>Pt||n!==Nt||r<8||r>15||t<0||t>9||a<0||a>At)return en(e,Ct);r===8&&(r=9);let s=new bn;return e.state=s,s.strm=e,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+Rt-1)/Rt),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.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=a,s.method=n,Sn(e)},Tn={deflateInit:(e,t)=>wn(e,t,Nt,Ft,It,jt),deflateInit2:wn,deflateReset:Sn,deflateResetKeep:xn,deflateSetHeader:Cn,deflate:(e,t)=>{let n,r;if(!e||!e.state||t>bt||t<0)return e?en(e,Ct):Ct;let i=e.state;if(!e.output||!e.input&&e.avail_in!==0||i.status===Jt&&t!==yt)return en(e,e.avail_out===0?Tt:Ct);i.strm=e;let a=i.last_flush;if(i.last_flush=t,i.status===Ht){if(i.wrap===2)e.adler=0,sn(i,31),sn(i,139),sn(i,8),i.gzhead?(sn(i,+!!i.gzhead.text+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),sn(i,i.gzhead.time&255),sn(i,i.gzhead.time>>8&255),sn(i,i.gzhead.time>>16&255),sn(i,i.gzhead.time>>24&255),sn(i,i.level===9?2:i.strategy>=Ot||i.level<2?4:0),sn(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(sn(i,i.gzhead.extra.length&255),sn(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=ct(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=Ut):(sn(i,0),sn(i,0),sn(i,0),sn(i,0),sn(i,0),sn(i,i.level===9?2:i.strategy>=Ot||i.level<2?4:0),sn(i,$t),i.status=qt);else{let t=Nt+(i.w_bits-8<<4)<<8,n=-1;n=i.strategy>=Ot||i.level<2?0:i.level<6?1:i.level===6?2:3,t|=n<<6,i.strstart!==0&&(t|=Vt),t+=31-t%31,i.status=qt,cn(i,t),i.strstart!==0&&(cn(i,e.adler>>>16),cn(i,e.adler&65535)),e.adler=1}}if(i.status===Ut){if(i.gzhead.extra){for(n=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=ct(e.adler,i.pending_buf,i.pending-n,n)),an(e),n=i.pending,i.pending===i.pending_buf_size));)sn(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=ct(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=Wt)}else i.status=Wt}if(i.status===Wt){if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=ct(e.adler,i.pending_buf,i.pending-n,n)),an(e),n=i.pending,i.pending===i.pending_buf_size)){r=1;break}r=i.gzindex<i.gzhead.name.length?i.gzhead.name.charCodeAt(i.gzindex++)&255:0,sn(i,r)}while(r!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=ct(e.adler,i.pending_buf,i.pending-n,n)),r===0&&(i.gzindex=0,i.status=Gt)}else i.status=Gt}if(i.status===Gt){if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=ct(e.adler,i.pending_buf,i.pending-n,n)),an(e),n=i.pending,i.pending===i.pending_buf_size)){r=1;break}r=i.gzindex<i.gzhead.comment.length?i.gzhead.comment.charCodeAt(i.gzindex++)&255:0,sn(i,r)}while(r!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=ct(e.adler,i.pending_buf,i.pending-n,n)),r===0&&(i.status=Kt)}else i.status=Kt}if(i.status===Kt&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&an(e),i.pending+2<=i.pending_buf_size&&(sn(i,e.adler&255),sn(i,e.adler>>8&255),e.adler=0,i.status=qt)):i.status=qt),i.pending!==0){if(an(e),e.avail_out===0)return i.last_flush=-1,xt}else if(e.avail_in===0&&tn(t)<=tn(a)&&t!==yt)return en(e,Tt);if(i.status===Jt&&e.avail_in!==0)return en(e,Tt);if(e.avail_in!==0||i.lookahead!==0||t!==gt&&i.status!==Jt){let n=i.strategy===Ot?gn(i,t):i.strategy===kt?hn(i,t):vn[i.level].func(i,t);if((n===Zt||n===Qt)&&(i.status=Jt),n===Yt||n===Zt)return e.avail_out===0&&(i.last_flush=-1),xt;if(n===Xt&&(t===_t?ht(i):t!==bt&&(ft(i,0,0,!1),t===vt&&(nn(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),an(e),e.avail_out===0))return i.last_flush=-1,xt}return t===yt?i.wrap<=0?St:(i.wrap===2?(sn(i,e.adler&255),sn(i,e.adler>>8&255),sn(i,e.adler>>16&255),sn(i,e.adler>>24&255),sn(i,e.total_in&255),sn(i,e.total_in>>8&255),sn(i,e.total_in>>16&255),sn(i,e.total_in>>24&255)):(cn(i,e.adler>>>16),cn(i,e.adler&65535)),an(e),i.wrap>0&&(i.wrap=-i.wrap),i.pending===0?St:xt):xt},deflateEnd:e=>{if(!e||!e.state)return Ct;let t=e.state.status;return t!==Ht&&t!==Ut&&t!==Wt&&t!==Gt&&t!==Kt&&t!==qt&&t!==Jt?en(e,Ct):(e.state=null,t===qt?en(e,wt):xt)},deflateSetDictionary:(e,t)=>{let n=t.length;if(!e||!e.state)return Ct;let r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==Ht||r.lookahead)return Ct;if(i===1&&(e.adler=ot(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(nn(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,dn(r);r.lookahead>=Rt;){let e=r.strstart,t=r.lookahead-2;do r.ins_h=rn(r,r.ins_h,r.window[e+Rt-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,dn(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,xt},deflateInfo:`pako deflate (from Nodeca project)`},En=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Dn={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)En(n,t)&&(e[t]=n[t])}}return e},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}},On=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{On=!1}var kn=new Uint8Array(256);for(let e=0;e<256;e++)kn[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;kn[254]=kn[254]=1;var An=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},jn=(e,t)=>{if(t<65534&&e.subarray&&On)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},Mn={string2buf:An,buf2string:(e,t)=>{let n,r,i=t||e.length,a=Array(i*2);for(r=0,n=0;n<i;){let t=e[n++];if(t<128){a[r++]=t;continue}let o=kn[t];if(o>4){a[r++]=65533,n+=o-1;continue}for(t&=o===2?31:o===3?15:7;o>1&&n<i;)t=t<<6|e[n++]&63,o--;if(o>1){a[r++]=65533;continue}t<65536?a[r++]=t:(t-=65536,a[r++]=55296|t>>10&1023,a[r++]=56320|t&1023)}return jn(a,r)},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+kn[e[n]]>t?n:t}};function Nn(){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}var Pn=Nn,Fn=Object.prototype.toString,{Z_NO_FLUSH:In,Z_SYNC_FLUSH:Ln,Z_FULL_FLUSH:Rn,Z_FINISH:zn,Z_OK:Bn,Z_STREAM_END:Vn,Z_DEFAULT_COMPRESSION:Hn,Z_DEFAULT_STRATEGY:Un,Z_DEFLATED:Wn}=ut;function Gn(e){this.options=Dn.assign({level:Hn,method:Wn,chunkSize:16384,windowBits:15,memLevel:8,strategy:Un},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 Pn,this.strm.avail_out=0;let n=Tn.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Bn)throw Error(lt[n]);if(t.header&&Tn.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e=typeof t.dictionary==`string`?Mn.string2buf(t.dictionary):Fn.call(t.dictionary)===`[object ArrayBuffer]`?new Uint8Array(t.dictionary):t.dictionary,n=Tn.deflateSetDictionary(this.strm,e),n!==Bn)throw Error(lt[n]);this._dict_set=!0}}Gn.prototype.push=function(e,t){let n=this.strm,r=this.options.chunkSize,i,a;if(this.ended)return!1;for(a=t===~~t?t:t===!0?zn:In,n.input=typeof e==`string`?Mn.string2buf(e):Fn.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(r),n.next_out=0,n.avail_out=r),(a===Ln||a===Rn)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=Tn.deflate(n,a),i===Vn)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=Tn.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Bn;if(n.avail_out===0){this.onData(n.output);continue}if(a>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0},Gn.prototype.onData=function(e){this.chunks.push(e)},Gn.prototype.onEnd=function(e){e===Bn&&(this.result=Dn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Kn(e,t){let n=new Gn(t);if(n.push(e,!0),n.err)throw n.msg||lt[n.err];return n.result}function qn(e,t){return t||={},t.raw=!0,Kn(e,t)}function Jn(e,t){return t||={},t.gzip=!0,Kn(e,t)}var Yn={Deflate:Gn,deflate:Kn,deflateRaw:qn,gzip:Jn,constants:ut},Xn=30,Zn=12,Qn=function(e,t){let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E=e.state;n=e.next_in,w=e.input,r=n+(e.avail_in-5),i=e.next_out,T=e.output,a=i-(t-e.avail_out),o=i+(e.avail_out-257),s=E.dmax,c=E.wsize,l=E.whave,u=E.wnext,d=E.window,f=E.hold,p=E.bits,m=E.lencode,h=E.distcode,g=(1<<E.lenbits)-1,_=(1<<E.distbits)-1;top:do{p<15&&(f+=w[n++]<<p,p+=8,f+=w[n++]<<p,p+=8),v=m[f&g];dolen:for(;;){if(y=v>>>24,f>>>=y,p-=y,y=v>>>16&255,y===0)T[i++]=v&65535;else if(y&16){b=v&65535,y&=15,y&&(p<y&&(f+=w[n++]<<p,p+=8),b+=f&(1<<y)-1,f>>>=y,p-=y),p<15&&(f+=w[n++]<<p,p+=8,f+=w[n++]<<p,p+=8),v=h[f&_];dodist:for(;;){if(y=v>>>24,f>>>=y,p-=y,y=v>>>16&255,y&16){if(x=v&65535,y&=15,p<y&&(f+=w[n++]<<p,p+=8,p<y&&(f+=w[n++]<<p,p+=8)),x+=f&(1<<y)-1,x>s){e.msg=`invalid distance too far back`,E.mode=Xn;break top}if(f>>>=y,p-=y,y=i-a,x>y){if(y=x-y,y>l&&E.sane){e.msg=`invalid distance too far back`,E.mode=Xn;break top}if(S=0,C=d,u===0){if(S+=c-y,y<b){b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}}else if(u<y){if(S+=c+u-y,y-=u,y<b){b-=y;do T[i++]=d[S++];while(--y);if(S=0,u<b){y=u,b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}}}else if(S+=u-y,y<b){b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}for(;b>2;)T[i++]=C[S++],T[i++]=C[S++],T[i++]=C[S++],b-=3;b&&(T[i++]=C[S++],b>1&&(T[i++]=C[S++]))}else{S=i-x;do T[i++]=T[S++],T[i++]=T[S++],T[i++]=T[S++],b-=3;while(b>2);b&&(T[i++]=T[S++],b>1&&(T[i++]=T[S++]))}}else if(y&64){e.msg=`invalid distance code`,E.mode=Xn;break top}else{v=h[(v&65535)+(f&(1<<y)-1)];continue dodist}break}}else if(!(y&64)){v=m[(v&65535)+(f&(1<<y)-1)];continue dolen}else if(y&32){E.mode=Zn;break top}else{e.msg=`invalid literal/length code`,E.mode=Xn;break top}break}}while(n<r&&i<o);b=p>>3,n-=b,p-=b<<3,f&=(1<<p)-1,e.next_in=n,e.next_out=i,e.avail_in=n<r?5+(r-n):5-(n-r),e.avail_out=i<o?257+(o-i):257-(i-o),E.hold=f,E.bits=p},$n=15,er=852,tr=592,nr=0,rr=1,ir=2,ar=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]),or=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]),sr=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]),cr=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]),lr=(e,t,n,r,i,a,o,s)=>{let c=s.bits,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y,b,x,S,C,w=null,T=0,E,D=new Uint16Array(16),ee=new Uint16Array(16),te=null,ne=0,re,ie,ae;for(l=0;l<=$n;l++)D[l]=0;for(u=0;u<r;u++)D[t[n+u]]++;for(p=c,f=$n;f>=1&&D[f]===0;f--);if(p>f&&(p=f),f===0)return i[a++]=20971520,i[a++]=20971520,s.bits=1,0;for(d=1;d<f&&D[d]===0;d++);for(p<d&&(p=d),g=1,l=1;l<=$n;l++)if(g<<=1,g-=D[l],g<0)return-1;if(g>0&&(e===nr||f!==1))return-1;for(ee[1]=0,l=1;l<$n;l++)ee[l+1]=ee[l]+D[l];for(u=0;u<r;u++)t[n+u]!==0&&(o[ee[t[n+u]]++]=u);if(e===nr?(w=te=o,E=19):e===rr?(w=ar,T-=257,te=or,ne-=257,E=256):(w=sr,te=cr,E=-1),v=0,u=0,l=d,C=a,m=p,h=0,x=-1,_=1<<p,S=_-1,e===rr&&_>er||e===ir&&_>tr)return 1;for(;;){re=l-h,o[u]<E?(ie=0,ae=o[u]):o[u]>E?(ie=te[ne+o[u]],ae=w[T+o[u]]):(ie=96,ae=0),y=1<<l-h,b=1<<m,d=b;do b-=y,i[C+(v>>h)+b]=re<<24|ie<<16|ae|0;while(b!==0);for(y=1<<l-1;v&y;)y>>=1;if(y===0?v=0:(v&=y-1,v+=y),u++,--D[l]===0){if(l===f)break;l=t[n+o[u]]}if(l>p&&(v&S)!==x){for(h===0&&(h=p),C+=d,m=l-h,g=1<<m;m+h<f&&(g-=D[m+h],!(g<=0));)m++,g<<=1;if(_+=1<<m,e===rr&&_>er||e===ir&&_>tr)return 1;x=v&S,i[x]=p<<24|m<<16|C-a|0}}return v!==0&&(i[C+v]=l-h<<24|4194304),s.bits=p,0},ur=0,dr=1,fr=2,{Z_FINISH:pr,Z_BLOCK:mr,Z_TREES:hr,Z_OK:gr,Z_STREAM_END:_r,Z_NEED_DICT:vr,Z_STREAM_ERROR:yr,Z_DATA_ERROR:br,Z_MEM_ERROR:xr,Z_BUF_ERROR:Sr,Z_DEFLATED:Cr}=ut,wr=1,Tr=2,Er=3,Dr=4,Or=5,kr=6,Ar=7,jr=8,Mr=9,Nr=10,Pr=11,Fr=12,Ir=13,Lr=14,Rr=15,zr=16,Br=17,Vr=18,Hr=19,Ur=20,Wr=21,Gr=22,Kr=23,qr=24,Jr=25,Yr=26,Xr=27,Zr=28,Qr=29,$r=30,ei=31,ti=32,ni=852,ri=592,ii=15,ai=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function oi(){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=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var si=e=>{if(!e||!e.state)return yr;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=wr,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(ni),t.distcode=t.distdyn=new Int32Array(ri),t.sane=1,t.back=-1,gr},ci=e=>{if(!e||!e.state)return yr;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,si(e)},li=(e,t)=>{let n;if(!e||!e.state)return yr;let r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15)?yr:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,ci(e))},ui=(e,t)=>{if(!e)return yr;let n=new oi;e.state=n,n.window=null;let r=li(e,t);return r!==gr&&(e.state=null),r},di=e=>ui(e,ii),fi=!0,pi,mi,hi=e=>{if(fi){pi=new Int32Array(512),mi=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(lr(dr,e.lens,0,288,pi,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;lr(fr,e.lens,0,32,mi,0,e.work,{bits:5}),fi=!1}e.lencode=pi,e.lenbits=9,e.distcode=mi,e.distbits=5},gi=(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},_i={inflateReset:ci,inflateReset2:li,inflateResetKeep:si,inflateInit:di,inflateInit2:ui,inflate:(e,t)=>{let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g=0,_,v,y,b,x,S,C,w,T=new Uint8Array(4),E,D,ee=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return yr;n=e.state,n.mode===Fr&&(n.mode=Ir),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,d=s,f=c,w=gr;inf_leave:for(;;)switch(n.mode){case wr:if(n.wrap===0){n.mode=Ir;break}for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&2&&l===35615){n.check=0,T[0]=l&255,T[1]=l>>>8&255,n.check=ct(n.check,T,2,0),l=0,u=0,n.mode=Tr;break}if(n.flags=0,n.head&&(n.head.done=!1),!(n.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg=`incorrect header check`,n.mode=$r;break}if((l&15)!==Cr){e.msg=`unknown compression method`,n.mode=$r;break}if(l>>>=4,u-=4,C=(l&15)+8,n.wbits===0)n.wbits=C;else if(C>n.wbits){e.msg=`invalid window size`,n.mode=$r;break}n.dmax=1<<n.wbits,e.adler=n.check=1,n.mode=l&512?Nr:Fr,l=0,u=0;break;case Tr:for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.flags=l,(n.flags&255)!==Cr){e.msg=`unknown compression method`,n.mode=$r;break}if(n.flags&57344){e.msg=`unknown header flags set`,n.mode=$r;break}n.head&&(n.head.text=l>>8&1),n.flags&512&&(T[0]=l&255,T[1]=l>>>8&255,n.check=ct(n.check,T,2,0)),l=0,u=0,n.mode=Er;case Er:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.time=l),n.flags&512&&(T[0]=l&255,T[1]=l>>>8&255,T[2]=l>>>16&255,T[3]=l>>>24&255,n.check=ct(n.check,T,4,0)),l=0,u=0,n.mode=Dr;case Dr:for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.xflags=l&255,n.head.os=l>>8),n.flags&512&&(T[0]=l&255,T[1]=l>>>8&255,n.check=ct(n.check,T,2,0)),l=0,u=0,n.mode=Or;case Or:if(n.flags&1024){for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.length=l,n.head&&(n.head.extra_len=l),n.flags&512&&(T[0]=l&255,T[1]=l>>>8&255,n.check=ct(n.check,T,2,0)),l=0,u=0}else n.head&&(n.head.extra=null);n.mode=kr;case kr:if(n.flags&1024&&(p=n.length,p>s&&(p=s),p&&(n.head&&(C=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(a,a+p),C)),n.flags&512&&(n.check=ct(n.check,r,p,a)),s-=p,a+=p,n.length-=p),n.length))break inf_leave;n.length=0,n.mode=Ar;case Ar:if(n.flags&2048){if(s===0)break inf_leave;p=0;do C=r[a+p++],n.head&&C&&n.length<65536&&(n.head.name+=String.fromCharCode(C));while(C&&p<s);if(n.flags&512&&(n.check=ct(n.check,r,p,a)),s-=p,a+=p,C)break inf_leave}else n.head&&(n.head.name=null);n.length=0,n.mode=jr;case jr:if(n.flags&4096){if(s===0)break inf_leave;p=0;do C=r[a+p++],n.head&&C&&n.length<65536&&(n.head.comment+=String.fromCharCode(C));while(C&&p<s);if(n.flags&512&&(n.check=ct(n.check,r,p,a)),s-=p,a+=p,C)break inf_leave}else n.head&&(n.head.comment=null);n.mode=Mr;case Mr:if(n.flags&512){for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(l!==(n.check&65535)){e.msg=`header crc mismatch`,n.mode=$r;break}l=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Fr;break;case Nr:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}e.adler=n.check=ai(l),l=0,u=0,n.mode=Pr;case Pr:if(n.havedict===0)return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,vr;e.adler=n.check=1,n.mode=Fr;case Fr:if(t===mr||t===hr)break inf_leave;case Ir:if(n.last){l>>>=u&7,u-=u&7,n.mode=Xr;break}for(;u<3;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}switch(n.last=l&1,l>>>=1,--u,l&3){case 0:n.mode=Lr;break;case 1:if(hi(n),n.mode=Ur,t===hr){l>>>=2,u-=2;break inf_leave}break;case 2:n.mode=Br;break;case 3:e.msg=`invalid block type`,n.mode=$r}l>>>=2,u-=2;break;case Lr:for(l>>>=u&7,u-=u&7;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if((l&65535)!=(l>>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=$r;break}if(n.length=l&65535,l=0,u=0,n.mode=Rr,t===hr)break inf_leave;case Rr:n.mode=zr;case zr:if(p=n.length,p){if(p>s&&(p=s),p>c&&(p=c),p===0)break inf_leave;i.set(r.subarray(a,a+p),o),s-=p,a+=p,c-=p,o+=p,n.length-=p;break}n.mode=Fr;break;case Br:for(;u<14;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.nlen=(l&31)+257,l>>>=5,u-=5,n.ndist=(l&31)+1,l>>>=5,u-=5,n.ncode=(l&15)+4,l>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg=`too many length or distance symbols`,n.mode=$r;break}n.have=0,n.mode=Vr;case Vr:for(;n.have<n.ncode;){for(;u<3;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.lens[ee[n.have++]]=l&7,l>>>=3,u-=3}for(;n.have<19;)n.lens[ee[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,E={bits:n.lenbits},w=lr(ur,n.lens,0,19,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid code lengths set`,n.mode=$r;break}n.have=0,n.mode=Hr;case Hr:for(;n.have<n.nlen+n.ndist;){for(;g=n.lencode[l&(1<<n.lenbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(y<16)l>>>=_,u-=_,n.lens[n.have++]=y;else{if(y===16){for(D=_+2;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(l>>>=_,u-=_,n.have===0){e.msg=`invalid bit length repeat`,n.mode=$r;break}C=n.lens[n.have-1],p=3+(l&3),l>>>=2,u-=2}else if(y===17){for(D=_+3;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=_,u-=_,C=0,p=3+(l&7),l>>>=3,u-=3}else{for(D=_+7;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=_,u-=_,C=0,p=11+(l&127),l>>>=7,u-=7}if(n.have+p>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=$r;break}for(;p--;)n.lens[n.have++]=C}}if(n.mode===$r)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=$r;break}if(n.lenbits=9,E={bits:n.lenbits},w=lr(dr,n.lens,0,n.nlen,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid literal/lengths set`,n.mode=$r;break}if(n.distbits=6,n.distcode=n.distdyn,E={bits:n.distbits},w=lr(fr,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,E),n.distbits=E.bits,w){e.msg=`invalid distances set`,n.mode=$r;break}if(n.mode=Ur,t===hr)break inf_leave;case Ur:n.mode=Wr;case Wr:if(s>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,Qn(e,f),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,n.mode===Fr&&(n.back=-1);break}for(n.back=0;g=n.lencode[l&(1<<n.lenbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(v&&!(v&240)){for(b=_,x=v,S=y;g=n.lencode[S+((l&(1<<b+x)-1)>>b)],_=g>>>24,v=g>>>16&255,y=g&65535,!(b+_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=b,u-=b,n.back+=b}if(l>>>=_,u-=_,n.back+=_,n.length=y,v===0){n.mode=Yr;break}if(v&32){n.back=-1,n.mode=Fr;break}if(v&64){e.msg=`invalid literal/length code`,n.mode=$r;break}n.extra=v&15,n.mode=Gr;case Gr:if(n.extra){for(D=n.extra;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=Kr;case Kr:for(;g=n.distcode[l&(1<<n.distbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(!(v&240)){for(b=_,x=v,S=y;g=n.distcode[S+((l&(1<<b+x)-1)>>b)],_=g>>>24,v=g>>>16&255,y=g&65535,!(b+_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=b,u-=b,n.back+=b}if(l>>>=_,u-=_,n.back+=_,v&64){e.msg=`invalid distance code`,n.mode=$r;break}n.offset=y,n.extra=v&15,n.mode=qr;case qr:if(n.extra){for(D=n.extra;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=$r;break}n.mode=Jr;case Jr:if(c===0)break inf_leave;if(p=f-c,n.offset>p){if(p=n.offset-p,p>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=$r;break}p>n.wnext?(p-=n.wnext,m=n.wsize-p):m=n.wnext-p,p>n.length&&(p=n.length),h=n.window}else h=i,m=o-n.offset,p=n.length;p>c&&(p=c),c-=p,n.length-=p;do i[o++]=h[m++];while(--p);n.length===0&&(n.mode=Wr);break;case Yr:if(c===0)break inf_leave;i[o++]=n.length,c--,n.mode=Wr;break;case Xr:if(n.wrap){for(;u<32;){if(s===0)break inf_leave;s--,l|=r[a++]<<u,u+=8}if(f-=c,e.total_out+=f,n.total+=f,f&&(e.adler=n.check=n.flags?ct(n.check,i,f,o-f):ot(n.check,i,f,o-f)),f=c,(n.flags?l:ai(l))!==n.check){e.msg=`incorrect data check`,n.mode=$r;break}l=0,u=0}n.mode=Zr;case Zr:if(n.wrap&&n.flags){for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(l!==(n.total&4294967295)){e.msg=`incorrect length check`,n.mode=$r;break}l=0,u=0}n.mode=Qr;case Qr:w=_r;break inf_leave;case $r:w=br;break inf_leave;case ei:return xr;case ti:default:return yr}return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,(n.wsize||f!==e.avail_out&&n.mode<$r&&(n.mode<Xr||t!==pr))&&gi(e,e.output,e.next_out,f-e.avail_out),d-=e.avail_in,f-=e.avail_out,e.total_in+=d,e.total_out+=f,n.total+=f,n.wrap&&f&&(e.adler=n.check=n.flags?ct(n.check,i,f,e.next_out-f):ot(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Fr?128:0)+(n.mode===Ur||n.mode===Rr?256:0),(d===0&&f===0||t===pr)&&w===gr&&(w=Sr),w},inflateEnd:e=>{if(!e||!e.state)return yr;let t=e.state;return t.window&&=null,e.state=null,gr},inflateGetHeader:(e,t)=>{if(!e||!e.state)return yr;let n=e.state;return n.wrap&2?(n.head=t,t.done=!1,gr):yr},inflateSetDictionary:(e,t)=>{let n=t.length,r,i,a;return!e||!e.state||(r=e.state,r.wrap!==0&&r.mode!==Pr)?yr:r.mode===Pr&&(i=1,i=ot(i,t,n,0),i!==r.check)?br:(a=gi(e,t,n,n),a?(r.mode=ei,xr):(r.havedict=1,gr))},inflateInfo:`pako inflate (from Nodeca project)`};function vi(){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}var yi=vi,bi=Object.prototype.toString,{Z_NO_FLUSH:xi,Z_FINISH:Si,Z_OK:Ci,Z_STREAM_END:wi,Z_NEED_DICT:Ti,Z_STREAM_ERROR:Ei,Z_DATA_ERROR:Di,Z_MEM_ERROR:Oi}=ut;function ki(e){this.options=Dn.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 Pn,this.strm.avail_out=0;let n=_i.inflateInit2(this.strm,t.windowBits);if(n!==Ci||(this.header=new yi,_i.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary==`string`?t.dictionary=Mn.string2buf(t.dictionary):bi.call(t.dictionary)===`[object ArrayBuffer]`&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=_i.inflateSetDictionary(this.strm,t.dictionary),n!==Ci))))throw Error(lt[n])}ki.prototype.push=function(e,t){let n=this.strm,r=this.options.chunkSize,i=this.options.dictionary,a,o,s;if(this.ended)return!1;for(o=t===~~t?t:t===!0?Si:xi,n.input=bi.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(r),n.next_out=0,n.avail_out=r),a=_i.inflate(n,o),a===Ti&&i&&(a=_i.inflateSetDictionary(n,i),a===Ci?a=_i.inflate(n,o):a===Di&&(a=Ti));n.avail_in>0&&a===wi&&n.state.wrap>0&&e[n.next_in]!==0;)_i.inflateReset(n),a=_i.inflate(n,o);switch(a){case Ei:case Di:case Ti:case Oi:return this.onEnd(a),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(n.avail_out===0||a===wi)){if(this.options.to===`string`){let e=Mn.utf8border(n.output,n.next_out),t=n.next_out-e,i=Mn.buf2string(n.output,e);n.next_out=t,n.avail_out=r-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(i)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out))}if(a!==Ci||s!==0){if(a===wi)return a=_i.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(n.avail_in===0)break}}return!0},ki.prototype.onData=function(e){this.chunks.push(e)},ki.prototype.onEnd=function(e){e===Ci&&(this.result=this.options.to===`string`?this.chunks.join(``):Dn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ai(e,t){let n=new ki(t);if(n.push(e),n.err)throw n.msg||lt[n.err];return n.result}function ji(e,t){return t||={},t.raw=!0,Ai(e,t)}var Mi={Inflate:ki,inflate:Ai,inflateRaw:ji,ungzip:Ai,constants:ut},{Deflate:Ni,deflate:Pi,deflateRaw:Fi,gzip:Ii}=Yn,{Inflate:Li,inflate:Ri,inflateRaw:zi,ungzip:Bi}=Mi,Vi=Pi,Hi=Ri,Ui={white:`#ffffff`,black:`#000000`,gray:[`#f8f9fa`,`#f1f3f5`,`#e9ecef`,`#dee2e6`,`#ced4da`,`#adb5bd`,`#868e96`,`#495057`,`#343a40`,`#212529`],red:[`#fff5f5`,`#ffe3e3`,`#ffc9c9`,`#ffa8a8`,`#ff8787`,`#ff6b6b`,`#fa5252`,`#f03e3e`,`#e03131`,`#c92a2a`],pink:[`#fff0f6`,`#ffdeeb`,`#fcc2d7`,`#faa2c1`,`#f783ac`,`#f06595`,`#e64980`,`#d6336c`,`#c2255c`,`#a61e4d`],grape:[`#f8f0fc`,`#f3d9fa`,`#eebefa`,`#e599f7`,`#da77f2`,`#cc5de8`,`#be4bdb`,`#ae3ec9`,`#9c36b5`,`#862e9c`],violet:[`#f3f0ff`,`#e5dbff`,`#d0bfff`,`#b197fc`,`#9775fa`,`#845ef7`,`#7950f2`,`#7048e8`,`#6741d9`,`#5f3dc4`],indigo:[`#edf2ff`,`#dbe4ff`,`#bac8ff`,`#91a7ff`,`#748ffc`,`#5c7cfa`,`#4c6ef5`,`#4263eb`,`#3b5bdb`,`#364fc7`],blue:[`#e7f5ff`,`#d0ebff`,`#a5d8ff`,`#74c0fc`,`#4dabf7`,`#339af0`,`#228be6`,`#1c7ed6`,`#1971c2`,`#1864ab`],cyan:[`#e3fafc`,`#c5f6fa`,`#99e9f2`,`#66d9e8`,`#3bc9db`,`#22b8cf`,`#15aabf`,`#1098ad`,`#0c8599`,`#0b7285`],teal:[`#e6fcf5`,`#c3fae8`,`#96f2d7`,`#63e6be`,`#38d9a9`,`#20c997`,`#12b886`,`#0ca678`,`#099268`,`#087f5b`],green:[`#ebfbee`,`#d3f9d8`,`#b2f2bb`,`#8ce99a`,`#69db7c`,`#51cf66`,`#40c057`,`#37b24d`,`#2f9e44`,`#2b8a3e`],lime:[`#f4fce3`,`#e9fac8`,`#d8f5a2`,`#c0eb75`,`#a9e34b`,`#94d82d`,`#82c91e`,`#74b816`,`#66a80f`,`#5c940d`],yellow:[`#fff9db`,`#fff3bf`,`#ffec99`,`#ffe066`,`#ffd43b`,`#fcc419`,`#fab005`,`#f59f00`,`#f08c00`,`#e67700`],orange:[`#fff4e6`,`#ffe8cc`,`#ffd8a8`,`#ffc078`,`#ffa94d`,`#ff922b`,`#fd7e14`,`#f76707`,`#e8590c`,`#d9480f`]},Wi=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>(t&=63,e+=t<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?`-`:`_`,e),``),Gi=n(((e,t)=>{var n=`Expected a function`,r=NaN,i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,c=parseInt,l=typeof global==`object`&&global&&global.Object===Object&&global,u=typeof self==`object`&&self&&self.Object===Object&&self,d=l||u||Function(`return this`)(),f=Object.prototype.toString,p=Math.max,m=Math.min,h=function(){return d.Date.now()};function g(e,t,r){var i,a,o,s,c,l,u=0,d=!1,f=!1,g=!0;if(typeof e!=`function`)throw TypeError(n);t=x(t)||0,v(r)&&(d=!!r.leading,f=`maxWait`in r,o=f?p(x(r.maxWait)||0,t):o,g=`trailing`in r?!!r.trailing:g);function _(t){var n=i,r=a;return i=a=void 0,u=t,s=e.apply(r,n),s}function y(e){return u=e,c=setTimeout(C,t),d?_(e):s}function b(e){var n=e-l,r=e-u,i=t-n;return f?m(i,o-r):i}function S(e){var n=e-l,r=e-u;return l===void 0||n>=t||n<0||f&&r>=o}function C(){var e=h();if(S(e))return w(e);c=setTimeout(C,b(e))}function w(e){return c=void 0,g&&i?_(e):(i=a=void 0,s)}function T(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function E(){return c===void 0?s:w(h())}function D(){var e=h(),n=S(e);if(i=arguments,a=this,l=e,n){if(c===void 0)return y(l);if(f)return c=setTimeout(C,t),_(l)}return c===void 0&&(c=setTimeout(C,t)),s}return D.cancel=T,D.flush=E,D}function _(e,t,r){var i=!0,a=!0;if(typeof e!=`function`)throw TypeError(n);return v(r)&&(i=`leading`in r?!!r.leading:i,a=`trailing`in r?!!r.trailing:a),g(e,t,{leading:i,maxWait:t,trailing:a})}function v(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function y(e){return!!e&&typeof e==`object`}function b(e){return typeof e==`symbol`||y(e)&&f.call(e)==`[object Symbol]`}function x(e){if(typeof e==`number`)return e;if(b(e))return r;if(v(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=v(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=e.replace(i,``);var n=o.test(e);return n||s.test(e)?c(e.slice(2),n?2:8):a.test(e)?r:+e}t.exports=_})),Ki=n(((e,t)=>{(function(n,r){typeof define==`function`&&define.amd?define([],r):typeof e==`object`?t.exports=r():(n.PromisePool=r(),n.promisePool=n.PromisePool)})(e,function(){var e=function(){this._listeners={}};e.prototype.addEventListener=function(e,t){this._listeners[e]=this._listeners[e]||[],this._listeners[e].indexOf(t)<0&&this._listeners[e].push(t)},e.prototype.removeEventListener=function(e,t){if(this._listeners[e]){var n=this._listeners[e].indexOf(t);n>=0&&this._listeners[e].splice(n,1)}},e.prototype.dispatchEvent=function(e){if(this._listeners[e.type]&&this._listeners[e.type].length)for(var t=this._listeners[e.type].slice(),n=0,r=t.length;n<r;++n)t[n].call(this,e)};var t=function(e){return typeof e.constructor==`function`&&e.constructor.name===`GeneratorFunction`},n=function(e){return{next:function(){var t=e();return t?{value:t}:{done:!0}}}},r=function(e){var t=!1;return{next:function(){return t?{done:!0}:(t=!0,{value:e})}}},i=function(e,i){var a=typeof e;if(a===`object`){if(typeof e.next==`function`)return e;if(typeof e.then==`function`)return r(e)}return a===`function`?t(e)?e():n(e):r(i.resolve(e))},a=function(e,t,n){this.target=e,this.type=t,this.data=n},o=function(t,n,r){if(e.call(this),typeof n!=`number`||Math.floor(n)!==n||n<1)throw Error(`Invalid concurrency`);this._concurrency=n,this._options=r||{},this._options.promise=this._options.promise||Promise,this._iterator=i(t,this._options.promise),this._done=!1,this._size=0,this._promise=null,this._callbacks=null};return o.prototype=new e,o.prototype.constructor=o,o.prototype.concurrency=function(e){return e!==void 0&&(this._concurrency=e,this.active()&&this._proceed()),this._concurrency},o.prototype.size=function(){return this._size},o.prototype.active=function(){return!!this._promise},o.prototype.promise=function(){return this._promise},o.prototype.start=function(){var e=this,t=this._options.promise;return this._promise=new t(function(t,n){e._callbacks={reject:n,resolve:t},e._proceed()}),this._promise},o.prototype._fireEvent=function(e,t){this.dispatchEvent(new a(this,e,t))},o.prototype._settle=function(e){e?this._callbacks.reject(e):this._callbacks.resolve(),this._promise=null,this._callbacks=null},o.prototype._onPooledPromiseFulfilled=function(e,t){this._size--,this.active()&&(this._fireEvent(`fulfilled`,{promise:e,result:t}),this._proceed())},o.prototype._onPooledPromiseRejected=function(e,t){this._size--,this.active()&&(this._fireEvent(`rejected`,{promise:e,error:t}),this._settle(t||Error(`Unknown error`)))},o.prototype._trackPromise=function(e){var t=this;e.then(function(n){t._onPooledPromiseFulfilled(e,n)},function(n){t._onPooledPromiseRejected(e,n)}).catch(function(e){t._settle(Error(`Promise processing failed: `+e))})},o.prototype._proceed=function(){if(!this._done){for(var e={done:!1};this._size<this._concurrency&&!(e=this._iterator.next()).done;)this._size++,this._trackPromise(e.value);this._done=e===null||!!e.done}this._done&&this._size===0&&this._settle()},o.PromisePoolEvent=a,o.PromisePool=o,o})})),qi=e(Gi(),1),Ji=e(Ki(),1);function Yi(e,t,n){if(e&&e.length){let[r,i]=t,a=Math.PI/180*n,o=Math.cos(a),s=Math.sin(a);for(let t of e){let[e,n]=t;t[0]=(e-r)*o-(n-i)*s+r,t[1]=(e-r)*s+(n-i)*o+i}}}function Xi(e,t,n){let r=[];e.forEach(e=>r.push(...e)),Yi(r,t,n)}function Zi(e,t){return e[0]===t[0]&&e[1]===t[1]}function Qi(e,t,n,r=1){let i=n,a=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]==`number`?[e]:e,s=[0,0];if(i)for(let e of o)Yi(e,s,i);let c=$i(o,a,r);if(i){for(let e of o)Yi(e,s,-i);Xi(c,s,-i)}return c}function $i(e,t,n){let r=[];for(let t of e){let e=[...t];Zi(e[0],e[e.length-1])||e.push([e[0][0],e[0][1]]),e.length>2&&r.push(e)}let i=[];t=Math.max(t,.1);let a=[];for(let e of r)for(let t=0;t<e.length-1;t++){let n=e[t],r=e[t+1];if(n[1]!==r[1]){let e=Math.min(n[1],r[1]);a.push({ymin:e,ymax:Math.max(n[1],r[1]),x:e===n[1]?n[0]:r[0],islope:(r[0]-n[0])/(r[1]-n[1])})}}if(a.sort((e,t)=>e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax)),!a.length)return i;let o=[],s=a[0].ymin,c=0;for(;o.length||a.length;){if(a.length){let e=-1;for(let t=0;t<a.length&&!(a[t].ymin>s);t++)e=t;a.splice(0,e+1).forEach(e=>{o.push({s,edge:e})})}if(o=o.filter(e=>!(e.edge.ymax<=s)),o.sort((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x)),(n!==1||c%t===0)&&o.length>1)for(let e=0;e<o.length;e+=2){let t=e+1;if(t>=o.length)break;let n=o[e].edge,r=o[t].edge;i.push([[Math.round(n.x),s],[Math.round(r.x),s]])}s+=n,o.forEach(e=>{e.edge.x=e.edge.x+n*e.edge.islope}),c++}return i}function ea(e,t){let n=t.hachureAngle+90,r=t.hachureGap;r<0&&(r=t.strokeWidth*4),r=Math.max(r,.1);let i=1;return t.roughness>=1&&(t.randomizer?.next()||Math.random())>.7&&(i=r),Qi(e,r,n,i||1)}var ta=class{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){let n=ea(e,t);return{type:`fillSketch`,ops:this.renderLines(n,t)}}renderLines(e,t){let n=[];for(let r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}};function na(e){let t=e[0],n=e[1];return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}var ra=class extends ta{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=t.strokeWidth*4),n=Math.max(n,.1);let r=ea(e,Object.assign({},t,{hachureGap:n})),i=Math.PI/180*t.hachureAngle,a=[],o=n*.5*Math.cos(i),s=n*.5*Math.sin(i);for(let[e,t]of r)na([e,t])&&a.push([[e[0]-o,e[1]+s],[...t]],[[e[0]+o,e[1]-s],[...t]]);return{type:`fillSketch`,ops:this.renderLines(a,t)}}},ia=class extends ta{fillPolygons(e,t){let n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return n.ops=n.ops.concat(i.ops),n}},aa=class{constructor(e){this.helper=e}fillPolygons(e,t){t=Object.assign({},t,{hachureAngle:0});let n=ea(e,t);return this.dotsOnLines(n,t)}dotsOnLines(e,t){let n=[],r=t.hachureGap;r<0&&(r=t.strokeWidth*4),r=Math.max(r,.1);let i=t.fillWeight;i<0&&(i=t.strokeWidth/2);let a=r/4;for(let o of e){let e=na(o),s=e/r,c=Math.ceil(s)-1,l=e-c*r,u=(o[0][0]+o[1][0])/2-r/4,d=Math.min(o[0][1],o[1][1]);for(let e=0;e<c;e++){let o=d+l+e*r,s=u-a+Math.random()*2*a,c=o-a+Math.random()*2*a,f=this.helper.ellipse(s,c,i,i,t);n.push(...f.ops)}}return{type:`fillSketch`,ops:n}}},oa=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=ea(e,t);return{type:`fillSketch`,ops:this.dashedLine(n,t)}}dashedLine(e,t){let n=t.dashOffset<0?t.hachureGap<0?t.strokeWidth*4:t.hachureGap:t.dashOffset,r=t.dashGap<0?t.hachureGap<0?t.strokeWidth*4:t.hachureGap:t.dashGap,i=[];return e.forEach(e=>{let a=na(e),o=Math.floor(a/(n+r)),s=(a+r-o*(n+r))/2,c=e[0],l=e[1];c[0]>l[0]&&(c=e[1],l=e[0]);let u=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let e=0;e<o;e++){let a=e*(n+r),o=a+n,l=[c[0]+a*Math.cos(u)+s*Math.cos(u),c[1]+a*Math.sin(u)+s*Math.sin(u)],d=[c[0]+o*Math.cos(u)+s*Math.cos(u),c[1]+o*Math.sin(u)+s*Math.sin(u)];i.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],t))}}),i}},sa=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=t.hachureGap<0?t.strokeWidth*4:t.hachureGap,r=t.zigzagOffset<0?n:t.zigzagOffset;t=Object.assign({},t,{hachureGap:n+r});let i=ea(e,t);return{type:`fillSketch`,ops:this.zigzagLines(i,r,t)}}zigzagLines(e,t,n){let r=[];return e.forEach(e=>{let i=na(e),a=Math.round(i/(2*t)),o=e[0],s=e[1];o[0]>s[0]&&(o=e[1],s=e[0]);let c=Math.atan((s[1]-o[1])/(s[0]-o[0]));for(let e=0;e<a;e++){let i=e*2*t,a=(e+1)*2*t,s=Math.sqrt(2*t**2),l=[o[0]+i*Math.cos(c),o[1]+i*Math.sin(c)],u=[o[0]+a*Math.cos(c),o[1]+a*Math.sin(c)],d=[l[0]+s*Math.cos(c+Math.PI/4),l[1]+s*Math.sin(c+Math.PI/4)];r.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],n),...this.helper.doubleLineOps(d[0],d[1],u[0],u[1],n))}}),r}},ca={};function la(e,t){let n=e.fillStyle||`hachure`;if(!ca[n])switch(n){case`zigzag`:ca[n]||(ca[n]=new ra(t));break;case`cross-hatch`:ca[n]||(ca[n]=new ia(t));break;case`dots`:ca[n]||(ca[n]=new aa(t));break;case`dashed`:ca[n]||(ca[n]=new oa(t));break;case`zigzag-line`:ca[n]||(ca[n]=new sa(t));break;default:n=`hachure`,ca[n]||(ca[n]=new ta(t))}return ca[n]}function ua(){return Math.floor(Math.random()*2**31)}var da=class{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}},fa=0,pa=1,ma=2,ha={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function ga(e){let t=[];for(;e!==``;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:fa,text:RegExp.$1},e=e.substr(RegExp.$1.length);else if(e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))t[t.length]={type:pa,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length);else return[];return t[t.length]={type:ma,text:``},t}function _a(e,t){return e.type===t}function va(e){let t=[],n=ga(e),r=`BOD`,i=0,a=n[i];for(;!_a(a,ma);){let o=0,s=[];if(r===`BOD`){if(a.text===`M`||a.text===`m`)i++,o=ha[a.text],r=a.text;else return va(`M0,0`+e)}else _a(a,pa)?o=ha[r]:(i++,o=ha[a.text],r=a.text);if(i+o<n.length){for(let e=i;e<i+o;e++){let t=n[e];if(_a(t,pa))s[s.length]=+t.text;else throw Error(`Param not a number: `+r+`,`+t.text)}if(typeof ha[r]==`number`){let e={key:r,data:s};t.push(e),i+=o,a=n[i],r===`M`&&(r=`L`),r===`m`&&(r=`l`)}else throw Error(`Bad segment: `+r)}else throw Error(`Path data ended short`)}return t}function ya(e){let t=0,n=0,r=0,i=0,a=[];for(let{key:o,data:s}of e)switch(o){case`M`:a.push({key:`M`,data:[...s]}),[t,n]=s,[r,i]=s;break;case`m`:t+=s[0],n+=s[1],a.push({key:`M`,data:[t,n]}),r=t,i=n;break;case`L`:a.push({key:`L`,data:[...s]}),[t,n]=s;break;case`l`:t+=s[0],n+=s[1],a.push({key:`L`,data:[t,n]});break;case`C`:a.push({key:`C`,data:[...s]}),t=s[4],n=s[5];break;case`c`:{let e=s.map((e,r)=>r%2?e+n:e+t);a.push({key:`C`,data:e}),t=e[4],n=e[5];break}case`Q`:a.push({key:`Q`,data:[...s]}),t=s[2],n=s[3];break;case`q`:{let e=s.map((e,r)=>r%2?e+n:e+t);a.push({key:`Q`,data:e}),t=e[2],n=e[3];break}case`A`:a.push({key:`A`,data:[...s]}),t=s[5],n=s[6];break;case`a`:t+=s[5],n+=s[6],a.push({key:`A`,data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case`H`:a.push({key:`H`,data:[...s]}),t=s[0];break;case`h`:t+=s[0],a.push({key:`H`,data:[t]});break;case`V`:a.push({key:`V`,data:[...s]}),n=s[0];break;case`v`:n+=s[0],a.push({key:`V`,data:[n]});break;case`S`:a.push({key:`S`,data:[...s]}),t=s[2],n=s[3];break;case`s`:{let e=s.map((e,r)=>r%2?e+n:e+t);a.push({key:`S`,data:e}),t=e[2],n=e[3];break}case`T`:a.push({key:`T`,data:[...s]}),t=s[0],n=s[1];break;case`t`:t+=s[0],n+=s[1],a.push({key:`T`,data:[t,n]});break;case`Z`:case`z`:a.push({key:`Z`,data:[]}),t=r,n=i}return a}function ba(e){let t=[],n=``,r=0,i=0,a=0,o=0,s=0,c=0;for(let{key:l,data:u}of e){switch(l){case`M`:t.push({key:`M`,data:[...u]}),[r,i]=u,[a,o]=u;break;case`C`:t.push({key:`C`,data:[...u]}),r=u[4],i=u[5],s=u[2],c=u[3];break;case`L`:t.push({key:`L`,data:[...u]}),[r,i]=u;break;case`H`:r=u[0],t.push({key:`L`,data:[r,i]});break;case`V`:i=u[0],t.push({key:`L`,data:[r,i]});break;case`S`:{let e=0,a=0;n===`C`||n===`S`?(e=r+(r-s),a=i+(i-c)):(e=r,a=i),t.push({key:`C`,data:[e,a,...u]}),s=u[0],c=u[1],r=u[2],i=u[3];break}case`T`:{let[e,a]=u,o=0,l=0;n===`Q`||n===`T`?(o=r+(r-s),l=i+(i-c)):(o=r,l=i);let d=r+2*(o-r)/3,f=i+2*(l-i)/3,p=e+2*(o-e)/3,m=a+2*(l-a)/3;t.push({key:`C`,data:[d,f,p,m,e,a]}),s=o,c=l,r=e,i=a;break}case`Q`:{let[e,n,a,o]=u,l=r+2*(e-r)/3,d=i+2*(n-i)/3,f=a+2*(e-a)/3,p=o+2*(n-o)/3;t.push({key:`C`,data:[l,d,f,p,a,o]}),s=e,c=n,r=a,i=o;break}case`A`:{let e=Math.abs(u[0]),n=Math.abs(u[1]),a=u[2],o=u[3],s=u[4],c=u[5],l=u[6];e===0||n===0?(t.push({key:`C`,data:[r,i,c,l,c,l]}),r=c,i=l):(r!==c||i!==l)&&(Ca(r,i,c,l,e,n,a,o,s).forEach(function(e){t.push({key:`C`,data:e})}),r=c,i=l);break}case`Z`:t.push({key:`Z`,data:[]}),r=a,i=o}n=l}return t}function xa(e){return Math.PI*e/180}function Sa(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function Ca(e,t,n,r,i,a,o,s,c,l){let u=xa(o),d=[],f=0,p=0,m=0,h=0;if(l)[f,p,m,h]=l;else{[e,t]=Sa(e,t,-u),[n,r]=Sa(n,r,-u);let o=(e-n)/2,l=(t-r)/2,d=o*o/(i*i)+l*l/(a*a);d>1&&(d=Math.sqrt(d),i=d*i,a=d*a);let g=s===c?-1:1,_=i*i,v=a*a,y=_*v-_*l*l-v*o*o,b=_*l*l+v*o*o,x=g*Math.sqrt(Math.abs(y/b));m=x*i*l/a+(e+n)/2,h=x*-a*o/i+(t+r)/2,f=Math.asin(parseFloat(((t-h)/a).toFixed(9))),p=Math.asin(parseFloat(((r-h)/a).toFixed(9))),e<m&&(f=Math.PI-f),n<m&&(p=Math.PI-p),f<0&&(f=Math.PI*2+f),p<0&&(p=Math.PI*2+p),c&&f>p&&(f-=Math.PI*2),!c&&p>f&&(p-=Math.PI*2)}let g=p-f;if(Math.abs(g)>Math.PI*120/180){let e=p,t=n,s=r;p=c&&p>f?f+Math.PI*120/180*1:f+Math.PI*120/180*-1,n=m+i*Math.cos(p),r=h+a*Math.sin(p),d=Ca(n,r,t,s,i,a,o,0,c,[p,e,m,h])}g=p-f;let _=Math.cos(f),v=Math.sin(f),y=Math.cos(p),b=Math.sin(p),x=Math.tan(g/4),S=4/3*i*x,C=4/3*a*x,w=[e,t],T=[e+S*v,t-C*_],E=[n+S*b,r-C*y],D=[n,r];if(T[0]=2*w[0]-T[0],T[1]=2*w[1]-T[1],l)return[T,E,D].concat(d);{d=[T,E,D].concat(d);let e=[];for(let t=0;t<d.length;t+=3){let n=Sa(d[t][0],d[t][1],u),r=Sa(d[t+1][0],d[t+1][1],u),i=Sa(d[t+2][0],d[t+2][1],u);e.push([n[0],n[1],r[0],r[1],i[0],i[1]])}return e}}var wa={randOffset:Ra,randOffsetWithRange:za,ellipse:Aa,doubleLineOps:Ba};function Ta(e,t,n,r,i){return{type:`path`,ops:Ga(e,t,n,r,i)}}function Ea(e,t,n){let r=(e||[]).length;if(r>2){let i=[];for(let t=0;t<r-1;t++)i.push(...Ga(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&i.push(...Ga(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:`path`,ops:i}}return r===2?Ta(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:`path`,ops:[]}}function Da(e,t){return Ea(e,!0,t)}function Oa(e,t,n,r,i){return Da([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],i)}function ka(e,t){let n=qa(e,1*(1+t.roughness*.2),t);if(!t.disableMultiStroke){let r=qa(e,1.5*(1+t.roughness*.22),Va(t));n=n.concat(r)}return{type:`path`,ops:n}}function Aa(e,t,n,r,i){return Ma(e,t,i,ja(n,r,i)).opset}function ja(e,t,n){let r=Math.sqrt(Math.PI*2*Math.sqrt(((e/2)**2+(t/2)**2)/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),a=Math.PI*2/i,o=Math.abs(e/2),s=Math.abs(t/2),c=1-n.curveFitting;return o+=Wa(o*c,n),s+=Wa(s*c,n),{increment:a,rx:o,ry:s}}function Ma(e,t,n,r){let[i,a]=Ya(r.increment,e,t,r.rx,r.ry,1,r.increment*Ua(.1,Ua(.4,1,n),n),n),o=Ja(i,null,n);if(!n.disableMultiStroke&&n.roughness!==0){let[i]=Ya(r.increment,e,t,r.rx,r.ry,1.5,0,n),a=Ja(i,null,n);o=o.concat(a)}return{estimatedPoints:a,opset:{type:`path`,ops:o}}}function Na(e,t,n,r,i,a,o,s,c){let l=e,u=t,d=Math.abs(n/2),f=Math.abs(r/2);d+=Wa(d*.01,c),f+=Wa(f*.01,c);let p=i,m=a;for(;p<0;)p+=Math.PI*2,m+=Math.PI*2;m-p>Math.PI*2&&(p=0,m=Math.PI*2);let h=Math.PI*2/c.curveStepCount,g=Math.min(h/2,(m-p)/2),_=Xa(g,l,u,d,f,p,m,1,c);if(!c.disableMultiStroke){let e=Xa(g,l,u,d,f,p,m,1.5,c);_.push(...e)}return o&&(s?_.push(...Ga(l,u,l+d*Math.cos(p),u+f*Math.sin(p),c),...Ga(l,u,l+d*Math.cos(m),u+f*Math.sin(m),c)):_.push({op:`lineTo`,data:[l,u]},{op:`lineTo`,data:[l+d*Math.cos(p),u+f*Math.sin(p)]})),{type:`path`,ops:_}}function Pa(e,t){let n=ba(ya(va(e))),r=[],i=[0,0],a=[0,0];for(let{key:e,data:o}of n)switch(e){case`M`:a=[o[0],o[1]],i=[o[0],o[1]];break;case`L`:r.push(...Ga(a[0],a[1],o[0],o[1],t)),a=[o[0],o[1]];break;case`C`:{let[e,n,i,s,c,l]=o;r.push(...Za(e,n,i,s,c,l,a,t)),a=[c,l];break}case`Z`:r.push(...Ga(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]]}return{type:`path`,ops:r}}function Fa(e,t){let n=[];for(let r of e)if(r.length){let e=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:`move`,data:[r[0][0]+Wa(e,t),r[0][1]+Wa(e,t)]});for(let a=1;a<i;a++)n.push({op:`lineTo`,data:[r[a][0]+Wa(e,t),r[a][1]+Wa(e,t)]})}}return{type:`fillPath`,ops:n}}function Ia(e,t){return la(t,wa).fillPolygons(e,t)}function La(e,t,n,r,i,a,o){let s=e,c=t,l=Math.abs(n/2),u=Math.abs(r/2);l+=Wa(l*.01,o),u+=Wa(u*.01,o);let d=i,f=a;for(;d<0;)d+=Math.PI*2,f+=Math.PI*2;f-d>Math.PI*2&&(d=0,f=Math.PI*2);let p=(f-d)/o.curveStepCount,m=[];for(let e=d;e<=f;e+=p)m.push([s+l*Math.cos(e),c+u*Math.sin(e)]);return m.push([s+l*Math.cos(f),c+u*Math.sin(f)]),m.push([s,c]),Ia([m],o)}function Ra(e,t){return Wa(e,t)}function za(e,t,n){return Ua(e,t,n)}function Ba(e,t,n,r,i){return Ga(e,t,n,r,i,!0)}function Va(e){let t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function Ha(e){return e.randomizer||=new da(e.seed||0),e.randomizer.next()}function Ua(e,t,n,r=1){return n.roughness*r*(Ha(n)*(t-e)+e)}function Wa(e,t,n=1){return Ua(-e,e,t,n)}function Ga(e,t,n,r,i,a=!1){let o=a?i.disableMultiStrokeFill:i.disableMultiStroke,s=Ka(e,t,n,r,i,!0,!1);if(o)return s;let c=Ka(e,t,n,r,i,!0,!0);return s.concat(c)}function Ka(e,t,n,r,i,a,o){let s=(e-n)**2+(t-r)**2,c=Math.sqrt(s),l=1;l=c<200?1:c>500?.4:-.0016668*c+1.233334;let u=i.maxRandomnessOffset||0;u*u*100>s&&(u=c/10);let d=u/2,f=.2+Ha(i)*.2,p=i.bowing*i.maxRandomnessOffset*(r-t)/200,m=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=Wa(p,i,l),m=Wa(m,i,l);let h=[],g=()=>Wa(d,i,l),_=()=>Wa(u,i,l),v=i.preserveVertices;return a&&(o?h.push({op:`move`,data:[e+(v?0:g()),t+(v?0:g())]}):h.push({op:`move`,data:[e+(v?0:Wa(u,i,l)),t+(v?0:Wa(u,i,l))]})),o?h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+g(),m+t+(r-t)*f+g(),p+e+2*(n-e)*f+g(),m+t+2*(r-t)*f+g(),n+(v?0:g()),r+(v?0:g())]}):h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+_(),m+t+(r-t)*f+_(),p+e+2*(n-e)*f+_(),m+t+2*(r-t)*f+_(),n+(v?0:_()),r+(v?0:_())]}),h}function qa(e,t,n){let r=[];r.push([e[0][0]+Wa(t,n),e[0][1]+Wa(t,n)]),r.push([e[0][0]+Wa(t,n),e[0][1]+Wa(t,n)]);for(let i=1;i<e.length;i++)r.push([e[i][0]+Wa(t,n),e[i][1]+Wa(t,n)]),i===e.length-1&&r.push([e[i][0]+Wa(t,n),e[i][1]+Wa(t,n)]);return Ja(r,null,n)}function Ja(e,t,n){let r=e.length,i=[];if(r>3){let a=[],o=1-n.curveTightness;i.push({op:`move`,data:[e[1][0],e[1][1]]});for(let t=1;t+2<r;t++){let n=e[t];a[0]=[n[0],n[1]],a[1]=[n[0]+(o*e[t+1][0]-o*e[t-1][0])/6,n[1]+(o*e[t+1][1]-o*e[t-1][1])/6],a[2]=[e[t+1][0]+(o*e[t][0]-o*e[t+2][0])/6,e[t+1][1]+(o*e[t][1]-o*e[t+2][1])/6],a[3]=[e[t+1][0],e[t+1][1]],i.push({op:`bcurveTo`,data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(t&&t.length===2){let e=n.maxRandomnessOffset;i.push({op:`lineTo`,data:[t[0]+Wa(e,n),t[1]+Wa(e,n)]})}}else r===3?(i.push({op:`move`,data:[e[1][0],e[1][1]]}),i.push({op:`bcurveTo`,data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&i.push(...Ga(e[0][0],e[0][1],e[1][0],e[1][1],n));return i}function Ya(e,t,n,r,i,a,o,s){let c=s.roughness===0,l=[],u=[];if(c){e/=4,u.push([t+r*Math.cos(-e),n+i*Math.sin(-e)]);for(let a=0;a<=Math.PI*2;a+=e){let e=[t+r*Math.cos(a),n+i*Math.sin(a)];l.push(e),u.push(e)}u.push([t+r*Math.cos(0),n+i*Math.sin(0)]),u.push([t+r*Math.cos(e),n+i*Math.sin(e)])}else{let c=Wa(.5,s)-Math.PI/2;u.push([Wa(a,s)+t+.9*r*Math.cos(c-e),Wa(a,s)+n+.9*i*Math.sin(c-e)]);let d=Math.PI*2+c-.01;for(let o=c;o<d;o+=e){let e=[Wa(a,s)+t+r*Math.cos(o),Wa(a,s)+n+i*Math.sin(o)];l.push(e),u.push(e)}u.push([Wa(a,s)+t+r*Math.cos(c+Math.PI*2+o*.5),Wa(a,s)+n+i*Math.sin(c+Math.PI*2+o*.5)]),u.push([Wa(a,s)+t+.98*r*Math.cos(c+o),Wa(a,s)+n+.98*i*Math.sin(c+o)]),u.push([Wa(a,s)+t+.9*r*Math.cos(c+o*.5),Wa(a,s)+n+.9*i*Math.sin(c+o*.5)])}return[u,l]}function Xa(e,t,n,r,i,a,o,s,c){let l=a+Wa(.1,c),u=[];u.push([Wa(s,c)+t+.9*r*Math.cos(l-e),Wa(s,c)+n+.9*i*Math.sin(l-e)]);for(let a=l;a<=o;a+=e)u.push([Wa(s,c)+t+r*Math.cos(a),Wa(s,c)+n+i*Math.sin(a)]);return u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),Ja(u,null,c)}function Za(e,t,n,r,i,a,o,s){let c=[],l=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3],u=[0,0],d=s.disableMultiStroke?1:2,f=s.preserveVertices;for(let p=0;p<d;p++)p===0?c.push({op:`move`,data:[o[0],o[1]]}):c.push({op:`move`,data:[o[0]+(f?0:Wa(l[0],s)),o[1]+(f?0:Wa(l[0],s))]}),u=f?[i,a]:[i+Wa(l[p],s),a+Wa(l[p],s)],c.push({op:`bcurveTo`,data:[e+Wa(l[p],s),t+Wa(l[p],s),n+Wa(l[p],s),r+Wa(l[p],s),u[0],u[1]]});return c}function Qa(e){return[...e]}function $a(e,t=0){let n=e.length;if(n<3)throw Error(`A curve must have at least three points.`);let r=[];if(n===3)r.push(Qa(e[0]),Qa(e[1]),Qa(e[2]),Qa(e[2]));else{let n=[];n.push(e[0],e[0]);for(let t=1;t<e.length;t++)n.push(e[t]),t===e.length-1&&n.push(e[t]);let i=[],a=1-t;r.push(Qa(n[0]));for(let e=1;e+2<n.length;e++){let t=n[e];i[0]=[t[0],t[1]],i[1]=[t[0]+(a*n[e+1][0]-a*n[e-1][0])/6,t[1]+(a*n[e+1][1]-a*n[e-1][1])/6],i[2]=[n[e+1][0]+(a*n[e][0]-a*n[e+2][0])/6,n[e+1][1]+(a*n[e][1]-a*n[e+2][1])/6],i[3]=[n[e+1][0],n[e+1][1]],r.push(i[1],i[2],i[3])}}return r}function eo(e,t){return Math.sqrt(to(e,t))}function to(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2}function no(e,t,n){let r=to(t,n);if(r===0)return to(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),to(e,ro(t,n,i))}function ro(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function io(e,t){let n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3],o=3*r[0]-2*n[0]-a[0];o*=o;let s=3*r[1]-2*n[1]-a[1];s*=s;let c=3*i[0]-2*a[0]-n[0];c*=c;let l=3*i[1]-2*a[1]-n[1];return l*=l,o<c&&(o=c),s<l&&(s=l),o+s}function ao(e,t,n,r){let i=r||[];if(io(e,t)<n){let n=e[t+0];i.length?eo(i[i.length-1],n)>1&&i.push(n):i.push(n),i.push(e[t+3])}else{let r=.5,a=e[t+0],o=e[t+1],s=e[t+2],c=e[t+3],l=ro(a,o,r),u=ro(o,s,r),d=ro(s,c,r),f=ro(l,u,r),p=ro(u,d,r),m=ro(f,p,r);ao([a,l,f,m],0,n,i),ao([m,p,d,c],0,n,i)}return i}function oo(e,t){return so(e,0,e.length,t)}function so(e,t,n,r,i){let a=i||[],o=e[t],s=e[n-1],c=0,l=1;for(let r=t+1;r<n-1;++r){let t=no(e[r],o,s);t>c&&(c=t,l=r)}return Math.sqrt(c)>r?(so(e,t,l+1,r,a),so(e,l,n,r,a)):(a.length||a.push(o),a.push(s)),a}function co(e,t=.15,n){let r=[],i=(e.length-1)/3;for(let n=0;n<i;n++)ao(e,n*3,t,r);return n&&n>0?so(r,0,r.length,n):r}function lo(e,t,n){let r=ba(ya(va(e))),i=[],a=[],o=[0,0],s=[],c=()=>{s.length>=4&&a.push(...co(s,t)),s=[]},l=()=>{c(),a.length&&(i.push(a),a=[])};for(let{key:e,data:t}of r)switch(e){case`M`:l(),o=[t[0],t[1]],a.push(o);break;case`L`:c(),a.push([t[0],t[1]]);break;case`C`:if(!s.length){let e=a.length?a[a.length-1]:o;s.push([e[0],e[1]])}s.push([t[0],t[1]]),s.push([t[2],t[3]]),s.push([t[4],t[5]]);break;case`Z`:c(),a.push([o[0],o[1]])}if(l(),!n)return i;let u=[];for(let e of i){let t=oo(e,n);t.length&&u.push(t)}return u}var uo=`none`,fo=class{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:`#000`,strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:`hachure`,fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return ua()}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,i){let a=this._o(i);return this._d(`line`,[Ta(e,t,n,r,a)],a)}rectangle(e,t,n,r,i){let a=this._o(i),o=[],s=Oa(e,t,n,r,a);if(a.fill){let i=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];a.fillStyle===`solid`?o.push(Fa([i],a)):o.push(Ia([i],a))}return a.stroke!==uo&&o.push(s),this._d(`rectangle`,o,a)}ellipse(e,t,n,r,i){let a=this._o(i),o=[],s=ja(n,r,a),c=Ma(e,t,a,s);if(a.fill){if(a.fillStyle===`solid`){let n=Ma(e,t,a,s).opset;n.type=`fillPath`,o.push(n)}else o.push(Ia([c.estimatedPoints],a))}return a.stroke!==uo&&o.push(c.opset),this._d(`ellipse`,o,a)}circle(e,t,n,r){let i=this.ellipse(e,t,n,n,r);return i.shape=`circle`,i}linearPath(e,t){let n=this._o(t);return this._d(`linearPath`,[Ea(e,!1,n)],n)}arc(e,t,n,r,i,a,o=!1,s){let c=this._o(s),l=[],u=Na(e,t,n,r,i,a,o,!0,c);if(o&&c.fill){if(c.fillStyle===`solid`){let o=Object.assign({},c);o.disableMultiStroke=!0;let s=Na(e,t,n,r,i,a,!0,!1,o);s.type=`fillPath`,l.push(s)}else l.push(La(e,t,n,r,i,a,c))}return c.stroke!==uo&&l.push(u),this._d(`arc`,l,c)}curve(e,t){let n=this._o(t),r=[],i=ka(e,n);if(n.fill&&n.fill!==uo&&e.length>=3){if(n.fillStyle===`solid`){let t=ka(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else{let t=co($a(e),10,(1+n.roughness)/2);r.push(Ia([t],n))}}return n.stroke!==uo&&r.push(i),this._d(`curve`,r,n)}polygon(e,t){let n=this._o(t),r=[],i=Ea(e,!0,n);return n.fill&&(n.fillStyle===`solid`?r.push(Fa([e],n)):r.push(Ia([e],n))),n.stroke!==uo&&r.push(i),this._d(`polygon`,r,n)}path(e,t){let n=this._o(t),r=[];if(!e)return this._d(`path`,r,n);e=(e||``).replace(/\n/g,` `).replace(/(-\s)/g,`-`).replace(`/(ss)/g`,` `);let i=n.fill&&n.fill!==`transparent`&&n.fill!==uo,a=n.stroke!==uo,o=!!(n.simplification&&n.simplification<1),s=o?4-4*(n.simplification||1):(1+n.roughness)/2,c=lo(e,1,s),l=Pa(e,n);if(i){if(n.fillStyle===`solid`){if(c.length===1){let t=Pa(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else r.push(Fa(c,n))}else r.push(Ia(c,n))}return a&&(o?c.forEach(e=>{r.push(Ea(e,!1,n))}):r.push(l)),this._d(`path`,r,n)}opsToPath(e,t){let n=``;for(let r of e.ops){let e=typeof t==`number`&&t>=0?r.data.map(e=>+e.toFixed(t)):r.data;switch(r.op){case`move`:n+=`M${e[0]} ${e[1]} `;break;case`bcurveTo`:n+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case`lineTo`:n+=`L${e[0]} ${e[1]} `}}return n.trim()}toPaths(e){let t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(let e of t){let t=null;switch(e.type){case`path`:t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:uo};break;case`fillPath`:t={d:this.opsToPath(e),stroke:uo,strokeWidth:0,fill:n.fill||uo};break;case`fillSketch`:t=this.fillSketch(e,n)}t&&r.push(t)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||uo,strokeWidth:n,fill:uo}}_mergedShape(e){return e.filter((e,t)=>t===0||e.op!==`move`)}},po=class{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext(`2d`),this.gen=new fo(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.ctx,i=e.options.fixedDecimalPlaceDigits;for(let a of t)switch(a.type){case`path`:r.save(),r.strokeStyle=n.stroke===`none`?`transparent`:n.stroke,r.lineWidth=n.strokeWidth,n.strokeLineDash&&r.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(r.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(r,a,i),r.restore();break;case`fillPath`:{r.save(),r.fillStyle=n.fill||``;let t=e.shape===`curve`||e.shape===`polygon`||e.shape===`path`?`evenodd`:`nonzero`;this._drawToContext(r,a,i,t),r.restore();break}case`fillSketch`:this.fillSketch(r,a,n)}}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||``,e.lineWidth=r,this._drawToContext(e,t,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,t,n,r=`nonzero`){e.beginPath();for(let r of t.ops){let t=typeof n==`number`&&n>=0?r.data.map(e=>+e.toFixed(n)):r.data;switch(r.op){case`move`:e.moveTo(t[0],t[1]);break;case`bcurveTo`:e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]);break;case`lineTo`:e.lineTo(t[0],t[1])}}t.type===`fillPath`?e.fill(r):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a),a}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a),a}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a),a}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i),i}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n),n}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n),n}arc(e,t,n,r,i,a,o=!1,s){let c=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(c),c}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n),n}path(e,t){let n=this.gen.path(e,t);return this.draw(n),n}},mo=`http://www.w3.org/2000/svg`,ho=class{constructor(e,t){this.svg=e,this.gen=new fo(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,i=r.createElementNS(mo,`g`),a=e.options.fixedDecimalPlaceDigits;for(let o of t){let t=null;switch(o.type){case`path`:t=r.createElementNS(mo,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,n.stroke),t.setAttribute(`stroke-width`,n.strokeWidth+``),t.setAttribute(`fill`,`none`),n.strokeLineDash&&t.setAttribute(`stroke-dasharray`,n.strokeLineDash.join(` `).trim()),n.strokeLineDashOffset&&t.setAttribute(`stroke-dashoffset`,`${n.strokeLineDashOffset}`);break;case`fillPath`:t=r.createElementNS(mo,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,`none`),t.setAttribute(`stroke-width`,`0`),t.setAttribute(`fill`,n.fill||``),(e.shape===`curve`||e.shape===`polygon`)&&t.setAttribute(`fill-rule`,`evenodd`);break;case`fillSketch`:t=this.fillSketch(r,o,n)}t&&i.appendChild(t)}return i}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);let i=e.createElementNS(mo,`path`);return i.setAttribute(`d`,this.opsToPath(t,n.fixedDecimalPlaceDigits)),i.setAttribute(`stroke`,n.fill||``),i.setAttribute(`stroke-width`,r+``),i.setAttribute(`fill`,`none`),n.fillLineDash&&i.setAttribute(`stroke-dasharray`,n.fillLineDash.join(` `).trim()),n.fillLineDashOffset&&i.setAttribute(`stroke-dashoffset`,`${n.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a)}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a)}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a)}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i)}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n)}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n)}arc(e,t,n,r,i,a,o=!1,s){let c=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(c)}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n)}path(e,t){let n=this.gen.path(e,t);return this.draw(n)}},go={canvas(e,t){return new po(e,t)},svg(e,t){return new ho(e,t)},generator(e){return new fo(e)},newSeed(){return fo.newSeed()}};function _o(e,t,n,r=e=>e){return e*r(.5-t*(.5-n))}function vo(e){return[-e[0],-e[1]]}function yo(e,t){return[e[0]+t[0],e[1]+t[1]]}function bo(e,t){return[e[0]-t[0],e[1]-t[1]]}function xo(e,t){return[e[0]*t,e[1]*t]}function So(e,t){return[e[0]/t,e[1]/t]}function Co(e){return[e[1],-e[0]]}function wo(e,t){return e[0]*t[0]+e[1]*t[1]}function To(e,t){return e[0]===t[0]&&e[1]===t[1]}function Eo(e){return Math.hypot(e[0],e[1])}function Do(e){return e[0]*e[0]+e[1]*e[1]}function Oo(e,t){return Do(bo(e,t))}function ko(e){return So(e,Eo(e))}function Ao(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function jo(e,t,n){let r=Math.sin(n),i=Math.cos(n),a=e[0]-t[0],o=e[1]-t[1],s=a*i-o*r,c=a*r+o*i;return[s+t[0],c+t[1]]}function Mo(e,t,n){return yo(e,xo(bo(t,e),n))}function No(e,t,n){return yo(e,xo(t,n))}var{min:Po,PI:Fo}=Math,Io=.275,Lo=Fo+1e-4;function Ro(e,t={}){let{size:n=16,smoothing:r=.5,thinning:i=.5,simulatePressure:a=!0,easing:o=e=>e,start:s={},end:c={},last:l=!1}=t,{cap:u=!0,easing:d=e=>e*(2-e)}=s,{cap:f=!0,easing:p=e=>--e*e*e+1}=c;if(e.length===0||n<=0)return[];let m=e[e.length-1].runningLength,h=s.taper===!1?0:s.taper===!0?Math.max(n,m):s.taper,g=c.taper===!1?0:c.taper===!0?Math.max(n,m):c.taper,_=(n*r)**2,v=[],y=[],b=e.slice(0,10).reduce((e,t)=>{let r=t.pressure;if(a){let i=Po(1,t.distance/n);r=Po(1,e+(Po(1,1-i)-e)*(i*Io))}return(e+r)/2},e[0].pressure),x=_o(n,i,e[e.length-1].pressure,o),S,C=e[0].vector,w=e[0].point,T=w,E=w,D=T,ee=!1;for(let t=0;t<e.length;t++){let{pressure:r}=e[t],{point:s,vector:c,distance:l,runningLength:u}=e[t];if(t<e.length-1&&m-u<3)continue;if(i){if(a){let e=Po(1,l/n),t=Po(1,1-e);r=Po(1,b+(t-b)*(e*Io))}x=_o(n,i,r,o)}else x=n/2;S===void 0&&(S=x);let f=u<h?d(u/h):1,te=m-u<g?p((m-u)/g):1;x=Math.max(.01,x*Math.min(f,te));let ne=(t<e.length-1?e[t+1]:e[t]).vector,re=t<e.length-1?wo(c,ne):1,ie=wo(c,C)<0&&!ee,ae=re!==null&&re<0;if(ie||ae){let e=xo(Co(C),x);for(let t=0;t<=1;t+=.07692307692307693)E=jo(bo(s,e),s,Lo*t),v.push(E),D=jo(yo(s,e),s,Lo*-t),y.push(D);w=E,T=D,ae&&(ee=!0);continue}if(ee=!1,t===e.length-1){let e=xo(Co(c),x);v.push(bo(s,e)),y.push(yo(s,e));continue}let oe=xo(Co(Mo(ne,c,re)),x);E=bo(s,oe),(t<=1||Oo(w,E)>_)&&(v.push(E),w=E),D=yo(s,oe),(t<=1||Oo(T,D)>_)&&(y.push(D),T=D),b=r,C=c}let te=e[0].point.slice(0,2),ne=e.length>1?e[e.length-1].point.slice(0,2):yo(e[0].point,[1,1]),re=[],ie=[];if(e.length===1){if(!(h||g)||l){let e=No(te,ko(Co(bo(te,ne))),-(S||x)),t=[];for(let n=1/13,r=n;r<=1;r+=n)t.push(jo(e,te,Lo*2*r));return t}}else{if(!(h||g&&e.length===1)){if(u)for(let e=1/13,t=e;t<=1;t+=e){let e=jo(y[0],te,Lo*t);re.push(e)}else{let e=bo(v[0],y[0]),t=xo(e,.5),n=xo(e,.51);re.push(bo(te,t),bo(te,n),yo(te,n),yo(te,t))}}let t=Co(vo(e[e.length-1].vector));if(g||h&&e.length===1)ie.push(ne);else if(f){let e=No(ne,t,x);for(let t=1/29,n=t;n<1;n+=t)ie.push(jo(e,ne,Lo*3*n))}else ie.push(yo(ne,xo(t,x)),yo(ne,xo(t,x*.99)),bo(ne,xo(t,x*.99)),bo(ne,xo(t,x)))}return v.concat(ie,y.reverse(),re)}function zo(e,t={}){let{streamline:n=.5,size:r=16,last:i=!1}=t;if(e.length===0)return[];let a=.15+(1-n)*.85,o=Array.isArray(e[0])?e:e.map(({x:e,y:t,pressure:n=.5})=>[e,t,n]);if(o.length===2){let e=o[1];o=o.slice(0,-1);for(let t=1;t<5;t++)o.push(Mo(o[0],e,t/4))}o.length===1&&(o=[...o,[...yo(o[0],[1,1]),...o[0].slice(2)]]);let s=[{point:[o[0][0],o[0][1]],pressure:o[0][2]>=0?o[0][2]:.25,vector:[1,1],distance:0,runningLength:0}],c=!1,l=0,u=s[0],d=o.length-1;for(let e=1;e<o.length;e++){let t=i&&e===d?o[e].slice(0,2):Mo(u.point,o[e],a);if(To(u.point,t))continue;let n=Ao(t,u.point);if(l+=n,e<d&&!c){if(l<r)continue;c=!0}u={point:t,pressure:o[e][2]>=0?o[e][2]:.5,vector:ko(bo(u.point,t)),distance:n,runningLength:l},s.push(u)}return s[0].vector=s[1]?.vector||[0,0],s}function Bo(e,t={}){return Ro(zo(e,t),t)}function Vo(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Vo(e[t]))&&(r&&(r+=` `),r+=n);else for(t in e)e[t]&&(r&&(r+=` `),r+=t)}return r}function O(){for(var e=0,t,n,r=``;e<arguments.length;)(t=arguments[e++])&&(n=Vo(t))&&(r&&(r+=` `),r+=n);return r}var Ho=n((e=>{var t=i(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),a=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var i,c={},l=null,u=null;for(i in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)a.call(t,i)&&!s.hasOwnProperty(i)&&(c[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)c[i]===void 0&&(c[i]=t[i]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:o.current}}e.Fragment=r,e.jsx=c,e.jsxs=c})),k=n(((e,t)=>{t.exports=Ho()}))();function Uo(e,t){return Math.sqrt(Wo(e,t))}function Wo(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2}function Go(e,t,n){let r=Wo(t,n);if(r===0)return Wo(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),Wo(e,Ko(t,n,i))}function Ko(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function qo(e,t){let n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3],o=3*r[0]-2*n[0]-a[0];o*=o;let s=3*r[1]-2*n[1]-a[1];s*=s;let c=3*i[0]-2*a[0]-n[0];c*=c;let l=3*i[1]-2*a[1]-n[1];return l*=l,o<c&&(o=c),s<l&&(s=l),o+s}function Jo(e,t,n,r){let i=r||[];if(qo(e,t)<n){let n=e[t+0];i.length?Uo(i[i.length-1],n)>1&&i.push(n):i.push(n),i.push(e[t+3])}else{let r=.5,a=e[t+0],o=e[t+1],s=e[t+2],c=e[t+3],l=Ko(a,o,r),u=Ko(o,s,r),d=Ko(s,c,r),f=Ko(l,u,r),p=Ko(u,d,r),m=Ko(f,p,r);Jo([a,l,f,m],0,n,i),Jo([m,p,d,c],0,n,i)}return i}function Yo(e,t){return Xo(e,0,e.length,t)}function Xo(e,t,n,r,i){let a=i||[],o=e[t],s=e[n-1],c=0,l=1;for(let r=t+1;r<n-1;++r){let t=Go(e[r],o,s);t>c&&(c=t,l=r)}return Math.sqrt(c)>r?(Xo(e,t,l+1,r,a),Xo(e,l,n,r,a)):(a.length||a.push(o),a.push(s)),a}function Zo(e,t=.15,n){let r=[],i=(e.length-1)/3;for(let n=0;n<i;n++)Jo(e,n*3,t,r);return n&&n>0?Xo(r,0,r.length,n):r}var Qo=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.sanitizeUrl=void 0;var t=/^([^\w]*)(javascript|data|vbscript)/im,n=/&#(\w+)(^\w|;)?/g,r=/&(newline|tab);/gi,i=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,a=/^.+(:|:)/gim,o=[`.`,`/`];function s(e){return o.indexOf(e[0])>-1}function c(e){return e.replace(n,function(e,t){return String.fromCharCode(t)})}function l(e){var n=c(e||``).replace(r,``).replace(i,``).trim();if(!n)return`about:blank`;if(s(n))return n;var o=n.match(a);if(!o)return n;var l=o[0];return t.test(l)?`about:blank`:n}e.sanitizeUrl=l}))(),$o=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`;function es(e,t,n){let r=n[0];if(t!=null&&e>=t)throw Error(e+` >= `+t);if(e.slice(-1)===r||t&&t.slice(-1)===r)throw Error(`trailing zero`);if(t){let i=0;for(;(e[i]||r)===t[i];)i++;if(i>0)return t.slice(0,i)+es(e.slice(i),t.slice(i),n)}let i=e?n.indexOf(e[0]):0,a=t==null?n.length:n.indexOf(t[0]);return a-i>1?n[Math.round(.5*(i+a))]:t&&t.length>1?t.slice(0,1):n[i]+es(e.slice(1),null,n)}function ts(e){if(e.length!==ns(e[0]))throw Error(`invalid integer part of order key: `+e)}function ns(e){if(e>=`a`&&e<=`z`)return e.charCodeAt(0)-97+2;if(e>=`A`&&e<=`Z`)return 90-e.charCodeAt(0)+2;throw Error(`invalid order key head: `+e)}function rs(e){let t=ns(e[0]);if(t>e.length)throw Error(`invalid order key: `+e);return e.slice(0,t)}function is(e,t){if(e===`A`+t[0].repeat(26))throw Error(`invalid order key: `+e);let n=rs(e);if(e.slice(n.length).slice(-1)===t[0])throw Error(`invalid order key: `+e)}function as(e,t){ts(e);let[n,...r]=e.split(``),i=!0;for(let e=r.length-1;i&&e>=0;e--){let n=t.indexOf(r[e])+1;n===t.length?r[e]=t[0]:(r[e]=t[n],i=!1)}if(i){if(n===`Z`)return`a`+t[0];if(n===`z`)return null;let e=String.fromCharCode(n.charCodeAt(0)+1);return e>`a`?r.push(t[0]):r.pop(),e+r.join(``)}return n+r.join(``)}function os(e,t){ts(e);let[n,...r]=e.split(``),i=!0;for(let e=r.length-1;i&&e>=0;e--){let n=t.indexOf(r[e])-1;n===-1?r[e]=t.slice(-1):(r[e]=t[n],i=!1)}if(i){if(n===`a`)return`Z`+t.slice(-1);if(n===`A`)return null;let e=String.fromCharCode(n.charCodeAt(0)-1);return e<`Z`?r.push(t.slice(-1)):r.pop(),e+r.join(``)}return n+r.join(``)}function ss(e,t,n=$o){if(e!=null&&is(e,n),t!=null&&is(t,n),e!=null&&t!=null&&e>=t)throw Error(e+` >= `+t);if(e==null){if(t==null)return`a`+n[0];let e=rs(t),r=t.slice(e.length);if(e===`A`+n[0].repeat(26))return e+es(``,r,n);if(e<t)return e;let i=os(e,n);if(i==null)throw Error(`cannot decrement any more`);return i}if(t==null){let t=rs(e),r=e.slice(t.length);return as(t,n)??t+es(r,null,n)}let r=rs(e),i=e.slice(r.length),a=rs(t),o=t.slice(a.length);if(r===a)return r+es(i,o,n);let s=as(r,n);if(s==null)throw Error(`cannot increment any more`);return s<t?s:r+es(i,null,n)}function cs(e,t,n,r=$o){if(n===0)return[];if(n===1)return[ss(e,t,r)];if(t==null){let i=ss(e,t,r),a=[i];for(let e=0;e<n-1;e++)i=ss(i,t,r),a.push(i);return a}if(e==null){let i=ss(e,t,r),a=[i];for(let t=0;t<n-1;t++)i=ss(e,i,r),a.push(i);return a.reverse(),a}let i=Math.floor(n/2),a=ss(e,t,r);return[...cs(e,a,i,r),a,...cs(a,t,n-i-1,r)]}var ls=`modulepreload`,us=function(e,t){return new URL(e,t).href},ds={},A=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=us(t,n),t=s(t),t in ds)return;ds[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:ls,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},fs=typeof self>`u`?!1:!(`top`in self&&self!==top)&&`showOpenFilePicker`in self&&`showOpenFilePicker`,ps=A(fs?()=>import(`./file-open-002ab408-BHUWm0Sh.js`):()=>import(`./file-open-7c801643-DZtJT5zp.js`),[],import.meta.url);async function ms(...e){return(await ps).default(...e)}A(fs?()=>import(`./directory-open-4ed118d0-1i309Asm.js`):()=>import(`./directory-open-01563666-D4xXyWb_.js`),[],import.meta.url);var hs=A(fs?()=>import(`./file-save-745eba88-Bwdfz6OZ.js`):()=>import(`./file-save-3189631c-CO9S4HFW.js`),[],import.meta.url);async function gs(...e){return(await hs).default(...e)}var _s=(e,t)=>t.reduce((t,n)=>(n in e&&(t[n]=e[n]),t),{}),vs=4,ys=[0,2,4,6,8],bs=(e,t)=>t.map(t=>Ui[e][t]),xs={transparent:`transparent`,black:`#1e1e1e`,white:`#ffffff`,gray:bs(`gray`,ys),red:bs(`red`,ys),pink:bs(`pink`,ys),grape:bs(`grape`,ys),violet:bs(`violet`,ys),blue:bs(`blue`,ys),cyan:bs(`cyan`,ys),teal:bs(`teal`,ys),green:bs(`green`,ys),yellow:bs(`yellow`,ys),orange:bs(`orange`,ys),bronze:[`#f8f1ee`,`#eaddd7`,`#d2bab0`,`#a18072`,`#846358`]},Ss=_s(xs,[`cyan`,`blue`,`violet`,`grape`,`pink`,`green`,`teal`,`yellow`,`orange`,`red`]),Cs=[xs.black,xs.red[4],xs.green[4],xs.blue[4],xs.yellow[4]],ws=[xs.transparent,xs.red[1],xs.green[1],xs.blue[1],xs.yellow[1]],Ts=[xs.white,`#f8f9fa`,`#f5faff`,`#fffce8`,`#fdf8f6`],Es={transparent:xs.transparent,white:xs.white,gray:xs.gray,black:xs.black,bronze:xs.bronze,...Ss},Ds={transparent:xs.transparent,white:xs.white,gray:xs.gray,black:xs.black,bronze:xs.bronze,...Ss},Os=e=>[xs.cyan[e],xs.blue[e],xs.violet[e],xs.grape[e],xs.pink[e],xs.green[e],xs.teal[e],xs.yellow[e],xs.orange[e],xs.red[e]],ks=(e,t,n)=>`#${((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)}`,As=/Mac|iPod|iPhone|iPad/.test(navigator.platform),js=/^Win/.test(navigator.platform),Ms=/\b(android)\b/i.test(navigator.userAgent),Ns=`netscape`in window&&navigator.userAgent.indexOf(`rv:`)>1&&navigator.userAgent.indexOf(`Gecko`)>1,Ps=navigator.userAgent.indexOf(`Chrome`)===-1&&navigator.userAgent.indexOf(`Safari`)!==-1,Fs=/iPad|iPhone/.test(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document,Is=()=>navigator.brave?.isBrave?.name===`isBrave`,Ls=typeof window<`u`&&`ResizeObserver`in window,Rs=`Excalidraw`,zs=36,Bs=Math.PI/12,Vs={TEXT:`text`,CROSSHAIR:`crosshair`,GRABBING:`grabbing`,GRAB:`grab`,POINTER:`pointer`,MOVE:`move`,AUTO:``},Hs={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},Us={enabled:`all`,disabled:`none`,inheritFromUI:`var(--ui-pointerEvents)`},Ws={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},Gs={TEST:`test`,DEVELOPMENT:`development`},Ks={SHAPE_ACTIONS_MENU:`App-menu__left`,ZOOM_ACTIONS:`zoom-actions`,SEARCH_MENU_INPUT_WRAPPER:`layer-ui__search-inputWrapper`},qs=`Xiaolai`,Js=`Segoe UI Emoji`,Ys={Virgil:1,Helvetica:2,Cascadia:3,Excalifont:5,Nunito:6,"Lilita One":7,"Comic Shanns":8,"Liberation Sans":9},Xs={[qs]:100,[Js]:1e3},Zs=e=>{switch(e){case Ys.Excalifont:return[qs,Js];default:return[Js]}},Qs={LIGHT:`light`,DARK:`dark`},$s={strokeColor:`#bbb`,strokeWidth:2,strokeStyle:`solid`,fillStyle:`solid`,roughness:0,roundness:null,backgroundColor:`transparent`,radius:8,nameOffsetY:3,nameColorLightTheme:`#999999`,nameColorDarkTheme:`#7a7a7a`,nameFontSize:14,nameLineHeight:1.25},ec=1,tc=Ys.Excalifont,nc=`left`,rc=4,ic=2*rc-1e-5,ac=`#ffffff`,oc=`#a2f1a6`,sc=5,cc={svg:`image/svg+xml`,png:`image/png`,jpg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,bmp:`image/bmp`,ico:`image/x-icon`,avif:`image/avif`,jfif:`image/jfif`},j={text:`text/plain`,html:`text/html`,json:`application/json`,excalidraw:`application/vnd.excalidraw+json`,excalidrawlib:`application/vnd.excalidrawlib+json`,"excalidraw.svg":`image/svg+xml`,"excalidraw.png":`image/png`,binary:`application/octet-stream`,...cc},lc=[j.text,j.html,...Object.values(cc)],uc={png:`png`,svg:`svg`,clipboard:`clipboard`},dc={excalidraw:`excalidraw`,excalidrawClipboard:`excalidraw/clipboard`,excalidrawLibrary:`excalidrawlib`,excalidrawClipboardWithAPI:`excalidraw-api/clipboard`},fc=window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,pc=.1,mc=.1,hc=`invert(93%) hue-rotate(180deg)`,gc={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0},tools:{image:!0}},_c=1229,vc=2,yc=[1,2,3],bc=1440,xc=4194304,Sc=`http://www.w3.org/2000/svg`,Cc={excalidraw:2,excalidrawLibrary:2},wc=.7,Tc=11,Ec={TOP:`top`,MIDDLE:`middle`,BOTTOM:`bottom`},Dc={LEFT:`left`,CENTER:`center`,RIGHT:`right`},Oc=20,kc=.25,Ac=32,jc={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},M={architect:0,artist:1,cartoonist:2},Mc={thin:1,bold:2,extraBold:4},Nc={strokeColor:xs.black,backgroundColor:xs.transparent,fillStyle:`solid`,strokeWidth:2,strokeStyle:`solid`,roughness:M.artist,opacity:100,locked:!1},Pc=`library`,Fc=`search`,Ic={name:`default`,defaultTab:Pc},Lc=new Set([`iframe`,`embeddable`,`image`]),Rc={selection:`selection`,rectangle:`rectangle`,diamond:`diamond`,ellipse:`ellipse`,arrow:`arrow`,line:`line`,freedraw:`freedraw`,text:`text`,image:`image`,eraser:`eraser`,hand:`hand`,frame:`frame`,magicframe:`magicframe`,embeddable:`embeddable`,laser:`laser`},zc={OAI_API_KEY:`excalidraw-oai-api-key`,MERMAID_TO_EXCALIDRAW:`mermaid-to-excalidraw`,PUBLISH_LIBRARY:`publish-library-data`},Bc={generalStats:1,elementProperties:2},Vc={sharp:`sharp`,round:`round`,elbow:`elbow`},Hc=.3,Uc=`element`,Wc=Symbol.for(`__test__originalId__`),Gc=(e=>(e.ACTIVE=`active`,e.AWAY=`away`,e.IDLE=`idle`,e))(Gc||{}),Kc=yc.includes(devicePixelRatio)?devicePixelRatio:1,qc=()=>({showWelcomeScreen:!1,theme:Qs.LIGHT,collaborators:new Map,currentChartType:`bar`,currentItemBackgroundColor:Nc.backgroundColor,currentItemEndArrowhead:`arrow`,currentItemFillStyle:Nc.fillStyle,currentItemFontFamily:tc,currentItemFontSize:20,currentItemOpacity:Nc.opacity,currentItemRoughness:Nc.roughness,currentItemStartArrowhead:null,currentItemStrokeColor:Nc.strokeColor,currentItemRoundness:`round`,currentItemArrowType:Vc.round,currentItemStrokeStyle:Nc.strokeStyle,currentItemStrokeWidth:Nc.strokeWidth,currentItemTextAlign:nc,currentHoveredFontFamily:null,cursorButton:`up`,activeEmbeddable:null,newElement:null,editingTextElement:null,editingGroupId:null,editingLinearElement:null,activeTool:{type:`selection`,customType:null,locked:Nc.locked,lastActiveTool:null},penMode:!1,penDetected:!1,errorMessage:null,exportBackground:!0,exportScale:Kc,exportEmbedScene:!1,exportWithDarkMode:!1,fileHandle:null,gridSize:20,gridStep:sc,gridModeEnabled:!1,isBindingEnabled:!0,defaultSidebarDockedPreference:!1,isLoading:!1,isResizing:!1,isRotating:!1,lastPointerDownWith:`mouse`,multiElement:null,name:null,contextMenu:null,openMenu:null,openPopup:null,openSidebar:null,openDialog:null,pasteDialog:{shown:!1,data:null},previousSelectedElementIds:{},resizingElement:null,scrolledOutside:!1,scrollX:0,scrollY:0,selectedElementIds:{},hoveredElementIds:{},selectedGroupIds:{},selectedElementsAreBeingDragged:!1,selectionElement:null,shouldCacheIgnoreZoom:!1,stats:{open:!1,panels:Bc.generalStats|Bc.elementProperties},startBoundElement:null,suggestedBindings:[],frameRendering:{enabled:!0,clip:!0,name:!0,outline:!0},frameToHighlight:null,editingFrame:null,elementsToHighlight:null,toast:null,viewBackgroundColor:xs.white,zenModeEnabled:!1,zoom:{value:1},viewModeEnabled:!1,pendingImageElementId:null,showHyperlinkPopup:!1,selectedLinearElement:null,snapLines:[],originSnapOffset:{x:0,y:0},objectsSnapModeEnabled:!1,userToFollow:null,followedBy:new Set,isCropping:!1,croppingElementId:null,searchMatches:[]}),Jc=(e=>e)({showWelcomeScreen:{browser:!0,export:!1,server:!1},theme:{browser:!0,export:!1,server:!1},collaborators:{browser:!1,export:!1,server:!1},currentChartType:{browser:!0,export:!1,server:!1},currentItemBackgroundColor:{browser:!0,export:!1,server:!1},currentItemEndArrowhead:{browser:!0,export:!1,server:!1},currentItemFillStyle:{browser:!0,export:!1,server:!1},currentItemFontFamily:{browser:!0,export:!1,server:!1},currentItemFontSize:{browser:!0,export:!1,server:!1},currentItemRoundness:{browser:!0,export:!1,server:!1},currentItemArrowType:{browser:!0,export:!1,server:!1},currentItemOpacity:{browser:!0,export:!1,server:!1},currentItemRoughness:{browser:!0,export:!1,server:!1},currentItemStartArrowhead:{browser:!0,export:!1,server:!1},currentItemStrokeColor:{browser:!0,export:!1,server:!1},currentItemStrokeStyle:{browser:!0,export:!1,server:!1},currentItemStrokeWidth:{browser:!0,export:!1,server:!1},currentItemTextAlign:{browser:!0,export:!1,server:!1},currentHoveredFontFamily:{browser:!1,export:!1,server:!1},cursorButton:{browser:!0,export:!1,server:!1},activeEmbeddable:{browser:!1,export:!1,server:!1},newElement:{browser:!1,export:!1,server:!1},editingTextElement:{browser:!1,export:!1,server:!1},editingGroupId:{browser:!0,export:!1,server:!1},editingLinearElement:{browser:!1,export:!1,server:!1},activeTool:{browser:!0,export:!1,server:!1},penMode:{browser:!0,export:!1,server:!1},penDetected:{browser:!0,export:!1,server:!1},errorMessage:{browser:!1,export:!1,server:!1},exportBackground:{browser:!0,export:!1,server:!1},exportEmbedScene:{browser:!0,export:!1,server:!1},exportScale:{browser:!0,export:!1,server:!1},exportWithDarkMode:{browser:!0,export:!1,server:!1},fileHandle:{browser:!1,export:!1,server:!1},gridSize:{browser:!0,export:!0,server:!0},gridStep:{browser:!0,export:!0,server:!0},gridModeEnabled:{browser:!0,export:!0,server:!0},height:{browser:!1,export:!1,server:!1},isBindingEnabled:{browser:!1,export:!1,server:!1},defaultSidebarDockedPreference:{browser:!0,export:!1,server:!1},isLoading:{browser:!1,export:!1,server:!1},isResizing:{browser:!1,export:!1,server:!1},isRotating:{browser:!1,export:!1,server:!1},lastPointerDownWith:{browser:!0,export:!1,server:!1},multiElement:{browser:!1,export:!1,server:!1},name:{browser:!0,export:!1,server:!1},offsetLeft:{browser:!1,export:!1,server:!1},offsetTop:{browser:!1,export:!1,server:!1},contextMenu:{browser:!1,export:!1,server:!1},openMenu:{browser:!0,export:!1,server:!1},openPopup:{browser:!1,export:!1,server:!1},openSidebar:{browser:!0,export:!1,server:!1},openDialog:{browser:!1,export:!1,server:!1},pasteDialog:{browser:!1,export:!1,server:!1},previousSelectedElementIds:{browser:!0,export:!1,server:!1},resizingElement:{browser:!1,export:!1,server:!1},scrolledOutside:{browser:!0,export:!1,server:!1},scrollX:{browser:!0,export:!1,server:!1},scrollY:{browser:!0,export:!1,server:!1},selectedElementIds:{browser:!0,export:!1,server:!1},hoveredElementIds:{browser:!1,export:!1,server:!1},selectedGroupIds:{browser:!0,export:!1,server:!1},selectedElementsAreBeingDragged:{browser:!1,export:!1,server:!1},selectionElement:{browser:!1,export:!1,server:!1},shouldCacheIgnoreZoom:{browser:!0,export:!1,server:!1},stats:{browser:!0,export:!1,server:!1},startBoundElement:{browser:!1,export:!1,server:!1},suggestedBindings:{browser:!1,export:!1,server:!1},frameRendering:{browser:!1,export:!1,server:!1},frameToHighlight:{browser:!1,export:!1,server:!1},editingFrame:{browser:!1,export:!1,server:!1},elementsToHighlight:{browser:!1,export:!1,server:!1},toast:{browser:!1,export:!1,server:!1},viewBackgroundColor:{browser:!0,export:!0,server:!0},width:{browser:!1,export:!1,server:!1},zenModeEnabled:{browser:!0,export:!1,server:!1},zoom:{browser:!0,export:!1,server:!1},viewModeEnabled:{browser:!1,export:!1,server:!1},pendingImageElementId:{browser:!1,export:!1,server:!1},showHyperlinkPopup:{browser:!1,export:!1,server:!1},selectedLinearElement:{browser:!0,export:!1,server:!1},snapLines:{browser:!1,export:!1,server:!1},originSnapOffset:{browser:!1,export:!1,server:!1},objectsSnapModeEnabled:{browser:!0,export:!1,server:!1},userToFollow:{browser:!1,export:!1,server:!1},followedBy:{browser:!1,export:!1,server:!1},isCropping:{browser:!1,export:!1,server:!1},croppingElementId:{browser:!1,export:!1,server:!1},searchMatches:{browser:!1,export:!1,server:!1}}),Yc=(e,t)=>{let n={};for(let r of Object.keys(e))Jc[r]?.[t]&&(n[r]=e[r]);return n},Xc=e=>Yc(e,`export`),Zc=e=>Yc(e,`server`),Qc=({activeTool:e})=>e.type===`eraser`,$c=({activeTool:e})=>e.type===`hand`,el=(e,t,n)=>Math.min(Math.max(e,t),n),tl=(e,t,n=`round`)=>{let r=10**t;return Math[n]((e+2**-52)*r)/r},nl=(e,t,n=`round`)=>{let r=1/t;return Math[n](e*r)/r},rl=(e,t)=>(e+t)/2,il=e=>typeof e==`number`&&Number.isFinite(e),al=(e,t,n=1e-4)=>Math.abs(e-t)<n,ol=e=>e<0?e+2*Math.PI:e>=2*Math.PI?e-2*Math.PI:e;function sl(e){return e*Math.PI/180}function cl(e){return e*180/Math.PI}function ll(e){return Math.abs(Math.sin(2*e))<1e-4}function ul(e,t,n=0,r=0){return[e-n,t-r]}function N(e,t=[0,0]){return ul(e[0]-t[0],e[1]-t[1])}function dl(e,t){return e[0]*t[1]-t[0]*e[1]}function fl(e,t){return e[0]*t[0]+e[1]*t[1]}function pl(e,t){return[e[0]+t[0],e[1]+t[1]]}function ml(e,t){return[e[0]-t[0],e[1]-t[1]]}function hl(e,t){return ul(e[0]*t,e[1]*t)}function gl(e){return e[0]*e[0]+e[1]*e[1]}function _l(e){return Math.sqrt(gl(e))}var vl=e=>{let t=_l(e);return t===0?ul(0,0):ul(e[0]/t,e[1]/t)};function P(e,t){return[e,t]}function yl(e){return e.length===2?P(e[0],e[1]):void 0}function bl(e,t=P(0,0)){return P(t[0]+e[0],t[1]+e[1])}function xl(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&!isNaN(e[0])&&typeof e[1]==`number`&&!isNaN(e[1])}function Sl(e,t){let n=Math.abs;return n(e[0]-t[0])<1e-4&&n(e[1]-t[1])<1e-4}function F([e,t],[n,r],i){return P((e-n)*Math.cos(i)-(t-r)*Math.sin(i)+n,(e-n)*Math.sin(i)+(t-r)*Math.cos(i)+r)}function Cl(e,t=[0,0]){return P(e[0]+t[0],e[1]+t[1])}function wl(e,t){return P((e[0]+t[0])/2,(e[1]+t[1])/2)}function Tl(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}function El(e,t){let n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}var Dl=(e,t,n)=>Cl(t,hl(N(e,t),n)),Ol=(e,t,n)=>t[0]<=Math.max(e[0],n[0])&&t[0]>=Math.min(e[0],n[0])&&t[1]<=Math.max(e[1],n[1])&&t[1]>=Math.min(e[1],n[1]);function kl(e,t){return[e,t]}function Al(e,t){let n=e[1][1]-e[0][1],r=e[0][0]-e[1][0],i=t[1][1]-t[0][1],a=t[0][0]-t[1][0],o=n*a-i*r;if(o!==0){let s=n*e[0][0]+r*e[0][1],c=i*t[0][0]+a*t[0][1];return P((s*a-c*r)/o,(n*c-i*s)/o)}return null}function I(e,t){return[e,t]}var jl=(e,t,n=1e-4)=>{let r=Ml(e,t);return r===0||r<n},Ml=(e,t)=>{let[n,r]=e,[[i,a],[o,s]]=t,c=n-i,l=r-a,u=o-i,d=s-a,f=c*u+l*d,p=u*u+d*d,m=-1;p!==0&&(m=f/p);let h,g;m<0?(h=i,g=a):m>1?(h=o,g=s):(h=i+m*u,g=a+m*d);let _=n-h,v=r-g;return Math.sqrt(_*_+v*v)};function Nl(e,t){let n=Al(kl(e[0],e[1]),kl(t[0],t[1]));return!n||!jl(n,t)||!jl(n,e)?null:n}function Pl(e,t){return[e,t]}function Fl(e,t){return[I(e[0],P(e[1][0],e[0][1])),I(P(e[1][0],e[0][1]),e[1]),I(e[1],P(e[0][0],e[1][1])),I(P(e[0][0],e[1][1]),e[0])].map(e=>Nl(t,e)).filter(e=>!!e)}function Il(e,t,n,r){return[e,t,n,r]}function Ll(e,t,n,r=1e-6){return[(e(t+r,n)-e(t-r,n))/(2*r),(e(t,n+r)-e(t,n-r))/(2*r)]}function Rl(e,t,n,r=.001,i=10){let a=1/0,o=0;for(;a>=r;){if(o>=i)return null;let r=e(t,n),s=[Ll((t,n)=>e(t,n)[0],t,n),Ll((t,n)=>e(t,n)[1],t,n)],c=[[-r[0]],[-r[1]]],l=s[0][0]*s[1][1]-s[0][1]*s[1][0];if(l===0)return null;let u=[[s[1][1]/l,-s[0][1]/l],[-s[1][0]/l,s[0][0]/l]],d=[[u[0][0]*c[0][0]+u[0][1]*c[1][0]],[u[1][0]*c[0][0]+u[1][1]*c[1][0]]];t+=d[0][0],n+=d[1][0];let[f,p]=e(t,n);a=Math.max(Math.abs(f),Math.abs(p)),o+=1}return[t,n]}var zl=(e,t)=>P((1-t)**3*e[0][0]+3*(1-t)**2*t*e[1][0]+3*(1-t)*t**2*e[2][0]+t**3*e[3][0],(1-t)**3*e[0][1]+3*(1-t)**2*t*e[1][1]+3*(1-t)*t**2*e[2][1]+t**3*e[3][1]);function Bl(e,t){let n=Ul(e);if(Fl(Pl(P(n[0],n[1]),P(n[2],n[3])),t).length===0)return[];let r=e=>P(t[0][0]+e*(t[1][0]-t[0][0]),t[0][1]+e*(t[1][1]-t[0][1])),i=[[.5,0],[.2,0],[.8,0]],a=([t,n])=>{let i=Rl((t,n)=>{let i=zl(e,t),a=r(n);return[i[0]-a[0],i[1]-a[1]]},t,n);if(!i)return null;let[a,o]=i;return a<0||a>1||o<0||o>1?null:zl(e,a)},o=a(i[0]);return o?[o]:(o=a(i[1]),o?[o]:(o=a(i[2]),o?[o]:[]))}function Vl(e,t,n=.001){let r=(e,t,r,i=n)=>{let a=e,o=t,s;for(;o-a>i;)s=(o+a)/2,r(s-i)<r(s+i)?o=s:a=s;return s},i=0;for(let n=1/0,r=0;r<30;r++){let a=Tl(t,zl(e,r/30));a<n&&(n=a,i=r)}let a=r(Math.max((i-1)/30,0),Math.min((i+1)/30,1),n=>Tl(t,zl(e,n)));return a?zl(e,a):null}function Hl(e,t){let n=Vl(e,t);return n?Tl(t,n):0}function Ul(e){let[t,n,r,i]=e,a=[t[0],n[0],r[0],i[0]],o=[t[1],n[1],r[1],i[1]];return[Math.min(...a),Math.min(...o),Math.max(...a),Math.max(...o)]}function Wl(...e){return Jl(e)}function Gl(e){return Jl(e)}var Kl=(e,t)=>{let n=e[0],r=e[1],i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e][0],s=t[e][1],c=t[a][0],l=t[a][1];(s>r&&l<=r||s<=r&&l>r)&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i},ql=(e,t,n=1e-4)=>{let r=!1;for(let i=0,a=t.length-1;i<a;i++)if(jl(e,I(t[i],t[i+1]),n)){r=!0;break}return r};function Jl(e){return Yl(e)?e:[...e,e[0]]}function Yl(e){return Sl(e[0],e[e.length-1])}function Xl(e,t){return rd([e,t])}var Zl=([e,t],[n,r])=>e<=n?t>=n:e>=n&&r>=e,Ql=([e,t],[n,r])=>{let i=Math.max(e,n),a=Math.min(t,r);return i<=a?rd([i,a]):null},$l=(e,[t,n])=>e>=t&&e<=n;function eu([e,t,n],r){let i=(e,t,n)=>(e[0]-n[0])*(t[1]-n[1])-(t[0]-n[0])*(e[1]-n[1]),a=i(r,e,t),o=i(r,t,n),s=i(r,n,e);return!((a<0||o<0||s<0)&&(a>0||o>0||s>0))}var tu=()=>{let e=new Date;return`${e.getFullYear()}-${`${e.getMonth()+1}`.padStart(2,`0`)}-${`${e.getDate()}`.padStart(2,`0`)}-${`${e.getHours()}`.padStart(2,`0`)}${`${e.getMinutes()}`.padStart(2,`0`)}`},nu=e=>e.charAt(0).toUpperCase()+e.slice(1),ru=e=>e instanceof HTMLElement&&e.className.includes(`ToolIcon`),iu=e=>e instanceof HTMLElement&&e.dataset.type===`wysiwyg`||e instanceof HTMLBRElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,au=e=>iu(e)||e instanceof Element&&!!e.closest(`label, button`),ou=e=>e instanceof HTMLElement&&e.dataset.type===`wysiwyg`||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&(e.type===`text`||e.type===`number`||e.type===`password`),su=({fontFamily:e})=>{for(let[t,n]of Object.entries(Ys))if(n===e)return`${t}${Zs(n).map(e=>`, ${e}`).join(``)}`;return Js},cu=({fontSize:e,fontFamily:t})=>`${e}px ${su({fontFamily:t})}`,lu=(e,t)=>{let n=0,r=null,i=(...i)=>{r=i,clearTimeout(n),n=window.setTimeout(()=>{r=null,e(...i)},t)};return i.flush=()=>{if(clearTimeout(n),r){let t=r;r=null,e(...t)}},i.cancel=()=>{r=null,clearTimeout(n)},i},uu=(e,t)=>{let n=null,r=null,i=null,a=t=>{n=window.requestAnimationFrame(()=>{n=null,e(...t),r=null,i&&(r=i,i=null,a(r))})},o=(...o)=>{if(f.MODE===`test`){e(...o);return}r=o,n===null?a(r):t?.trailing&&(i=o)};return o.flush=()=>{n!==null&&(cancelAnimationFrame(n),n=null),r&&=(e(...i||r),i=null)},o.cancel=()=>{r=i=null,n!==null&&(cancelAnimationFrame(n),n=null)},o},du=e=>1-(1-e)**4,fu=(e,t,n)=>(t-e)*du(n)+e,pu=({fromValues:e,toValues:t,onStep:n,duration:r=250,interpolateValue:i,onStart:a,onEnd:o,onCancel:s})=>{let c=!1,l=0,u;function d(s){if(c)return;u===void 0&&(u=s,a?.());let f=Math.min(s-u,r),p=du(f/r),m={};if(Object.keys(e).forEach(n=>{let r=n,i=(t[r]-e[r])*p+e[r];m[r]=i}),n(m),f<r){let a=f/r,o={};Object.keys(e).forEach(n=>{let r=n,s=e[r],c=t[r],l;l=i?i(s,c,a,r):fu(s,c,a),l??=fu(s,c,a),o[r]=l}),n(o),l=window.requestAnimationFrame(d)}else n(t),o?.()}return l=window.requestAnimationFrame(d),()=>{s?.(),c=!0,window.cancelAnimationFrame(l)}},mu=(e,t)=>{if(!e.length||t<1)return[];let n=0,r=0,i=Array(Math.ceil(e.length/t));for(;n<e.length;)i[r++]=e.slice(n,n+=t);return i},hu=(e,t)=>Math.abs(e-t),gu=(e,t)=>t.type===`custom`?{...e.activeTool,type:`custom`,customType:t.customType,locked:t.locked??e.activeTool.locked}:{...e.activeTool,lastActiveTool:t.lastActiveToolBeforeEraser===void 0?e.activeTool.lastActiveTool:t.lastActiveToolBeforeEraser,type:t.type,customType:null,locked:t.locked??e.activeTool.locked},L=e=>(e=e.replace(/\bAlt\b/i,`Alt`).replace(/\bShift\b/i,`Shift`).replace(/\b(Enter|Return)\b/i,`Enter`),As?e.replace(/\bCtrlOrCmd\b/gi,`Cmd`).replace(/\bAlt\b/i,`Option`):e.replace(/\bCtrlOrCmd\b/gi,`Ctrl`)),_u=({clientX:e,clientY:t},{zoom:n,offsetLeft:r,offsetTop:i,scrollX:a,scrollY:o})=>({x:(e-r)/n.value-a,y:(t-i)/n.value-o}),vu=({sceneX:e,sceneY:t},{zoom:n,offsetLeft:r,offsetTop:i,scrollX:a,scrollY:o})=>({x:(e+a)*n.value+r,y:(t+o)*n.value+i}),yu=e=>getComputedStyle(document.documentElement).getPropertyValue(`--${e}`),bu=RegExp(`^[^A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-﷾--]*[֑-߿יִ-﷽ﹰ-ﻼ]`),xu=e=>bu.test(e),Su=e=>{let[t,n]=e;return{x:t,y:n}},Cu=e=>{if(e?.name===`AbortError`){console.warn(e);return}throw e},wu=(e,t,n=0)=>{n<0&&(n=e.length+n),n=Math.min(e.length,Math.max(n,0));let r=n-1;for(;++r<e.length;)if(t(e[r],r,e))return r;return-1},Tu=(e,t,n=e.length-1)=>{n<0&&(n=e.length+n),n=Math.min(e.length-1,Math.max(n,0));let r=n+1;for(;--r>-1;)if(t(e[r],r,e))return r;return-1},Eu=e=>{let t=e.length===5&&e.substr(4,1)===`0`,n=e.length===9&&e.substr(7,2)===`00`;return t||n||e===xs.transparent},Du=e=>e.fillStyle!==`solid`||Eu(e.backgroundColor),Ou=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},ku=e=>{let t=e.parentElement;for(;t;){if(t===document.body)return document;let{overflowY:e}=window.getComputedStyle(t);if(t.scrollHeight>t.clientHeight&&(e===`auto`||e===`scroll`||e===`overlay`))return t;t=t.parentElement}return document},Au=e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1){t.focus();return}t=t.parentElement}},ju=e=>Array.from(e).map(e=>`0${e.toString(16)}`.slice(-2)).join(``),Mu=()=>Lu()?1:Date.now(),Nu=e=>e instanceof Map?e:e.reduce((e,t)=>(e.set(typeof t==`string`?t:t.id,t),e),new Map),Pu=e=>e.reduce((e,t,n)=>(e.set(t.id,[t,n]),e),new Map),Fu=(e,t)=>e.reduce((e,n)=>(e[t?t(n):String(n)]=n,e),{}),Iu=e=>e.reduce((t,n,r)=>{let i={...n,prev:null,next:null};if(r!==0){let n=t[r-1];if(i.prev=n,n.next=i,r===e.length-1){let e=t[0];i.next=e,e.prev=i}}return t.push(i),t},[]),Lu=()=>f.MODE===`test`,Ru=()=>f.MODE===`development`,zu=()=>typeof process<`u`&&!0,Bu=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),Vu=(e,t)=>{let n=!1;for(let r in t){let i=t[r];if(typeof i<`u`){if(e[r]===i&&(typeof i!=`object`||!i))continue;n=!0}}return n?{...e,...t}:e},Hu=()=>{try{return window.self===window.top?`top`:`iframe`}catch{return`iframe`}},Uu=e=>!!e&&typeof e==`object`&&`then`in e&&`catch`in e&&`finally`in e,Wu=e=>{let t=e?.querySelectorAll(`button, a, input, select, textarea, div[tabindex], label[tabindex]`);return t?Array.from(t).filter(e=>e.tabIndex>-1&&!e.disabled):[]},Gu=(e,t)=>Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t,Ku=(e,t,n,r=!1)=>{let i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return r&&console.warn(`%cisShallowEqual: objects don't have same properties ->`,`color: #8B4000`,e,t),!1;if(n&&Array.isArray(n)){for(let i of n)if(!(e[i]===t[i]||Gu(e[i],t[i])))return r&&console.warn(`%cisShallowEqual: ${i} not equal ->`,`color: #8B4000`,e[i],t[i]),!1;return!0}return i.every(i=>{let a=n?.[i],o=a?a(e[i],t[i]):e[i]===t[i]||Gu(e[i],t[i]);return!o&&r&&console.warn(`%cisShallowEqual: ${i} not equal ->`,`color: #8B4000`,e[i],t[i]),o})},qu=(e,t,{checkForDefaultPrevented:n=!0}={})=>function(r){if(e?.(r),!n||!r?.defaultPrevented)return t?.(r)},Ju=(e,t,n)=>{if(!t)return e;if(n)return console.error(t),e;throw Error(t)};function Yu(e,t){if(!e)throw Error(t)}var Xu=e=>{let t,n,r=function(r){let i=Object.entries(r);if(t){let e=!0;for(let[n,r]of i)if(t.get(n)!==r){e=!1;break}if(e)return n}let a=e(r);return t=new Map(i),n=a,a};return r.clear=()=>{t=void 0,n=void 0},r},Zu=(e,t)=>e instanceof Set||e instanceof Map?e.has(t):`includes`in e?e.includes(t):e.hasOwnProperty(t),Qu=e=>JSON.parse(JSON.stringify(e)),$u=(e,t)=>Ku(e,t)?e:t;function ed(e,t,n,r){return e?(e?.addEventListener?.(t,n,r),()=>{e?.removeEventListener?.(t,n,r)}):()=>{}}function td(e,t=!0){let n=e.length;if(n<4)return``;let r=e[0],i=e[1],a=e[2],o=`M${r[0].toFixed(2)},${r[1].toFixed(2)} Q${i[0].toFixed(2)},${i[1].toFixed(2)} ${rl(i[0],a[0]).toFixed(2)},${rl(i[1],a[1]).toFixed(2)} T`;for(let t=2,a=n-1;t<a;t++)r=e[t],i=e[t+1],o+=`${rl(r[0],i[0]).toFixed(2)},${rl(r[1],i[1]).toFixed(2)} `;return t&&(o+=`Z`),o}var nd=e=>e.replace(/\r?\n|\r/g,`
|
|
16
|
+
`),rd=e=>e,id=async(e,...t)=>new Promise(n=>{n(e(...t))}),ad=(...e)=>Math.max(...e.map(e=>+!!e))>0,od=class{constructor(e,t){v(this,`pool`),v(this,`entries`,{}),this.pool=new Ji.default(e,t)}all(){let e=e=>{if(e.data.result){let[t,n]=e.data.result;this.entries[t]=n}};return this.pool.addEventListener(`fulfilled`,e),this.pool.start().then(()=>(setTimeout(()=>{this.pool.removeEventListener(`fulfilled`,e)}),Object.values(this.entries)))}},sd=e=>e.replace(/"/g,`"`),cd=e=>Array.isArray(e)?e:[e],ld=e=>!!e&&e.type===`image`&&!!e.fileId,ud=e=>!!e&&e.type===`image`,dd=e=>!!e&&e.type===`embeddable`,fd=e=>!!e&&e.type===`iframe`,pd=e=>!!e&&(e.type===`iframe`||e.type===`embeddable`),R=e=>e!=null&&e.type===`text`,md=e=>e!=null&&e.type===`frame`,hd=e=>e!=null&&e.type===`magicframe`,gd=e=>e!=null&&(e.type===`frame`||e.type===`magicframe`),_d=e=>e!=null&&vd(e.type),vd=e=>e===`freedraw`,yd=e=>e!=null&&xd(e.type),bd=e=>e!=null&&e.type===`arrow`,z=e=>bd(e)&&e.elbowed,xd=e=>e===`arrow`||e===`line`,Sd=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&Cd(e.type),Cd=e=>e===`arrow`,wd=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&(e.type===`rectangle`||e.type===`diamond`||e.type===`ellipse`||e.type===`image`||e.type===`iframe`||e.type===`embeddable`||e.type===`frame`||e.type===`magicframe`||e.type===`text`&&!e.containerId),Td=e=>e!=null&&(e.type===`rectangle`||e.type===`diamond`||e.type===`image`||e.type===`iframe`||e.type===`embeddable`||e.type===`frame`||e.type===`magicframe`||e.type===`text`&&!e.containerId),Ed=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&(e.type===`rectangle`||e.type===`diamond`||e.type===`ellipse`||bd(e)),Dd=e=>{let t=e?.type;if(!t)return!1;switch(t){case`text`:case`diamond`:case`rectangle`:case`iframe`:case`embeddable`:case`ellipse`:case`arrow`:case`freedraw`:case`line`:case`frame`:case`magicframe`:case`image`:case`selection`:return!0;default:return Ju(t,null),!1}},Od=e=>e.type===`rectangle`||e.type===`ellipse`||e.type===`diamond`,kd=e=>Ed(e)&&!!e.boundElements?.some(({type:e})=>e===`text`),Ad=e=>e!==null&&`containerId`in e&&e.containerId!==null&&R(e),jd=e=>e===`rectangle`||e===`embeddable`||e===`iframe`||e===`image`,Md=e=>e===`line`||e===`arrow`||e===`diamond`,Nd=(e,t)=>!!((e===jc.ADAPTIVE_RADIUS||e===jc.LEGACY)&&jd(t.type)||e===jc.PROPORTIONAL_RADIUS&&Md(t.type)),Pd=e=>Md(e.type)?{type:jc.PROPORTIONAL_RADIUS}:jd(e.type)?{type:jc.ADAPTIVE_RADIUS}:null,Fd=e=>Object.hasOwn(e,`fixedPoint`)&&e.fixedPoint!=null,Id=(e,t,n)=>{let r=e.split(`
|
|
17
|
+
`).map(e=>e||` `).join(`
|
|
18
|
+
`),i=Xd(r,parseFloat(t),n);return{width:Yd(r,t),height:i}},Ld=`ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789`.toLocaleUpperCase(),Rd=(e,t)=>{let n=Qd(e);return n===0?Id(Ld.split(``).join(`
|
|
19
|
+
`),e,t).width+10:n+10},zd=(e,t)=>Id(``,e,t).width+10,Bd=()=>Yd(Ld,cu({fontSize:20,fontFamily:tc}))>0,Vd=e=>nd(e).replace(/\t/g,` `),Hd=e=>Vd(e).split(`
|
|
20
|
+
`),Ud=e=>{let t=Hd(e.text).length;return e.height/t/e.fontSize},Wd=(e,t)=>e*t,Gd=(e,t)=>Wd(e,t)+10,Kd,qd=class{constructor(){v(this,`canvas`),this.canvas=document.createElement(`canvas`)}getLineWidth(e,t){let n=this.canvas.getContext(`2d`);n.font=t;let r=n.measureText(e).width;return Lu()?r*10:r}},Jd=(e,t)=>(Kd||=new qd,Kd.getLineWidth(e,t)),Yd=(e,t)=>{let n=Hd(e),r=0;return n.forEach(e=>{r=Math.max(r,Jd(e,t))}),r},Xd=(e,t,n)=>{let r=Hd(e).length;return Wd(t,n)*r},Zd=(()=>{let e={};return{calculate:(t,n)=>{let r=t.charCodeAt(0);if(e[n]||(e[n]=[]),!e[n][r]){let i=Jd(t,n);e[n][r]=i}return e[n][r]},getCache:t=>e[t],clearCache:t=>{e[t]=[]}}})(),Qd=e=>{let t=Zd.getCache(e);if(!t)return 0;let n=t.filter(e=>e!==void 0);return Math.max(...n)},$d,ef,tf,nf=e=>($d||=ff.class(...Object.values(sf)),$d.test(e)),rf=()=>{if(!ef)try{ef=uf()}catch{ef=lf()}return ef},af=()=>(tf||=df(),tf),of={WHITESPACE:/\s/u,HYPHEN:/-/u,OPENING:/<\(\[\{/u,CLOSING:/>\)\]\}.,:;!\?…\//u},sf={CHAR:/\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}`'^〃〰〆#&*+-ー/\=|¦〒¬ ̄/u,OPENING:/([{〈《⦅「「『【〖〔〘〚<〝/u,CLOSING:/)]}〉》⦆」」』】〗〕〙〛>。.,、〟‥?!:;・〜〞/u,CURRENCY:/¥₩£¢$/u},cf={FLAG:/\p{RI}\p{RI}/u,JOINER:/(?:\p{Emoji_Modifier}|\uFE0F\u20E3?|[\u{E0020}-\u{E007E}]+\u{E007F})?/u,ZWJ:/\u200D/u,ANY:/[\p{Emoji}]/u,MOST:/[\p{Extended_Pictographic}\p{Emoji_Presentation}]/u},lf=()=>ff.or(af(),pf.On(of.HYPHEN,of.WHITESPACE,sf.CHAR)),uf=()=>ff.or(af(),pf.Before(of.WHITESPACE).Build(),pf.After(of.WHITESPACE,of.HYPHEN).Build(),pf.Before(sf.CHAR,sf.CURRENCY).NotPrecededBy(of.OPENING,sf.OPENING).Build(),pf.After(sf.CHAR).NotFollowedBy(of.HYPHEN,of.CLOSING,sf.CLOSING).Build(),pf.BeforeMany(sf.OPENING).NotPrecededBy(of.OPENING).Build(),pf.AfterMany(sf.CLOSING).NotFollowedBy(of.CLOSING).Build(),pf.AfterMany(of.CLOSING).FollowedBy(of.OPENING).Build()),df=()=>ff.group(ff.or(cf.FLAG,ff.and(cf.MOST,cf.JOINER,ff.build(`(?:${cf.ZWJ.source}(?:${cf.FLAG.source}|${cf.ANY.source}${cf.JOINER.source}))*`)))),ff={build:e=>new RegExp(e,`u`),join:(...e)=>e.map(e=>e.source).join(``),and:(...e)=>ff.build(ff.join(...e)),or:(...e)=>ff.build(e.map(e=>e.source).join(`|`)),group:(...e)=>ff.build(`(${ff.join(...e)})`),class:(...e)=>ff.build(`[${ff.join(...e)}]`)},pf={On:(...e)=>{let t=ff.join(...e);return ff.build(`([${t}])`)},Before:(...e)=>{let t=ff.join(...e);return pf.Chain(()=>ff.build(`(?=[${t}])`))},After:(...e)=>{let t=ff.join(...e);return pf.Chain(()=>ff.build(`(?<=[${t}])`))},BeforeMany:(...e)=>{let t=ff.join(...e);return pf.Chain(()=>ff.build(`(?<![${t}])(?=[${t}])`))},AfterMany:(...e)=>{let t=ff.join(...e);return pf.Chain(()=>ff.build(`(?<=[${t}])(?![${t}])`))},NotBefore:(...e)=>{let t=ff.join(...e);return pf.Chain(()=>ff.build(`(?![${t}])`))},NotAfter:(...e)=>{let t=ff.join(...e);return pf.Chain(()=>ff.build(`(?<![${t}])`))},Chain:e=>({Build:e,PreceededBy:(...t)=>{let n=e(),r=pf.After(...t).Build();return pf.Chain(()=>ff.and(r,n))},FollowedBy:(...t)=>{let n=e(),r=pf.Before(...t).Build();return pf.Chain(()=>ff.and(n,r))},NotPrecededBy:(...t)=>{let n=e(),r=pf.NotAfter(...t).Build();return pf.Chain(()=>ff.and(r,n))},NotFollowedBy:(...t)=>{let n=e(),r=pf.NotBefore(...t).Build();return pf.Chain(()=>ff.and(n,r))}})},mf=e=>{let t=rf();return e.normalize(`NFC`).split(t).filter(Boolean)},hf=(e,t,n)=>{if(!Number.isFinite(n)||n<0)return e;let r=[],i=e.split(`
|
|
21
|
+
`);for(let e of i){if(Jd(e,t)<=n){r.push(e);continue}let i=gf(e,t,n);r.push(...i)}return r.join(`
|
|
22
|
+
`)},gf=(e,t,n)=>{let r=[],i=mf(e)[Symbol.iterator](),a=``,o=0,s=i.next();for(;!s.done;){let e=s.value,c=a+e,l=yf(e)?o+Zd.calculate(e,t):Jd(c,t);if(/\s/.test(e)||l<=n){a=c,o=l,s=i.next();continue}if(a)r.push(a.trimEnd()),a=``,o=0;else{let c=_f(e,t,n),l=c[c.length-1]??``,u=c.slice(0,-1);r.push(...u),a=l,o=Jd(l,t),s=i.next()}}if(a){let e=vf(a,t,n);r.push(e)}return r},_f=(e,t,n)=>{if(af().test(e))return[e];bf(e);let r=[],i=Array.from(e),a=``,o=0;for(let e of i){let i=Zd.calculate(e,t),s=o+i;if(s<=n){a+=e,o=s;continue}a&&r.push(a),a=e,o=i}return a&&r.push(a),r},vf=(e,t,n)=>{if(!(Jd(e,t)>n))return e;let[,r,i]=e.match(/^(.+?)(\s+)$/)??[e,e.trimEnd(),``],a=Jd(r,t);for(let e of Array.from(i)){let i=Zd.calculate(e,t),o=a+i;if(o>n)break;r+=e,a=o}return r},yf=e=>e.codePointAt(0)!==void 0&&e.codePointAt(1)===void 0,bf=e=>{if((f.MODE===Gs.TEST||f.DEV)&&/\s/.test(e))throw Error(`Word should not contain any whitespaces!`)},xf=class{};v(xf,`rg`,new fo),v(xf,`cache`,new WeakMap),v(xf,`get`,e=>xf.cache.get(e)),v(xf,`set`,(e,t)=>xf.cache.set(e,t)),v(xf,`delete`,e=>xf.cache.delete(e)),v(xf,`destroy`,()=>{xf.cache=new WeakMap}),v(xf,`generateElementShape`,(e,t)=>{let n=t?.isExporting?void 0:xf.get(e);if(n!==void 0)return n;g_.delete(e);let r=$_(e,xf.rg,t||{isExporting:!1,canvasBackgroundColor:xs.white,embedsValidationStatus:null});return xf.cache.set(e,r),r});var Sf=xf,Cf=e=>`var(--icon-fill-color)`,wf=e=>e===Qs.LIGHT?Ui.white:`#1e1e1e`,B=(e,t=512)=>{let{width:n=512,height:r=n,mirror:i,style:a,...o}=typeof t==`number`?{width:t}:t;return(0,k.jsx)(`svg`,{"aria-hidden":`true`,focusable:`false`,role:`img`,viewBox:`0 0 ${n} ${r}`,className:O({"rtl-mirror":i}),style:a,...o,children:typeof e==`string`?(0,k.jsx)(`path`,{fill:`currentColor`,d:e}):e})},V={width:24,height:24,fill:`none`,strokeWidth:2,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`},Tf={width:20,height:20,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`};B((0,k.jsxs)(`g`,{strokeWidth:`1.5`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`rect`,{x:3,y:8,width:18,height:4,rx:1}),(0,k.jsx)(`line`,{x1:12,y1:8,x2:12,y2:21}),(0,k.jsx)(`path`,{d:`M19 12v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-7`}),(0,k.jsx)(`path`,{d:`M7.5 8a2.5 2.5 0 0 1 0 -5a4.8 8 0 0 1 4.5 5a4.8 8 0 0 1 4.5 -5a2.5 2.5 0 0 1 0 5`})]}),V);var Ef=B((0,k.jsxs)(`g`,{strokeWidth:`1.25`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0`}),(0,k.jsx)(`path`,{d:`M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0`}),(0,k.jsx)(`line`,{x1:`3`,y1:`6`,x2:`3`,y2:`19`}),(0,k.jsx)(`line`,{x1:`12`,y1:`6`,x2:`12`,y2:`19`}),(0,k.jsx)(`line`,{x1:`21`,y1:`6`,x2:`21`,y2:`19`})]}),V),Df=B((0,k.jsxs)(`svg`,{strokeWidth:`1.5`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),(0,k.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})]}),V),Of=B((0,k.jsxs)(`g`,{strokeWidth:`1.5`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1`}),(0,k.jsx)(`circle`,{cx:`12`,cy:`19`,r:`1`}),(0,k.jsx)(`circle`,{cx:`12`,cy:`5`,r:`1`})]}),V),kf=B((0,k.jsxs)(`svg`,{strokeWidth:`1.5`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M9 4v6l-2 4v2h10v-2l-2 -4v-6`}),(0,k.jsx)(`line`,{x1:`12`,y1:`16`,x2:`12`,y2:`21`}),(0,k.jsx)(`line`,{x1:`8`,y1:`4`,x2:`16`,y2:`4`})]}),V),Af=B((0,k.jsxs)(`g`,{children:[(0,k.jsx)(`path`,{d:`M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z`,stroke:`currentColor`,strokeWidth:`1.25`}),(0,k.jsx)(`path`,{d:`M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z`,stroke:`currentColor`,strokeWidth:`1.25`}),(0,k.jsx)(`mask`,{id:`UnlockedIcon`,style:{maskType:`alpha`},maskUnits:`userSpaceOnUse`,x:6,y:1,width:9,height:9,children:(0,k.jsx)(`path`,{stroke:`none`,d:`M6.399 9.561V5.175c0-.93.401-1.823 1.116-2.48a3.981 3.981 0 0 1 2.693-1.028c1.01 0 1.98.37 2.694 1.027.715.658 1.116 1.55 1.116 2.481`,fill:`#fff`})}),(0,k.jsx)(`g`,{mask:`url(#UnlockedIcon)`,children:(0,k.jsx)(`path`,{stroke:`none`,d:`M5.149 9.561v1.25h2.5v-1.25h-2.5Zm5.06-7.894V.417v1.25Zm2.559 3.508v1.25h2.5v-1.25h-2.5ZM7.648 8.51V5.175h-2.5V8.51h2.5Zm0-3.334c0-.564.243-1.128.713-1.561L6.668 1.775c-.959.883-1.52 2.104-1.52 3.4h2.5Zm.713-1.561a2.732 2.732 0 0 1 1.847-.697v-2.5c-1.31 0-2.585.478-3.54 1.358L8.36 3.614Zm1.847-.697c.71 0 1.374.26 1.847.697l1.694-1.839a5.231 5.231 0 0 0-3.54-1.358v2.5Zm1.847.697c.47.433.713.997.713 1.561h2.5c0-1.296-.56-2.517-1.52-3.4l-1.693 1.839Z`,fill:`currentColor`})})]}),Tf),jf=B((0,k.jsxs)(`g`,{strokeWidth:`1.25`,children:[(0,k.jsx)(`path`,{d:`M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z`}),(0,k.jsx)(`path`,{d:`M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z`}),(0,k.jsx)(`path`,{d:`M6.667 8.333V5.417C6.667 3.806 8.159 2.5 10 2.5c1.841 0 3.333 1.306 3.333 2.917v2.916`})]}),Tf);B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`path`,{d:`M38.5 83.5c-14-2-17.833-10.473-21-22.5C14.333 48.984 12 22 12 12.5`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`}),(0,k.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`m12.005 10.478 7.905 14.423L6 25.75l6.005-15.273Z`,fill:`currentColor`}),(0,k.jsx)(`path`,{d:`M12.005 10.478c1.92 3.495 3.838 7 7.905 14.423m-7.905-14.423c3.11 5.683 6.23 11.368 7.905 14.423m0 0c-3.68.226-7.35.455-13.91.85m13.91-.85c-5.279.33-10.566.647-13.91.85m0 0c1.936-4.931 3.882-9.86 6.005-15.273M6 25.75c2.069-5.257 4.135-10.505 6.005-15.272`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`})]}),{width:41,height:94,fill:`none`}),B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`path`,{d:`M18.026 1.232c-5.268 13.125-5.548 33.555 3.285 42.311 8.823 8.75 33.31 12.304 42.422 13.523`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`}),(0,k.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`m72.181 59.247-13.058-10-2.948 13.62 16.006-3.62Z`,fill:`currentColor`}),(0,k.jsx)(`path`,{d:`M72.181 59.247c-3.163-2.429-6.337-4.856-13.058-10m13.058 10c-5.145-3.936-10.292-7.882-13.058-10m0 0c-.78 3.603-1.563 7.196-2.948 13.62m2.948-13.62c-1.126 5.168-2.24 10.346-2.948 13.62m0 0c5.168-1.166 10.334-2.343 16.006-3.62m-16.006 3.62c5.51-1.248 11.01-2.495 16.006-3.62`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`})]}),{width:85,height:71,fill:`none`}),B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`path`,{d:`M1 77c14-2 31.833-11.973 35-24 3.167-12.016-6-35-9.5-43.5`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`}),(0,k.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`m24.165 1.093-2.132 16.309 13.27-4.258-11.138-12.05Z`,fill:`currentColor`}),(0,k.jsx)(`path`,{d:`M24.165 1.093c-.522 3.953-1.037 7.916-2.132 16.309m2.131-16.309c-.835 6.424-1.68 12.854-2.13 16.308m0 0c3.51-1.125 7.013-2.243 13.27-4.257m-13.27 4.257c5.038-1.608 10.08-3.232 13.27-4.257m0 0c-3.595-3.892-7.197-7.777-11.14-12.05m11.14 12.05c-3.837-4.148-7.667-8.287-11.14-12.05`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`})]}),{width:38,height:78,fill:`none`}),B((0,k.jsx)(`g`,{fill:`currentColor`,children:(0,k.jsx)(`path`,{d:`M39.9 32.889a.326.326 0 0 0-.279-.056c-2.094-3.083-4.774-6-7.343-8.833l-.419-.472a.212.212 0 0 0-.056-.139.586.586 0 0 0-.167-.111l-.084-.083-.056-.056c-.084-.167-.28-.278-.475-.167-.782.39-1.507.973-2.206 1.528-.92.722-1.842 1.445-2.708 2.25a8.405 8.405 0 0 0-.977 1.028c-.14.194-.028.361.14.444-.615.611-1.23 1.223-1.843 1.861a.315.315 0 0 0-.084.223c0 .083.056.166.111.194l1.09.833v.028c1.535 1.528 4.244 3.611 7.12 5.861.418.334.865.667 1.284 1 .195.223.39.473.558.695.084.11.28.139.391.055.056.056.14.111.196.167a.398.398 0 0 0 .167.056.255.255 0 0 0 .224-.111.394.394 0 0 0 .055-.167c.029 0 .028.028.056.028a.318.318 0 0 0 .224-.084l5.082-5.528a.309.309 0 0 0 0-.444Zm-14.63-1.917a.485.485 0 0 0 .111.14c.586.5 1.2 1 1.843 1.555l-2.569-1.945-.251-.166c-.056-.028-.112-.084-.168-.111l-.195-.167.056-.056.055-.055.112-.111c.866-.861 2.346-2.306 3.1-3.028-.81.805-2.43 3.167-2.095 3.944Zm8.767 6.89-2.122-1.612a44.713 44.713 0 0 0-2.625-2.5c1.145.861 2.122 1.611 2.262 1.75 1.117.972 1.06.806 1.815 1.445l.921.666a1.06 1.06 0 0 1-.251.25Zm.558.416-.056-.028c.084-.055.168-.111.252-.194l-.196.222ZM1.089 5.75c.055.361.14.722.195 1.056.335 1.833.67 3.5 1.284 4.75l.252.944c.084.361.223.806.363.917 1.424 1.25 3.602 3.11 5.947 4.889a.295.295 0 0 0 .363 0s0 .027.028.027a.254.254 0 0 0 .196.084.318.318 0 0 0 .223-.084c2.988-3.305 5.221-6.027 6.813-8.305.112-.111.14-.278.14-.417.111-.111.195-.25.307-.333.111-.111.111-.306 0-.39l-.028-.027c0-.055-.028-.139-.084-.167-.698-.666-1.2-1.138-1.731-1.638-.922-.862-1.871-1.75-3.881-3.75l-.028-.028c-.028-.028-.056-.056-.112-.056-.558-.194-1.703-.389-3.127-.639C6.087 2.223 3.21 1.723.614.944c0 0-.168 0-.196.028l-.083.084c-.028.027-.056.055-.224.11h.056-.056c.028.167.028.278.084.473 0 .055.112.5.112.555l.782 3.556Zm15.496 3.278-.335-.334c.084.112.196.195.335.334Zm-3.546 4.666-.056.056c0-.028.028-.056.056-.056Zm-2.038-10c.168.167.866.834 1.033.973-.726-.334-2.54-1.167-3.379-1.445.838.167 1.983.334 2.346.472ZM1.424 2.306c.419.722.754 3.222 1.089 5.666-.196-.778-.335-1.555-.503-2.278-.251-1.277-.503-2.416-.838-3.416.056 0 .14 0 .252.028Zm-.168-.584c-.112 0-.223-.028-.307-.028 0-.027 0-.055-.028-.055.14 0 .223.028.335.083Zm-1.089.222c0-.027 0-.027 0 0ZM39.453 1.333c.028-.11-.558-.61-.363-.639.42-.027.42-.666 0-.666-.558.028-1.144.166-1.675.25-.977.194-1.982.389-2.96.61-2.205.473-4.383.973-6.561 1.557-.67.194-1.424.333-2.066.666-.224.111-.196.333-.084.472-.056.028-.084.028-.14.056-.195.028-.363.056-.558.083-.168.028-.252.167-.224.334 0 .027.028.083.028.11-1.173 1.556-2.485 3.195-3.909 4.945-1.396 1.611-2.876 3.306-4.356 5.056-4.719 5.5-10.052 11.75-15.943 17.25a.268.268 0 0 0 0 .389c.028.027.056.055.084.055-.084.084-.168.14-.252.222-.056.056-.084.111-.084.167a.605.605 0 0 0-.111.139c-.112.111-.112.305.028.389.111.11.307.11.39-.028.029-.028.029-.056.056-.056a.44.44 0 0 1 .615 0c.335.362.67.723.977 1.028l-.698-.583c-.112-.111-.307-.083-.39.028-.113.11-.085.305.027.389l7.427 6.194c.056.056.112.056.196.056s.14-.028.195-.084l.168-.166c.028.027.083.027.111.027.084 0 .14-.027.196-.083 10.052-10.055 18.15-17.639 27.42-24.417.083-.055.111-.166.111-.25.112 0 .196-.083.251-.194 1.704-5.194 2.039-9.806 2.15-12.083v-.028c0-.028.028-.056.028-.083.028-.056.028-.084.028-.084a1.626 1.626 0 0 0-.111-1.028ZM21.472 9.5c.446-.5.893-1.028 1.34-1.5-2.876 3.778-7.65 9.583-14.408 16.5 4.607-5.083 9.242-10.333 13.068-15ZM5.193 35.778h.084-.084Zm3.462 3.194c-.027-.028-.027-.028 0-.028v.028Zm4.16-3.583c.224-.25.448-.472.699-.722 0 0 0 .027.028.027-.252.223-.475.445-.726.695Zm1.146-1.111c.14-.14.279-.334.446-.5l.028-.028c1.648-1.694 3.351-3.389 5.082-5.111l.028-.028c.419-.333.921-.694 1.368-1.028a379.003 379.003 0 0 0-6.952 6.695ZM24.794 6.472c-.921 1.195-1.954 2.778-2.82 4.028-2.736 3.944-11.532 13.583-11.727 13.75a1976.983 1976.983 0 0 1-8.042 7.639l-.167.167c-.14-.167-.14-.417.028-.556C14.49 19.861 22.03 10.167 25.074 5.917c-.084.194-.14.36-.28.555Zm4.83 5.695c-1.116-.64-1.646-1.64-1.34-2.611l.084-.334c.028-.083.084-.194.14-.277.307-.5.754-.917 1.257-1.167.027 0 .055 0 .083-.028-.028-.056-.028-.139-.028-.222.028-.167.14-.278.335-.278.335 0 1.369.306 1.76.639.111.083.223.194.335.305.14.167.363.445.474.667.056.028.112.306.196.445.056.222.111.472.084.694-.028.028 0 .194-.028.194a2.668 2.668 0 0 1-.363 1.028c-.028.028-.028.056-.056.084l-.028.027c-.14.223-.335.417-.53.556-.643.444-1.369.583-2.095.389 0 0-.195-.084-.28-.111Zm8.154-.834a39.098 39.098 0 0 1-.893 3.167c0 .028-.028.083 0 .111-.056 0-.084.028-.14.056-2.206 1.61-4.356 3.305-6.506 5.028 1.843-1.64 3.686-3.306 5.613-4.945.558-.5.949-1.139 1.06-1.861l.28-1.667v-.055c.14-.334.67-.195.586.166Z`,fill:`currentColor`})}),{width:40,height:40,fill:`none`});var Mf=B((0,k.jsxs)(`g`,{stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M6 6l4.153 11.793a0.365 .365 0 0 0 .331 .207a0.366 .366 0 0 0 .332 -.207l2.184 -4.793l4.787 -1.994a0.355 .355 0 0 0 .213 -.323a0.355 .355 0 0 0 -.213 -.323l-11.787 -4.36z`}),(0,k.jsx)(`path`,{d:`M13.5 13.5l4.5 4.5`})]}),{fill:`none`,width:22,height:22,strokeWidth:1.25}),Nf=B((0,k.jsxs)(`g`,{strokeWidth:`1.5`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`})]}),V),Pf=B((0,k.jsxs)(`g`,{strokeWidth:`1.5`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M10.5 20.4l-6.9 -6.9c-.781 -.781 -.781 -2.219 0 -3l6.9 -6.9c.781 -.781 2.219 -.781 3 0l6.9 6.9c.781 .781 .781 2.219 0 3l-6.9 6.9c-.781 .781 -2.219 .781 -3 0z`})]}),V),Ff=B((0,k.jsxs)(`g`,{strokeWidth:`1.5`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`})]}),V),If=B((0,k.jsxs)(`g`,{strokeWidth:`1.5`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`}),(0,k.jsx)(`line`,{x1:`15`,y1:`16`,x2:`19`,y2:`12`}),(0,k.jsx)(`line`,{x1:`15`,y1:`8`,x2:`19`,y2:`12`})]}),V),Lf=B((0,k.jsx)(`path`,{d:`M4.167 10h11.666`,strokeWidth:`1.5`}),Tf),Rf=B((0,k.jsxs)(`g`,{strokeWidth:`1.25`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M20 17v-12c0 -1.121 -.879 -2 -2 -2s-2 .879 -2 2v12l2 2l2 -2z`}),(0,k.jsx)(`path`,{d:`M16 7h4`}),(0,k.jsx)(`path`,{d:`M18 19h-13a2 2 0 1 1 0 -4h4a2 2 0 1 0 0 -4h-3`})]}),V),zf=B((0,k.jsxs)(`g`,{strokeWidth:`1.25`,children:[(0,k.jsx)(`path`,{clipRule:`evenodd`,d:`m7.643 15.69 7.774-7.773a2.357 2.357 0 1 0-3.334-3.334L4.31 12.357a3.333 3.333 0 0 0-.977 2.357v1.953h1.953c.884 0 1.732-.352 2.357-.977Z`}),(0,k.jsx)(`path`,{d:`m11.25 5.417 3.333 3.333`})]}),Tf),Bf=B((0,k.jsxs)(`g`,{strokeWidth:`1.5`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`line`,{x1:`4`,y1:`20`,x2:`7`,y2:`20`}),(0,k.jsx)(`line`,{x1:`14`,y1:`20`,x2:`21`,y2:`20`}),(0,k.jsx)(`line`,{x1:`6.9`,y1:`15`,x2:`13.8`,y2:`15`}),(0,k.jsx)(`line`,{x1:`10.2`,y1:`6.3`,x2:`16`,y2:`20`}),(0,k.jsx)(`polyline`,{points:`5 20 11 4 13 4 20 20`})]}),V),Vf=B((0,k.jsxs)(`g`,{strokeWidth:`1.25`,children:[(0,k.jsx)(`path`,{d:`M12.5 6.667h.01`}),(0,k.jsx)(`path`,{d:`M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z`}),(0,k.jsx)(`path`,{d:`m3.333 12.5 3.334-3.333c.773-.745 1.726-.745 2.5 0l4.166 4.166`}),(0,k.jsx)(`path`,{d:`m11.667 11.667.833-.834c.774-.744 1.726-.744 2.5 0l1.667 1.667`})]}),Tf),Hf=B((0,k.jsxs)(`g`,{strokeWidth:`1.5`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M19 20h-10.5l-4.21 -4.3a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9.2 9.3`}),(0,k.jsx)(`path`,{d:`M18 13.3l-6.3 -6.3`})]}),V),Uf=B((0,k.jsx)(`path`,{strokeWidth:`1.25`,d:`M10 4.167v11.666M4.167 10h11.666`}),Tf),Wf=B((0,k.jsx)(`path`,{d:`M5 10h10`,strokeWidth:`1.25`}),Tf),Gf=B((0,k.jsxs)(`g`,{strokeWidth:1.25,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M21 21l-6 -6`}),(0,k.jsx)(`path`,{d:`M3.268 12.043a7.017 7.017 0 0 0 6.634 4.957a7.012 7.012 0 0 0 7.043 -6.131a7 7 0 0 0 -5.314 -7.672a7.021 7.021 0 0 0 -8.241 4.403`}),(0,k.jsx)(`path`,{d:`M3 4v4h4`})]}),V),Kf=B((0,k.jsx)(`path`,{strokeWidth:`1.25`,d:`M3.333 5.833h13.334M8.333 9.167v5M11.667 9.167v5M4.167 5.833l.833 10c0 .92.746 1.667 1.667 1.667h6.666c.92 0 1.667-.746 1.667-1.667l.833-10M7.5 5.833v-2.5c0-.46.373-.833.833-.833h3.334c.46 0 .833.373.833.833v2.5`}),Tf),qf=B((0,k.jsxs)(`g`,{strokeWidth:`1.25`,children:[(0,k.jsx)(`polyline`,{points:`12 16 18 10 12 4`}),(0,k.jsx)(`polyline`,{points:`8 4 2 10 8 16`})]}),Tf),Jf=B((0,k.jsxs)(`g`,{strokeWidth:`1.25`,children:[(0,k.jsx)(`path`,{d:`M14.375 6.458H8.958a2.5 2.5 0 0 0-2.5 2.5v5.417a2.5 2.5 0 0 0 2.5 2.5h5.417a2.5 2.5 0 0 0 2.5-2.5V8.958a2.5 2.5 0 0 0-2.5-2.5Z`}),(0,k.jsx)(`path`,{clipRule:`evenodd`,d:`M11.667 3.125c.517 0 .986.21 1.325.55.34.338.55.807.55 1.325v1.458H8.333c-.485 0-.927.185-1.26.487-.343.312-.57.75-.609 1.24l-.005 5.357H5a1.87 1.87 0 0 1-1.326-.55 1.87 1.87 0 0 1-.549-1.325V5c0-.518.21-.987.55-1.326.338-.34.807-.549 1.325-.549h6.667Z`})]}),Tf),Yf=B((0,k.jsx)(`path`,{clipRule:`evenodd`,d:`M10 2.5h.328a6.25 6.25 0 0 0 6.6 10.372A7.5 7.5 0 1 1 10 2.493V2.5Z`,stroke:`currentColor`}),Tf),Xf=B((0,k.jsx)(`g`,{stroke:`currentColor`,strokeLinejoin:`round`,children:(0,k.jsx)(`path`,{d:`M10 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM10 4.167V2.5M14.167 5.833l1.166-1.166M15.833 10H17.5M14.167 14.167l1.166 1.166M10 15.833V17.5M5.833 14.167l-1.166 1.166M5 10H3.333M5.833 5.833 4.667 4.667`})}),{...Tf,strokeWidth:1.5}),Zf=B((0,k.jsxs)(`g`,{strokeWidth:`1.5`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`line`,{x1:`4`,y1:`6`,x2:`20`,y2:`6`}),(0,k.jsx)(`line`,{x1:`4`,y1:`12`,x2:`20`,y2:`12`}),(0,k.jsx)(`line`,{x1:`4`,y1:`18`,x2:`20`,y2:`18`})]}),V),Qf=B((0,k.jsx)(`path`,{strokeWidth:`1.25`,d:`M3.333 14.167v1.666c0 .92.747 1.667 1.667 1.667h10c.92 0 1.667-.746 1.667-1.667v-1.666M5.833 9.167 10 13.333l4.167-4.166M10 3.333v10`}),Tf),$f=B((0,k.jsxs)(`g`,{strokeWidth:`1.5`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,k.jsx)(`line`,{x1:`12`,y1:`17`,x2:`12`,y2:`17.01`}),(0,k.jsx)(`path`,{d:`M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4`})]}),V),ep=B((0,k.jsxs)(`g`,{strokeWidth:`1.25`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,k.jsx)(`line`,{x1:`12`,y1:`17`,x2:`12`,y2:`17.01`}),(0,k.jsx)(`path`,{d:`M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4`})]}),V),tp=B((0,k.jsx)(`path`,{strokeWidth:`1.25`,d:`M9.167 5.833H5.833c-1.254 0-2.5 1.282-2.5 2.5v5.834c0 1.283 1.252 2.5 2.5 2.5h5.834c1.251 0 2.5-1.25 2.5-2.5v-3.334M8.333 11.667l8.334-8.334M12.5 3.333h4.167V7.5`}),Tf),np=B((0,k.jsx)(`path`,{d:`M7.5 15.833c-3.583 1.167-3.583-2.083-5-2.5m10 4.167v-2.917c0-.833.083-1.166-.417-1.666 2.334-.25 4.584-1.167 4.584-5a3.833 3.833 0 0 0-1.084-2.667 3.5 3.5 0 0 0-.083-2.667s-.917-.25-2.917 1.084a10.25 10.25 0 0 0-5.166 0C5.417 2.333 4.5 2.583 4.5 2.583a3.5 3.5 0 0 0-.083 2.667 3.833 3.833 0 0 0-1.084 2.667c0 3.833 2.25 4.75 4.584 5-.5.5-.5 1-.417 1.666V17.5`,strokeWidth:`1.25`}),Tf),rp=B((0,k.jsxs)(`g`,{strokeWidth:`1.25`,children:[(0,k.jsx)(`path`,{d:`M7.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM12.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM6.25 6.25c2.917-.833 4.583-.833 7.5 0M5.833 13.75c2.917.833 5.417.833 8.334 0`}),(0,k.jsx)(`path`,{d:`M12.917 14.167c0 .833 1.25 2.5 1.666 2.5 1.25 0 2.361-1.39 2.917-2.5.556-1.39.417-4.861-1.25-9.584-1.214-.846-2.5-1.116-3.75-1.25l-.833 2.084M7.083 14.167c0 .833-1.13 2.5-1.526 2.5-1.191 0-2.249-1.39-2.778-2.5-.529-1.39-.397-4.861 1.19-9.584 1.157-.846 2.318-1.116 3.531-1.25l.833 2.084`})]}),Tf),ip=B((0,k.jsxs)(`g`,{strokeWidth:`1.25`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M4 4l11.733 16h4.267l-11.733 -16z`}),(0,k.jsx)(`path`,{d:`M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772`})]}),V),ap=B((0,k.jsx)(`polyline`,{fill:`none`,stroke:`currentColor`,points:`20 6 9 17 4 12`}),{width:24,height:24}),op=B((0,k.jsxs)(`g`,{strokeWidth:`1.25`,children:[(0,k.jsx)(`path`,{d:`M8.333 11.667a2.917 2.917 0 0 0 4.167 0l3.333-3.334a2.946 2.946 0 1 0-4.166-4.166l-.417.416`}),(0,k.jsx)(`path`,{d:`M11.667 8.333a2.917 2.917 0 0 0-4.167 0l-3.333 3.334a2.946 2.946 0 0 0 4.166 4.166l.417-.416`})]}),Tf),sp=B(`M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z`,{width:448,height:512}),cp=B(`M252 54L203 8a28 27 0 00-20-8H28C12 0 0 12 0 27v195c0 15 12 26 28 26h204c15 0 28-11 28-26V73a28 27 0 00-8-19zM130 213c-21 0-37-16-37-36 0-19 16-35 37-35 20 0 37 16 37 35 0 20-17 36-37 36zm56-169v56c0 4-4 6-7 6H44c-4 0-7-2-7-6V42c0-4 3-7 7-7h133l4 2 3 2a7 7 0 012 5z M296 201l87 95-188 205-78 9c-10 1-19-8-18-20l9-84zm141-14l-41-44a31 31 0 00-46 0l-38 41 87 95 38-42c13-14 13-36 0-50z`,{width:448,height:512}),lp=B((0,k.jsx)(`path`,{d:`m9.257 6.351.183.183H15.819c.34 0 .727.182 1.051.506.323.323.505.708.505 1.05v5.819c0 .316-.183.7-.52 1.035-.337.338-.723.522-1.037.522H4.182c-.352 0-.74-.181-1.058-.5-.318-.318-.499-.705-.499-1.057V5.182c0-.351.181-.736.5-1.054.32-.321.71-.503 1.057-.503H6.53l2.726 2.726Z`,strokeWidth:`1.25`}),Tf);B(`M384 112v352c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h80c0-35.29 28.71-64 64-64s64 28.71 64 64h80c26.51 0 48 21.49 48 48zM192 40c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24m96 114v-20a6 6 0 0 0-6-6H102a6 6 0 0 0-6 6v20a6 6 0 0 0 6 6h180a6 6 0 0 0 6-6z`,{width:384,height:512});var up=B(`M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z`),dp=B((0,k.jsxs)(`g`,{strokeWidth:1.25,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M5 16l1.465 1.638a2 2 0 1 1 -3.015 .099l1.55 -1.737z`}),(0,k.jsx)(`path`,{d:`M13.737 9.737c2.299 -2.3 3.23 -5.095 2.081 -6.245c-1.15 -1.15 -3.945 -.217 -6.244 2.082c-2.3 2.299 -3.231 5.095 -2.082 6.244c1.15 1.15 3.946 .218 6.245 -2.081z`}),(0,k.jsx)(`path`,{d:`M7.492 11.818c.362 .362 .768 .676 1.208 .934l6.895 4.047c1.078 .557 2.255 -.075 3.692 -1.512c1.437 -1.437 2.07 -2.614 1.512 -3.692c-.372 -.718 -1.72 -3.017 -4.047 -6.895a6.015 6.015 0 0 0 -.934 -1.208`})]}),V),fp=B((0,k.jsxs)(`g`,{strokeWidth:`1.25`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M15 8h.01`}),(0,k.jsx)(`path`,{d:`M12 20h-5a3 3 0 0 1 -3 -3v-10a3 3 0 0 1 3 -3h10a3 3 0 0 1 3 3v5`}),(0,k.jsx)(`path`,{d:`M4 15l4 -4c.928 -.893 2.072 -.893 3 0l4 4`}),(0,k.jsx)(`path`,{d:`M14 14l1 -1c.617 -.593 1.328 -.793 2.009 -.598`}),(0,k.jsx)(`path`,{d:`M19 16v6`}),(0,k.jsx)(`path`,{d:`M22 19l-3 3l-3 -3`})]}),V),pp=B(`M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z`,{width:512,height:512});B(`M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z`,{width:448,height:512}),B(`M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z`,{width:448,height:512});var mp=B(`M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z`);B(`M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z`);var hp=B((0,k.jsx)(`path`,{d:`M7.5 10.833 4.167 7.5 7.5 4.167M4.167 7.5h9.166a3.333 3.333 0 0 1 0 6.667H12.5`,strokeWidth:`1.25`}),Tf),gp=B((0,k.jsx)(`path`,{d:`M12.5 10.833 15.833 7.5 12.5 4.167M15.833 7.5H6.667a3.333 3.333 0 1 0 0 6.667H7.5`,strokeWidth:`1.25`}),Tf),_p=B(`M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z`,{mirror:!0});B((0,k.jsx)(`path`,{d:`M5 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 7.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 17.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM7.25 8.917l5.5-2.834M7.25 11.083l5.5 2.834`,strokeWidth:`1.5`}),Tf),B(`M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z`),B(`M16 5l-1.42 1.42-1.59-1.59V16h-1.98V4.83L9.42 6.42 8 5l4-4 4 4zm4 5v11c0 1.1-.9 2-2 2H6c-1.11 0-2-.9-2-2V10c0-1.11.89-2 2-2h3v2H6v11h12V10h-3V8h3c1.1 0 2 .89 2 2z`,{width:24,height:24}),B((0,k.jsxs)(`g`,{strokeWidth:1.25,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M8 9h-1a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-8a2 2 0 0 0 -2 -2h-1`}),(0,k.jsx)(`path`,{d:`M12 14v-11`}),(0,k.jsx)(`path`,{d:`M9 6l3 -3l3 3`})]}),V),B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`path`,{fill:`currentColor`,d:`M40 5.6v6.1l-4.1.7c-8.9 1.4-16.5 6.9-20.6 15C13 32 10.9 43 12.4 43c.4 0 2.4-1.3 4.4-3 5-3.9 12.1-7 18.2-7.7l5-.6v12.8l11.2-11.3L62.5 22 51.2 10.8 40-.5v6.1zm10.2 22.6L44 34.5v-6.8l-6.9.6c-3.9.3-9.8 1.7-13.2 3.1-3.5 1.4-6.5 2.4-6.7 2.2-.9-1 3-7.5 6.4-10.8C28 18.6 34.4 16 40.1 16c3.7 0 3.9-.1 3.9-3.2V9.5l6.2 6.3 6.3 6.2-6.3 6.2z`}),(0,k.jsx)(`path`,{stroke:`currentColor`,fill:`currentColor`,d:`M0 36v20h48v-6.2c0-6 0-6.1-2-4.3-1.1 1-2 2.9-2 4.2V52H4V34c0-17.3-.1-18-2-18s-2 .7-2 20z`})]}),{width:64,height:64}),B((0,k.jsx)(`path`,{stroke:`currentColor`,strokeWidth:`40`,fill:`currentColor`,d:`M148 560a318 318 0 0 0 522 110 316 316 0 0 0 0-450 316 316 0 0 0-450 0c-11 11-21 22-30 34v4h47c25 0 46 21 46 46s-21 45-46 45H90c-13 0-25-6-33-14-9-9-14-20-14-33V156c0-25 20-45 45-45s45 20 45 45v32l1 1a401 401 0 0 1 623 509l212 212a42 42 0 0 1-59 59L698 757A401 401 0 0 1 65 570a42 42 0 0 1 83-10z`}),{width:1024});var vp=(0,k.jsxs)(`g`,{strokeWidth:1.5,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M12 10l0 10`}),(0,k.jsx)(`path`,{d:`M12 10l4 4`}),(0,k.jsx)(`path`,{d:`M12 10l-4 4`}),(0,k.jsx)(`path`,{d:`M4 4l16 0`})]}),yp=(0,k.jsxs)(`g`,{strokeWidth:1.5,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M12 5l0 14`}),(0,k.jsx)(`path`,{d:`M16 9l-4 -4`}),(0,k.jsx)(`path`,{d:`M8 9l4 -4`})]}),bp=B(yp,V),xp=B(yp,{...V,style:{transform:`rotate(180deg)`}}),Sp=B(vp,V),Cp=B(vp,{...V,style:{transform:`rotate(180deg)`}}),wp=B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`g`,{clipPath:`url(#a)`,stroke:`currentColor`,strokeWidth:`1.25`,children:[(0,k.jsx)(`path`,{d:`M3.333 3.333h13.334`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,k.jsx)(`path`,{d:`M13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v7.083c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V8.125c0-.92-.746-1.667-1.666-1.667ZM6.875 6.458h-.417c-.92 0-1.666.747-1.666 1.667v3.75c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667v-3.75c0-.92-.747-1.667-1.667-1.667Z`})]}),(0,k.jsx)(`defs`,{children:(0,k.jsx)(`clipPath`,{id:`a`,children:(0,k.jsx)(`path`,{fill:`#fff`,d:`M0 0h20v20H0z`})})})]}),Tf),Tp=B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`g`,{clipPath:`url(#a)`,stroke:`currentColor`,strokeWidth:`1.25`,children:[(0,k.jsx)(`path`,{d:`M3.333 16.667h13.334`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,k.jsx)(`path`,{d:`M6.875 3.125h-.417c-.92 0-1.666.746-1.666 1.667v7.083c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667V4.792c0-.92-.747-1.667-1.667-1.667ZM13.542 5.817h-.417c-.92 0-1.667.747-1.667 1.667v4.391c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V7.484c0-.92-.746-1.667-1.666-1.667Z`})]}),(0,k.jsx)(`defs`,{children:(0,k.jsx)(`clipPath`,{id:`a`,children:(0,k.jsx)(`path`,{fill:`#fff`,d:`M0 0h20v20H0z`})})})]}),Tf),Ep=B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`g`,{clipPath:`url(#a)`,stroke:`currentColor`,strokeWidth:`1.25`,children:[(0,k.jsx)(`path`,{d:`M3.333 3.333v13.334`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,k.jsx)(`path`,{d:`M15.208 4.792H8.125c-.92 0-1.667.746-1.667 1.666v.417c0 .92.747 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM12.516 11.458H8.125c-.92 0-1.667.746-1.667 1.667v.417c0 .92.747 1.666 1.667 1.666h4.391c.92 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.667-1.667Z`})]}),(0,k.jsx)(`defs`,{children:(0,k.jsx)(`clipPath`,{id:`a`,children:(0,k.jsx)(`path`,{fill:`#fff`,d:`M0 0h20v20H0z`})})})]}),Tf),Dp=B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`g`,{clipPath:`url(#a)`,stroke:`currentColor`,strokeWidth:`1.25`,children:[(0,k.jsx)(`path`,{d:`M16.667 3.333v13.334`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,k.jsx)(`path`,{d:`M11.875 4.792H4.792c-.92 0-1.667.746-1.667 1.666v.417c0 .92.746 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM11.683 11.458H7.292c-.92 0-1.667.746-1.667 1.667v.417c0 .92.746 1.666 1.667 1.666h4.39c.921 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.666-1.667Z`})]}),(0,k.jsx)(`defs`,{children:(0,k.jsx)(`clipPath`,{id:`a`,children:(0,k.jsx)(`path`,{fill:`#fff`,d:`M0 0h20v20H0z`})})})]}),Tf),Op=B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`g`,{clipPath:`url(#a)`,stroke:`currentColor`,strokeWidth:`1.25`,children:[(0,k.jsx)(`path`,{d:`M16.667 3.333v13.334M3.333 3.333v13.334`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,k.jsx)(`path`,{d:`M14.375 10.208v-.416c0-.92-.746-1.667-1.667-1.667H7.292c-.92 0-1.667.746-1.667 1.667v.416c0 .92.746 1.667 1.667 1.667h5.416c.92 0 1.667-.746 1.667-1.667Z`})]}),(0,k.jsx)(`defs`,{children:(0,k.jsx)(`clipPath`,{id:`a`,children:(0,k.jsx)(`path`,{fill:`#fff`,d:`M0 0h20v20H0z`})})})]}),Tf),kp=B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`g`,{clipPath:`url(#a)`,stroke:`currentColor`,strokeWidth:`1.25`,children:[(0,k.jsx)(`path`,{d:`M3.333 3.333h13.334M3.333 16.667h13.334`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,k.jsx)(`path`,{d:`M10.208 5.625h-.416c-.92 0-1.667.746-1.667 1.667v5.416c0 .92.746 1.667 1.667 1.667h.416c.92 0 1.667-.746 1.667-1.667V7.292c0-.92-.746-1.667-1.667-1.667Z`})]}),(0,k.jsx)(`defs`,{children:(0,k.jsx)(`clipPath`,{id:`a`,children:(0,k.jsx)(`path`,{fill:`#fff`,d:`M0 0h20v20H0z`})})})]}),Tf),Ap=B((0,k.jsxs)(`g`,{stroke:`currentColor`,strokeWidth:`1.25`,children:[(0,k.jsx)(`path`,{d:`M1.667 10h2.916`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,k.jsx)(`path`,{d:`M8.333 10h3.334`,strokeLinejoin:`round`}),(0,k.jsx)(`path`,{d:`M15.417 10h2.916`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,k.jsx)(`path`,{d:`M6.875 4.792h-.417c-.92 0-1.666.746-1.666 1.666v7.084c0 .92.746 1.666 1.666 1.666h.417c.92 0 1.667-.746 1.667-1.666V6.458c0-.92-.747-1.666-1.667-1.666ZM13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v3.75c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667v-3.75c0-.92-.746-1.667-1.666-1.667Z`})]}),Tf),jp=B((0,k.jsxs)(`g`,{stroke:`currentColor`,strokeWidth:`1.25`,children:[(0,k.jsx)(`path`,{d:`M10 18.333v-2.916`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,k.jsx)(`path`,{d:`M10 11.667V8.333`,strokeLinejoin:`round`}),(0,k.jsx)(`path`,{d:`M10 4.583V1.667`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,k.jsx)(`path`,{d:`M4.792 13.125v.417c0 .92.746 1.666 1.666 1.666h7.084c.92 0 1.666-.746 1.666-1.666v-.417c0-.92-.746-1.667-1.666-1.667H6.458c-.92 0-1.666.746-1.666 1.667ZM6.458 6.458v.417c0 .92.747 1.667 1.667 1.667h3.75c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666h-3.75c-.92 0-1.667.746-1.667 1.666Z`})]}),Tf),Mp=B((0,k.jsxs)(`g`,{strokeWidth:`1.5`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`circle`,{cx:`9`,cy:`7`,r:`4`}),(0,k.jsx)(`path`,{d:`M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2`}),(0,k.jsx)(`path`,{d:`M16 3.13a4 4 0 0 1 0 7.75`}),(0,k.jsx)(`path`,{d:`M21 21v-2a4 4 0 0 0 -3 -3.85`})]}),V);B(`M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z`),B(`M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm96 328c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h160c8.8 0 16 7.2 16 16v160z`);var Np=B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`g`,{clipPath:`url(#a)`,stroke:`currentColor`,strokeWidth:`1.25`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,k.jsx)(`path`,{d:`M15 5 5 15M5 5l10 10`})}),(0,k.jsx)(`defs`,{children:(0,k.jsx)(`clipPath`,{id:`a`,children:(0,k.jsx)(`path`,{fill:`#fff`,d:`M0 0h20v20H0z`})})})]}),Tf);B(`M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z`,{mirror:!0}),B(`M11.553 22.894a.998.998 0 00.894 0s3.037-1.516 5.465-4.097C19.616 16.987 21 14.663 21 12V5a1 1 0 00-.649-.936l-8-3a.998.998 0 00-.702 0l-8 3A1 1 0 003 5v7c0 2.663 1.384 4.987 3.088 6.797 2.428 2.581 5.465 4.097 5.465 4.097zm-1.303-8.481l6.644-6.644a.856.856 0 111.212 1.212l-7.25 7.25a.856.856 0 01-1.212 0l-3.75-3.75a.856.856 0 111.212-1.212l3.144 3.144z`,{width:24}),B(`M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48zm32-48h224V288l-23.5-23.5c-4.7-4.7-12.3-4.7-17 0L176 352l-39.5-39.5c-4.7-4.7-12.3-4.7-17 0L80 352v64zm48-240c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z`,{width:384,height:512});var Pp=u.memo(({theme:e})=>B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`path`,{d:`M25 26H111V111H25`,fill:Cf(e)}),(0,k.jsx)(`path`,{d:`M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z`,stroke:Cf(e),strokeWidth:`2`}),(0,k.jsx)(`path`,{d:`M100 100H160V160H100`,fill:Cf(e)}),(0,k.jsx)(`path`,{d:`M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z`,stroke:Cf(e),strokeWidth:`2`}),(0,k.jsxs)(`g`,{fill:wf(e),stroke:Cf(e),strokeWidth:`6`,children:[(0,k.jsx)(`rect`,{x:`2.5`,y:`2.5`,width:`30`,height:`30`}),(0,k.jsx)(`rect`,{x:`2.5`,y:`149.5`,width:`30`,height:`30`}),(0,k.jsx)(`rect`,{x:`147.5`,y:`149.5`,width:`30`,height:`30`}),(0,k.jsx)(`rect`,{x:`147.5`,y:`2.5`,width:`30`,height:`30`})]})]}),{width:182,height:182,mirror:!0})),Fp=u.memo(({theme:e})=>B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`path`,{d:`M25 26H111V111H25`,fill:Cf(e)}),(0,k.jsx)(`path`,{d:`M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z`,stroke:Cf(e),strokeWidth:`2`}),(0,k.jsx)(`path`,{d:`M100 100H160V160H100`,fill:Cf(e)}),(0,k.jsx)(`path`,{d:`M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z`,stroke:Cf(e),strokeWidth:`2`}),(0,k.jsxs)(`g`,{fill:wf(e),stroke:Cf(e),strokeWidth:`6`,children:[(0,k.jsx)(`rect`,{x:`2.5`,y:`2.5`,width:`30`,height:`30`}),(0,k.jsx)(`rect`,{x:`78.5`,y:`149.5`,width:`30`,height:`30`}),(0,k.jsx)(`rect`,{x:`147.5`,y:`149.5`,width:`30`,height:`30`}),(0,k.jsx)(`rect`,{x:`147.5`,y:`78.5`,width:`30`,height:`30`}),(0,k.jsx)(`rect`,{x:`105.5`,y:`2.5`,width:`30`,height:`30`}),(0,k.jsx)(`rect`,{x:`2.5`,y:`102.5`,width:`30`,height:`30`})]})]}),{width:182,height:182,mirror:!0})),Ip=B((0,k.jsx)(`g`,{strokeWidth:1.25,children:(0,k.jsx)(`path`,{d:`M5.879 2.625h8.242a3.27 3.27 0 0 1 3.254 3.254v8.242a3.27 3.27 0 0 1-3.254 3.254H5.88a3.27 3.27 0 0 1-3.254-3.254V5.88A3.27 3.27 0 0 1 5.88 2.626l-.001-.001ZM4.518 16.118l7.608-12.83m.198 13.934 5.051-9.897M2.778 9.675l9.348-6.387m-7.608 12.83 12.857-8.793`})}),Tf),Lp=B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`path`,{d:`M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z`,stroke:`currentColor`,strokeWidth:`1.25`}),(0,k.jsx)(`mask`,{id:`FillHachureIcon`,style:{maskType:`alpha`},maskUnits:`userSpaceOnUse`,x:2,y:2,width:16,height:16,children:(0,k.jsx)(`path`,{d:`M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z`,fill:`currentColor`,stroke:`currentColor`,strokeWidth:`1.25`})}),(0,k.jsx)(`g`,{mask:`url(#FillHachureIcon)`,children:(0,k.jsx)(`path`,{d:`M2.258 15.156 15.156 2.258M7.324 20.222 20.222 7.325m-20.444 5.35L12.675-.222m-8.157 18.34L17.416 5.22`,stroke:`currentColor`,strokeWidth:`1.25`,strokeLinecap:`round`,strokeLinejoin:`round`})})]}),Tf),Rp=B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`g`,{clipPath:`url(#a)`,children:[(0,k.jsx)(`path`,{d:`M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z`,stroke:`currentColor`,strokeWidth:`1.25`}),(0,k.jsx)(`mask`,{id:`FillCrossHatchIcon`,style:{maskType:`alpha`},maskUnits:`userSpaceOnUse`,x:-1,y:-1,width:22,height:22,children:(0,k.jsx)(`path`,{d:`M2.426 15.044 15.044 2.426M7.383 20 20 7.383M0 12.617 12.617 0m-7.98 17.941L17.256 5.324m-2.211 12.25L2.426 4.956M20 12.617 7.383 0m5.234 20L0 7.383m17.941 7.98L5.324 2.745`,stroke:`currentColor`,strokeWidth:`1.25`,strokeLinecap:`round`,strokeLinejoin:`round`})}),(0,k.jsx)(`g`,{mask:`url(#FillCrossHatchIcon)`,children:(0,k.jsx)(`path`,{d:`M14.121 2H5.88A3.879 3.879 0 0 0 2 5.879v8.242A3.879 3.879 0 0 0 5.879 18h8.242A3.879 3.879 0 0 0 18 14.121V5.88A3.879 3.879 0 0 0 14.121 2Z`,fill:`currentColor`})})]}),(0,k.jsx)(`defs`,{children:(0,k.jsx)(`clipPath`,{id:`a`,children:(0,k.jsx)(`path`,{fill:`#fff`,d:`M0 0h20v20H0z`})})})]}),Tf),zp=B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`g`,{clipPath:`url(#a)`,children:(0,k.jsx)(`path`,{d:`M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z`,stroke:`currentColor`,strokeWidth:`1.25`})}),(0,k.jsx)(`defs`,{children:(0,k.jsx)(`clipPath`,{id:`a`,children:(0,k.jsx)(`path`,{fill:`#fff`,d:`M0 0h20v20H0z`})})})]}),{...Tf,fill:`currentColor`}),Bp=B((0,k.jsx)(k.Fragment,{children:(0,k.jsx)(`path`,{d:`M4.167 10h11.666`,stroke:`currentColor`,strokeWidth:`1.25`,strokeLinecap:`round`,strokeLinejoin:`round`})}),Tf),Vp=B((0,k.jsx)(`path`,{d:`M5 10h10`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),Tf),Hp=B((0,k.jsx)(`path`,{d:`M5 10h10`,stroke:`currentColor`,strokeWidth:`3.75`,strokeLinecap:`round`,strokeLinejoin:`round`}),Tf);u.memo(({theme:e})=>B((0,k.jsx)(`path`,{d:`M6 10H34`,stroke:Cf(e),strokeWidth:2,fill:`none`,strokeLinecap:`round`}),{width:40,height:20}));var Up=B((0,k.jsxs)(`g`,{strokeWidth:`2`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M5 12h2`}),(0,k.jsx)(`path`,{d:`M17 12h2`}),(0,k.jsx)(`path`,{d:`M11 12h2`})]}),V),Wp=B((0,k.jsxs)(`g`,{strokeWidth:`2`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M4 12v.01`}),(0,k.jsx)(`path`,{d:`M8 12v.01`}),(0,k.jsx)(`path`,{d:`M12 12v.01`}),(0,k.jsx)(`path`,{d:`M16 12v.01`}),(0,k.jsx)(`path`,{d:`M20 12v.01`})]}),V),Gp=B((0,k.jsx)(`path`,{d:`M2.5 12.038c1.655-.885 5.9-3.292 8.568-4.354 2.668-1.063.101 2.821 1.32 3.104 1.218.283 5.112-1.814 5.112-1.814`,strokeWidth:`1.25`}),Tf),Kp=B((0,k.jsx)(`path`,{d:`M2.5 12.563c1.655-.886 5.9-3.293 8.568-4.355 2.668-1.062.101 2.822 1.32 3.105 1.218.283 5.112-1.814 5.112-1.814m-13.469 2.23c2.963-1.586 6.13-5.62 7.468-4.998 1.338.623-1.153 4.11-.132 5.595 1.02 1.487 6.133-1.43 6.133-1.43`,strokeWidth:`1.25`}),Tf),qp=B((0,k.jsx)(`path`,{d:`M2.5 11.936c1.737-.879 8.627-5.346 10.42-5.268 1.795.078-.418 5.138.345 5.736.763.598 3.53-1.789 4.235-2.147M2.929 9.788c1.164-.519 5.47-3.28 6.987-3.114 1.519.165 1 3.827 2.121 4.109 1.122.281 3.839-2.016 4.606-2.42`,strokeWidth:`1.25`}),Tf),Jp=B((0,k.jsxs)(`svg`,{strokeWidth:`1.5`,children:[(0,k.jsx)(`path`,{d:`M3.33334 9.99998V6.66665C3.33334 6.04326 3.33403 4.9332 3.33539 3.33646C4.95233 3.33436 6.06276 3.33331 6.66668 3.33331H10`}),(0,k.jsx)(`path`,{d:`M13.3333 3.33331V3.34331`}),(0,k.jsx)(`path`,{d:`M16.6667 3.33331V3.34331`}),(0,k.jsx)(`path`,{d:`M16.6667 6.66669V6.67669`}),(0,k.jsx)(`path`,{d:`M16.6667 10V10.01`}),(0,k.jsx)(`path`,{d:`M3.33334 13.3333V13.3433`}),(0,k.jsx)(`path`,{d:`M16.6667 13.3333V13.3433`}),(0,k.jsx)(`path`,{d:`M3.33334 16.6667V16.6767`}),(0,k.jsx)(`path`,{d:`M6.66666 16.6667V16.6767`}),(0,k.jsx)(`path`,{d:`M10 16.6667V16.6767`}),(0,k.jsx)(`path`,{d:`M13.3333 16.6667V16.6767`}),(0,k.jsx)(`path`,{d:`M16.6667 16.6667V16.6767`})]}),Tf),Yp=B((0,k.jsxs)(`g`,{strokeWidth:`1.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M4 12v-4a4 4 0 0 1 4 -4h4`}),(0,k.jsx)(`line`,{x1:`16`,y1:`4`,x2:`16`,y2:`4.01`}),(0,k.jsx)(`line`,{x1:`20`,y1:`4`,x2:`20`,y2:`4.01`}),(0,k.jsx)(`line`,{x1:`20`,y1:`8`,x2:`20`,y2:`8.01`}),(0,k.jsx)(`line`,{x1:`20`,y1:`12`,x2:`20`,y2:`12.01`}),(0,k.jsx)(`line`,{x1:`4`,y1:`16`,x2:`4`,y2:`16.01`}),(0,k.jsx)(`line`,{x1:`20`,y1:`16`,x2:`20`,y2:`16.01`}),(0,k.jsx)(`line`,{x1:`4`,y1:`20`,x2:`4`,y2:`20.01`}),(0,k.jsx)(`line`,{x1:`8`,y1:`20`,x2:`8`,y2:`20.01`}),(0,k.jsx)(`line`,{x1:`12`,y1:`20`,x2:`12`,y2:`20.01`}),(0,k.jsx)(`line`,{x1:`16`,y1:`20`,x2:`16`,y2:`20.01`}),(0,k.jsx)(`line`,{x1:`20`,y1:`20`,x2:`20`,y2:`20.01`})]}),V),Xp=B((0,k.jsxs)(`g`,{stroke:`currentColor`,opacity:.3,strokeWidth:2,children:[(0,k.jsx)(`path`,{d:`M12 12l9 0`}),(0,k.jsx)(`path`,{d:`M3 9l6 6`}),(0,k.jsx)(`path`,{d:`M3 15l6 -6`})]}),V),Zp=u.memo(({flip:e=!1})=>B((0,k.jsxs)(`g`,{transform:e?`translate(40, 0) scale(-1, 1)`:``,stroke:`currentColor`,strokeWidth:2,fill:`none`,children:[(0,k.jsx)(`path`,{d:`M34 10H6M34 10L27 5M34 10L27 15`}),(0,k.jsx)(`path`,{d:`M27.5 5L34.5 10L27.5 15`})]}),{width:40,height:20})),Qp=u.memo(({flip:e=!1})=>B((0,k.jsxs)(`g`,{stroke:`currentColor`,fill:`currentColor`,transform:e?`translate(40, 0) scale(-1, 1)`:``,children:[(0,k.jsx)(`path`,{d:`M32 10L6 10`,strokeWidth:2}),(0,k.jsx)(`circle`,{r:`4`,transform:`matrix(-1 0 0 1 30 10)`})]}),{width:40,height:20})),$p=u.memo(({flip:e=!1})=>B((0,k.jsxs)(`g`,{stroke:`currentColor`,fill:`none`,transform:e?`translate(40, 0) scale(-1, 1)`:``,strokeWidth:2,children:[(0,k.jsx)(`path`,{d:`M26 10L6 10`}),(0,k.jsx)(`circle`,{r:`4`,transform:`matrix(-1 0 0 1 30 10)`})]}),{width:40,height:20})),em=u.memo(({flip:e=!1})=>B((0,k.jsx)(`g`,{transform:e?`translate(40, 0) scale(-1, 1)`:``,children:(0,k.jsx)(`path`,{d:`M34 10H5.99996M34 10L34 5M34 10L34 15`,stroke:`currentColor`,strokeWidth:2,fill:`none`})}),{width:40,height:20})),tm=u.memo(({flip:e=!1})=>B((0,k.jsxs)(`g`,{stroke:`currentColor`,fill:`currentColor`,transform:e?`translate(40, 0) scale(-1, 1)`:``,children:[(0,k.jsx)(`path`,{d:`M32 10L6 10`,strokeWidth:2}),(0,k.jsx)(`path`,{d:`M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5`})]}),{width:40,height:20})),nm=u.memo(({flip:e=!1})=>B((0,k.jsxs)(`g`,{stroke:`currentColor`,fill:`none`,transform:e?`translate(40, 0) scale(-1, 1)`:``,strokeWidth:2,strokeLinejoin:`round`,children:[(0,k.jsx)(`path`,{d:`M6,9.5H27`}),(0,k.jsx)(`path`,{d:`M27,5L34,10L27,14Z`,fill:`none`})]}),{width:40,height:20})),rm=u.memo(({flip:e=!1})=>B((0,k.jsxs)(`g`,{stroke:`currentColor`,fill:`currentColor`,transform:e?`translate(40, 0) scale(-1, 1)`:``,strokeLinejoin:`round`,strokeWidth:2,children:[(0,k.jsx)(`path`,{d:`M6,9.5H20`}),(0,k.jsx)(`path`,{d:`M27,5L34,10L27,14L20,9.5Z`})]}),{width:40,height:20})),im=u.memo(({flip:e=!1})=>B((0,k.jsxs)(`g`,{stroke:`currentColor`,fill:`none`,transform:e?`translate(40, 0) scale(-1, 1)`:``,strokeLinejoin:`round`,strokeWidth:2,children:[(0,k.jsx)(`path`,{d:`M6,9.5H20`}),(0,k.jsx)(`path`,{d:`M27,5L34,10L27,14L20,9.5Z`})]}),{width:40,height:20})),am=u.memo(({flip:e=!1})=>B((0,k.jsx)(`g`,{stroke:`currentColor`,fill:`none`,transform:e?``:`translate(40, 0) scale(-1, 1)`,strokeLinejoin:`round`,strokeWidth:2,children:(0,k.jsx)(`path`,{d:`M34,10 H6 M15,10 L7,5 M15,10 L7,15`})}),{width:40,height:20})),om=u.memo(({flip:e=!1})=>B((0,k.jsx)(`g`,{stroke:`currentColor`,fill:`none`,transform:e?``:`translate(40, 0) scale(-1, 1)`,strokeLinejoin:`round`,strokeWidth:2,children:(0,k.jsx)(`path`,{d:`M34,10 H6 M15,10 L15,15 L15,5`})}),{width:40,height:20})),sm=u.memo(({flip:e=!1})=>B((0,k.jsx)(`g`,{stroke:`currentColor`,fill:`none`,transform:e?``:`translate(40, 0) scale(-1, 1)`,strokeLinejoin:`round`,strokeWidth:2,children:(0,k.jsx)(`path`,{d:`M34,10 H6 M15,10 L15,16 L15,4 M15,10 L7,5 M15,10 L7,15`})}),{width:40,height:20})),cm=B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`g`,{clipPath:`url(#a)`,children:(0,k.jsx)(`path`,{d:`M14.167 6.667a3.333 3.333 0 0 0-3.334-3.334H9.167a3.333 3.333 0 0 0 0 6.667h1.666a3.333 3.333 0 0 1 0 6.667H9.167a3.333 3.333 0 0 1-3.334-3.334`,stroke:`currentColor`,strokeWidth:`1.25`,strokeLinecap:`round`,strokeLinejoin:`round`})}),(0,k.jsx)(`defs`,{children:(0,k.jsx)(`clipPath`,{id:`a`,children:(0,k.jsx)(`path`,{fill:`#fff`,d:`M0 0h20v20H0z`})})})]}),Tf),lm=B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`g`,{clipPath:`url(#a)`,children:(0,k.jsx)(`path`,{d:`M5 16.667V3.333L10 15l5-11.667v13.334`,stroke:`currentColor`,strokeWidth:`1.25`,strokeLinecap:`round`,strokeLinejoin:`round`})}),(0,k.jsx)(`defs`,{children:(0,k.jsx)(`clipPath`,{id:`a`,children:(0,k.jsx)(`path`,{fill:`#fff`,d:`M0 0h20v20H0z`})})})]}),Tf),um=B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`g`,{clipPath:`url(#a)`,children:(0,k.jsx)(`path`,{d:`M5.833 3.333v13.334h8.334`,stroke:`currentColor`,strokeWidth:`1.25`,strokeLinecap:`round`,strokeLinejoin:`round`})}),(0,k.jsx)(`defs`,{children:(0,k.jsx)(`clipPath`,{id:`a`,children:(0,k.jsx)(`path`,{fill:`#fff`,d:`M0 0h20v20H0z`})})})]}),Tf),dm=B((0,k.jsx)(k.Fragment,{children:(0,k.jsx)(`path`,{d:`m1.667 3.333 6.666 13.334M8.333 3.333 1.667 16.667M11.667 3.333v13.334h6.666`,stroke:`currentColor`,strokeWidth:`1.25`,strokeLinecap:`round`,strokeLinejoin:`round`})}),Tf),fm=B((0,k.jsxs)(`g`,{strokeWidth:1.25,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M3 7v-2h13v2`}),(0,k.jsx)(`path`,{d:`M10 5v14`}),(0,k.jsx)(`path`,{d:`M12 19h-4`}),(0,k.jsx)(`path`,{d:`M15 13v-1h6v1`}),(0,k.jsx)(`path`,{d:`M18 12v7`}),(0,k.jsx)(`path`,{d:`M17 19h2`})]}),V),pm=B((0,k.jsx)(k.Fragment,{children:(0,k.jsxs)(`g`,{stroke:`currentColor`,strokeWidth:`1.25`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M7 12h10`}),(0,k.jsx)(`path`,{d:`M7 5v14`}),(0,k.jsx)(`path`,{d:`M17 5v14`}),(0,k.jsx)(`path`,{d:`M15 19h4`}),(0,k.jsx)(`path`,{d:`M15 5h4`}),(0,k.jsx)(`path`,{d:`M5 19h4`}),(0,k.jsx)(`path`,{d:`M5 5h4`})]})}),V),mm=B((0,k.jsx)(k.Fragment,{children:(0,k.jsx)(`g`,{stroke:`currentColor`,strokeWidth:`1.25`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,k.jsx)(`path`,{d:`M5.833 16.667v-10a3.333 3.333 0 0 1 3.334-3.334h1.666a3.333 3.333 0 0 1 3.334 3.334v10M5.833 10.833h8.334`})})}),Tf),hm=B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`g`,{clipPath:`url(#a)`,stroke:`currentColor`,strokeWidth:`1.25`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,k.jsx)(`path`,{d:`M5.833 6.667 2.5 10l3.333 3.333M14.167 6.667 17.5 10l-3.333 3.333M11.667 3.333 8.333 16.667`})}),(0,k.jsx)(`defs`,{children:(0,k.jsx)(`clipPath`,{id:`a`,children:(0,k.jsx)(`path`,{fill:`#fff`,d:`M0 0h20v20H0z`})})})]}),Tf),gm=B((0,k.jsxs)(`g`,{stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`line`,{x1:`4`,y1:`8`,x2:`20`,y2:`8`}),(0,k.jsx)(`line`,{x1:`4`,y1:`12`,x2:`12`,y2:`12`}),(0,k.jsx)(`line`,{x1:`4`,y1:`16`,x2:`16`,y2:`16`})]}),V),_m=B((0,k.jsxs)(`g`,{stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`line`,{x1:`4`,y1:`8`,x2:`20`,y2:`8`}),(0,k.jsx)(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`}),(0,k.jsx)(`line`,{x1:`6`,y1:`16`,x2:`18`,y2:`16`})]}),V),vm=B((0,k.jsxs)(`g`,{stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`line`,{x1:`4`,y1:`8`,x2:`20`,y2:`8`}),(0,k.jsx)(`line`,{x1:`10`,y1:`12`,x2:`20`,y2:`12`}),(0,k.jsx)(`line`,{x1:`8`,y1:`16`,x2:`20`,y2:`16`})]}),V),ym=u.memo(({theme:e})=>B((0,k.jsxs)(`g`,{strokeWidth:`1.5`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`line`,{x1:`4`,y1:`4`,x2:`20`,y2:`4`}),(0,k.jsx)(`rect`,{x:`9`,y:`8`,width:`6`,height:`12`,rx:`2`})]}),V)),bm=u.memo(({theme:e})=>B((0,k.jsxs)(`g`,{strokeWidth:`2`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`line`,{x1:`4`,y1:`20`,x2:`20`,y2:`20`}),(0,k.jsx)(`rect`,{x:`9`,y:`4`,width:`6`,height:`12`,rx:`2`})]}),V)),xm=u.memo(({theme:e})=>B((0,k.jsxs)(`g`,{strokeWidth:`1.5`,stroke:`currentColor`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`line`,{x1:`4`,y1:`12`,x2:`9`,y2:`12`}),(0,k.jsx)(`line`,{x1:`15`,y1:`12`,x2:`20`,y2:`12`}),(0,k.jsx)(`rect`,{x:`9`,y:`6`,width:`6`,height:`12`,rx:`2`})]}),V)),Sm=B((0,k.jsxs)(`g`,{children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M21 19h-18l9 -15`}),(0,k.jsx)(`path`,{d:`M20.615 15.171h.015`}),(0,k.jsx)(`path`,{d:`M19.515 11.771h.015`}),(0,k.jsx)(`path`,{d:`M17.715 8.671h.015`}),(0,k.jsx)(`path`,{d:`M15.415 5.971h.015`})]}),V),Cm=B((0,k.jsx)(`path`,{d:`M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zM393.4 288H328v112c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V288h-65.4c-14.3 0-21.4-17.2-11.3-27.3l105.4-105.4c6.2-6.2 16.4-6.2 22.6 0l105.4 105.4c10.1 10.1 2.9 27.3-11.3 27.3z`,fill:`currentColor`}),{width:640,height:512});B((0,k.jsx)(`path`,{d:`M480 416C497.7 416 512 430.3 512 448C512 465.7 497.7 480 480 480H150.6C133.7 480 117.4 473.3 105.4 461.3L25.37 381.3C.3786 356.3 .3786 315.7 25.37 290.7L258.7 57.37C283.7 32.38 324.3 32.38 349.3 57.37L486.6 194.7C511.6 219.7 511.6 260.3 486.6 285.3L355.9 416H480zM265.4 416L332.7 348.7L195.3 211.3L70.63 336L150.6 416L265.4 416z`}));var wm=B((0,k.jsxs)(`g`,{strokeWidth:1.25,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5`}),(0,k.jsx)(`path`,{d:`M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5`}),(0,k.jsx)(`path`,{d:`M14 5.5a1.5 1.5 0 0 1 3 0v6.5`}),(0,k.jsx)(`path`,{d:`M17 7.5a1.5 1.5 0 0 1 3 0v8.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47`})]}),V),Tm=B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2`}),(0,k.jsx)(`path`,{d:`M7 11l5 5l5 -5`}),(0,k.jsx)(`path`,{d:`M12 4l0 12`})]}),V),Em=B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z`}),(0,k.jsx)(`path`,{d:`M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2`})]}),V),Dm=B((0,k.jsxs)(`g`,{strokeWidth:1.25,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M7 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0`}),(0,k.jsx)(`path`,{d:`M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0`}),(0,k.jsx)(`path`,{d:`M9.15 14.85l8.85 -10.85`}),(0,k.jsx)(`path`,{d:`M6 4l8.85 10.85`})]}),V),Om=B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`}),(0,k.jsx)(`path`,{d:`M12 17l0 .01`}),(0,k.jsx)(`path`,{d:`M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4`})]}),V);B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M7 4v16l13 -8z`})]}),V),B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M17 4h-10a3 3 0 0 0 -3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3 -3v-10a3 3 0 0 0 -3 -3z`,strokeWidth:`0`,fill:`currentColor`})]}),V);var km=B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M5 12l5 5l10 -10`})]}),V),Am=B((0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M10.24 3.957l-8.422 14.06a1.989 1.989 0 0 0 1.7 2.983h16.845a1.989 1.989 0 0 0 1.7 -2.983l-8.423 -14.06a1.989 1.989 0 0 0 -3.4 0z`}),(0,k.jsx)(`path`,{d:`M12 9v4`}),(0,k.jsx)(`path`,{d:`M12 17h.01`})]}),V),jm=B((0,k.jsxs)(`g`,{strokeWidth:1.25,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M11 7l6 6`}),(0,k.jsx)(`path`,{d:`M4 16l11.7 -11.7a1 1 0 0 1 1.4 0l2.6 2.6a1 1 0 0 1 0 1.4l-11.7 11.7h-4v-4z`})]}),V),Mm=B((0,k.jsxs)(`g`,{strokeWidth:1.5,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M12 3l-4 7h8z`}),(0,k.jsx)(`path`,{d:`M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0`}),(0,k.jsx)(`path`,{d:`M4 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z`})]}),V),Nm=B((0,k.jsxs)(`g`,{strokeWidth:1.5,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M4 7l16 0`}),(0,k.jsx)(`path`,{d:`M4 17l16 0`}),(0,k.jsx)(`path`,{d:`M7 4l0 16`}),(0,k.jsx)(`path`,{d:`M17 4l0 16`})]}),V),Pm=B((0,k.jsx)(`path`,{fill:`currentColor`,d:`M407.48,111.18C335.587,108.103 269.573,152.338 245.08,220C220.587,152.338 154.573,108.103 82.68,111.18C80.285,168.229 107.577,222.632 154.74,254.82C178.908,271.419 193.35,298.951 193.27,328.27L193.27,379.13L296.9,379.13L296.9,328.27C296.816,298.953 311.255,271.42 335.42,254.82C382.596,222.644 409.892,168.233 407.48,111.18Z`})),Fm=B((0,k.jsxs)(`g`,{strokeWidth:`1.25`,children:[(0,k.jsx)(`path`,{d:`M4.16602 10H15.8327`}),(0,k.jsx)(`path`,{d:`M12.5 13.3333L15.8333 10`}),(0,k.jsx)(`path`,{d:`M12.5 6.66666L15.8333 9.99999`})]}),Tf),Im=B((0,k.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeWidth:`1.25`,strokeLinecap:`round`,strokeLinejoin:`round`,transform:`rotate(90 10 10)`,children:[(0,k.jsx)(`path`,{clipRule:`evenodd`,d:`m9.644 13.69 7.774-7.773a2.357 2.357 0 0 0-3.334-3.334l-7.773 7.774L8 12l1.643 1.69Z`}),(0,k.jsx)(`path`,{d:`m13.25 3.417 3.333 3.333M10 10l2-2M5 15l3-3M2.156 17.894l1-1M5.453 19.029l-.144-1.407M2.377 11.887l.866 1.118M8.354 17.273l-1.194-.758M.953 14.652l1.408.13`})]}),20),Lm=B((0,k.jsxs)(`g`,{stroke:`currentColor`,fill:`none`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`}),(0,k.jsx)(`path`,{d:`M6 21l15 -15l-3 -3l-15 15l3 3`}),(0,k.jsx)(`path`,{d:`M15 6l3 3`}),(0,k.jsx)(`path`,{d:`M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2`}),(0,k.jsx)(`path`,{d:`M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2`})]}),V);B((0,k.jsxs)(`g`,{strokeWidth:1.25,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`}),(0,k.jsx)(`path`,{d:`M6 21l15 -15l-3 -3l-15 15l3 3`}),(0,k.jsx)(`path`,{d:`M15 6l3 3`}),(0,k.jsx)(`path`,{d:`M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2`}),(0,k.jsx)(`path`,{d:`M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2`})]}),V),B((0,k.jsxs)(`g`,{stroke:`currentColor`,fill:`none`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M11.217 19.384a3.501 3.501 0 0 0 6.783 -1.217v-5.167l-6 -3.35`}),(0,k.jsx)(`path`,{d:`M5.214 15.014a3.501 3.501 0 0 0 4.446 5.266l4.34 -2.534v-6.946`}),(0,k.jsx)(`path`,{d:`M6 7.63c-1.391 -.236 -2.787 .395 -3.534 1.689a3.474 3.474 0 0 0 1.271 4.745l4.263 2.514l6 -3.348`}),(0,k.jsx)(`path`,{d:`M12.783 4.616a3.501 3.501 0 0 0 -6.783 1.217v5.067l6 3.45`}),(0,k.jsx)(`path`,{d:`M18.786 8.986a3.501 3.501 0 0 0 -4.446 -5.266l-4.34 2.534v6.946`}),(0,k.jsx)(`path`,{d:`M18 16.302c1.391 .236 2.787 -.395 3.534 -1.689a3.474 3.474 0 0 0 -1.271 -4.745l-4.308 -2.514l-5.955 3.42`})]}),V);var Rm=B((0,k.jsxs)(`g`,{stroke:`currentColor`,fill:`none`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M4 8v-2a2 2 0 0 1 2 -2h2`}),(0,k.jsx)(`path`,{d:`M4 16v2a2 2 0 0 0 2 2h2`}),(0,k.jsx)(`path`,{d:`M16 4h2a2 2 0 0 1 2 2v2`}),(0,k.jsx)(`path`,{d:`M16 20h2a2 2 0 0 0 2 -2v-2`})]}),V),zm=B((0,k.jsxs)(`g`,{stroke:`currentColor`,fill:`none`,strokeWidth:1.5,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0`}),(0,k.jsx)(`path`,{d:`M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6`})]}),V),Bm=B((0,k.jsxs)(`g`,{stroke:`currentColor`,fill:`none`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M10.585 10.587a2 2 0 0 0 2.829 2.828`}),(0,k.jsx)(`path`,{d:`M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87`}),(0,k.jsx)(`path`,{d:`M3 3l18 18`})]}),V);B((0,k.jsxs)(`g`,{stroke:`currentColor`,fill:`none`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8`}),(0,k.jsx)(`path`,{d:`M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8`}),(0,k.jsx)(`path`,{d:`M17.5 16a3.5 3.5 0 0 0 0 -7h-.5`}),(0,k.jsx)(`path`,{d:`M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0`}),(0,k.jsx)(`path`,{d:`M6.5 16a3.5 3.5 0 0 1 0 -7h.5`}),(0,k.jsx)(`path`,{d:`M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10`})]}),V);var Vm=B((0,k.jsxs)(`g`,{strokeWidth:1.25,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8`}),(0,k.jsx)(`path`,{d:`M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8`}),(0,k.jsx)(`path`,{d:`M17.5 16a3.5 3.5 0 0 0 0 -7h-.5`}),(0,k.jsx)(`path`,{d:`M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0`}),(0,k.jsx)(`path`,{d:`M6.5 16a3.5 3.5 0 0 1 0 -7h.5`}),(0,k.jsx)(`path`,{d:`M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10`})]}),V),Hm=B((0,k.jsxs)(`g`,{strokeWidth:1.5,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0`}),(0,k.jsx)(`path`,{d:`M21 21l-6 -6`})]}),V),Um=B((0,k.jsxs)(`g`,{strokeWidth:1.5,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M20.984 12.53a9 9 0 1 0 -7.552 8.355`}),(0,k.jsx)(`path`,{d:`M12 7v5l3 3`}),(0,k.jsx)(`path`,{d:`M19 16l-2 3h4l-2 3`})]}),V),Wm=B((0,k.jsxs)(`g`,{strokeWidth:1.5,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M9 2m0 3a3 3 0 0 1 3 -3h0a3 3 0 0 1 3 3v5a3 3 0 0 1 -3 3h0a3 3 0 0 1 -3 -3z`}),(0,k.jsx)(`path`,{d:`M5 10a7 7 0 0 0 14 0`}),(0,k.jsx)(`path`,{d:`M8 21l8 0`}),(0,k.jsx)(`path`,{d:`M12 17l0 4`})]}),V),Gm=B((0,k.jsxs)(`g`,{strokeWidth:1.5,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M3 3l18 18`}),(0,k.jsx)(`path`,{d:`M9 5a3 3 0 0 1 6 0v5a3 3 0 0 1 -.13 .874m-2 2a3 3 0 0 1 -3.87 -2.872v-1`}),(0,k.jsx)(`path`,{d:`M5 10a7 7 0 0 0 10.846 5.85m2 -2a6.967 6.967 0 0 0 1.152 -3.85`}),(0,k.jsx)(`path`,{d:`M8 21l8 0`}),(0,k.jsx)(`path`,{d:`M12 17l0 4`})]}),V),Km=B((0,k.jsxs)(`g`,{strokeWidth:1.25,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11`})]}),V),qm=B((0,k.jsxs)(`g`,{children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M8 8m0 1a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1z`}),(0,k.jsx)(`path`,{d:`M12 20v.01`}),(0,k.jsx)(`path`,{d:`M16 20v.01`}),(0,k.jsx)(`path`,{d:`M8 20v.01`}),(0,k.jsx)(`path`,{d:`M4 20v.01`}),(0,k.jsx)(`path`,{d:`M4 16v.01`}),(0,k.jsx)(`path`,{d:`M4 12v.01`}),(0,k.jsx)(`path`,{d:`M4 8v.01`}),(0,k.jsx)(`path`,{d:`M4 4v.01`}),(0,k.jsx)(`path`,{d:`M8 4v.01`}),(0,k.jsx)(`path`,{d:`M12 4v.01`}),(0,k.jsx)(`path`,{d:`M16 4v.01`}),(0,k.jsx)(`path`,{d:`M20 4v.01`}),(0,k.jsx)(`path`,{d:`M20 8v.01`}),(0,k.jsx)(`path`,{d:`M20 12v.01`}),(0,k.jsx)(`path`,{d:`M20 16v.01`}),(0,k.jsx)(`path`,{d:`M20 20v.01`})]}),V),Jm=B((0,k.jsxs)(`g`,{strokeWidth:1.25,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M5 3v18`}),(0,k.jsx)(`path`,{d:`M19 21v-18`}),(0,k.jsx)(`path`,{d:`M5 7h14`}),(0,k.jsx)(`path`,{d:`M5 15h14`}),(0,k.jsx)(`path`,{d:`M8 13v4`}),(0,k.jsx)(`path`,{d:`M11 13v4`}),(0,k.jsx)(`path`,{d:`M16 13v4`}),(0,k.jsx)(`path`,{d:`M14 5v4`}),(0,k.jsx)(`path`,{d:`M11 5v4`}),(0,k.jsx)(`path`,{d:`M8 5v4`}),(0,k.jsx)(`path`,{d:`M3 21h18`})]}),V),Ym=B((0,k.jsxs)(`g`,{strokeWidth:1.25,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M3 12l18 0`}),(0,k.jsx)(`path`,{d:`M7 16l10 0l-10 5l0 -5`}),(0,k.jsx)(`path`,{d:`M7 8l10 0l-10 -5l0 5`})]}),V),Xm=B((0,k.jsxs)(`g`,{strokeWidth:1.25,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M12 3l0 18`}),(0,k.jsx)(`path`,{d:`M16 7l0 10l5 0l-5 -10`}),(0,k.jsx)(`path`,{d:`M8 7l0 10l-5 0l5 -10`})]}),V),Zm=B((0,k.jsxs)(`g`,{strokeWidth:1.25,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M5 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z`}),(0,k.jsx)(`path`,{d:`M19 6h1a2 2 0 0 1 2 2a5 5 0 0 1 -5 5l-5 0v2`}),(0,k.jsx)(`path`,{d:`M10 15m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z`})]}),V),Qm=B((0,k.jsxs)(`g`,{strokeWidth:1.25,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M15 15m-5 0a5 5 0 1 0 10 0a5 5 0 1 0 -10 0`}),(0,k.jsx)(`path`,{d:`M22 22l-3 -3`}),(0,k.jsx)(`path`,{d:`M6 18h-1a2 2 0 0 1 -2 -2v-1`}),(0,k.jsx)(`path`,{d:`M3 11v-1`}),(0,k.jsx)(`path`,{d:`M3 6v-1a2 2 0 0 1 2 -2h1`}),(0,k.jsx)(`path`,{d:`M10 3h1`}),(0,k.jsx)(`path`,{d:`M15 3h1a2 2 0 0 1 2 2v1`})]}),V),$m=B((0,k.jsxs)(`g`,{strokeWidth:1.25,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M14 3v4a1 1 0 0 0 1 1h4`}),(0,k.jsx)(`path`,{d:`M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4`}),(0,k.jsx)(`path`,{d:`M4 20.25c0 .414 .336 .75 .75 .75h1.25a1 1 0 0 0 1 -1v-1a1 1 0 0 0 -1 -1h-1a1 1 0 0 1 -1 -1v-1a1 1 0 0 1 1 -1h1.25a.75 .75 0 0 1 .75 .75`}),(0,k.jsx)(`path`,{d:`M10 15l2 6l2 -6`}),(0,k.jsx)(`path`,{d:`M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3`})]}),V),eh=B((0,k.jsxs)(`g`,{strokeWidth:1.25,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M14 3v4a1 1 0 0 0 1 1h4`}),(0,k.jsx)(`path`,{d:`M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4`}),(0,k.jsx)(`path`,{d:`M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3`}),(0,k.jsx)(`path`,{d:`M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6`}),(0,k.jsx)(`path`,{d:`M11 21v-6l3 6v-6`})]}),V),th=B((0,k.jsxs)(`g`,{strokeWidth:1.25,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M4 13v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a2 2 0 0 0 6 0v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a8 8 0 0 1 -16 0`}),(0,k.jsx)(`path`,{d:`M4 8l5 0`}),(0,k.jsx)(`path`,{d:`M15 8l4 0`})]}),V),nh=B((0,k.jsxs)(`g`,{strokeWidth:1.25,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M3 14c.83 .642 2.077 1.017 3.5 1c1.423 .017 2.67 -.358 3.5 -1c.83 -.642 2.077 -1.017 3.5 -1c1.423 -.017 2.67 .358 3.5 1`}),(0,k.jsx)(`path`,{d:`M8 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2`}),(0,k.jsx)(`path`,{d:`M12 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2`}),(0,k.jsx)(`path`,{d:`M3 10h14v5a6 6 0 0 1 -6 6h-2a6 6 0 0 1 -6 -6v-5z`}),(0,k.jsx)(`path`,{d:`M16.746 16.726a3 3 0 1 0 .252 -5.555`})]}),V),rh=B((0,k.jsxs)(`g`,{stroke:`currentColor`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M3 5a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-16a1 1 0 0 1-1-1v-10zM7 20h10M9 16v4M15 16v4`})]}),{...V,strokeWidth:1.5});B((0,k.jsxs)(`g`,{strokeWidth:1.5,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M15 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2`}),(0,k.jsx)(`path`,{d:`M21 12h-13l3 -3`}),(0,k.jsx)(`path`,{d:`M11 15l-3 -3`})]}),V);var ih=B((0,k.jsxs)(`g`,{children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M2 8a4 4 0 0 1 4 -4h12a4 4 0 0 1 4 4v8a4 4 0 0 1 -4 4h-12a4 4 0 0 1 -4 -4v-8z`}),(0,k.jsx)(`path`,{d:`M10 9l5 3l-5 3z`})]}),V),ah=B((0,k.jsxs)(`g`,{strokeWidth:1.5,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M3 6h18`}),(0,k.jsx)(`path`,{d:`M3 12h18`}),(0,k.jsx)(`path`,{d:`M3 18h18`}),(0,k.jsx)(`path`,{d:`M6 3v18`}),(0,k.jsx)(`path`,{d:`M12 3v18`}),(0,k.jsx)(`path`,{d:`M18 3v18`})]}),V),oh=B((0,k.jsxs)(`g`,{strokeWidth:1.5,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M17 3m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z`}),(0,k.jsx)(`path`,{d:`M3 17m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z`}),(0,k.jsx)(`path`,{d:`M17 5c-6.627 0 -12 5.373 -12 12`})]}),V),sh=B((0,k.jsxs)(`g`,{children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M6 18l12 -12`}),(0,k.jsx)(`path`,{d:`M18 10v-4h-4`})]}),V),ch=B((0,k.jsxs)(`g`,{children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M4,19L10,19C11.097,19 12,18.097 12,17L12,9C12,7.903 12.903,7 14,7L21,7`}),(0,k.jsx)(`path`,{d:`M18 4l3 3l-3 3`})]}),V),lh=B((0,k.jsxs)(`g`,{children:[(0,k.jsx)(`path`,{d:`M16,12L20,9L16,6`}),(0,k.jsx)(`path`,{d:`M6 20c0 -6.075 4.925 -11 11 -11h3`})]}),V),uh=B((0,k.jsxs)(`g`,{children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M6 9l6 6l6 -6`})]}),V),dh=B((0,k.jsxs)(`g`,{children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M6 15l6 -6l6 6`})]}),V),fh=B((0,k.jsxs)(`g`,{children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M6 15l6 -6l6 6`})]}),V),ph=B((0,k.jsxs)(`g`,{strokeWidth:`1.25`,children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M8 5v10a1 1 0 0 0 1 1h10`}),(0,k.jsx)(`path`,{d:`M5 8h10a1 1 0 0 1 1 1v10`})]}),V),mh=B((0,k.jsxs)(`g`,{children:[(0,k.jsx)(`path`,{stroke:`none`,d:`M0 0h24v24H0z`,fill:`none`}),(0,k.jsx)(`path`,{d:`M5 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`}),(0,k.jsx)(`path`,{d:`M19 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`}),(0,k.jsx)(`path`,{d:`M5 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`}),(0,k.jsx)(`path`,{d:`M19 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`}),(0,k.jsx)(`path`,{d:`M5 7l0 10`}),(0,k.jsx)(`path`,{d:`M7 5l10 0`}),(0,k.jsx)(`path`,{d:`M7 19l10 0`}),(0,k.jsx)(`path`,{d:`M19 7l0 10`})]}),V),hh={[Ys.Excalifont]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},icon:zf},[Ys.Nunito]:{metrics:{unitsPerEm:1e3,ascender:1011,descender:-353,lineHeight:1.35},icon:mm},[Ys[`Lilita One`]]:{metrics:{unitsPerEm:1e3,ascender:923,descender:-220,lineHeight:1.15},icon:pm},[Ys[`Comic Shanns`]]:{metrics:{unitsPerEm:1e3,ascender:750,descender:-250,lineHeight:1.25},icon:hm},[Ys.Virgil]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},icon:zf,deprecated:!0},[Ys.Helvetica]:{metrics:{unitsPerEm:2048,ascender:1577,descender:-471,lineHeight:1.15},icon:mm,deprecated:!0,local:!0},[Ys.Cascadia]:{metrics:{unitsPerEm:2048,ascender:1900,descender:-480,lineHeight:1.2},icon:hm,deprecated:!0},[Ys[`Liberation Sans`]]:{metrics:{unitsPerEm:2048,ascender:1854,descender:-434,lineHeight:1.15},serverSide:!0},[Xs.Xiaolai]:{metrics:{unitsPerEm:1e3,ascender:880,descender:-144,lineHeight:1.15},fallback:!0},[Xs[`Segoe UI Emoji`]]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},local:!0,fallback:!0}},gh={LATIN:`U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD`,LATIN_EXT:`U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF`,CYRILIC_EXT:`U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F`,CYRILIC:`U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116`,VIETNAMESE:`U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB`},_h=`local:`,vh=class extends Error{constructor(e=`Couldn't export canvas.`,t=`CANVAS_ERROR`){super(),this.name=t,this.message=e}},yh=class extends DOMException{constructor(e=`Request Aborted`){super(e,`AbortError`)}},bh=class extends Error{constructor(e=`Image Scene Data Error`,t=`IMAGE_SCENE_DATA_ERROR`){super(e),v(this,`code`),this.name=`EncodingError`,this.code=t}},xh=class extends Error{constructor(){super(...arguments),v(this,`code`,`ELEMENT_HAS_INVALID_INDEX`)}},Sh=class extends Error{constructor(e=`Worker URL is not defined!`,t=`WORKER_URL_NOT_DEFINED`){super(e),v(this,`code`),this.name=`WorkerUrlNotDefinedError`,this.code=t}},Ch=class extends Error{constructor(e=`Worker has to be in a separate chunk!`,t=`WORKER_IN_THE_MAIN_CHUNK`){super(e),v(this,`code`),this.name=`WorkerInTheMainChunkError`,this.code=t}},wh=class extends Error{constructor(e){super(e),this.name=`ExcalidrawError`}},Th=class{constructor(e){v(this,`instance`),v(this,`debounceTerminate`),this.instance=new Worker(e,{type:`module`})}},Eh=class e{constructor(e,t){v(this,`idleWorkers`,new Set),v(this,`workerUrl`),v(this,`workerTTL`),this.workerUrl=e,this.workerTTL=t.ttl||1e3}static create(t,n={}){if(!t)throw new Sh;if(!import.meta.url||t.toString()===import.meta.url)throw new Ch;return new e(t,n)}async postMessage(e,t){let n,r=Array.from(this.idleWorkers).shift();return r?(this.idleWorkers.delete(r),n=r):n=await this.createWorker(),new Promise((r,i)=>{n.instance.onmessage=this.onMessageHandler(n,r),n.instance.onerror=this.onErrorHandler(n,i),n.instance.postMessage(e,t),n.debounceTerminate(()=>i(Error(`Active worker did not respond for ${this.workerTTL}ms!`)))})}async clear(){for(let e of this.idleWorkers)e.debounceTerminate.cancel(),e.instance.terminate();this.idleWorkers.clear()}async createWorker(){let e=new Th(this.workerUrl);return e.debounceTerminate=lu(t=>{e.instance.terminate(),this.idleWorkers.has(e)?(this.idleWorkers.delete(e),console.debug(`Job finished! Idle worker has been released from the pool.`)):t?t():console.error(`Worker has been terminated!`)},this.workerTTL),e}onMessageHandler(e,t){return n=>{e.debounceTerminate(),this.idleWorkers.add(e),t(n.data)}}onErrorHandler(e,t){return n=>{e.debounceTerminate(()=>t(n)),e.debounceTerminate.flush(),this.clear()}}},Dh=typeof Worker<`u`,Oh=async(e,t)=>{let{Commands:n,subsetToBase64:r,toBase64:i}=await Mh();return Dh?id(async()=>{try{let r=await Ph(),a=e.slice(0),o=await r.postMessage({command:n.Subset,arrayBuffer:a,codePoints:t},{transfer:[a]});return i(o)}catch(n){return Dh=!1,zu()&&(n instanceof Sh||n instanceof Ch)||console.error(`Failed to use workers for subsetting, falling back to the main thread.`,n),r(e,t)}}):r(e,t)},kh=null,Ah=null,jh=async()=>(kh||=A(()=>import(`./subset-worker.chunk-BLppPGco.js`),__vite__mapDeps([0,1]),import.meta.url),kh),Mh=async()=>(Ah||=A(()=>import(`./subset-shared.chunk-DQ-JqEaX.js`),__vite__mapDeps([2,1]),import.meta.url),Ah),Nh=null,Ph=()=>(Nh||=id(async()=>{let{WorkerUrl:e}=await jh();return Eh.create(e)}),Nh),Fh=class e{constructor(t,n,r){v(this,`urls`),v(this,`fontFace`),this.urls=e.createUrls(n);let i=this.urls.map(t=>`url(${t}) ${e.getFormat(t)}`).join(`, `);this.fontFace=new FontFace(t,i,{display:`swap`,style:`normal`,weight:`400`,...r})}toCSS(e){if(!this.getUnicodeRangeRegex().test(e))return;let t=Array.from(e).map(e=>e.codePointAt(0));return this.getContent(t).then(e=>`@font-face { font-family: ${this.fontFace.family}; src: url(${e}); }`)}async getContent(e){let t=0,n=[];for(;t<this.urls.length;){let r=this.urls[t];try{return await Oh(await this.fetchFont(r),e)}catch(e){n.push(`"${r.toString()}" returned error "${e}"`)}t++}return console.error(`Failed to fetch font family "${this.fontFace.family}"`,JSON.stringify(n,void 0,2)),this.urls.length?this.urls[this.urls.length-1].toString():``}fetchFont(e){return id(async()=>{let t=await fetch(e,{cache:`force-cache`,headers:{Accept:`font/woff2`}});if(!t.ok){let n=e instanceof URL?e.toString():`dataurl`;throw Error(`Failed to fetch "${n}": ${t.statusText}`)}return await t.arrayBuffer()})}getUnicodeRangeRegex(){let e=this.fontFace.unicodeRange.split(/,\s*/).map(e=>{let[t,n]=e.replace(`U+`,``).split(`-`);return n?`\\u{${t}}-\\u{${n}}`:`\\u{${t}}`}).join(``);return RegExp(`[${e}]`,`u`)}static createUrls(t){if(t.startsWith(`data`))return[t];if(t.startsWith(_h))return[];if(t.startsWith(`http`))return[new URL(t)];let n=t.replace(/^\/+/,``),r=[];if(typeof window.EXCALIDRAW_ASSET_PATH==`string`){let e=this.normalizeBaseUrl(window.EXCALIDRAW_ASSET_PATH);r.push(new URL(n,e))}else Array.isArray(window.EXCALIDRAW_ASSET_PATH)&&window.EXCALIDRAW_ASSET_PATH.forEach(e=>{let t=this.normalizeBaseUrl(e);r.push(new URL(n,t))});return r.push(new URL(n,e.ASSETS_FALLBACK_URL)),r}static getFormat(e){if(!(e instanceof URL))return``;try{let t=new URL(e).pathname.split(`.`);return t.length===1?``:`format('${t.pop()}')`}catch{return``}}static normalizeBaseUrl(e){let t=e;return/^\.?\//.test(t)&&(t=new URL(t.replace(/^\.?\/+/,``),window?.location?.origin).toString()),t=`${t.replace(/\/+$/,``)}/`,t}};v(Fh,`ASSETS_FALLBACK_URL`,`https://esm.sh/${f.PKG_NAME?`${f.PKG_NAME}@${f.PKG_VERSION}`:`@excalidraw/excalidraw`}/dist/prod/`);var Ih=Fh,Lh=[{uri:`./fonts/Cascadia/CascadiaCode-Regular.woff2`}],Rh=[{uri:`./fonts/ComicShanns/ComicShanns-Regular-279a7b317d12eb88de06167bd672b4b4.woff2`,descriptors:{unicodeRange:`U+20-7e,U+a1-a6,U+a8,U+ab-ac,U+af-b1,U+b4,U+b8,U+bb-bc,U+bf-cf,U+d1-d7,U+d9-de,U+e0-ef,U+f1-f7,U+f9-ff,U+131,U+152-153,U+2c6,U+2da,U+2dc,U+2013-2014,U+2018-201a,U+201c-201d,U+2020-2022,U+2026,U+2039-203a,U+2044,U+20ac,U+2191,U+2193,U+2212`}},{uri:`./fonts/ComicShanns/ComicShanns-Regular-fcb0fc02dcbee4c9846b3e2508668039.woff2`,descriptors:{unicodeRange:`U+100-10f,U+112-125,U+128-130,U+134-137,U+139-13c,U+141-148,U+14c-151,U+154-161,U+164-165,U+168-17f,U+1bf,U+1f7,U+218-21b,U+237,U+1e80-1e85,U+1ef2-1ef3,U+a75b`}},{uri:`./fonts/ComicShanns/ComicShanns-Regular-dc6a8806fa96795d7b3be5026f989a17.woff2`,descriptors:{unicodeRange:`U+2c7,U+2d8-2d9,U+2db,U+2dd,U+315,U+2190,U+2192,U+2200,U+2203-2204,U+2264-2265,U+f6c3`}},{uri:`./fonts/ComicShanns/ComicShanns-Regular-6e066e8de2ac57ea9283adb9c24d7f0c.woff2`,descriptors:{unicodeRange:`U+3bb`}}],zh=[{uri:_h}],Bh=[{uri:`./fonts/Excalifont/Excalifont-Regular-a88b72a24fb54c9f94e3b5fdaa7481c9.woff2`,descriptors:{unicodeRange:`U+20-7e,U+a0-a3,U+a5-a6,U+a8-ab,U+ad-b1,U+b4,U+b6-b8,U+ba-ff,U+131,U+152-153,U+2bc,U+2c6,U+2da,U+2dc,U+304,U+308,U+2013-2014,U+2018-201a,U+201c-201e,U+2020,U+2022,U+2024-2026,U+2030,U+2039-203a,U+20ac,U+2122,U+2212`}},{uri:`./fonts/Excalifont/Excalifont-Regular-be310b9bcd4f1a43f571c46df7809174.woff2`,descriptors:{unicodeRange:`U+100-130,U+132-137,U+139-149,U+14c-151,U+154-17e,U+192,U+1fc-1ff,U+218-21b,U+237,U+1e80-1e85,U+1ef2-1ef3,U+2113`}},{uri:`./fonts/Excalifont/Excalifont-Regular-b9dcf9d2e50a1eaf42fc664b50a3fd0d.woff2`,descriptors:{unicodeRange:`U+400-45f,U+490-491,U+2116`}},{uri:`./fonts/Excalifont/Excalifont-Regular-41b173a47b57366892116a575a43e2b6.woff2`,descriptors:{unicodeRange:`U+37e,U+384-38a,U+38c,U+38e-393,U+395-3a1,U+3a3-3a8,U+3aa-3cf,U+3d7`}},{uri:`./fonts/Excalifont/Excalifont-Regular-3f2c5db56cc93c5a6873b1361d730c16.woff2`,descriptors:{unicodeRange:`U+2c7,U+2d8-2d9,U+2db,U+2dd,U+302,U+306-307,U+30a-30c,U+326-328,U+212e,U+2211,U+fb01-fb02`}},{uri:`./fonts/Excalifont/Excalifont-Regular-349fac6ca4700ffec595a7150a0d1e1d.woff2`,descriptors:{unicodeRange:`U+462-463,U+472-475,U+4d8-4d9,U+4e2-4e3,U+4e6-4e9,U+4ee-4ef`}},{uri:`./fonts/Excalifont/Excalifont-Regular-623ccf21b21ef6b3a0d87738f77eb071.woff2`,descriptors:{unicodeRange:`U+300-301,U+303`}}],Vh=[{uri:_h}],Hh=[{uri:`./fonts/Liberation/LiberationSans-Regular.woff2`}],Uh=[{uri:`./fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYE98RXi4EwSsbg.woff2`,descriptors:{unicodeRange:gh.LATIN_EXT}},{uri:`./fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYEF8RXi4EwQ.woff2`,descriptors:{unicodeRange:gh.LATIN}}],Wh=[{uri:`./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTk3j6zbXWjgevT5.woff2`,descriptors:{unicodeRange:gh.CYRILIC_EXT,weight:`500`}},{uri:`./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTA3j6zbXWjgevT5.woff2`,descriptors:{unicodeRange:gh.CYRILIC,weight:`500`}},{uri:`./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTs3j6zbXWjgevT5.woff2`,descriptors:{unicodeRange:gh.VIETNAMESE,weight:`500`}},{uri:`./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTo3j6zbXWjgevT5.woff2`,descriptors:{unicodeRange:gh.LATIN_EXT,weight:`500`}},{uri:`./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTQ3j6zbXWjgeg.woff2`,descriptors:{unicodeRange:gh.LATIN,weight:`500`}}],Gh=[{uri:`./fonts/Virgil/Virgil-Regular.woff2`}],Kh=[{uri:`./fonts/Xiaolai/Xiaolai-Regular-09850c4077f3fffe707905872e0e2460.woff2`,descriptors:{unicodeRange:`U+f9b8-fa6d,U+fe32,U+fe45-fe4f,U+ff02-ff0b,U+ff0d-ff1e,U+ff20-ff2a`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-7eb9fffd1aa890d07d0f88cc82e6cfe4.woff2`,descriptors:{unicodeRange:`U+20dd-20de,U+25ef,U+ff2b-ffbe,U+ffc2-ffc7,U+ffca-ffcf,U+ffd2-ffd7,U+ffda-ffdc,U+ffe0-ffe6,U+ffe8-ffee`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-60a3089806700d379f11827ee9843b6b.woff2`,descriptors:{unicodeRange:`U+d7eb-d7fb,U+f900-f9b7`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-6fe5c5973cc06f74b2387a631ea36b88.woff2`,descriptors:{unicodeRange:`U+d6f2-d7a3,U+d7b0-d7c6,U+d7cb-d7ea`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-b96d9226ce77ec94ceca043d712182e6.woff2`,descriptors:{unicodeRange:`U+d609-d6f1`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-6ae5b42180ad70b971c91e7eefb8eba2.woff2`,descriptors:{unicodeRange:`U+d520-d608`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-a4c34be6d42152e64b0df90bc4607f64.woff2`,descriptors:{unicodeRange:`U+d437-d51f`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-c69f61a4ab18d0488c8d1fc12e7028e8.woff2`,descriptors:{unicodeRange:`U+d34e-d436`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-e3fcf5180fd466c8915c4e8069491054.woff2`,descriptors:{unicodeRange:`U+d265-d34d`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-c1f94158256bb1f3bf665b053d895af9.woff2`,descriptors:{unicodeRange:`U+d17c-d264`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-544fc28abe2c5c30e62383fd4dac255f.woff2`,descriptors:{unicodeRange:`U+d093-d17b`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-7197d6fda6cba7c3874c53d6381ca239.woff2`,descriptors:{unicodeRange:`U+cfaa-d092`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-70c2eb8d64e71a42a834eb857ea9df51.woff2`,descriptors:{unicodeRange:`U+cec1-cfa9`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-069e77aac84590e2e991d0a0176d34f2.woff2`,descriptors:{unicodeRange:`U+cdd8-cec0`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-41521fade99856108931b4768b1b2648.woff2`,descriptors:{unicodeRange:`U+ccf1-cdd7`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-a004ddfcb26e67bd6e678c8ed19e25ce.woff2`,descriptors:{unicodeRange:`U+cc08-ccf0`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-04b718e5623574919c8b0dea5f301444.woff2`,descriptors:{unicodeRange:`U+cb43-cc07`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-7e4bde7e9c7f84cd34d8a845e384c746.woff2`,descriptors:{unicodeRange:`U+ca83-cb42`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-23686f7f29da6e8008c36dd3a80c83d6.woff2`,descriptors:{unicodeRange:`U+c9a1-ca82`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-69c09cc5fa3e55c74fc4821f76909cc3.woff2`,descriptors:{unicodeRange:`U+c8b8-c9a0`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-25b7f38e18f035f96cb5e547bd2bd08c.woff2`,descriptors:{unicodeRange:`U+c7cf-c8b7`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-ba3de316d63c7e339987b16f41a0b879.woff2`,descriptors:{unicodeRange:`U+c6e6-c7ce`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-12b52b58eb3df36804b9a654ec9ee194.woff2`,descriptors:{unicodeRange:`U+c5fd-c6e5`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-b1220a3c61f85cc0408deedb4c5f57a2.woff2`,descriptors:{unicodeRange:`U+c514-c5fc`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-4535823663ad81405188a528d8f2b1a2.woff2`,descriptors:{unicodeRange:`U+c42b-c513`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-3eaa538115d76932653c21d8dc28f207.woff2`,descriptors:{unicodeRange:`U+c341-c34e,U+c350-c42a`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-7e929f262f30c8ee78bf398150b1a7cd.woff2`,descriptors:{unicodeRange:`U+c258-c340`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-73e309718fd16cea44b4d54a33581811.woff2`,descriptors:{unicodeRange:`U+c16f-c257`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-9eb5a99df4e76ac3363453ac9ca288b1.woff2`,descriptors:{unicodeRange:`U+c086-c16e`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-3e63ed8162808a9e425ed80a8bc79114.woff2`,descriptors:{unicodeRange:`U+bf9d-c085`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-cb17fc3db95f6d139afc9d31a8e93293.woff2`,descriptors:{unicodeRange:`U+beb4-bf9c`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-c8b71798409ccc126ee264a00aadcf21.woff2`,descriptors:{unicodeRange:`U+bdcb-beb3`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-11c345711937f0ba4b8f7b6b919c8440.woff2`,descriptors:{unicodeRange:`U+bce2-bdca`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-e480d9c614742d05f0e78f274f1e69e6.woff2`,descriptors:{unicodeRange:`U+bbf9-bce1`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-95429962233afd82db1c27df1500a28c.woff2`,descriptors:{unicodeRange:`U+bb10-bbf8`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-2cf96d082d35ea3d8106851223ad0d16.woff2`,descriptors:{unicodeRange:`U+ba27-bb0f`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-2d43040e86ff03ba677f6f9c04cd0805.woff2`,descriptors:{unicodeRange:`U+b93e-ba26`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-2a26d20a23b00898ce82f09d2ee47c3f.woff2`,descriptors:{unicodeRange:`U+b855-b93d`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-a365e82ed54697a52f27adcea1315fe8.woff2`,descriptors:{unicodeRange:`U+b76c-b854`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-f5d079153c99a25b9be5b8583c4cc8a7.woff2`,descriptors:{unicodeRange:`U+b683-b76b`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-10a7ae9a371830a80c3d844acf1c02d7.woff2`,descriptors:{unicodeRange:`U+b59a-b682`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-e4bca6cfa53e499cae0a6be4894a90e9.woff2`,descriptors:{unicodeRange:`U+b4b1-b599`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-60a41c7e1c68f22424e6d22df544bc82.woff2`,descriptors:{unicodeRange:`U+11fb-11ff,U+b3cd-b4b0`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-7ab2bed91166a9dca83a5ebfbe2a7f38.woff2`,descriptors:{unicodeRange:`U+11e6-11fa,U+b2f9-b3cc`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-670ba603758d94268e8606f240a42e12.woff2`,descriptors:{unicodeRange:`U+11d1-11e5,U+b225-b2f8`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-e656f091b9dc4709722c9f4b84d3c797.woff2`,descriptors:{unicodeRange:`U+11bc-11d0,U+b151-b224`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-15dc6d811c9cd078f9086a740d5a1038.woff2`,descriptors:{unicodeRange:`U+11a7-11bb,U+b07d-b150`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-f0f13b5c60e0af5553bd359f5513be1b.woff2`,descriptors:{unicodeRange:`U+1191-11a6,U+afaa-b07c`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-8c2f33cee3993174f7e87c28e4bf42ee.woff2`,descriptors:{unicodeRange:`U+117c-1190,U+aed6-afa9`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-761d05e3cd968cf574166867998ef06a.woff2`,descriptors:{unicodeRange:`U+1167-117b,U+ae02-aed5`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-642b26e2e5f5fb780b51b593dbc8c851.woff2`,descriptors:{unicodeRange:`U+1152-115e,U+1160-1166,U+ad2d-ae01`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-5572b3513ba8df57a3d5d7303ee6b11b.woff2`,descriptors:{unicodeRange:`U+113d-1151,U+ac59-ad2c`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-3c9de2ae0ea4bc91a510942dfa4be8d2.woff2`,descriptors:{unicodeRange:`U+1100-113c,U+9f95-9f98,U+9f9c-9f9e,U+9fa1-9fce,U+9fd0,U+a960-a97c,U+ac00-ac58`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-671a2c20b1eb9e4ef8a192833940e319.woff2`,descriptors:{unicodeRange:`U+9771-9772,U+9775,U+9777-977b,U+977d-9784,U+9786-978a,U+978c,U+978e-9790,U+9793,U+9795-9797,U+9799-979f,U+97a1-97a2,U+97a4-97aa,U+97ac,U+97ae,U+97b0-97b1,U+97b3,U+97b5-97e5,U+97e8,U+97ee-97f2,U+97f4,U+97f7-982d`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-4dc6d5f188d5c96d44815cd1e81aa885.woff2`,descriptors:{unicodeRange:`U+9491,U+9496,U+9498,U+94c7,U+94cf,U+94d3-94d4,U+94da,U+94e6,U+94fb,U+951c,U+9520,U+9527,U+9533,U+953d,U+9543,U+9548,U+954b,U+9555,U+955a,U+9560,U+956e,U+9574-9575,U+9577-957e,U+9580-95e7,U+95ec,U+95ff,U+9607,U+9613,U+9618,U+961b,U+961e,U+9620,U+9623-9629,U+962b-962d,U+962f-9630,U+9637-963a,U+963e,U+9641,U+9643,U+964a,U+964e-964f,U+9651-9653,U+9656-965a,U+965c-965e,U+9660,U+9663,U+9665-9666,U+966b,U+966d-9671,U+9673,U+9678-9684,U+9687,U+9689-968a,U+968c,U+968e,U+9691-9693`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-ce4884f96f11589608b76b726a755803.woff2`,descriptors:{unicodeRange:`U+923c-9273,U+9275-928d,U+928f-92ad,U+92af-92c7,U+92c9-92ee`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-8f476c4c99813d57cbe6eca4727388ad.woff2`,descriptors:{unicodeRange:`U+9159,U+915b-915c,U+915f-9160,U+9166-9168,U+916b,U+916d,U+9173,U+917a-917c,U+9180-9184,U+9186,U+9188,U+918a,U+918e-918f,U+9193-9199,U+919c-91a1,U+91a4-91a9,U+91ab-91ac,U+91b0-91b3,U+91b6-91b9,U+91bb-91c6,U+91c8,U+91cb,U+91d0,U+91d2-91db,U+91dd-923b`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-5935a5775af3d5c6307ac667bd9ae74e.woff2`,descriptors:{unicodeRange:`U+902b-902c,U+9030-9034,U+9037,U+9039-903a,U+903d,U+903f-9040,U+9043,U+9045-9046,U+9048-904c,U+904e,U+9054-9056,U+9059-905a,U+905c-9061,U+9064,U+9066-9067,U+9069-906c,U+906f-9073,U+9076-907c,U+907e,U+9081,U+9084-9087,U+9089-908a,U+908c-9090,U+9092,U+9094,U+9096,U+9098,U+909a,U+909c,U+909e-90a0,U+90a4-90a5,U+90a7-90a9,U+90ab,U+90ad,U+90b2,U+90b7,U+90bc-90bd,U+90bf-90c0,U+90c2-90c3,U+90c6,U+90c8-90c9,U+90cb-90cd,U+90d2,U+90d4-90d6,U+90d8-90da,U+90de-90e0,U+90e3-90e5,U+90e9-90ea,U+90ec,U+90ee,U+90f0-90f3,U+90f5-90f7,U+90f9-90fc,U+90ff-9101,U+9103,U+9105-9118,U+911a-911d,U+911f-9121,U+9124-912e,U+9130,U+9132-9138,U+913a-9142,U+9144-9145,U+9147-9148,U+9151,U+9153-9156,U+9158`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-79f007c1c6d07557120982951ea67998.woff2`,descriptors:{unicodeRange:`U+8f03-8f65,U+8f6a,U+8f80,U+8f8c,U+8f92,U+8f9d,U+8fa0-8fa2,U+8fa4-8fa7,U+8faa,U+8fac-8faf,U+8fb2-8fb5,U+8fb7-8fb8,U+8fba-8fbc,U+8fbf-8fc0,U+8fc3,U+8fc6,U+8fc9-8fcd,U+8fcf,U+8fd2,U+8fd6-8fd7,U+8fda,U+8fe0-8fe1,U+8fe3,U+8fe7,U+8fec,U+8fef,U+8ff1-8ff2,U+8ff4-8ff6,U+8ffa-8ffc,U+8ffe-8fff,U+9007-9008,U+900c,U+900e,U+9013,U+9015,U+9018-9019,U+901c,U+9023-9025,U+9027-902a`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-bafff7a14c27403dcc6cf1432e8ea836.woff2`,descriptors:{unicodeRange:`U+8d03-8d1c,U+8d20,U+8d51-8d52,U+8d57,U+8d5f,U+8d65,U+8d68-8d6a,U+8d6c,U+8d6e-8d6f,U+8d71-8d72,U+8d78-8d80,U+8d82-8d83,U+8d86-8d89,U+8d8c-8d90,U+8d92-8d93,U+8d95-8d9e,U+8da0-8da2,U+8da4-8db0,U+8db2,U+8db6-8db7,U+8db9,U+8dbb,U+8dbd,U+8dc0-8dc2,U+8dc5,U+8dc7-8dca,U+8dcd,U+8dd0,U+8dd2-8dd5,U+8dd8-8dd9,U+8ddc,U+8de0-8de2,U+8de5-8de7,U+8de9,U+8ded-8dee,U+8df0-8df2,U+8df4,U+8df6,U+8dfc,U+8dfe-8e04,U+8e06-8e08,U+8e0b,U+8e0d-8e0e,U+8e10-8e13,U+8e15-8e1c,U+8e20-8e21,U+8e24-8e28,U+8e2b,U+8e2d,U+8e30,U+8e32-8e34,U+8e36-8e38,U+8e3b-8e3c,U+8e3e-8e3f,U+8e43,U+8e45-8e46`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-543fa46ace099a7099dad69123399400.woff2`,descriptors:{unicodeRange:`U+8bea,U+8c09,U+8c1e,U+8c38-8c40,U+8c42-8c45,U+8c48,U+8c4a-8c4b,U+8c4d-8c54,U+8c56-8c59,U+8c5b-8c60,U+8c63-8c69,U+8c6c-8c72,U+8c74-8c77,U+8c7b-8c81,U+8c83-8c84,U+8c86-8c88,U+8c8b,U+8c8d-8c93,U+8c95-8c97,U+8c99-8d02`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-4ddc14ed3eb0c3e46364317dfc0144a3.woff2`,descriptors:{unicodeRange:`U+8a64-8a78,U+8a7a-8a88,U+8a8b-8a92,U+8a94-8b06,U+8b08-8b1b`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-0fa55a080fcd0f9dc2e0b0058b793df8.woff2`,descriptors:{unicodeRange:`U+8987-89c0,U+89c3,U+89cd,U+89d3-89d5,U+89d7-89d9,U+89db,U+89dd,U+89df-89e2,U+89e4,U+89e7-89ea,U+89ec-89ee,U+89f0-89f2,U+89f4-89ff,U+8a01-8a06,U+8a08-8a3d,U+8a3f-8a47,U+8a49-8a63`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-66493ba5a8367f2928812f446f47b56a.woff2`,descriptors:{unicodeRange:`U+87e3-87e4,U+87e6-87e9,U+87eb-87ed,U+87ef-87f8,U+87fa-87fd,U+87ff-8802,U+8804-8809,U+880b-8812,U+8814,U+8817-881a,U+881c-8820,U+8823-8831,U+8833-8838,U+883a-883b,U+883d-883f,U+8841-8843,U+8846-884b,U+884e-8853,U+8855-8856,U+8858,U+885a-8860,U+8866-8867,U+886a,U+886d,U+886f,U+8871,U+8873-8876,U+8878-887c,U+8880,U+8883,U+8886-8887,U+8889-888a,U+888c,U+888e-8891,U+8893-8895,U+8897-889b,U+889d-88a1,U+88a3,U+88a5-88aa,U+88ac,U+88ae-88b0,U+88b2-88b6,U+88b8-88bb`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-57862b464a55b18c7bf234ce22907d73.woff2`,descriptors:{unicodeRange:`U+86e7-86e8,U+86ea-86ec,U+86ef,U+86f5-86f7,U+86fa-86fd,U+86ff,U+8701,U+8704-8706,U+870b-870c,U+870e-8711,U+8714,U+8716,U+8719,U+871b,U+871d,U+871f-8720,U+8724,U+8726-8728,U+872a-872d,U+872f-8730,U+8732-8733,U+8735-8736,U+8738-873a,U+873c-873d,U+8740-8746,U+874a-874b,U+874d,U+874f-8752,U+8754-8756,U+8758,U+875a-875f,U+8761-8762,U+8766-876d,U+876f,U+8771-8773,U+8775,U+8777-877a,U+877f-8781,U+8784,U+8786-8787,U+8789-878a,U+878c,U+878e-8792,U+8794-8796,U+8798-879e,U+87a0-87a7,U+87a9-87aa,U+87ae,U+87b0-87b2,U+87b4,U+87b6-87b9,U+87bb-87bc,U+87be-87bf,U+87c1-87c5,U+87c7-87c9,U+87cc-87d0,U+87d4-87da,U+87dc-87df,U+87e1-87e2`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-8d3bcabb847b56243b16afe62adaaf21.woff2`,descriptors:{unicodeRange:`U+8604,U+8606-8610,U+8612-8615,U+8617-8626,U+8628,U+862a-8637,U+8639-863b,U+863d-864c,U+8652-8653,U+8655-8659,U+865b-865d,U+865f-8661,U+8663-866a,U+866d,U+866f-8670,U+8672-8678,U+8683-8689,U+868e-8692,U+8694,U+8696-869b,U+869e-86a2,U+86a5-86a6,U+86ab,U+86ad-86ae,U+86b2-86b3,U+86b7-86b9,U+86bb-86bf,U+86c1-86c3,U+86c5,U+86c8,U+86cc-86cd,U+86d2-86d3,U+86d5-86d7,U+86da,U+86dc-86dd,U+86e0-86e3,U+86e5-86e6`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-2b77e8ebfb2367ab2662396a60e7d320.woff2`,descriptors:{unicodeRange:`U+8456,U+8458,U+845d-8460,U+8462,U+8464-8468,U+846a,U+846e-8470,U+8472,U+8474,U+8477,U+8479,U+847b-8481,U+8483-8486,U+848a,U+848d,U+848f-8496,U+8498,U+849a-849b,U+849d-84a0,U+84a2-84ae,U+84b0-84b1,U+84b3,U+84b5-84b7,U+84bb-84bc,U+84be,U+84c0,U+84c2-84c3,U+84c5-84c8,U+84cb-84cc,U+84ce-84cf,U+84d2,U+84d4-84d5,U+84d7-84dc,U+84de,U+84e1-84e2,U+84e4,U+84e7-84eb,U+84ed-84ef,U+84f1-84fb,U+84fd-84fe,U+8500-850b,U+850d-8510,U+8512,U+8514-8516,U+8518-8519,U+851b-851e,U+8520,U+8522-852a,U+852d-8536,U+853e-8542,U+8544-8547,U+854b-854f`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-0b5d723fdc4e249c140f0909e87d03b4.woff2`,descriptors:{unicodeRange:`U+82c2-82c3,U+82c5-82c6,U+82c9,U+82d0,U+82d6,U+82d9-82da,U+82dd,U+82e2,U+82e7-82ea,U+82ec-82ee,U+82f0,U+82f2-82f3,U+82f5-82f6,U+82f8,U+82fa,U+82fc-8300,U+830a-830b,U+830d,U+8310,U+8312-8313,U+8316,U+8318-8319,U+831d-8326,U+8329-832a,U+832e,U+8330,U+8332,U+8337,U+833b,U+833d-833f,U+8341-8342,U+8344-8345,U+8348,U+834a-834e,U+8353,U+8355-8359,U+835d,U+8362,U+8370-8376,U+8379-837a,U+837e-8384,U+8387-8388,U+838a-838d,U+838f-8391,U+8394-8397,U+8399-839a,U+839d,U+839f,U+83a1-83a7,U+83ac-83af,U+83b5,U+83bb,U+83be-83bf,U+83c2-83c4,U+83c6,U+83c8-83c9,U+83cb,U+83cd-83ce,U+83d0-83d3,U+83d5,U+83d7,U+83d9-83db,U+83de,U+83e2-83e4,U+83e6-83e8,U+83eb-83ef,U+83f3-83f7,U+83fa-83fc,U+83fe-8400,U+8402,U+8405,U+8407-840a,U+8410,U+8412-8417,U+8419-841b,U+841e-8423,U+8429-8430,U+8432-8437,U+8439-843b,U+843e-8445,U+8447-8450,U+8452-8455`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-cdbce89e82cc1ab53a2decbf5819278f.woff2`,descriptors:{unicodeRange:`U+81a4-81a5,U+81a7,U+81a9,U+81ab-81b2,U+81b4-81b9,U+81bc-81bf,U+81c4-81c5,U+81c7-81c9,U+81cb,U+81cd-81e2,U+81e4-81e6,U+81e8-81e9,U+81eb,U+81ee-81f2,U+81f5-81fa,U+81fd,U+81ff,U+8203,U+8207-820b,U+820e-820f,U+8211,U+8213,U+8215-821a,U+821d,U+8220,U+8224-8227,U+8229,U+822e,U+8232,U+823a,U+823c-823d,U+823f-8243,U+8245-8246,U+8248,U+824a,U+824c-824e,U+8250-8257,U+8259,U+825b-825e,U+8260-8267,U+8269-826d,U+8271,U+8275-8278,U+827b-827c,U+8280-8281,U+8283,U+8285-8287,U+8289,U+828c,U+8290,U+8293-8296,U+829a-829b,U+829e,U+82a0,U+82a2-82a3,U+82a7,U+82b2,U+82b5-82b6,U+82ba-82bc,U+82bf-82c0`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-739bc1a567439c7cffcd1614644593d2.woff2`,descriptors:{unicodeRange:`U+8059,U+805b-8068,U+806b-8070,U+8072-807e,U+8081-8082,U+8085,U+8088,U+808a,U+808d-8092,U+8094-8095,U+8097,U+8099,U+809e,U+80a3,U+80a6-80a8,U+80ac,U+80b0,U+80b3,U+80b5-80b6,U+80b8-80b9,U+80bb,U+80c5,U+80c7-80cb,U+80cf-80d5,U+80d8,U+80df-80e0,U+80e2-80e3,U+80e6,U+80ee,U+80f5,U+80f7,U+80f9,U+80fb,U+80fe-8101,U+8103-8105,U+8107-8108,U+810b-810c,U+8115,U+8117,U+8119,U+811b-811d,U+811f-812b,U+812d-812e,U+8130,U+8133-8135,U+8137,U+8139-813d,U+813f-8145,U+8147,U+8149,U+814d-814f,U+8152,U+8156-8158,U+815b-815f,U+8161-8164,U+8166,U+8168,U+816a-816c,U+816f,U+8172-8173,U+8175-8178,U+8181,U+8183-8187,U+8189,U+818b-818e,U+8190,U+8192-8197,U+8199-819a,U+819e-81a2`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-72252d73220fa3cd856677888cee1635.woff2`,descriptors:{unicodeRange:`U+7f3c-7f41,U+7f43,U+7f46-7f4f,U+7f52-7f53,U+7f56,U+7f59,U+7f5b-7f5e,U+7f60,U+7f63-7f67,U+7f6b-7f6d,U+7f6f-7f70,U+7f73,U+7f75-7f78,U+7f7a-7f7d,U+7f7f-7f80,U+7f82-7f89,U+7f8b,U+7f8d,U+7f8f-7f93,U+7f95-7f99,U+7f9b-7f9c,U+7fa0,U+7fa2-7fa3,U+7fa5-7fa6,U+7fa8-7fae,U+7fb1,U+7fb3-7fb7,U+7fba-7fbb,U+7fbe,U+7fc0,U+7fc2-7fc4,U+7fc6-7fc9,U+7fcb,U+7fcd,U+7fcf-7fd3,U+7fd6-7fd7,U+7fd9-7fde,U+7fe2-7fe4,U+7fe7-7fe8,U+7fea-7fed,U+7fef,U+7ff2,U+7ff4-7ffa,U+7ffd-7fff,U+8002,U+8007-800a,U+800e-800f,U+8011,U+8013,U+801a-801b,U+801d-801f,U+8021,U+8023-8024,U+802b-8030,U+8032,U+8034,U+8039-803a,U+803c,U+803e,U+8040-8041,U+8044-8045,U+8047-8049,U+804e-8051,U+8053,U+8055-8057`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-08e0dc436ad0ad61ba5558db0674d762.woff2`,descriptors:{unicodeRange:`U+7cd8,U+7cda-7cdb,U+7cdd-7cde,U+7ce1-7ce7,U+7ce9-7cee,U+7cf0-7cf7,U+7cf9-7cfa,U+7cfc-7d09,U+7d0b-7d1f,U+7d21,U+7d23-7d26,U+7d28-7d2a,U+7d2c-7d2e,U+7d30-7d6d,U+7d6f-7d76,U+7d78-7d94`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-cf6ff4e0f491ca0cf3038187a997b9b4.woff2`,descriptors:{unicodeRange:`U+7afe,U+7b00-7b02,U+7b05,U+7b07,U+7b09,U+7b0c-7b0e,U+7b10,U+7b12-7b13,U+7b16-7b18,U+7b1a,U+7b1c-7b1d,U+7b1f,U+7b21-7b23,U+7b27,U+7b29,U+7b2d,U+7b2f-7b30,U+7b32,U+7b34-7b37,U+7b39,U+7b3b,U+7b3d,U+7b3f-7b44,U+7b46,U+7b48,U+7b4a,U+7b4d-7b4e,U+7b53,U+7b55,U+7b57,U+7b59,U+7b5c,U+7b5e-7b5f,U+7b61,U+7b63-7b6d,U+7b6f-7b70,U+7b73-7b74,U+7b76,U+7b78,U+7b7a,U+7b7c-7b7d,U+7b7f,U+7b81-7b84,U+7b86-7b8c,U+7b8e-7b8f,U+7b91-7b93,U+7b96,U+7b98-7b9b,U+7b9e-7ba0,U+7ba3-7ba5,U+7bae-7bb0,U+7bb2-7bb3,U+7bb5-7bb7,U+7bb9-7bc0,U+7bc2-7bc5,U+7bc8-7bcb,U+7bcd-7bd0,U+7bd2,U+7bd4-7bd8,U+7bdb-7bdc,U+7bde-7be0,U+7be2-7be4,U+7be7-7be9,U+7beb-7bed,U+7bef-7bf0,U+7bf2-7bf6,U+7bf8-7bfb,U+7bfd,U+7bff-7c06,U+7c08-7c0a,U+7c0d-7c0e,U+7c10-7c13`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-9cfb2a77a4e45025105ad29a1748b90d.woff2`,descriptors:{unicodeRange:`U+7a10-7a13,U+7a15-7a16,U+7a18-7a19,U+7a1b-7a1d,U+7a1f,U+7a21-7a22,U+7a24-7a32,U+7a34-7a36,U+7a38,U+7a3a,U+7a3e,U+7a40-7a45,U+7a47-7a50,U+7a52-7a56,U+7a58-7a6f,U+7a71-7a73,U+7a75,U+7a7b-7a7e,U+7a82,U+7a85,U+7a87,U+7a89-7a8c,U+7a8e-7a90,U+7a93-7a94,U+7a99-7a9b,U+7a9e,U+7aa1-7aa4,U+7aa7,U+7aa9-7aab,U+7aae-7ab2,U+7ab4-7abe,U+7ac0-7aca,U+7acc-7ad5,U+7ad7-7ad8,U+7ada-7add,U+7ae1-7ae2,U+7ae4,U+7ae7-7aec,U+7aee,U+7af0-7af8,U+7afb-7afc`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-450da755d5bcb70906e1295e559b9602.woff2`,descriptors:{unicodeRange:`U+790d-7912,U+7914-791d,U+791f-7923,U+7925-7933,U+7935-7939,U+793d,U+793f,U+7942-7945,U+7947,U+794a-7952,U+7954-7955,U+7958-7959,U+7961,U+7963-7964,U+7966,U+7969-796c,U+796e,U+7970-7976,U+7979,U+797b-797f,U+7982-7983,U+7986-7989,U+798b-798e,U+7990-7999,U+799b-79a6,U+79a8-79b2,U+79b4-79b8,U+79bc,U+79bf,U+79c2,U+79c4-79c5,U+79c7-79c8,U+79ca,U+79cc,U+79ce-79d0,U+79d3-79d4,U+79d6-79d7,U+79d9-79de,U+79e0-79e2,U+79e5,U+79e8,U+79ea,U+79ec,U+79ee,U+79f1-79f7,U+79f9-79fa,U+79fc,U+79fe-79ff,U+7a01,U+7a04-7a05,U+7a07-7a0a,U+7a0c,U+7a0f`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-0986d134c05864f5025962eef9f994a0.woff2`,descriptors:{unicodeRange:`U+77d8-77da,U+77dd-77e1,U+77e4,U+77e6,U+77e8,U+77ea,U+77ef-77f2,U+77f4-77f5,U+77f7,U+77f9-77fc,U+7803-7808,U+780a-780b,U+780e-7810,U+7813,U+7815,U+7819,U+781b,U+781e,U+7820-7822,U+7824,U+7828,U+782a-782b,U+782e-782f,U+7831-7833,U+7835-7836,U+783d,U+783f,U+7841-7844,U+7846,U+7848-784b,U+784d,U+784f,U+7851,U+7853-7854,U+7858-785c,U+785e-7869,U+786f-7876,U+7878-787b,U+787d-7886,U+7888,U+788a-788b,U+788f-7890,U+7892,U+7894-7896,U+7899,U+789d-789e,U+78a0,U+78a2,U+78a4,U+78a6,U+78a8-78af,U+78b5-78b8,U+78ba-78bd,U+78bf-78c0,U+78c2-78c4,U+78c6-78c8,U+78cc-78cf,U+78d1-78d3,U+78d6-78d8,U+78da-78e7,U+78e9-78eb,U+78ed-78f1,U+78f3,U+78f5-78f6,U+78f8-78f9,U+78fb-7900,U+7902-7904,U+7906-790c`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-1ee544f0f1dac422545c505baa788992.woff2`,descriptors:{unicodeRange:`U+76af-76b0,U+76b3,U+76b5-76be,U+76c0-76c1,U+76c3-76c4,U+76c7,U+76c9,U+76cb-76cc,U+76d3,U+76d5,U+76d9-76da,U+76dc-76de,U+76e0-76e4,U+76e6-76ed,U+76f0,U+76f3,U+76f5-76f7,U+76fa-76fb,U+76fd,U+76ff-7703,U+7705-7706,U+770a,U+770c,U+770e-7718,U+771b-771e,U+7721,U+7723-7725,U+7727,U+772a-772c,U+772e,U+7730-7734,U+7739,U+773b,U+773d-773f,U+7742,U+7744-7746,U+7748-774f,U+7752-7759,U+775c-7760,U+7764,U+7767,U+7769-776a,U+776d-7778,U+777a-777c,U+7781-7783,U+7786-778b,U+778f-7790,U+7793-779e,U+77a1,U+77a3-77a4,U+77a6,U+77a8,U+77ab,U+77ad-77af,U+77b1-77b2,U+77b4,U+77b6-77ba,U+77bc,U+77be,U+77c0-77cc,U+77ce-77d6`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-4806e761d750087c2d734fc64596eaff.woff2`,descriptors:{unicodeRange:`U+7589-758a,U+758c-758e,U+7590,U+7593,U+7595,U+7598,U+759b-759c,U+759e,U+75a2,U+75a6-75aa,U+75ad,U+75b6-75b7,U+75ba-75bb,U+75bf-75c1,U+75c6,U+75cb-75cc,U+75ce-75d1,U+75d3,U+75d7,U+75d9-75da,U+75dc-75dd,U+75df-75e1,U+75e5,U+75e9,U+75ec-75ef,U+75f2-75f3,U+75f5-75f8,U+75fa-75fb,U+75fd-75fe,U+7602,U+7604,U+7606-7609,U+760b,U+760d-760f,U+7611-7614,U+7616,U+761a,U+761c-761e,U+7621,U+7623,U+7627-7628,U+762c,U+762e-762f,U+7631-7632,U+7636-7637,U+7639-763b,U+763d,U+7641-7642,U+7644-764b,U+764e-7653,U+7655,U+7657-765b,U+765d,U+765f-7662,U+7664-766a,U+766c-766e,U+7670-7677,U+7679-767a,U+767c,U+767f-7681,U+7683,U+7685,U+7689-768a,U+768c-768d,U+768f-7690,U+7692,U+7694-7695,U+7697-7698,U+769a-76a3,U+76a5-76ad`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-33432927cd87d40cfe393c7482bf221f.woff2`,descriptors:{unicodeRange:`U+7492-749b,U+749d,U+749f-74a6,U+74aa-74b9,U+74bb-74d1,U+74d3-74db,U+74dd,U+74df,U+74e1,U+74e5,U+74e7-74ed,U+74f0-74f3,U+74f5,U+74f8-74fe,U+7500-7503,U+7505-750c,U+750e,U+7510,U+7512,U+7514-7517,U+751b,U+751d-751e,U+7520-7524,U+7526-7527,U+752a,U+752e,U+7534,U+7536,U+7539,U+753c-753d,U+753f,U+7541-7544,U+7546-7547,U+7549-754a,U+754d,U+7550-7553,U+7555-7558,U+755d-7564,U+7567-7569,U+756b-7571,U+7573,U+7575-7577,U+757a-757e,U+7580-7582,U+7584-7585,U+7587-7588`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-be549ab72f0719d606a5c01e2c0219b6.woff2`,descriptors:{unicodeRange:`U+7372-737d,U+737f-7383,U+7385-7386,U+7388,U+738a,U+738c-738d,U+738f-7390,U+7392-7395,U+7397-739a,U+739c-739e,U+73a0-73a1,U+73a3-73a8,U+73aa,U+73ac-73ad,U+73b1,U+73b4-73b6,U+73b8-73b9,U+73bc-73bf,U+73c1,U+73c3-73c7,U+73cb-73cc,U+73ce,U+73d2-73d8,U+73da-73dd,U+73df,U+73e1-73e4,U+73e6,U+73e8,U+73ea-73ec,U+73ee-73f1,U+73f3-7402,U+7404,U+7407-7408,U+740b-740e,U+7411-7419,U+741c-7421,U+7423-7424,U+7427,U+7429,U+742b,U+742d,U+742f,U+7431-7432,U+7437-743b,U+743d-7440,U+7442-7454,U+7456,U+7458,U+745d,U+7460-746c,U+746e-746f,U+7471-7475,U+7478-747d,U+747f,U+7482,U+7484-7486,U+7488-748a,U+748c-748d,U+748f,U+7491`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-019d66dcad46dc156b162d267f981c20.woff2`,descriptors:{unicodeRange:`U+7054-705d,U+705f-706a,U+706e,U+7071-7074,U+7077,U+7079-707b,U+707d,U+7081-7084,U+7086-7088,U+708b-708d,U+708f-7091,U+7093,U+7097-7098,U+709a-709b,U+709e-70aa,U+70b0,U+70b2,U+70b4-70b6,U+70ba,U+70be-70bf,U+70c4-70c7,U+70c9,U+70cb-70d7,U+70da,U+70dc-70de,U+70e0-70e3,U+70e5,U+70ea,U+70ee,U+70f0-70f6,U+70f8,U+70fa-70fc,U+70fe-7108,U+710b-710f,U+7111-7112,U+7114,U+7117,U+711b-7125,U+7127-712e,U+7132-7135,U+7137-7144,U+7146-7149,U+714b,U+714d,U+714f-715b,U+715d,U+715f-7163,U+7165,U+7169-716d,U+716f-7171,U+7174-7177`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-b5c1596551c256e0e9cf02028595b092.woff2`,descriptors:{unicodeRange:`U+722e-722f,U+7232-7234,U+723a,U+723c,U+723e,U+7240-7246,U+7249-724b,U+724e-7251,U+7253-7255,U+7257-7258,U+725a,U+725c,U+725e,U+7260,U+7263-7265,U+7268,U+726a-726d,U+7270-7271,U+7273-7274,U+7276-7278,U+727b-727d,U+7282-7283,U+7285-7289,U+728c,U+728e,U+7290-7291,U+7293-729e,U+72a0-72ab,U+72ae,U+72b1-72b3,U+72b5,U+72ba-72c0,U+72c5-72c7,U+72c9-72cc,U+72cf,U+72d1,U+72d3-72d6,U+72d8,U+72da-72dd,U+72df,U+72e2-72e7,U+72ea-72eb,U+72f5-72f6,U+72f9,U+72fd-7300,U+7302,U+7304-7309,U+730b-730d,U+730f-7312,U+7314,U+7318-731a,U+731f-7320,U+7323-7324,U+7326-7328,U+732d,U+732f-7330,U+7332-7333,U+7335-7336,U+733a-733d,U+7340-734c,U+734e-734f,U+7351,U+7353-7356,U+7358-735f,U+7361-736b,U+736e,U+7370-7371`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-e5f453bb04da18eed01675eeebd88bf8.woff2`,descriptors:{unicodeRange:`U+6ec5-6ec6,U+6ec8-6eca,U+6ecc-6ece,U+6ed0,U+6ed2,U+6ed6,U+6ed8-6ed9,U+6edb-6edd,U+6ee3,U+6ee7,U+6eea-6ef3,U+6ef5-6ef8,U+6efa-6f01,U+6f03-6f05,U+6f07-6f08,U+6f0a-6f0e,U+6f10-6f12,U+6f16-6f1f,U+6f21-6f23,U+6f25-6f28,U+6f2c,U+6f2e,U+6f30,U+6f32,U+6f34-6f35,U+6f37-6f3d,U+6f3f-6f45,U+6f48-6f4a,U+6f4c,U+6f4e-6f57,U+6f59-6f5b,U+6f5d,U+6f5f-6f61,U+6f63-6f65,U+6f67-6f6c,U+6f6f-6f71,U+6f73,U+6f75-6f77,U+6f79,U+6f7b,U+6f7d-6f83,U+6f85-6f87,U+6f8a-6f8b,U+6f8f-6f9b,U+6f9d-6fa0,U+6fa2-6fa6,U+6fa8-6fb1`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-cf2cc71752631e579e35b0e423bf2638.woff2`,descriptors:{unicodeRange:`U+6d73,U+6d75-6d76,U+6d79-6d7b,U+6d7d-6d81,U+6d83-6d84,U+6d86-6d87,U+6d8a-6d8b,U+6d8d,U+6d8f-6d90,U+6d92,U+6d96-6d9a,U+6d9c,U+6da2,U+6da5,U+6dac-6dad,U+6db0-6db1,U+6db3-6db4,U+6db6-6db7,U+6db9-6dbe,U+6dc1-6dc3,U+6dc8-6dca,U+6dcd-6dd0,U+6dd2-6dd5,U+6dd7,U+6dda-6ddc,U+6ddf,U+6de2-6de3,U+6de5,U+6de7-6dea,U+6ded,U+6def-6df0,U+6df2,U+6df4-6df6,U+6df8,U+6dfa,U+6dfd-6e04,U+6e06-6e09,U+6e0b,U+6e0f,U+6e12-6e13,U+6e15,U+6e18-6e19,U+6e1b-6e1c,U+6e1e-6e1f,U+6e22,U+6e26-6e28,U+6e2a,U+6e2c,U+6e2e,U+6e30-6e31,U+6e33,U+6e35-6e37,U+6e39,U+6e3b-6e42,U+6e45-6e4c,U+6e4f-6e52,U+6e55,U+6e57,U+6e59-6e5a,U+6e5c-6e5e,U+6e60-6e6a,U+6e6c-6e6d,U+6e6f-6e7d,U+6e80-6e82,U+6e84,U+6e87-6e88,U+6e8a-6e8e,U+6e91-6e97,U+6e99-6e9b,U+6e9d-6e9e,U+6ea0-6ea1,U+6ea3-6ea4,U+6ea6,U+6ea8-6ea9,U+6eab-6eae,U+6eb0,U+6eb3,U+6eb5,U+6eb8-6eb9,U+6ebc,U+6ebe-6ec0,U+6ec3-6ec4`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-6f3256af8454371776bc46670d33cc65.woff2`,descriptors:{unicodeRange:`U+6bbb-6bbe,U+6bc0,U+6bc3-6bc4,U+6bc6-6bca,U+6bcc,U+6bce,U+6bd0-6bd1,U+6bd8,U+6bda,U+6bdc-6be0,U+6be2-6be9,U+6bec-6bee,U+6bf0-6bf2,U+6bf4,U+6bf6-6bf8,U+6bfa-6bfc,U+6bfe-6c04,U+6c08-6c0c,U+6c0e,U+6c12,U+6c17,U+6c1c-6c1e,U+6c20,U+6c23,U+6c25,U+6c2b-6c2d,U+6c31,U+6c33,U+6c36-6c37,U+6c39-6c3c,U+6c3e-6c3f,U+6c43-6c45,U+6c48,U+6c4b-6c4f,U+6c51-6c53,U+6c56,U+6c58-6c5a,U+6c62-6c63,U+6c65-6c67,U+6c6b-6c6f,U+6c71,U+6c73,U+6c75,U+6c77-6c78,U+6c7a-6c7c,U+6c7f-6c80,U+6c84,U+6c87,U+6c8a-6c8b,U+6c8d-6c8e,U+6c91-6c92,U+6c95-6c98,U+6c9a,U+6c9c-6c9e,U+6ca0,U+6ca2,U+6ca8,U+6cac,U+6caf-6cb0,U+6cb4-6cb7,U+6cba,U+6cc0-6cc3,U+6cc6-6cc8,U+6ccb,U+6ccd-6ccf,U+6cd1-6cd2,U+6cd8-6cda,U+6cdc-6cdd,U+6cdf,U+6ce4,U+6ce6-6ce7,U+6ce9,U+6cec-6ced,U+6cf2,U+6cf4,U+6cf9,U+6cff-6d00,U+6d02-6d03,U+6d05-6d06,U+6d08-6d0a,U+6d0d,U+6d0f-6d11,U+6d13-6d16,U+6d18,U+6d1c-6d1d,U+6d1f-6d24,U+6d26,U+6d28-6d29,U+6d2c-6d2d,U+6d2f-6d30,U+6d34,U+6d36-6d38,U+6d3a,U+6d3f-6d40,U+6d42,U+6d44,U+6d49,U+6d4c,U+6d50,U+6d55-6d58,U+6d5b,U+6d5d,U+6d5f,U+6d61-6d62,U+6d64-6d65,U+6d67-6d68,U+6d6b-6d6d,U+6d70-6d72`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-23f228f3999c01983860012330e4be08.woff2`,descriptors:{unicodeRange:`U+6967-696a,U+696c-696d,U+696f-6970,U+6972-6976,U+697a-697b,U+697d-697f,U+6981,U+6983,U+6985,U+698a-698c,U+698e-6993,U+6996-6997,U+6999-699a,U+699d-69a6,U+69a9-69aa,U+69ac,U+69ae-69b0,U+69b2-69b3,U+69b5-69b6,U+69b8-69ba,U+69bc-69c0,U+69c2-69c9,U+69cb,U+69cd,U+69cf,U+69d1-69d3,U+69d5-69da,U+69dc-69de,U+69e1-69ec,U+69ee-69f1,U+69f3-69fc,U+69fe,U+6a00-6a09,U+6a0b-6a16,U+6a19-6a1e,U+6a20,U+6a22-6a27,U+6a29,U+6a2b-6a2e,U+6a30,U+6a32-6a34,U+6a36-6a3c,U+6a3f-6a43,U+6a45-6a46,U+6a48-6a4a`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-21430ee05a1248901da8d0de08744d47.woff2`,descriptors:{unicodeRange:`U+6830-6831,U+6834-6836,U+683a-683b,U+683f,U+6847,U+684b,U+684d,U+684f,U+6852,U+6856-685f,U+686a,U+686c-6873,U+6875,U+6878-6880,U+6882,U+6884,U+6887-688e,U+6890-6892,U+6894-6896,U+6898-68a1,U+68a3-68a5,U+68a9-68ac,U+68ae,U+68b1-68b2,U+68b4,U+68b6-68bf,U+68c1,U+68c3-68c8,U+68ca,U+68cc,U+68ce-68d1,U+68d3-68d4,U+68d6-68d7,U+68d9,U+68db-68df,U+68e1-68e2,U+68e4-68ed,U+68ef,U+68f2-68f4,U+68f6-68f8,U+68fb,U+68fd-6900,U+6902-6904,U+6906-690a,U+690c,U+690f,U+6911,U+6913-691e,U+6921-6923,U+6925-692c,U+692e-692f,U+6931-6933,U+6935-6938,U+693a-693c,U+693e,U+6940-6941,U+6943-6953,U+6955-6956,U+6958-6959,U+695b-695c,U+695f,U+6961-6962,U+6964-6965`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-5330a2119a716e4e7224ed108b085dac.woff2`,descriptors:{unicodeRange:`U+66b8,U+66ba-66bd,U+66bf-66d8,U+66da,U+66de-66e5,U+66e7-66e8,U+66ea-66ef,U+66f1,U+66f5-66f6,U+66f8,U+66fa-66fb,U+66fd,U+6701-6707,U+670c,U+670e-670f,U+6711-6713,U+6716,U+6718-671a,U+671c,U+671e,U+6720-6725,U+6727,U+6729,U+672e,U+6730,U+6732-6733,U+6736-6739,U+673b-673c,U+673e-673f,U+6741,U+6744-6745,U+6747,U+674a-674b,U+674d,U+6752,U+6754-6755,U+6757-675b,U+675d,U+6762-6764,U+6766-6767,U+676b-676c,U+676e,U+6771,U+6774,U+6776,U+6778-677b,U+677d,U+6780,U+6782-6783,U+6785-6786,U+6788,U+678a,U+678c-678f,U+6791-6794,U+6796,U+6799,U+679b,U+679f-67a1,U+67a4,U+67a6,U+67a9,U+67ac,U+67ae,U+67b1-67b2,U+67b4,U+67b9-67c0,U+67c2,U+67c5-67ce,U+67d5-67d7,U+67db,U+67df,U+67e1,U+67e3-67e4,U+67e6-67e8,U+67ea-67eb,U+67ed-67ee,U+67f2,U+67f5-67fc,U+67fe,U+6801-6804,U+6806,U+680d,U+6810,U+6812,U+6814-6815,U+6818-681c,U+681e-6820,U+6822-6828,U+682b-682f`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-cd145ce4a0ea18469358df53c207bc1b.woff2`,descriptors:{unicodeRange:`U+6569-656a,U+656d-656f,U+6571,U+6573,U+6575-6576,U+6578-6586,U+6588-658a,U+658d-658f,U+6592,U+6594-6596,U+6598,U+659a,U+659d-659e,U+65a0,U+65a2-65a3,U+65a6,U+65a8,U+65aa,U+65ac,U+65ae,U+65b1-65b8,U+65ba-65bb,U+65be-65c0,U+65c2,U+65c7-65ca,U+65cd,U+65d0-65d1,U+65d3-65d5,U+65d8-65df,U+65e1,U+65e3-65e4,U+65ea-65eb,U+65f2-65f5,U+65f8-65f9,U+65fb-65ff,U+6601,U+6604-6605,U+6607-6609,U+660b,U+660d,U+6610-6612,U+6616-6618,U+661a-661c,U+661e,U+6621-6624,U+6626,U+6629-662c,U+662e,U+6630,U+6632-6633,U+6637-663b,U+663d,U+663f-6640,U+6642,U+6644-664a,U+664d-664e,U+6650-6651,U+6658-6659,U+665b-665e,U+6660,U+6662-6663,U+6665,U+6667,U+6669-666d,U+6671-6673,U+6675,U+6678-6679,U+667b-667d,U+667f-6681,U+6683,U+6685-6686,U+6688-668b,U+668d-6690,U+6692-6695,U+6698-669c,U+669e-66a6,U+66a9-66ad,U+66af-66b3,U+66b5-66b7`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-36925dfe329a45086cbb7fc5c20d45ac.woff2`,descriptors:{unicodeRange:`U+5f30,U+5f32-5f38,U+5f3b,U+5f3d-5f3f,U+5f41-5f4f,U+5f51,U+5f54,U+5f59-5f5c,U+5f5e-5f60,U+5f63,U+5f65,U+5f67-5f68,U+5f6b,U+5f6e-5f6f,U+5f72,U+5f74-5f76,U+5f78,U+5f7a,U+5f7d-5f7f,U+5f83,U+5f86,U+5f8d-5f8f,U+5f91,U+5f93-5f94,U+5f96,U+5f9a-5f9b,U+5f9d-5fa0,U+5fa2-5fa7,U+5fa9,U+5fab-5fac,U+5faf-5fb4,U+5fb6,U+5fb8-5fbb,U+5fbe-5fc2,U+5fc7-5fc8,U+5fca-5fcb,U+5fce,U+5fd3-5fd5,U+5fda-5fdc,U+5fde-5fdf,U+5fe2-5fe3,U+5fe5-5fe6,U+5fe8-5fe9,U+5fec,U+5fef-5ff0,U+5ff2-5ff4,U+5ff6-5ff7,U+5ff9-5ffa,U+5ffc,U+6007-6009,U+600b-600c,U+6010-6011,U+6013,U+6017-6018,U+601a,U+601e-601f,U+6022-6024,U+602c-602e,U+6030-6034,U+6036-603a,U+603d-603e,U+6040,U+6044-604a,U+604c,U+604e-604f,U+6051,U+6053-6054,U+6056-6058,U+605b-605c,U+605e-6061,U+6065-6066,U+606e,U+6071-6072,U+6074-6075,U+6077,U+607e,U+6080-6082,U+6085-6088,U+608a-608b,U+608e-6091,U+6093,U+6095,U+6097-6099,U+609c,U+609e,U+60a1-60a2,U+60a4-60a5,U+60a7,U+60a9-60aa,U+60ae,U+60b0,U+60b3,U+60b5-60b7,U+60b9-60ba,U+60bd-60c4,U+60c7-60c9,U+60cc`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-4bfaa8ffa64c5ee560aa2daba7c9cbd3.woff2`,descriptors:{unicodeRange:`U+635a-635d,U+6360,U+6364-6366,U+6368,U+636a-636c,U+636f-6370,U+6372-6375,U+6378-6379,U+637c-637f,U+6381,U+6383-6386,U+638b,U+638d,U+6391,U+6393-6395,U+6397,U+6399-639f,U+63a1,U+63a4,U+63a6,U+63ab,U+63af,U+63b1-63b2,U+63b5-63b6,U+63b9,U+63bb,U+63bd,U+63bf-63c3,U+63c5,U+63c7-63c8,U+63ca-63cc,U+63d1,U+63d3-63d5,U+63d7-63dd,U+63df,U+63e2,U+63e4-63e8,U+63eb-63ec,U+63ee-63f1,U+63f3,U+63f5,U+63f7,U+63f9-63fc,U+63fe,U+6403-6404,U+6406-640a,U+640d-640e,U+6411-6412,U+6415-641a,U+641d,U+641f,U+6422-6425,U+6427-6429,U+642b,U+642e-6433,U+6435-6439,U+643b-643c,U+643e,U+6440,U+6442-6443,U+6449,U+644b-6451,U+6453,U+6455-6457,U+6459-645d,U+645f-6466,U+6468,U+646a-646c,U+646e-6477,U+647b-6481,U+6483,U+6486,U+6488-648f`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-112c051027b2d766c19a519f6ee1f4f7.woff2`,descriptors:{unicodeRange:`U+61c5-61c7,U+61c9,U+61cc-61d0,U+61d3,U+61d5-61e5,U+61e7-61f4,U+61f6-61fe,U+6200-6205,U+6207,U+6209,U+6213-6214,U+6219,U+621c-621e,U+6220,U+6223,U+6226-6229,U+622b,U+622d,U+622f-6232,U+6235-6236,U+6238-623c,U+6242,U+6244-6246,U+624a,U+624f-6250,U+6255-6257,U+6259-625a,U+625c-6262,U+6264-6265,U+6268,U+6271-6272,U+6274-6275,U+6277-6278,U+627a-627b,U+627d,U+6281-6283,U+6285-6288,U+628b-6290,U+6294,U+6299,U+629c-629e,U+62a3,U+62a6-62a7,U+62a9-62aa,U+62ad-62b0,U+62b2-62b4,U+62b6-62b8,U+62ba,U+62be,U+62c0-62c1,U+62c3,U+62cb,U+62cf,U+62d1,U+62d5,U+62dd-62de,U+62e0-62e1,U+62e4,U+62ea-62eb,U+62f0,U+62f2,U+62f5,U+62f8-62fb,U+6300,U+6303-6306,U+630a-630d,U+630f-6310,U+6312-6315,U+6317-6319,U+631c,U+6326-6327,U+6329,U+632c-632e,U+6330-6331,U+6333-6338,U+633b-633c,U+633e-6341,U+6344,U+6347-6348,U+634a,U+6351-6354,U+6356-6359`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-5b0ed6971aaab9c8ad563230bd5471a7.woff2`,descriptors:{unicodeRange:`U+5dd0-5dda,U+5ddc,U+5ddf-5de0,U+5de3-5de4,U+5dea,U+5dec-5ded,U+5df0,U+5df5-5df6,U+5df8-5dfc,U+5dff-5e00,U+5e04,U+5e07,U+5e09-5e0b,U+5e0d-5e0e,U+5e12-5e13,U+5e17,U+5e1e-5e25,U+5e28-5e2c,U+5e2f-5e30,U+5e32-5e36,U+5e39-5e3a,U+5e3e-5e41,U+5e43,U+5e46-5e4b,U+5e4d-5e53,U+5e56-5e5a,U+5e5c-5e5d,U+5e5f-5e60,U+5e63-5e71,U+5e75,U+5e77,U+5e79,U+5e7e,U+5e81-5e83,U+5e85,U+5e88-5e89,U+5e8c-5e8e,U+5e92,U+5e98,U+5e9b,U+5e9d,U+5ea1-5ea4,U+5ea8-5eac,U+5eae-5eb2,U+5eb4,U+5eba-5ebd,U+5ebf-5ec8,U+5ecb-5ed0,U+5ed4-5ed5,U+5ed7-5eda,U+5edc-5ee7,U+5ee9,U+5eeb-5ef3,U+5ef5,U+5ef8-5ef9,U+5efb-5efd,U+5f05-5f07,U+5f09,U+5f0c-5f0e,U+5f10,U+5f12,U+5f14,U+5f16,U+5f19-5f1a,U+5f1c-5f1e,U+5f21-5f24,U+5f28,U+5f2b-5f2c,U+5f2e`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-98f2ad84457de7f3740d9920b8fa8667.woff2`,descriptors:{unicodeRange:`U+60cd-60d0,U+60d2-60d4,U+60d6-60d7,U+60d9,U+60db,U+60de,U+60e1-60e5,U+60ea,U+60f1-60f2,U+60f5,U+60f7-60f8,U+60fb-60ff,U+6102-6105,U+6107,U+610a-610c,U+6110-6114,U+6116-6119,U+611b-611e,U+6121-6122,U+6125,U+6128-612a,U+612c-613e,U+6140-6147,U+6149,U+614b,U+614d,U+614f-6150,U+6152-6154,U+6156-615c,U+615e-6161,U+6163-6166,U+6169-616f,U+6171-6174,U+6176,U+6178-618a,U+618c-618d,U+618f-6193,U+6195-619c,U+619e-61a6,U+61aa-61ab,U+61ad-61b6,U+61b8-61bd,U+61bf-61c1,U+61c3-61c4`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-733171b4ffcd17ea1fe1c0ba627173bf.woff2`,descriptors:{unicodeRange:`U+5cf4-5cfa,U+5cfc-5d01,U+5d04-5d05,U+5d08-5d0d,U+5d0f-5d13,U+5d15,U+5d17-5d1a,U+5d1c-5d1d,U+5d1f-5d23,U+5d25,U+5d28,U+5d2a-5d2c,U+5d2f-5d33,U+5d35-5d3c,U+5d3f-5d46,U+5d48-5d49,U+5d4d-5d57,U+5d59-5d5a,U+5d5c,U+5d5e-5d68,U+5d6a,U+5d6d-5d6e,U+5d70-5d73,U+5d75-5d81,U+5d83-5d98,U+5d9a-5d9c,U+5d9e-5db6,U+5db8-5dc4,U+5dc6-5dcc,U+5dce-5dcf`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-684d65f1793cac449dde5d59cb3c47fb.woff2`,descriptors:{unicodeRange:`U+5b52,U+5b56,U+5b5e,U+5b60-5b61,U+5b67-5b68,U+5b6b,U+5b6d-5b6f,U+5b72,U+5b74,U+5b76-5b79,U+5b7b-5b7c,U+5b7e-5b7f,U+5b82,U+5b86,U+5b8a,U+5b8d-5b8e,U+5b90-5b92,U+5b94,U+5b96,U+5b9f,U+5ba7-5ba9,U+5bac-5baf,U+5bb1-5bb2,U+5bb7,U+5bba-5bbc,U+5bc0-5bc1,U+5bc3,U+5bc8-5bcb,U+5bcd-5bcf,U+5bd1,U+5bd4-5bdc,U+5be0,U+5be2-5be3,U+5be6-5be7,U+5be9-5bed,U+5bef,U+5bf1-5bf7,U+5bfd-5bfe,U+5c00,U+5c02-5c03,U+5c05,U+5c07-5c08,U+5c0b-5c0e,U+5c10,U+5c12-5c13,U+5c17,U+5c19,U+5c1b,U+5c1e-5c21,U+5c23,U+5c26,U+5c28-5c2b,U+5c2d-5c30,U+5c32-5c33,U+5c35-5c37,U+5c43-5c44,U+5c46-5c47,U+5c4c-5c4d,U+5c52-5c54,U+5c56-5c58,U+5c5a-5c5d,U+5c5f,U+5c62,U+5c64,U+5c67-5c6d,U+5c70,U+5c72-5c78,U+5c7b-5c7e,U+5c80,U+5c83-5c87,U+5c89-5c8b,U+5c8e-5c8f,U+5c92-5c93,U+5c95,U+5c9d-5ca1,U+5ca4-5ca8,U+5caa,U+5cae-5cb0,U+5cb2,U+5cb4,U+5cb6,U+5cb9-5cbc,U+5cbe,U+5cc0,U+5cc2-5cc3,U+5cc5-5cca,U+5ccc-5cd1,U+5cd3-5cd8,U+5cda-5ce0,U+5ce2-5ce3,U+5ce7,U+5ce9,U+5ceb-5cec,U+5cee-5cef,U+5cf1-5cf3`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-cbaaefaaf326668277aa24dfa93c4d28.woff2`,descriptors:{unicodeRange:`U+593b,U+593d-5940,U+5943,U+5945-5946,U+594a,U+594c-594d,U+5950,U+5952-5953,U+5959,U+595b-595f,U+5961,U+5963-5964,U+5966-5972,U+5975,U+5977,U+597a-597c,U+597e-5980,U+5985,U+5989,U+598b-598c,U+598e-5991,U+5994-5995,U+5998,U+599a-599d,U+599f-59a2,U+59a6-59a7,U+59ac-59ad,U+59b0-59b1,U+59b3-59b8,U+59ba,U+59bc-59bd,U+59bf-59c5,U+59c7-59c9,U+59cc-59cf,U+59d5-59d6,U+59d9,U+59db,U+59de-59e2,U+59e4,U+59e6-59e7,U+59e9-59eb,U+59ed-59f8,U+59fa,U+59fc-59fe,U+5a00,U+5a02,U+5a0a-5a0b,U+5a0d-5a10,U+5a12,U+5a14-5a17,U+5a19-5a1b,U+5a1d-5a1e,U+5a21-5a22,U+5a24,U+5a26-5a28,U+5a2a-5a30,U+5a33,U+5a35,U+5a37-5a3b,U+5a3d-5a3f,U+5a41-5a45,U+5a47-5a48,U+5a4b-5a54,U+5a56-5a59,U+5a5b-5a61,U+5a63-5a66,U+5a68-5a69,U+5a6b-5a73,U+5a78-5a79,U+5a7b-5a7e,U+5a80-5a90`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-58fd02350d0bc52cf1ca3bb32ce9766e.woff2`,descriptors:{unicodeRange:`U+5a91,U+5a93-5a99,U+5a9c-5aa9,U+5aab-5ab1,U+5ab4,U+5ab6-5ab7,U+5ab9-5abd,U+5abf-5ac0,U+5ac3-5ac8,U+5aca-5acb,U+5acd-5ad1,U+5ad3,U+5ad5,U+5ad7,U+5ad9-5adb,U+5add-5adf,U+5ae2,U+5ae4-5ae5,U+5ae7-5ae8,U+5aea,U+5aec-5af0,U+5af2-5b08,U+5b0a-5b15,U+5b18-5b31,U+5b33,U+5b35-5b36,U+5b38-5b3f,U+5b41-5b4f`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-7ccce86603f80a099ddb0cb21d4ae3e3.woff2`,descriptors:{unicodeRange:`U+5843,U+5845-584b,U+584e-5850,U+5852-5853,U+5855-5857,U+5859-585d,U+585f-5864,U+5866-586a,U+586d-587d,U+587f,U+5882,U+5884,U+5886-5888,U+588a-5891,U+5894-5898,U+589b-589d,U+58a0-58a7,U+58aa-58bb,U+58bd-58c0,U+58c2-58c4,U+58c6-58d0,U+58d2-58d4,U+58d6-58e3,U+58e5-58ea,U+58ed,U+58ef,U+58f1-58f2,U+58f4-58f5,U+58f7-58f8,U+58fa-5901,U+5903,U+5905-5906,U+5908-590c,U+590e,U+5910-5913,U+5917-5918,U+591b,U+591d-591e,U+5920-5923,U+5926,U+5928,U+592c,U+5930,U+5932-5933,U+5935-5936`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-3717077e38f98d89eae729b6c14e56dc.woff2`,descriptors:{unicodeRange:`U+56d0-56d3,U+56d5-56d6,U+56d8-56d9,U+56dc,U+56e3,U+56e5-56ea,U+56ec,U+56ee-56ef,U+56f2-56f3,U+56f6-56f8,U+56fb-56fc,U+5700-5702,U+5705,U+5707,U+570b-571b,U+571d-571e,U+5720-5722,U+5724-5727,U+572b,U+5731-5732,U+5734-5738,U+573c-573d,U+573f,U+5741,U+5743-5746,U+5748-5749,U+574b,U+5752-5756,U+5758-5759,U+5762-5763,U+5765,U+5767,U+576c,U+576e,U+5770-5772,U+5774-5775,U+5778-577a,U+577d-5781,U+5787-578a,U+578d-5791,U+5794-579a,U+579c-579f,U+57a5,U+57a8,U+57aa,U+57ac,U+57af-57b1,U+57b3,U+57b5-57b7,U+57b9-57c1,U+57c4-57ca,U+57cc-57cd,U+57d0-57d1,U+57d3,U+57d6-57d7,U+57db-57dc,U+57de,U+57e1-57e3,U+57e5-57ec,U+57ee,U+57f0-57f3,U+57f5-57f7,U+57fb-57fc,U+57fe-57ff,U+5801,U+5803-5805,U+5808-580a,U+580c,U+580e-5810,U+5812-5814,U+5816-5818,U+581a-581d,U+581f,U+5822-5823,U+5825-5829,U+582b-582f,U+5831-5834,U+5836-5842`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-dbea1af6dcd9860be40c3d18254338f5.woff2`,descriptors:{unicodeRange:`U+55f9-55fc,U+55ff,U+5602-5607,U+560a-560b,U+560d,U+5610-5617,U+5619-561a,U+561c-561d,U+5620-5622,U+5625-5626,U+5628-562b,U+562e-5630,U+5633,U+5635,U+5637-5638,U+563a,U+563c-563e,U+5640-564b,U+564f-5653,U+5655-5656,U+565a-565b,U+565d-5661,U+5663,U+5665-5667,U+566d-5670,U+5672-5675,U+5677-567a,U+567d-5684,U+5687-568d,U+5690-5692,U+5694-56a2,U+56a4-56ae,U+56b0-56b6,U+56b8-56bb,U+56bd-56c9,U+56cb-56cf`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-4a0fdb40036e87b40aa08dd30584cb85.woff2`,descriptors:{unicodeRange:`U+5286-5287,U+5289-528f,U+5291-5292,U+5294-529a,U+529c,U+52a4-52a7,U+52ae-52b0,U+52b4-52bd,U+52c0-52c2,U+52c4-52c6,U+52c8,U+52ca,U+52cc-52cf,U+52d1,U+52d3-52d5,U+52d7,U+52d9-52de,U+52e0-52e3,U+52e5-52ef,U+52f1-52f8,U+52fb-52fd,U+5301-5304,U+5307,U+5309-530c,U+530e,U+5311-5314,U+5318,U+531b-531c,U+531e-531f,U+5322,U+5324-5325,U+5327-5329,U+532b-532d,U+532f-5338,U+533c-533d,U+5340,U+5342,U+5344,U+5346,U+534b-534d,U+5350,U+5354,U+5358-5359,U+535b,U+535d,U+5365,U+5368,U+536a,U+536c-536d,U+5372,U+5376,U+5379,U+537b-537e,U+5380-5381,U+5383,U+5387-5388,U+538a,U+538e-5394,U+5396-5397,U+5399,U+539b-539c,U+539e,U+53a0-53a1,U+53a4,U+53a7,U+53aa-53ad,U+53af-53b5,U+53b7-53ba,U+53bc-53be,U+53c0,U+53c3-53c7,U+53ce-53d0,U+53d2-53d3,U+53d5,U+53da,U+53dc-53de,U+53e1-53e2,U+53e7,U+53f4,U+53fa,U+53fe-5400,U+5402,U+5405,U+5407,U+540b,U+5414,U+5418-541a,U+541c,U+5422,U+5424-5425,U+542a,U+5430,U+5433,U+5436-5437,U+543a`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-0f626226ba1272e832aea87bafd9720e.woff2`,descriptors:{unicodeRange:`U+5101-5105,U+5108-510a,U+510c-5111,U+5113-5120,U+5122-513e,U+5142,U+5147,U+514a,U+514c,U+514e-5150,U+5152-5153,U+5157-5159,U+515b,U+515d-5161,U+5163-5164,U+5166-5167,U+5169-516a,U+516f,U+5172,U+517a,U+517e-517f,U+5183-5184,U+5186-5187,U+518a-518b,U+518e-5191,U+5193-5194,U+5198,U+519a,U+519d-519f,U+51a1,U+51a3,U+51a6-51aa,U+51ad-51ae,U+51b4,U+51b8-51ba,U+51be-51bf,U+51c1-51c3,U+51c5,U+51c8,U+51ca,U+51cd-51ce,U+51d0,U+51d2-51da,U+51dc,U+51de-51df,U+51e2-51e3,U+51e5-51ea,U+51ec,U+51ee,U+51f1-51f2,U+51f4,U+51f7,U+51fe,U+5204-5205,U+5209,U+520b-520c,U+520f-5210,U+5213-5215,U+521c,U+521e-521f,U+5221-5223,U+5225-5227,U+522a,U+522c,U+522f,U+5231-5232,U+5234-5235,U+523c,U+523e,U+5244-5249,U+524b,U+524e-524f,U+5252-5253,U+5255,U+5257-525b,U+525d,U+525f-5260,U+5262-5264,U+5266,U+5268,U+526b-526e,U+5270-5271,U+5273-527c,U+527e,U+5280,U+5283-5285`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-938d90c10ff8c20386af7f242c05d6b0.woff2`,descriptors:{unicodeRange:`U+543d,U+543f,U+5441-5442,U+5444-5445,U+5447,U+5449,U+544c-544f,U+5451,U+545a,U+545d-5461,U+5463,U+5465,U+5467,U+5469-5470,U+5474,U+5479-547a,U+547e-547f,U+5481,U+5483,U+5485,U+5487-548a,U+548d,U+5491,U+5493,U+5497-5498,U+549c,U+549e-54a2,U+54a5,U+54ae,U+54b0,U+54b2,U+54b5-54b7,U+54b9-54ba,U+54bc,U+54be,U+54c3,U+54c5,U+54ca-54cb,U+54d6,U+54d8,U+54db,U+54e0-54e4,U+54eb-54ec,U+54ef-54f1,U+54f4-54f9,U+54fb,U+54fe,U+5500,U+5502-5505,U+5508,U+550a-550e,U+5512-5513,U+5515-551a,U+551c-551f,U+5521,U+5525-5526,U+5528-5529,U+552b,U+552d,U+5532,U+5534-5536,U+5538-553b,U+553d,U+5540,U+5542,U+5545,U+5547-5548,U+554b-554f,U+5551-5554,U+5557-555b,U+555d-5560,U+5562-5563,U+5568-5569,U+556b,U+556f-5574,U+5579-557a,U+557d,U+557f,U+5585-5586,U+558c-558e,U+5590,U+5592-5593,U+5595-5597,U+559a-559b,U+559e,U+55a0-55a6,U+55a8-55b0,U+55b2,U+55b4,U+55b6,U+55b8,U+55ba,U+55bc,U+55bf-55c3,U+55c6-55c8,U+55ca-55cb,U+55ce-55d0,U+55d5,U+55d7-55db,U+55de,U+55e0,U+55e2,U+55e7,U+55e9,U+55ed-55ee,U+55f0-55f1,U+55f4,U+55f6,U+55f8`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-b6d128682ee29e471486354d486a1b90.woff2`,descriptors:{unicodeRange:`U+4fe0,U+4fe2,U+4fe4-4fe5,U+4fe7,U+4feb-4fec,U+4ff0,U+4ff2,U+4ff4-4ff7,U+4ff9,U+4ffb-4ffd,U+4fff-500b,U+500e,U+5010-5011,U+5013,U+5015-5017,U+501b,U+501d-501e,U+5020,U+5022-5024,U+5027,U+502b,U+502f-5039,U+503b,U+503d,U+503f-5042,U+5044-5046,U+5049-504b,U+504d,U+5050-5054,U+5056-5059,U+505b,U+505d-5064,U+5066-506b,U+506d-5075,U+5078-507a,U+507c-507d,U+5081-5084,U+5086-5087,U+5089-508c,U+508e-50a2,U+50a4,U+50a6,U+50aa-50ab,U+50ad-50b1,U+50b3-50b9,U+50bc-50ce,U+50d0-50d5,U+50d7-50d9,U+50db-50e5,U+50e8-50eb,U+50ef-50f2,U+50f4,U+50f6-50fa,U+50fc-5100`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-e51ef413167c6e14e0c0fdcc585f2fc9.woff2`,descriptors:{unicodeRange:`U+49d5-4a77`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-9d81066dd2b337c938df6e90380a00dc.woff2`,descriptors:{unicodeRange:`U+4dac-4dad,U+4daf-4db5,U+4e02,U+4e04-4e06,U+4e0f,U+4e12,U+4e17,U+4e1f-4e21,U+4e23,U+4e26,U+4e29,U+4e2e-4e2f,U+4e31,U+4e33,U+4e35,U+4e37,U+4e3c,U+4e40-4e42,U+4e44,U+4e46,U+4e4a,U+4e51,U+4e55,U+4e57,U+4e5a-4e5b,U+4e62-4e65,U+4e67-4e68,U+4e6a-4e6f,U+4e72,U+4e74-4e7d,U+4e7f-4e85,U+4e87,U+4e8a,U+4e90,U+4e96-4e97,U+4e99,U+4e9c-4e9e,U+4ea3,U+4eaa,U+4eaf-4eb1,U+4eb4,U+4eb6-4eb9,U+4ebc-4ebe,U+4ec8,U+4ecc,U+4ecf-4ed0,U+4ed2,U+4eda-4edc,U+4ee0,U+4ee2,U+4ee6-4ee7,U+4ee9,U+4eed-4eef,U+4ef1,U+4ef4,U+4ef8-4efa,U+4efc,U+4efe,U+4f00,U+4f02-4f08,U+4f0b-4f0c,U+4f12-4f16,U+4f1c-4f1d,U+4f21,U+4f23,U+4f28-4f29,U+4f2c-4f2e,U+4f31,U+4f33,U+4f35,U+4f37,U+4f39,U+4f3b,U+4f3e-4f42,U+4f44-4f45,U+4f47-4f4c,U+4f52,U+4f54,U+4f56,U+4f61-4f62,U+4f66,U+4f68,U+4f6a-4f6b,U+4f6d-4f6e,U+4f71-4f72,U+4f75,U+4f77-4f7a,U+4f7d,U+4f80-4f82,U+4f85-4f87,U+4f8a,U+4f8c,U+4f8e,U+4f90,U+4f92-4f93,U+4f95-4f96,U+4f98-4f9a,U+4f9c,U+4f9e-4f9f,U+4fa1-4fa2,U+4fa4,U+4fab,U+4fad,U+4fb0-4fb4,U+4fb6-4fbe,U+4fc0-4fc2,U+4fc6-4fc9,U+4fcb-4fcd,U+4fd2-4fd6,U+4fd9,U+4fdb`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-20e7bf72fa05de9adf7dbcc7bf51dde6.woff2`,descriptors:{unicodeRange:`U+4933-49d4`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-4095eb84ef3874e2600247bee0b04026.woff2`,descriptors:{unicodeRange:`U+487a-4932`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-4ee10ae43505e2e0bc62656ced49c0fa.woff2`,descriptors:{unicodeRange:`U+47d2-4879,U+2ce7c,U+2ce88,U+2ce93`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-7494dc504ae00ee9cd0505f990f88c5d.woff2`,descriptors:{unicodeRange:`U+4756-47d1,U+2ca02,U+2ca0e,U+2ca7d,U+2caa9,U+2cb29,U+2cb2e,U+2cb31,U+2cb38-2cb39,U+2cb3f,U+2cb41,U+2cb4e,U+2cb5a,U+2cb64,U+2cb69,U+2cb6c,U+2cb6f,U+2cb76,U+2cb78,U+2cb7c,U+2cbb1,U+2cbbf-2cbc0,U+2cbce,U+2cc5f,U+2ccf5-2ccf6,U+2ccfd,U+2ccff,U+2cd02-2cd03,U+2cd0a,U+2cd8b,U+2cd8d,U+2cd8f-2cd90,U+2cd9f-2cda0,U+2cda8,U+2cdad-2cdae,U+2cdd5,U+2ce18,U+2ce1a,U+2ce23,U+2ce26,U+2ce2a`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-8de5b863cb50dfefdd07cb11c774d579.woff2`,descriptors:{unicodeRange:`U+46c3-4755,U+2c488,U+2c494,U+2c497,U+2c542,U+2c613,U+2c618,U+2c621,U+2c629,U+2c62b-2c62d,U+2c62f,U+2c642,U+2c64a-2c64b,U+2c72c,U+2c72f,U+2c79f,U+2c7c1,U+2c7fd,U+2c8d9,U+2c8de,U+2c8e1,U+2c8f3,U+2c907,U+2c90a,U+2c91d`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-3e1f8f654357353bf0e04ba5c34b5f7f.woff2`,descriptors:{unicodeRange:`U+4629-46c2,U+2bdf7,U+2be29,U+2c029-2c02a,U+2c0a9,U+2c0ca,U+2c1d5,U+2c1d9,U+2c1f9,U+2c27c,U+2c288,U+2c2a4,U+2c317,U+2c35b,U+2c361,U+2c364`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-2e33e8dc771ef5e1d9127d60a6b73679.woff2`,descriptors:{unicodeRange:`U+458e-4628,U+2b7a9,U+2b7c5,U+2b7e6,U+2b7f9,U+2b806,U+2b80a,U+2b81c,U+2b8b8,U+2bac7,U+2bb5f,U+2bb62,U+2bb7c,U+2bb83,U+2bc1b,U+2bd77,U+2bd87`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-173945821411c09f70c95f98d590e697.woff2`,descriptors:{unicodeRange:`U+4449-4511,U+2afa2,U+2b127-2b128,U+2b137-2b138,U+2b1ed`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-b358f7a51ece39a3247942b1feabdb29.woff2`,descriptors:{unicodeRange:`U+439b-4448,U+2a437,U+2a5f1,U+2a602,U+2a61a,U+2a6b2,U+2a7dd,U+2a8fb,U+2a917,U+2aa30,U+2aa36,U+2aa58`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-23ad2d71b280f00b1363b95b7bea94eb.woff2`,descriptors:{unicodeRange:`U+4275-430d,U+298c6,U+29a72,U+29d98,U+29ddb,U+29e15,U+29e3d,U+29e49`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-5882ffa04f32584d26109137e2da4352.woff2`,descriptors:{unicodeRange:`U+4132-41de,U+28bef,U+28c47,U+28c4f,U+28c51,U+28c54,U+28d10,U+28d71,U+28dfb,U+28e1f,U+28e36,U+28e89,U+28e99,U+28eeb,U+28f32,U+28ff8,U+292a0`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-a203b91dad570bf05a58c3c3ddb529bf.woff2`,descriptors:{unicodeRange:`U+41df-4274,U+292b1,U+29490,U+295cf,U+2967f,U+296f0,U+29719,U+29750`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-bd77e3c7f9e0b072d96af37f73d1aa32.woff2`,descriptors:{unicodeRange:`U+408e-4131,U+285c8-285c9,U+28678,U+28695,U+286d7,U+286fa,U+287e0,U+28946,U+28949,U+2896b,U+28987-28988,U+289ba-289bb,U+28a1e,U+28a29,U+28a43,U+28a71,U+28a99,U+28acd,U+28add,U+28ae4,U+28b49,U+28bc1`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-5a45d991244d4c7140217e1e5f5ca4f4.woff2`,descriptors:{unicodeRange:`U+3e83-3f2f,U+27139,U+273da-273db,U+273fe,U+27410,U+27449,U+27614-27615,U+27631,U+27684,U+27693,U+2770e,U+27723,U+27752`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-f56414bf9bced67990def8660e306759.woff2`,descriptors:{unicodeRange:`U+3f30-3fdb,U+27985,U+27a84,U+27bb3,U+27bbe,U+27bc7,U+27cb8,U+27da0,U+27e10`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-583d166e56ba0de4b77eabb47ef67839.woff2`,descriptors:{unicodeRange:`U+3fdc-408d,U+27fb7,U+27ff9,U+2808a,U+280bb,U+2815d,U+28277,U+28282,U+282e2,U+282f3,U+283cd,U+28408,U+2840c,U+28455,U+28468,U+2856b`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-7f855356ab893b0d2b9c1c83b8116f0e.woff2`,descriptors:{unicodeRange:`U+3dd2-3e82,U+26a58,U+26a8c,U+26ab7,U+26aff,U+26b5c,U+26c21,U+26c29,U+26c73,U+26cdd,U+26e40,U+26e65,U+26f94,U+26ff6-26ff8,U+270f4,U+2710d`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-b57aaedfd8ebdf3931f25119dc6a5eb2.woff2`,descriptors:{unicodeRange:`U+3d34-3dd1,U+2648d,U+26676,U+2667e,U+266b0,U+2671d,U+2677c,U+267cc,U+268dd,U+268ea,U+26951,U+2696f,U+269dd,U+269fa,U+26a1e`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-b6fd38ca30869792244804b04bc058da.woff2`,descriptors:{unicodeRange:`U+3c76-3d33,U+25d0a,U+25da1,U+25e2e,U+25e56,U+25e62,U+25e65,U+25ec2,U+25ed7-25ed8,U+25ee8,U+25f23,U+25f5c,U+25fd4,U+25fe0,U+25ffb,U+2600c,U+26017,U+26060,U+260ed,U+26221,U+26270,U+26286,U+2634c,U+26402`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-452225341522a7942f0f6aab1a5c91a3.woff2`,descriptors:{unicodeRange:`U+3bda-3c75,U+25771,U+257a9,U+257b4,U+259c4,U+259d4,U+25ae3-25ae4,U+25af1,U+25bb2,U+25c14,U+25c4b,U+25c64`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-866fa7613df6b3fd272bcfd4530c0bb9.woff2`,descriptors:{unicodeRange:`U+3b25-3bd9,U+2504a,U+25055,U+25122,U+2512b,U+251a9,U+251cd,U+251e5,U+2521e,U+2524c,U+2542e,U+2548e,U+254d9,U+2550e,U+25532,U+25562,U+255a7-255a8`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-52a84a22fd1369bffeaf21da2d6158dc.woff2`,descriptors:{unicodeRange:`U+3a6b-3b24,U+24896,U+249db,U+24a4d,U+24a7d,U+24ac9,U+24b56,U+24b6f,U+24c16,U+24d14,U+24dea,U+24e0e,U+24e37,U+24e6a,U+24e8b,U+24eaa`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-829615148e6357d826b9242eb7fbbd1e.woff2`,descriptors:{unicodeRange:`U+39a9-3a6a,U+24096,U+24103,U+241ac,U+241c6,U+241fe,U+243bc,U+243f8,U+244d3,U+24629,U+246a5,U+247f1`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-c99eda15fc26a2941579560f76c3a5cf.woff2`,descriptors:{unicodeRange:`U+38e3-39a8,U+23a98,U+23c7f,U+23c97-23c98,U+23cfe,U+23d00,U+23d0e,U+23d40,U+23dd3,U+23df9-23dfa,U+23e23,U+23f7e`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-395c35dd584b56b0789f58a0559beaf1.woff2`,descriptors:{unicodeRange:`U+3760-382a,U+22ab8,U+22b43,U+22b46,U+22b4f-22b50,U+22ba6,U+22bca,U+22c1d,U+22c24,U+22c55,U+22d4c,U+22de1`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-203b0e569e3b14aac86a003dc3fa523e.woff2`,descriptors:{unicodeRange:`U+382b-38e2,U+231b6,U+231c3-231c4,U+231f5,U+23350,U+23372,U+233d0,U+233d2-233d3,U+233d5,U+233da,U+233df,U+233e4,U+2344a-2344b,U+23451,U+23465,U+234e4,U+2355a,U+23594,U+235c4,U+235cb,U+23638-2363a,U+23647,U+2370c,U+2371c,U+2373f,U+23763-23764,U+237e7,U+237ff,U+23824,U+2383d`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-51a0e808bbc8361236ac521a119758a3.woff2`,descriptors:{unicodeRange:`U+3698-375f,U+22218,U+2231e,U+223ad,U+224dc,U+226f3,U+2285b,U+228ab,U+2298f`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-6e092f71c1e634059ada0e52abadce67.woff2`,descriptors:{unicodeRange:`U+35e6-3697,U+21c56,U+21cde,U+21d2d,U+21d45,U+21d62,U+21d78,U+21d92,U+21d9c,U+21da1,U+21db7,U+21de0,U+21e33-21e34,U+21f1e,U+21f76,U+21ffa,U+2217b`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-0f7fb1e0d5015bb1371343153ecf7ce3.woff2`,descriptors:{unicodeRange:`U+3444-350e,U+20ad3,U+20b1d,U+20b9f,U+20c41,U+20cbf,U+20cd0,U+20d45,U+20de1,U+20e64,U+20e6d,U+20e95,U+20e9d,U+20ea2,U+20f5f,U+210c1,U+21201,U+2123d,U+21255,U+21274,U+2127b`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-d0cf73942fea1c74edbdf0b3011f4656.woff2`,descriptors:{unicodeRange:`U+350f-35e5,U+212d7,U+212e4,U+212fd,U+2131b,U+21336,U+21344,U+2139a,U+213c4,U+21413,U+2146d-2146e,U+215d7,U+21647,U+216b4,U+21706,U+21742,U+218bd,U+219c3`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-968cffdc8ee679da094e77ebf50f58ef.woff2`,descriptors:{unicodeRange:`U+336d-3443,U+2032b,U+20371,U+20381,U+203f9,U+2044a,U+20509,U+20547,U+205d6,U+20628,U+20676,U+2074f,U+20779,U+20807,U+2083a,U+20895,U+208b9,U+2097c,U+2099d`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-7a07ddc0f0c0f5f4a9bad6ee3dda66b5.woff2`,descriptors:{unicodeRange:`U+328b-336c,U+2000b,U+20089,U+200a2,U+200a4,U+20164,U+201a2,U+20213`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-ec181b795ac1fb5a50d700b6e996d745.woff2`,descriptors:{unicodeRange:`U+3192-31ba,U+31c0-31e3,U+31f0-321e,U+3220-328a,U+1f250-1f251`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-cfb211578629b7e8153b37240de6a9d5.woff2`,descriptors:{unicodeRange:`U+2f74-2fd5,U+3000,U+3003-3007,U+3012-3013,U+3018-301c,U+3020-3029,U+302f-303f,U+3041-3096,U+3099-30a1`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-59e9ff77b0efaf684bc09274fb6908c9.woff2`,descriptors:{unicodeRange:`U+30a2-30ff,U+3105-312f,U+3131-318e,U+3190-3191`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-2adbc89c11e65905393d3dfc468b9d5b.woff2`,descriptors:{unicodeRange:`U+4e36,U+4ea0,U+4f74,U+4f91,U+4f94,U+4fc5,U+507e,U+50ed,U+5182,U+51f5,U+525e,U+5282,U+52f9,U+5326,U+537a,U+53a3,U+5423,U+5459,U+54b4,U+54d9,U+55c9,U+57f4,U+580b,U+5902,U+5925,U+5a08,U+5ab5,U+5b84,U+5be4,U+5c22,U+5cb5,U+5cbd,U+5d3e,U+5e31,U+5e5e,U+5e80,U+5ee8,U+5f82,U+5fc9,U+5fed,U+600a,U+605d,U+609b,U+609d,U+60dd,U+6243,U+6322,U+63ce,U+640c,U+643f,U+6445,U+64d7,U+6534,U+6549,U+656b,U+6603,U+674c,U+680a,U+6864,U+69d4,U+6a65,U+6c2a,U+6c46,U+6c5c,U+6d0e,U+6d48,U+6e2b,U+6eb2,U+6eb7,U+6f89,U+706c,U+70b1,U+7113,U+71d4,U+727f,U+72f3,U+7303,U+7321,U+736c,U+736f,U+74a9,U+74de,U+750d,U+7513,U+7592,U+75c4,U+7605,U+760a,U+761b,U+7625,U+762d,U+7643,U+7707,U+7747,U+77b5,U+7839,U+784e,U+78a5,U+7924,U+793b,U+798a,U+7a03,U+7a06,U+7a78,U+7a80,U+7aad,U+7ba8,U+7be5,U+7cc8,U+7ec1,U+7f0b,U+7f0f,U+7f12,U+7f68,U+7f9d,U+8025,U+809c,U+80ad,U+80b7,U+80e8,U+811e,U+8204,U+8223,U+822d,U+823b,U+824b,U+825a,U+827d,U+827f,U+828f,U+82c8,U+8307,U+831b,U+8347,U+837d,U+839b,U+83a9,U+83f9,U+84b9,U+8579,U+864d,U+867f,U+86b0,U+86d1,U+86d8,U+86f2,U+8764,U+8770,U+8788,U+8797,U+87ac-87ad,U+87b5,U+881b,U+8844,U+88bc,U+88fc,U+8930,U+89cf,U+89d6,U+8ba0,U+8bd4,U+8c02,U+8c2b,U+8c85,U+8e23,U+8f81-8f82,U+8fd5,U+90b6,U+90db,U+914e,U+9164,U+91ad,U+943e,U+94b7-94b8,U+94eb,U+950d,U+9514,U+9516,U+9518,U+9529,U+9538,U+953f,U+954e,U+955f,U+95fc,U+9667,U+96b3,U+9792,U+97b2,U+98a1,U+9969,U+9987,U+9998,U+9a80,U+9a92,U+9a96,U+9adf,U+9cb4,U+9cbd,U+9cd0,U+9cd4,U+9e31,U+9e3a,U+9e71,U+9ee5,U+9eea,U+9ef9,U+9fa0`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-70e811fd7994e61f408c923de6ddd078.woff2`,descriptors:{unicodeRange:`U+4e0c,U+4e28,U+4e3f,U+4ec2,U+502e,U+50ba,U+5155,U+5181,U+522d,U+5281,U+5290,U+5369,U+53b6,U+54d5,U+54dc,U+54ff,U+552a,U+553c,U+5588,U+55b5,U+5686,U+570a,U+5776,U+5786,U+57a4,U+5820,U+5865,U+58bc,U+5b32,U+5b65,U+5c1c,U+5c66,U+5c6e,U+5c8d,U+5ddb,U+5f2a,U+5f50,U+5f61,U+6067,U+614a,U+615d,U+619d,U+61d4,U+620b,U+6224-6225,U+6343,U+63ad,U+63f2,U+640b,U+6420,U+6434,U+6496,U+64d0,U+6509,U+652e,U+67a8,U+6833,U+6844,U+684a,U+6920,U+6957,U+6971,U+6a8e,U+6a91,U+6aa0,U+6b43,U+6bea,U+6bf5,U+6c15,U+6cd0,U+6ee0,U+6f24,U+6f2d,U+70c0,U+721d,U+728b,U+72c3,U+72e8,U+730a,U+7338-7339,U+734d,U+746d,U+752f,U+754e,U+770d,U+7735,U+778d,U+77a2,U+77e7,U+7857,U+786d,U+78c9,U+78f2,U+791e,U+7953,U+7b58,U+7b9d,U+7bda,U+7cd7,U+7f32-7f33,U+8022,U+8028-8029,U+8035,U+804d,U+8080,U+80c2,U+80e9,U+80ec,U+80f2,U+810e,U+8221,U+8274,U+82b0,U+82e0,U+83b0,U+8487-8488,U+848e,U+84cd,U+84d0,U+8539,U+857a,U+85a8,U+85b7,U+867c,U+871e,U+8723,U+877e,U+878b,U+8793,U+8803,U+88d2,U+8966,U+89cc,U+89eb,U+8b26,U+8c8a,U+8c98,U+8d33,U+8d47,U+8d55,U+8dbc,U+8e40,U+8e94,U+8f77,U+8f79,U+9058,U+91a2,U+91b5,U+928e,U+9494,U+94b6,U+94de,U+94f4,U+94f9,U+950a,U+950e,U+951e,U+952b,U+953c,U+953e,U+9544,U+9561,U+9564,U+9569,U+95f6,U+9603,U+960d,U+963d,U+9674,U+9794,U+97ab,U+98a5,U+9a9f,U+9ab1,U+9ad1,U+9b0f,U+9b2f,U+9c92,U+9c95,U+9cba,U+9cbc,U+9cc6,U+9ccb,U+9cd8,U+9e32,U+9e38,U+9e5b,U+9e7e,U+9eb4,U+9efb-9efc,U+9f3d`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-c4a687ac4f0c2766eefc9f77ed99cddf.woff2`,descriptors:{unicodeRange:`U+2e3b,U+2e80-2e99,U+2e9b-2ef3,U+2f00-2f73,U+ffffd`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-51502f1206be09c565f1547c406e9558.woff2`,descriptors:{unicodeRange:`U+4e69,U+4f1b,U+4f67,U+4f7e,U+4fdc,U+50e6,U+5196,U+5202,U+5233,U+523f,U+52a2,U+536e,U+5476,U+54ad,U+54cf,U+5537,U+561e,U+56dd,U+56df,U+5709,U+572c,U+57cf,U+57f8,U+580d,U+5881,U+589a,U+5941,U+59b2,U+5c25,U+5d24,U+5d74,U+5e42,U+5e8b,U+5eb3,U+5ed2,U+5fad,U+6003,U+603c,U+6083,U+6100,U+6126,U+6206,U+62ca,U+638e,U+63b4,U+6426,U+646d,U+6535,U+65c4,U+66db,U+6715,U+6769,U+6798,U+67c3,U+6861,U+698d,U+69ca,U+69ed,U+69f2,U+69ff,U+6a18,U+6b39,U+6bb3,U+6c0d,U+6cb2,U+6cd6,U+6cf7,U+6cfa,U+6d33,U+6e16,U+6e53-6e54,U+6ebb,U+6fb6,U+709d,U+72ad,U+72f7,U+72fb,U+7313,U+739f,U+74ba,U+754b,U+755b,U+758b,U+75ac,U+75d6,U+7617,U+7635,U+7640,U+76a4,U+76b2,U+775a,U+77bd,U+781f,U+79b3,U+7b2b,U+7b31,U+7b3e,U+7b6e,U+7b9c,U+7c0b,U+7c9e,U+7cc1,U+7ce8,U+7ea5,U+7f21,U+7f27,U+7f74,U+7fb0,U+8031,U+8071,U+80ea,U+8114,U+8160,U+81a6,U+81c1,U+829f,U+82a4,U+82fb,U+831a,U+8333,U+836c,U+83b6,U+83f8,U+8411,U+841c,U+8489,U+848c,U+85a4,U+8627,U+8629,U+866e,U+86b5,U+872e,U+8731,U+877b,U+877d,U+87ea,U+8813,U+8816,U+8864,U+88ce,U+88e5,U+897b,U+89cb,U+89f3,U+8bfc,U+8c35,U+8d46,U+8d4d,U+8dba,U+8e3a,U+8f75,U+8f7e,U+8fd3,U+9161,U+9179,U+917e,U+91a3,U+94ac,U+94d7,U+94e5,U+952a,U+952c,U+9545,U+9565,U+9568,U+956a,U+961d,U+96e0,U+972a,U+9730,U+989f,U+98e7,U+990d,U+9967,U+9993,U+9aa3,U+9ac0,U+9ae1,U+9aeb,U+9af9,U+9c86,U+9c8b,U+9ca0-9ca1,U+9ca3,U+9ce2,U+9e48,U+9e6a,U+9e87,U+9ee2,U+9ee9,U+9f17,U+9f19,U+9f2c,U+9f80`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-1fdc0c67ed57263a80fd108c1f6ccf24.woff2`,descriptors:{unicodeRange:`U+4ef3,U+50d6,U+50ec,U+51ab,U+51b1,U+52d6,U+54a9,U+54da,U+55be,U+55cd,U+564d,U+572f,U+574c,U+576b,U+57d8,U+57fd,U+5844,U+59d2,U+5ae0,U+5b16,U+5b37,U+5b5b,U+5b80,U+5d1e,U+5d6b,U+5efe,U+5f11,U+5f56,U+5f58,U+5f73,U+5f8c,U+5fc4,U+5fe4,U+602b,U+6106,U+610d,U+63de,U+63f8,U+641b,U+64e4,U+6634,U+676a,U+67b5,U+681d,U+6883,U+69b1,U+69e0,U+6b37,U+6b9b,U+6d7c,U+6ed7,U+6f36,U+6f72,U+6f8c,U+7035,U+7039,U+7173,U+7178,U+7228,U+728f,U+72b4,U+72ef,U+72f4,U+7331,U+7481,U+74e0,U+7540,U+75c3,U+75e6,U+763c,U+764d,U+76cd,U+7704,U+7743,U+7780,U+7847,U+786a,U+78b9,U+7962,U+7a02,U+7aac,U+7ab3,U+7b0a,U+7b4c,U+7b7b,U+7bfc,U+7c0f,U+7c16,U+7c40,U+7ca2,U+7cc7,U+7cf8,U+7d77,U+7e3b,U+7ea1,U+7ea9,U+7ef2,U+7f02,U+7f07,U+7f0c,U+7f23,U+7f2f,U+7fbc,U+8016,U+8020,U+812c,U+8136,U+8182,U+822f,U+8233,U+825f,U+8268,U+8284,U+8288,U+8291,U+8308,U+8311,U+835b,U+836d,U+83dd,U+8406,U+840f,U+845c,U+84b4,U+84e3,U+850c,U+855e,U+863c,U+86ba,U+86c4,U+86de,U+86f1,U+873e,U+87bd,U+87db,U+880a,U+883c,U+887f,U+88f0,U+890a,U+892b,U+895e,U+89ef,U+8a48,U+8bdc,U+8c18,U+8c33,U+8c94,U+8db1,U+8dcf,U+8dd6,U+8de3,U+8e6f,U+8e90,U+8f7a,U+8fb6,U+902d,U+90be,U+91af,U+936a,U+948b,U+94d8,U+9513,U+953a,U+956c,U+963c,U+9654,U+966c,U+9688,U+97b4,U+996b,U+9a75,U+9a7a,U+9aba,U+9aed,U+9b08,U+9b43,U+9c8e,U+9c94,U+9c9a,U+9e2b,U+9e36,U+9e4b,U+9e4e,U+9e55,U+9e63,U+9e68-9e69,U+9ebd,U+9ec9,U+9f0d,U+9f37,U+9f51`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-e11567fd2accf9957cd0d3c2be937d87.woff2`,descriptors:{unicodeRange:`U+50a7,U+5240,U+5261,U+52ac,U+531a,U+5363,U+5432,U+5452,U+5456,U+5472,U+5478,U+553f,U+5575,U+5581,U+55cc,U+55fe,U+5601,U+572e,U+57d2,U+57ef,U+581e,U+5924,U+5981,U+5997,U+59a3,U+5aaa,U+5ab8,U+5b34,U+5d5d,U+5def,U+5e11,U+5e91,U+5ed1,U+5ef4,U+5f40,U+600d,U+6019,U+601b,U+605a,U+6092,U+60ab,U+6217,U+623d,U+6369,U+65d2,U+6661,U+670a,U+6753,U+67a7,U+6855,U+68f9,U+6939,U+696e,U+6980,U+6a7c,U+6aab,U+6b82,U+6bf3,U+6bf9,U+6c05,U+6c19-6c1a,U+6ca9,U+6cf6,U+6d1a,U+6dab,U+6f74,U+7085,U+7198,U+71b5,U+7256,U+725d,U+727e,U+72fa,U+7322,U+738e,U+73e5,U+750f,U+755a,U+7594,U+75b3,U+760c,U+7615,U+7630,U+763f,U+77ec,U+7817,U+78a1,U+78d9,U+7905,U+7b2a,U+7b2e,U+7b62,U+7b85,U+7bcc,U+7bea,U+7c26,U+7c74,U+7c9c-7c9d,U+7e47,U+7e9b,U+7e9f,U+7ee0,U+7ee8,U+7ef1,U+7f01,U+7f11,U+7f17,U+7f36,U+7f7e,U+7fee,U+802a,U+80cd,U+8112,U+8169,U+8234,U+8279,U+8298,U+82ca,U+82d8,U+82e1,U+83c0,U+83d4,U+83df,U+8401,U+8451,U+845a,U+8476,U+8478,U+84ba,U+84bd,U+84e0,U+851f,U+8548,U+8556,U+8585,U+868d,U+86e9,U+86f4,U+86f8,U+8765,U+8785,U+87ab,U+87ee,U+8832,U+8872,U+88b7,U+88e2-88e3,U+89da,U+8bce,U+8bd3,U+8bd6,U+8bf9,U+8c16,U+8c73,U+8d5c,U+8dde,U+8f6d,U+8f94,U+8fe8,U+9011,U+915e,U+9185,U+918c,U+94ab,U+94d1,U+94f3,U+9515,U+951d,U+9558,U+9567,U+96ce,U+96e9,U+9785,U+9878,U+987c,U+9883,U+98d1,U+9954,U+9963,U+9a93,U+9ac1,U+9acc,U+9b1f,U+9b49,U+9b4d,U+9b51,U+9ca7,U+9cae,U+9cce,U+9cd3,U+9e37,U+9e39,U+9e41,U+9e46,U+9f22,U+9f2f,U+9f39,U+9f85`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-20cc1bbf50e7efb442756cb605672c1f.woff2`,descriptors:{unicodeRange:`U+4e5c,U+4edf,U+4f25,U+4f32,U+4f5e,U+4f76,U+4faa,U+4fe6,U+5028,U+5048,U+5250,U+535f,U+538d,U+53c1,U+5412,U+5443,U+54d4,U+54dd,U+5541,U+5550,U+5577,U+55dd,U+55f3,U+560f,U+562c,U+5657-5658,U+5664,U+56af,U+575c,U+577c,U+57b2,U+57da,U+5800,U+5a62,U+5aeb,U+5c3b,U+5ca3,U+5d26,U+5d9d,U+5f01,U+5fb5,U+5fdd,U+5ff8,U+6029,U+6041,U+6079,U+60b1,U+6222,U+629f,U+6332,U+63bc,U+63e0,U+6485,U+65ab,U+65c3,U+65c6,U+668c,U+669d,U+66be,U+67fd,U+6800,U+68fc,U+690b,U+6924,U+6978,U+69a7,U+6a3e,U+6a50,U+6a5b,U+6a97,U+6b24,U+6b8d,U+6baa,U+6c10,U+6c54,U+6ceb,U+6d04,U+6d4d,U+6eb1,U+6ebd,U+7110,U+71b3,U+71f9,U+7230,U+728d,U+7292,U+72b8,U+72d2,U+7360,U+73a2,U+7511,U+75a0,U+75c8,U+779f,U+7826,U+7877,U+7a39,U+7aa8,U+7ae6,U+7b04,U+7b0f,U+7baa,U+7bac,U+7c1f,U+7ccd,U+7ecb,U+7ed4,U+7ed7,U+7efb,U+7f0d,U+7f5f,U+7faf,U+7fd5,U+7fe5,U+8027,U+80bc,U+80dd,U+80fc,U+8132,U+815a,U+8167,U+816d,U+81ca,U+8228,U+82a1,U+82a9,U+82ab,U+82cc,U+8351,U+8368,U+83b8,U+83d8,U+83ea,U+83f0,U+8497,U+84c1,U+858f,U+85ff,U+867b,U+86a8-86a9,U+870a,U+8722,U+876e,U+877c,U+87e5,U+8888,U+88df,U+8919,U+8bcc,U+8bdf,U+8be8,U+8bee,U+8c20,U+8c2f,U+8d36,U+8df8,U+8e05,U+8e2f,U+8f9a,U+9021,U+908b,U+90b4,U+90ba,U+90d0,U+90eb,U+90fe,U+91aa,U+933e,U+9486-9487,U+948d,U+9490,U+94ad,U+94bd,U+94d6,U+94d9,U+9507,U+9546,U+955e,U+956b,U+95e9,U+9604,U+960b,U+9612,U+9615,U+9617,U+96b9,U+989a-989b,U+989e,U+9a78,U+9a7d,U+9aa0,U+9aa2,U+9ac2,U+9b23,U+9b3b,U+9c82,U+9cca,U+9cd9,U+9e28,U+9e5a,U+9e5e,U+9e6c,U+9efe,U+9f0b`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-5d2898fbc097a7e24c6f38d80587621e.woff2`,descriptors:{unicodeRange:`U+4e47,U+4e8d,U+4f65,U+4f89,U+50ee,U+520e,U+5416,U+5454,U+54bb,U+54c2,U+54d3,U+54de,U+5591,U+55e5,U+560c,U+566b,U+5769,U+578c,U+5793,U+57e4,U+5889,U+593c,U+59ab,U+5ad4,U+5ad8,U+5af1,U+5b53,U+5ba5,U+5c59,U+5c63,U+5d5b,U+5e0f,U+5e14,U+5edb,U+5fbc,U+6004,U+60ad,U+610e,U+61b7,U+624c,U+634c,U+647a,U+64ba,U+65f0,U+6600,U+66f7,U+67e2,U+67f0,U+680c,U+686b,U+6874,U+691f,U+6989,U+6a17,U+6b81,U+6b84,U+6c06-6c07,U+6c3d,U+6d07,U+6d27,U+6d2b,U+6d91,U+6e6b,U+6e8f,U+6fde,U+70bb,U+723b,U+726e,U+72b0,U+72ce,U+72f2,U+7301,U+731e,U+737e,U+7477,U+748e,U+74ff,U+7633,U+7654,U+771a,U+7726,U+7765,U+7768,U+781c,U+7829,U+78d4,U+7913,U+7957,U+79d5,U+79eb,U+7a70,U+7a86,U+7b25,U+7b38,U+7b47,U+7b72,U+7ba6-7ba7,U+7dae,U+7ee1,U+7efe,U+7f26,U+7f31,U+7f35,U+801c,U+8043,U+809f,U+80ab,U+80d7,U+8118,U+8188,U+81cc,U+823e,U+8244,U+824f,U+82b4,U+82c1,U+82e4,U+82f4,U+8306,U+833a,U+835c,U+839c,U+83b3,U+83bc,U+846d,U+867a,U+868b,U+8734,U+87ca,U+886e,U+887e,U+88a2,U+88c9,U+8921,U+8bb5,U+8bf3,U+8c04,U+8c17,U+8c1d,U+8c25,U+8c36,U+8c55,U+8c78,U+8d3d,U+8d40,U+8d59,U+8d67,U+8d91,U+8dbf,U+8deb-8dec,U+8dfd,U+8e14,U+8e41,U+8f8e,U+900b,U+9044,U+9062,U+90cf,U+9123,U+9146,U+9162,U+9172,U+918d,U+9190,U+92c8,U+93ca,U+948c,U+94aa,U+94b2,U+94c8,U+94ca,U+94d5,U+94df,U+94e9-94ea,U+94f7,U+94fc-94fd,U+951b,U+954f,U+9554,U+9559,U+9566,U+9571-9572,U+95f1,U+9608,U+960f,U+97af,U+988f,U+98d5,U+992e,U+9955,U+9ab0,U+9b32,U+9c90,U+9c9e,U+9ca5,U+9ca9,U+9cad,U+9cb1,U+9cc3,U+9e47,U+9ee7,U+9f87`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-ac9ceb44437becc3e9c4dbfebab7fc2d.woff2`,descriptors:{unicodeRange:`U+4e93,U+4ec4,U+4ef5,U+4f27,U+4f7b,U+4fe3,U+5080,U+5121,U+51eb,U+5208,U+52f0,U+53f5,U+5453,U+5466,U+54a6,U+54bf,U+54d0,U+5533,U+5549,U+5556,U+556d,U+558f,U+55f2,U+55f5,U+5627,U+567b,U+56d4,U+571c,U+5739,U+57b4,U+5807,U+58c5,U+59a4,U+59af,U+59d8,U+5a09,U+5a0c,U+5a4a,U+5ad2,U+5b6c,U+5ca2,U+5cac,U+5d03,U+5d6c,U+5db7,U+5ebe,U+5f2d,U+5fea,U+6042,U+6120,U+6175,U+6221,U+623e,U+6339,U+638a,U+643d,U+64b8,U+64e2,U+66e9,U+67b3,U+67c1,U+67d2,U+6832,U+6877,U+68f0,U+6934,U+6966,U+6987,U+6998,U+69c1,U+69ce,U+6a3d,U+6a84,U+6aa9,U+6b87,U+6bd6,U+6c16,U+6c18,U+6cd4,U+6cee,U+6de0,U+6e0c,U+6ecf,U+6f4b,U+70b7,U+7168,U+72d9,U+7352,U+73b3,U+73d0,U+7441,U+74d2,U+75a5,U+75e7-75e8,U+7610,U+7619,U+765e,U+772d,U+7812,U+782c,U+784c,U+7850,U+7856,U+789b,U+78f4,U+7a51,U+7b15,U+7b1e,U+7b24,U+7b5a,U+7bb8,U+7bc1,U+7bd9,U+7ed0,U+7ee6,U+7efa,U+7f1b,U+7f1f,U+7f22,U+7f45,U+7f71,U+7fa7,U+7fbf,U+7ff3,U+8052,U+80b1,U+80db,U+80f4,U+81bb,U+81ec,U+8202,U+8210,U+8249,U+828a,U+828e,U+82e3,U+8315,U+8369,U+8378,U+83a8,U+83aa,U+83b4,U+83e1,U+84fc,U+8538,U+853b,U+859c,U+85ae,U+86b4,U+86c9,U+86cf,U+8725,U+879f,U+87b3,U+887d,U+88fe,U+8a8a,U+8ba7,U+8c07,U+8c14,U+8c30,U+8c47,U+8db5,U+8dd7,U+8e1f,U+8e69,U+8e70,U+8e85,U+8f78,U+8f87,U+8f8b,U+8f8f,U+90c4,U+9143,U+917d,U+948f,U+94cd,U+94d2,U+94ef,U+954a,U+9609-960a,U+96d2,U+9708,U+9765,U+97ea,U+9880,U+98a7,U+996c,U+9980,U+9991,U+9a88,U+9ab6,U+9afb,U+9b47,U+9c87,U+9c9b,U+9cb5,U+9cc7,U+9e2c,U+9e42,U+9e58,U+9ecd,U+9ecf,U+9f8a,U+9f8c`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-c16ed9740b85badf16e86ea782a3062f.woff2`,descriptors:{unicodeRange:`U+4ebb,U+4edd,U+4fa9,U+502c,U+50a5,U+51c7,U+51fc,U+523d,U+5241,U+530f,U+5464,U+549d,U+54a3,U+5514,U+5527,U+555c,U+556e,U+5576,U+55b1,U+55b9,U+55eb,U+5624,U+564c,U+5671,U+5685,U+568f,U+56d7,U+56e1,U+57a1,U+57d9,U+5942,U+5a67,U+5c50,U+5c7a,U+5c98,U+5d06,U+5d27,U+5d6f,U+5df3,U+5dfd,U+5e19,U+5ea0,U+5eb9,U+5eea,U+5ffe,U+600f,U+606b,U+6215,U+622c,U+6266,U+62bb,U+62bf,U+6308,U+6387,U+63b8,U+63c4,U+63c6,U+63f6,U+6441,U+6555,U+659b,U+6677,U+66a7,U+6775,U+678b,U+679e,U+6840,U+6849,U+6860,U+68c2,U+6910,U+6a28,U+6a2f,U+6a79,U+6b92-6b93,U+6bc2,U+6bfd,U+6c29,U+6c32,U+6c86,U+6cc5,U+6d0c,U+6d60,U+6da0,U+6ddd,U+6e86,U+6ed3,U+6edf,U+6fb9,U+6fd1,U+6fef,U+7023,U+7080,U+70ca,U+712f,U+7145,U+7284,U+732c,U+73c8,U+73d9,U+740a,U+7457,U+7596,U+759d,U+75a3,U+75d8,U+75e3-75e4,U+75ff,U+7622,U+7688,U+76b4,U+76e5,U+7818,U+7887,U+789a,U+78b2,U+7b08,U+7b33,U+7c2a,U+7ccc,U+7ea8,U+7ec0,U+7fe6,U+8012,U+8084,U+8093,U+80e4,U+80ef,U+8297,U+82a8,U+82be,U+8331,U+8366,U+83c5,U+83fd,U+8473,U+84a1,U+84ca,U+84d1,U+857b,U+85c1,U+85d3,U+8605,U+8662,U+86aa,U+86b1,U+86d4,U+86ed,U+86f3,U+8709,U+8748,U+874c,U+8763,U+89c7,U+89de,U+89e5,U+8a3e,U+8ba6,U+8c00,U+8c21,U+8c49,U+8c7a,U+8d30,U+8df9,U+8e51,U+8e59,U+8f6b,U+8f73,U+8ff3,U+9016,U+9026,U+902f,U+9099,U+909b,U+90c7,U+914a,U+91ae,U+91ba,U+9495,U+94a3,U+94af,U+94ba,U+94bf,U+94cc,U+94e1,U+94f0,U+9531,U+955d,U+95f3,U+9697,U+96bc,U+975b,U+977c,U+98a2,U+998a,U+9994-9995,U+9a9b,U+9ab7,U+9ac5,U+9c91,U+9ccf,U+9cd5,U+9e29,U+9edc,U+9edf,U+9f83,U+9f88-9f89`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-aa0d470430e6391eca720c7cfa44446f.woff2`,descriptors:{unicodeRange:`U+4ee8,U+4f22,U+4f43,U+4f57,U+4f5d,U+4f6f,U+4ff8,U+502d,U+507b,U+5345,U+53df,U+53fb,U+544b,U+5482,U+54a7,U+54cc,U+550f,U+5544,U+5555,U+5594,U+55e8,U+55ec,U+55ef,U+564e,U+56f9,U+5704,U+576d,U+5785,U+57ad,U+5914,U+5958,U+599e,U+59aa,U+59be,U+5a06,U+5abe,U+5ae1,U+5b40,U+5bee,U+5cbf,U+5cc4,U+5ccb,U+5d47,U+603f,U+6078,U+607d,U+607f,U+608c,U+609a,U+60fa,U+61ff,U+621b,U+622e,U+626a,U+6371,U+63ae,U+63cd,U+63d6,U+6410,U+6414,U+6421,U+6448,U+64d8,U+6710,U+6748,U+6772,U+680e,U+6954,U+69ab,U+6c68,U+6c8f,U+6ca4,U+6d2e,U+6e4e,U+6e98,U+6fe0,U+7094,U+70e9,U+7116,U+7119,U+723f,U+73c9,U+74e4,U+753e,U+7548,U+75bd,U+75cd,U+7618,U+7634,U+76c5,U+76f1,U+7708,U+7719,U+777e,U+7791,U+77b3,U+7823,U+7827,U+7830,U+7889,U+7893,U+7949,U+795c,U+79e3,U+7a14,U+7a88,U+7a95,U+7aa0,U+7afd,U+7b90,U+7bd1,U+7bfe,U+7da6,U+7ec2,U+7eef,U+7f03-7f04,U+7f08,U+7f58,U+7f61,U+7f9f,U+8174,U+8200,U+828d,U+82c4,U+82d5,U+82dc,U+82f7,U+832d,U+835a,U+840b,U+8438,U+852b,U+869d,U+86ac,U+86d0,U+86f0,U+8782,U+87a8,U+87d1-87d2,U+87e0,U+8839,U+8913,U+891b,U+8934,U+8941,U+89ca,U+89ce,U+8a07,U+8ba3,U+8bc5,U+8bcb,U+8bdb,U+8c11,U+8c15,U+8c29,U+8c32,U+8dc4,U+8dce,U+8ddb,U+8dfa,U+8e09,U+8e1d,U+8e39,U+8e42,U+8e49,U+8e4b,U+8e8f,U+8f71-8f72,U+9004,U+9036,U+9097,U+90dc,U+90e2,U+90e6,U+90ef,U+9104,U+919a,U+91b4,U+938f,U+9497,U+950f,U+9557,U+9562-9563,U+9573,U+9606,U+9649,U+972d,U+973e,U+97a3,U+97eb,U+988c,U+9894,U+98a6,U+9974,U+9977,U+997d,U+9a90,U+9a9d,U+9aef,U+9ca2,U+9ccd,U+9cdf,U+9e20,U+9e4c,U+9e6b,U+9f3e`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-f2b54d4e7be0eaefe1c2c56836fa5368.woff2`,descriptors:{unicodeRange:`U+4ede,U+4ee1,U+4eeb,U+4fda,U+4ffe,U+5025,U+506c,U+50f3,U+5106,U+520d,U+525c,U+52ad,U+530d,U+5310,U+539d,U+53a9,U+53fc,U+5421,U+5477,U+54e7,U+551b,U+5530,U+557e,U+5599,U+55c4,U+55d1,U+55d4,U+55df,U+55e4,U+55ea,U+5623,U+562d,U+5654,U+56eb,U+56f5,U+57a7,U+57d5,U+57dd,U+584d,U+5880,U+58ec,U+59dd,U+5a32,U+5a55,U+5a75,U+5b51,U+5b71,U+5b73,U+5cd2,U+5ce4,U+5e5b,U+5e96,U+5fd2,U+607b,U+61d1,U+634b,U+636d,U+63b3,U+63ff,U+64c0,U+661d,U+6657,U+66dc,U+67a5,U+6841,U+6867,U+6901,U+699b,U+6a47,U+6b46,U+6c21,U+6c24,U+6c35,U+6c4a,U+6c94,U+6ca3,U+6d39,U+6d63,U+6d6f,U+6d94,U+705e,U+71e7,U+726f,U+72cd,U+72de,U+72f0,U+7325,U+7350,U+7391,U+741a,U+757f,U+7583,U+75b1,U+75b4,U+75b8,U+75c2,U+75f1,U+766f,U+7699,U+7751,U+789c,U+7a17,U+7be6,U+7cb2,U+7ea3,U+7eb0,U+7ebe,U+7eeb,U+7f25,U+7f2c,U+7fb8,U+8026,U+8037,U+8153,U+8171,U+8191,U+8214,U+821b,U+8222,U+826e,U+82eb,U+830c,U+8314,U+8334,U+83d6,U+8418,U+843c,U+84ff,U+8564,U+8572,U+8616,U+866c,U+8693,U+86a3,U+86a7,U+86af,U+86b6,U+86c6,U+86ca,U+8708,U+870d,U+8759,U+8760,U+87af,U+87c6,U+8869,U+88c6,U+89d0,U+8b07,U+8baa-8bab,U+8bc2,U+8be4,U+8bf0,U+8c2a,U+8c62,U+8c89,U+8d49,U+8d6d,U+8d84,U+8d94,U+8db8,U+8dc6,U+8e2e,U+8e3d,U+8e47,U+8e7f,U+9005,U+9051,U+907d,U+9082,U+9088,U+90b0,U+90d3,U+9150,U+949c,U+94a4,U+94b9,U+94cb,U+94e0,U+9509,U+9512,U+951f,U+9534,U+9552-9553,U+965f,U+96b0,U+9791,U+9889,U+9990,U+9a9c,U+9aa7,U+9c88,U+9cb2-9cb3,U+9cb6-9cb7,U+9cc5,U+9cdc,U+9e22,U+9e2a,U+9e57,U+9e67,U+9e73,U+9e82,U+9eb8,U+9ee0,U+9f9b`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-99a16ef6a64934d5781933dbd9c46b2e.woff2`,descriptors:{unicodeRange:`U+4eb5,U+4f09,U+4f5a,U+4f8f,U+4fce,U+4fdf,U+4fea,U+4ff3,U+500c,U+500f,U+504e,U+5088,U+52be,U+5420,U+5457,U+5499,U+549b,U+54c6,U+54d2,U+558b,U+559f,U+55bd,U+55d6,U+565c,U+567c,U+568e,U+5768,U+577b,U+57a9,U+57ed,U+59f9,U+5a11,U+5a40,U+5ae6,U+5b6a,U+5b93,U+5bb8,U+5c15,U+5c99,U+5c9c,U+5cc1,U+5d2e,U+5d4b,U+5d99,U+5e54,U+5e61,U+5fcf-5fd1,U+6002,U+6006,U+6014,U+60af,U+60c6,U+60da,U+60f4,U+621f,U+62c8,U+631b,U+631e,U+63e9,U+64b5,U+655d,U+6619,U+6635,U+6641,U+67ad,U+67b0,U+67b7,U+67e9,U+684e,U+688f,U+695d,U+696b,U+69b7,U+6a58,U+6c26,U+6d35,U+6d43,U+6d9e,U+6dd9,U+6dec,U+6e11,U+6e6e,U+6e9f,U+6ec2,U+6ee2,U+6ef9,U+6f09,U+6f66,U+6f8d,U+6fc2,U+6fc9,U+729f,U+72c8,U+73de,U+7430,U+7566,U+7579,U+75c9,U+75e2,U+75fc,U+762a,U+7638,U+7678,U+76c2,U+76f9,U+778c,U+77cd,U+77dc,U+7800,U+781d,U+782d,U+783b-783c,U+78a3,U+78ec,U+7980,U+7a23,U+7b95,U+7bdd,U+7c0c,U+7c41,U+7c91,U+7cb3,U+7cc5,U+7ecc,U+7f19,U+7fca,U+8006,U+8069,U+807f,U+80bd,U+80ed,U+814b,U+8198,U+82cb,U+82d2,U+834f,U+8360,U+847a,U+84d6,U+84e5,U+8537,U+85d0,U+8671,U+86a4,U+86ce,U+86f9,U+8703,U+8707,U+8737,U+873b,U+8815,U+8936,U+8bc3,U+8bcf,U+8bd2,U+8bd8,U+8be9,U+8c0c,U+8c0f,U+8c4c,U+8d45,U+8d5d,U+8d73,U+8e31,U+8e6d,U+8e76,U+8fe4,U+9041,U+90d7,U+9169,U+92ae,U+94a1,U+94c4,U+94c9,U+94db,U+94e7,U+9503,U+9506,U+9517,U+9528,U+9537,U+9542,U+9549,U+95fe,U+9616,U+961a,U+96c9,U+96f3,U+9701,U+970e,U+9739,U+9753,U+9798,U+98d2-98d3,U+98d9-98da,U+9968,U+996f,U+9984,U+9997,U+9acb,U+9b03,U+9c85,U+9ca8,U+9cab,U+9e49,U+9e51,U+9e66,U+9f10`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-c40533fdf4cc57177b12803598af7e59.woff2`,descriptors:{unicodeRange:`U+4e15,U+4e1e,U+4e2b,U+4eb3,U+4ec9,U+4f0e,U+4f64,U+501c,U+50a9,U+510b,U+51a2,U+51bc,U+527d,U+52d0,U+53fd,U+5429,U+542e,U+5486,U+54af,U+5506,U+5511,U+5522,U+552c,U+556c,U+55b3,U+55d2,U+55e6,U+55fd,U+561f,U+5639,U+5659,U+5662,U+5693,U+572a,U+5892,U+598a,U+5992,U+59a9,U+5a20,U+5ae3,U+5b17,U+5b7d,U+5d34,U+5d3d,U+5d4a,U+5d82,U+5e1a-5e1b,U+5ea5,U+5f0b,U+5f77,U+5fd6,U+5fff,U+6026,U+6035,U+6063,U+60b4,U+60bb,U+60ee,U+612b,U+6194,U+61ca,U+61e6,U+61f5,U+620a,U+6248,U+62a1,U+62d7,U+6376,U+637b,U+652b,U+65bc,U+65cc,U+65ce,U+65d6,U+664c,U+665f,U+6666,U+6684,U+66b9,U+6773,U+6777,U+6787,U+67de,U+6845,U+693d,U+6994,U+6a35,U+6d54,U+6d5c,U+6d8e,U+6dd6,U+6eb4,U+6f2a,U+6f78,U+704f,U+70ec,U+7118,U+714a,U+7172,U+71b9,U+724d,U+728a,U+7337,U+733e,U+7396,U+73b7,U+73cf,U+7428,U+742c,U+742e,U+74ee,U+74f4,U+7525,U+753a,U+7572,U+75d4,U+765c,U+768e,U+7762,U+777d,U+77fd,U+7825,U+7837,U+78b4,U+795f,U+79ed,U+7a1e,U+7b06,U+7b20,U+7ba9,U+7bab,U+7c7c,U+7cbd,U+7cdc,U+7ec9,U+7ef6,U+7f30,U+7f42,U+7f44,U+7f54,U+7f94,U+8004,U+800b,U+8019,U+809b,U+80ae,U+80c4,U+80f1,U+8146,U+816e,U+817c,U+81c0,U+81fc,U+81fe,U+822b,U+830f,U+832f,U+8340,U+8365,U+8385,U+8392,U+83a0,U+8424,U+84af,U+869c,U+8713,U+8717-8718,U+87c0,U+87cb,U+87fe,U+8821,U+8902,U+89d1,U+8bb9,U+8c12,U+8d32,U+8d53,U+8df7,U+8e7c,U+8f7c,U+8f95,U+8fab,U+9052,U+905b,U+9095,U+909d,U+90c5,U+911e,U+9122,U+916a,U+919b,U+948e,U+9492,U+949a,U+94b5,U+94bc,U+94c6,U+94f1,U+9502,U+9511,U+9536,U+956f-9570,U+9602,U+9621,U+9631,U+998b,U+99a5,U+9a81,U+9a9e,U+9ebe,U+9f8b`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-91ddb2969bf2d31ba02ad82998d1314c.woff2`,descriptors:{unicodeRange:`U+4f2b,U+4f3d,U+4fac,U+5043,U+5055,U+5140,U+5156,U+51cb,U+5243,U+531d,U+536f,U+53a5,U+53ae,U+53f1,U+541d,U+5431,U+547b,U+5492,U+5494,U+54a4,U+54aa,U+54ce,U+54fd,U+5509,U+5520,U+553e,U+557b,U+55c5,U+55e1,U+55f7,U+5608,U+5636,U+563b,U+5773,U+57a0,U+5811,U+587e,U+58d5,U+59e3,U+5a29,U+5a6a,U+5a76,U+5a7a,U+5ac9,U+5b62,U+5b95,U+5c49,U+5c8c,U+5cab,U+5cb7,U+5d02,U+5d58,U+5e44,U+5e7a,U+5eff,U+5f29,U+5f89,U+5f9c,U+5fa8,U+6005,U+6043,U+60b8,U+60d8,U+60ec,U+60f0,U+6115,U+618e,U+630e,U+637a,U+6390,U+63ac,U+63b0,U+64de,U+6525,U+6538,U+65ee-65ef,U+6631,U+6636,U+6654,U+677c,U+67b8,U+67d8,U+683e,U+6886,U+68b5,U+692d,U+6963,U+6979,U+6988,U+6b59,U+6b9a,U+6c69,U+6c74,U+6cae,U+6ce0,U+6cef,U+6d95,U+6dc5,U+6dde,U+6de6,U+6dfc,U+6ea7,U+6f15,U+6f29,U+7096,U+70c3,U+7131,U+715c,U+7166,U+7266,U+7317,U+731d,U+7329,U+73e9,U+7425,U+7455,U+7490,U+74ef,U+7519,U+75b5,U+75b9,U+75de,U+7656,U+7663,U+7691,U+7729,U+77fe,U+783e,U+787c,U+795a,U+7a79,U+7abf,U+7b3a,U+7b4f,U+7b60,U+7b75,U+7b8d,U+7bb4,U+7bd3,U+7be1,U+7cbc,U+7edb,U+7f1c,U+7f8c,U+7fb2,U+7fb9,U+7fce,U+7ff1,U+810d,U+81c6,U+82a5,U+82aa,U+82de,U+8317,U+8343,U+835e,U+8364,U+836a,U+853a,U+8543,U+854a,U+8559,U+8568,U+85b0,U+85b9,U+864f,U+86e4,U+8715,U+8845,U+8884,U+88e8,U+88f1,U+8983,U+8be1,U+8c1f,U+8c27,U+8c5a,U+8c82,U+8d58,U+8dbe,U+8f98,U+9035,U+9074,U+90a1,U+9149,U+9157,U+93d6,U+949d,U+94c2,U+94e3-94e4,U+95eb,U+95f0,U+9611,U+9619,U+9642,U+968d,U+9706,U+970f,U+97ed,U+988a,U+9893,U+98e8,U+9a77,U+9a87,U+9aa1,U+9abc,U+9cdd,U+9e2f,U+9e33,U+9e44,U+9e5c,U+9e9d,U+9edd`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-774d4f764a1299da5d28ec2f2ffe0d69.woff2`,descriptors:{unicodeRange:`U+4f58,U+4f6c,U+4f70,U+4fd0,U+5014,U+51bd,U+524c,U+5315,U+5323,U+535e,U+540f,U+542d,U+545b,U+548e,U+549a,U+54ab,U+54fc,U+5567,U+556a,U+5600,U+5618,U+563f,U+5669,U+56f1,U+56ff,U+573b,U+574d,U+579b,U+57b8,U+57c2,U+586c,U+58f9,U+595a,U+598d,U+5993,U+5996,U+59d7,U+5b7a,U+5ba6,U+5c4e,U+5c96,U+5ce5,U+5eb6,U+5f08,U+5f99,U+602f,U+6059,U+606c,U+607a,U+60ed,U+61a9,U+620c,U+6249,U+62a8,U+62c4,U+62ed,U+62fd,U+6342,U+6345,U+6396,U+63a3,U+6402,U+6413,U+642a,U+6487,U+64a9,U+64ac,U+64ae,U+64b7,U+659f,U+65a1,U+667e,U+66f3,U+67e0,U+69db,U+69df,U+6aac,U+6b86,U+6c50,U+6c5e,U+6c76,U+6c85,U+6c8c,U+6cde,U+6d19,U+6d52,U+6da7,U+6db8,U+6e1a,U+6e25,U+6e4d,U+6e5f,U+6ec1,U+6f31,U+6f7a,U+6fa7,U+6fe1,U+701b,U+70ab,U+70f7,U+717d,U+71a8,U+7252,U+72c4,U+72e1,U+7315,U+736d,U+73ae,U+73c0,U+73c2,U+740f,U+75a4,U+7600-7601,U+768b,U+76bf,U+76d4,U+7728,U+772f,U+776c,U+77a0,U+77b0,U+77f8,U+783a,U+78d0,U+78fa,U+7977,U+7a37,U+7a92,U+7afa,U+7b71,U+7b94,U+7cef,U+7f28,U+7fe1,U+808b,U+80e5,U+80eb,U+8110,U+8113,U+812f,U+814c,U+81c3,U+8235,U+82d4,U+8309,U+83c1,U+8431,U+8469,U+84bf,U+84d3,U+84df,U+84e6,U+8511,U+8638,U+86c0,U+86db,U+86fe,U+8757,U+8822,U+8882,U+8885,U+8892,U+88f3,U+892a,U+8ba5,U+8bd9,U+8be0,U+8be7,U+8bfd,U+8c1a,U+8d4a,U+8d4e,U+8d66,U+8dda,U+8e0c,U+8e52,U+8e74,U+8e87,U+8f76,U+8fc2,U+8fe6,U+900d,U+9068,U+90ac,U+90b3,U+90b8,U+90e7,U+9119,U+9131,U+915a,U+916e,U+94b4,U+94d0,U+94e2,U+94ec,U+94ff,U+9522,U+9535,U+9556,U+965b,U+96f9,U+9774,U+9981,U+998d,U+998f,U+9a6e,U+9a7f,U+9a8a,U+9b13,U+9c9f,U+9e3e,U+9e43,U+9e6d,U+9e8b,U+9e92,U+9edb,U+9eef`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-7718fe60986d8b42b1be9c5ace5ccf25.woff2`,descriptors:{unicodeRange:`U+4e10,U+4e56,U+4e98,U+4ec3,U+4f3a,U+4f5f,U+4f88,U+4f97,U+4fa5,U+4fe8,U+504c,U+5197,U+52fa,U+5364,U+53e8,U+5406,U+543c,U+545c,U+5471,U+5480,U+5495,U+54b3,U+54df,U+54e6,U+54ee,U+557c,U+5583,U+55dc,U+55e3,U+566c,U+592f,U+5944,U+5983,U+59ca,U+59e5,U+5a13,U+5a7f,U+5b09,U+5bd0,U+5e4c,U+5eb5,U+5f1b,U+5f3c,U+608d,U+60cb,U+61a7,U+61ac,U+61cb,U+6233,U+62a0,U+62e7,U+62ee,U+62f4,U+62f7,U+634e,U+6382,U+63c9,U+63ea,U+6400,U+645e,U+6482,U+6556,U+6593,U+6615,U+664f,U+66e6,U+672d,U+675e,U+67da,U+6805,U+6808,U+6868,U+68a2,U+695e,U+69ad,U+6a80,U+6a90,U+6b83,U+6be1,U+6c30,U+6cad,U+6cb1,U+6cf1,U+6d31,U+6d93,U+6dae,U+6dbf,U+6dc6-6dc7,U+6e0d,U+6e32,U+6e3a,U+6e85,U+6eba,U+6f3e,U+6f5e,U+6f7c,U+6fee,U+71ee,U+722a,U+72b7,U+72e9,U+73ba,U+73d1,U+7409,U+7435-7436,U+7459-745a,U+747e,U+7487,U+74e2,U+7504,U+752c-752d,U+7599,U+759f,U+75a1,U+75ca,U+75f0,U+761f,U+7629,U+777f,U+7785,U+77a5,U+77bf,U+78d5,U+7934,U+7940,U+79a7,U+7b19,U+7c38,U+7c95,U+7cb1,U+7ce0,U+7eca,U+7ef7,U+7f2b,U+7f81,U+7fcc,U+8046,U+8148,U+8165,U+819b,U+81ba,U+828b,U+82ae,U+82b7,U+82d3,U+8301,U+830e,U+831c,U+8338,U+837c,U+8393,U+8398,U+83ba,U+83e0,U+83e9,U+853c,U+8654,U+86df,U+8712,U+873f,U+874e,U+8783,U+8859,U+88a4,U+8925,U+8bb7,U+8bff,U+8c19,U+8c1b,U+8c24,U+8c2c,U+8d61,U+8db4,U+8e6c,U+8f8a,U+8fe5,U+8ff8,U+901e,U+90f4,U+912f,U+9163,U+9170,U+91dc,U+949b,U+94a8,U+94b3,U+94c0,U+94e8,U+9525,U+9530,U+9539,U+954c-954d,U+9550,U+955b,U+962a,U+9685,U+96cc,U+9776,U+988d,U+9975,U+9985,U+9a6f,U+9aa5,U+9ab8,U+9c7f,U+9ca4,U+9cb8,U+9e25,U+9e35,U+9e4a`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-aa5c9ca6cf4fba00433b7aa3fa10671a.woff2`,descriptors:{unicodeRange:`U+4ea2,U+4ea5,U+4f36,U+4f84,U+4f8d,U+501a,U+5029,U+516e,U+51a5,U+51c4,U+51f8,U+5201,U+527f,U+5321,U+5352,U+5366,U+53e9,U+54c7,U+5632,U+5676,U+56b7,U+56bc,U+56da,U+56e4,U+5703,U+5729,U+5742,U+57a2-57a3,U+5815,U+58d1,U+5919,U+592d,U+5955,U+5a05,U+5a25,U+5a34,U+5b70,U+5b75,U+5bdd,U+5bf0,U+5c41,U+5c79,U+5c91,U+5c94,U+5ce6,U+5ced,U+5d69,U+5dc5,U+5e16,U+5e27,U+5f27,U+5f95,U+5ffb,U+6020,U+604d,U+6055,U+60e6,U+60eb,U+6123,U+618b,U+61a8,U+620d,U+62c7,U+62ce,U+62d9,U+631f,U+634d,U+6452,U+6479,U+64ce,U+64d2,U+655b,U+660a,U+6726,U+67c4,U+6809,U+6853,U+68e3,U+68f1,U+68fa,U+693f,U+6942,U+6995,U+69a8,U+69b4,U+6a71,U+6b89,U+6bcb,U+6bd3,U+6bd9,U+6c40,U+6cf8,U+6cfe,U+6d85,U+6da3,U+6daa,U+6e0e,U+6e43-6e44,U+6f88,U+7078,U+7099,U+70bd,U+70d9,U+70fd,U+7109,U+7184,U+7239,U+733f,U+73f2,U+748b,U+749c,U+749e,U+759a,U+75d2,U+75eb,U+7620,U+766b,U+7693,U+76cf,U+7738,U+773a,U+776b,U+778e,U+77aa,U+7852,U+78be,U+7948,U+795b,U+7960,U+796f,U+79ba,U+7a20,U+7a96,U+7aa5,U+7b03,U+7b28,U+7b50,U+7b77,U+7bc6,U+7bf1,U+7c27,U+7d0a,U+7ead,U+7ec5,U+7ee2,U+7ef0,U+7efd,U+7f0e,U+7f2e,U+7f79,U+7f9a,U+8098,U+80da,U+80e7,U+80f0,U+80f3,U+80fa,U+818a,U+81e7,U+8237-8238,U+8299,U+82b8,U+82ce,U+837b,U+83bd,U+83cf,U+8426,U+8475,U+85c9,U+85d5,U+85dc,U+85e9,U+871a,U+8747,U+8749,U+888d,U+8910,U+891a,U+8bb4,U+8be3,U+8bec,U+8bf2,U+8c06,U+8c0d,U+8d31,U+8d48,U+8de4,U+8e1e,U+8e4a,U+8e66,U+8f84,U+8f97,U+9083,U+90e1,U+9165,U+91c9,U+94b0,U+94f5,U+9504,U+9532,U+956d,U+95f5,U+95fa,U+9668,U+9698,U+96bd,U+9704,U+9773,U+9890,U+996a,U+997a,U+9a74,U+9a8b,U+9cc4,U+9ccc`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-4f50e5136e136527280bc902c5817561.woff2`,descriptors:{unicodeRange:`U+4ea8,U+4f1e,U+4f51,U+4f63,U+4f7c,U+4f83,U+4fa0,U+4fd1,U+4ffa,U+5018,U+5026,U+508d,U+50bb,U+50f5,U+50fb,U+5162,U+5319,U+5320,U+538c,U+5413,U+541f,U+5475,U+54bd,U+54d1,U+5589,U+5598,U+575f,U+57ae,U+57e0,U+5937,U+5974,U+5978,U+59ae,U+5a1f,U+5a49,U+5ab3,U+5b99,U+5b9b,U+5ba0,U+5be1,U+5be5,U+5c09,U+5c27,U+5de2,U+5e9a,U+5f26,U+5f8a,U+5f98,U+6021,U+606d,U+60bc,U+60d5,U+60e7,U+611a,U+614c,U+6254,U+626f,U+6292,U+6296,U+62b9,U+62e2,U+631a,U+631d,U+6320,U+6346,U+63ba,U+6467,U+64bc,U+658b,U+663c,U+6643,U+6652,U+6656,U+6687,U+66d9,U+66dd,U+66f0,U+673d,U+67ab,U+6816-6817,U+68a7,U+68ad,U+68cd,U+68e0,U+6986,U+69fd,U+6b47,U+6bd7,U+6c1f,U+6c2e-6c2f,U+6cbe,U+6de4,U+6e1d,U+6e83,U+6e9c,U+6ed4-6ed5,U+6f4d,U+70f9,U+7130,U+716e,U+718f,U+71ac,U+71e5,U+72fc,U+731c,U+7334,U+73ca,U+7422,U+7426,U+745f,U+7470,U+75af,U+75f4,U+762b,U+763e,U+7696,U+7737,U+7741,U+77a7,U+77bb,U+77ee,U+785d,U+788c,U+78ca,U+7901,U+796d,U+7985,U+79fd,U+7a3c,U+7a57,U+7a74,U+7b5b,U+7caa,U+7cb9,U+7cd5,U+7eac,U+7eb6,U+7ed1,U+7ee5,U+7f20,U+7f2a,U+7f38,U+7f69,U+7fa1,U+8018,U+8038,U+803f,U+804b,U+80a2,U+80be,U+80d6,U+817a,U+81fb,U+820c,U+82ad,U+82af,U+82bd,U+8327,U+8354,U+835f,U+8367,U+836b,U+840c,U+841d,U+8471,U+849c,U+84b2,U+84c9,U+8517,U+851a,U+8549,U+8681,U+8721,U+8776,U+88d9,U+88f9,U+89c5,U+8c1c,U+8c34,U+8d81,U+8d9f,U+8e0a,U+8e72,U+8eb2,U+8fed,U+901b,U+902e,U+906e,U+9091,U+90aa,U+90af,U+915d,U+9171,U+946b,U+9489,U+9499,U+94a5,U+9508,U+9524,U+952d,U+9551,U+9576,U+95f7,U+9600,U+96b6,U+96c0,U+9756,U+97f6,U+98a0,U+98a4,U+997f,U+9a73,U+9a86,U+9ad3,U+9e3d,U+9ed4`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-093b9ef39a46ceae95a1df18a0a3a326.woff2`,descriptors:{unicodeRange:`U+4e4d,U+4e5e,U+4ec7,U+4ed5,U+50da,U+50e7,U+515c,U+51a4,U+51ff,U+5203,U+5254,U+5300,U+533e,U+5375,U+53ee,U+5435,U+543b,U+5455,U+548b,U+548f,U+54d7,U+54fa,U+5578,U+5587,U+55a7,U+560e,U+5760,U+576f,U+5777,U+5830,U+58a9,U+5962,U+59e8,U+5a07,U+5a23,U+5a3c,U+5b5a,U+5bb5,U+5bc5,U+5bde,U+5c7f,U+5cb1,U+5ce8,U+5cea,U+5d29,U+5d4c,U+5e18,U+5f57,U+5f5d,U+5f87,U+5ff1,U+6016,U+601c,U+6064,U+6177,U+61d2,U+625b,U+62e3,U+62f1,U+634f,U+63a0,U+6401,U+6405,U+6495,U+64c2,U+6512,U+6577,U+6590,U+65a7,U+65a9,U+65f7,U+6627,U+6655,U+6714,U+6795,U+67d1,U+67ff,U+68b3,U+68d5,U+68d8,U+6930,U+6960,U+6977,U+69bb,U+69d0,U+6a31,U+6b7c,U+6bb4,U+6c22,U+6c72,U+6c79,U+6c7e,U+6c81,U+6c93,U+6ca5,U+6cbc,U+6ce3,U+6cfb,U+6d3c,U+6da9,U+6df3,U+6e2d,U+6eaf,U+6ec7,U+6f13,U+6f33,U+6f62,U+6fa1,U+7011,U+707c,U+708a,U+70c1,U+70d8,U+70eb,U+711a,U+7194,U+7281,U+7316,U+7357,U+7384,U+7405,U+742a,U+745b,U+7574,U+7578,U+75ea,U+7682,U+7792,U+77d7,U+77e9,U+77eb,U+77f6,U+780c,U+78c5,U+7941,U+79e4,U+7a1a,U+7a9c,U+7ad6,U+7b5d,U+7bf7,U+7c07,U+7c3f,U+7c9f,U+7ca5,U+7cdf,U+7e82,U+7eab,U+7ece,U+7eda,U+7f09,U+7f15,U+7f9e,U+7fdf,U+7fe9,U+803b,U+803d,U+80aa,U+80b4,U+813e,U+8155,U+817b,U+819d,U+821c,U+82b9,U+82df,U+82ef,U+8304,U+83b9,U+8446,U+853d,U+85af,U+85fb,U+8650,U+865e,U+86d9,U+86ee,U+8700,U+8862,U+889c,U+88d4,U+88f8,U+895f,U+8a79,U+8bb3,U+8bb6,U+8bc0,U+8beb,U+8bf5,U+8c23,U+8c79,U+8d1e,U+8dcb,U+8e29,U+8e44,U+8e81,U+8eac,U+8eaf,U+8f8d,U+9050,U+90f8,U+914b,U+948a,U+94be,U+94ee,U+950c,U+9540,U+962e,U+9647,U+9661,U+9699,U+96cf,U+9716,U+9761,U+97a0,U+97e7,U+9a7c,U+9a8f,U+9ae6,U+9cd6,U+9e26`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-a0ca5df4258213d7fc9fce80f65ce760.woff2`,descriptors:{unicodeRange:`U+4fa3,U+4fae,U+4fd8,U+4fef,U+50a3,U+5189,U+5195,U+51db,U+51f3,U+51f9,U+5220,U+5228,U+5288,U+52ff,U+532e,U+533f,U+5351,U+53db,U+53ed,U+5450,U+5484,U+5490,U+54c9,U+54e9,U+5501,U+5507,U+5543,U+55d3,U+56a3,U+575e,U+589f,U+5984,U+59ec,U+5a04,U+5a36,U+5a77,U+5a9a-5a9b,U+5ab2,U+5ac2,U+5ad6,U+5bc7,U+5c2c,U+5c34,U+5c51,U+5cd9,U+5d0e,U+5deb,U+5e3c,U+5e87,U+5ed3,U+5f13,U+5f64,U+5fe1,U+606a,U+6096,U+60df,U+60f6,U+60f9,U+6151,U+620e,U+6241,U+6252,U+6273,U+627c,U+6289,U+62c2,U+62cc,U+62ef,U+6361,U+6363,U+63b7,U+63e3,U+6518,U+66ae,U+6756,U+6789,U+6813,U+6829,U+6862,U+6866,U+6893,U+6897,U+690e,U+6984,U+69cc,U+6a1f,U+6a44,U+6a59,U+6ba1,U+6c13,U+6c90,U+6ca6,U+6cbd,U+6ccc,U+6cd3,U+6cd7,U+6d4a,U+6d4f,U+6d5a,U+6d9f,U+6da1,U+6dcc,U+6ea5,U+6ee4,U+6ee6,U+6f2f,U+6f8e,U+701a,U+7095,U+709c,U+70af,U+70db,U+70e8,U+714e,U+715e,U+71a0,U+71ce,U+7235,U+7280,U+72d0,U+72f8,U+73ab,U+7410,U+745c,U+7480,U+74a7-74a8,U+74e3,U+75ae,U+75f9,U+76b1,U+76ce,U+7736,U+77e2-77e3,U+781a,U+789f,U+797a,U+79be,U+79c3,U+79c6,U+79f8,U+7a8d,U+7a98,U+7aa6,U+7aff,U+7b1b,U+7cd9,U+7d6e,U+7ede,U+7eee,U+7f00,U+7f24,U+7f2d,U+7fd8,U+800d,U+8116,U+8151,U+81b3,U+8205,U+82c7,U+82db,U+832c,U+8335,U+8339,U+8386,U+846b,U+8587,U+8611,U+8682,U+868a,U+868c,U+8774,U+88d8,U+88f4,U+8912,U+8b6c,U+8bbd,U+8c0e,U+8c41,U+8d26,U+8d3b-8d3c,U+8d50,U+8dea,U+8e35,U+8f99,U+8fe2,U+8fe9,U+9017,U+914c,U+916f,U+9175-9176,U+918b,U+94a0,U+94ae,U+94ce,U+94f2,U+951a,U+952f,U+9541,U+9640,U+9672,U+968b,U+96cd,U+96ef,U+9713,U+97ec,U+9885,U+9992,U+9a6d,U+9a79,U+9a85,U+9cbb,U+9cd7,U+9cde,U+9e93,U+9f9f`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-d2666cbed13462c5dc36fa2f15c202ca.woff2`,descriptors:{unicodeRange:`U+4e11,U+4ed7,U+4fcf,U+4fe9,U+4fed,U+50ac,U+50b2,U+5112,U+5180,U+5188,U+51f6,U+522e,U+5265,U+52cb,U+52df,U+5349,U+5367,U+5378,U+537f,U+5395,U+5398,U+53d4,U+543e,U+5440,U+5446,U+54b8,U+5565-5566,U+5580,U+55bb,U+56ca,U+572d,U+573e,U+574e,U+5782-5784,U+58f3,U+5938-5939,U+5948,U+594e,U+5a1c,U+5a74,U+5ae9,U+5b55,U+5b5c,U+5bb0,U+5bd3,U+5bf8,U+5c3f,U+5d14,U+5d2d,U+5df7,U+5dfe,U+5e05-5e06,U+5e1c,U+5e62,U+5e7b,U+5e7d,U+5ed6,U+5f2f,U+5f66,U+5f6c,U+5fa1,U+604b,U+609f,U+60a6,U+60e8,U+6101,U+6124,U+6127,U+6148,U+61be,U+6247,U+62d8,U+62da,U+633d,U+635e,U+6367,U+6380,U+638f,U+63a9,U+63fd,U+641c,U+64e6,U+655e,U+6572,U+6591,U+65a5,U+6691,U+6735,U+67a2-67a3,U+67ef,U+680b,U+6876,U+6905,U+6a0a,U+6a61,U+6b79,U+6bb7,U+6bbf,U+6c41,U+6c55,U+6c83,U+6c9b,U+6ca7,U+6cfc,U+6d46,U+6d51,U+6d74,U+6d9d,U+6daf,U+6dc0,U+6deb,U+6e17,U+6e24,U+6e89,U+6ea2,U+6ef4,U+6f6d,U+707f,U+70b3,U+70e4,U+70ef,U+710a,U+722c,U+725f,U+7261,U+72ee,U+72f1,U+730e,U+732b,U+7433,U+7538,U+75bc,U+7624,U+7709,U+7750,U+7779,U+7802,U+7898,U+78a7,U+78b1,U+78cb,U+78f7,U+7984,U+7a83,U+7aed,U+7b3c,U+7b4b,U+7c92,U+7c98,U+7ca4,U+7eb9,U+7ee3,U+7ef3,U+7ef5,U+7f05,U+7f55,U+7f62,U+7fc1,U+7fd4,U+7fe0,U+8042,U+806a,U+80a0,U+80a4,U+80c3,U+8102,U+8106,U+814a,U+8154,U+8247,U+8258,U+82cd,U+8328,U+832b,U+8389,U+83ca,U+845b,U+846c,U+84b8,U+8574,U+859b,U+8680,U+8695,U+86c7,U+8702,U+886c,U+8896,U+88b1,U+88e4,U+8bc8,U+8c10,U+8c26,U+8c28,U+8c2d,U+8d4c,U+8d63,U+8f67,U+8f74,U+8fc4,U+9006,U+9063,U+90a2,U+90b1,U+90c1,U+9177,U+9189,U+9493,U+949e,U+94fe,U+9610,U+961c,U+96a7,U+96fe,U+978d,U+97f5,U+9888,U+997c,U+9a84,U+9b3c,U+9b44-9b45,U+9b54,U+9e64,U+9f0e,U+9f9a`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-1e6fd68f1f3902ce48ce8c69df385622.woff2`,descriptors:{unicodeRange:`U+4e19,U+4e38,U+4e53,U+4e7e,U+4e9f,U+4ec6,U+4f50,U+4fde,U+502a,U+5154,U+517d,U+51d1,U+51f0,U+5239,U+5256,U+52c9,U+52fe,U+5308,U+532a,U+535c,U+5384,U+53a2,U+53a8,U+53c9,U+53e0,U+5496,U+54ac,U+54c0,U+54c4,U+54e8,U+5561,U+5582,U+561b,U+5631,U+566a,U+5764,U+576a,U+5792,U+57ab,U+584c,U+5885,U+58f6,U+59a8,U+5acc,U+5bc2,U+5c38-5c39,U+5c60,U+5c6f,U+5c82,U+5c90,U+5d16,U+5dcd,U+5e37,U+5e90,U+5eb8,U+5f6a,U+5fcc,U+6012,U+6068,U+6073,U+607c,U+6094,U+6109,U+621a,U+626e,U+6284,U+62d0,U+62e6,U+62fe,U+6321,U+6328,U+632b,U+6349,U+6454,U+65ed,U+660f,U+6674,U+66a8,U+6749,U+674f,U+6760,U+67af,U+6850,U+6854,U+6869,U+68a8,U+68d2,U+68f5,U+6912,U+6b49,U+6b6a,U+6bef,U+6c28,U+6c5d,U+6c82,U+6cab,U+6cb8,U+6cc4,U+6cf5,U+6d47,U+6d78,U+6da4,U+6dc4,U+6dcb,U+6df9,U+6e0a,U+6e23,U+6e5b,U+6eb6,U+6f06,U+6f47,U+6f84,U+6f9c,U+6fd2,U+7076,U+70ac,U+7199,U+723d,U+72ac,U+72ed,U+7476,U+7529,U+752b,U+754f,U+7554,U+75d5,U+7626,U+76ef,U+7720,U+7766,U+7784,U+77ac,U+780d,U+7838,U+7845,U+786b,U+78b3,U+7978,U+79b9,U+79c9,U+79e7,U+7a3d,U+7a84,U+7a9f,U+7b0b,U+7b52,U+7c7d,U+7f1a,U+7fc5,U+7ff0,U+804a,U+8086-8087,U+808c,U+809a,U+80ba,U+810a,U+8180,U+818f,U+81c2,U+81ed,U+8231,U+8292,U+829c,U+82a6,U+82d1,U+8346,U+838e,U+839e,U+83c7,U+83f1,U+8403,U+840e,U+8513,U+857e,U+85e4,U+867e,U+871c,U+87ba,U+87f9,U+884d,U+8944,U+8a93,U+8c05,U+8d2c,U+8d2e,U+8d42-8d43,U+8dfb,U+8e22,U+8eba,U+8f69,U+8f9c,U+8fa3,U+8fa8,U+8fb1,U+900a,U+9038,U+903b,U+9042,U+904f,U+90b5,U+90dd,U+9102,U+9187,U+94a7,U+94c5,U+9523,U+95f8,U+95fd,U+960e,U+964b-964c,U+96c1,U+9709,U+971c,U+97ad,U+9882,U+9965,U+9976,U+9988,U+99a8,U+9a82,U+9a9a,U+9b41,U+9c8d,U+9e45,U+9e70,U+9e9f,U+9f3b,U+9f7f`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-87599f94b6cc129d505b375798d0d751.woff2`,descriptors:{unicodeRange:`U+4e08,U+4e18,U+4e1b,U+4e22,U+4e27,U+4e32,U+4e52,U+4e73,U+4ead,U+4ed4,U+4ed9,U+4ef0,U+4fa6,U+5076,U+5179,U+51bb,U+51c9,U+51ef,U+51fd,U+524a,U+526a,U+529d,U+52ab,U+5306,U+5339,U+53d9,U+540a,U+5410,U+541e,U+5439,U+54b1,U+54ed,U+5564,U+558a,U+55b7,U+5634,U+574a,U+5751,U+57a6,U+57cb,U+57d4,U+5824,U+582a,U+5835,U+5858,U+5893,U+58e4,U+5951,U+5986,U+59da,U+59fb,U+59ff,U+5a03,U+5a46,U+5ac1,U+5b5d,U+5bfa,U+5c18,U+5c3a,U+5c48,U+5c4f,U+5c61,U+5cb3,U+5d1b,U+5e15,U+5e3d,U+5e99,U+5e9e,U+5eca,U+5f0a,U+5f17-5f18,U+5f25,U+5f7c,U+5fcd,U+6028,U+60a0,U+60ac,U+60d1,U+614e,U+6155,U+6168,U+61c8,U+6208,U+6212,U+6251,U+629a-629b,U+62ab-62ac,U+62fc,U+6323,U+632a,U+63d2,U+643a,U+6491-6492,U+649e,U+64b0,U+64c5,U+659c,U+6614,U+662d,U+6664,U+6670,U+6676,U+6746,U+67cf,U+67d4,U+682a,U+6843,U+6846,U+68da,U+6b3a,U+6b67,U+6c27,U+6c5b,U+6c64,U+6c70,U+6caa,U+6cca,U+6ce1,U+6d12,U+6d45,U+6dd1,U+6dd8,U+6e34,U+6e7f,U+6ee5,U+6f02,U+7092,U+70c2,U+70e6,U+7115,U+7237,U+7272,U+727a,U+72c2,U+739b,U+73b2,U+743c,U+751c,U+758f,U+75b2,U+7686,U+76c6,U+76d2,U+76fc,U+775b,U+77a9,U+7816,U+788e,U+7897,U+78b0,U+79bd,U+7a0d,U+7a91,U+7a9d,U+7ae3,U+7bad,U+7cca,U+7d2b,U+7eb1,U+7f06,U+7f14,U+7f1d,U+7f50,U+7ffc,U+8036,U+80bf,U+80c1,U+80ce,U+80f8,U+8109,U+810f,U+8170,U+8179,U+819c,U+821f,U+8230,U+8236,U+8273,U+829d,U+82f9,U+8305,U+8350,U+83b2,U+83cc,U+8404,U+840d,U+8427,U+8482,U+8679,U+8854,U+886b,U+8bbc,U+8be6,U+8c31,U+8c6b,U+8d4b,U+8dcc,U+8e2a,U+8e48,U+8f90,U+8fb0,U+9022,U+903c,U+903e,U+9065,U+916c,U+917f,U+94a9,U+94c3,U+94dd,U+94ed,U+9510,U+953b,U+96c7,U+970d,U+9738,U+9877,U+987d,U+989c,U+98d8,U+9a70,U+9a91,U+9aa4,U+9b42,U+9b4f,U+9e2d,U+9e3f,U+9e7f,U+9f20`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-06c77b8c66e51ed6c63ccb502dd8b8af.woff2`,descriptors:{unicodeRange:`U+4e59,U+4ed3,U+4f0f,U+4f38,U+4f69,U+4fa7,U+4faf,U+4ff1,U+5077,U+5085,U+5144,U+5151,U+51af,U+51b6,U+51cc,U+523a,U+5251,U+5269,U+5272,U+52d8,U+5353,U+5389,U+53f9,U+5401,U+5415,U+541b,U+54f2,U+5524,U+554a,U+559d,U+5609,U+5740,U+575d,U+5806,U+5821,U+586b,U+5915,U+594f,U+5960,U+5999,U+59a5,U+59b9,U+59c6,U+59d1,U+59dc,U+5b5f,U+5b64,U+5b87,U+5bb4,U+5bbf,U+5c16,U+5c1d,U+5c3e,U+5c9a,U+5ca9,U+5cad,U+5cfb,U+5de1,U+5de7,U+5de9,U+5ef7,U+5f04,U+5f70,U+5f79,U+5fc6,U+602a,U+6050,U+6052,U+6070,U+6084,U+60b2,U+60dc,U+60e9,U+6167,U+6170,U+61c2,U+6270,U+6291,U+62b1,U+62bc,U+62dc,U+62df,U+62f3,U+6324,U+633a,U+6377,U+6398,U+63cf,U+640f,U+642c-642d,U+6458,U+6478,U+6500,U+654c,U+6566,U+658c,U+65c1,U+65cb,U+65e8,U+65ec,U+6696-6697,U+6734,U+679a,U+679d,U+67dc,U+67f3-67f4,U+680f,U+683d,U+684c,U+68af,U+699c,U+6bc1,U+6c0f,U+6c1b,U+6c57,U+6c6a,U+6d3d,U+6d6e,U+6d82,U+6db5,U+6dee,U+6e58,U+6eaa,U+6ecb,U+6ede,U+6ee9,U+6f0f,U+6f20,U+6f58,U+704c,U+7070,U+70b8,U+718a,U+7238,U+7262,U+7275,U+72b9,U+72d7,U+72e0,U+741b,U+7434,U+7483,U+74f6-74f7,U+75ab,U+764c,U+7761,U+7855,U+7891,U+78c1,U+79d2,U+7a00,U+7a3b,U+7c97,U+7ea4,U+7eb2,U+7ed2,U+7eea,U+7ef8,U+7f18,U+7fbd,U+8000,U+8010,U+8096,U+809d,U+80a9,U+817f,U+81e3,U+8206,U+8212,U+82ac,U+8302,U+8361,U+8377,U+83f2,U+8461,U+848b,U+84ec,U+8521,U+85aa,U+8870,U+8877,U+8881,U+888b,U+88ad,U+88c2,U+8986,U+8bd1,U+8bf1,U+8d24,U+8d2a,U+8d3e-8d3f,U+8d41,U+8d56,U+8d64,U+8d6b,U+8e0f,U+8f70,U+8f85,U+8f88,U+8fa9,U+9003,U+901d,U+90b9,U+90ce,U+94a6,U+94f8,U+9505,U+95ea,U+95ef,U+95f2,U+95f9,U+9601,U+9605,U+9634,U+966a,U+9677,U+9690,U+9694,U+96d5,U+971e,U+9896-9897,U+9972,U+9a71,U+9a76,U+9a7e,U+9e1f,U+9e23`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-13ae07ed2e272d26d59bc0691cd7117a.woff2`,descriptors:{unicodeRange:`U+4e01,U+4e43,U+4ea6,U+4ef2,U+4eff,U+4f26,U+4f2a,U+4f2f,U+4f5b,U+4fa8,U+4fca,U+4fd7,U+5021,U+504f,U+5141,U+51c0,U+51dd,U+51e4,U+51ed,U+5200,U+5237,U+5427,U+5448,U+54a8,U+5706,U+5708,U+5723,U+575b,U+57c3,U+5899,U+58a8,U+58c1,U+5976,U+5988,U+59bb,U+59d0,U+59d3,U+5a18,U+5a31,U+5a92,U+5b54,U+5b85,U+5baa-5bab,U+5bc4,U+5bd2,U+5be8,U+5bff,U+5c65,U+5d07,U+5e1d,U+5e78,U+5e7c,U+5f03,U+5f1f,U+5f39,U+5f6d,U+5f92,U+5faa,U+5fbd,U+5fe7,U+5ffd,U+60a8,U+60ef,U+6108,U+6162,U+622a,U+6234,U+626b,U+626d,U+62c6,U+62d2,U+62d4,U+62d6,U+62e8,U+6316,U+6355,U+63ed,U+6447,U+64a4,U+65f1,U+6606,U+6628,U+664b,U+6668,U+6682,U+66f9,U+66fc,U+66ff,U+6717,U+6740,U+676d,U+67aa,U+67ec,U+67f1,U+6842,U+6851,U+695a,U+6982,U+6a2a,U+6b20,U+6b23,U+6b32,U+6b96,U+6bc5,U+6beb,U+6c60,U+6c9f,U+6cea,U+6cf3,U+6d1e,U+6d53,U+6d66,U+6d69,U+6d8c,U+6d9b,U+6db2,U+6de1,U+6dfb,U+6e14,U+6ed1,U+6eda,U+6ee8,U+6f2b,U+706d,U+7089,U+708e,U+70ad-70ae,U+70e7,U+7126,U+714c,U+71c3,U+71d5,U+7206,U+7259,U+731b,U+73a9,U+73bb,U+74dc,U+7532,U+7545,U+755c,U+75c7,U+7687,U+76d7,U+76f2,U+788d,U+78e8,U+79e6,U+79e9,U+7a3f,U+7a46,U+7a97,U+7af9,U+7bee,U+7c4d,U+7c89,U+7cd6,U+7eb5,U+7ebd,U+7ed8,U+8017,U+8033,U+80c0,U+80de,U+80f6,U+8138,U+817e,U+81a8,U+820d,U+827e,U+82b3,U+82d7,U+83b1,U+84c4,U+84dd,U+8584,U+864e,U+865a,U+866b,U+86cb,U+88d5,U+89e6,U+8bca,U+8bde,U+8bfa,U+8c0a,U+8c37,U+8c46,U+8c6a,U+8c8c,U+8d1d,U+8d29,U+8d4f,U+8d54,U+8d5a,U+8d60,U+8d62,U+8f7f,U+8f96,U+8f9e-8f9f,U+8fc1,U+8fdf,U+8fea,U+8ff7,U+9012,U+906d,U+9075,U+90a6,U+90bb,U+90ca,U+9178,U+9192,U+91ca,U+94bb,U+94dc,U+94fa,U+9501,U+950b,U+9521,U+955c,U+963b,U+9655,U+9675-9676,U+9887,U+9891,U+9971,U+9a97,U+9ece,U+9ed8`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-353f33792a8f60dc69323ddf635a269e.woff2`,descriptors:{unicodeRange:`U+4e1d,U+4e39,U+4e4c,U+4e4f,U+4e54,U+4e58,U+4e95,U+4ea1,U+4eab,U+4eae,U+4ec1,U+4f10,U+4f19,U+4f30,U+4f34,U+4fb5,U+503e,U+518c,U+5192,U+51a0,U+51ac,U+51b0,U+51e1,U+5211,U+5242,U+52a3,U+52b2,U+52c3,U+52c7,U+52d2,U+52e4,U+5377,U+539a,U+53a6,U+53e5,U+5417,U+5510,U+552f,U+5531,U+574f-5750,U+5761,U+5851,U+5854,U+58ee,U+593a,U+5949,U+5954,U+5a5a,U+5b8b,U+5bbd,U+5c04,U+5c0a,U+5c4b,U+5ce1,U+5cf0,U+5e10,U+5e8a,U+5e9f,U+5ec9,U+5f31,U+5f84,U+5fd8-5fd9,U+5fe0,U+6015,U+6062,U+6069,U+6076,U+6089,U+60a3,U+60ca,U+620f,U+624e,U+6263,U+6298,U+62a2,U+62bd,U+6311,U+6350,U+6389,U+638c,U+63f4,U+6446,U+644a,U+6469,U+64cd,U+654f,U+6562,U+656c,U+65d7,U+65e6,U+65fa,U+660c,U+6653,U+66b4,U+670b,U+672b,U+676f-6770,U+6881,U+6885,U+68a6,U+68cb,U+68ee,U+6b8a,U+6c88-6c89,U+6cc9,U+6ce5,U+6d01,U+6d17,U+6d1b,U+6d59,U+6d6a,U+6da8,U+6df7,U+6e10,U+6e20-6e21,U+6f5c,U+706f,U+70bc,U+719f,U+7267,U+732a,U+73cd,U+7518,U+756a,U+7586,U+7591,U+75db,U+76c8,U+76d0,U+76d6,U+76d8,U+76df,U+76fe,U+77db,U+7801,U+786c,U+795d,U+7965,U+79cb,U+7a77,U+7a7f,U+7aef,U+7b11,U+7bb1,U+7bc7,U+7ea0,U+7eaf,U+7ed5,U+7edc,U+7f13,U+7f29,U+7f34,U+7f8a,U+7ffb,U+8015,U+8058,U+805a,U+8083,U+80af,U+80c6,U+80cc,U+811a,U+8150,U+82e5,U+8336,U+8352,U+83ab,U+8428,U+8463,U+852c,U+8861,U+89c8,U+8bcd,U+8bd7,U+8bda,U+8be2,U+8bef,U+8bf8,U+8c0b,U+8c13,U+8d34,U+8d3a,U+8d74,U+8d76,U+8da3,U+8dd1,U+8ddd,U+8ddf,U+8df3,U+8f68,U+8f6f,U+8f7d,U+8f91,U+8f9b,U+8fbd,U+8fc8,U+8fd4,U+8feb,U+8ff9,U+900f,U+9057,U+907f-9080,U+90d1,U+90ed,U+91ce,U+9519,U+9526,U+95ed,U+9614,U+9635,U+9644,U+9686,U+96c5,U+96ea,U+9707,U+9732,U+9759,U+978b,U+9876,U+9881,U+9910,U+996e,U+9970,U+9c81,U+9e21,U+9ebb,U+9f84`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-0facdf1ea213ba40261022f5d5ed4493.woff2`,descriptors:{unicodeRange:`U+4e3d,U+4e4e,U+4e71,U+4e8f,U+4ed8,U+4eea,U+4f0a,U+4f0d,U+4f11,U+4f1f,U+4f24,U+4f3c,U+4f73,U+4fc4,U+500d,U+5012,U+501f,U+503a,U+505c,U+507f,U+50a8,U+514d,U+5178,U+517c,U+51b2,U+51b7,U+520a,U+5238,U+523b,U+52b1,U+535a,U+5371,U+5385,U+53eb-53ec,U+53f3,U+53f6,U+5409,U+542b,U+542f,U+5434,U+5462,U+5473,U+547c,U+54c8,U+54ea,U+56fa,U+5733,U+5757,U+5766,U+5802,U+585e,U+590f,U+591c,U+591f,U+5947,U+594b,U+5987,U+5a01,U+5b59,U+5b63,U+5b88,U+5b97,U+5b9c,U+5bbe,U+5bfb,U+5c01,U+5c1a,U+5c24,U+5c3c,U+5c97,U+5c9b,U+5cb8,U+5de6,U+5e01,U+5e2e,U+5e45,U+5e55,U+5e84,U+5ef6,U+5f02,U+5f52,U+5f69,U+5f7b,U+5f90,U+5fae,U+6000,U+600e,U+6025,U+60e0,U+6276,U+6297,U+62b5,U+62cd,U+62d3,U+62e5,U+62e9,U+62ff,U+6302,U+632f,U+63e1,U+6444,U+64ad,U+653b,U+6551,U+6563,U+65a4,U+65e7,U+6620,U+667a,U+66f2,U+671d,U+6731,U+6742,U+675f,U+6768,U+677e-677f,U+6790,U+67b6,U+67d3,U+6863,U+68b0,U+68c9,U+690d,U+6b8b,U+6bcd,U+6bd2,U+6bd5,U+6c38,U+6c61,U+6cbf,U+6cdb,U+6cf0,U+6d2a,U+6d89,U+6da6,U+6f6e,U+6fb3,U+7075,U+707e,U+70df,U+7164,U+7236,U+725b,U+7389,U+73e0,U+745e,U+74e6,U+751a,U+7537,U+75be,U+76ae,U+76db,U+793c,U+7956,U+7981,U+79d8,U+79df,U+79fb,U+7adf,U+7ae5,U+7b14,U+7b26,U+7b54,U+7b79,U+7d2f,U+7eb8,U+7eba,U+7ec6,U+7ee9,U+7eff,U+7f5a,U+7f6a,U+7f72,U+8089,U+80a5,U+80e1,U+8111,U+8131,U+821e,U+822c,U+8270,U+8499,U+8651,U+867d,U+8840,U+8857,U+8863,U+88c1,U+89c9,U+89d2,U+8a89,U+8bed,U+8bfe,U+8c01,U+8c22,U+8d21,U+8d25,U+8d2f,U+8d5e,U+8d75,U+8d8b,U+8dc3,U+8de8,U+8df5,U+8f6e,U+8f86,U+8f89,U+8fc5,U+8ff0,U+8ffd,U+9014,U+904d,U+90ae,U+9274,U+949f,U+952e,U+969c,U+96c4,U+96e8,U+96f6-96f7,U+97e9,U+987f,U+996d,U+9a7b,U+9aa8,U+9c7c,U+9c9c,U+9e4f,U+9f13,U+9f50`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-f8ee5d36068a42b51d0e4a1116cfcec1.woff2`,descriptors:{unicodeRange:`U+4e13,U+4e16,U+4e1c,U+4e24,U+4e3e,U+4e49,U+4e61,U+4e66,U+4e89,U+4e8c,U+4e94,U+4e9b,U+4ea4,U+4eac,U+4ebf,U+4eca,U+4ef6-4ef7,U+4efb,U+4f18,U+4f20,U+4f46,U+4f7f,U+4fe1,U+503c,U+505a,U+5146,U+5148,U+515a,U+5171,U+5177,U+519b,U+51b3,U+51c6,U+51e0,U+5212,U+521b,U+522b,U+529e,U+52bf,U+534e-534f,U+5355,U+5357,U+5382,U+539f,U+53bb,U+53bf,U+53c2,U+53c8,U+53ca,U+53d6-53d8,U+53e3,U+53ea,U+53f0,U+540d,U+5411,U+56db,U+56de,U+56e0,U+56e2,U+578b,U+57ce,U+57fa,U+589e,U+5904,U+5934,U+5982,U+5b89,U+5b8c,U+5bfc,U+5c06,U+5c11,U+5c40,U+5c71,U+5e38,U+5e72,U+5e76,U+5e7f,U+5e94,U+5e9c,U+5f0f,U+5f15,U+5f20,U+5f3a,U+5f62,U+5f88,U+5fc5,U+5fd7,U+5feb,U+601d,U+6027,U+60c5,U+60f3,U+610f,U+6216,U+6218,U+624b,U+624d,U+6279,U+628a,U+6295,U+6301,U+6307,U+636e,U+63a5,U+63a8,U+652f,U+6536,U+653e,U+6548,U+6559,U+6570,U+65bd,U+65e0,U+6602,U+660e,U+6613,U+66f4,U+6700,U+670d,U+671f,U+672f,U+6743,U+674e,U+6751,U+6761,U+6784,U+6797,U+679c,U+67e5,U+6807,U+6837,U+683c,U+6b21,U+6b63-6b65,U+6bcf,U+6bd4,U+6c42,U+6c5f,U+6ca1,U+6cbb,U+6d3b,U+6d41,U+6d88,U+6df1,U+70b9,U+7136,U+7269,U+7279,U+7531,U+754c,U+767e,U+76ca,U+76f8,U+770b,U+7740,U+7814,U+79ef,U+7a0b,U+7a0e,U+7a76,U+7b80,U+7cbe,U+7cfb,U+7e41,U+7ea7,U+7ec4,U+7ec7,U+7ed3,U+7ed9,U+7edf,U+7f8e,U+8001,U+804c,U+8054,U+80b2,U+81f3,U+8425,U+8868,U+88ab,U+897f,U+89c1-89c2,U+89c4,U+89c6,U+89e3,U+8ba1,U+8ba4,U+8bae,U+8bb0,U+8bba,U+8bc1,U+8c03,U+8d28,U+8d39,U+8def,U+8f66,U+8f6c,U+8fd0-8fd1,U+9020,U+9053,U+90a3,U+90fd,U+91cc,U+9500,U+9547,U+95e8,U+95f4,U+961f,U+9645,U+9662,U+96be,U+96c6,U+9700,U+9769,U+97e6,U+9875,U+9879,U+9886,U+9898,U+98ce,U+9996,U+2b5af,U+2cc56,U+2e9f5,U+30edd-30ede`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-79d494361ae093b69e74ee9dbe65bfd4.woff2`,descriptors:{unicodeRange:`U+4e03,U+4e30,U+4e34,U+4e45,U+4e60,U+4e70,U+4e88,U+4e91-4e92,U+4ea9,U+4eb2,U+4ec0,U+4ecb,U+4ecd,U+4ee4,U+4fee,U+5019,U+5047,U+50cf,U+5145,U+516d,U+5170,U+5175,U+5199,U+51cf,U+51fb,U+521a,U+5224,U+5267,U+52aa,U+5347-5348,U+534a,U+5356,U+5361,U+536b,U+5370,U+538b,U+53e4,U+53e6,U+5403,U+5426,U+5428,U+542c,U+5438,U+5668,U+56ed,U+56f4,U+56fe,U+57df,U+592a,U+5957,U+5b69,U+5b81,U+5b8f,U+5b98,U+5b9d,U+5ba1,U+5ba4,U+5bb3,U+5bc6,U+5bdf,U+5c3d,U+5c5e,U+5c81,U+5ddd,U+5de8,U+5dee,U+5e0c,U+5e86,U+5e8f,U+5e93,U+5e95,U+5e97,U+5ea7,U+5ead,U+5eb7,U+5f55,U+5f81,U+5f85,U+5ff5,U+6001,U+613f,U+6258,U+6267,U+6269,U+626c,U+627e,U+62db,U+62ec,U+6325,U+635f,U+6362,U+6388,U+6392,U+63a2,U+63a7,U+63aa,U+641e,U+6545,U+6597,U+65e2,U+65e9,U+661f,U+665a,U+666e-666f,U+66fe,U+6728,U+67d0,U+6811,U+6838,U+6865,U+697c,U+6b22,U+6b27,U+6b4c,U+6b62,U+6b66,U+6b7b,U+6bdb,U+6c47,U+6c49,U+6c7d,U+6c99,U+6cfd,U+6d0b,U+6d25,U+6d32,U+6d3e,U+6d4b,U+6e29,U+6e56,U+6e7e,U+6f14,U+6fc0,U+706b,U+70c8,U+7247,U+72af,U+72b6,U+72ec,U+732e,U+73ed,U+7403,U+7533,U+753b,U+7559,U+7565,U+7597,U+767b,U+773c,U+7763,U+77ed,U+77ff,U+7968,U+798f,U+79bb,U+79c0-79c1,U+7ad9,U+7ae0,U+7b51,U+7b7e,U+7cae,U+7d22,U+7ea2,U+7eb3,U+7eb7,U+7ec3,U+7ec8,U+7ecd,U+7edd,U+7efc,U+7f16,U+7f3a,U+7f51,U+7f57,U+7f6e,U+80dc,U+822a,U+8239,U+826f,U+82cf,U+82e6,U+8349,U+8363,U+83dc,U+8457,U+85cf,U+878d,U+8865,U+8a00,U+8b66,U+8ba2,U+8ba8,U+8bad,U+8bb2,U+8bc9,U+8bd5,U+8bfb,U+8d2b,U+8d35,U+8d37,U+8f7b,U+8f93,U+8fce,U+8fdd,U+9000-9002,U+9010,U+9047,U+9093,U+9152,U+9488,U+94a2,U+9633,U+9636,U+963f,U+9646,U+9648,U+964d,U+9664,U+9669,U+9760,U+97f3,U+987a,U+987e,U+9884,U+98de,U+9986,U+9ed1`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-74e2263a91439c25b91d5132ce9f4d62.woff2`,descriptors:{unicodeRange:`U+4e14,U+4e25,U+4e48,U+4e50,U+4e5d,U+4e9a,U+4ec5,U+4efd,U+4f17,U+4f4e-4f4f,U+4f55,U+4f59,U+4f60,U+4f8b,U+4f9b,U+4f9d,U+4fbf,U+4fc3,U+5065,U+513f,U+5149,U+514b,U+516b,U+5174,U+517b,U+518d,U+51b5,U+5207,U+5217-5219,U+521d,U+526f,U+529f,U+52a9,U+52b3,U+5305,U+533b,U+5343,U+5360,U+5373-5374,U+5386,U+53cb-53cd,U+53f2,U+53f7,U+544a,U+5468,U+547d,U+54cd,U+552e,U+5584,U+56f0,U+571f,U+5747,U+575a,U+57f9,U+5883,U+58eb,U+58f0,U+5907,U+590d,U+592e,U+5931,U+5956,U+5965,U+5973,U+5979,U+59cb,U+5b57-5b58,U+5b83,U+5ba2-5ba3,U+5bb9,U+5bcc,U+5c42,U+5c45,U+5c4a,U+5dde,U+5df1,U+5df4,U+5e03,U+5e08,U+5e26,U+5e2d,U+5f71,U+5f80,U+5f8b,U+5fb7,U+606f,U+611f,U+6237,U+623f,U+6253,U+627f,U+6293,U+62a4,U+62c5,U+62c9,U+6309,U+6574,U+6599,U+65ad,U+65af,U+65c5,U+65cf,U+6625,U+663e,U+671b,U+672a,U+6750,U+6781,U+6821,U+6839,U+6848,U+68c0,U+6a21,U+6b3e,U+6bb5,U+6c14,U+6cb3,U+6cb9,U+6ce8,U+6e05,U+6e2f,U+6e38,U+6e90,U+6ee1,U+70ed,U+7167,U+7231,U+7248,U+724c,U+7387,U+738b,U+73af,U+7530,U+75c5,U+767d,U+76d1,U+76f4,U+771f,U+77e5,U+77f3,U+7834,U+7840,U+786e,U+793a,U+795e,U+79f0,U+7a33,U+7a7a,U+7a81,U+7ade,U+7b56,U+7b97,U+7c73,U+7c7b,U+7d20,U+7d27,U+7ea6,U+7eaa,U+7ebf,U+7ee7,U+7eed,U+7ef4,U+7fa4,U+8003,U+80a1,U+81f4,U+8272,U+827a,U+8282,U+82b1,U+82f1,U+8303,U+836f,U+83b7,U+843d,U+88c5,U+8ba9,U+8baf,U+8bb8,U+8bbf,U+8bc4,U+8bc6,U+8bdd,U+8be5,U+8bf7,U+8c08,U+8c61,U+8d1f,U+8d22-8d23,U+8d27,U+8d2d,U+8d38,U+8d5b,U+8d70,U+8d85,U+8d8a,U+8db3,U+8eab,U+8f83,U+8fb9,U+8fdc,U+8fde,U+9009,U+901f,U+914d,U+91c7,U+94b1,U+94c1,U+94f6,U+95fb,U+9632,U+9650,U+968f,U+9752,U+975e,U+987b,U+989d,U+98df,U+9999,U+9a6c,U+9a8c,U+9ec4,U+9feb-9fec`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-ee8bae97908d5147b423f77ad0d3c1bb.woff2`,descriptors:{unicodeRange:`U+98fb-990c,U+990e-990f,U+9911-992d,U+992f-9953,U+9956-9962,U+9964,U+9966,U+9973,U+9978-9979,U+997b,U+997e,U+9982-9983,U+9989,U+998c,U+998e,U+999a-99a4,U+99a6-99a7,U+99a9-99c8`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-56467a5c8840c4d23a60b2f935114848.woff2`,descriptors:{unicodeRange:`U+8e4c-8e50,U+8e53-8e58,U+8e5a-8e65,U+8e67-8e68,U+8e6a-8e6b,U+8e6e,U+8e71,U+8e73,U+8e75,U+8e77-8e7b,U+8e7d-8e7e,U+8e80,U+8e82-8e84,U+8e86,U+8e88-8e8e,U+8e91-8e93,U+8e95-8e9b,U+8e9d,U+8e9f-8eaa,U+8ead-8eae,U+8eb0-8eb1,U+8eb3-8eb9,U+8ebb-8ecd,U+8ecf-8f02`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-145aa02cdd91946e67dc934e1acffe75.woff2`,descriptors:{unicodeRange:`U+2e3a,U+3001-3002,U+3008-3011,U+3014-3017,U+301d-301f,U+4dae,U+4e00,U+4e07,U+4e09-4e0b,U+4e0d-4e0e,U+4e1a,U+4e2a,U+4e2d,U+4e3a-4e3b,U+4e4b,U+4e5f,U+4e86,U+4e8b,U+4e8e,U+4ea7,U+4eba,U+4ece,U+4ed1,U+4ed6,U+4ee3,U+4ee5,U+4eec,U+4f01,U+4f1a,U+4f4d,U+4f53,U+4f5c,U+4fdd,U+5143,U+5165,U+5168,U+516c,U+5173,U+5176,U+5185,U+519c,U+51fa,U+5206,U+5229,U+5230,U+5236,U+524d,U+529b,U+52a0-52a1,U+52a8,U+5316-5317,U+533a,U+5341,U+5362,U+53d1,U+53ef,U+53f8,U+5404,U+5408,U+540c,U+540e,U+5458,U+548c,U+54c1,U+54e5,U+5546,U+559c,U+56fd,U+5728,U+5730,U+573a,U+5916,U+591a,U+5927,U+5929,U+592b,U+597d,U+59d4,U+5b50,U+5b66,U+5b9a,U+5b9e,U+5bb6,U+5bf9,U+5c0f,U+5c14,U+5c31,U+5c55,U+5de5,U+5df2,U+5e02,U+5e73-5e74,U+5ea6,U+5efa,U+5f00,U+5f53,U+5f97,U+5fc3,U+603b,U+6210-6211,U+6240,U+6280,U+62a5,U+63d0,U+6539,U+653f,U+6587,U+65b0,U+65b9,U+65e5,U+65f6,U+662f,U+6708-6709,U+672c,U+673a,U+675c,U+6765,U+6c11,U+6c34,U+6cd5,U+6ce2,U+6d4e,U+6d77,U+73b0,U+7406,U+751f,U+7528,U+7535,U+7684,U+76ee,U+793e,U+79cd,U+79d1,U+7acb,U+7b2c,U+7b49,U+7ba1,U+7ecf,U+8005,U+800c,U+80fd,U+81ea,U+884c,U+8981,U+8bbe,U+8bf4,U+8d44,U+8d77,U+8fbe,U+8fc7,U+8fd8-8fd9,U+8fdb,U+901a,U+90e8,U+91cd,U+91cf,U+91d1,U+9485,U+957f,U+95ee,U+9762,U+9ad8,U+9ea6,U+9f99,U+9fcf,U+9fd4,U+9fed,U+fe10-fe19,U+fe30-fe31,U+fe33-fe44,U+ff01,U+ff0c,U+ff1f,U+2b4e7,U+2b7f7,U+2b7fc,U+2cb2d,U+2cb3b,U+2cb4a,U+2cb5b,U+2cb73`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-54acdfc2166ad7fcbd074f75fd4a56ba.woff2`,descriptors:{unicodeRange:`U+6490,U+6493-6494,U+6497-6498,U+649a-649d,U+649f-64a3,U+64a5-64a8,U+64aa-64ab,U+64af,U+64b1-64b4,U+64b6,U+64b9,U+64bb,U+64bd-64bf,U+64c1,U+64c3-64c4,U+64c6-64cc,U+64cf,U+64d1,U+64d3-64d6,U+64d9-64dd,U+64df-64e1,U+64e3,U+64e5,U+64e7-64ff,U+6501-6508,U+650a-6511,U+6513-6517,U+6519-6524,U+6526-652a,U+652c-652d,U+6530-6533,U+6537,U+653a,U+653c-653d,U+6540-6544,U+6546-6547,U+654a-654b,U+654d-654e,U+6550,U+6552-6554,U+6557-6558,U+655a,U+655c,U+655f-6561,U+6564-6565,U+6567-6568`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-29cec36cd205b211da97acabaa62f055.woff2`,descriptors:{unicodeRange:`U+9695-9696,U+969a-969b,U+969d-96a6,U+96a8-96af,U+96b1-96b2,U+96b4-96b5,U+96b7-96b8,U+96ba-96bb,U+96bf,U+96c2-96c3,U+96c8,U+96ca-96cb,U+96d0-96d1,U+96d3-96d4,U+96d6-96df,U+96e1-96e7,U+96eb-96ee,U+96f0-96f2,U+96f4-96f5,U+96f8,U+96fa-96fd,U+96ff,U+9702-9703,U+9705,U+970a-970c,U+9710-9712,U+9714-9715,U+9717-971b,U+971d,U+971f-9729,U+972b-972c,U+972e-972f,U+9731,U+9733-9737,U+973a-973d,U+973f-9751,U+9754-9755,U+9757-9758,U+975a,U+975c-975d,U+975f,U+9763-9764,U+9766-9768,U+976a-9770`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-3756e81d3e149cf6099163ee79944fec.woff2`,descriptors:{unicodeRange:`U+6af0-6b1f,U+6b25-6b26,U+6b28-6b31,U+6b33-6b36,U+6b38,U+6b3b-6b3d,U+6b3f-6b42,U+6b44-6b45,U+6b48,U+6b4a-6b4b,U+6b4d-6b58,U+6b5a-6b61,U+6b68-6b69,U+6b6b-6b78,U+6b7a,U+6b7d-6b80,U+6b85,U+6b88,U+6b8c,U+6b8e-6b91,U+6b94-6b95,U+6b97-6b99,U+6b9c-6ba0,U+6ba2-6ba9,U+6bab-6bb2,U+6bb6,U+6bb8-6bba`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-8e9f97f01034820170065b2921b4fb5e.woff2`,descriptors:{unicodeRange:`U+430e-439a,U+29e8a,U+29ec4,U+29edb,U+29ee9,U+29f7e,U+29f83,U+29f8c,U+29fce,U+2a01a,U+2a02f,U+2a082,U+2a0f9,U+2a190,U+2a38c`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-13d2887ec8ee73c43acdabc52a05af7b.woff2`,descriptors:{unicodeRange:`U+92ef-933d,U+933f-9369,U+936b-9388`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-72536a3d71b694a0d53dd90ddceae41e.woff2`,descriptors:{unicodeRange:`U+4512-458d,U+2b300,U+2b363,U+2b36f,U+2b372,U+2b37d,U+2b404,U+2b410,U+2b413,U+2b461,U+2b4ef,U+2b4f6,U+2b4f9,U+2b50d-2b50e,U+2b536,U+2b5ae,U+2b5b3,U+2b5e7,U+2b5f4,U+2b61c-2b61d,U+2b626-2b628,U+2b62a,U+2b62c,U+2b695-2b696,U+2b6ad,U+2b6ed`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-603aefd23e350ba7eb124273e3c9bcf1.woff2`,descriptors:{unicodeRange:`U+88bd-88c0,U+88c3-88c4,U+88c7-88c8,U+88ca-88cd,U+88cf-88d1,U+88d3,U+88d6-88d7,U+88da-88de,U+88e0-88e1,U+88e6-88e7,U+88e9-88ef,U+88f2,U+88f5-88f7,U+88fa-88fb,U+88fd,U+88ff-8901,U+8903-8909,U+890b-890f,U+8911,U+8914-8918,U+891c-8920,U+8922-8924,U+8926-8929,U+892c-892f,U+8931-8933,U+8935,U+8937-8940,U+8942-8943,U+8945-895d,U+8960-8965,U+8967-897a,U+897c-897e,U+8980,U+8982,U+8984-8985`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-095c169f3314805276f603a362766abd.woff2`,descriptors:{unicodeRange:`U+4b0b-4ba0`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-9544732d2e62d1a429674f8ee41b5d3a.woff2`,descriptors:{unicodeRange:`U+7179,U+717b-717c,U+717e-7183,U+7185-7189,U+718b-718e,U+7190-7193,U+7195-7197,U+719a-719e,U+71a1-71a7,U+71a9-71ab,U+71ad-71b2,U+71b4,U+71b6-71b8,U+71ba-71c2,U+71c4-71cd,U+71cf-71d3,U+71d6-71df,U+71e1-71e4,U+71e6,U+71e8-71ed,U+71ef-71f8,U+71fa-7205,U+7207-721c,U+721e-7227,U+7229,U+722b,U+722d`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-d3716376641d615e2995605b29bca7b6.woff2`,descriptors:{unicodeRange:`U+982e-9874,U+988b,U+988e,U+9892,U+9895,U+9899,U+98a3,U+98a8-98cd,U+98cf-98d0,U+98d4,U+98d6-98d7,U+98db-98dd,U+98e0-98e6,U+98e9-98fa`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-5a1ce3117cfe90c48e8fb4a9a00f694d.woff2`,descriptors:{unicodeRange:`U+7c14-7c15,U+7c17-7c1e,U+7c20-7c25,U+7c28-7c29,U+7c2b-7c37,U+7c39-7c3e,U+7c42-7c4c,U+7c4e-7c72,U+7c75-7c7a,U+7c7e-7c88,U+7c8a-7c90,U+7c93-7c94,U+7c96,U+7c99-7c9b,U+7ca0-7ca1,U+7ca3,U+7ca6-7ca9,U+7cab-7cad,U+7caf-7cb0,U+7cb4-7cb8,U+7cba-7cbb,U+7cbf-7cc0,U+7cc2-7cc4,U+7cc6,U+7cc9,U+7ccb,U+7cce-7cd4`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-b7d203b051eff504ff59ddca7576b6a9.woff2`,descriptors:{unicodeRange:`U+7d95-7da5,U+7da7-7dad,U+7daf-7e2a`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-4a38cc3e9cf104e69ba246d37f8cf135.woff2`,descriptors:{unicodeRange:`U+4a78-4b0a`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-982b630266d87db93d2539affb1275c6.woff2`,descriptors:{unicodeRange:`U+9b30-9b31,U+9b33-9b3a,U+9b3d-9b40,U+9b46,U+9b4a-9b4c,U+9b4e,U+9b50,U+9b52-9b53,U+9b55-9bcf`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-9592bfc861f07bcb8d75c196b370e548.woff2`,descriptors:{unicodeRange:`U+6a4b-6a4f,U+6a51-6a57,U+6a5a,U+6a5c-6a60,U+6a62-6a64,U+6a66-6a70,U+6a72-6a78,U+6a7a-6a7b,U+6a7d-6a7f,U+6a81-6a83,U+6a85-6a8d,U+6a8f,U+6a92-6a96,U+6a98-6a9f,U+6aa1-6aa8,U+6aaa,U+6aad-6aef`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-a7accba310e821da5505f71c03b76bdb.woff2`,descriptors:{unicodeRange:`U+99c9-9a53`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-dac48066b5883d8b4551fc584f0c2a3e.woff2`,descriptors:{unicodeRange:`U+8550-8555,U+8557-8558,U+855a-855d,U+855f-8563,U+8565-8567,U+8569-8571,U+8573,U+8575-8578,U+857c-857d,U+857f-8583,U+8586,U+8588-858e,U+8590-859a,U+859d-85a3,U+85a5-85a7,U+85a9,U+85ab-85ad,U+85b1-85b6,U+85b8,U+85ba-85c0,U+85c2-85c8,U+85ca-85ce,U+85d1-85d2,U+85d4,U+85d6-85db,U+85dd-85e3,U+85e5-85e8,U+85ea-85fa,U+85fc-85fe,U+8600-8603`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-a1f916d6039285c4ffb900cd654e418f.woff2`,descriptors:{unicodeRange:`U+6fb2,U+6fb4-6fb5,U+6fb7-6fb8,U+6fba-6fbf,U+6fc1,U+6fc3-6fc8,U+6fca-6fd0,U+6fd3-6fdd,U+6fdf,U+6fe2-6fed,U+6ff0-7010,U+7012-7019,U+701c-7022,U+7024-7034,U+7036-7038,U+703a-704b,U+704d-704e,U+7050-7053`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-95bfd249da4902577b4b7d76ebdd0b44.woff2`,descriptors:{unicodeRange:`U+4ba1-4c2c`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-93fc8f28a33234bcadf1527cafabd502.woff2`,descriptors:{unicodeRange:`U+9a54-9a6b,U+9a72,U+9a83,U+9a89,U+9a8d-9a8e,U+9a94-9a95,U+9a99,U+9aa6,U+9aa9-9aaf,U+9ab2-9ab5,U+9ab9,U+9abb,U+9abd-9abf,U+9ac3-9ac4,U+9ac6-9aca,U+9acd-9ad0,U+9ad2,U+9ad4-9ad7,U+9ad9-9ade,U+9ae0,U+9ae2-9ae5,U+9ae7-9aea,U+9aec,U+9aee,U+9af0-9af8,U+9afa,U+9afc-9b02,U+9b04-9b07,U+9b09-9b0e,U+9b10-9b12,U+9b14-9b1e,U+9b20-9b22,U+9b24-9b2e`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-903bb6865f3452e2fda42e3a25547bc5.woff2`,descriptors:{unicodeRange:`U+9d1a-9da1`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-4aca6a43e59aceee2166b0c7e4e85ef1.woff2`,descriptors:{unicodeRange:`U+9e13-9e1e,U+9e24,U+9e27,U+9e2e,U+9e30,U+9e34,U+9e3b-9e3c,U+9e40,U+9e4d,U+9e50,U+9e52-9e54,U+9e56,U+9e59,U+9e5d,U+9e5f-9e62,U+9e65,U+9e6e-9e6f,U+9e72,U+9e74-9e7d,U+9e80-9e81,U+9e83-9e86,U+9e89-9e8a,U+9e8c-9e91,U+9e94-9e9c,U+9e9e,U+9ea0-9ea5,U+9ea7-9eb3,U+9eb5-9eb7,U+9eb9-9eba,U+9ebc,U+9ebf-9ec3,U+9ec5-9ec8,U+9eca-9ecc,U+9ed0,U+9ed2-9ed3,U+9ed5-9ed7,U+9ed9-9eda,U+9ede,U+9ee1,U+9ee3-9ee4,U+9ee6,U+9ee8,U+9eeb-9eee,U+9ef0-9ef8`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-24476a126f129212beb33f66853ea151.woff2`,descriptors:{unicodeRange:`U+8b1c-8b25,U+8b27-8b65,U+8b67-8b6b,U+8b6d-8b9f,U+8bac,U+8bb1,U+8bbb,U+8bc7,U+8bd0`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-1b611157cd46bb184d4fa4dae2d6a2b8.woff2`,descriptors:{unicodeRange:`U+4cad-4d2f`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-56a32a7689abd0326e57c10c6c069bb4.woff2`,descriptors:{unicodeRange:`U+9c4b-9c7b,U+9c7d-9c7e,U+9c80,U+9c83-9c84,U+9c89-9c8a,U+9c8c,U+9c8f,U+9c93,U+9c96-9c99,U+9c9d,U+9caa,U+9cac,U+9caf,U+9cb9,U+9cbe-9cc2,U+9cc8-9cc9,U+9cd1-9cd2,U+9cda-9cdb,U+9ce0-9ce1,U+9ce3-9d19`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-3cc70dbb64df5b21f1326cc24dee2195.woff2`,descriptors:{unicodeRange:`U+9389-938e,U+9390-93c9,U+93cb-93d5,U+93d7-9410`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-f6032fc06eb20480f096199713f70885.woff2`,descriptors:{unicodeRange:`U+20a0-20b5,U+20b9-20ba,U+20bc-20bd,U+4e2c,U+5107,U+5216,U+5293,U+54f3,U+5523,U+5819,U+5adc,U+5c88,U+5e3b,U+5fee,U+62f6,U+63be,U+6484,U+6499,U+67d9,U+67dd,U+6d5e,U+6f46,U+717a,U+71e0,U+72c1,U+73e7,U+75b0,U+7603,U+7722,U+7809,U+7811,U+7946,U+7967,U+799a,U+7b45,U+7ba2,U+8014,U+80d9,U+8159,U+817d,U+81a3,U+81aa,U+8201,U+833c,U+836e,U+83e5,U+8459,U+84f0,U+8729,U+8753,U+87d3,U+89dc,U+8bf6,U+8c2e,U+8e2c,U+8e9c,U+8e9e,U+8ece,U+8fee,U+9139,U+914f,U+9174,U+9191,U+960c,U+9622,U+9a98,U+9b48,U+9ca6,U+9cb0,U+9da2-9e12,U+9e88,U+9f44,U+9f86`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-e2ead7ea7da0437f085f42ffc05f8d13.woff2`,descriptors:{unicodeRange:`U+9bd0-9c4a`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-97f7f48ce90c9429bf32ae51469db74d.woff2`,descriptors:{unicodeRange:`U+4c2d-4cac`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-24a21c1e4449222e8d1898d69ff3a404.woff2`,descriptors:{unicodeRange:`U+4d30-4dab`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-726303e0774b4e678bff8c2deb6ca603.woff2`,descriptors:{unicodeRange:`U+9411-943d,U+943f-946a,U+946c-9484`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-5a7fac4b8b23a6e4e5ba0c9bf1756c91.woff2`,descriptors:{unicodeRange:`U+9efa,U+9efd,U+9eff-9f0a,U+9f0c,U+9f0f,U+9f11-9f12,U+9f14-9f16,U+9f18,U+9f1a-9f1f,U+9f21,U+9f23-9f2b,U+9f2d-9f2e,U+9f30-9f36,U+9f38,U+9f3a,U+9f3c,U+9f3f-9f43,U+9f45-9f4f,U+9f52-9f7e,U+9f81-9f82,U+9f8d-9f94`}},{uri:`./fonts/Xiaolai/Xiaolai-Regular-2b7441d46298788ac94e610ffcc709b6.woff2`,descriptors:{unicodeRange:`U+7e2b-7e3a,U+7e3c-7e40,U+7e42-7e46,U+7e48-7e81,U+7e83-7e9a,U+7e9c-7e9e,U+7eae,U+7eb4,U+7ebb-7ebc,U+7ed6,U+7ee4,U+7eec,U+7ef9,U+7f0a,U+7f10,U+7f1e,U+7f37,U+7f39,U+7f3b`}}],qh=class e{constructor(t){v(this,`scene`),v(this,`getSceneFamilies`,()=>e.getUniqueFamilies(this.scene.getNonDeletedElements())),v(this,`onLoaded`,t=>{let n=!0;for(let r of t){let t=`${r.family}-${r.style}-${r.weight}-${r.unicodeRange}`;e.loadedFontsCache.has(t)||(e.loadedFontsCache.add(t),n=!1)}if(n)return;let r=!1,i=this.scene.getNonDeletedElementsMap();for(let e of this.scene.getNonDeletedElements())if(R(e)){r=!0,Sf.delete(e),Zd.clearCache(cu(e));let t=Bb(e,i);t&&Sf.delete(t)}r&&this.scene.triggerUpdate()}),v(this,`loadSceneFonts`,async()=>{let t=this.getSceneFamilies(),n=e.getCharsPerFamily(this.scene.getNonDeletedElements());return e.loadFontFaces(t,n)}),this.scene=t}static get registered(){return e._registered?e._initialized||(e._registered=new Map([...e.init().entries(),...e._registered.entries()])):e._registered=e.init(),e._registered}get registered(){return e.registered}static async generateFontFaceDeclarations(t){let n=e.getUniqueFamilies(t),r=e.getCharsPerFamily(t),i=n.find(e=>Zs(e).includes(qs));if(i){let t=e.getCharacters(r,i);if(nf(t)){let e=Xs[qs];r[e]=new Set(t),n.unshift(Xs[qs])}}let a=await new od(e.fontFacesStylesGenerator(n,r),3).all();return Array.from(new Set(a))}static async loadFontFaces(t,n){for(let{fontFaces:t,metadata:n}of e.registered.values())if(!n.local)for(let{fontFace:e}of t)window.document.fonts.has(e)||window.document.fonts.add(e);return(await new od(e.fontFacesLoader(t,n),10).all()).flat().filter(Boolean)}static*fontFacesLoader(t,n){for(let[r,i]of t.entries()){let t=cu({fontFamily:i,fontSize:16}),a=e.getCharacters(n,i);window.document.fonts.check(t,a)||(yield id(async()=>{try{let e=await window.document.fonts.load(t,a);return[r,e]}catch(n){console.error(`Failed to load font "${t}" from urls "${e.registered.get(i)?.fontFaces.map(e=>e.urls)}"`,n)}}))}}static*fontFacesStylesGenerator(t,n){for(let[r,i]of t.entries()){let{fontFaces:t,metadata:a}=e.registered.get(i)??{};if(!Array.isArray(t)){console.error(`Couldn't find registered fonts for font-family "${i}"`,e.registered);continue}if(!a?.local)for(let[a,o]of t.entries())yield id(async()=>{try{let t=e.getCharacters(n,i),s=await o.toCSS(t);return s?[r*1e4+a,s]:void 0}catch(e){console.error(`Couldn't transform font-face to css for family "${o.fontFace.family}"`,e)}})}}static register(e,t,...n){let r=Ys[e]??Xs[e];return this.registered.get(r)||this.registered.set(r,{metadata:t,fontFaces:n.map(({uri:t,descriptors:n})=>new Ih(e,t,n))}),this.registered}static init(){let t={registered:new Map},n=(n,...r)=>{let i=hh[Ys[n]??Xs[n]]??hh[Ys.Excalifont];e.register.call(t,n,i,...r)};return n(`Cascadia`,...Lh),n(`Comic Shanns`,...Rh),n(`Excalifont`,...Bh),n(`Helvetica`,...Vh),n(`Liberation Sans`,...Hh),n(`Lilita One`,...Uh),n(`Nunito`,...Wh),n(`Virgil`,...Gh),n(qs,...Kh),n(Js,...zh),e._initialized=!0,t.registered}static getUniqueFamilies(e){return Array.from(e.reduce((e,t)=>(R(t)&&e.add(t.fontFamily),e),new Set))}static getCharsPerFamily(e){let t={};for(let n of e)if(R(n))for(let e of n.originalText)t[n.fontFamily]||(t[n.fontFamily]=new Set),t[n.fontFamily].add(e);return t}static getCharacters(e,t){return e[t]?Array.from(e[t]).join(``):``}static getAllFamilies(){return Array.from(e.registered.keys())}};v(qh,`loadedFontsCache`,new Set),v(qh,`_registered`),v(qh,`_initialized`,!1),v(qh,`loadElementsFonts`,async e=>{let t=qh.getUniqueFamilies(e),n=qh.getCharsPerFamily(e);return qh.loadFontFaces(t,n)});var Jh=qh,Yh=(e,t,n)=>{let{unitsPerEm:r,ascender:i,descender:a}=Jh.registered.get(e)?.metadata.metrics||hh[Ys.Virgil].metrics,o=t/r,s=(n-o*i+o*a)/2;return o*i+s},Xh=e=>{let{lineHeight:t}=Jh.registered.get(e)?.metadata.metrics||hh[Ys.Excalifont].metrics;return t},Zh=e=>{let{angle:t,width:n,height:r,x:i,y:a}=e,o=i+n/2,s=a+r/2,c=P(o,s),l;return l=e.type===`diamond`?Wl(F(P(o,a),c,t),F(P(i+n,s),c,t),F(P(o,a+r),c,t),F(P(i,s),c,t)):Wl(F(P(i,a),c,t),F(P(i+n,a),c,t),F(P(i+n,a+r),c,t),F(P(i,a+r),c,t)),{type:`polygon`,data:l}},Qh=(e,t,n=10)=>{let[r,i,a,o,s,c]=av(e,t,!0);r-=n,a+=n,i-=n,o+=n;let l=P(s,c),u=F(P(r,i),l,e.angle),d=F(P(a,i),l,e.angle),f=F(P(r,o),l,e.angle);return{type:`polygon`,data:[u,d,F(P(a,o),l,e.angle),f]}},$h=e=>{let{width:t,height:n,angle:r,x:i,y:a}=e;return{type:`ellipse`,data:{center:P(i+t/2,a+n/2),angle:r,halfWidth:t/2,halfHeight:n/2}}},eg=e=>{if(!e)return[];for(let t of e.sets)if(t.type===`path`)return t.ops;return e.sets[0].ops},tg=(e,t=P(0,0),n,r)=>{let i=e=>F(P(e[0]+t[0],e[1]+t[1]),r,n),a=eg(e),o=[],s=P(0,0);for(let e of a){if(e.op===`move`){let t=yl(e.data);Yu(t!=null,`Ops data is not a point`),s=i(t)}if(e.op===`bcurveTo`){let t=i(P(e.data[0],e.data[1])),n=i(P(e.data[2],e.data[3])),r=i(P(e.data[4],e.data[5]));o.push(Il(s,t,n,r)),s=r}}return{type:`polycurve`,data:o}},ng=e=>{let t=e[0],n=[];for(let r=1;r<e.length;r++){let i=e[r];n.push(I(t,i)),t=i}return n},rg=(e,t,n=!1)=>{let r=n=>F(bl(pl(N(n),ul(e.x,e.y))),t,e.angle),i=ng(e.points.map(e=>r(e)));return n?{type:`polygon`,data:Gl(i.flat())}:{type:`polyline`,data:i}},ig=(e,t,n=P(0,0),r,i)=>{let a=e=>F(P(e[0]+n[0],e[1]+n[1]),i,r);if(e.roundness===null)return{type:`polygon`,data:Gl(e.points.map(e=>a(e)))};let o=eg(t),s=[],c=!1;for(let e of o)e.op===`move`?(c=!c,c&&s.push(P(e.data[0],e.data[1]))):e.op===`bcurveTo`?c&&(s.push(P(e.data[0],e.data[1])),s.push(P(e.data[2],e.data[3])),s.push(P(e.data[4],e.data[5]))):e.op===`lineTo`&&c&&s.push(P(e.data[0],e.data[1]));return{type:`polygon`,data:Gl(Zo(s,10,5).map(e=>a(e)))}},ag=(e,t)=>{let{angle:n,halfWidth:r,halfHeight:i,center:a}=t,o=r,s=i,[c,l]=F(bl(pl(N(e),hl(N(a),-1))),P(0,0),-n),u=Math.abs(c),d=Math.abs(l),f=.707,p=.707;for(let e=0;e<3;e++){let e=o*f,t=s*p,n=(o*o-s*s)*f**3/o,r=(s*s-o*o)*p**3/s,i=e-n,a=t-r,c=u-n,l=d-r,m=Math.hypot(a,i),h=Math.hypot(l,c);f=Math.min(1,Math.max(0,(c*m/h+n)/o)),p=Math.min(1,Math.max(0,(l*m/h+r)/s));let g=Math.hypot(p,f);f/=g,p/=g}let[m,h]=[o*f*Math.sign(c),s*p*Math.sign(l)];return Tl(P(c,l),P(m,h))},og=(e,t,n=1e-4)=>ag(e,t)<=n,sg=(e,t)=>{let{center:n,angle:r,halfWidth:i,halfHeight:a}=t,[o,s]=F(bl(pl(N(e),hl(N(n),-1))),P(0,0),-r);return o/i*(o/i)+s/a*(s/a)<=1},cg=(e,t,n=0)=>{switch(t.type){case`polygon`:return ql(e,t.data,n);case`ellipse`:return og(e,t.data,n);case`line`:return jl(e,t.data,n);case`polyline`:return mg(e,t.data,n);case`curve`:return pg(e,t.data,n);case`polycurve`:return ug(e,t.data,n);default:throw Error(`shape ${t} is not implemented`)}},lg=(e,t)=>{switch(t.type){case`polygon`:return Kl(e,t.data);case`line`:return!1;case`curve`:return!1;case`ellipse`:return sg(e,t.data);case`polyline`:return Kl(e,Gl(t.data.flat()));case`polycurve`:return!1;default:throw Error(`shape ${t} is not implemented`)}},ug=(e,t,n)=>t.some(t=>pg(e,t,n)),dg=e=>{let[t,n,r,i]=e;return(e,a)=>(1-e)**3*i[a]+3*e*(1-e)**2*r[a]+3*e**2*(1-e)*n[a]+t[a]*e**3},fg=(e,t=10)=>{let n=dg(e),r=[n(0,0),n(0,1)],i=[],a=0,o=1/t;for(let e=0;e<t;e++)if(a+=o,a<=1){let e=P(n(a,0),n(a,1));i.push(I(r,e)),r=e}return i},pg=(e,t,n)=>mg(e,fg(t),n),mg=(e,t,n=1e-4)=>t.some(t=>jl(e,t,n));function hg(e,t,n){return{center:e,halfWidth:t,halfHeight:n}}var gg=(e,t)=>{let{halfWidth:n,halfHeight:r,center:i}=t,a=n,o=r,s=pl(N(e),hl(N(i),-1)),c=Math.abs(s[0]),l=Math.abs(s[1]),u=.707,d=.707;for(let e=0;e<3;e++){let e=a*u,t=o*d,n=(a*a-o*o)*u**3/a,r=(o*o-a*a)*d**3/o,i=e-n,s=t-r,f=c-n,p=l-r,m=Math.hypot(s,i),h=Math.hypot(p,f);u=Math.min(1,Math.max(0,(f*m/h+n)/a)),d=Math.min(1,Math.max(0,(p*m/h+r)/o));let g=Math.hypot(d,u);u/=g,d/=g}let[f,p]=[a*u*Math.sign(s[0]),o*d*Math.sign(s[1])];return Tl(bl(s),P(f,p))};function _g({center:e,halfWidth:t,halfHeight:n},[r,i]){let[a,o]=e,s=r[0]-a,c=r[1]-o,l=i[0]-a,u=i[1]-o,d=(l-s)**2/t**2+(u-c)**2/n**2,f=2*(s*(l-s)/t**2+c*(u-c)/n**2),p=s**2/t**2+c**2/n**2-1,m=(-f+Math.sqrt(f**2-4*d*p))/(2*d),h=(-f-Math.sqrt(f**2-4*d*p))/(2*d),g=[P(s+m*(l-s)+a,c+m*(u-c)+o),P(s+h*(l-s)+a,c+h*(u-c)+o)].filter(e=>!isNaN(e[0])&&!isNaN(e[1]));return g.length===2&&Sl(g[0],g[1])?[g[0]]:g}function vg(e,t=0){let n=Yg(Math.min(e.width,e.height),e);if(n<=0){let r=Pl(P(e.x-t,e.y-t),P(e.x+e.width+t,e.y+e.height+t));return[[I(P(r[0][0]+n,r[0][1]),P(r[1][0]-n,r[0][1])),I(P(r[1][0],r[0][1]+n),P(r[1][0],r[1][1]-n)),I(P(r[0][0]+n,r[1][1]),P(r[1][0]-n,r[1][1])),I(P(r[0][0],r[1][1]-n),P(r[0][0],r[0][1]+n))],[]]}let r=P(e.x+e.width/2,e.y+e.height/2),i=Pl(P(e.x,e.y),P(e.x+e.width,e.y+e.height)),a=I(P(i[0][0]+n,i[0][1]),P(i[1][0]-n,i[0][1])),o=I(P(i[1][0],i[0][1]+n),P(i[1][0],i[1][1]-n)),s=I(P(i[0][0]+n,i[1][1]),P(i[1][0]-n,i[1][1])),c=I(P(i[0][0],i[1][1]-n),P(i[0][0],i[0][1]+n)),l=[hl(vl(N(P(i[0][0]-t,i[0][1]-t),r)),t),hl(vl(N(P(i[1][0]+t,i[0][1]-t),r)),t),hl(vl(N(P(i[1][0]+t,i[1][1]+t),r)),t),hl(vl(N(P(i[0][0]-t,i[1][1]+t),r)),t)],u=[Il(bl(l[0],c[1]),bl(l[0],P(c[1][0]+2/3*(i[0][0]-c[1][0]),c[1][1]+2/3*(i[0][1]-c[1][1]))),bl(l[0],P(a[0][0]+2/3*(i[0][0]-a[0][0]),a[0][1]+2/3*(i[0][1]-a[0][1]))),bl(l[0],a[0])),Il(bl(l[1],a[1]),bl(l[1],P(a[1][0]+2/3*(i[1][0]-a[1][0]),a[1][1]+2/3*(i[0][1]-a[1][1]))),bl(l[1],P(o[0][0]+2/3*(i[1][0]-o[0][0]),o[0][1]+2/3*(i[0][1]-o[0][1]))),bl(l[1],o[0])),Il(bl(l[2],o[1]),bl(l[2],P(o[1][0]+2/3*(i[1][0]-o[1][0]),o[1][1]+2/3*(i[1][1]-o[1][1]))),bl(l[2],P(s[1][0]+2/3*(i[1][0]-s[1][0]),s[1][1]+2/3*(i[1][1]-s[1][1]))),bl(l[2],s[1])),Il(bl(l[3],s[0]),bl(l[3],P(s[0][0]+2/3*(i[0][0]-s[0][0]),s[0][1]+2/3*(i[1][1]-s[0][1]))),bl(l[3],P(c[0][0]+2/3*(i[0][0]-c[0][0]),c[0][1]+2/3*(i[1][1]-c[0][1]))),bl(l[3],c[0]))];return[[I(u[0][3],u[1][0]),I(u[1][3],u[2][0]),I(u[2][3],u[3][0]),I(u[3][3],u[0][0])],u]}function yg(e,t=0){let[n,r,i,a,o,s,c,l]=sv(e),u=Yg(Math.abs(n-c),e),d=Yg(Math.abs(a-r),e);if(e.roundness?.type==null){let[f,p,m,h]=[P(e.x+n,e.y+r-t),P(e.x+i+t,e.y+a),P(e.x+o,e.y+s+t),P(e.x+c-t,e.y+l)];return[[I(P(f[0]+u,f[1]+d),P(p[0]-u,p[1]-d)),I(P(p[0]-u,p[1]+d),P(m[0]+u,m[1]-d)),I(P(m[0]-u,m[1]-d),P(h[0]+u,h[1]+d)),I(P(h[0]+u,h[1]-d),P(f[0]-u,f[1]+d))],[]]}let f=P(e.x+e.width/2,e.y+e.height/2),[p,m,h,g]=[P(e.x+n,e.y+r),P(e.x+i,e.y+a),P(e.x+o,e.y+s),P(e.x+c,e.y+l)],_=[hl(vl(N(m,f)),t),hl(vl(N(h,f)),t),hl(vl(N(g,f)),t),hl(vl(N(p,f)),t)],v=[Il(bl(_[0],P(m[0]-u,m[1]-d)),bl(_[0],m),bl(_[0],m),bl(_[0],P(m[0]-u,m[1]+d))),Il(bl(_[1],P(h[0]+u,h[1]-d)),bl(_[1],h),bl(_[1],h),bl(_[1],P(h[0]-u,h[1]-d))),Il(bl(_[2],P(g[0]+u,g[1]+d)),bl(_[2],g),bl(_[2],g),bl(_[2],P(g[0]+u,g[1]-d))),Il(bl(_[3],P(p[0]-u,p[1]+d)),bl(_[3],p),bl(_[3],p),bl(_[3],P(p[0]+u,p[1]+d)))];return[[I(v[0][3],v[1][0]),I(v[1][3],v[2][0]),I(v[2][3],v[3][0]),I(v[3][3],v[0][0])],v]}var bg=e=>{if(e.type===`arrow`)return!1;let t=!Eu(e.backgroundColor)||kd(e)||pd(e)||R(e);return e.type===`line`||e.type===`freedraw`?t&&Xg(e.points):t||ud(e)},xg=({x:e,y:t,element:n,shape:r,threshold:i=10,frameNameBound:a=null})=>{let o=bg(n)&&lg(P(e,t),r)||cg(P(e,t),r,i);return!o&&a&&(o=lg(P(e,t),{type:`polygon`,data:Zh(a).data})),o},Sg=(e,t,n,r,i=0)=>{let[a,o,s,c]=yv(n,r);return a-=i,o-=i,s+=i,c+=i,Ol(P(a,o),P(e,t),P(s,c))},Cg=(e,t)=>!xg(e)&&!wg(e.x,e.y,Bg(e.element,t))&&Sg(e.x,e.y,e.element,t),wg=(e,t,n)=>!!n&&lg(P(e,t),n),Tg=(e,t,n=0)=>{switch(e.type){case`rectangle`:case`image`:case`text`:case`iframe`:case`embeddable`:case`frame`:case`magicframe`:return Eg(e,t,n);case`diamond`:return Dg(e,t,n);case`ellipse`:return Og(e,t,n);default:throw Error(`Unimplemented element type '${e.type}'`)}},Eg=(e,t,n=0)=>{let r=P(e.x+e.width/2,e.y+e.height/2),i=F(t[0],r,-e.angle),a=F(t[1],r,-e.angle),[o,s]=vg(e,n);return[...o.map(e=>Nl(I(i,a),e)).filter(e=>e!=null).map(t=>F(t,r,e.angle)),...s.flatMap(e=>Bl(e,I(i,a))).filter(e=>e!=null).map(t=>F(t,r,e.angle))].filter((e,t,n)=>n.findIndex(t=>Sl(e,t))===t)},Dg=(e,t,n=0)=>{let r=P(e.x+e.width/2,e.y+e.height/2),i=F(t[0],r,-e.angle),a=F(t[1],r,-e.angle),[o,s]=yg(e,n);return[...o.map(e=>Nl(I(i,a),e)).filter(e=>e!=null).map(t=>F(t,r,e.angle)),...s.flatMap(e=>Bl(e,I(i,a))).filter(e=>e!=null).map(t=>F(t,r,e.angle))].filter((e,t,n)=>n.findIndex(t=>Sl(e,t))===t)},Og=(e,t,n=0)=>{let r=P(e.x+e.width/2,e.y+e.height/2),i=F(t[0],r,-e.angle),a=F(t[1],r,-e.angle);return _g(hg(r,e.width/2+n,e.height/2+n),kl(i,a)).map(t=>F(t,r,e.angle))},kg={EQUAL:`Equal`,MINUS:`Minus`,NUM_ADD:`NumpadAdd`,NUM_SUBTRACT:`NumpadSubtract`,NUM_ZERO:`Numpad0`,BRACKET_RIGHT:`BracketRight`,BRACKET_LEFT:`BracketLeft`,ONE:`Digit1`,TWO:`Digit2`,THREE:`Digit3`,NINE:`Digit9`,QUOTE:`Quote`,ZERO:`Digit0`,SLASH:`Slash`,C:`KeyC`,D:`KeyD`,H:`KeyH`,V:`KeyV`,Z:`KeyZ`,Y:`KeyY`,R:`KeyR`,S:`KeyS`},H={ARROW_DOWN:`ArrowDown`,ARROW_LEFT:`ArrowLeft`,ARROW_RIGHT:`ArrowRight`,ARROW_UP:`ArrowUp`,PAGE_UP:`PageUp`,PAGE_DOWN:`PageDown`,BACKSPACE:`Backspace`,ALT:`Alt`,CTRL_OR_CMD:As?`metaKey`:`ctrlKey`,DELETE:`Delete`,ENTER:`Enter`,ESCAPE:`Escape`,QUESTION_MARK:`?`,SPACE:` `,TAB:`Tab`,CHEVRON_LEFT:`<`,CHEVRON_RIGHT:`>`,PERIOD:`.`,COMMA:`,`,SUBTRACT:`-`,SLASH:`/`,A:`a`,C:`c`,D:`d`,E:`e`,F:`f`,G:`g`,H:`h`,I:`i`,L:`l`,O:`o`,P:`p`,Q:`q`,R:`r`,S:`s`,T:`t`,V:`v`,X:`x`,Y:`y`,Z:`z`,K:`k`,W:`w`,0:`0`,1:`1`,2:`2`,3:`3`,4:`4`,5:`5`,6:`6`,7:`7`,8:`8`,9:`9`},Ag=new Map([[H.Z,kg.Z],[H.Y,kg.Y]]),jg=e=>/^[a-z]$/.test(e.toLowerCase()),Mg=(e,t)=>{if(t===e.key.toLowerCase())return!0;let n=Ag.get(t);return!!(n&&!jg(e.key)&&e.code===n)},Ng=e=>e===H.ARROW_LEFT||e===H.ARROW_RIGHT||e===H.ARROW_DOWN||e===H.ARROW_UP,Pg=e=>e.altKey,Fg=e=>e.shiftKey,Ig=e=>e.shiftKey,Lg=[{icon:Mf,value:`selection`,key:H.V,numericKey:H[1],fillable:!0},{icon:Nf,value:`rectangle`,key:H.R,numericKey:H[2],fillable:!0},{icon:Pf,value:`diamond`,key:H.D,numericKey:H[3],fillable:!0},{icon:Ff,value:`ellipse`,key:H.O,numericKey:H[4],fillable:!0},{icon:If,value:`arrow`,key:H.A,numericKey:H[5],fillable:!0},{icon:Lf,value:`line`,key:H.L,numericKey:H[6],fillable:!0},{icon:zf,value:`freedraw`,key:[H.P,H.X],numericKey:H[7],fillable:!1},{icon:Bf,value:`text`,key:H.T,numericKey:H[8],fillable:!1},{icon:Vf,value:`image`,key:null,numericKey:H[9],fillable:!1},{icon:Hf,value:`eraser`,key:H.E,numericKey:H[0],fillable:!1}],Rg=e=>Lg.find((t,n)=>t.numericKey!=null&&e===t.numericKey.toString()||t.key&&(typeof t.key==`string`?t.key===e:t.key.includes(e)))?.value||null,zg=(e,t)=>{switch(e.type){case`rectangle`:case`diamond`:case`frame`:case`magicframe`:case`embeddable`:case`image`:case`iframe`:case`text`:case`selection`:return Zh(e);case`arrow`:case`line`:{let n=Sf.get(e)?.[0]??Sf.generateElementShape(e,null)[0],[,,,,r,i]=av(e,t);return bg(e)?ig(e,n,P(e.x,e.y),e.angle,P(r,i)):tg(n,P(e.x,e.y),e.angle,P(r,i))}case`ellipse`:return $h(e);case`freedraw`:{let[,,,,n,r]=av(e,t);return rg(e,P(n,r),bg(e))}}},Bg=(e,t)=>{let n=zb(e,t);return n?e.type===`arrow`?zg({...n,...U.getBoundTextElementPosition(e,n,t)},t):zg(n,t):null},Vg=(e,t)=>{let n=Sf.generateElementShape(e,null);if(!n)return null;let r=eg(n[0]),i=P(0,0),a=0,o=1/0,s=null;for(;a<r.length;){let{op:e,data:n}=r[a];if(e===`move`&&(Yu(xl(n),`The returned ops is not compatible with a point`),i=n),e===`bcurveTo`){let e=i,r=P(n[0],n[1]),a=P(n[2],n[3]),c=P(n[4],n[5]),l=Tl(c,t);l<o&&(o=l,s=[e,r,a,c]),i=c}a++}return s},Hg=(e,t,n,r,i)=>{let a=(i,a)=>(1-i)**3*r[a]+3*i*(1-i)**2*n[a]+3*i**2*(1-i)*t[a]+e[a]*i**3;return P(a(i,0),a(i,1))},Ug=(e,t)=>{let n=Vg(e,t);if(!n)return[];let r=[],i=1;for(;i>0;){let e=Hg(n[0],n[1],n[2],n[3],i);r.push(P(e[0],e[1])),i-=.05}return r.length&&Sl(r.at(-1),t)&&r.push(P(t[0],t[1])),r},Wg=(e,t)=>{let n=[];n[0]=0;let r=Ug(e,t),i=0,a=0;for(;i<r.length-1;){let e=Tl(r[i],r[i+1]);a+=e,n.push(a),i++}return n},Gg=(e,t)=>Wg(e,t).at(-1),Kg=(e,t,n)=>{let r=Wg(e,t),i=r.length-1,a=n*r.at(-1),o=0,s=i,c=0;for(;o<s;)c=Math.floor(o+(s-o)/2),r[c]<a?o=c+1:s=c;return r[c]>a&&c--,r[c]===a?c/i:1-(c+(a-r[c])/(r[c+1]-r[c]))/i},qg=(e,t)=>{let n={minX:e.x,minY:e.y,maxX:e.x+e.width,maxY:e.y+e.height,midX:e.x+e.width/2,midY:e.y+e.height/2},r=P(n.midX,n.midY),[i,a]=F(P(n.minX,n.minY),r,e.angle),[o,s]=F(P(n.maxX,n.minY),r,e.angle),[c,l]=F(P(n.maxX,n.maxY),r,e.angle),[u,d]=F(P(n.minX,n.maxY),r,e.angle),f=[Math.min(i,o,c,u),Math.min(a,s,l,d),Math.max(i,o,c,u),Math.max(a,s,l,d)];if(t){let[e,n,r,i]=t;return[f[0]-i,f[1]-e,f[2]+n,f[3]+r]}return f},Jg=(e,t)=>e[0]>t[0]&&e[0]<t[2]&&e[1]>t[1]&&e[1]<t[3],Yg=(e,t)=>{if(t.roundness?.type===jc.PROPORTIONAL_RADIUS||t.roundness?.type===jc.LEGACY)return e*kc;if(t.roundness?.type===jc.ADAPTIVE_RADIUS){let n=t.roundness?.value??Ac;return e<=n/kc?e*kc:n}return 0},Xg=(e,t=1)=>{if(e.length>=3){let[n,r]=[e[0],e[e.length-1]];return Tl(n,r)<=8/t}return!1},Zg=(e,t,n,r,i,a,o)=>{let{width:s,height:c}=e_(e),l=n/s,u=r/c,d=(e.crop?.x??0)/l,f=(e.crop?.y??0)/u,p=F(P(i,a),P(e.x+e.width/2,e.y+e.height/2),-e.angle);i=p[0],a=p[1];let m=e.width,h=e.height,g=e.crop??{x:0,y:0,width:n,height:r,naturalWidth:n,naturalHeight:r},_=g.height,v=g.width,y=e.scale[0]===-1,b=e.scale[1]===-1,x=a-e.y,S=i-e.x;t.includes(`n`)&&(h=el(e.height-x,10,b?c-f:e.height+f)),t.includes(`s`)&&(x=a-e.y-e.height,h=el(e.height+x,10,b?e.height+f:c-f)),t.includes(`e`)&&(S=i-e.x-e.width,m=el(e.width+S,10,y?e.width+d:s-d)),t.includes(`w`)&&(m=el(e.width-S,10,y?s-d:e.width+d));let C=e=>{e.height=h*u,e.width=m*l};C(g);let w=(e,t)=>{C(t),e.includes(`n`)&&(b||(t.y+=_-t.height)),e.includes(`s`)&&b&&(t.y+=_-t.height),e.includes(`e`)&&y&&(t.x+=v-t.width),e.includes(`w`)&&(y||(t.x+=v-t.width))};switch(t){case`n`:if(o){let t=d+e.width/2,n=s-d-e.width/2,r=Math.min(t,n)*2;m=el(h*o,10,r),h=m/o}w(t,g),o&&(g.x+=(v-g.width)/2);break;case`s`:if(o){let t=d+e.width/2,n=s-d-e.width/2,r=Math.min(t,n)*2;m=el(h*o,10,r),h=m/o}w(t,g),o&&(g.x+=(v-g.width)/2);break;case`w`:if(o){let t=f+e.height/2,n=c-f-e.height/2,r=Math.min(t,n)*2;h=el(m/o,10,r),m=h*o}w(t,g),o&&(g.y+=(_-g.height)/2);break;case`e`:if(o){let t=f+e.height/2,n=c-f-e.height/2,r=Math.min(t,n)*2;h=el(m/o,10,r),m=h*o}w(t,g),o&&(g.y+=(_-g.height)/2);break;case`ne`:if(o){if(S>-x){let t=b?c-f:f+e.height;h=el(m/o,10,t),m=h*o}else{let t=y?d+e.width:s-d;m=el(h*o,10,t),h=m/o}}w(t,g);break;case`nw`:if(o){if(S<x){let t=b?c-f:f+e.height;h=el(m/o,10,t),m=h*o}else{let t=y?s-d:d+e.width;m=el(h*o,10,t),h=m/o}}w(t,g);break;case`se`:if(o){if(S>x){let t=b?f+e.height:c-f;h=el(m/o,10,t),m=h*o}else{let t=y?d+e.width:s-d;m=el(h*o,10,t),h=m/o}}w(t,g);break;case`sw`:if(o){if(-S>x){let t=b?f+e.height:c-f;h=el(m/o,10,t),m=h*o}else{let t=y?s-d:d+e.width;m=el(h*o,10,t),h=m/o}}w(t,g)}let T=Qg(e,t,m,h,!!o);return al(g.width,g.naturalWidth)&&al(g.height,g.naturalHeight)&&(g=null),{x:T[0],y:T[1],width:m,height:h,crop:g}},Qg=(e,t,n,r,i)=>{let[a,o,s,c]=Sv(e,e.width,e.height,!0),l=P(a,o),u=P(s,c),d=wl(l,u),[f,p,m,h]=Sv(e,n,r,!0),g=m-f,_=h-p,v=[...l];if([`n`,`w`,`nw`].includes(t)&&(v=[u[0]-Math.abs(g),u[1]-Math.abs(_)]),t===`ne`){let e=[l[0],u[1]];v=[e[0],e[1]-Math.abs(_)]}if(t===`sw`){let e=[u[0],l[1]];v=[e[0]-Math.abs(g),e[1]]}i&&([`s`,`n`].includes(t)&&(v[0]=d[0]-g/2),[`e`,`w`].includes(t)&&(v[1]=d[1]-_/2));let y=e.angle;v=F(F(v,d,y),F([v[0]+Math.abs(g)/2,v[1]+Math.abs(_)/2],d,y),-y);let b=[...v];return b[0]+=e.x-f,b[1]+=e.y-p,b},$g=(e,t)=>{if(e.crop){let{width:n,height:r}=e_(e),[i,a,o,s,c,l]=av(e,t),u=N(F(P(i,a),P(c,l),e.angle)),d=vl(ml(N(F(P(o,a),P(c,l),e.angle)),u)),f=vl(ml(N(F(P(i,s),P(c,l),e.angle)),u)),{cropX:p,cropY:m}=t_(e.crop,e.scale),h=pl(pl(u,hl(d,-p*n/e.crop.naturalWidth)),hl(f,-m*r/e.crop.naturalHeight)),g=bl(pl(pl(h,hl(d,n/2)),hl(f,r/2))),_=F(bl(h),g,-e.angle);return{...e,x:_[0],y:_[1],width:n,height:r,crop:null}}return e},e_=e=>e.crop?{width:e.width/(e.crop.width/e.crop.naturalWidth),height:e.height/(e.crop.height/e.crop.naturalHeight)}:{width:e.width,height:e.height},t_=(e,t)=>{let n=e.x,r=e.y,i=t[0]===-1,a=t[1]===-1;return i&&(n=e.naturalWidth-Math.abs(n)-e.width),a&&(r=e.naturalHeight-Math.abs(r)-e.height),{cropX:n,cropY:r}},n_=(e,t=!1)=>{let n=e.crop;if(!n)return null;let r=e.scale[0]===-1,i=e.scale[1]===-1,a=n.x,o=n.y;if(r&&(a=n.naturalWidth-n.width-n.x),i&&(o=n.naturalHeight-n.height-n.y),t)return{x:a,y:o};let{width:s,height:c}=e_(e);return{x:a/(n.naturalWidth/s),y:o/(n.naturalHeight/c)}},r_=`invert(100%) hue-rotate(180deg) saturate(1.25)`,i_=qc(),a_=(e,t)=>ld(e)&&!t.imageCache.has(e.fileId),o_=(e,t,n)=>n.theme===Qs.DARK&&ld(e)&&!a_(e,t)&&t.imageCache.get(e.fileId)?.mimeType!==j.svg,s_=e=>{switch(e.type){case`freedraw`:return e.strokeWidth*12;case`text`:return e.fontSize/2;default:return 20}},c_=(e,t,n,r,i=1)=>{let a=(t?.opacity??100)*e.opacity/1e4*i;return(n.has(e.id)||r&&r.some(t=>t.id===e.id)||t&&n.has(t.id))&&(a*=Oc/100),a},l_=(e,t,n)=>{let r=s_(e),[i,a,o,s]=av(e,t),c=yd(e)||_d(e)?hu(i,o):e.width,l=yd(e)||_d(e)?hu(a,s):e.height,u=c*window.devicePixelRatio+r*2,d=l*window.devicePixelRatio+r*2,f=n.value;return(u*f>32767||d*f>32767)&&(f=Math.min(32767/u,32767/d)),u*d*f*f>16777216&&(f=Math.sqrt(16777216/(u*d))),u=Math.floor(u*f),d=Math.floor(d*f),{width:u,height:d,scale:f}},u_=(e,t,n,r,i)=>{let a=document.createElement(`canvas`),o=a.getContext(`2d`),s=s_(e),{width:c,height:l,scale:u}=l_(e,t,n);if(!c||!l)return null;a.width=c,a.height=l;let d=-100,f=0;if(yd(e)||_d(e)){let[n,r]=av(e,t);d=e.x>n?hu(e.x,n)*window.devicePixelRatio*u:0,f=e.y>r?hu(e.y,r)*window.devicePixelRatio*u:0,o.translate(d,f)}o.save(),o.translate(s*u,s*u),o.scale(window.devicePixelRatio*u,window.devicePixelRatio*u);let p=go.canvas(a);o_(e,r,i)&&(o.filter=r_),h_(e,p,o,r,i),o.restore();let m=zb(e,t),h=document.createElement(`canvas`),g=h.getContext(`2d`);if(bd(e)&&m){let[n,r,i,o]=av(e,t),c=Math.max(hu(n,i),hu(r,o));h.width=c*window.devicePixelRatio*u+s*u*10,h.height=c*window.devicePixelRatio*u+s*u*10,g.translate(h.width/2,h.height/2),g.rotate(e.angle),g.drawImage(a,-a.width/2,-a.height/2,a.width,a.height);let[,,,,l,d]=av(m,t);g.rotate(-e.angle);let f=(h.width-a.width)/2,p=(h.height-a.height)/2,_=h.width/2-(l-n)*window.devicePixelRatio*u-f-s*u,v=h.height/2-(d-r)*window.devicePixelRatio*u-p-s*u;g.translate(-_,-v),g.clearRect(-(m.width/2+5)*window.devicePixelRatio*u,-(m.height/2+5)*window.devicePixelRatio*u,(m.width+10)*window.devicePixelRatio*u,(m.height+10)*window.devicePixelRatio*u)}return{element:e,canvas:a,theme:i.theme,scale:u,zoomValue:n.value,canvasOffsetX:d,canvasOffsetY:f,boundTextElementVersion:zb(e,t)?.version||null,containingFrameOpacity:AT(e,t)?.opacity||100,boundTextCanvas:h,angle:e.angle,imageCrop:ud(e)?e.crop:null}},d_=14,f_=document.createElement(`img`);f_.src=`data:${j.svg},%3Csvg%20aria-hidden%3D%22true%22%20focusable%3D%22false%22%20data-prefix%3D%22fas%22%20data-icon%3D%22image%22%20class%3D%22svg-inline--fa%20fa-image%20fa-w-16%22%20role%3D%22img%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20512%20512%22%3E%3Cpath%20fill%3D%22%23888%22%20d%3D%22M464%20448H48c-26.51%200-48-21.49-48-48V112c0-26.51%2021.49-48%2048-48h416c26.51%200%2048%2021.49%2048%2048v288c0%2026.51-21.49%2048-48%2048zM112%20120c-30.928%200-56%2025.072-56%2056s25.072%2056%2056%2056%2056-25.072%2056-56-25.072-56-56-56zM64%20384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971%200L208%20320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971%200L64%20336v48z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E`;var p_=document.createElement(`img`);p_.src=`data:${j.svg},%3Csvg%20viewBox%3D%220%200%20668%20668%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xml%3Aspace%3D%22preserve%22%20style%3D%22fill-rule%3Aevenodd%3Bclip-rule%3Aevenodd%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A2%22%3E%3Cpath%20d%3D%22M464%20448H48c-26.51%200-48-21.49-48-48V112c0-26.51%2021.49-48%2048-48h416c26.51%200%2048%2021.49%2048%2048v288c0%2026.51-21.49%2048-48%2048ZM112%20120c-30.928%200-56%2025.072-56%2056s25.072%2056%2056%2056%2056-25.072%2056-56-25.072-56-56-56ZM64%20384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971%200L208%20320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971%200L64%20336v48Z%22%20style%3D%22fill%3A%23888%3Bfill-rule%3Anonzero%22%20transform%3D%22matrix(.81709%200%200%20.81709%20124.825%20145.825)%22%2F%3E%3Cpath%20d%3D%22M256%208C119.034%208%208%20119.033%208%20256c0%20136.967%20111.034%20248%20248%20248s248-111.034%20248-248S392.967%208%20256%208Zm130.108%20117.892c65.448%2065.448%2070%20165.481%2020.677%20235.637L150.47%20105.216c70.204-49.356%20170.226-44.735%20235.638%2020.676ZM125.892%20386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53%20406.784c-70.203%2049.356-170.226%2044.736-235.638-20.676Z%22%20style%3D%22fill%3A%23888%3Bfill-rule%3Anonzero%22%20transform%3D%22matrix(.30366%200%200%20.30366%20506.822%2060.065)%22%2F%3E%3C%2Fsvg%3E`;var m_=(e,t)=>{t.fillStyle=`#E7E7E7`,t.fillRect(0,0,e.width,e.height);let n=Math.min(e.width,e.height),r=Math.min(n,Math.min(n*.4,100));t.drawImage(e.status===`error`?p_:f_,e.width/2-r/2,e.height/2-r/2,r,r)},h_=(e,t,n,r,i)=>{switch(e.type){case`rectangle`:case`iframe`:case`embeddable`:case`diamond`:case`ellipse`:n.lineJoin=`round`,n.lineCap=`round`,t.draw(Sf.get(e));break;case`arrow`:case`line`:n.lineJoin=`round`,n.lineCap=`round`,Sf.get(e).forEach(e=>{t.draw(e)});break;case`freedraw`:{n.save(),n.fillStyle=e.strokeColor;let r=C_(e),i=Sf.get(e);i&&t.draw(i),n.fillStyle=e.strokeColor,n.fill(r),n.restore();break}case`image`:{let t=ld(e)?r.imageCache.get(e.fileId)?.image:void 0;if(t!=null&&!(t instanceof Promise)){e.roundness&&n.roundRect&&(n.beginPath(),n.roundRect(0,0,e.width,e.height,Yg(Math.min(e.width,e.height),e)),n.clip());let{x:r,y:i,width:a,height:o}=e.crop?e.crop:{x:0,y:0,width:t.naturalWidth,height:t.naturalHeight};n.drawImage(t,r,i,a,o,0,0,e.width,e.height)}else m_(e,n);break}default:if(R(e)){let t=xu(e.text),r=t&&!n.canvas.isConnected;r&&document.body.appendChild(n.canvas),n.canvas.setAttribute(`dir`,t?`rtl`:`ltr`),n.save(),n.font=cu(e),n.fillStyle=e.strokeColor,n.textAlign=e.textAlign;let i=e.text.replace(/\r\n?/g,`
|
|
23
|
+
`).split(`
|
|
24
|
+
`),a=e.textAlign===`center`?e.width/2:e.textAlign===`right`?e.width:0,o=Wd(e.fontSize,e.lineHeight),s=Yh(e.fontFamily,e.fontSize,o);for(let e=0;e<i.length;e++)n.fillText(i[e],a,e*o+s);n.restore(),r&&n.canvas.remove()}else throw Error(`Unimplemented type ${e.type}`)}},g_=new WeakMap,__=(e,t,n,r)=>{let i=n?r.zoom:i_.zoom,a=g_.get(e),o=a&&a.zoomValue!==i.value&&!r?.shouldCacheIgnoreZoom,s=zb(e,t),c=s?.version||null,l=ud(e)?e.crop:null,u=AT(e,t)?.opacity||100;if(!a||o||a.theme!==r.theme||a.boundTextElementVersion!==c||a.imageCrop!==l||a.containingFrameOpacity!==u||bd(e)&&s&&e.angle!==a.angle){let a=u_(e,t,i,n,r);return a?(g_.set(e,a),a):null}return a},v_=(e,t,n,r,i)=>{let a=e.element,o=s_(a),s=e.scale,[c,l,u,d]=av(a,i),p=((c+u)/2+r.scrollX)*window.devicePixelRatio,m=((l+d)/2+r.scrollY)*window.devicePixelRatio;t.save(),t.scale(1/window.devicePixelRatio,1/window.devicePixelRatio);let h=zb(a,i);if(bd(a)&&h){let n=(e.boundTextCanvas.width-e.canvas.width)/2,r=(e.boundTextCanvas.height-e.canvas.height)/2;t.translate(p,m),t.drawImage(e.boundTextCanvas,-(u-c)/2*window.devicePixelRatio-n/s-o,-(d-l)/2*window.devicePixelRatio-r/s-o,e.boundTextCanvas.width/s,e.boundTextCanvas.height/s)}else if(t.translate(p,m),t.rotate(a.angle),`scale`in e.element&&!a_(a,n)&&t.scale(e.element.scale[0],e.element.scale[1]),t.translate(-p,-m),t.drawImage(e.canvas,(c+r.scrollX)*window.devicePixelRatio-o*e.scale/e.scale,(l+r.scrollY)*window.devicePixelRatio-o*e.scale/e.scale,e.canvas.width/e.scale,e.canvas.height/e.scale),f.VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX===`true`&&kd(a)){let e=zb(a,i),n=Hb(a);t.strokeStyle=`#c92a2a`,t.lineWidth=3,t.strokeRect((n.x+r.scrollX)*window.devicePixelRatio,(n.y+r.scrollY)*window.devicePixelRatio,Yb(a,e)*window.devicePixelRatio,Xb(a,e)*window.devicePixelRatio)}t.restore()},y_=(e,t,n,r)=>{t.save(),t.translate(e.x+n.scrollX,e.y+n.scrollY),t.fillStyle=`rgba(0, 0, 200, 0.04)`;let i=.5/n.zoom.value;t.fillRect(i,i,e.width,e.height),t.lineWidth=1/n.zoom.value,t.strokeStyle=r,t.strokeRect(i,i,e.width,e.height),t.restore()},b_=(e,t,n,r,i,a,o)=>{let s=o.openDialog?.name===`elementLinkSelector`&&!o.selectedElementIds[e.id]&&!o.hoveredElementIds[e.id];switch(i.globalAlpha=c_(e,AT(e,t),a.elementsPendingErasure,a.pendingFlowchartNodes,s?Hc:1),e.type){case`magicframe`:case`frame`:o.frameRendering.enabled&&o.frameRendering.outline&&(i.save(),i.translate(e.x+o.scrollX,e.y+o.scrollY),i.fillStyle=`rgba(0, 0, 200, 0.04)`,i.lineWidth=$s.strokeWidth/o.zoom.value,i.strokeStyle=$s.strokeColor,hd(e)&&(i.strokeStyle=o.theme===Qs.LIGHT?`#7affd7`:`#1d8264`),$s.radius&&i.roundRect?(i.beginPath(),i.roundRect(0,0,e.width,e.height,$s.radius/o.zoom.value),i.stroke(),i.closePath()):i.strokeRect(0,0,e.width,e.height),i.restore());break;case`freedraw`:if(Sf.generateElementShape(e,null),a.isExporting){let[n,s,c,l]=av(e,t),u=(n+c)/2+o.scrollX,d=(s+l)/2+o.scrollY,f=(c-n)/2-(e.x-n),p=(l-s)/2-(e.y-s);i.save(),i.translate(u,d),i.rotate(e.angle),i.translate(-f,-p),h_(e,r,i,a,o),i.restore()}else{let t=__(e,n,a,o);if(!t)return;v_(t,i,a,o,n)}break;case`rectangle`:case`diamond`:case`ellipse`:case`line`:case`arrow`:case`image`:case`text`:case`iframe`:case`embeddable`:if(Sf.generateElementShape(e,a),a.isExporting){let[n,s,c,l]=av(e,t),u=(n+c)/2+o.scrollX,d=(s+l)/2+o.scrollY,f=(c-n)/2-(e.x-n),p=(l-s)/2-(e.y-s);if(R(e)){let r=Bb(e,t);if(bd(r)){let i=U.getBoundTextElementPosition(r,e,t);f=(c-n)/2-(i.x-n),p=(l-s)/2-(i.y-s)}}i.save(),i.translate(u,d),o_(e,a,o)&&(i.filter=`none`);let m=zb(e,t);if(bd(e)&&m){let r=document.createElement(`canvas`),u=r.getContext(`2d`),d=Math.max(hu(n,c),hu(s,l)),h=s_(e);r.width=d*o.exportScale+h*10*o.exportScale,r.height=d*o.exportScale+h*10*o.exportScale,u.translate(r.width/2,r.height/2),u.scale(o.exportScale,o.exportScale),f=e.width/2-(e.x-n),p=e.height/2-(e.y-s),u.rotate(e.angle);let g=go.canvas(r);u.translate(-f,-p),h_(e,g,u,a,o),u.translate(f,p),u.rotate(-e.angle);let[,,,,_,v]=av(m,t),y=(n+c)/2-_,b=(s+l)/2-v;u.translate(-y,-b),u.clearRect(-m.width/2,-m.height/2,m.width,m.height),i.scale(1/o.exportScale,1/o.exportScale),i.drawImage(r,-r.width/2,-r.height/2,r.width,r.height)}else i.rotate(e.angle),e.type===`image`&&i.scale(e.scale[0],e.scale[1]),i.translate(-f,-p),h_(e,r,i,a,o);i.restore()}else{let r=__(e,n,a,o);if(!r)return;let s=i.imageSmoothingEnabled;if(!o?.shouldCacheIgnoreZoom&&(!e.angle||ll(e.angle))&&(i.imageSmoothingEnabled=!1),e.id===o.croppingElementId&&ud(r.element)&&r.element.crop!==null){i.save(),i.globalAlpha=.1;let e=u_($g(r.element,t),n,o.zoom,a,o);e&&v_(e,i,a,o,n),i.restore()}v_(r,i,a,o,n),i.imageSmoothingEnabled=s}break;default:throw Error(`Unimplemented type ${e.type}`)}i.globalAlpha=1},x_=new WeakMap([]);function S_(e){let t=w_(e),n=new Path2D(t);return x_.set(e,n),n}function C_(e){return x_.get(e)}function w_(e){return D_(Bo(e.simulatePressure?e.points:e.points.length?e.points.map(([t,n],r)=>[t,n,e.pressures[r]]):[[0,0,.5]],{simulatePressure:e.simulatePressure,size:e.strokeWidth*4.25,thinning:.6,smoothing:.5,streamline:.5,easing:e=>Math.sin(e*Math.PI/2),last:!!e.lastCommittedPoint}))}function T_(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}var E_=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g;function D_(e){if(!e.length)return``;let t=e.length-1;return e.reduce((e,n,r,i)=>(r===t?e.push(n,T_(n,i[0]),`L`,i[0],`Z`):e.push(n,T_(n,i[r+1])),e),[`M`,e[0],`Q`]).join(` `).replace(E_,`$1`)}var O_=e=>e===`rectangle`||e===`iframe`||e===`embeddable`||e===`ellipse`||e===`diamond`||e===`line`||e===`freedraw`,k_=e=>e!==`image`&&e!==`frame`&&e!==`magicframe`,A_=e=>e===`rectangle`||e===`iframe`||e===`embeddable`||e===`ellipse`||e===`diamond`||e===`freedraw`||e===`arrow`||e===`line`,j_=e=>e===`rectangle`||e===`iframe`||e===`embeddable`||e===`ellipse`||e===`diamond`||e===`arrow`||e===`line`,M_=e=>e===`rectangle`||e===`iframe`||e===`embeddable`||e===`line`||e===`diamond`||e===`image`,N_=e=>e===`arrow`,P_=e=>e===`arrow`,F_=[1,0],I_=[0,1],L_=[-1,0],R_=[0,-1],z_=(e,t)=>{let n=cl(Math.atan2(t[1]-e[1],t[0]-e[0]));return n>=315||n<45?R_:n>=45&&n<135?F_:n>=135&&n<225?I_:L_},B_=e=>{let[t,n]=e,r=Math.abs(t),i=Math.abs(n);return t>i?F_:t<=-i?L_:n>r?I_:R_},V_=(e,t)=>B_(N(e,t)),H_=(e,t)=>W_(V_(e,t)),U_=(e,t)=>e[0]===t[0]&&e[1]===t[1],W_=e=>U_(e,F_)||U_(e,L_),G_=(e,t,n)=>{let r=Dv(t);if(e.type===`diamond`){if(n[0]<e.x)return L_;if(n[1]<e.y)return R_;if(n[0]>e.x+e.width)return F_;if(n[1]>e.y+e.height)return I_;let t=F(Dl(P(e.x+e.width/2,e.y),r,2),r,e.angle),i=F(Dl(P(e.x+e.width,e.y+e.height/2),r,2),r,e.angle),a=F(Dl(P(e.x+e.width/2,e.y+e.height),r,2),r,e.angle),o=F(Dl(P(e.x,e.y+e.height/2),r,2),r,e.angle);return eu([t,i,r],n)?z_(t,i):eu([i,a,r],n)?z_(i,a):eu([a,o,r],n)?z_(a,o):z_(o,t)}let i=Dl(P(t[0],t[1]),r,2),a=Dl(P(t[2],t[1]),r,2),o=Dl(P(t[0],t[3]),r,2),s=Dl(P(t[2],t[3]),r,2);return eu([i,a,r],n)?R_:eu([a,s,r],n)?F_:eu([s,o,r],n)?I_:L_},K_=e=>[e[0]===0?0:e[0]>0?-1:1,e[1]===0?0:e[1]>0?-1:1],q_=e=>[8,8+e],J_=e=>[1.5,6+e];function Y_(e){let t=e.roughness,n=Math.max(e.width,e.height),r=Math.min(e.width,e.height);return r>=20&&n>=50||r>=15&&e.roundness&&M_(e.type)||yd(e)&&n>=50?t:Math.min(t/(n<10?3:2),2.5)}var X_=(e,t=!1)=>{let n={seed:e.seed,strokeLineDash:e.strokeStyle===`dashed`?q_(e.strokeWidth):e.strokeStyle===`dotted`?J_(e.strokeWidth):void 0,disableMultiStroke:e.strokeStyle!==`solid`,strokeWidth:e.strokeStyle===`solid`?e.strokeWidth:e.strokeWidth+.5,fillWeight:e.strokeWidth/2,hachureGap:e.strokeWidth*4,roughness:Y_(e),stroke:e.strokeColor,preserveVertices:t||e.roughness<M.cartoonist};switch(e.type){case`rectangle`:case`iframe`:case`embeddable`:case`diamond`:case`ellipse`:return n.fillStyle=e.fillStyle,n.fill=Eu(e.backgroundColor)?void 0:e.backgroundColor,e.type===`ellipse`&&(n.curveFitting=1),n;case`line`:case`freedraw`:return Xg(e.points)&&(n.fillStyle=e.fillStyle,n.fill=e.backgroundColor===`transparent`?void 0:e.backgroundColor),n;case`arrow`:return n;default:throw Error(`Unimplemented type ${e.type}`)}},Z_=(e,t,n)=>pd(e)&&(t||dd(e)&&n?.get(e.id)!==!0)&&Eu(e.backgroundColor)&&Eu(e.strokeColor)?{...e,roughness:0,backgroundColor:`#d3d3d3`,fillStyle:`solid`}:fd(e)?{...e,strokeColor:Eu(e.strokeColor)?`#000000`:e.strokeColor,backgroundColor:Eu(e.backgroundColor)?`#f4f4f6`:e.backgroundColor}:e,Q_=(e,t,n,r,i,a,o)=>{let s=gv(e,t,n,r);if(s===null)return[];let c=(e,t)=>{if(e===null)return[];let[,,n,r,a,o]=e;return[i.line(n,r,a,o,t)]};switch(r){case`dot`:case`circle`:case`circle_outline`:{let[t,n,c]=s;return delete a.strokeLineDash,[i.circle(t,n,c,{...a,fill:r===`circle_outline`?o:e.strokeColor,fillStyle:`solid`,stroke:e.strokeColor,roughness:Math.min(.5,a.roughness||0)})]}case`triangle`:case`triangle_outline`:{let[t,n,c,l,u,d]=s;return delete a.strokeLineDash,[i.polygon([[t,n],[c,l],[u,d],[t,n]],{...a,fill:r===`triangle_outline`?o:e.strokeColor,fillStyle:`solid`,roughness:Math.min(1,a.roughness||0)})]}case`diamond`:case`diamond_outline`:{let[t,n,c,l,u,d,f,p]=s;return delete a.strokeLineDash,[i.polygon([[t,n],[c,l],[u,d],[f,p],[t,n]],{...a,fill:r===`diamond_outline`?o:e.strokeColor,fillStyle:`solid`,roughness:Math.min(1,a.roughness||0)})]}case`crowfoot_one`:return c(s,a);default:{let[o,l,u,d,f,p]=s;if(e.strokeStyle===`dotted`){let t=J_(e.strokeWidth-1);a.strokeLineDash=[t[0],t[1]-1]}else delete a.strokeLineDash;return a.roughness=Math.min(1,a.roughness||0),[i.line(u,d,o,l,a),i.line(f,p,o,l,a),...r===`crowfoot_one_or_many`?c(gv(e,t,n,`crowfoot_one`),a):[]]}}},$_=(e,t,{isExporting:n,canvasBackgroundColor:r,embedsValidationStatus:i})=>{switch(e.type){case`rectangle`:case`iframe`:case`embeddable`:{let r;if(e.roundness){let a=e.width,o=e.height,s=Yg(Math.min(a,o),e);r=t.path(`M ${s} 0 L ${a-s} 0 Q ${a} 0, ${a} ${s} L ${a} ${o-s} Q ${a} ${o}, ${a-s} ${o} L ${s} ${o} Q 0 ${o}, 0 ${o-s} L 0 ${s} Q 0 0, ${s} 0`,X_(Z_(e,n,i),!0))}else r=t.rectangle(0,0,e.width,e.height,X_(Z_(e,n,i),!1));return r}case`diamond`:{let n,[r,i,a,o,s,c,l,u]=sv(e);if(e.roundness){let d=Yg(Math.abs(r-l),e),f=Yg(Math.abs(o-i),e);n=t.path(`M ${r+d} ${i+f} L ${a-d} ${o-f}
|
|
25
|
+
C ${a} ${o}, ${a} ${o}, ${a-d} ${o+f}
|
|
26
|
+
L ${s+d} ${c-f}
|
|
27
|
+
C ${s} ${c}, ${s} ${c}, ${s-d} ${c-f}
|
|
28
|
+
L ${l+d} ${u+f}
|
|
29
|
+
C ${l} ${u}, ${l} ${u}, ${l+d} ${u-f}
|
|
30
|
+
L ${r-d} ${i+f}
|
|
31
|
+
C ${r} ${i}, ${r} ${i}, ${r+d} ${i+f}`,X_(e,!0))}else n=t.polygon([[r,i],[a,o],[s,c],[l,u]],X_(e));return n}case`ellipse`:return t.ellipse(e.width/2,e.height/2,e.width,e.height,X_(e));case`line`:case`arrow`:{let n,i=X_(e),a=e.points.length?e.points:[P(0,0)];if(z(e)?a.every(e=>Math.abs(e[0])<=1e6&&Math.abs(e[1])<=1e6)?n=[t.path(ev(a,16),X_(e,!0))]:(console.error(`Elbow arrow with extreme point positions detected. Arrow not rendered.`,e.id,JSON.stringify(a)),n=[]):n=e.roundness?[t.curve(a,i)]:i.fill?[t.polygon(a,i)]:[t.linearPath(a,i)],e.type===`arrow`){let{startArrowhead:a=null,endArrowhead:o=`arrow`}=e;if(a!==null){let o=Q_(e,n,`start`,a,t,i,r);n.push(...o)}if(o!==null){let a=Q_(e,n,`end`,o,t,i,r);n.push(...a)}}return n}case`freedraw`:{let n;if(S_(e),Xg(e.points)){let r=Yo(e.points,.75);n=t.curve(r,{...X_(e),stroke:`none`})}else n=null;return n}case`frame`:case`magicframe`:case`text`:case`image`:return null;default:return Ju(e,`generateElementShape(): Unimplemented type ${e?.type}`),null}},ev=(e,t)=>{let n=[];for(let r=1;r<e.length-1;r+=1){let i=e[r-1],a=e[r+1],o=e[r],s=H_(o,i),c=H_(a,o),l=Math.min(t,Tl(e[r],a)/2,Tl(e[r],i)/2);s?i[0]<o[0]?n.push([e[r][0]-l,e[r][1]]):n.push([e[r][0]+l,e[r][1]]):i[1]<o[1]?n.push([e[r][0],e[r][1]-l]):n.push([e[r][0],e[r][1]+l]),n.push(e[r]),c?a[0]<o[0]?n.push([e[r][0]-l,e[r][1]]):n.push([e[r][0]+l,e[r][1]]):a[1]<o[1]?n.push([e[r][0],e[r][1]-l]):n.push([e[r][0],e[r][1]+l])}let r=[`M ${e[0][0]} ${e[0][1]}`];for(let e=0;e<n.length;e+=3)r.push(`L ${n[e][0]} ${n[e][1]}`),r.push(`Q ${n[e+1][0]} ${n[e+1][1]}, ${n[e+2][0]} ${n[e+2][1]}`);return r.push(`L ${e[e.length-1][0]} ${e[e.length-1][1]}`),r.join(` `)},tv=e=>{let t=e.map(e=>e[0]),n=e.map(e=>e[1]);return{width:Math.max(...t)-Math.min(...t),height:Math.max(...n)-Math.min(...n)}},nv=(e,t,n,r)=>{let i=n.map(t=>t[e]),a=Math.max(...i),o=Math.min(...i),s=a-o,c=s===0?1:t/s,l=1/0,u=n.map(t=>{let n=t[e]*c,r=[...t];return r[e]=n,n<l&&(l=n),r});if(!r||u.length===2)return u;let d=o-l;return u.map(t=>t.map((t,n)=>n===e?t+d:t))},rv=class e{static getBounds(t,n){let r=e.boundsCache.get(t);if(r?.version&&r.version===t.version&&!Ad(t))return r.bounds;let i=e.calculateBounds(t,n);return e.boundsCache.set(t,{version:t.version,bounds:i}),i}static calculateBounds(e,t){let n,[r,i,a,o,s,c]=av(e,t);if(_d(e)){let[t,n,r,i]=fv(e.points.map(([t,n])=>F(P(t,n),P(s-e.x,c-e.y),e.angle)));return[t+e.x,n+e.y,r+e.x,i+e.y]}if(yd(e))n=vv(e,s,c,t);else if(e.type===`diamond`){let[t,l]=F(P(s,i),P(s,c),e.angle),[u,d]=F(P(s,o),P(s,c),e.angle),[f,p]=F(P(r,c),P(s,c),e.angle),[m,h]=F(P(a,c),P(s,c),e.angle);n=[Math.min(t,u,f,m),Math.min(l,d,p,h),Math.max(t,u,f,m),Math.max(l,d,p,h)]}else if(e.type===`ellipse`){let t=(a-r)/2,l=(o-i)/2,u=Math.cos(e.angle),d=Math.sin(e.angle),f=Math.hypot(t*u,l*d),p=Math.hypot(l*u,t*d);n=[s-f,c-p,s+f,c+p]}else{let[t,l]=F(P(r,i),P(s,c),e.angle),[u,d]=F(P(r,o),P(s,c),e.angle),[f,p]=F(P(a,o),P(s,c),e.angle),[m,h]=F(P(a,i),P(s,c),e.angle);n=[Math.min(t,u,f,m),Math.min(l,d,p,h),Math.max(t,u,f,m),Math.max(l,d,p,h)]}return n}};v(rv,`boundsCache`,new WeakMap);var iv=rv,av=(e,t,n=!1)=>{if(_d(e))return pv(e);if(yd(e))return U.getElementAbsoluteCoords(e,t,n);if(R(e)){let n=t?Bb(e,t):null;if(bd(n)){let{x:r,y:i}=U.getBoundTextElementPosition(n,e,t);return[r,i,r+e.width,i+e.height,r+e.width/2,i+e.height/2]}}return[e.x,e.y,e.x+e.width,e.y+e.height,e.x+e.width/2,e.y+e.height/2]},ov=(e,t)=>{let[n,r,i,a,o,s]=av(e,t),c=P(o,s);if(yd(e)||_d(e)){let t=[],n=0;for(;n<e.points.length-1;)t.push(I(F(P(e.points[n][0]+e.x,e.points[n][1]+e.y),c,e.angle),F(P(e.points[n+1][0]+e.x,e.points[n+1][1]+e.y),c,e.angle))),n++;return t}let[l,u,d,f,p,m,h,g]=[[n,r],[i,r],[n,a],[i,a],[o,r],[o,a],[n,s],[i,s]].map(t=>F(t,c,e.angle));return e.type===`diamond`?[I(p,h),I(p,g),I(m,h),I(m,g)]:e.type===`ellipse`?[I(p,h),I(p,g),I(m,h),I(m,g),I(p,h),I(p,g),I(m,h),I(m,g)]:[I(l,u),I(d,f),I(l,d),I(u,f),I(l,g),I(d,g),I(u,h),I(f,h)]},sv=e=>{let t=Math.floor(e.width/2)+1,n=e.width,r=Math.floor(e.height/2)+1;return[t,0,n,r,t,e.height,0,r]},cv=(e,t,n,r,i)=>{let a=1-e;return a**3*t+3*a**2*e*n+3*a*e**2*r+e**3*i},lv=(e,t,n,r)=>{let i=t-e,a=n-t,o=r-n,s=3*i-6*a+3*o,c=6*a-6*i,l=3*i,u=c*c-4*s*l;if(!(u>=0))return!1;let d=null,f=null,p=1/0,m=1/0;return s===0?p=m=-l/c:(p=(-c+Math.sqrt(u))/(2*s),m=(-c-Math.sqrt(u))/(2*s)),p>=0&&p<=1&&(d=cv(p,e,t,n,r)),m>=0&&m<=1&&(f=cv(m,e,t,n,r)),[d,f]},uv=(e,t,n,r)=>{let i=lv(e[0],t[0],n[0],r[0]),a=lv(e[1],t[1],n[1],r[1]),o=Math.min(e[0],r[0]),s=Math.max(e[0],r[0]);if(i){let e=i.filter(e=>e!==null);o=Math.min(o,...e),s=Math.max(s,...e)}let c=Math.min(e[1],r[1]),l=Math.max(e[1],r[1]);if(a){let e=a.filter(e=>e!==null);c=Math.min(c,...e),l=Math.max(l,...e)}return[o,c,s,l]},dv=(e,t)=>{let n=P(0,0),{minX:r,minY:i,maxX:a,maxY:o}=e.reduce((e,{op:r,data:i})=>{if(r===`move`){let e=yl(i);Yu(e!=null,`Op data is not a point`),n=e}else if(r===`bcurveTo`){let r=P(i[0],i[1]),a=P(i[2],i[3]),o=P(i[4],i[5]),s=t?t(r):r,c=t?t(a):a,l=t?t(o):o,u=t?t(n):n;n=o;let[d,f,p,m]=uv(u,s,c,l);e.minX=Math.min(e.minX,d),e.minY=Math.min(e.minY,f),e.maxX=Math.max(e.maxX,p),e.maxY=Math.max(e.maxY,m)}return e},{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[r,i,a,o]},fv=e=>{let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let[a,o]of e)t=Math.min(t,a),n=Math.min(n,o),r=Math.max(r,a),i=Math.max(i,o);return[t,n,r,i]},pv=e=>{let[t,n,r,i]=fv(e.points),a=t+e.x,o=n+e.y,s=r+e.x,c=i+e.y;return[a,o,s,c,(a+s)/2,(o+c)/2]},mv=e=>{switch(e){case`arrow`:return 25;case`diamond`:case`diamond_outline`:return 12;case`crowfoot_many`:case`crowfoot_one`:case`crowfoot_one_or_many`:return 20;default:return 15}},hv=e=>{switch(e){case`bar`:return 90;case`arrow`:return 20;default:return 25}},gv=(e,t,n,r)=>{if(t.length<1)return null;let i=eg(t[0]);if(i.length<1)return null;let a=n===`start`?1:i.length-1,o=i[a].data;Yu(o.length===6,`Op data length is not 6`);let s=P(o[4],o[5]),c=P(o[2],o[3]),l=P(o[0],o[1]),u=i[a-1],d=P(0,0);if(u.op===`move`){let e=yl(u.data);Yu(e!=null,`Op data is not a point`),d=e}else u.op===`bcurveTo`&&(d=P(u.data[4],u.data[5]));let f=(e,t)=>(1-e)**3*s[t]+3*e*(1-e)**2*c[t]+3*e**2*(1-e)*l[t]+d[t]*e**3,[p,m]=n===`start`?d:s,[h,g]=[f(.3,0),f(.3,1)],_=Math.hypot(p-h,m-g),v=(p-h)/_,y=(m-g)/_,b=mv(r),x=0;{let[t,r]=n===`end`?e.points[e.points.length-1]:e.points[0],[i,a]=e.points.length>1?n===`end`?e.points[e.points.length-2]:e.points[1]:[0,0];x=Math.hypot(t-i,r-a)}let S=Math.min(b,x*(r===`diamond`||r===`diamond_outline`?.25:.5)),C=p-v*S,w=m-y*S;if(r===`dot`||r===`circle`||r===`circle_outline`)return[p,m,Math.hypot(w-m,C-p)+e.strokeWidth-2];let T=hv(r);if(r===`crowfoot_many`||r===`crowfoot_one_or_many`){let[e,t]=F(P(p,m),P(C,w),sl(-T)),[n,r]=F(P(p,m),P(C,w),sl(T));return[C,w,e,t,n,r]}let[E,D]=F(P(C,w),P(p,m),-T*Math.PI/180),[ee,te]=F(P(C,w),P(p,m),sl(T));if(r===`diamond`||r===`diamond_outline`){let t,r;if(n===`start`){let[n,i]=e.points.length>1?e.points[1]:[0,0];[t,r]=F(P(p+S*2,m),P(p,m),Math.atan2(i-m,n-p))}else{let[n,i]=e.points.length>1?e.points[e.points.length-2]:[0,0];[t,r]=F(P(p-S*2,m),P(p,m),Math.atan2(m-i,p-n))}return[p,m,E,D,t,r,ee,te]}return[p,m,E,D,ee,te]},_v=e=>{let t=go.generator(),n=X_(e);return t[e.roundness?`curve`:n.fill?`polygon`:`linearPath`](e.points,n)},vv=(e,t,n,r)=>{let i=zb(e,r);if(e.points.length<2){let[a,o]=e.points[0],[s,c]=F(P(e.x+a,e.y+o),P(t,n),e.angle),l=[s,c,s,c];if(i){let t=U.getMinMaxXYWithBoundText(e,r,[s,c,s,c],i);l=[t[0],t[1],t[2],t[3]]}return l}let a=dv(eg(Sf.get(e)?.[0]??_v(e)),([r,i])=>F(P(e.x+r,e.y+i),P(t,n),e.angle)),o=[a[0],a[1],a[2],a[3]];if(i){let t=U.getMinMaxXYWithBoundText(e,r,o,i);o=[t[0],t[1],t[2],t[3]]}return o},yv=(e,t)=>iv.getBounds(e,t),bv=(e,t)=>{if(!e.length)return[0,0,0,0];let n=1/0,r=-1/0,i=1/0,a=-1/0,o=t||Nu(e);return e.forEach(e=>{let[t,s,c,l]=yv(e,o);n=Math.min(n,t),i=Math.min(i,s),r=Math.max(r,c),a=Math.max(a,l)}),[n,i,r,a]},xv=(e,t)=>{let[n,r,i,a]=bv(e);return[n+t.x,r+t.y,i+t.x,a+t.y]},Sv=(e,t,n,r)=>{if(!(yd(e)||_d(e)))return[e.x,e.y,e.x+t,e.y+n];let i=nv(0,t,nv(1,n,e.points,r),r),a;if(_d(e))a=fv(i);else{let t=go.generator();a=dv(eg(e.roundness?t.curve(i,X_(e)):t.linearPath(i,X_(e))))}let[o,s,c,l]=a;return[o+e.x,s+e.y,c+e.x,l+e.y]},Cv=(e,t)=>{let n=go.generator(),[r,i,a,o]=dv(eg(e.roundness==null?n.linearPath(t,X_(e)):n.curve(t,X_(e))));return[r+e.x,i+e.y,a+e.x,o+e.y]},wv=(e,t)=>{if(!e.length)return[0,0,0,0];let n=1/0,r=e[0],i=Nu(e);return e.forEach(e=>{let[a,o,s,c]=yv(e,i),l=Tl(P((a+s)/2,(o+c)/2),P(t.x,t.y));l<n&&(n=l,r=e)}),yv(r,i)},Tv=e=>{let[t,n,r,i]=bv(e);return{minX:t,minY:n,maxX:r,maxY:i,width:r-t,height:i-n,midX:(t+r)/2,midY:(n+i)/2}},Ev=({scrollX:e,scrollY:t,width:n,height:r,zoom:i})=>[-e,-t,-e+n/i.value,-t+r/i.value],Dv=e=>P(e[0]+(e[2]-e[0])/2,e[1]+(e[3]-e[1])/2),Ov=(e,t)=>{if(e==null||t==null)return!1;let[n,r,i,a]=e,[o,s,c,l]=t;return n<c&&i>o&&r<l&&a>s},kv=(e,t)=>{switch(e.type){case`rectangle`:case`image`:case`text`:case`iframe`:case`embeddable`:case`frame`:case`magicframe`:return Av(e,t);case`diamond`:return jv(e,t);case`ellipse`:return Mv(e,t)}},Av=(e,t)=>{let n=F(t,P(e.x+e.width/2,e.y+e.height/2),-e.angle),[r,i]=vg(e);return Math.min(...r.map(e=>Ml(n,e)),...i.map(e=>Hl(e,n)).filter(e=>e!==null))},jv=(e,t)=>{let n=F(t,P(e.x+e.width/2,e.y+e.height/2),-e.angle),[r,i]=yg(e);return Math.min(...r.map(e=>Ml(n,e)),...i.map(e=>Hl(e,n)).filter(e=>e!==null))},Mv=(e,t)=>{let n=P(e.x+e.width/2,e.y+e.height/2);return gg(F(t,n,-e.angle),hg(n,e.width/2,e.height/2))},Nv=e=>!e[H.CTRL_OR_CMD],Pv=e=>e.isBindingEnabled,Fv=5,Iv=(e,t)=>{let n=[];return t.forEach(t=>{let r=e.getNonDeletedElement(t);r!=null&&n.push(r)}),n},Lv=(e,t,n,r,i)=>{let a=new Set,o=new Set;Rv(e,t,n,`start`,a,o,r),Rv(e,n,t,`end`,a,o,r),Iv(i,Array.from(o).filter(e=>!a.has(e))).forEach(t=>{K(t,{boundElements:t.boundElements?.filter(t=>t.type!==`arrow`||t.id!==e.id)})})},Rv=(e,t,n,r,i,a,o)=>{if(t!==`keep`){if(t===null){let t=Zv(e,r);t!=null&&a.add(t);return}Xv(e)?(n==null||(n===`keep`?!Jv(e,t,r):r===`start`||n.id!==t.id))&&(qv(e,t,r,o),i.add(t.id)):(qv(e,t,r,o),i.add(t.id))}},zv=(e,t,n,r)=>{let i=hy(e,t,n),a=t===`start`?e.startBinding?.elementId:e.endBinding?.elementId;if(a){let e=n.get(a);if(wd(e)&&by(e,i,n,r))return e}return null},Bv=(e,t,n)=>[`start`,`end`].map(r=>zv(e,r,t,n)),Vv=(e,t,n,r,i,a)=>{let o=e.points.length-1,s=n.findIndex(e=>e===0)>-1,c=n.findIndex(e=>e===o)>-1;return[s?t?my(e,`start`,r,i,a):null:z(e)?`keep`:my(e,`start`,r,i,a),c?t?my(e,`end`,r,i,a):null:z(e)?`keep`:my(e,`end`,r,i,a)]},Hv=(e,t,n,r,i)=>{if(z(e))return[`keep`,`keep`];let[a,o]=Bv(e,t,i);return[a&&r?my(e,`start`,t,n,i):null,o&&r?my(e,`end`,t,n,i):null]},Uv=(e,t,n,r,i,a,o)=>{e.forEach(e=>{let[s,c]=a?.length?Vv(e,i,a??[],t,n,o):Hv(e,t,n,i,o);Lv(e,s,c,t,r)})},Wv=(e,t,n)=>e.length>50?[]:e.filter(yd).flatMap(e=>Bv(e,t,n)).filter(e=>e!==null).filter(t=>e.filter(e=>e.id===t?.id).length===0),Gv=(e,t,n,r,i)=>{t.startBoundElement!=null&&qv(e,t.startBoundElement,`start`,r);let a=Qv(n,i,r,t.zoom,z(e),z(e));a!==null&&(Jv(e,a,`end`)||qv(e,a,`end`,r))},Kv=(e,t)=>{let n=e.gap,r=xy(t,t.width,t.height);return n>r&&(n=14),{...e,gap:n}},qv=(e,t,n,r)=>{if(!bd(e))return;let i={elementId:t.id,...z(e)?{...fy(e,t,n,r),focus:0,gap:0}:{...Kv(ty(e,t,n,r),t)}};K(e,{[n===`start`?`startBinding`:`endBinding`]:i}),Nu(t.boundElements||[]).has(e.id)||K(t,{boundElements:(t.boundElements||[]).concat({id:e.id,type:`arrow`})})},Jv=(e,t,n)=>{let r=e[n===`start`?`endBinding`:`startBinding`];return Yv(e,r?.elementId,t)},Yv=(e,t,n)=>t===n.id&&Xv(e),Xv=e=>e.points.length<3,Zv=(e,t)=>{let n=t===`start`?`startBinding`:`endBinding`,r=e[n];return r==null?null:(K(e,{[n]:null}),r.elementId)},Qv=(e,t,n,r,i,a)=>{if(a){let a=!1,o=ey(t,t=>wd(t,!1)&&by(t,e,n,r,(i||!Du(t))&&!gd(t))).filter(e=>!a&&(Du(e)||(a=!0),!0));if(!o||o.length===0)return null;if(o.length===1)return o[0];let s=o.filter(t=>by(t,e,n,r,!1));return s.length===1?s[0]:o.sort((e,t)=>t.width**2+t.height**2-(e.width**2+e.height**2)).pop()}return $v(t,t=>wd(t,!1)&&by(t,e,n,r,(i||!Du(t))&&!gd(t)))},$v=(e,t)=>{let n=null;for(let r=e.length-1;r>=0;--r){let i=e[r];if(!i.isDeleted&&t(i)){n=i;break}}return n},ey=(e,t)=>{let n=[];for(let r=e.length-1;r>=0;--r){let i=e[r];i.isDeleted||t(i)&&n.push(i)}return n},ty=(e,t,n,r)=>{let i=n===`start`?-1:1,a=i===-1?0:e.points.length-1,o=a-i,s=U.getPointAtIndexGlobalCoordinates(e,a,r);return{focus:Sy(t,U.getPointAtIndexGlobalCoordinates(e,o,r),s),gap:Math.max(1,kv(t,s))}},ny=(e,t,n)=>{let{newSize:r,simultaneouslyUpdated:i}=n??{},a=iy(i);wd(e)&&Ty(t,e,n=>{if(!yd(n)||n.isDeleted||!ry(n,e))return;let i=n.startBinding?t.get(n.startBinding.elementId):null,o=n.endBinding?t.get(n.endBinding.elementId):null,s=null,c=null;i&&o&&(s=yv(i,t),c=yv(o,t));let l={startBinding:py(e,n.startBinding,r),endBinding:py(e,n.endBinding,r)};if(a.has(n.id)){K(n,l,!0);return}let u=Ey(t,n,(r,i)=>{if(r&&wd(r)&&(i===`startBinding`||i===`endBinding`)&&(e.id===n[i]?.elementId||e.id===n[i===`startBinding`?`endBinding`:`startBinding`]?.elementId&&!Ov(s,c))){let e=dy(n,i,l[i],r,t);if(e)return{index:i===`startBinding`?0:n.points.length-1,point:e}}return null}).filter(e=>e!==null);U.movePoints(n,u,{...e.id===n.startBinding?.elementId?{startBinding:l.startBinding}:{},...e.id===n.endBinding?.elementId?{endBinding:l.endBinding}:{}});let d=zb(n,t);d&&!d.isDeleted&&Ib(n,t,!1)})},ry=(e,t)=>e.startBinding?.elementId===t.id||e.endBinding?.elementId===t.id,iy=e=>new Set((e||[]).map(e=>e.id)),ay=(e,t,n,r,i,a,o)=>{let s=B_(N(t,e));return!n||!r?s:oy(a,n,i,o)?G_(n,r,e):B_(N(e,P(n.x+n.width/2,n.y+n.height/2)))},oy=(e,t,n,r)=>{let i=kv(t,e);return i>xy(t,t.width,t.height,r)?null:i},sy=(e,t,n)=>{let r=t&&qg(t),i=e.points[n===`start`?0:e.points.length-1],a=P(e.x+i[0],e.y+i[1]),o=Td(t)?ly(t,a):a;if(t&&r){let e=Dv(r),n=Tg(t,I(e,bl(hl(vl(N(o,e)),Math.max(t.width,t.height)),e)))[0],i=Tl(o,e),a=Math.max(Tl(n??o,e),1e-4),s=tl(i/a,6);switch(!0){case s>.9:return i-a>Fv||El(o,n)<1e-4?o:bl(hl(vl(N(o,n??e)),s>1?Fv:-Fv),n??e);default:return cy(o,t,r)}}return o},cy=(e,t,n)=>{let r=Dv(n),i=B_(N(e,r));switch(!0){case U_(i,R_):return F(P((n[0]+n[2])/2+.1,n[1]),r,t.angle);case U_(i,F_):return F(P(n[2],(n[1]+n[3])/2+.1),r,t.angle);case U_(i,I_):return F(P((n[0]+n[2])/2-.1,n[3]),r,t.angle);default:return F(P(n[0],(n[1]+n[3])/2-.1),r,t.angle)}},ly=(e,t)=>{let n=P(e.x+e.width/2,e.y+e.height/2),r=F(t,n,-e.angle);return r[0]<e.x&&r[1]<e.y?r[1]-e.y>-Fv?F(P(e.x-Fv,e.y),n,e.angle):F(P(e.x,e.y-Fv),n,e.angle):r[0]<e.x&&r[1]>e.y+e.height?r[0]-e.x>-Fv?F(P(e.x,e.y+e.height+Fv),n,e.angle):F(P(e.x-Fv,e.y+e.height),n,e.angle):r[0]>e.x+e.width&&r[1]>e.y+e.height?r[0]-e.x<e.width+Fv?F(P(e.x+e.width,e.y+e.height+Fv),n,e.angle):F(P(e.x+e.width+Fv,e.y+e.height),n,e.angle):r[0]>e.x+e.width&&r[1]<e.y?r[0]-e.x<e.width+Fv?F(P(e.x+e.width,e.y-Fv),n,e.angle):F(P(e.x+e.width+Fv,e.y),n,e.angle):t},uy=(e,t,n=.05)=>{let{x:r,y:i,width:a,height:o,angle:s}=e,c=P(r+a/2-.1,i+o/2-.1),l=F(t,c,-s),u=el(n*o,5,80),d=el(n*a,5,80);return l[0]<=r+a/2&&l[1]>c[1]-u&&l[1]<c[1]+u?F(P(r-Fv,c[1]),c,s):l[1]<=i+o/2&&l[0]>c[0]-d&&l[0]<c[0]+d?F(P(c[0],i-Fv),c,s):l[0]>=r+a/2&&l[1]>c[1]-u&&l[1]<c[1]+u?F(P(r+a+Fv,c[1]),c,s):l[1]>=i+o/2&&l[0]>c[0]-d&&l[0]<c[0]+d?F(P(c[0],i+o+Fv),c,s):t},dy=(e,t,n,r,i)=>{if(n==null||n.elementId!==r.id&&e.points.length>2)return null;let a=t===`startBinding`?-1:1,o=a===-1?0:e.points.length-1;if(z(e)&&Fd(n)){let a=My(n.fixedPoint)??fy(e,r,t===`startBinding`?`start`:`end`,i).fixedPoint,o=P(r.x+r.width/2,r.y+r.height/2),s=F(P(r.x+a[0]*r.width,r.y+a[1]*r.height),o,r.angle);return U.pointFromAbsoluteCoords(e,s,i)}let s=o-a,c=U.getPointAtIndexGlobalCoordinates(e,s,i),l=Cy(r,n.focus,c),u;if(n.gap===0)u=l;else{let t=U.getPointAtIndexGlobalCoordinates(e,o,i),a=P(r.x+r.width/2,r.y+r.height/2),s=Tl(c,t)+Tl(c,a)+Math.max(r.width,r.height)*2,d=Tg(r,I(c,bl(hl(vl(N(l,c)),s),c)),n.gap).sort((e,t)=>El(e,c)-El(t,c));u=d.length>1?d[0]:d.length===1?l:t}return U.pointFromAbsoluteCoords(e,u,i)},fy=(e,t,n,r)=>{let i=[t.x,t.y,t.x+t.width,t.y+t.height],a=F(sy(e,t,n),P(i[0]+(i[2]-i[0])/2,i[1]+(i[3]-i[1])/2),-t.angle);return{fixedPoint:My([(a[0]-t.x)/t.width,(a[1]-t.y)/t.height])}},py=(e,t,n)=>{if(t==null||n==null)return t;let{width:r,height:i}=n,{width:a,height:o}=e,s=Math.max(1,Math.min(xy(e,r,i),t.gap*(r<i?r/a:i/o)));return{...t,gap:s}},my=(e,t,n,r,i)=>Qv(hy(e,t,n),r,n,i,z(e),z(e)),hy=(e,t,n)=>{let r=t===`start`?0:-1;return Su(U.getPointAtIndexGlobalCoordinates(e,r,n))},gy=(e,t,n,r)=>{let i=new Set,a=new Set,o=r===`duplicatesServeAsOld`,s=new Map([...n].map(([e,t])=>[t,e]));t.forEach(e=>{let{boundElements:t}=e;if(t!=null&&t.length>0&&(t.forEach(e=>{o&&!n.has(e.id)&&i.add(e.id)}),a.add(n.get(e.id))),Sd(e)){if(e.startBinding!=null){let{elementId:t}=e.startBinding;o&&!n.has(t)&&a.add(t)}if(e.endBinding!=null){let{elementId:t}=e.endBinding;o&&!n.has(t)&&a.add(t)}(e.startBinding!=null||e.endBinding!=null)&&i.add(n.get(e.id))}}),e.filter(({id:e})=>i.has(e)).forEach(e=>{let{startBinding:t,endBinding:r}=e;K(e,{startBinding:_y(t,n),endBinding:_y(r,n)})}),e.filter(({id:e})=>a.has(e)).forEach(t=>{let r=s.get(t.id),i=e.find(({id:e})=>e===r)?.boundElements;i&&i.length>0&&K(t,{boundElements:i.map(e=>n.has(e.id)?{id:n.get(e.id),type:e.type}:e)})})},_y=(e,t)=>e==null?null:{...e,elementId:t.get(e.elementId)??e.elementId},vy=(e,t)=>{let n=Nu(e);for(let e of t)Dy.unbindAffected(n,e,K),Oy.unbindAffected(n,e,K)},yy=(e,t,n=[])=>{if(!e)return null;let r=e.filter(e=>!t.has(e.id));return r.push(...n.map(e=>({id:e.id,type:e.type}))),r},by=(e,{x:t,y:n},r,i,a)=>{let o=xy(e,e.width,e.height,i),s=zg(e,r);return cg(P(t,n),s,o)||a===!0&&Jg(P(t,n),qg(e))},xy=(e,t,n,r)=>{let i=r?.value&&r.value<1?r.value:1,a=(e.type===`diamond`?1/Math.sqrt(2):1)*Math.min(t,n);return Math.max(16,Math.min(.25*a,32),10/i+4)},Sy=(e,t,n)=>{let r=P(e.x+e.width/2,e.y+e.height/2);if(Sl(t,n))return 0;let i=F(t,r,-e.angle),a=F(n,r,-e.angle),o=Math.sign(dl(N(a,t),N(a,r)))*-1,s=I(a,bl(hl(vl(N(a,i)),Math.max(e.width*2,e.height*2)),a)),c=e.type===`diamond`?[I(P(e.x+e.width/2,e.y),P(e.x+e.width/2,e.y+e.height)),I(P(e.x,e.y+e.height/2),P(e.x+e.width,e.y+e.height/2))]:[I(P(e.x,e.y),P(e.x+e.width,e.y+e.height)),I(P(e.x+e.width,e.y),P(e.x,e.y+e.height))],l=e.type===`diamond`?[I(P(e.x+e.width/2,e.y-e.height),P(e.x+e.width/2,e.y+e.height*2)),I(P(e.x-e.width,e.y+e.height/2),P(e.x+e.width*2,e.y+e.height/2))]:[I(P(e.x-e.width,e.y-e.height),P(e.x+e.width*2,e.y+e.height*2)),I(P(e.x+e.width*2,e.y-e.height),P(e.x-e.width,e.y+e.height*2))];return[Nl(s,l[0]),Nl(s,l[1])].filter(e=>e!==null).sort((e,t)=>El(e,n)-El(t,n)).map((t,n)=>o*Tl(r,t)/(e.type===`diamond`?Tl(c[n][0],c[n][1])/2:Math.sqrt(e.width**2+e.height**2)/2)).sort((e,t)=>Math.abs(e)-Math.abs(t))[0]??0},Cy=(e,t,n)=>{let r=P(e.x+e.width/2,e.y+e.height/2);if(t===0)return r;let i=(e.type===`diamond`?[P(e.x,e.y+e.height/2),P(e.x+e.width/2,e.y),P(e.x+e.width,e.y+e.height/2),P(e.x+e.width/2,e.y+e.height)]:[P(e.x,e.y),P(e.x+e.width,e.y),P(e.x+e.width,e.y+e.height),P(e.x,e.y+e.height)]).map(e=>bl(hl(N(e,r),Math.abs(t)),r)).map(t=>F(t,r,e.angle)),a=[dl(N(n,i[0]),N(i[1],i[0]))>0&&(t>0?dl(N(n,i[1]),N(i[2],i[1]))<0:dl(N(n,i[3]),N(i[0],i[3]))<0),dl(N(n,i[1]),N(i[2],i[1]))>0&&(t>0?dl(N(n,i[2]),N(i[3],i[2]))<0:dl(N(n,i[0]),N(i[1],i[0]))<0),dl(N(n,i[2]),N(i[3],i[2]))>0&&(t>0?dl(N(n,i[3]),N(i[0],i[3]))<0:dl(N(n,i[1]),N(i[2],i[1]))<0),dl(N(n,i[3]),N(i[0],i[3]))>0&&(t>0?dl(N(n,i[0]),N(i[1],i[0]))<0:dl(N(n,i[2]),N(i[3],i[2]))<0)];return a[0]?t>0?i[1]:i[0]:a[1]?t>0?i[2]:i[1]:a[2]?t>0?i[3]:i[2]:t>0?i[0]:i[3]},wy=new Set([`boundElements`,`frameId`,`containerId`,`startBinding`,`endBinding`]),Ty=(e,t,n)=>{wd(t)&&(t.boundElements?.slice()??[]).forEach(({id:t})=>{n(e.get(t),`boundElements`,t)})},Ey=(e,t,n)=>{let r=[];if(t.frameId){let i=t.frameId;r.push(n(e.get(i),`frameId`,i))}if(Ad(t)){let i=t.containerId;r.push(n(e.get(i),`containerId`,i))}if(bd(t)){if(t.startBinding){let i=t.startBinding.elementId;r.push(n(e.get(i),`startBinding`,i))}if(t.endBinding){let i=t.endBinding.elementId;r.push(n(e.get(i),`endBinding`,i))}}return r},Dy=class{static unbindAffected(e,t,n){t&&Ey(e,t,r=>{!r||r.isDeleted||Ty(e,r,(e,i,a)=>{a===t.id&&n(r,{boundElements:yy(r.boundElements,new Set([a]))})})})}};v(Dy,`rebindAffected`,(e,t,n)=>{!t||t.isDeleted||Ey(e,t,(e,r)=>{if(!e||e.isDeleted){n(t,{[r]:null});return}r!==`frameId`&&(e.boundElements?.find(e=>e.id===t.id)||(bd(t)&&n(e,{boundElements:yy(e.boundElements,new Set,Array(t))}),R(t)&&(e.boundElements?.find(e=>e.type===`text`)?n(t,{[r]:null}):n(e,{boundElements:yy(e.boundElements,new Set,Array(t))}))))})});var Oy=class{static unbindAffected(e,t,n){t&&Ty(e,t,r=>{!r||r.isDeleted||Ey(e,r,(e,i,a)=>{a===t.id&&n(r,{[i]:null})})})}};v(Oy,`rebindAffected`,(e,t,n)=>{!t||t.isDeleted||Ty(e,t,(e,r,i)=>{if(!e||e.isDeleted){n(t,{boundElements:yy(t.boundElements,new Set([i]))});return}R(e)&&((t.boundElements?.slice()??[]).reverse().find(e=>e.type===`text`)?.id===e.id?e.containerId!==t.id&&n(e,{containerId:t.id}):(e.containerId!==null&&n(e,{containerId:null}),n(t,{boundElements:yy(t.boundElements,new Set([e.id]))})))})});var ky=(e,t)=>{let[n,r]=My(e);return F(P(t.x+t.width*n,t.y+t.height*r),P(t.x+t.width/2,t.y+t.height/2),t.angle)},Ay=(e,t)=>{let n=e.startBinding&&t.get(e.startBinding.elementId),r=e.endBinding&&t.get(e.endBinding.elementId);return[n&&e.startBinding?ky(e.startBinding.fixedPoint,n):P(e.x+e.points[0][0],e.y+e.points[0][1]),r&&e.endBinding?ky(e.endBinding.fixedPoint,r):P(e.x+e.points[e.points.length-1][0],e.y+e.points[e.points.length-1][1])]},jy=(e,t)=>{let[n,r]=Ay(e,t);return[U.pointFromAbsoluteCoords(e,n,t),U.pointFromAbsoluteCoords(e,r,t)]},My=e=>e&&(Math.abs(e[0]-.5)<1e-4||Math.abs(e[1]-.5)<1e-4)?e.map(e=>Math.abs(e-.5)<1e-4?.5001:e):e,Ny=(e,t)=>{let[n,r,i,a]=t,{x:o,y:s}=vu({sceneX:n,sceneY:r},e),{x:c,y:l}=vu({sceneX:i,sceneY:a},e);return c-o>e.width||l-s>e.height},Py=({scenePoint:e,viewportDimensions:t,zoom:n,offsets:r})=>{let i=(t.width-(r?.right??0))/2/n.value-e.x;i+=(r?.left??0)/2/n.value;let a=(t.height-(r?.bottom??0))/2/n.value-e.y;return a+=(r?.top??0)/2/n.value,{scrollX:i,scrollY:a}},Fy=(e,t)=>{if(e=$E(e),!e.length)return{scrollX:0,scrollY:0};let[n,r,i,a]=bv(e);return Ny(t,[n,r,i,a])&&([n,r,i,a]=wv(e,_u({clientX:t.scrollX,clientY:t.scrollY},t))),Py({scenePoint:{x:(n+i)/2,y:(r+a)/2},viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})},Iy=e=>el(tl(e,6),mc,30),Ly=e=>el(Math.round(e),1,100),Ry=e=>el(Math.round(e),1,100),zy=(e,t,n)=>{let r=n.reduce((t,n)=>(n.groupIds.includes(e)&&(t[n.id]=!0),t),{});return Object.keys(r).length<2?t.selectedGroupIds[e]||t.editingGroupId===e?{selectedElementIds:t.selectedElementIds,selectedGroupIds:{...t.selectedGroupIds,[e]:!1},editingGroupId:null}:t:{editingGroupId:t.editingGroupId,selectedGroupIds:{...t.selectedGroupIds,[e]:!0},selectedElementIds:{...t.selectedElementIds,...r}}},By=function(){let e=null,t=null,n=null,r=(r,i,a,o)=>{if(n!==void 0&&i===t&&r===e&&a.editingGroupId===n?.editingGroupId)return n;let s={};for(let e of r){let t=e.groupIds;if(a.editingGroupId){let e=t.indexOf(a.editingGroupId);e>-1&&(t=t.slice(0,e))}if(t.length>0){let e=t[t.length-1];s[e]=!0}}let c={},l=i.reduce((e,t)=>{if(t.isDeleted)return e;let n=t.groupIds.find(e=>s[e]);return n&&(e[t.id]=!0,Array.isArray(c[n])?c[n].push(t.id):c[n]=[t.id]),e},{});for(let e of Object.keys(c))c[e].length<2&&s[e]&&(s[e]=!1);return t=i,e=r,n={editingGroupId:a.editingGroupId,selectedGroupIds:s,selectedElementIds:ZT({...a.selectedElementIds,...l},o)},n},i=(e,t,n,i)=>{let a=i?i.scene.getSelectedElements({selectedElementIds:e.selectedElementIds,elements:t}):YT(t,e);return a.length?r(a,t,e,n):{selectedGroupIds:{},editingGroupId:null,selectedElementIds:ZT(e.selectedElementIds,n)}};return i.clearCache=()=>{t=null,e=null,n=null},i}(),Vy=(e,t)=>Hy(e,t)!=null,Hy=(e,t)=>t.groupIds.filter(t=>t!==e.editingGroupId).find(t=>e.selectedGroupIds[t]),Uy=e=>Object.entries(e.selectedGroupIds).filter(([e,t])=>t).map(([e,t])=>e),Wy=(e,t)=>{let n={...t,selectedGroupIds:{}};for(let r of e){let i=r.groupIds;if(t.editingGroupId){let e=i.indexOf(t.editingGroupId);e>-1&&(i=i.slice(0,e))}if(i.length>0){let t=i[i.length-1];n={...n,...zy(t,n,e)}}}return n.selectedGroupIds},Gy=(e,t)=>({...e,editingGroupId:t.groupIds.length?t.groupIds[0]:null,selectedGroupIds:{},selectedElementIds:{[t.id]:!0}}),Ky=(e,t)=>e.groupIds.includes(t),qy=(e,t)=>{let n=[];for(let r of e.values())Ky(r,t)&&n.push(r);return n},Jy=(e,t)=>e.groupIds.find(e=>t[e]),Yy=(e,t,n)=>{let r=[...e],i=t?e.indexOf(t):-1,a=i>-1?i:e.length;for(let e=0;e<a;e++)r[e]=n(r[e]);return r},Xy=(e,t,n)=>{let r=[...e],i=n?r.indexOf(n):-1,a=i>-1?i:r.length;return r.splice(a,0,t),r},Zy=(e,t)=>e.filter(e=>!t[e]),Qy=(e,t)=>{let n=new Map;return e.forEach(e=>{let r=e.groupIds.length===0?e.id:e.groupIds[e.groupIds.length-1],i=n.get(r)||[],a=zb(e,t);a&&i.push(a),n.set(r,[...i,e])}),Array.from(n.values())},$y=e=>{let t=new Set;for(let[,n]of e)if(!n.isDeleted)for(let e of n.groupIds??[])t.add(e);return t},eb=e=>{let t=e.flatMap(e=>e.groupIds),n=new Map,r=0;for(let e of t)n.set(e,(n.get(e)??0)+1),n.get(e)>r&&(r=n.get(e));return r===e.length},tb=e=>e.groupIds.length>0,nb=8,rb=99999,ib=e=>nb/e,ab=class{};v(ab,`referenceSnapPoints`,null),v(ab,`visibleGaps`,null),v(ab,`setReferenceSnapPoints`,e=>{ab.referenceSnapPoints=e}),v(ab,`getReferenceSnapPoints`,()=>ab.referenceSnapPoints),v(ab,`setVisibleGaps`,e=>{ab.visibleGaps=e}),v(ab,`getVisibleGaps`,()=>ab.visibleGaps),v(ab,`destroy`,()=>{ab.referenceSnapPoints=null,ab.visibleGaps=null});var ob=ab,sb=e=>e.props.gridModeEnabled??e.state.gridModeEnabled,cb=({event:e,app:t,selectedElements:n})=>e?t.state.objectsSnapModeEnabled&&!e[H.CTRL_OR_CMD]||!t.state.objectsSnapModeEnabled&&e[H.CTRL_OR_CMD]&&!sb(t):n.length===1&&n[0].type===`arrow`?!1:t.state.objectsSnapModeEnabled,lb=(e,t,n=.01)=>Math.abs(e-t)<=n,ub=(e,t,{omitCenter:n,boundingBoxCorners:r,dragOffset:i}={omitCenter:!1,boundingBoxCorners:!1})=>{let a=[];if(e.length===1){let o=e[0],[s,c,l,u,d,f]=av(o,t);i&&(s+=i.x,l+=i.x,d+=i.x,c+=i.y,u+=i.y,f+=i.y);let p=(l-s)/2,m=(u-c)/2;if((o.type===`diamond`||o.type===`ellipse`)&&!r){let e=F(P(s,c+m),P(d,f),o.angle),t=F(P(s+p,c),P(d,f),o.angle),r=F(P(l,c+m),P(d,f),o.angle),i=F(P(s+p,u),P(d,f),o.angle),h=P(d,f);a=n?[e,t,r,i]:[e,t,r,i,h]}else{let e=F(P(s,c),P(d,f),o.angle),t=F(P(l,c),P(d,f),o.angle),r=F(P(s,u),P(d,f),o.angle),i=F(P(l,u),P(d,f),o.angle),p=P(d,f);a=n?[e,t,r,i]:[e,t,r,i,p]}}else if(e.length>1){let[t,r,o,s]=xv(e,i??{x:0,y:0}),c=o-t,l=s-r,u=P(t,r),d=P(o,r),f=P(t,s),p=P(o,s),m=P(t+c/2,r+l/2);a=n?[u,d,f,p]:[u,d,f,p,m]}return a.map(e=>P(_b(e[0]),_b(e[1])))},db=(e,t,n,r)=>{let i=t.filter(e=>gd(e)).map(e=>e.id);return KT(e,t,n,r).filter(e=>!(e.frameId&&i.includes(e.frameId)))},fb=(e,t,n,r)=>{let i=Qy(db(e,t,n,r),r).filter(e=>!(e.length===1&&Ad(e[0]))).map(e=>bv(e).map(e=>_b(e))),a=i.sort((e,t)=>e[0]-t[0]),o=[],s=0;e:for(let e=0;e<a.length;e++){let t=a[e];for(let n=e+1;n<a.length;n++){if(++s>rb)break e;let e=a[n],[,r,i,c]=t,[l,u,,d]=e;i<l&&Zl(Xl(r,c),Xl(u,d))&&o.push({startBounds:t,endBounds:e,startSide:[P(i,r),P(i,c)],endSide:[P(l,u),P(l,d)],length:l-i,overlap:Ql(Xl(r,c),Xl(u,d))})}}let c=i.sort((e,t)=>e[1]-t[1]),l=[];s=0;e:for(let e=0;e<c.length;e++){let t=c[e];for(let n=e+1;n<c.length;n++){if(++s>rb)break e;let e=c[n],[r,,i,a]=t,[o,u,d]=e;a<u&&Zl(Xl(r,i),Xl(o,d))&&l.push({startBounds:t,endBounds:e,startSide:[P(r,a),P(i,a)],endSide:[P(o,u),P(d,u)],length:u-a,overlap:Ql(Xl(r,i),Xl(o,d))})}}return{horizontalGaps:o,verticalGaps:l}},pb=(e,t,n,r,i,a,o)=>{if(!cb({app:n,event:r,selectedElements:e})||e.length===0)return[];let s=ob.getVisibleGaps();if(s){let{horizontalGaps:n,verticalGaps:r}=s,[c,l,u,d]=xv(e,t).map(e=>_b(e)),f=(c+u)/2,p=(l+d)/2;for(let e of n){if(!Zl(Xl(l,d),e.overlap))continue;let t=_b(e.startSide[0][0]+e.length/2-f);if(e.length>u-c&&Math.abs(t)<=o.x){Math.abs(t)<o.x&&(i.length=0),o.x=Math.abs(t);let n={type:`gap`,direction:`center_horizontal`,gap:e,offset:t};i.push(n);continue}let[,,n]=e.endBounds,r=c-n,a=_b(e.length-r);if(Math.abs(a)<=o.x){Math.abs(a)<o.x&&(i.length=0),o.x=Math.abs(a);let t={type:`gap`,direction:`side_right`,gap:e,offset:a};i.push(t);continue}let[s,,,]=e.startBounds,p=_b(s-u-e.length);if(Math.abs(p)<=o.x){Math.abs(p)<o.x&&(i.length=0),o.x=Math.abs(p);let t={type:`gap`,direction:`side_left`,gap:e,offset:p};i.push(t);continue}}for(let e of r){if(!Zl(Xl(c,u),e.overlap))continue;let t=_b(e.startSide[0][1]+e.length/2-p);if(e.length>d-l&&Math.abs(t)<=o.y){Math.abs(t)<o.y&&(a.length=0),o.y=Math.abs(t);let n={type:`gap`,direction:`center_vertical`,gap:e,offset:t};a.push(n);continue}let[,n,,]=e.startBounds,r=_b(n-d-e.length);if(Math.abs(r)<=o.y){Math.abs(r)<o.y&&(a.length=0),o.y=Math.abs(r);let t={type:`gap`,direction:`side_top`,gap:e,offset:r};a.push(t);continue}let[,,,i]=e.endBounds,s=_b(l-i),f=e.length-s;if(Math.abs(f)<=o.y){Math.abs(f)<o.y&&(a.length=0),o.y=Math.abs(f);let t={type:`gap`,direction:`side_bottom`,gap:e,offset:f};a.push(t);continue}}}},mb=(e,t,n,r)=>Qy(db(e,t,n,r),r).filter(e=>!(e.length===1&&Ad(e[0]))).flatMap(e=>ub(e,r)),hb=(e,t,n,r,i,a,o)=>{if(!cb({app:n,event:r,selectedElements:e})||e.length===0&&t.length===0)return[];let s=ob.getReferenceSnapPoints();if(s)for(let e of t)for(let t of s){let n=t[0]-e[0],r=t[1]-e[1];Math.abs(n)<=o.x&&(Math.abs(n)<o.x&&(i.length=0),i.push({type:`point`,points:[e,t],offset:n}),o.x=Math.abs(n)),Math.abs(r)<=o.y&&(Math.abs(r)<o.y&&(a.length=0),a.push({type:`point`,points:[e,t],offset:r}),o.y=Math.abs(r))}},gb=(e,t,n,r,i)=>{let a=n.state,o=YT(e,a);if(!cb({app:n,event:r,selectedElements:o})||o.length===0)return{snapOffset:{x:0,y:0},snapLines:[]};t.x=_b(t.x),t.y=_b(t.y);let s=[],c=[],l=ib(a.zoom.value),u={x:l,y:l};hb(o,ub(o,i,{dragOffset:t}),n,r,s,c,u),pb(o,t,n,r,s,c,u);let d={x:s[0]?.offset??0,y:c[0]?.offset??0};u.x=0,u.y=0,s.length=0,c.length=0;let f={x:_b(t.x+d.x),y:_b(t.y+d.y)};hb(o,ub(o,i,{dragOffset:f}),n,r,s,c,u),pb(o,f,n,r,s,c,u);let p=yb(s,c),m=xb(o,f,[...s,...c].filter(e=>e.type===`gap`));return{snapOffset:d,snapLines:[...p,...m]}},_b=e=>Math.round(e*10**6)/10**6,vb=e=>{let t=new Map;for(let n of e){let e=n.join(`,`);t.has(e)||t.set(e,n)}return Array.from(t.values())},yb=(e,t)=>{let n={},r={};if(e.length>0){for(let t of e)if(t.type===`point`){let e=_b(t.points[0][0]);n[e]||(n[e]=[]),n[e].push(...t.points.map(e=>P(_b(e[0]),_b(e[1]))))}}if(t.length>0){for(let e of t)if(e.type===`point`){let t=_b(e.points[0][1]);r[t]||(r[t]=[]),r[t].push(...e.points.map(e=>P(_b(e[0]),_b(e[1]))))}}return Object.entries(n).map(([e,t])=>({type:`points`,points:vb(t.map(t=>P(Number(e),t[1])).sort((e,t)=>e[1]-t[1]))})).concat(Object.entries(r).map(([e,t])=>({type:`points`,points:vb(t.map(t=>P(t[0],Number(e))).sort((e,t)=>e[0]-t[0]))})))},bb=e=>{let t=new Map;for(let n of e){let e=n.points.flat().map(e=>[_b(e)]).join(`,`);t.has(e)||t.set(e,n)}return Array.from(t.values())},xb=(e,t,n)=>{let[r,i,a,o]=xv(e,t),s=[];for(let e of n){let[t,n,c,l]=e.gap.startBounds,[u,d,f,p]=e.gap.endBounds,m=Ql(Xl(i,o),e.gap.overlap),h=Ql(Xl(r,a),e.gap.overlap);switch(e.direction){case`center_horizontal`:if(m){let t=(m[0]+m[1])/2;s.push({type:`gap`,direction:`horizontal`,points:[P(e.gap.startSide[0][0],t),P(r,t)]},{type:`gap`,direction:`horizontal`,points:[P(a,t),P(e.gap.endSide[0][0],t)]})}break;case`center_vertical`:if(h){let t=(h[0]+h[1])/2;s.push({type:`gap`,direction:`vertical`,points:[P(t,e.gap.startSide[0][1]),P(t,i)]},{type:`gap`,direction:`vertical`,points:[P(t,o),P(t,e.gap.endSide[0][1])]})}break;case`side_right`:if(m){let e=(m[0]+m[1])/2;s.push({type:`gap`,direction:`horizontal`,points:[P(c,e),P(u,e)]},{type:`gap`,direction:`horizontal`,points:[P(f,e),P(r,e)]})}break;case`side_left`:if(m){let e=(m[0]+m[1])/2;s.push({type:`gap`,direction:`horizontal`,points:[P(a,e),P(t,e)]},{type:`gap`,direction:`horizontal`,points:[P(c,e),P(u,e)]})}break;case`side_top`:if(h){let e=(h[0]+h[1])/2;s.push({type:`gap`,direction:`vertical`,points:[P(e,o),P(e,n)]},{type:`gap`,direction:`vertical`,points:[P(e,l),P(e,d)]})}break;case`side_bottom`:if(h){let e=(h[0]+h[1])/2;s.push({type:`gap`,direction:`vertical`,points:[P(e,l),P(e,d)]},{type:`gap`,direction:`vertical`,points:[P(e,p),P(e,i)]})}}}return bb(s.map(e=>({...e,points:e.points.map(e=>P(_b(e[0]),_b(e[1])))})))},Sb=(e,t,n,r,i,a)=>{if(!cb({event:r,selectedElements:e,app:n})||e.length===0||e.length===1&&!lb(e[0].angle,0))return{snapOffset:{x:0,y:0},snapLines:[]};let[o,s,c,l]=bv(t);a&&(a.includes(`e`)?c+=i.x:a.includes(`w`)&&(o+=i.x),a.includes(`n`)?s+=i.y:a.includes(`s`)&&(l+=i.y));let u=[];if(a)switch(a){case`e`:u.push(P(c,s),P(c,l));break;case`w`:u.push(P(o,s),P(o,l));break;case`n`:u.push(P(o,s),P(c,s));break;case`s`:u.push(P(o,l),P(c,l));break;case`ne`:u.push(P(c,s));break;case`nw`:u.push(P(o,s));break;case`se`:u.push(P(c,l));break;case`sw`:u.push(P(o,l));break}let d=ib(n.state.zoom.value),f={x:d,y:d},p=[],m=[];hb(t,u,n,r,p,m,f);let h={x:p[0]?.offset??0,y:m[0]?.offset??0};f.x=0,f.y=0,p.length=0,m.length=0;let[g,_,v,y]=bv(e).map(e=>_b(e));return hb(e,[P(g,_),P(g,y),P(v,_),P(v,y)],n,r,p,m,f),{snapOffset:h,snapLines:yb(p,m)}},Cb=(e,t,n,r,i,a)=>{if(!cb({event:n,selectedElements:[e],app:t}))return{snapOffset:{x:0,y:0},snapLines:[]};let o=[P(r.x+i.x,r.y+i.y)],s=ib(t.state.zoom.value),c={x:s,y:s},l=[],u=[];hb([e],o,t,n,l,u,c);let d={x:l[0]?.offset??0,y:u[0]?.offset??0};c.x=0,c.y=0,l.length=0,u.length=0;let f=ub([e],a,{boundingBoxCorners:!0,omitCenter:!0});return hb([e],f,t,n,l,u,c),{snapOffset:d,snapLines:yb(l,u)}},wb=(e,t,n,r,i)=>{if(!cb({event:r,selectedElements:[],app:t}))return{originOffset:{x:0,y:0},snapLines:[]};let a=KT(e,[],t.state,i),o=ib(t.state.zoom.value),s={x:o,y:o},c=[],l=[];for(let e of a){let t=ub([e],i);for(let e of t){let t=e[0]-n.x;Math.abs(t)<=Math.abs(s.x)&&(Math.abs(t)<Math.abs(s.x)&&(l.length=0),l.push({type:`pointer`,points:[e,P(e[0],n.y)],direction:`vertical`}),s.x=t);let r=e[1]-n.y;Math.abs(r)<=Math.abs(s.y)&&(Math.abs(r)<Math.abs(s.y)&&(c.length=0),c.push({type:`pointer`,points:[e,P(n.x,e[1])],direction:`horizontal`}),s.y=r)}}return{originOffset:{x:l.length>0?l[0].points[0][0]-n.x:0,y:c.length>0?c[0].points[0][1]-n.y:0},snapLines:[...l,...c]}},Tb=e=>e===Rc.rectangle||e===Rc.ellipse||e===Rc.diamond||e===Rc.frame||e===Rc.magicframe||e===Rc.image||e===Rc.text,Eb=(e,t,n)=>n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t],Db={version:null,points:[],zoom:null},Ob=class e{constructor(e){v(this,`elementId`),v(this,`selectedPointsIndices`),v(this,`pointerDownState`),v(this,`isDragging`),v(this,`lastUncommittedPoint`),v(this,`pointerOffset`),v(this,`startBindingElement`),v(this,`endBindingElement`),v(this,`hoverPointIndex`),v(this,`segmentMidPointHoveredCoords`),v(this,`elbowed`),this.elementId=e.id,Sl(e.points[0],P(0,0))||console.error(`Linear element is not normalized`,Error().stack),this.selectedPointsIndices=null,this.lastUncommittedPoint=null,this.isDragging=!1,this.pointerOffset={x:0,y:0},this.startBindingElement=`keep`,this.endBindingElement=`keep`,this.pointerDownState={prevSelectedPointsIndices:null,lastClickedPoint:-1,lastClickedIsEndPoint:!1,origin:null,segmentMidpoint:{value:null,index:null,added:!1}},this.hoverPointIndex=-1,this.segmentMidPointHoveredCoords=null,this.elbowed=z(e)&&e.elbowed}static getElement(e,t){return t.get(e)||null}static handleBoxSelection(t,n,r,i){if(!n.editingLinearElement||!n.selectionElement)return!1;let{editingLinearElement:a}=n,{selectedPointsIndices:o,elementId:s}=a,c=e.getElement(s,i);if(!c)return!1;let[l,u,d,f]=av(n.selectionElement,i),p=e.getPointsGlobalCoordinates(c,i).reduce((e,n,r)=>((n[0]>=l&&n[0]<=d&&n[1]>=u&&n[1]<=f||t.shiftKey&&o?.includes(r))&&e.push(r),e),[]).filter(e=>!(z(c)&&e!==0&&e!==c.points.length-1));r({editingLinearElement:{...a,selectedPointsIndices:p.length?p:null}})}static handlePointDragging(t,n,r,i,a,o,s){if(!o)return!1;let{elementId:c}=o,l=s.getNonDeletedElementsMap(),u=e.getElement(c,l);if(!u||z(u)&&!o.pointerDownState.lastClickedIsEndPoint&&o.pointerDownState.lastClickedPoint!==0)return!1;let d=z(u)?o.selectedPointsIndices?.reduce((e,t)=>t===0?[0,e[1]]:[e[0],u.points.length-1],[!1,!1]).filter(e=>typeof e==`number`):o.selectedPointsIndices,f=z(u)?o.pointerDownState.lastClickedPoint>0?u.points.length-1:0:o.pointerDownState.lastClickedPoint,p=u.points[f];if(d&&p){if(Ig(t)&&d.length===1&&u.points.length>1){let a=d[0],o=u.points[a===0?1:a-1],[s,c]=e._getShiftLockedDelta(u,l,o,P(r,i),t[H.CTRL_OR_CMD]?null:n.getEffectiveGridSize());e.movePoints(u,[{index:a,point:P(s+o[0],c+o[1]),isDragging:a===f}])}else{let a=e.createPointAt(u,l,r-o.pointerOffset.x,i-o.pointerOffset.y,t[H.CTRL_OR_CMD]?null:n.getEffectiveGridSize()),s=a[0]-p[0],c=a[1]-p[1];e.movePoints(u,d.map(a=>({index:a,point:a===f?e.createPointAt(u,l,r-o.pointerOffset.x,i-o.pointerOffset.y,t[H.CTRL_OR_CMD]?null:n.getEffectiveGridSize()):P(u.points[a][0]+s,u.points[a][1]+c),isDragging:a===f})))}if(zb(u,l)&&Ib(u,l,!1),Sd(u,!1)){let t=[];d[0]===0&&t.push(Su(e.getPointGlobalCoordinates(u,u.points[0],l)));let n=d[d.length-1];n===u.points.length-1&&t.push(Su(e.getPointGlobalCoordinates(u,u.points[n],l))),t.length&&a(u,t)}return!0}return!1}static handlePointerUp(t,n,r,i){let a=i.getNonDeletedElementsMap(),o=i.getNonDeletedElements(),{elementId:s,selectedPointsIndices:c,isDragging:l,pointerDownState:u}=n,d=e.getElement(s,a);if(!d)return n;let f={};if(l&&c){for(let t of c)if(t===0||t===d.points.length-1){Xg(d.points,r.zoom.value)&&e.movePoints(d,[{index:t,point:t===0?d.points[d.points.length-1]:d.points[0]}]);let n=Pv(r)?Qv(Su(e.getPointAtIndexGlobalCoordinates(d,t,a)),o,a,r.zoom,z(d),z(d)):null;f[t===0?`startBindingElement`:`endBindingElement`]=n}}return{...n,...f,selectedPointsIndices:l||t.shiftKey?!l&&t.shiftKey&&u.prevSelectedPointsIndices?.includes(u.lastClickedPoint)?c&&c.filter(e=>e!==u.lastClickedPoint):c:c?.includes(u.lastClickedPoint)?[u.lastClickedPoint]:c,isDragging:!1,pointerOffset:{x:0,y:0}}}static isSegmentTooShort(t,n,r,i,a){if(z(t))return i>=0&&i<t.points.length&&Tl(n,r)*a.value<e.POINT_HANDLE_SIZE/2;let o=Tl(n,r);return t.points.length>2&&t.roundness&&(o=Gg(t,r)),o*a.value<e.POINT_HANDLE_SIZE*4}static getSegmentMidPoint(t,n,r,i,a){let o=wl(n,r);if(t.points.length>2&&t.roundness){let n=Vg(t,t.points[i]);if(n){let r=Kg(t,t.points[i],.5);o=e.getPointGlobalCoordinates(t,Hg(n[0],n[1],n[2],n[3],r),a)}}return o}static getSegmentMidPointIndex(t,n,r,i){let a=e.getElement(t.elementId,i);if(!a)return-1;let o=e.getEditorMidPoints(a,i,n),s=0;for(;s<o.length;){if(e.arePointsEqual(r,o[s]))return s+1;s++}return-1}static handlePointerDown(t,n,r,i,a,o){let s=n.state,c=o.getNonDeletedElementsMap(),l=o.getNonDeletedElements(),u={didAddPoint:!1,hitElement:null,linearElementEditor:null};if(!a)return u;let{elementId:d}=a,f=e.getElement(d,c);if(!f)return u;let p=e.getSegmentMidpointHitCoords(a,i,s,c),m=null;if(p)m=e.getSegmentMidPointIndex(a,s,p,c);else if(t.altKey&&s.editingLinearElement)return a.lastUncommittedPoint??(K(f,{points:[...f.points,e.createPointAt(f,c,i.x,i.y,t[H.CTRL_OR_CMD]?null:n.getEffectiveGridSize())]}),u.didAddPoint=!0),r.shouldCaptureIncrement(),u.linearElementEditor={...a,pointerDownState:{prevSelectedPointsIndices:a.selectedPointsIndices,lastClickedPoint:-1,lastClickedIsEndPoint:!1,origin:{x:i.x,y:i.y},segmentMidpoint:{value:p,index:m,added:!1}},selectedPointsIndices:[f.points.length-1],lastUncommittedPoint:null,endBindingElement:Qv(i,l,c,n.state.zoom,a.elbowed)},u.didAddPoint=!0,u;let h=e.getPointIndexUnderCursor(f,c,s.zoom,i.x,i.y);if(h>=0||p)u.hitElement=f;else{let{startBindingElement:e,endBindingElement:t}=a;Pv(s)&&Sd(f)&&Lv(f,e,t,c,o)}let[g,_,v,y]=av(f,c),b=(g+v)/2,x=(_+y)/2,S=h>-1&&F(P(f.x+f.points[h][0],f.y+f.points[h][1]),P(b,x),f.angle),C=h>-1||t.shiftKey?t.shiftKey||a.selectedPointsIndices?.includes(h)?kb([...a.selectedPointsIndices||[],h]):[h]:null;return u.linearElementEditor={...a,pointerDownState:{prevSelectedPointsIndices:a.selectedPointsIndices,lastClickedPoint:h,lastClickedIsEndPoint:h===f.points.length-1,origin:{x:i.x,y:i.y},segmentMidpoint:{value:p,index:m,added:!1}},selectedPointsIndices:C,pointerOffset:S?{x:i.x-S[0],y:i.y-S[1]}:{x:0,y:0}},u}static arePointsEqual(e,t){return!e&&!t?!0:!e||!t?!1:Sl(e,t)}static handlePointerMove(t,n,r,i,a){let o=i.state;if(!o.editingLinearElement)return null;let{elementId:s,lastUncommittedPoint:c}=o.editingLinearElement,l=e.getElement(s,a);if(!l)return o.editingLinearElement;let{points:u}=l,d=u[u.length-1];if(!t.altKey)return d===c&&e.deletePoints(l,[u.length-1]),{...o.editingLinearElement,lastUncommittedPoint:null};let f;if(Ig(t)&&u.length>=2){let o=u[u.length-2],[s,c]=e._getShiftLockedDelta(l,a,o,P(n,r),t[H.CTRL_OR_CMD]?null:i.getEffectiveGridSize());f=P(s+o[0],c+o[1])}else f=e.createPointAt(l,a,n-o.editingLinearElement.pointerOffset.x,r-o.editingLinearElement.pointerOffset.y,t[H.CTRL_OR_CMD]||z(l)?null:i.getEffectiveGridSize());return d===c?e.movePoints(l,[{index:l.points.length-1,point:f}]):e.addPoints(l,[{point:f}]),{...o.editingLinearElement,lastUncommittedPoint:l.points[l.points.length-1]}}static getPointGlobalCoordinates(e,t,n){let[r,i,a,o]=av(e,n),s=(r+a)/2,c=(i+o)/2,{x:l,y:u}=e;return F(P(l+t[0],u+t[1]),P(s,c),e.angle)}static getPointsGlobalCoordinates(e,t){let[n,r,i,a]=av(e,t),o=(n+i)/2,s=(r+a)/2;return e.points.map(t=>{let{x:n,y:r}=e;return F(P(n+t[0],r+t[1]),P(o,s),e.angle)})}static getPointAtIndexGlobalCoordinates(e,t,n){let r=t<0?e.points.length+t:t,[i,a,o,s]=av(e,n),c=(i+o)/2,l=(a+s)/2,u=e.points[r],{x:d,y:f}=e;return F(u?P(d+u[0],f+u[1]):P(d,f),P(c,l),e.angle)}static pointFromAbsoluteCoords(e,t,n){if(z(e))return P(t[0]-e.x,t[1]-e.y);let[r,i,a,o]=av(e,n),s=(r+a)/2,c=(i+o)/2,[l,u]=F(P(t[0],t[1]),P(s,c),-e.angle);return P(l-e.x,u-e.y)}static getPointIndexUnderCursor(t,n,r,i,a){let o=e.getPointsGlobalCoordinates(t,n),s=o.length;for(;--s>-1;){let t=o[s];if(Tl(P(i,a),P(t[0],t[1]))*r.value<e.POINT_HANDLE_SIZE+1)return s}return-1}static createPointAt(e,t,n,r,i){let a=Eb(n,r,i),[o,s,c,l]=av(e,t),u=(o+c)/2,d=(s+l)/2,[f,p]=F(P(a[0],a[1]),P(u,d),-e.angle);return P(f-e.x,p-e.y)}static getNormalizedPoints(e){let{points:t}=e,n=t[0][0],r=t[0][1];return{points:t.map(e=>P(e[0]-n,e[1]-r)),x:e.x+n,y:e.y+r}}static normalizePoints(t){K(t,e.getNormalizedPoints(t))}static duplicateSelectedPoints(t,n){Yu(t.editingLinearElement,`Not currently editing a linear element`);let{selectedPointsIndices:r,elementId:i}=t.editingLinearElement,a=e.getElement(i,n);Yu(a,`The linear element does not exist in the provided Scene`),Yu(r!=null,`There are no selected points to duplicate`);let{points:o}=a,s=[],c=!1,l=-1;if(K(a,{points:o.reduce((e,t,n)=>{if(++l,e.push(t),r.includes(n)){let r=o[n+1];r||(c=!0),e.push(r?P((t[0]+r[0])/2,(t[1]+r[1])/2):P(t[0],t[1])),s.push(l+1),++l}return e},[])}),c){let t=a.points[a.points.length-1];e.movePoints(a,[{index:a.points.length-1,point:P(t[0]+30,t[1]+30)}])}return{...t,editingLinearElement:{...t.editingLinearElement,selectedPointsIndices:s}}}static deletePoints(t,n){let r=0,i=0;if(n.includes(0)){let e=t.points.find((e,t)=>!n.includes(t));e&&(r=e[0],i=e[1])}let a=t.points.reduce((e,t,a)=>(n.includes(a)||e.push(e.length?P(t[0]-r,t[1]-i):P(0,0)),e),[]);e._updatePoints(t,a,r,i)}static addPoints(t,n){let r=[...t.points,...n.map(e=>e.point)];e._updatePoints(t,r,0,0)}static movePoints(t,n,r){let{points:i}=t,[a,o]=n.find(({index:e})=>e===0)?.point??P(0,0),[s,c]=P(a-i[0][0],o-i[0][1]),l=z(t)?[n.find(e=>e.index===0)?.point??i[0],n.find(e=>e.index===i.length-1)?.point??i[i.length-1]]:i.map((e,t)=>{let r=n.find(e=>e.index===t)?.point??e;return P(r[0]-s,r[1]-c)});e._updatePoints(t,l,s,c,r,{isDragging:n.reduce((e,t)=>e||t.isDragging===!0,!1)})}static shouldAddMidpoint(t,n,r,i){let a=e.getElement(t.elementId,i);if(a&&z(a)||!a)return!1;let{segmentMidpoint:o}=t.pointerDownState;if(o.added||o.value===null||o.index===null||t.pointerDownState.origin===null)return!1;let s=t.pointerDownState.origin,c=Tl(P(s.x,s.y),P(n.x,n.y));return!(!r.editingLinearElement&&c<10/r.zoom.value)}static addMidpoint(t,n,r,i,a){let o=e.getElement(t.elementId,a);if(!o)return;let{segmentMidpoint:s}=t.pointerDownState,c={pointerDownState:t.pointerDownState,selectedPointsIndices:t.selectedPointsIndices},l=e.createPointAt(o,a,n.x,n.y,i&&!z(o)?r.getEffectiveGridSize():null);return K(o,{points:[...o.points.slice(0,s.index),l,...o.points.slice(s.index)]}),c.pointerDownState={...t.pointerDownState,segmentMidpoint:{...t.pointerDownState.segmentMidpoint,added:!0},lastClickedPoint:s.index},c.selectedPointsIndices=[s.index],c}static _updatePoints(e,t,n,r,i,a){if(z(e)){let n={};i?.startBinding!==void 0&&(n.startBinding=i.startBinding!==null&&Fd(i.startBinding)?i.startBinding:null),i?.endBinding!==void 0&&(n.endBinding=i.endBinding!==null&&Fd(i.endBinding)?i.endBinding:null),n.points=Array.from(t),K(e,n,!0,{isDragging:a?.isDragging})}else{let a=Cv(e,t),o=Cv(e,e.points),s=(a[0]+a[2])/2,c=(a[1]+a[3])/2,l=(o[0]+o[2])/2,u=(o[1]+o[3])/2,d=l-s,f=u-c,p=F(P(n,r),P(d,f),e.angle);K(e,{...i,points:t,x:e.x+p[0],y:e.y+p[1]})}}static _getShiftLockedDelta(t,n,r,i,a){let o=e.getPointGlobalCoordinates(t,r,n);if(z(t))return[i[0]-o[0],i[1]-o[1]];let[s,c]=Eb(i[0],i[1],a),{width:l,height:u}=uE(o[0],o[1],s,c);return F(P(l,u),P(0,0),-t.angle)}static moveFixedSegment(t,n,r,i,a){let o=e.getElement(t.elementId,a);if(!o||!z(o))return t;if(n&&n>0&&n<o.points.length){let e=W_(B_(N(o.points[n],o.points[n-1]))),a=(o.fixedSegments??[]).reduce((e,t)=>(e[t.index]=t,e),{});a[n]={index:n,start:P(e?o.points[n-1][0]:r-o.x,e?i-o.y:o.points[n-1][1]),end:P(e?o.points[n][0]:r-o.x,e?i-o.y:o.points[n][1])};let s=Object.values(a).sort((e,t)=>e.index-t.index),c=s.map(e=>e.index).reduce((e,t)=>t<n?e+1:e,0);K(o,{fixedSegments:s});let l=P(o.x+(o.fixedSegments[c].start[0]+o.fixedSegments[c].end[0])/2,o.y+(o.fixedSegments[c].start[1]+o.fixedSegments[c].end[1])/2);return{...t,segmentMidPointHoveredCoords:l,pointerDownState:{...t.pointerDownState,segmentMidpoint:{added:!1,index:o.fixedSegments[c].index,value:l}}}}return t}static deleteFixedSegment(e,t){K(e,{fixedSegments:e.fixedSegments?.filter(e=>e.index!==t)}),K(e,{},!0)}};v(Ob,`POINT_HANDLE_SIZE`,10),v(Ob,`getEditorMidPoints`,(e,t,n)=>{let r=zb(e,t);return!z(e)&&!n.editingLinearElement&&e.points.length>2&&!r?[]:(Db.version===e.version&&Db.zoom===n.zoom.value||Ob.updateEditorMidPointsCache(e,t,n),Db.points)}),v(Ob,`updateEditorMidPointsCache`,(e,t,n)=>{let r=Ob.getPointsGlobalCoordinates(e,t),i=0,a=[];for(;i<r.length-1;){if(Ob.isSegmentTooShort(e,e.points[i],e.points[i+1],i,n.zoom)){a.push(null),i++;continue}let o=Ob.getSegmentMidPoint(e,r[i],r[i+1],i+1,t);a.push(o),i++}Db.points=a,Db.version=e.version,Db.zoom=n.zoom.value}),v(Ob,`getSegmentMidpointHitCoords`,(e,t,n,r)=>{let{elementId:i}=e,a=Ob.getElement(i,r);if(!a)return null;let o=Ob.getPointIndexUnderCursor(a,r,n.zoom,t.x,t.y);if(!z(a)&&o>=0||Ob.getPointsGlobalCoordinates(a,r).length>=3&&!n.editingLinearElement&&!z(a))return null;let s=(Ob.POINT_HANDLE_SIZE+1)/n.zoom.value,c=e.segmentMidPointHoveredCoords;if(c&&Tl(P(c[0],c[1]),P(t.x,t.y))<=s)return c;let l=0,u=Ob.getEditorMidPoints(a,r,n);for(;l<u.length;){if(u[l]!==null&&Tl(u[l],P(t.x,t.y))<=s)return u[l];l++}return null}),v(Ob,`getBoundTextElementPosition`,(e,t,n)=>{let r=Ob.getPointsGlobalCoordinates(e,n);r.length<2&&K(t,{isDeleted:!0});let i=0,a=0;if(e.points.length%2==1){let r=Math.floor(e.points.length/2),o=Ob.getPointGlobalCoordinates(e,e.points[r],n);i=o[0]-t.width/2,a=o[1]-t.height/2}else{let o=e.points.length/2-1,s=Db.points[o];e.points.length===2&&(s=wl(r[0],r[1])),(!s||Db.version!==e.version)&&(s=Ob.getSegmentMidPoint(e,r[o],r[o+1],o+1,n)),i=s[0]-t.width/2,a=s[1]-t.height/2}return{x:i,y:a}}),v(Ob,`getMinMaxXYWithBoundText`,(e,t,n,r)=>{let[i,a,o,s]=n,c=(i+o)/2,l=(a+s)/2,{x:u,y:d}=Ob.getBoundTextElementPosition(e,r,t),f=u+r.width,p=d+r.height,m=P(c,l),h=F(P(i,a),m,e.angle),g=F(P(o,a),m,e.angle),_=F(P(u,d),m,-e.angle),v=F(P(f,d),m,-e.angle),y=F(P(u,p),m,-e.angle),b=F(P(f,p),m,-e.angle);return h[0]<g[0]&&h[1]>=g[1]?(i=Math.min(i,y[0]),o=Math.max(o,Math.max(v[0],b[0])),a=Math.min(a,_[1]),s=Math.max(s,b[1])):h[0]>=g[0]&&h[1]>g[1]?(i=Math.min(i,b[0]),o=Math.max(o,Math.max(_[0],v[0])),a=Math.min(a,y[1]),s=Math.max(s,v[1])):h[0]>=g[0]?(i=Math.min(i,v[0]),o=Math.max(o,y[0]),a=Math.min(a,b[1]),s=Math.max(s,_[1])):h[1]<=g[1]&&(i=Math.min(i,Math.min(v[0],_[0])),o=Math.max(o,b[0]),a=Math.min(a,v[1]),s=Math.max(s,y[1])),[i,a,o,s,c,l]}),v(Ob,`getElementAbsoluteCoords`,(e,t,n=!1)=>{let r,i,a,o,s;if(e.points.length<2||!Sf.get(e)){let{minX:t,minY:n,maxX:r,maxY:c}=e.points.reduce((e,[t,n])=>(e.minY=Math.min(e.minY,n),e.minX=Math.min(e.minX,t),e.maxX=Math.max(e.maxX,t),e.maxY=Math.max(e.maxY,n),e),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});i=t+e.x,a=n+e.y,o=r+e.x,s=c+e.y}else{let[t,n,r,c]=dv(eg(Sf.generateElementShape(e,null)[0]));i=t+e.x,a=n+e.y,o=r+e.x,s=c+e.y}let c=(i+o)/2,l=(a+s)/2;if(r=[i,a,o,s,c,l],!n)return r;let u=zb(e,t);return u&&(r=Ob.getMinMaxXYWithBoundText(e,t,[i,a,o,s],u)),r});var U=Ob,kb=e=>{let t=[...new Set(e.filter(e=>e!==null&&e!==-1))];return t=t.sort((e,t)=>e-t),t.length?t:null},Ab={},jb=(e,t)=>{let n=Ab[e]||(Ab[e]={height:t});return n.height=t,n},Mb=e=>{Ab[e]&&delete Ab[e]},Nb=e=>Ab[e]?.height??null,Pb=(e,t,n,r=!0)=>{let i,a={x:e.x,y:e.y,text:e.text,width:e.width,height:e.height,angle:t?.angle??e.angle};a.text=e.text,(t||!e.autoResize)&&(i=t?Yb(t,e):e.width,a.text=hf(e.originalText,cu(e),i));let o=Id(a.text,cu(e),e.lineHeight);if(e.autoResize&&(a.width=o.width),a.height=o.height,t){let i=Xb(t,e),s=Yb(t,e);if(!bd(t)&&o.height>i){let e=Jb(o.height,t.type);K(t,{height:e},r),jb(t.id,e)}o.width>s&&K(t,{width:Jb(o.width,t.type)},r);let{x:c,y:l}=Lb(t,{...e,...a},n);a.x=c,a.y=l}K(e,a,r)},Fb=(e,t,n)=>{let r=Nu(e);t.forEach(e=>{let t=n.get(e.id),i=Rb(e);if(i){let a=n.get(i);if(a){let n=r.get(t);n&&K(n,{boundElements:(e.boundElements||[]).filter(e=>e.id!==a&&e.id!==i).concat({type:`text`,id:a})});let o=r.get(a);o&&R(o)&&K(o,{containerId:n?t:null})}}})},Ib=(e,t,n,r=!1)=>{if(!Rb(e))return;Mb(e.id);let i=zb(e,t);if(i&&i.text){if(!e)return;let a=i.text,o=i.height,s=i.width,c=Yb(e,i),l=Xb(e,i),u=e.height;if(r||n!==`n`&&n!==`s`){a&&=hf(i.originalText,cu(i),c);let e=Id(a,cu(i),i.lineHeight);o=e.height,s=e.width}if(o>l){u=Jb(o,e.type);let t=u-e.height,r=!bd(e)&&(n===`ne`||n===`nw`||n===`n`)?e.y-t:e.y;K(e,{height:u,y:r})}K(i,{text:a,width:s,height:o}),bd(e)||K(i,Lb(e,i,t))}},Lb=(e,t,n)=>{if(bd(e))return U.getBoundTextElementPosition(e,t,n);let r=Hb(e),i=Xb(e,t),a=Yb(e,t),o,s;return s=t.verticalAlign===Ec.TOP?r.y:t.verticalAlign===Ec.BOTTOM?r.y+(i-t.height):r.y+(i/2-t.height/2),o=t.textAlign===Dc.LEFT?r.x:t.textAlign===Dc.RIGHT?r.x+(a-t.width):r.x+(a/2-t.width/2),{x:o,y:s}},Rb=e=>e?.boundElements?.length&&e?.boundElements?.find(e=>e.type===`text`)?.id||null,zb=(e,t)=>{if(!e)return null;let n=Rb(e);return n&&t.get(n)||null},Bb=(e,t)=>e&&e.containerId&&t.get(e.containerId)||null,Vb=(e,t,n)=>{if(!bd(e))return{x:e.x+e.width/2,y:e.y+e.height/2};let r=U.getPointsGlobalCoordinates(e,n);if(r.length%2==1){let t=Math.floor(e.points.length/2),r=U.getPointGlobalCoordinates(e,e.points[t],n);return{x:r[0],y:r[1]}}let i=e.points.length/2-1,a=U.getEditorMidPoints(e,n,t)[i];return a||=U.getSegmentMidPoint(e,r[i],r[i+1],i+1,n),{x:a[0],y:a[1]}},Hb=e=>{let t=5,n=5;return e.type===`ellipse`&&(t+=e.width/2*(1-Math.sqrt(2)/2),n+=e.height/2*(1-Math.sqrt(2)/2)),e.type===`diamond`&&(t+=e.width/4,n+=e.height/4),{x:e.x+t,y:e.y+n}},Ub=(e,t)=>!t||bd(t)?e.angle:t.angle,Wb=(e,t)=>e.some(e=>Ad(e)?!bd(Bb(e,t)):!1),Gb=(e,t)=>e.some(e=>Ad(e)?!bd(Bb(e,t)):R(e)),Kb=new Set([`rectangle`,`ellipse`,`diamond`,`arrow`]),qb=e=>Kb.has(e.type),Jb=(e,t)=>(e=Math.ceil(e),t===`ellipse`?Math.round((e+10)/Math.sqrt(2)*2):t===`arrow`?e+80:t===`diamond`?2*(e+10):e+10),Yb=(e,t)=>{let{width:n}=e;if(bd(e)){let e=(t?.fontSize??20)*Tc;return Math.max(wc*n,e)}return e.type===`ellipse`?Math.round(n/2*Math.sqrt(2))-10:e.type===`diamond`?Math.round(n/2)-10:n-10},Xb=(e,t)=>{let{height:n}=e;return bd(e)?n-80<=0?t.height:n:e.type===`ellipse`?Math.round(n/2*Math.sqrt(2))-10:e.type===`diamond`?Math.round(n/2)-10:n-10},Zb=(e,t=`
|
|
32
|
+
|
|
33
|
+
`)=>e.reduce((e,t)=>(R(t)&&e.push(t.text),e),[]).join(t),Qb=e=>(e=e.trim(),e&&(0,Qo.sanitizeUrl)(sd(e))),$b=e=>!!(e?.includes(location.origin)||e?.startsWith(`/`)),ex=e=>{if(e=Qb(e),e.startsWith(`/`))return`${location.origin}${e}`;try{new URL(e)}catch{return`about:blank`}return e},tx=[],W=e=>(tx=tx.concat(e),e),nx=`<svg viewBox="0 0 24 24" stroke-width="1" width="28" height="28" xmlns="http://www.w3.org/2000/svg">`,rx=`<path d="M6.164 11.755a5.314 5.314 0 0 1-4.932-5.298 5.314 5.314 0 0 1 5.311-5.311 5.314 5.314 0 0 1 5.307 5.113l8.773 8.773a3.322 3.322 0 0 1 0 4.696l-.895.895a3.322 3.322 0 0 1-4.696 0l-8.868-8.868Z" style="fill:#fff"/>`,ix=`<path stroke="#1b1b1f" fill="#fff" d="m7.868 11.113 7.773 7.774a2.359 2.359 0 0 0 1.667.691 2.368 2.368 0 0 0 2.357-2.358c0-.625-.248-1.225-.69-1.667L11.201 7.78 9.558 9.469l-1.69 1.643v.001Zm10.273 3.606-3.333 3.333m-3.25-6.583 2 2m-7-7 3 3M3.664 3.625l1 1M2.529 6.922l1.407-.144m5.735-2.932-1.118.866M4.285 9.823l.758-1.194m1.863-6.207-.13 1.408"/>`,ax=`data:${j.svg},${encodeURIComponent(`${nx}${ix}</svg>`)}`,ox=`data:${j.svg},${encodeURIComponent(`${nx}${rx}${ix}</svg>`)}`,sx=e=>{e&&(e.style.cursor=``)},cx=(e,t)=>{e&&(e.style.cursor=t)},lx,ux,dx=(e,t)=>{(!lx||lx.theme!==t)&&(()=>{let e=t===Qs.DARK;lx=document.createElement(`canvas`),lx.theme=t,lx.height=20,lx.width=20;let n=lx.getContext(`2d`);n.lineWidth=1,n.beginPath(),n.arc(lx.width/2,lx.height/2,5,0,2*Math.PI),n.fillStyle=e?Ui.black:Ui.white,n.fill(),n.strokeStyle=e?Ui.white:Ui.black,n.stroke(),ux=lx.toDataURL(j.svg)})(),cx(e,`url(${ux}) 10 10, auto`)},fx=(e,t)=>{if(e){if(t.activeTool.type===`selection`)sx(e);else if($c(t))e.style.cursor=Vs.GRAB;else if(Qc(t))dx(e,t.theme);else if(t.activeTool.type===`laser`){let n=t.theme===Qs.LIGHT?ax:ox;e.style.cursor=`url(${n}), auto`}else[`image`,`custom`].includes(t.activeTool.type)?t.activeTool.type!==`image`&&(e.style.cursor=Vs.AUTO):e.style.cursor=Vs.CROSSHAIR}},px=new da(Date.now()),mx=0,hx=()=>Math.floor(px.next()*2**31),gx=()=>Lu()?`id${mx++}`:Wi(),_x=(e,{x:t,y:n,strokeColor:r=Nc.strokeColor,backgroundColor:i=Nc.backgroundColor,fillStyle:a=Nc.fillStyle,strokeWidth:o=Nc.strokeWidth,strokeStyle:s=Nc.strokeStyle,roughness:c=Nc.roughness,opacity:l=Nc.opacity,width:u=0,height:d=0,angle:f=0,groupIds:p=[],frameId:m=null,index:h=null,roundness:g=null,boundElements:_=null,link:v=null,locked:y=Nc.locked,...b})=>((t<-1e6||t>1e6||n<-1e6||n>1e6||u<-1e6||u>1e6||d<-1e6||d>1e6)&&console.error(`New element size or position is too large`,{x:t,y:n,width:u,height:d,points:b.points}),{id:b.id||gx(),type:e,x:t,y:n,width:u,height:d,angle:f,strokeColor:r,backgroundColor:i,fillStyle:a,strokeWidth:o,strokeStyle:s,roughness:c,opacity:l,groupIds:p,frameId:m,index:h,roundness:g,seed:b.seed??hx(),version:b.version||1,versionNonce:b.versionNonce??0,isDeleted:!1,boundElements:_,updated:Mu(),link:v,locked:y,customData:b.customData}),vx=e=>_x(e.type,e),yx=e=>_x(`embeddable`,e),bx=e=>({..._x(`iframe`,e)}),xx=e=>iE({..._x(`frame`,e),type:`frame`,name:e?.name||null},{}),Sx=e=>iE({..._x(`magicframe`,e),type:`magicframe`,name:e?.name||null},{}),Cx=(e,t)=>({x:e.textAlign===`center`?t.width/2:e.textAlign===`right`?t.width:0,y:e.verticalAlign===`middle`?t.height/2:0}),wx=e=>{let t=e.fontFamily||tc,n=e.fontSize||20,r=e.lineHeight||Xh(t),i=Vd(e.text),a=Id(i,cu({fontFamily:t,fontSize:n}),r),o=e.textAlign||`left`,s=e.verticalAlign||`top`,c=Cx({textAlign:o,verticalAlign:s},a);return iE({..._x(`text`,e),text:i,fontSize:n,fontFamily:t,textAlign:o,verticalAlign:s,x:e.x-c.x,y:e.y-c.y,width:a.width,height:a.height,containerId:e.containerId||null,originalText:e.originalText??i,autoResize:e.autoResize??!0,lineHeight:r},{})},Tx=(e,t,n)=>{let{width:r,height:i}=Id(n,cu(e),e.lineHeight);e.autoResize||(r=e.width);let{textAlign:a,verticalAlign:o}=e,s,c;if(a===`center`&&o===Ec.MIDDLE&&!e.containerId&&e.autoResize){let t=Id(e.text,cu(e),e.lineHeight),n=Cx(e,{width:r-t.width,height:i-t.height});s=e.x-n.x,c=e.y-n.y}else{let[n,o,l,u]=av(e,t),[d,f,p,m]=Sv(e,r,i,!1),h=(n-d)/2,g=(o-f)/2,_=(l-p)/2,v=(u-m)/2;[s,c]=Ex({s:!0,e:a===`center`||a===`left`,w:a===`center`||a===`right`},e.x,e.y,e.angle,h,g,_,v)}return{width:r,height:i,x:Number.isFinite(s)?s:e.x,y:Number.isFinite(c)?c:e.y}},Ex=(e,t,n,r,i,a,o,s)=>{let c=Math.cos(r),l=Math.sin(r);return e.e&&e.w?t+=i+o:e.e?(t+=i*(1+c),n+=i*l,t+=o*(1-c),n+=o*-l):e.w&&(t+=i*(1-c),n+=i*-l,t+=o*(1+c),n+=o*l),e.n&&e.s?n+=a+s:e.n?(t+=a*l,n+=a*(1-c),t+=s*-l,n+=s*(1+c)):e.s&&(t+=a*-l,n+=a*(1+c),t+=s*l,n+=s*(1-c)),[t,n]},Dx=(e,t,n,r=e.text)=>{if(e.isDeleted)return;(t||!e.autoResize)&&(r=hf(r,cu(e),t?Yb(t,e):e.width));let i=Tx(e,n,r);return{text:r,...i}},Ox=e=>({..._x(e.type,e),points:e.points||[],pressures:e.pressures||[],simulatePressure:e.simulatePressure,lastCommittedPoint:null}),kx=e=>({..._x(e.type,e),points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:null,endArrowhead:null}),Ax=e=>e.elbowed?{..._x(e.type,e),points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead||null,endArrowhead:e.endArrowhead||null,elbowed:!0,fixedSegments:e.fixedSegments||[],startIsSpecial:!1,endIsSpecial:!1}:{..._x(e.type,e),points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead||null,endArrowhead:e.endArrowhead||null,elbowed:!1},jx=e=>({..._x(`image`,e),strokeColor:`transparent`,status:e.status??`pending`,fileId:e.fileId??null,scale:e.scale??[1,1],crop:e.crop??null}),Mx=(e,t=0)=>{if(typeof e!=`object`||!e)return e;let n=Object.prototype.toString.call(e);if(n===`[object Object]`){let n=typeof e.constructor==`function`?Object.create(Object.getPrototypeOf(e)):{};for(let r in e)if(e.hasOwnProperty(r)){if(t===0&&(r===`shape`||r===`canvas`))continue;n[r]=Mx(e[r],t+1)}return n}if(Array.isArray(e)){let n=e.length,r=Array(n);for(;n--;)r[n]=Mx(e[n],t+1);return r}return f.DEV&&n!==`[object Object]`&&n!==`[object Array]`&&n.startsWith(`[object `)&&console.warn(`_deepCloneElement: unexpected object type ${n}. This value will not be cloned!`),e},Nx=e=>Mx(e),Px=(e,t)=>{Object.defineProperty(e,Wc,{value:t,writable:!1,enumerable:!1})},Fx=()=>gx(),Ix=(e,t,n,r)=>{let i=Nx(n);return Lu()&&Px(i,n.id),i.id=Fx(),i.boundElements=null,i.updated=Mu(),i.seed=hx(),i.groupIds=Yy(i.groupIds,e,e=>(t.has(e)||t.set(e,Fx()),t.get(e))),r&&(i=Object.assign(i,r)),i},Lx=(e,t)=>{let n=[],r=Nu(e),i=new Map,a=e=>{if(i.has(e))return i.get(e);if(r.has(e)){let t=Fx();return i.set(e,t),t}return null},o=new Map;for(let r of e){let e=Mx(r);if(e.id=a(r.id),Lu()&&Px(e,r.id),t?.randomizeSeed&&(e.seed=hx(),aE(e)),e.groupIds&&=e.groupIds.map(e=>(o.has(e)||o.set(e,Fx()),o.get(e))),`containerId`in e&&e.containerId&&(e.containerId=a(e.containerId)),`boundElements`in e&&e.boundElements&&(e.boundElements=e.boundElements.reduce((e,t)=>{let n=a(t.id);return n&&e.push({...t,id:n}),e},[])),`endBinding`in e&&e.endBinding){let t=a(e.endBinding.elementId);e.endBinding=t?{...e.endBinding,elementId:t}:null}if(`startBinding`in e&&e.startBinding){let t=a(e.startBinding.elementId);e.startBinding=t?{...e.startBinding,elementId:t}:null}e.frameId&&=a(e.frameId),n.push(e)}return n},Rx=(e,{shouldThrow:t=!1,includeBoundTextValidation:n=!1,ignoreLogs:r,reconciliationContext:i})=>{let a=[],o=e=>`${e?.index}:${e?.id}:${e?.type}:${e?.isDeleted}:${e?.version}:${e?.versionNonce}`,s=e.map(e=>e.index);for(let[t,r]of s.entries()){let i=s[t-1],c=s[t+1];if(Wx(r,i,c)||a.push(`Fractional indices invariant has been compromised: "${o(e[t-1])}", "${o(e[t])}", "${o(e[t+1])}"`),n&&kd(e[t])){let n=e[t],r=zb(n,Nu(e));r&&r.index<=n.index&&a.push(`Fractional indices invariant for bound elements has been compromised: "${o(r)}", "${o(n)}"`)}}if(a.length){let n=new xh,s=[];if(i&&(s.push(`Additional reconciliation context:`),s.push(i.localElements.map(e=>o(e))),s.push(i.remoteElements.map(e=>o(e)))),r||console.error(a.join(`
|
|
34
|
+
|
|
35
|
+
`),n.stack,e.map(e=>o(e)),...s),t)throw n}},zx=e=>e.sort((e,t)=>Kx(e)&&Kx(t)?e.index<t.index?-1:e.index>t.index?1:e.id<t.id?-1:1:1),Bx=(e,t)=>{try{let n=Gx(e,Hx(e,t));Rx(e.map(e=>n.has(e)?{...e,...n.get(e)}:e),{includeBoundTextValidation:!1,shouldThrow:!0,ignoreLogs:!0});for(let[e,t]of n)K(e,t,!1)}catch{Vx(e)}return e},Vx=e=>{let t=Gx(e,Ux(e));for(let[e,n]of t)K(e,n,!1);return e},Hx=(e,t)=>{let n=[],r=0;for(;r<e.length;)if(t.has(e[r].id)){let i=[r-1,r];for(;++r<e.length&&t.has(e[r].id);)i.push(r);i.push(r),n.push(i)}else r++;return n},Ux=e=>{let t=[],n,r,i=-1,a=0,o=t=>{let n=e[i]?e[i].index:void 0,r=e[t-1]?.index;return!n&&r||n&&r&&r>n?[r,t-1]:[n,i]},s=t=>{let n=e[a]?e[a].index:void 0;if(n&&t<a)return[n,a];let r=a;for(;++r<e.length;){let t=e[r]?.index;if(!n&&t||n&&t&&t>n)return[t,r]}return[void 0,r]},c=0;for(;c<e.length;){let l=e[c].index;if([n,i]=o(c),[r,a]=s(c),Wx(l,n,r))c++;else{let l=[i,c];for(;++c<e.length;){let t=e[c].index,[u,d]=o(c),[f,p]=s(c);if(Wx(t,u,f))break;[n,i]=[u,d],[r,a]=[f,p],l.push(c)}l.push(a),t.push(l)}}return t},Wx=(e,t,n)=>e?t&&n?t<e&&e<n:!t&&n?e<n:t&&!n?t<e:!!e:!1,Gx=(e,t)=>{let n=new Map;for(let r of t){let t=r.shift(),i=r.pop(),a=cs(e[t]?.index,e[i]?.index,r.length);for(let t=0;t<r.length;t++){let i=e[r[t]];n.set(i,{index:a[t]})}}return n},Kx=e=>!!e.index,qx=class e{constructor(e,t){this.deleted=e,this.inserted=t}static create(t,n,r,i){let a=r&&i!==`inserted`?r(t):t,o=r&&i!==`deleted`?r(n):n;return new e(a,o)}static calculate(t,n,r,i){if(t===n)return e.empty();let a={},o={};for(let e of this.distinctKeysIterator(`full`,t,n))a[e]=t[e],o[e]=n[e];let[s,c]=i?i(a,o):[a,o];return e.create(s,c,r)}static empty(){return new e({},{})}static isEmpty(e){return!Object.keys(e.deleted).length&&!Object.keys(e.inserted).length}static mergeObjects(e,t,n){let r={...e};for(let e of Object.keys(n))delete r[e];return{...r,...t}}static mergeArrays(t,n,r,i){return Object.values(e.mergeObjects(Fu(t??[],i),Fu(n??[],i),Fu(r??[],i)))}static diffObjects(t,n,r,i){if(!(!t[r]&&!n[r])&&(typeof t[r]==`object`||typeof n[r]==`object`)){let a=t[r]??{},o=n[r]??{},s=e.getLeftDifferences(a,o).reduce((e,t)=>(e[t]=i(a[t]),e),{}),c=e.getRightDifferences(a,o).reduce((e,t)=>(e[t]=i(o[t]),e),{});Object.keys(s).length||Object.keys(c).length?(Reflect.set(t,r,s),Reflect.set(n,r,c)):(Reflect.deleteProperty(t,r),Reflect.deleteProperty(n,r))}}static diffArrays(t,n,r,i){if(!(!t[r]&&!n[r])&&(Array.isArray(t[r])||Array.isArray(n[r]))){let a=Array.isArray(t[r])?t[r]:[],o=Array.isArray(n[r])?n[r]:[],s=Fu(e.getLeftDifferences(Fu(a,i),Fu(o,i))),c=Fu(e.getRightDifferences(Fu(a,i),Fu(o,i)));if(Object.keys(s).length||Object.keys(c).length){let e=a.filter(e=>s[i?i(e):String(e)]),l=o.filter(e=>c[i?i(e):String(e)]);Reflect.set(t,r,e),Reflect.set(n,r,l)}else Reflect.deleteProperty(t,r),Reflect.deleteProperty(n,r)}}static isLeftDifferent(e,t,n=!1){return!!this.distinctKeysIterator(`left`,e,t,n).next().value}static isRightDifferent(e,t,n=!1){return!!this.distinctKeysIterator(`right`,e,t,n).next().value}static getLeftDifferences(e,t,n=!1){return Array.from(this.distinctKeysIterator(`left`,e,t,n))}static getRightDifferences(e,t,n=!1){return Array.from(this.distinctKeysIterator(`right`,e,t,n))}static*distinctKeysIterator(e,t,n,r=!1){if(t===n)return;let i=[];e===`left`?i=Object.keys(t):e===`right`?i=Object.keys(n):e===`full`?i=Array.from(new Set([...Object.keys(t),...Object.keys(n)])):Ju(e,`Unknown distinctKeysIterator's join param "${e}"`,!0);for(let e of i){let i=t[e],a=n[e];if(i!==a){if(!r&&typeof i==`object`&&typeof a==`object`&&i!==null&&a!==null&&Ku(i,a))continue;yield e}}}},Jx=class e{constructor(e){this.delta=e}static calculate(t,n){let r=qx.calculate(t,n,void 0,e.postProcess);return new e(r)}static empty(){return new e(qx.create({},{}))}inverse(){let t=qx.create(this.delta.inserted,this.delta.deleted);return new e(t)}applyTo(e,t){try{let{selectedElementIds:n={},selectedGroupIds:r={}}=this.delta.deleted,{selectedElementIds:i={},selectedGroupIds:a={},selectedLinearElementId:o,editingLinearElementId:s,...c}=this.delta.inserted,l=qx.mergeObjects(e.selectedElementIds,i,n),u=qx.mergeObjects(e.selectedGroupIds,a,r),d=o&&t.has(o)?new U(t.get(o)):null,f=s&&t.has(s)?new U(t.get(s)):null,p={...e,...c,selectedElementIds:l,selectedGroupIds:u,selectedLinearElement:typeof o<`u`?d:e.selectedLinearElement,editingLinearElement:typeof s<`u`?f:e.editingLinearElement};return[p,this.filterInvisibleChanges(e,p,t)]}catch(t){if(console.error(`Couldn't apply appstate change`,t),f.DEV||f.MODE===Gs.TEST)throw t;return[e,!1]}}isEmpty(){return qx.isEmpty(this.delta)}static postProcess(e,t){try{qx.diffObjects(e,t,`selectedElementIds`,e=>!0),qx.diffObjects(e,t,`selectedGroupIds`,e=>e??!1)}catch(e){if(console.error(`Couldn't postprocess appstate change deltas.`),f.DEV||f.MODE===Gs.TEST)throw e}finally{return[e,t]}}filterInvisibleChanges(t,n,r){let i=$x(t),a=$x(n),o=qx.isRightDifferent(e.stripElementsProps(i),e.stripElementsProps(a)),s=qx.isRightDifferent(e.stripStandaloneProps(i),e.stripStandaloneProps(a));if(!o&&!s)return!1;let c={value:o};if(s){let t=qx.getRightDifferences(e.stripStandaloneProps(i),e.stripStandaloneProps(a)),o=new Set;(t.includes(`editingGroupId`)||t.includes(`selectedGroupIds`))&&(o=$y(r));for(let i of t)switch(i){case`selectedElementIds`:n[i]=e.filterSelectedElements(n[i],r,c);break;case`selectedGroupIds`:n[i]=e.filterSelectedGroups(n[i],o,c);break;case`croppingElementId`:{let e=n[i],t=e&&r.get(e);t&&!t.isDeleted?c.value=!0:n[i]=null;break}case`editingGroupId`:let t=n[i];t?o.has(t)?c.value=!0:n[i]=null:c.value=!0;break;case`selectedLinearElementId`:case`editingLinearElementId`:let a=e.convertToAppStateKey(i),s=n[a];if(!s)c.value=!0;else{let e=r.get(s.elementId);e&&!e.isDeleted?c.value=!0:n[a]=null}break;default:Ju(i,`Unknown ObservedElementsAppState's key "${i}"`,!0)}}return c.value}static convertToAppStateKey(e){switch(e){case`selectedLinearElementId`:return`selectedLinearElement`;case`editingLinearElementId`:return`editingLinearElement`}}static filterSelectedElements(e,t,n){let r=Object.keys(e);if(!r.length)return n.value=!0,e;let i={...e};for(let e of r){let r=t.get(e);r&&!r.isDeleted?n.value=!0:delete i[e]}return i}static filterSelectedGroups(e,t,n){if(!Object.keys(e).length)return n.value=!0,e;let r={...e};for(let e of Object.keys(r))t.has(e)?n.value=!0:delete r[e];return r}static stripElementsProps(e){let{editingGroupId:t,selectedGroupIds:n,selectedElementIds:r,editingLinearElementId:i,selectedLinearElementId:a,croppingElementId:o,...s}=e;return s}static stripStandaloneProps(e){let{name:t,viewBackgroundColor:n,...r}=e;return r}},Yx=class e{constructor(e,t,n){this.added=e,this.removed=t,this.updated=n}static create(t,n,r,i={shouldRedistribute:!1}){let a;if(i.shouldRedistribute){let i=new Map,o=new Map,s=new Map,c=[...t,...n,...r];for(let[e,t]of c)this.satisfiesAddition(t)?i.set(e,t):this.satisfiesRemoval(t)?o.set(e,t):s.set(e,t);a=new e(i,o,s)}else a=new e(t,n,r);return(f.DEV||f.MODE===Gs.TEST)&&(e.validate(a,`added`,this.satisfiesAddition),e.validate(a,`removed`,this.satisfiesRemoval),e.validate(a,`updated`,this.satisfiesUpdate)),a}static validate(e,t,n){for(let[r,i]of e[t].entries())if(!n(i))throw console.error(`Broken invariant for "${t}" delta, element "${r}", delta:`,i),Error(`ElementsChange invariant broken for element "${r}".`)}static calculate(t,n){if(t===n)return e.empty();let r=new Map,i=new Map,a=new Map;for(let r of t.values())if(!n.get(r.id)){let t={...r,isDeleted:!1},n=qx.create(t,{isDeleted:!0},e.stripIrrelevantProps);i.set(r.id,n)}for(let o of n.values()){let n=t.get(o.id);if(!n){let t={isDeleted:!0},n={...o,isDeleted:!1},i=qx.create(t,n,e.stripIrrelevantProps);r.set(o.id,i);continue}if(n.versionNonce!==o.versionNonce){let t=qx.calculate(n,o,e.stripIrrelevantProps,e.postProcess);if(typeof n.isDeleted==`boolean`&&typeof o.isDeleted==`boolean`&&n.isDeleted!==o.isDeleted){n.isDeleted&&!o.isDeleted?r.set(o.id,t):i.set(o.id,t);continue}qx.isEmpty(t)||a.set(o.id,t)}}return e.create(r,i,a)}static empty(){return e.create(new Map,new Map,new Map)}inverse(){let t=e=>{let t=new Map;for(let[n,r]of e.entries())t.set(n,qx.create(r.inserted,r.deleted));return t},n=t(this.added),r=t(this.removed),i=t(this.updated);return e.create(r,n,i)}isEmpty(){return this.added.size===0&&this.removed.size===0&&this.updated.size===0}applyLatestChanges(t){let n=e=>t=>{let n={};for(let r of Object.keys(t))switch(r){case`boundElements`:n[r]=t[r];break;default:n[r]=e[r]}return n},r=e=>{let r=new Map;for(let[i,a]of e.entries()){let e=t.get(i);if(e){let t=qx.create(a.deleted,a.inserted,n(e),`inserted`);r.set(i,t)}else r.set(i,a)}return r},i=r(this.added),a=r(this.removed),o=r(this.updated);return e.create(i,a,o,{shouldRedistribute:!0})}applyTo(t,n){let r=rd(new Map(t)),i,a={containsVisibleDifference:!1,containsZindexDifference:!1};try{let o=e.createApplier(r,n,a),s=o(this.added),c=o(this.removed),l=o(this.updated),u=this.resolveConflicts(t,r);i=new Map([...s,...c,...l,...u])}catch(e){if(console.error(`Couldn't apply elements change`,e),f.DEV||f.MODE===Gs.TEST)throw e;return[t,!0]}try{e.redrawTextBoundingBoxes(r,i),r=e.reorderElements(r,i,a),e.redrawBoundArrows(r,i)}catch(e){if(console.error(`Couldn't mutate elements after applying elements change`,e),f.DEV||f.MODE===Gs.TEST)throw e}finally{return[r,a.containsVisibleDifference]}}static applyDelta(t,n,r={containsVisibleDifference:!0,containsZindexDifference:!0}){let{boundElements:i,...a}=n.inserted;if(n.deleted.boundElements?.length||n.inserted.boundElements?.length){let e=qx.mergeArrays(t.boundElements,n.inserted.boundElements,n.deleted.boundElements,e=>e.id);Object.assign(a,{boundElements:e})}if(ud(t)){let e=n;(e.deleted.crop||e.inserted.crop)&&Object.assign(a,{crop:e.inserted.crop??null})}if(!r.containsVisibleDifference){let{index:n,...i}=a;r.containsVisibleDifference=e.checkForVisibleDifference(t,i)}return r.containsZindexDifference||=n.deleted.index!==n.inserted.index,iE(t,a)}static checkForVisibleDifference(e,t){return e.isDeleted&&t.isDeleted!==!1?!1:e.isDeleted&&t.isDeleted===!1||e.isDeleted===!1&&t.isDeleted?!0:qx.isRightDifferent(e,t)}resolveConflicts(t,n){let r=new Map,i=(e,i)=>{let a=n.get(e.id);if(!a)return;let o;o=t.get(e.id)===a?iE(a,i):K(a,i),r.set(o.id,o),n.set(o.id,o)};for(let[r]of this.removed)e.unbindAffected(t,n,r,i);for(let[r]of this.added)e.rebindAffected(t,n,r,i);for(let[r]of Array.from(this.updated).filter(([e,t])=>Object.keys({...t.deleted,...t.inserted}).find(e=>wy.has(e)))){let a=n.get(r);!a||a.isDeleted||e.rebindAffected(t,n,r,i)}let a=new Map(Array.from(t).filter(([e])=>r.has(e))),{added:o,removed:s,updated:c}=e.calculate(a,r);for(let[e,t]of o)this.added.set(e,t);for(let[e,t]of s)this.removed.set(e,t);for(let[e,t]of c)this.updated.set(e,t);return r}static unbindAffected(e,t,n,r){let i=()=>e.get(n),a=()=>t.get(n);Dy.unbindAffected(t,i(),r),Dy.unbindAffected(t,a(),r),Oy.unbindAffected(t,i(),r),Oy.unbindAffected(t,a(),r)}static rebindAffected(e,t,n,r){let i=()=>e.get(n),a=()=>t.get(n);Dy.unbindAffected(t,i(),r),Dy.rebindAffected(t,a(),r),Oy.unbindAffected(t,i(),(e,t)=>{R(e)&&r(e,t)}),Oy.rebindAffected(t,a(),r)}static redrawTextBoundingBoxes(e,t){let n=new Map;for(let r of t.values()){if(Ad(r)){let{containerId:t}=r,i=t?e.get(t):void 0;i&&n.set(i.id,{container:i,boundText:r})}if(kd(r)){let t=Rb(r),i=t?e.get(t):void 0;i&&n.set(r.id,{container:r,boundText:i})}}for(let{container:t,boundText:r}of n.values())t.isDeleted||r.isDeleted||Pb(r,t,e,!1)}static redrawBoundArrows(e,t){for(let n of t.values())!n.isDeleted&&wd(n)&&ny(n,e,{changedElements:t})}static reorderElements(e,t,n){if(!n.containsZindexDifference)return e;let r=Array.from(e.values()),i=zx([...r]),a=qx.getRightDifferences(r,i,!0).reduce((e,n)=>{let i=r[Number(n)];return i&&t.has(i.id)&&e.set(i.id,i),e},new Map);return!n.containsVisibleDifference&&a.size&&(n.containsVisibleDifference=!0),Nu(Bx(i,a))}static postProcess(e,t){try{qx.diffArrays(e,t,`boundElements`,e=>e.id)}catch(e){if(console.error(`Couldn't postprocess elements change deltas.`),f.DEV||f.MODE===Gs.TEST)throw e}finally{return[e,t]}}static stripIrrelevantProps(e){let{id:t,updated:n,version:r,versionNonce:i,seed:a,...o}=e;return o}};v(Yx,`satisfiesAddition`,({deleted:e,inserted:t})=>e.isDeleted===!0&&!t.isDeleted),v(Yx,`satisfiesRemoval`,({deleted:e,inserted:t})=>!e.isDeleted&&t.isDeleted===!0),v(Yx,`satisfiesUpdate`,({deleted:e,inserted:t})=>!!e.isDeleted==!!t.isDeleted),v(Yx,`createApplier`,(e,t,n)=>{let r=Yx.createGetter(e,t,n);return t=>Array.from(t.entries()).reduce((t,[i,a])=>{let o=r(i,a.inserted);if(o){let r=Yx.applyDelta(o,a,n);e.set(r.id,r),t.set(r.id,r)}return t},new Map)}),v(Yx,`createGetter`,(e,t,n)=>(r,i)=>{let a=e.get(r);return a||(a=t.get(r),a&&(n.containsZindexDifference=!0,(i.isDeleted===!1||i.isDeleted!==!0&&a.isDeleted===!1)&&(n.containsVisibleDifference=!0))),a});var Xx=Yx,Zx=class{constructor(){v(this,`subscribers`,[])}on(...e){let t=e.flat().filter(e=>typeof e==`function`);return this.subscribers.push(...t),()=>this.off(t)}once(...e){let t=e.flat().filter(e=>typeof e==`function`);t.push(()=>n());let n=this.on(...t);return n}off(...e){let t=e.flat();this.subscribers=this.subscribers.filter(e=>!t.includes(e))}trigger(...e){for(let t of this.subscribers)t(...e);return this}clear(){this.subscribers=[]}},Qx=`__observedAppState`,$x=e=>{let t={name:e.name,editingGroupId:e.editingGroupId,viewBackgroundColor:e.viewBackgroundColor,selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,editingLinearElementId:e.editingLinearElement?.elementId||null,selectedLinearElementId:e.selectedLinearElement?.elementId||null,croppingElementId:e.croppingElementId};return Reflect.defineProperty(t,Qx,{value:!0,enumerable:!1}),t},eS=e=>!!Reflect.get(e,Qx),G={IMMEDIATELY:`IMMEDIATELY`,NEVER:`NEVER`,EVENTUALLY:`EVENTUALLY`},tS=class{constructor(e,t){this.elementsChange=e,this.appStateChange=t}},nS=class{constructor(){v(this,`onStoreIncrementEmitter`,new Zx),v(this,`scheduledActions`,new Set),v(this,`_snapshot`,rS.empty()),v(this,`shouldCaptureIncrement`,()=>{this.scheduleAction(G.IMMEDIATELY)}),v(this,`shouldUpdateSnapshot`,()=>{this.scheduleAction(G.NEVER)}),v(this,`scheduleAction`,e=>{this.scheduledActions.add(e),this.satisfiesScheduledActionsInvariant()}),v(this,`commit`,(e,t)=>{try{this.scheduledActions.has(G.IMMEDIATELY)?this.captureIncrement(e,t):this.scheduledActions.has(G.NEVER)&&this.updateSnapshot(e,t)}finally{this.satisfiesScheduledActionsInvariant(),this.scheduledActions=new Set}}),v(this,`captureIncrement`,(e,t)=>{let n=this.snapshot,r=this.snapshot.maybeClone(e,t);if(n!==r){let e=r.meta.didElementsChange?Xx.calculate(n.elements,r.elements):Xx.empty(),t=r.meta.didAppStateChange?Jx.calculate(n.appState,r.appState):Jx.empty();(!e.isEmpty()||!t.isEmpty())&&this.onStoreIncrementEmitter.trigger(new tS(e,t)),this.snapshot=r}}),v(this,`updateSnapshot`,(e,t)=>{let n=this.snapshot.maybeClone(e,t);this.snapshot!==n&&(this.snapshot=n)}),v(this,`filterUncomittedElements`,(e,t)=>{for(let[n,r]of e.entries()){if(!t.get(n))continue;let e=this.snapshot.elements.get(n);e?e.version<r.version&&t.set(n,e):t.delete(n)}return t}),v(this,`clear`,()=>{this.snapshot=rS.empty(),this.scheduledActions=new Set}),v(this,`satisfiesScheduledActionsInvariant`,()=>{if(!(this.scheduledActions.size>=0&&this.scheduledActions.size<=3)){let e=`There can be at most three store actions scheduled at the same time, but there are "${this.scheduledActions.size}".`;if(console.error(e,this.scheduledActions.values()),f.DEV||f.MODE===Gs.TEST)throw Error(e)}})}get snapshot(){return this._snapshot}set snapshot(e){this._snapshot=e}},rS=class e{constructor(e,t,n={didElementsChange:!1,didAppStateChange:!1,isEmpty:!1}){this.elements=e,this.appState=t,this.meta=n}static empty(){return new e(new Map,$x(qc()),{didElementsChange:!1,didAppStateChange:!1,isEmpty:!0})}isEmpty(){return this.meta.isEmpty}maybeClone(t,n){let r=this.maybeCreateElementsSnapshot(t),i=this.maybeCreateAppStateSnapshot(n),a=!1,o=!1;return this.elements!==r&&(a=!0),this.appState!==i&&(o=!0),!a&&!o?this:new e(r,i,{didElementsChange:a,didAppStateChange:o})}maybeCreateAppStateSnapshot(e){if(!e)return this.appState;let t=eS(e)?e:$x(e);return this.detectChangedAppState(t)?t:this.appState}detectChangedAppState(e){return!Ku(this.appState,e,{selectedElementIds:Ku,selectedGroupIds:Ku})}maybeCreateElementsSnapshot(e){return e&&this.detectChangedElements(e)?this.createElementsSnapshot(e):this.elements}detectChangedElements(e){if(this.elements===e)return!1;if(this.elements.size!==e.size)return!0;let t=Array.from(e.keys());for(let n=t.length-1;n>=0;n--){let r=this.elements.get(t[n]),i=e.get(t[n]);if(!r||!i||r.id!==i.id||r.versionNonce!==i.versionNonce)return!0}return!1}createElementsSnapshot(e){let t=new Map;for(let[n,r]of this.elements.entries())e.get(n)?t.set(n,r):t.set(n,iE(r,{isDeleted:!0}));for(let[n,r]of e.entries()){let e=t.get(n);(!e||e&&e.versionNonce!==r.versionNonce)&&t.set(n,Nx(r))}return t}},iS=new Map,aS=/^(?:http(?:s)?:\/\/)?(?:www\.)?youtu(?:be\.com|\.be)\/(embed\/|watch\?v=|shorts\/|playlist\?list=|embed\/videoseries\?list=)?([a-zA-Z0-9_-]+)(?:\?t=|&t=|\?start=|&start=)?([a-zA-Z0-9_-]+)?[^\s]*$/,oS=/^(?:http(?:s)?:\/\/)?(?:(?:w){3}\.)?(?:player\.)?vimeo\.com\/(?:video\/)?([^?\s]+)(?:\?.*)?$/,sS=/^https:\/\/(?:www\.)?figma\.com/,cS=/^https:\/\/gist\.github\.com\/([\w_-]+)\/([\w_-]+)/,lS=/^<script[\s\S]*?\ssrc=["'](https:\/\/gist\.github\.com\/.*?)\.js["']/i,uS=/(?:https?:\/\/)?(?:(?:w){3}\.)?(?:twitter|x)\.com\/[^/]+\/status\/(\d+)/,dS=/^<blockquote[\s\S]*?\shref=["'](https?:\/\/(?:twitter|x)\.com\/[^"']*)/i,fS=/^https:\/\/(?:www\.)?val\.town\/(v|embed)\/[a-zA-Z_$][0-9a-zA-Z_$]+\.[a-zA-Z_$][0-9a-zA-Z_$]+/,pS=/^<(?:iframe|blockquote)[\s\S]*?\s(?:src|href)=["']([^"']*)["'][\s\S]*?>$/i,mS=/giphy.com\/(?:clips|embed|gifs)\/[a-zA-Z0-9]*?-?([a-zA-Z0-9]+)(?:[^a-zA-Z0-9]|$)/,hS=/^(?:http(?:s)?:\/\/)?(?:www\.)?reddit\.com\/r\/([a-zA-Z0-9_]+)\/comments\/([a-zA-Z0-9_]+)\/([a-zA-Z0-9_]+)\/?(?:\?[^#\s]*)?(?:#[^\s]*)?$/,gS=/^<blockquote[\s\S]*?\shref=["'](https?:\/\/(?:www\.)?reddit\.com\/[^"']*)/i,_S=new Set([`youtube.com`,`youtu.be`,`vimeo.com`,`player.vimeo.com`,`figma.com`,`link.excalidraw.com`,`gist.github.com`,`twitter.com`,`x.com`,`*.simplepdf.eu`,`stackblitz.com`,`val.town`,`giphy.com`,`reddit.com`]),vS=new Set([`youtube.com`,`youtu.be`,`vimeo.com`,`player.vimeo.com`,`figma.com`,`twitter.com`,`x.com`,`*.simplepdf.eu`,`stackblitz.com`,`reddit.com`]),yS=e=>`<html><body>${e}</body></html>`,bS=e=>{if(!e)return null;if(iS.has(e))return iS.get(e);let t=e,n=vS.has(SS(e,vS)||``),r=`generic`,i={w:560,h:840},a=e.match(aS);if(a?.[2]){let o=a[3]?`&start=${a[3]}`:``,s=e.includes(`shorts`);switch(r=`video`,a[1]){case`embed/`:case`watch?v=`:case`shorts/`:e=`https://www.youtube.com/embed/${a[2]}?enablejsapi=1${o}`;break;case`playlist?list=`:case`embed/videoseries?list=`:e=`https://www.youtube.com/embed/videoseries?list=${a[2]}&enablejsapi=1${o}`;break;default:e=`https://www.youtube.com/embed/${a[2]}?enablejsapi=1${o}`}return i=s?{w:315,h:560}:{w:560,h:315},iS.set(t,{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}}}let o=e.match(oS);if(o?.[1]){let a=o?.[1],s=/^\d+$/.test(a)?void 0:URIError(`Invalid embed link format`);return r=`video`,e=`https://player.vimeo.com/video/${a}?api=1`,i={w:560,h:315},iS.set(t,{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:r,error:s,sandbox:{allowSameOrigin:n}}}if(e.match(sS))return r=`generic`,e=`https://www.figma.com/embed?embed_host=share&url=${encodeURIComponent(e)}`,i={w:550,h:550},iS.set(t,{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}};let s=e.match(fS);if(s)return e=s[1]===`embed`?s[0]:s[0].replace(`/v`,`/embed`),iS.set(t,{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}};if(uS.test(e)){let r=e.match(uS)[1],i=sd(`https://twitter.com/x/status/${r}`),a={type:`document`,srcdoc:e=>yS(`<blockquote class="twitter-tweet" data-dnt="true" data-theme="${e}"><a href="${i}"></a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"><\/script>`),intrinsicSize:{w:480,h:480},sandbox:{allowSameOrigin:n}};return iS.set(t,a),a}if(hS.test(e)){let[,r,i,a]=e.match(hS),o=sd(`https://reddit.com/r/${r}/comments/${i}/${a}`),s={type:`document`,srcdoc:e=>yS(`<blockquote class="reddit-embed-bq" data-embed-theme="${e}"><a href="${o}"></a><br></blockquote><script async="" src="https://embed.reddit.com/widgets.js" charset="UTF-8"><\/script>`),intrinsicSize:{w:480,h:480},sandbox:{allowSameOrigin:n}};return iS.set(t,s),s}if(cS.test(e)){let[,t,r]=e.match(cS),i=sd(`https://gist.github.com/${t}/${r}`),a={type:`document`,srcdoc:()=>yS(`
|
|
36
|
+
<script src="${i}.js"><\/script>
|
|
37
|
+
<style type="text/css">
|
|
38
|
+
* { margin: 0px; }
|
|
39
|
+
table, .gist { height: 100%; }
|
|
40
|
+
.gist .gist-file { height: calc(100vh - 2px); padding: 0px; display: grid; grid-template-rows: 1fr auto; }
|
|
41
|
+
</style>
|
|
42
|
+
`),intrinsicSize:{w:550,h:720},sandbox:{allowSameOrigin:n}};return iS.set(e,a),a}return iS.set(e,{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:r,sandbox:{allowSameOrigin:n}}},xS=e=>{let t;t=fd(e)?`IFrame element`:!e.link||e?.link===``?`Empty Web-Embed`:e.link;let n=Math.max(Math.min(e.width/2,e.width/t.length),e.width/30),r=Ys.Helvetica,i=cu({fontSize:n,fontFamily:r});return wx({x:e.x+e.width/2,y:e.y+e.height/2,strokeColor:e.strokeColor===`transparent`?`black`:e.strokeColor,backgroundColor:`transparent`,fontFamily:r,fontSize:n,text:hf(t,i,e.width-20),textAlign:`center`,verticalAlign:Ec.MIDDLE,angle:e.angle??0})};W({name:`setEmbeddableAsActiveTool`,trackEvent:{category:`toolbar`},target:`Tool`,label:`toolBar.embeddable`,perform:(e,t,n,r)=>{let i=gu(t,{type:`embeddable`});return fx(r.canvas,{...t,activeTool:i}),{elements:e,appState:{...t,activeTool:gu(t,{type:`embeddable`})},captureUpdate:G.EVENTUALLY}}});var SS=(e,t)=>{try{let{hostname:n}=new URL(e),r=n.replace(/^www\./,``);if(t instanceof Set){if(_S.has(r))return r;let e=r.replace(/^([^.]+)/,`*`);return _S.has(e)?e:null}let i=t.replace(/^www\./,``);if(r===i)return i}catch{}return null},CS=e=>{let t=e.match(dS);if(t&&t.length===2)return t[1];let n=e.match(gS);if(n&&n.length===2)return n[1];let r=e.match(lS);if(r&&r.length===2)return r[1];if(mS.test(e))return`https://giphy.com/embed/${mS.exec(e)[1]}`;let i=e.match(pS);return i&&i.length===2?i[1]:e},wS=(e,t)=>{if(!e)return!1;if(t!=null){if(typeof t==`function`){let n=t(e);if(typeof n==`boolean`)return n}else{if(typeof t==`boolean`)return t;if(t instanceof RegExp)return t.test(e);if(Array.isArray(t)){for(let n of t)if(n instanceof RegExp){if(e.match(n))return!0}else if(SS(e,n))return!0;return!1}}}return!!SS(e,_S)},TS=(e,t,n)=>{if(typeof n>`u`)return e.draw(t);let r={sets:t.sets,shape:t.shape,options:{...t.options,fixedDecimalPlaceDigits:n}};return e.draw(r)},ES=(e,t,n,r,i)=>{if(!r.enabled||!r.clip)return null;let a=AT(e,i);if(a){let e=t.ownerDocument.createElementNS(Sc,`g`);return e.setAttributeNS(Sc,`clip-path`,`url(#${a.id})`),n.forEach(t=>e.appendChild(t)),e}return null},DS=(e,t,n,r,i,a,o,s)=>{let c={x:a,y:o},[l,u,d,f]=av(e,t),p=(d-l)/2-(e.x-l),m=(f-u)/2-(e.y-u);if(R(e)){let n=Bb(e,t);if(bd(n)){let[r,i,s,c]=av(n,t),l=U.getBoundTextElementPosition(n,e,t);p=(s-r)/2-(l.x-r),m=(c-i)/2-(l.y-i),a=a+l.x-e.x,o=o+l.y-e.y}}let h=180*e.angle/Math.PI,g=r;if(e.link){let t=r.ownerDocument.createElementNS(Sc,`a`);t.setAttribute(`href`,Qb(e.link)),g.appendChild(t),g=t}let _=(e,t)=>{Lu()&&e.setAttribute(`data-id`,t.id),g.appendChild(e)},v=(AT(e,t)?.opacity??100)*e.opacity/1e4;switch(e.type){case`selection`:throw Error(`Selection rendering is not supported for SVG`);case`rectangle`:case`diamond`:case`ellipse`:{let r=TS(n,Sf.generateElementShape(e,null),vc);v!==1&&(r.setAttribute(`stroke-opacity`,`${v}`),r.setAttribute(`fill-opacity`,`${v}`)),r.setAttribute(`stroke-linecap`,`round`),r.setAttribute(`transform`,`translate(${a||0} ${o||0}) rotate(${h} ${p} ${m})`),_(ES(e,g,[r],s.frameRendering,t)||r,e);break}case`iframe`:case`embeddable`:{let l=Sf.generateElementShape(e,s),u=TS(n,l,vc),d=e.opacity/100;d!==1&&(u.setAttribute(`stroke-opacity`,`${d}`),u.setAttribute(`fill-opacity`,`${d}`)),u.setAttribute(`stroke-linecap`,`round`),u.setAttribute(`transform`,`translate(${a||0} ${o||0}) rotate(${h} ${p} ${m})`),_(u,e);let f=xS(e);DS(f,t,n,g,i,f.x+c.x-e.x,f.y+c.y-e.y,s);let v=TS(n,l,vc);for(v.setAttribute(`stroke-linecap`,`round`),v.setAttribute(`transform`,`translate(${a||0} ${o||0}) rotate(${h} ${p} ${m})`);v.firstChild;)v.removeChild(v.firstChild);let y=Yg(Math.min(e.width,e.height),e),b=bS(ex(e.link||``));if(s.renderEmbeddables===!1||b?.type===`document`){let t=r.ownerDocument.createElementNS(Sc,`a`);t.setAttribute(`href`,Qb(e.link||``)),t.setAttribute(`target`,`_blank`),t.setAttribute(`rel`,`noopener noreferrer`),t.style.borderRadius=`${y}px`,v.appendChild(t)}else{let t=r.ownerDocument.createElementNS(Sc,`foreignObject`);t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.border=`none`;let n=t.ownerDocument.createElementNS(Sc,`div`);n.setAttribute(`xmlns`,`http://www.w3.org/1999/xhtml`),n.style.width=`100%`,n.style.height=`100%`;let i=n.ownerDocument.createElement(`iframe`);i.src=b?.link??``,i.style.width=`100%`,i.style.height=`100%`,i.style.border=`none`,i.style.borderRadius=`${y}px`,i.style.top=`0`,i.style.left=`0`,i.allowFullscreen=!0,n.appendChild(i),t.appendChild(n),v.appendChild(t)}_(v,e);break}case`line`:case`arrow`:{let i=zb(e,t),c=r.ownerDocument.createElementNS(Sc,`mask`);if(i){c.setAttribute(`id`,`mask-${e.id}`);let n=r.ownerDocument.createElementNS(Sc,`rect`);a||=0,o||=0,n.setAttribute(`x`,`0`),n.setAttribute(`y`,`0`),n.setAttribute(`fill`,`#fff`),n.setAttribute(`width`,`${e.width+100+a}`),n.setAttribute(`height`,`${e.height+100+o}`),c.appendChild(n);let s=r.ownerDocument.createElementNS(Sc,`rect`),l=U.getBoundTextElementPosition(e,i,t),u=a+l.x-e.x,d=o+l.y-e.y;s.setAttribute(`x`,u.toString()),s.setAttribute(`y`,d.toString()),s.setAttribute(`fill`,`#000`),s.setAttribute(`width`,`${i.width}`),s.setAttribute(`height`,`${i.height}`),s.setAttribute(`opacity`,`1`),c.appendChild(s)}let l=r.ownerDocument.createElementNS(Sc,`g`);i&&l.setAttribute(`mask`,`url(#mask-${e.id})`),l.setAttribute(`stroke-linecap`,`round`),Sf.generateElementShape(e,s).forEach(t=>{let r=TS(n,t,vc);v!==1&&(r.setAttribute(`stroke-opacity`,`${v}`),r.setAttribute(`fill-opacity`,`${v}`)),r.setAttribute(`transform`,`translate(${a||0} ${o||0}) rotate(${h} ${p} ${m})`),e.type===`line`&&Xg(e.points)&&e.backgroundColor!==`transparent`&&r.setAttribute(`fill-rule`,`evenodd`),l.appendChild(r)});let u=ES(e,g,[l,c],s.frameRendering,t);u?(_(u,e),g.appendChild(u)):(_(l,e),g.append(c));break}case`freedraw`:{let i=Sf.generateElementShape(e,s),c=i?TS(n,i,vc):r.ownerDocument.createElementNS(Sc,`g`);v!==1&&(c.setAttribute(`stroke-opacity`,`${v}`),c.setAttribute(`fill-opacity`,`${v}`)),c.setAttribute(`transform`,`translate(${a||0} ${o||0}) rotate(${h} ${p} ${m})`),c.setAttribute(`stroke`,`none`);let l=r.ownerDocument.createElementNS(Sc,`path`);l.setAttribute(`fill`,e.strokeColor),l.setAttribute(`d`,w_(e)),c.appendChild(l),_(ES(e,g,[c],s.frameRendering,t)||c,e);break}case`image`:{let n=Math.round(e.width),c=Math.round(e.height),l=ld(e)&&i[e.fileId];if(l){let{reuseImages:i=!0}=s,u=`image-${l.id}`,d=e.width,f=e.height;e.crop&&({width:d,height:f}=e_(e),u=`image-crop-${l.id}-${QE(`${d}x${f}`)}`),i||(u=`image-${e.id}`);let y=r.querySelector(`#${u}`);if(!y){y=r.ownerDocument.createElementNS(Sc,`symbol`),y.id=u;let t=r.ownerDocument.createElementNS(Sc,`image`);t.setAttribute(`href`,l.dataURL),t.setAttribute(`preserveAspectRatio`,`none`),e.crop||!i?(t.setAttribute(`width`,`${d}`),t.setAttribute(`height`,`${f}`)):(t.setAttribute(`width`,`100%`),t.setAttribute(`height`,`100%`)),y.appendChild(t),(g.querySelector(`defs`)||g).prepend(y)}let b=r.ownerDocument.createElementNS(Sc,`use`);b.setAttribute(`href`,`#${u}`),s.exportWithDarkMode&&l.mimeType!==j.svg&&b.setAttribute(`filter`,r_);let x=0,S=0;if(e.crop){let{width:t,height:n}=e_(e);x=e.crop.x/(e.crop.naturalWidth/t),S=e.crop.y/(e.crop.naturalHeight/n)}let C=p+x,w=m+S;b.setAttribute(`width`,`${n+x}`),b.setAttribute(`height`,`${c+S}`),b.setAttribute(`opacity`,`${v}`),(e.scale[0]!==1||e.scale[1]!==1)&&b.setAttribute(`transform`,`translate(${C} ${w}) scale(${e.scale[0]} ${e.scale[1]}) translate(${-C} ${-w})`);let T=r.ownerDocument.createElementNS(Sc,`g`);if(e.crop){let t=r.ownerDocument.createElementNS(Sc,`mask`);t.setAttribute(`id`,`mask-image-crop-${e.id}`),t.setAttribute(`fill`,`#fff`);let i=r.ownerDocument.createElementNS(Sc,`rect`);i.setAttribute(`x`,`${x}`),i.setAttribute(`y`,`${S}`),i.setAttribute(`width`,`${n}`),i.setAttribute(`height`,`${c}`),t.appendChild(i),g.appendChild(t),T.setAttribute(`mask`,`url(#${t.id})`)}if(T.appendChild(b),T.setAttribute(`transform`,`translate(${a-x} ${o-S}) rotate(${h} ${C} ${w})`),e.roundness){let t=r.ownerDocument.createElementNS(Sc,`clipPath`);t.id=`image-clipPath-${e.id}`;let n=r.ownerDocument.createElementNS(Sc,`rect`),i=Yg(Math.min(e.width,e.height),e);n.setAttribute(`width`,`${e.width}`),n.setAttribute(`height`,`${e.height}`),n.setAttribute(`rx`,`${i}`),n.setAttribute(`ry`,`${i}`),t.appendChild(n),_(t,e),T.setAttributeNS(Sc,`clip-path`,`url(#${t.id})`)}_(ES(e,g,[T],s.frameRendering,t)||T,e)}break}case`frame`:case`magicframe`:if(s.frameRendering.enabled&&s.frameRendering.outline){let t=document.createElementNS(Sc,`rect`);t.setAttribute(`transform`,`translate(${a||0} ${o||0}) rotate(${h} ${p} ${m})`),t.setAttribute(`width`,`${e.width}px`),t.setAttribute(`height`,`${e.height}px`),t.setAttribute(`rx`,$s.radius.toString()),t.setAttribute(`ry`,$s.radius.toString()),t.setAttribute(`fill`,`none`),t.setAttribute(`stroke`,$s.strokeColor),t.setAttribute(`stroke-width`,$s.strokeWidth.toString()),_(t,e)}break;default:if(R(e)){let n=r.ownerDocument.createElementNS(Sc,`g`);v!==1&&(n.setAttribute(`stroke-opacity`,`${v}`),n.setAttribute(`fill-opacity`,`${v}`)),n.setAttribute(`transform`,`translate(${a||0} ${o||0}) rotate(${h} ${p} ${m})`);let i=e.text.replace(/\r\n?/g,`
|
|
43
|
+
`).split(`
|
|
44
|
+
`),c=Wd(e.fontSize,e.lineHeight),l=e.textAlign===`center`?e.width/2:e.textAlign===`right`?e.width:0,u=Yh(e.fontFamily,e.fontSize,c),d=xu(e.text)?`rtl`:`ltr`,f=e.textAlign===`center`?`middle`:e.textAlign===`right`||d===`rtl`?`end`:`start`;for(let t=0;t<i.length;t++){let a=r.ownerDocument.createElementNS(Sc,`text`);a.textContent=i[t],a.setAttribute(`x`,`${l}`),a.setAttribute(`y`,`${t*c+u}`),a.setAttribute(`font-family`,su(e)),a.setAttribute(`font-size`,`${e.fontSize}px`),a.setAttribute(`fill`,e.strokeColor),a.setAttribute(`text-anchor`,f),a.setAttribute(`style`,`white-space: pre;`),a.setAttribute(`direction`,d),a.setAttribute(`dominant-baseline`,`alphabetic`),n.appendChild(a)}_(ES(e,g,[n],s.frameRendering,t)||n,e)}else throw Error(`Unimplemented type ${e.type}`)}},OS=(e,t,n,r,i,a)=>{r&&(e.filter(e=>!pd(e)).forEach(e=>{if(!e.isDeleted){if(R(e)&&e.containerId&&t.has(e.containerId))return;try{DS(e,t,n,r,i,e.x+a.offsetX,e.y+a.offsetY,a);let o=zb(e,t);o&&DS(o,t,n,r,i,o.x+a.offsetX,o.y+a.offsetY,a)}catch(e){console.error(e)}}}),e.filter(e=>pd(e)).forEach(e=>{if(!e.isDeleted)try{DS(e,t,n,r,i,e.x+a.offsetX,e.y+a.offsetY,a)}catch(e){console.error(e)}}))},kS=500,AS=e=>{let t=e.extensions?.reduce((e,t)=>(e.push(j[t]),e),[]),n=e.extensions?.reduce((e,t)=>t===`jpg`?e.concat(`.jpg`,`.jpeg`):e.concat(`.${t}`),[]);return ms({description:e.description,extensions:n,mimeTypes:t,multiple:e.multiple??!1,legacySetup:(t,n,r)=>{let i=lu(n,kS),a=()=>{o(),document.addEventListener(`keyup`,i),document.addEventListener(`pointerup`,i),i()},o=()=>{r.files?.length&&t(e.multiple?[...r.files]:r.files[0])};requestAnimationFrame(()=>{window.addEventListener(`focus`,a)});let s=window.setInterval(()=>{o()},kS);return e=>{clearInterval(s),i.cancel(),window.removeEventListener(`focus`,a),document.removeEventListener(`keyup`,i),document.removeEventListener(`pointerup`,i),e&&(console.warn(`Opening the file was canceled (legacy-fs).`),e(new yh))}}})},jS=(e,t)=>gs(e,{fileName:`${t.name}.${t.extension}`,description:t.description,extensions:[`.${t.extension}`],mimeTypes:t.mimeTypes},t.fileHandle),MS=(e,t)=>{let n={};for(let r of e)!r.isDeleted&&`fileId`in r&&r.fileId&&t[r.fileId]&&(n[r.fileId]=t[r.fileId]);return n},NS=(e,t,n,r)=>{let i={type:dc.excalidraw,version:Cc.excalidraw,source:fc,elements:r===`local`?iD(e):rD(e),appState:r===`local`?Xc(t):Zc(t),files:r===`local`?MS(e,n):void 0};return JSON.stringify(i,null,2)},PS=async(e,t,n,r=t.name||`Untitled`)=>{let i=NS(e,t,n,`local`);return{fileHandle:await jS(new Blob([i],{type:j.excalidraw}),{name:r,extension:`excalidraw`,description:`Excalidraw file`,fileHandle:cD(t.fileHandle)?null:t.fileHandle})}},FS=async(e,t)=>{let n=await AS({description:`Excalidraw files`});return fD(await OD(n),e,t,n.handle)},IS=e=>e?.type===dc.excalidraw&&(!e.elements||Array.isArray(e.elements)&&(!e.appState||typeof e.appState==`object`)),LS=e=>typeof e==`object`&&e&&e.type===dc.excalidrawLibrary&&(e.version===1||e.version===2),RS=e=>{let t={type:dc.excalidrawLibrary,version:Cc.excalidrawLibrary,source:fc,libraryItems:e};return JSON.stringify(t,null,2)},zS=async e=>{let t=RS(e);await jS(new Blob([t],{type:j.excalidrawlib}),{name:`library`,extension:`excalidrawlib`,description:`Excalidraw library file`})},BS=e=>new Promise((t,n)=>{let r=new Image;r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.src=e}),VS=async({fileIds:e,files:t,imageCache:n})=>{let r=new Map,i=new Map;return await Promise.all(e.reduce((e,a)=>{let o=t[a];return o&&!r.has(a)?(r.set(a,!0),e.concat((async()=>{try{if(o.mimeType===j.binary)throw Error(`Only images can be added to ImageCache`);let e=BS(o.dataURL),t={image:e,mimeType:o.mimeType};n.set(a,t);let r=await e;n.set(a,{...t,image:r})}catch{i.set(a,!0)}})())):e},[])),{imageCache:n,updatedFiles:r,erroredFiles:i}},HS=e=>e.filter(e=>ld(e)),US=e=>e?.nodeName.toLowerCase()===`svg`,WS=e=>{let t=new DOMParser().parseFromString(e,j.svg),n=t.querySelector(`svg`);if(t.querySelector(`parsererror`)||!US(n))throw Error(`Invalid SVG`);{n.hasAttribute(`xmlns`)||n.setAttribute(`xmlns`,`http://www.w3.org/2000/svg`);let e=n.getAttribute(`width`),t=n.getAttribute(`height`);(e?.includes(`%`)||e===`auto`)&&(e=null),(t?.includes(`%`)||t===`auto`)&&(t=null);let r=n.getAttribute(`viewBox`);if(!e||!t){if(e||=`50`,t||=`50`,r){let n=r.match(/\d+ +\d+ +(\d+(?:\.\d+)?) +(\d+(?:\.\d+)?)/);n&&([,e,t]=n)}n.setAttribute(`width`,e),n.setAttribute(`height`,t)}return r||n.setAttribute(`viewBox`,`0 0 ${e} ${t}`),n.outerHTML}},GS=document.createElement(`img`);GS.src=`data:${j.svg}, %3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%231971c2%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20class%3D%22feather%20feather-external-link%22%3E%3Cpath%20d%3D%22M18%2013v6a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2V8a2%202%200%200%201%202-2h6%22%3E%3C%2Fpath%3E%3Cpolyline%20points%3D%2215%203%2021%203%2021%209%22%3E%3C%2Fpolyline%3E%3Cline%20x1%3D%2210%22%20y1%3D%2214%22%20x2%3D%2221%22%20y2%3D%223%22%3E%3C%2Fline%3E%3C%2Fsvg%3E`;var KS=document.createElement(`img`);KS.src=`data:${j.svg}, %3Csvg%20%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20%20width%3D%2216%22%20%20height%3D%2216%22%20%20viewBox%3D%220%200%2024%2024%22%20%20fill%3D%22none%22%20%20stroke%3D%22%231971c2%22%20%20stroke-width%3D%222%22%20%20stroke-linecap%3D%22round%22%20%20stroke-linejoin%3D%22round%22%20%20class%3D%22icon%20icon-tabler%20icons-tabler-outline%20icon-tabler-arrow-big-right-line%22%3E%3Cpath%20stroke%3D%22none%22%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22%2F%3E%3Cpath%20d%3D%22M12%209v-3.586a1%201%200%200%201%201.707%20-.707l6.586%206.586a1%201%200%200%201%200%201.414l-6.586%206.586a1%201%200%200%201%20-1.707%20-.707v-3.586h-6v-6h6z%22%20%2F%3E%3Cpath%20d%3D%22M3%209v6%22%20%2F%3E%3C%2Fsvg%3E`;var qS=([e,t,n,r],i,a)=>{let o=d_,s=o/a.zoom.value,c=o/a.zoom.value,l=o/a.zoom.value,u=(e+n)/2,d=(t+r)/2,f=(o-8)/(2*a.zoom.value),p=4/a.zoom.value,m=n+p-f,h=t-p-l+f,[g,_]=F(P(m+s/2,h+c/2),P(u,d),i);return[g-s/2,_-c/2,s,c]},JS=(e,t,n,[r,i])=>{let a=4/n.zoom.value,[o,s,c,l]=av(e,t),[u,d,f,p]=qS([o,s,c,l],e.angle,n);return r>u-a&&r<u+a+f&&i>d-a&&i<d+p+a},YS=(e,t,n,[r,i],a)=>!e.link||n.selectedElementIds[e.id]?!1:!a&&n.viewModeEnabled&&Sg(r,i,e,t)?!0:JS(e,t,n,P(r,i)),XS=(e,t,n,r,i=!0)=>{e.beginPath(),e.arc(t,n,r,0,Math.PI*2),e.fill(),i&&e.stroke()},ZS=(e,t)=>[e.width/t,e.height/t],QS=({canvas:e,scale:t,normalizedWidth:n,normalizedHeight:r,theme:i,isExporting:a,viewBackgroundColor:o})=>{let s=e.getContext(`2d`);return s.setTransform(1,0,0,1,0,0),s.scale(t,t),a&&i===Qs.DARK&&(s.filter=`invert(93%) hue-rotate(180deg)`),typeof o==`string`?((o===`transparent`||o.length===5||o.length===9||/(hsla|rgba)\(/.test(o))&&s.clearRect(0,0,n,r),s.save(),s.fillStyle=o,s.fillRect(0,0,n,r),s.restore()):s.clearRect(0,0,n,r),s},$S=(e,t)=>{let n=window.location.href;try{let t=new URL(n);return t.searchParams.set(Uc,e),Qb(t.toString())}catch(e){console.error(e)}return Qb(n)},eC=(e,t)=>{if(e.length>0&&tC(e)){if(e.length===1)return{id:e[0].id,type:`element`};if(e.length>1){let n=Object.keys(t.selectedGroupIds)[0];return n?{id:n,type:`group`}:{id:e[0].groupIds[0],type:`group`}}}return null},tC=e=>!!(e.length===1||e.length>1&&eb(e)),nC=e=>{try{let t=new URL(e);return t.searchParams.has(Uc)&&t.host===window.location.host}catch{return!1}},rC=e=>{try{let{searchParams:t}=new URL(e);if(t.has(Uc))return t.get(Uc)}catch{}return null},iC={Bold:`#dddddd`,Regular:`#e5e5e5`},aC=(e,t,n,r,i,a,o,s)=>{let c=r%t-t,l=i%t-t,u=t*a.value,d=1/a.value;e.save(),a.value===1&&e.translate(c%1?0:.5,l%1?0:.5);for(let i=c;i<c+o+t*2;i+=t){let o=n>1&&Math.round(i-r)%(n*t)===0;if(!o&&u<10)continue;let c=Math.min(1/a.value,o?4:1);e.lineWidth=c;let f=[c*3,d+(c+d)];e.beginPath(),e.setLineDash(o?[]:f),e.strokeStyle=o?iC.Bold:iC.Regular,e.moveTo(i,l-t),e.lineTo(i,Math.ceil(l+s+t*2)),e.stroke()}for(let r=l;r<l+s+t*2;r+=t){let s=n>1&&Math.round(r-i)%(n*t)===0;if(!s&&u<10)continue;let l=Math.min(1/a.value,s?4:1);e.lineWidth=l;let f=[l*3,d+(l+d)];e.beginPath(),e.setLineDash(s?[]:f),e.strokeStyle=s?iC.Bold:iC.Regular,e.moveTo(c-t,r),e.lineTo(Math.ceil(c+o+t*2),r),e.stroke()}e.restore()},oC=(e,t,n,r)=>{t.translate(e.x+r.scrollX,e.y+r.scrollY),t.beginPath(),t.roundRect?t.roundRect(0,0,e.width,e.height,$s.radius/r.zoom.value):t.rect(0,0,e.width,e.height),t.clip(),t.translate(-(e.x+r.scrollX),-(e.y+r.scrollY))},sC={regularLink:null,elementLink:null},cC=(e,t,n,r)=>{if(e.link&&!n.selectedElementIds[e.id]){let[i,a,o,s]=av(e,r),[c,l,u,d]=qS([i,a,o,s],e.angle,n),f=c+u/2,p=l+d/2;t.save(),t.translate(n.scrollX+f,n.scrollY+p),t.rotate(e.angle);let m=nC(e.link)?`elementLink`:`regularLink`,h=sC[m];if(!h||h.zoom!==n.zoom.value){h=Object.assign(document.createElement(`canvas`),{zoom:n.zoom.value}),h.width=u*window.devicePixelRatio*n.zoom.value,h.height=d*window.devicePixelRatio*n.zoom.value,sC[m]=h;let e=h.getContext(`2d`);e.scale(window.devicePixelRatio*n.zoom.value,window.devicePixelRatio*n.zoom.value),e.fillStyle=`#fff`,e.fillRect(0,0,u,d),m===`elementLink`?e.drawImage(KS,0,0,u,d):e.drawImage(GS,0,0,u,d),e.restore()}t.drawImage(h,c-f,l-p,u,d),t.restore()}},lC=({canvas:e,rc:t,elementsMap:n,allElementsMap:r,visibleElements:i,scale:a,appState:o,renderConfig:s})=>{if(e===null)return;let{renderGrid:c=!0,isExporting:l}=s,[u,d]=ZS(e,a),f=QS({canvas:e,scale:a,normalizedWidth:u,normalizedHeight:d,theme:o.theme,isExporting:l,viewBackgroundColor:o.viewBackgroundColor});f.scale(o.zoom.value,o.zoom.value),c&&aC(f,o.gridSize,o.gridStep,o.scrollX,o.scrollY,o.zoom,u/o.zoom.value,d/o.zoom.value);let p=new Set;i.forEach(e=>{e.groupIds.length>0&&o.frameToHighlight&&o.selectedElementIds[e.id]&&(xT(e,o.frameToHighlight,n)||e.groupIds.find(e=>p.has(e)))&&e.groupIds.forEach(e=>p.add(e))});let m=new Map;i.filter(e=>!pd(e)).forEach(e=>{try{let i=e.frameId||o.frameToHighlight?.id;if(R(e)&&e.containerId&&n.has(e.containerId))return;if(f.save(),i&&o.frameRendering.enabled&&o.frameRendering.clip){let i=RT(e,n,o);i&&BT(e,i,o,n,m)&&oC(i,f,s,o),b_(e,n,r,t,f,s,o)}else b_(e,n,r,t,f,s,o);let a=zb(e,n);a&&b_(a,n,r,t,f,s,o),f.restore(),l||cC(e,f,o,n)}catch(t){console.error(t,e.id,e.x,e.y,e.width,e.height)}}),i.filter(e=>pd(e)).forEach(e=>{try{let i=()=>{b_(e,n,r,t,f,s,o),pd(e)&&(l||dd(e)&&s.embedsValidationStatus.get(e.id)!==!0)&&e.width&&e.height&&b_(xS(e),n,r,t,f,s,o),l||cC(e,f,o,n)};if((e.frameId||o.frameToHighlight?.id)&&o.frameRendering.enabled&&o.frameRendering.clip){f.save();let t=RT(e,n,o);t&&BT(e,t,o,n,m)&&oC(t,f,s,o),i(),f.restore()}else i()}catch(e){console.error(e)}}),s.pendingFlowchartNodes?.forEach(e=>{try{b_(e,n,r,t,f,s,o)}catch(e){console.error(e)}})},uC=uu(e=>{lC(e)},{trailing:!0}),dC=(e,t)=>{if(t){uC(e);return}lC(e)},fC=(e,t)=>{if(e.width<=t)return e;let n=document.createElement(`canvas`).getContext(`2d`);n.font=cu({fontFamily:e.fontFamily,fontSize:e.fontSize});let r=e.text;if(n.measureText(r).width>t)for(let e=r.length;e>0;e--){let i=`${r.slice(0,e)}...`;if(n.measureText(i).width<=t){r=i;break}}return iE(e,{text:r,width:t})},pC=(e,t)=>{let n=[];for(let r of e){if(gd(r)){let e=wx({x:r.x,y:r.y-$s.nameOffsetY,fontFamily:Ys.Helvetica,fontSize:$s.nameFontSize,lineHeight:$s.nameLineHeight,strokeColor:t.exportWithDarkMode?$s.nameColorDarkTheme:$s.nameColorLightTheme,text:VT(r)});e.y-=e.height,e=fC(e,r.width),n.push(e)}n.push(r)}return n},mC=(e,t)=>(t||=qc().frameRendering,{enabled:e?!0:t.enabled,outline:!e&&t.outline,name:!e&&t.name,clip:e?!0:t.clip}),hC=({elements:e,exportingFrame:t,frameRendering:n,exportWithDarkMode:r})=>{let i;return i=t?HT(e,t):n.enabled&&n.name?pC(e,{exportWithDarkMode:r}):e,i},gC=async(e,t,n,{exportBackground:r,exportPadding:i=10,viewBackgroundColor:a,exportingFrame:o},s=(e,n)=>{let r=document.createElement(`canvas`);return r.width=e*t.exportScale,r.height=n*t.exportScale,{canvas:r,scale:t.exportScale}},c=async()=>{await Jh.loadElementsFonts(e)})=>{await c();let l=mC(o??null,t.frameRendering??null);o&&(l.clip=!1);let u=hC({elements:e,exportingFrame:o,exportWithDarkMode:t.exportWithDarkMode,frameRendering:l});o&&(i=0);let[d,f,p,m]=xC(o?[o]:ET(u),i),{canvas:h,scale:g=1}=s(p,m),_=qc(),{imageCache:v}=await VS({imageCache:new Map,fileIds:HS(u).map(e=>e.fileId),files:n});return dC({canvas:h,rc:go.canvas(h),elementsMap:rd(Nu(u)),allElementsMap:rd(Nu(Vx(e))),visibleElements:u,scale:g,appState:{...t,frameRendering:l,viewBackgroundColor:r?a:null,scrollX:-d+i,scrollY:-f+i,zoom:_.zoom,shouldCacheIgnoreZoom:!1,theme:t.exportWithDarkMode?Qs.DARK:Qs.LIGHT},renderConfig:{canvasBackgroundColor:a,imageCache:v,renderGrid:!1,isExporting:!0,embedsValidationStatus:new Map,elementsPendingErasure:new Set,pendingFlowchartNodes:null}}),h},_C=e=>document.createComment(` ${e} `),vC=async(e,t,n,r)=>{let i=mC(r?.exportingFrame??null,t.frameRendering??null),{exportPadding:a=10,exportWithDarkMode:o=!1,viewBackgroundColor:s,exportScale:c=1,exportEmbedScene:l}=t,{exportingFrame:u=null}=r||{},d=hC({elements:e,exportingFrame:u,exportWithDarkMode:o,frameRendering:i});u&&(a=0);let[f,p,m,h]=xC(u?[u]:ET(d),a),g=-f+a,_=-p+a,v=document.createElementNS(Sc,`svg`);v.setAttribute(`version`,`1.1`),v.setAttribute(`xmlns`,Sc),v.setAttribute(`viewBox`,`0 0 ${m} ${h}`),v.setAttribute(`width`,`${m*c}`),v.setAttribute(`height`,`${h*c}`),o&&v.setAttribute(`filter`,`invert(93%) hue-rotate(180deg)`);let y=v.ownerDocument.createElementNS(Sc,`defs`),b=v.ownerDocument.createElementNS(Sc,`metadata`);if(v.appendChild(_C(`svg-source:excalidraw`)),v.appendChild(b),v.appendChild(y),l)try{yC({metadataElement:b,payload:NS(e,t,n||{},`local`)})}catch(e){console.error(e)}let x=TT(e);if(x.length){let t=Nu(e);for(let e of x){let n=v.ownerDocument.createElementNS(Sc,`clipPath`);n.setAttribute(`id`,e.id);let[r,i,a,o]=av(e,t),s=(a-r)/2-(e.x-r),c=(o-i)/2-(e.y-i),l=v.ownerDocument.createElementNS(Sc,`rect`);l.setAttribute(`transform`,`translate(${e.x+g} ${e.y+_}) rotate(${e.angle} ${s} ${c})`),l.setAttribute(`width`,`${e.width}`),l.setAttribute(`height`,`${e.height}`),u||(l.setAttribute(`rx`,`${$s.radius}`),l.setAttribute(`ry`,`${$s.radius}`)),n.appendChild(l),y.appendChild(n)}}let S=r?.skipInliningFonts?[]:await Jh.generateFontFaceDeclarations(e),C=`
|
|
45
|
+
`,w=v.ownerDocument.createElementNS(Sc,`style`);if(w.classList.add(`style-fonts`),w.appendChild(document.createTextNode(`${C}${S.join(C)}`)),y.appendChild(w),t.exportBackground&&s){let e=v.ownerDocument.createElementNS(Sc,`rect`);e.setAttribute(`x`,`0`),e.setAttribute(`y`,`0`),e.setAttribute(`width`,`${m}`),e.setAttribute(`height`,`${h}`),e.setAttribute(`fill`,s),v.appendChild(e)}let T=go.svg(v),E=r?.renderEmbeddables??!1;return OS(d,rd(Nu(d)),T,v,n||{},{offsetX:g,offsetY:_,isExporting:!0,exportWithDarkMode:o,renderEmbeddables:E,frameRendering:i,canvasBackgroundColor:s,embedsValidationStatus:E?new Map(d.filter(e=>gd(e)).map(e=>[e.id,!0])):new Map,reuseImages:r?.reuseImages??!0}),v},yC=({payload:e,metadataElement:t})=>{let n=ND(JSON.stringify(FD({text:e})),!0);t.appendChild(_C(`payload-type:${j.excalidraw}`)),t.appendChild(_C(`payload-version:2`)),t.appendChild(_C(`payload-start`)),t.appendChild(document.createTextNode(n)),t.appendChild(_C(`payload-end`))},bC=({svg:e})=>{if(e.includes(`payload-type:${j.excalidraw}`)){let t=e.match(/<!-- payload-start -->\s*(.+?)\s*<!-- payload-end -->/);if(!t)throw Error(`INVALID`);let n=(e.match(/<!-- payload-version:(\d+) -->/)?.[1]||`1`)!==`1`;try{let e=PD(t[1],n),r=JSON.parse(e);if(!(`encoded`in r)){if(`type`in r&&r.type===dc.excalidraw)return e;throw Error(`FAILED`)}return ID(r)}catch(e){throw console.error(e),Error(`FAILED`)}}throw Error(`INVALID`)},xC=(e,t)=>{let[n,r,i,a]=bv(e);return[n,r,hu(n,i)+t*2,hu(r,a)+t*2]},SC=(e,t,n)=>{let[,,r,i]=xC(e,t).map(e=>Math.trunc(e*n));return[r,i]},CC=class{constructor(e){this.scoreFunction=e,v(this,`content`,[])}sinkDown(e){let t=this.content[e];for(;e>0;){let n=(e+1>>1)-1,r=this.content[n];if(this.scoreFunction(t)<this.scoreFunction(r))this.content[n]=t,this.content[e]=r,e=n;else break}}bubbleUp(e){let t=this.content.length,n=this.content[e],r=this.scoreFunction(n);for(;;){let i=e+1<<1,a=i-1,o=null,s=0;if(a<t){let e=this.content[a];s=this.scoreFunction(e),s<r&&(o=a)}if(i<t){let e=this.content[i];this.scoreFunction(e)<(o===null?r:s)&&(o=i)}if(o!==null)this.content[e]=this.content[o],this.content[o]=n,e=o;else break}}push(e){this.content.push(e),this.sinkDown(this.content.length-1)}pop(){if(this.content.length===0)return null;let e=this.content[0],t=this.content.pop();return this.content.length>0&&(this.content[0]=t,this.bubbleUp(0)),e}remove(e){if(this.content.length===0)return;let t=this.content.indexOf(e),n=this.content.pop();t<this.content.length&&(this.content[t]=n,this.scoreFunction(n)<this.scoreFunction(e)?this.sinkDown(t):this.bubbleUp(t))}size(){return this.content.length}rescoreElement(e){this.sinkDown(this.content.indexOf(e))}},wC=1,TC=40,EC=(e,t)=>{let n=e.fixedSegments?e.fixedSegments.slice():null;if(n){let r=[];e.points.map(t=>P(e.x+t[0],e.y+t[1])).forEach((t,i,a)=>{if(i<2)return r.push(t);if(U_(V_(t,a[i-1]),V_(a[i-1],a[i-2]))){let t=n?.findIndex(e=>e.index===i-1)??-1,o=n?.findIndex(e=>e.index===i)??-1;o!==-1&&(n[o].start=P(a[i-2][0]-e.x,a[i-2][1]-e.y)),t!==-1&&n.splice(t,1),r.splice(-1,1),n.forEach(e=>{e.index>i-1&&--e.index})}return r.push(t)});let i=[];r.forEach((e,t,r)=>{if(t<3)return i.push(e);if(Tl(r[t-2],r[t-1])<wC){let a=n?.findIndex(e=>e.index===t-2)??-1,o=n?.findIndex(e=>e.index===t-1)??-1;o!==-1&&n.splice(o,1),a!==-1&&n.splice(a,1),i.splice(-2,2),n.forEach(e=>{e.index>t-2&&(e.index-=2)});let s=H_(e,r[t-1]);return i.push(P(s?e[0]:r[t-2][0],s?r[t-2][1]:e[1]))}i.push(e)});let a=n.filter(e=>e.index!==1&&e.index!==i.length-1);return a.length===0?qC(JC(YC(NC(e,MC(e,t,i.map(t=>P(t[0]-e.x,t[1]-e.y)),e.startBinding&&KC(e.startBinding.elementId,t),e.endBinding&&KC(e.endBinding.elementId,t)))??[])),a,null,null):(f.DEV&&Yu(tw(i),`Invalid elbow points with fixed segments`),qC(i,a,e.startIsSpecial,e.endIsSpecial))}return{x:e.x,y:e.y,points:e.points,fixedSegments:e.fixedSegments,startIsSpecial:e.startIsSpecial,endIsSpecial:e.endIsSpecial}},DC=(e,t,n)=>{let r=t.map(e=>e.index),i=(e.fixedSegments?.map(e=>e.index)??[]).findIndex(e=>!r.includes(e));if(i===-1||!e.fixedSegments?.[i])return{points:e.points};let a=e.fixedSegments[i].index,o=e.fixedSegments[i-1],s=e.fixedSegments[i+1],c=e.x+(o?o.end[0]:0),l=e.y+(o?o.end[1]:0),u=o?null:e.startBinding,d=s?null:e.endBinding,{startHeading:f,endHeading:p,startGlobalPoint:m,endGlobalPoint:h,hoveredStartElement:g,hoveredEndElement:_,...v}=MC({x:c,y:l,startBinding:u,endBinding:d,startArrowhead:null,endArrowhead:null,points:e.points},n,[P(0,0),P(e.x+(s?.start[0]??e.points[e.points.length-1][0])-c,e.y+(s?.start[1]??e.points[e.points.length-1][1])-l)],u&&KC(u.elementId,n),d&&KC(d.elementId,n),{isDragging:!1}),{points:y}=qC(JC(YC(NC(e,{startHeading:f,endHeading:p,startGlobalPoint:m,endGlobalPoint:h,hoveredStartElement:g,hoveredEndElement:_,...v})??[])),t,null,null),b=[];if(o)for(let t=0;t<o.index;t++)b.push(P(e.x+e.points[t][0],e.y+e.points[t][1]));if(y.forEach(t=>{b.push(P(e.x+(o?o.end[0]:0)+t[0],e.y+(o?o.end[1]:0)+t[1]))}),s)for(let t=s.index;t<e.points.length;t++)b.push(P(e.x+e.points[t][0],e.y+e.points[t][1]));let x=(s?.index??e.points.length)-(o?.index??0)-1,S=t.map(e=>e.index>a?{...e,index:e.index-x+(y.length-1)}:e);return qC(b.flatMap((e,t)=>{let n=b[t-1],r=b[t+1];if(n&&r){let i=V_(e,n),a=V_(r,e);if(U_(i,a))return S.forEach(e=>{e.index>t&&--e.index}),[];if(U_(i,K_(a)))return S.forEach(e=>{e.index>t&&(e.index+=1)}),[e,e]}return[e]}),S,!1,!1)},OC=(e,t,n,r,i,a)=>{let o=t.map((t,n)=>e.fixedSegments==null||e.fixedSegments[n]===void 0||e.fixedSegments[n].index!==t.index||(t.start[0]!==e.fixedSegments[n].start[0]&&t.end[0]!==e.fixedSegments[n].end[0])!=(t.start[1]!==e.fixedSegments[n].start[1]&&t.end[1]!==e.fixedSegments[n].end[1])?n:null).filter(e=>e!==null).shift();if(o==null)return{points:e.points};let s=e.fixedSegments?.findIndex(e=>e.index===1)??-1,c=e.fixedSegments?.findIndex(t=>t.index===e.points.length-1)??-1,l=Tl(t[o].start,t[o].end),u=l<TC+5;if(s===-1&&t[o].index===1&&i){let e=W_(n),r=(e?U_(n,F_):U_(n,I_))?u?l/2:TC:u?-l/2:-TC;t[o].start=P(t[o].start[0]+(e?r:0),t[o].start[1]+(e?0:r))}if(c===-1&&t[o].index===e.points.length-1&&a){let e=W_(r),n=(e?U_(r,F_):U_(r,I_))?u?l/2:TC:u?-l/2:-TC;t[o].end=P(t[o].end[0]+(e?n:0),t[o].end[1]+(e?0:n))}let d=t.map(t=>({...t,start:P(e.x+t.start[0],e.y+t.start[1]),end:P(e.x+t.end[0],e.y+t.end[1])})),f=e.points.map((t,n)=>P(e.x+t[0],e.y+t[1])),p=d[o].index-1,m=d[o].index,h=d[o].start,g=d[o].end,_=f[p-1]&&!Sl(f[p],f[p-1])?H_(f[p-1],f[p]):void 0,v=f[m+1]&&!Sl(f[m],f[m+1])?H_(f[m+1],f[m]):void 0;if(_!==void 0){let e=+!!_;f[p-1][e]=h[e]}if(f[p]=h,f[m]=g,v!==void 0){let e=+!!v;f[m+1][e]=g[e]}let y=d.findIndex(e=>e.index===p);if(y!==-1){let e=+!!H_(d[y].end,d[y].start);d[y].start[e]=h[e],d[y].end=h}let b=d.findIndex(e=>e.index===m+1);if(b!==-1){let e=+!!H_(d[b].end,d[b].start);d[b].end[e]=g[e],d[b].start=g}if(s===-1&&p===0){let t=i?W_(n):H_(f[1],f[0]);f.unshift(P(t?h[0]:e.x+e.points[0][0],t?e.y+e.points[0][1]:h[1])),i&&f.unshift(P(e.x+e.points[0][0],e.y+e.points[0][1]));for(let e of d)e.index+=i?2:1}if(c===-1&&m===e.points.length-1){let t=W_(r);f.push(P(t?g[0]:e.x+e.points[e.points.length-1][0],t?e.y+e.points[e.points.length-1][1]:g[1])),a&&f.push(P(e.x+e.points[e.points.length-1][0],e.y+e.points[e.points.length-1][1]))}return qC(f,d.map(t=>({...t,start:P(t.start[0]-e.x,t.start[1]-e.y),end:P(t.end[0]-e.x,t.end[1]-e.y)})),!1,!1)},kC=(e,t,n,r,i,a,o,s,c)=>{let l=e.startIsSpecial??null,u=e.endIsSpecial??null,d=t.map((n,r)=>r===0||r===t.length-1?P(e.x+n[0],e.y+n[1]):P(e.x+e.points[r][0],e.y+e.points[r][1])),f=n.map(n=>({...n,start:P(e.x+(n.start[0]-t[0][0]),e.y+(n.start[1]-t[0][1])),end:P(e.x+(n.end[0]-t[0][0]),e.y+(n.end[1]-t[0][1]))})),p=[],m=2+ +!!l,h=2+ +!!u;for(;p.length+m<d.length-h;)p.push(d[p.length+m]);{let e=d[l?2:1],t=d[l?3:2],n=W_(r),i=W_(B_(N(e,t)));if(s&&n===i){let e=n?U_(r,F_):U_(r,I_);if(p.unshift(P(i?a[0]+(e?TC:-TC):t[0],i?t[1]:a[1]+(e?TC:-TC))),p.unshift(P(n?a[0]+(e?TC:-TC):a[0],n?a[1]:a[1]+(e?TC:-TC))),!l){l=!0;for(let e of f)e.index>1&&(e.index+=1)}}else if(p.unshift(P(i?a[0]:e[0],i?e[1]:a[1])),l){l=!1;for(let e of f)e.index>1&&--e.index}p.unshift(a)}{let e=d[d.length-(u?3:2)],t=d[d.length-(u?4:3)],n=W_(i),r=H_(t,e);if(c&&n===r){let e=n?U_(i,F_):U_(i,I_);p.push(P(r?o[0]+(e?TC:-TC):t[0],r?t[1]:o[1]+(e?TC:-TC))),p.push(P(n?o[0]+(e?TC:-TC):o[0],n?o[1]:o[1]+(e?TC:-TC))),u||=!0}else p.push(P(r?o[0]:e[0],r?e[1]:o[1])),u&&=!1}return p.push(o),qC(p,f.map(({index:e})=>({index:e,start:p[e-1],end:p[e]})).map(e=>({...e,start:P(e.start[0]-a[0],e.start[1]-a[1]),end:P(e.end[0]-a[0],e.end[1]-a[1])})),l,u)},AC=1e6,jC=(e,t,n,r)=>{if(e.points.length<2)return{points:n.points??e.points};(e.x<-AC||e.x>AC||e.y<-AC||e.y>AC||e.x+(n?.points?.[n?.points?.length-1]?.[0]??0)<-AC||e.x+(n?.points?.[n?.points?.length-1]?.[0]??0)>AC||e.y+(n?.points?.[n?.points?.length-1]?.[1]??0)<-AC||e.y+(n?.points?.[n?.points?.length-1]?.[1]??0)>AC||e.x+(e?.points?.[e?.points?.length-1]?.[0]??0)<-AC||e.x+(e?.points?.[e?.points?.length-1]?.[0]??0)>AC||e.y+(e?.points?.[e?.points?.length-1]?.[1]??0)<-AC||e.y+(e?.points?.[e?.points?.length-1]?.[1]??0)>AC)&&console.error(`Elbow arrow (or update) is outside reasonable bounds (> 1e6)`,{arrow:e,updates:n}),e.x=el(e.x,-AC,AC),e.y=el(e.y,-AC,AC),n.points&&=n.points.map(([e,t])=>P(el(e,-AC,AC),el(t,-AC,AC))),f.PROD||(Yu(!n.points||n.points.length>=2,`Updated point array length must match the arrow point length, contain exactly the new start and end points or not be specified at all (i.e. you can't add new points between start and end manually to elbow arrows)`),Yu(!e.fixedSegments||e.fixedSegments.map(e=>e.start[0]===e.end[0]||e.start[1]===e.end[1]).every(Boolean),`Fixed segments must be either horizontal or vertical`),Yu(!n.fixedSegments||n.fixedSegments.map(e=>e.start[0]===e.end[0]||e.start[1]===e.end[1]).every(Boolean),`Updates to fixed segments must be either horizontal or vertical`),Yu(e.points.slice(1).map((t,n)=>t[0]===e.points[n][0]||t[1]===e.points[n][1]),`Elbow arrow segments must be either horizontal or vertical`));let i=n.points?n.points&&n.points.length===2?e.points.map((t,r)=>r===0?n.points[0]:r===e.points.length-1?n.points[1]:t):n.points.slice():e.points.slice(),a=typeof n.startBinding<`u`?n.startBinding:e.startBinding,o=typeof n.endBinding<`u`?n.endBinding:e.endBinding,s=a&&KC(a.elementId,t),c=o&&KC(o.elementId,t);if(t.size===0&&tw(i)||s?.id!==a?.elementId||c?.id!==o?.elementId)return qC(i.map(t=>P(e.x+t[0],e.y+t[1])),e.fixedSegments,e.startIsSpecial,e.endIsSpecial);let{startHeading:l,endHeading:u,startGlobalPoint:d,endGlobalPoint:p,hoveredStartElement:m,hoveredEndElement:h,...g}=MC({x:e.x,y:e.y,startBinding:a,endBinding:o,startArrowhead:e.startArrowhead,endArrowhead:e.endArrowhead,points:e.points},t,i,s,c,r),_=n.fixedSegments??e.fixedSegments??[];return!n.points&&!n.fixedSegments&&!n.startBinding&&!n.endBinding?EC(e,t):n.startBinding===e.startBinding&&n.endBinding===e.endBinding&&(n.points??[]).every((t,n)=>Sl(t,e.points[n]??P(1/0,1/0)))?{}:_.length===0?qC(JC(YC(NC(e,{startHeading:l,endHeading:u,startGlobalPoint:d,endGlobalPoint:p,hoveredStartElement:m,hoveredEndElement:h,...g})??[])),_,null,null):(e.fixedSegments?.length??0)>_.length?DC(e,_,t):n.points?n.points&&n.fixedSegments?n:kC(e,i,_,l,u,d,p,m,h):OC(e,_,l,u,m,h)},MC=(e,t,n,r,i,a)=>{let o=Cl(n[0],ul(e.x,e.y)),s=Cl(n[n.length-1],ul(e.x,e.y)),c=r,l=i;if(a?.isDragging){let e=Array.from(t.values());c=$C(o,t,e,a?.zoom)||r,l=$C(s,t,e,a?.zoom)||i}let u=ZC({...e,elbowed:!0,points:n},`start`,e.startBinding?.fixedPoint,o,r,c,a?.isDragging),d=ZC({...e,elbowed:!0,points:n},`end`,e.endBinding?.fixedPoint,s,i,l,a?.isDragging),f=QC(u,d,t,c,o),p=QC(d,u,t,l,s),m=[u[0]-2,u[1]-2,u[0]+2,u[1]+2],h=[d[0]-2,d[1]-2,d[0]+2,d[1]+2],g=c?qg(c,PC(f,e.startArrowhead?Fv*6:Fv*2,1)):m,_=l?qg(l,PC(p,e.endArrowhead?Fv*6:Fv*2,1)):h,v=Jg(u,l?qg(l,PC(p,TC,TC)):h)||Jg(d,c?qg(c,PC(f,TC,TC)):m),y=GC(v?[m,h]:[g,_]),b=RC(v?m:g,v?h:_,y,v?PC(f,!c&&!l?0:TC,0):PC(f,!c&&!l?0:TC-(e.startArrowhead?Fv*6:Fv*2),TC),v?PC(p,!c&&!l?0:TC,0):PC(p,!c&&!l?0:TC-(e.endArrowhead?Fv*6:Fv*2),TC),v,c&&qg(c),l&&qg(l));return{dynamicAABBs:b,startDonglePosition:BC(b[0],f,u),startGlobalPoint:u,startHeading:f,endDonglePosition:BC(b[1],p,d),endGlobalPoint:d,endHeading:p,commonBounds:y,hoveredStartElement:c,hoveredEndElement:l,boundsOverlap:v,startElementBounds:g,endElementBounds:_}},NC=(e,t)=>{let{dynamicAABBs:n,startDonglePosition:r,startGlobalPoint:i,startHeading:a,endDonglePosition:o,endGlobalPoint:s,endHeading:c,commonBounds:l,hoveredEndElement:u}=t,d=zC(n,r||i,a,o||s,c,l),f=r&&WC(r,d),p=o&&WC(o,d),m=WC(s,d);m&&u&&(m.closed=!0);let h=WC(i,d);h&&e.startBinding&&(h.closed=!0);let g=f&&p&&(Jg(f.pos,n[1])||Jg(p.pos,n[0])),_=FC(f||h,p||m,d,a||F_,c||F_,g?[]:n);if(_){let e=_.map(e=>[e.pos[0],e.pos[1]]);return f&&e.unshift(i),p&&e.push(s),e}return null},PC=(e,t,n)=>{switch(e){case R_:return[t,n,n,n];case F_:return[n,t,n,n];case I_:return[n,n,t,n]}return[n,n,n,t]},FC=(e,t,n,r,i,a)=>{let o=LC(e.pos,t.pos),s=new CC(e=>e.f);for(s.push(e);s.size()>0;){let c=s.pop();if(!c||c.closed)continue;if(c===t)return IC(e,c);c.closed=!0;let l=HC(c.addr,n);for(let n=0;n<4;n++){let u=l[n];if(!u||u.closed)continue;let d=Dl(u.pos,c.pos,.5);if(ad(...a.map(e=>Jg(d,e))))continue;let f=XC(n),p=c.parent?B_(N(c.pos,c.parent.pos)):r;if(U_(K_(p),f)||ew(e.addr,u.addr)&&U_(f,r)||ew(t.addr,u.addr)&&U_(f,i))continue;let m=p!==f,h=c.g+LC(u.pos,c.pos)+(m?o**3:0),g=u.visited;if(!g||h<u.g){let e=VC(u,t,f,i);u.visited=!0,u.parent=c,u.h=LC(t.pos,u.pos)+e*o**2,u.g=h,u.f=u.g+u.h,g?s.rescoreElement(u):s.push(u)}}}return null},IC=(e,t)=>{let n=t,r=[];for(;n.parent;)r.unshift(n),n=n.parent;return r.unshift(e),r},LC=(e,t)=>Math.abs(e[0]-t[0])+Math.abs(e[1]-t[1]),RC=(e,t,n,r,i,a,o,s)=>{let c=o??e,l=s??t,[u,d,f,p]=r??[0,0,0,0],[m,h,g,_]=i??[0,0,0,0],v=[e[0]>t[2]?e[1]>t[3]||e[3]<t[1]?Math.min((c[0]+l[2])/2,e[0]-p):(c[0]+l[2])/2:e[0]>t[0]?e[0]-p:n[0]-p,e[1]>t[3]?e[0]>t[2]||e[2]<t[0]?Math.min((c[1]+l[3])/2,e[1]-u):(c[1]+l[3])/2:e[1]>t[1]?e[1]-u:n[1]-u,e[2]<t[0]?e[1]>t[3]||e[3]<t[1]?Math.max((c[2]+l[0])/2,e[2]+d):(c[2]+l[0])/2:e[2]<t[2]?e[2]+d:n[2]+d,e[3]<t[1]?e[0]>t[2]||e[2]<t[0]?Math.max((c[3]+l[1])/2,e[3]+f):(c[3]+l[1])/2:e[3]<t[3]?e[3]+f:n[3]+f],y=[t[0]>e[2]?t[1]>e[3]||t[3]<e[1]?Math.min((l[0]+c[2])/2,t[0]-_):(l[0]+c[2])/2:t[0]>e[0]?t[0]-_:n[0]-_,t[1]>e[3]?t[0]>e[2]||t[2]<e[0]?Math.min((l[1]+c[3])/2,t[1]-m):(l[1]+c[3])/2:t[1]>e[1]?t[1]-m:n[1]-m,t[2]<e[0]?t[1]>e[3]||t[3]<e[1]?Math.max((l[2]+c[0])/2,t[2]+h):(l[2]+c[0])/2:t[2]<e[2]?t[2]+h:n[2]+h,t[3]<e[1]?t[0]>e[2]||t[2]<e[0]?Math.max((l[3]+c[1])/2,t[3]+g):(l[3]+c[1])/2:t[3]<e[3]?t[3]+g:n[3]+g],b=GC([v,y]);if(!a&&v[2]-v[0]+y[2]-y[0]>b[2]-b[0]+1e-11&&v[3]-v[1]+y[3]-y[1]>b[3]-b[1]+1e-11){let[n,r]=[(y[0]+y[2])/2,(y[1]+y[3])/2];if(t[0]>e[2]&&e[1]>t[3]){let t=v[2]+(y[0]-v[2])/2,i=y[3]+(v[1]-y[3])/2;return dl(ul(e[2]-n,e[1]-r),ul(e[0]-n,e[3]-r))>0?[[v[0],v[1],t,v[3]],[t,y[1],y[2],y[3]]]:[[v[0],i,v[2],v[3]],[y[0],y[1],y[2],i]]}if(e[2]<t[0]&&e[3]<t[1]){let t=v[2]+(y[0]-v[2])/2,i=v[3]+(y[1]-v[3])/2;return dl(ul(e[0]-n,e[1]-r),ul(e[2]-n,e[3]-r))>0?[[v[0],v[1],v[2],i],[y[0],i,y[2],y[3]]]:[[v[0],v[1],t,v[3]],[t,y[1],y[2],y[3]]]}if(e[0]>t[2]&&e[3]<t[1]){let t=y[2]+(v[0]-y[2])/2,i=v[3]+(y[1]-v[3])/2;return dl(ul(e[2]-n,e[1]-r),ul(e[0]-n,e[3]-r))>0?[[t,v[1],v[2],v[3]],[y[0],y[1],t,y[3]]]:[[v[0],v[1],v[2],i],[y[0],i,y[2],y[3]]]}if(e[0]>t[2]&&e[1]>t[3]){let t=y[2]+(v[0]-y[2])/2,i=y[3]+(v[1]-y[3])/2;return dl(ul(e[0]-n,e[1]-r),ul(e[2]-n,e[3]-r))>0?[[t,v[1],v[2],v[3]],[y[0],y[1],t,y[3]]]:[[v[0],i,v[2],v[3]],[y[0],y[1],y[2],i]]}}return[v,y]},zC=(e,t,n,r,i,a)=>{let o=new Set,s=new Set;n===L_||n===F_?s.add(t[1]):o.add(t[0]),i===L_||i===F_?s.add(r[1]):o.add(r[0]),e.forEach(e=>{o.add(e[0]),o.add(e[2]),s.add(e[1]),s.add(e[3])}),o.add(a[0]),o.add(a[2]),s.add(a[1]),s.add(a[3]);let c=Array.from(s).sort((e,t)=>e-t),l=Array.from(o).sort((e,t)=>e-t);return{row:c.length,col:l.length,data:c.flatMap((e,t)=>l.map((n,r)=>({f:0,g:0,h:0,closed:!1,visited:!1,parent:null,addr:[r,t],pos:[n,e]})))}},BC=(e,t,n)=>{switch(t){case R_:return P(n[0],e[1]);case F_:return P(e[2],n[1]);case I_:return P(n[0],e[3])}return P(e[0],n[1])},VC=(e,t,n,r)=>{if(r===F_)switch(n){case F_:return e.pos[0]>=t.pos[0]?4:e.pos[1]===t.pos[1]?0:2;case R_:return e.pos[1]>t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case I_:return e.pos[1]<t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case L_:return e.pos[1]===t.pos[1]?4:2}else if(r===L_)switch(n){case F_:return e.pos[1]===t.pos[1]?4:2;case R_:return e.pos[1]>t.pos[1]&&e.pos[0]>t.pos[0]?1:3;case I_:return e.pos[1]<t.pos[1]&&e.pos[0]>t.pos[0]?1:3;case L_:return e.pos[0]<=t.pos[0]?4:e.pos[1]===t.pos[1]?0:2}else if(r===R_)switch(n){case F_:return e.pos[1]>t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case R_:return e.pos[1]>=t.pos[1]?4:e.pos[0]===t.pos[0]?0:2;case I_:return e.pos[0]===t.pos[0]?4:2;case L_:return e.pos[1]>t.pos[1]&&e.pos[0]>t.pos[0]?1:3}else if(r===I_)switch(n){case F_:return e.pos[1]<t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case R_:return e.pos[0]===t.pos[0]?4:2;case I_:return e.pos[1]<=t.pos[1]?4:e.pos[0]===t.pos[0]?0:2;case L_:return e.pos[1]<t.pos[1]&&e.pos[0]>t.pos[0]?1:3}return 0},HC=([e,t],n)=>[UC([e,t-1],n),UC([e+1,t],n),UC([e,t+1],n),UC([e-1,t],n)],UC=([e,t],n)=>e<0||e>=n.col||t<0||t>=n.row?null:n.data[t*n.col+e]??null,WC=(e,t)=>{for(let n=0;n<t.col;n++)for(let r=0;r<t.row;r++){let i=UC([n,r],t);if(i&&e[0]===i.pos[0]&&e[1]===i.pos[1])return i}return null},GC=e=>[Math.min(...e.map(e=>e[0])),Math.min(...e.map(e=>e[1])),Math.max(...e.map(e=>e[2])),Math.max(...e.map(e=>e[3]))],KC=(e,t)=>{let n=t.get(e);return n&&wd(n)?n:null},qC=(e,t,n,r)=>{let i=e[0][0],a=e[0][1],o=e.map(t=>Cl(t,hl(N(e[0]),-1)));return(i<-AC||i>AC||a<-AC||a>AC||i+o[o.length-1][0]<-AC||a+o[o.length-1][0]>AC||i+o[o.length-1][1]<-AC||a+o[o.length-1][1]>AC)&&console.error(`Elbow arrow normalization is outside reasonable bounds (> 1e6)`,{x:i,y:a,points:o,...tv(o)}),o=o.map(([e,t])=>P(el(e,-1e6,1e6),el(t,-1e6,1e6))),{points:o,x:el(i,-1e6,1e6),y:el(a,-1e6,1e6),fixedSegments:(t?.length??0)>0?t:null,...tv(o),startIsSpecial:n,endIsSpecial:r}},JC=e=>{if(e.length>1){let t=Math.abs(e[0][1]-e[1][1])<Math.abs(e[0][0]-e[1][0]);return e.filter((n,r)=>{if(r===0||r===e.length-1)return!0;let i=e[r+1],a=Math.abs(n[1]-i[1])<Math.abs(n[0]-i[0]);return t===a?(t=a,!1):(t=a,!0)})}return e},YC=e=>e.length>=4?e.filter((t,n)=>{if(n===0||n===e.length-1)return!0;let r=e[n-1];return Tl(r,t)>wC}):e,XC=e=>{switch(e){case 0:return R_;case 1:return F_;case 2:return I_}return L_},ZC=(e,t,n,r,i,a,o)=>{if(o)return a?uy(a,sy(e,a,t)):r;if(i){let r=ky(n||[0,0],i);return Math.abs(kv(i,r)-Fv)>.01?sy(e,i,t):r}return r},QC=(e,t,n,r,i)=>ay(e,t,r,r&&qg(r,[,,,,].fill(kv(r,e))),n,i),$C=(e,t,n,r)=>Qv(Su(e),n,t,r,!0,!0),ew=(e,t)=>e[0]===t[0]&&e[1]===t[1],tw=(e,t=wC)=>e.slice(1).map((n,r)=>Math.abs(n[0]-e[r][0])<t||Math.abs(n[1]-e[r][1])<t).every(Boolean),nw={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,image:!0,arrow:!0,freedraw:!0,eraser:!1,custom:!0,frame:!0,embeddable:!0,hand:!0,laser:!1,magicframe:!1},rw=e=>Object.keys(Ys).includes(e)?Ys[e]:tc,iw=(e,t)=>{if(!t)return null;let n=t.focus||0;return z(e)?Fd(t)?{...t,focus:n,fixedPoint:My(t.fixedPoint??[0,0])}:null:{...t,focus:n}},aw=(e,t)=>{let n={type:t.type||e.type,version:e.version||1,versionNonce:e.versionNonce??0,index:e.index??null,isDeleted:e.isDeleted??!1,id:e.id||gx(),fillStyle:e.fillStyle||Nc.fillStyle,strokeWidth:e.strokeWidth||Nc.strokeWidth,strokeStyle:e.strokeStyle??Nc.strokeStyle,roughness:e.roughness??Nc.roughness,opacity:e.opacity==null?Nc.opacity:e.opacity,angle:e.angle||0,x:t.x??e.x??0,y:t.y??e.y??0,strokeColor:e.strokeColor||Nc.strokeColor,backgroundColor:e.backgroundColor||Nc.backgroundColor,width:e.width||0,height:e.height||0,seed:e.seed??1,groupIds:e.groupIds??[],frameId:e.frameId??null,roundness:e.roundness?e.roundness:e.strokeSharpness===`round`?{type:jd(e.type)?jc.LEGACY:jc.PROPORTIONAL_RADIUS}:null,boundElements:e.boundElementIds?e.boundElementIds.map(e=>({type:`arrow`,id:e})):e.boundElements??[],updated:e.updated??Mu(),link:e.link?Qb(e.link):null,locked:e.locked??!1};return(`customData`in e||`customData`in t)&&(n.customData=`customData`in t?t.customData:e.customData),{...e,...n,...dE(n),...t}},ow=e=>{switch(e={...e},e.type){case`text`:delete e.rawText;let t=e.fontSize,n=e.fontFamily;if(`font`in e){let[r,i]=e.font.split(` `);t=parseFloat(r),n=rw(i)}let r=typeof e.text==`string`&&e.text||``,i=e.lineHeight||(e.height?Ud(e):Xh(e.fontFamily));return e=aw(e,{fontSize:t,fontFamily:n,text:r,textAlign:e.textAlign||`left`,verticalAlign:e.verticalAlign||`top`,containerId:e.containerId??null,originalText:e.originalText||r,autoResize:e.autoResize??!0,lineHeight:i}),!r&&!e.isDeleted&&(e={...e,originalText:r,isDeleted:!0},e=aE(e)),e;case`freedraw`:return aw(e,{points:e.points,lastCommittedPoint:null,simulatePressure:e.simulatePressure,pressures:e.pressures});case`image`:return aw(e,{status:e.status||`pending`,fileId:e.fileId,scale:e.scale||[1,1],crop:e.crop??null});case`line`:case`draw`:let{startArrowhead:a=null,endArrowhead:o=null}=e,s=e.x,c=e.y,l=!Array.isArray(e.points)||e.points.length<2?[P(0,0),P(e.width,e.height)]:e.points;return(l[0][0]!==0||l[0][1]!==0)&&({points:l,x:s,y:c}=U.getNormalizedPoints(e)),aw(e,{type:e.type===`draw`?`line`:e.type,startBinding:iw(e,e.startBinding),endBinding:iw(e,e.endBinding),lastCommittedPoint:null,startArrowhead:a,endArrowhead:o,points:l,x:s,y:c,...tv(l)});case`arrow`:{let{startArrowhead:t=null,endArrowhead:n=`arrow`}=e,r=e.x,i=e.y,a=!Array.isArray(e.points)||e.points.length<2?[P(0,0),P(e.width,e.height)]:e.points;(a[0][0]!==0||a[0][1]!==0)&&({points:a,x:r,y:i}=U.getNormalizedPoints(e));let o={type:e.type,startBinding:iw(e,e.startBinding),endBinding:iw(e,e.endBinding),lastCommittedPoint:null,startArrowhead:t,endArrowhead:n,points:a,x:r,y:i,elbowed:e.elbowed,...tv(a)};return z(e)?aw(e,{...o,elbowed:!0,startBinding:iw(e,e.startBinding),endBinding:iw(e,e.endBinding),fixedSegments:e.fixedSegments,startIsSpecial:e.startIsSpecial,endIsSpecial:e.endIsSpecial}):aw(e,o)}case`ellipse`:case`rectangle`:case`diamond`:case`iframe`:case`embeddable`:return aw(e,{});case`magicframe`:case`frame`:return aw(e,{name:e.name??null})}return null},sw=(e,t)=>{if(e.boundElements){let n=e.boundElements.slice(),r=new Set;e.boundElements=n.reduce((n,i)=>{let a=t.get(i.id);if(a&&!r.has(i.id)){if(r.add(i.id),a.isDeleted)return n;n.push(i),R(a)&&!a.containerId&&(a.containerId=e.id)}return n},[])}},cw=(e,t)=>{let n=e.containerId?t.get(e.containerId):null;if(!n){e.containerId=null;return}if(!e.isDeleted&&n.boundElements&&!n.boundElements.find(t=>t.id===e.id)){let t=(n.boundElements||=[]).slice();t.push({type:`text`,id:e.id}),n.boundElements=t}},lw=(e,t)=>{e.frameId&&(t.get(e.frameId)||(e.frameId=null))},uw=(e,t,n)=>{let r=new Set,i=t?Nu(t):null,a=Vx((e||[]).reduce((e,t)=>{if(t.type!==`selection`&&!oE(t)){let n=ow(t);if(n){let a=i?.get(t.id);a&&a.version>n.version&&(n=aE(n,a.version)),r.has(n.id)&&(n={...n,id:gx()}),r.add(n.id),e.push(n)}}return e},[]));if(!n?.repairBindings)return a;let o=Nu(a);for(let e of a)e.frameId&&lw(e,o),R(e)&&e.containerId?cw(e,o):e.boundElements&&sw(e,o),n.refreshDimensions&&R(e)&&Object.assign(e,Dx(e,Bb(e,o),o)),yd(e)&&(e.startBinding&&(!o.has(e.startBinding.elementId)||!bd(e))&&(e.startBinding=null),e.endBinding&&(!o.has(e.endBinding.elementId)||!bd(e))&&(e.endBinding=null));return a.map(e=>{if(z(e)&&e.startBinding==null&&e.endBinding==null&&!tw(e.points))return{...e,...jC(e,o,{points:[P(0,0),e.points[e.points.length-1]]}),index:e.index};if(z(e)&&e.startBinding&&e.endBinding&&e.startBinding.elementId===e.endBinding.elementId&&e.points.length>1&&e.points.some(([e,t])=>Math.abs(e)>1e6||Math.abs(t)>1e6)){console.error(`Fixing self-bound elbow arrow`,e.id);let t=o.get(e.startBinding.elementId);return t?{...e,x:t.x+t.width/2,y:t.y-5,width:t.width,height:t.height,points:[P(0,0),P(0,-10),P(t.width/2+5,-10),P(t.width/2+5,t.height/2+5)]}:(console.error(`Bound element not found`,e.startBinding.elementId),e)}return e})},dw=(e,t,n)=>{let r=t[e];return r===void 0?n[e]:r},fw={isSidebarDocked:(e,t)=>[`defaultSidebarDockedPreference`,e.isSidebarDocked??dw(`defaultSidebarDockedPreference`,e,t)]},pw=(e,t)=>{e||={};let n=qc(),r={};for(let t of Object.keys(fw))if(t in e){let[i,a]=fw[t](e,n);r[i]=a}for(let[i,a]of Object.entries(n)){let n=e[i],o=t?t[i]:void 0;r[i]=n===void 0?o===void 0?a:o:n}return{...r,cursorButton:t?.cursorButton||`up`,penDetected:t?.penDetected??(e.penMode?e.penDetected??!1:!1),activeTool:{...gu(n,r.activeTool.type&&nw[r.activeTool.type]?r.activeTool:{type:`selection`}),lastActiveTool:null,locked:r.activeTool.locked??!1},zoom:{value:Iy(il(e.zoom)?e.zoom:e.zoom?.value??n.zoom.value)},openSidebar:typeof e.openSidebar==`string`?{name:Ic.name}:r.openSidebar,gridSize:Ly(il(e.gridSize)?e.gridSize:20),gridStep:Ry(il(e.gridStep)?e.gridStep:sc),editingFrame:null}},mw=(e,t,n,r)=>({elements:uw(e?.elements,n,r),appState:pw(e?.appState,t||null),files:e?.files||{}}),hw=e=>{let t=uw(eD(e.elements),null);return t.length?{...e,elements:t}:null},gw=(e=[],t)=>{let n=[];for(let r of e)if(Array.isArray(r)){let e=hw({status:t,elements:r,id:gx(),created:Date.now()});e&&n.push(e)}else{let e=r,i=hw({...e,id:e.id||gx(),status:e.status||t,created:e.created||Date.now()});i&&n.push(i)}return n},_w=32,vw=12,yw=256,bw=50,xw=`NOT_SPREADSHEET`,Sw=`VALID_SPREADSHEET`,Cw=e=>{let t=/^([-+]?)[$€£¥₩]?([-+]?)([\d.,]+)[%]?$/.exec(e);return t?parseFloat(`${(t[1]||t[2])+t[3]}`.replace(/,/g,``)):null},ww=(e,t)=>e.slice(1).every(e=>Cw(e[t])!==null),Tw=e=>{let t=e[0].length;if(t>2)return{type:xw,reason:`More than 2 columns`};if(t===1){if(!ww(e,0))return{type:xw,reason:`Value is not numeric`};let t=Cw(e[0][0])===null,n=(t?e.slice(1):e).map(e=>Cw(e[0]));return n.length<2?{type:xw,reason:`Less than two rows`}:{type:Sw,spreadsheet:{title:t?e[0][0]:null,labels:null,values:n}}}let n=ww(e,0),r=ww(e,1);if(!n&&!r)return{type:xw,reason:`Value is not numeric`};let[i,a]=r?[0,1]:[1,0],o=Cw(e[0][a])===null,s=o?e.slice(1):e;return s.length<2?{type:xw,reason:`Less than 2 rows`}:{type:Sw,spreadsheet:{title:o?e[0][a]:null,labels:s.map(e=>e[i]),values:s.map(e=>Cw(e[a]))}}},Ew=e=>{let t=[];for(let n=0;n<e[0].length;n++){let r=[];for(let t=0;t<e.length;t++)r.push(e[t][n]);t.push(r)}return t},Dw=e=>{let t=e.trim().split(`
|
|
46
|
+
`).map(e=>e.trim().split(` `));if(t.length&&t[0].length!==2&&(t=e.trim().split(`
|
|
47
|
+
`).map(e=>e.trim().split(`,`))),t.length===0)return{type:xw,reason:`No values`};let n=t[0].length;if(!t.every(e=>e.length===n))return{type:xw,reason:`All rows don't have same number of columns`};let r=Tw(t);if(r.type!==Sw){let e=Tw(Ew(t));if(e.type===Sw)return e}return r},Ow=Os(vs),kw={fillStyle:`hachure`,fontFamily:tc,fontSize:20,opacity:100,roughness:1,strokeColor:xs.black,roundness:null,strokeStyle:`solid`,strokeWidth:1,verticalAlign:Ec.MIDDLE,locked:!1},Aw=e=>({chartWidth:(_w+vw)*e.values.length+vw,chartHeight:yw+vw*2}),jw=(e,t,n,r,i)=>e.labels?.map((e,a)=>wx({groupIds:[r],backgroundColor:i,...kw,text:e.length>8?`${e.slice(0,5)}...`:e,x:t+a*(_w+vw)+vw*2,y:n+vw/2,width:_w,angle:5.87,fontSize:16,textAlign:`center`,verticalAlign:`top`}))||[],Mw=(e,t,n,r,i)=>{let a=wx({groupIds:[r],backgroundColor:i,...kw,x:t-vw,y:n-vw,text:`0`,textAlign:`right`});return[a,wx({groupIds:[r],backgroundColor:i,...kw,x:t-vw,y:n-yw-a.height/2,text:Math.max(...e.values).toLocaleString(),textAlign:`right`})]},Nw=(e,t,n,r,i)=>{let{chartWidth:a,chartHeight:o}=Aw(e);return[kx({backgroundColor:i,groupIds:[r],...kw,type:`line`,x:t,y:n,width:a,points:[P(0,0),P(a,0)]}),kx({backgroundColor:i,groupIds:[r],...kw,type:`line`,x:t,y:n,height:o,points:[P(0,0),P(0,-o)]}),kx({backgroundColor:i,groupIds:[r],...kw,type:`line`,x:t,y:n-yw-vw,strokeStyle:`dotted`,width:a,opacity:bw,points:[P(0,0),P(a,0)]})]},Pw=(e,t,n,r,i,a)=>{let{chartWidth:o,chartHeight:s}=Aw(e),c=e.title?wx({backgroundColor:i,groupIds:[r],...kw,text:e.title,x:t+o/2,y:n-yw-vw*2-20,roundness:null,textAlign:`center`}):null,l=a?vx({backgroundColor:i,groupIds:[r],...kw,type:`rectangle`,x:t,y:n-s,width:o,height:s,strokeColor:xs.black,fillStyle:`solid`,opacity:6}):null;return[...l?[l]:[],...c?[c]:[],...jw(e,t,n,r,i),...Mw(e,t,n,r,i),...Nw(e,t,n,r,i)]},Fw=(e,t,n)=>{let r=Math.max(...e.values),i=gx(),a=Ow[Math.floor(Math.random()*Ow.length)];return[...e.values.map((e,o)=>{let s=e/r*yw;return vx({backgroundColor:a,groupIds:[i],...kw,type:`rectangle`,x:t+o*(_w+vw)+vw,y:n-s-vw,width:_w,height:s})}),...Pw(e,t,n,i,a,f.DEV)]},Iw=(e,t,n)=>{let r=Math.max(...e.values),i=gx(),a=Ow[Math.floor(Math.random()*Ow.length)],o=0,s=[];for(let t of e.values){let e=o*(_w+vw),n=-(t/r)*yw;s.push([e,n]),o++}let c=Math.max(...s.map(e=>e[0])),l=Math.max(...s.map(e=>e[1])),u=Math.min(...s.map(e=>e[0])),d=Math.min(...s.map(e=>e[1])),p=kx({backgroundColor:a,groupIds:[i],...kw,type:`line`,x:t+vw+_w/2,y:n-vw,height:l-d,width:c-u,strokeWidth:2,points:s}),m=e.values.map((e,o)=>{let s=o*(_w+vw)+vw/2,c=-(e/r)*yw+vw/2;return vx({backgroundColor:a,groupIds:[i],...kw,fillStyle:`solid`,strokeWidth:2,type:`ellipse`,x:t+s+_w/2,y:n+c-vw*2,width:vw,height:vw})}),h=e.values.map((e,o)=>{let s=o*(_w+vw)+vw/2,c=e/r*yw+vw/2+vw;return kx({backgroundColor:a,groupIds:[i],...kw,type:`line`,x:t+s+_w/2+vw/2,y:n-c,height:c,strokeStyle:`dotted`,opacity:bw,points:[P(0,0),P(0,c)]})});return[...Pw(e,t,n,i,a,f.DEV),p,...h,...m]},Lw=(e,t,n,r)=>e===`line`?Iw(t,n,r):Fw(t,n,r);`clipboard`in navigator&&`readText`in navigator.clipboard;var Rw=`clipboard`in navigator&&`writeText`in navigator.clipboard,zw=`clipboard`in navigator&&`write`in navigator.clipboard&&`ClipboardItem`in window&&`toBlob`in HTMLCanvasElement.prototype,Bw=e=>!!([dc.excalidraw,dc.excalidrawClipboard,dc.excalidrawClipboardWithAPI].includes(e?.type)&&Array.isArray(e.elements)),Vw=({types:e,files:t})=>{!e&&!t&&console.warn(`createPasteEvent: no types or files provided`);let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});if(e)for(let[r,i]of Object.entries(e)){if(typeof i!=`string`){t||=[],t.push(i);continue}try{if(n.clipboardData?.setData(r,i),n.clipboardData?.getData(r)!==i)throw Error(`Failed to set "${r}" as clipboardData item`)}catch(e){throw Error(e.message)}}if(t){let e=-1;for(let r of t){e++;try{if(n.clipboardData?.items.add(r),n.clipboardData?.files[e]!==r)throw Error(`Failed to set file "${r.name}" as clipboardData item`)}catch(e){throw Error(e.message)}}}return n},Hw=({elements:e,files:t})=>{let n=Nu(e),r=new Set(e.filter(e=>gd(e))),i=!1,a=e.reduce((e,n)=>(ld(n)&&(i=!0,t&&t[n.fileId]&&(e[n.fileId]=t[n.fileId])),e),{});i&&!t&&console.warn("copyToClipboard: attempting to file element(s) without providing associated `files` object.");let o={type:dc.excalidrawClipboard,elements:e.map(e=>{if(AT(e,n)&&!r.has(AT(e,n))){let t=Nx(e);return K(t,{frameId:null}),t}return e}),files:t?a:void 0};return JSON.stringify(o)},Uw=async(e,t,n)=>{await Zw(Hw({elements:e,files:t}),n)},Ww=e=>{let t=Dw(e);return t.type===Sw?{spreadsheet:t.spreadsheet}:null};function Gw(e){let t=[];for(let n of e.childNodes)if(n.nodeType===3){let e=n.textContent?.trim();e&&t.push({type:`text`,value:e})}else if(n instanceof HTMLImageElement){let e=n.getAttribute(`src`);e&&e.startsWith(`http`)&&t.push({type:`imageUrl`,value:e})}else t=t.concat(Gw(n));return t}var Kw=e=>{let t=e.clipboardData?.getData(j.html);if(!t)return null;try{let e=Gw(new DOMParser().parseFromString(t,j.html).body);if(e.length)return{type:`mixedContent`,value:e}}catch(e){console.error(`error in parseHTMLFromPaste: ${e.message}`)}return null},qw=async()=>{let e={},t;try{t=await navigator.clipboard?.read()}catch(t){try{if(navigator.clipboard?.readText){console.warn(`navigator.clipboard.readText() failed (${t.message}). Failling back to navigator.clipboard.read()`);let e=await navigator.clipboard?.readText();if(e)return{[j.text]:e}}}catch(t){if(navigator.clipboard?.read)console.warn(`navigator.clipboard.readText() failed (${t.message}). Failling back to navigator.clipboard.read()`);else{if(t.name===`DataError`)return console.warn(`navigator.clipboard.read() error, clipboard is probably empty: ${t.message}`),e;throw t}}throw t}for(let n of t)for(let t of n.types)if(Zu(lc,t))try{if(t===j.text||t===j.html)e[t]=await(await n.getType(t)).text();else if(lD(t))e[t]=DD(await n.getType(t),t,void 0);else throw new wh(`Unsupported clipboard type: ${t}`)}catch(e){console.warn(e instanceof wh?e.message:`Cannot retrieve ${t} from clipboardItem: ${e.message}`)}return Object.keys(e).length===0&&console.warn(`No clipboard data found from clipboard.read().`),e},Jw=async(e,t=!1)=>{try{let n=!t&&e&&Kw(e);return n?n.value.every(e=>e.type===`text`)?{type:`text`,value:e.clipboardData?.getData(j.text)||n.value.map(e=>e.value).join(`
|
|
48
|
+
`).trim()}:n:{type:`text`,value:(e.clipboardData?.getData(j.text)||``).trim()}}catch{return{type:`text`,value:``}}},Yw=async(e,t=!1)=>{let n=await Jw(e,t);if(n.type===`mixedContent`)return{mixedContent:n.value};try{let e=!t&&Ww(n.value);if(e)return e}catch(e){console.error(e)}try{let e=JSON.parse(n.value),r=e.type===dc.excalidrawClipboardWithAPI;if(Bw(e))return{elements:e.elements,files:e.files,text:t?JSON.stringify(e.elements,null,2):void 0,programmaticAPI:r}}catch{}return{text:n.value}},Xw=async e=>{try{await navigator.clipboard.write([new window.ClipboardItem({[j.png]:e})])}catch(t){if(Uu(e))await navigator.clipboard.write([new window.ClipboardItem({[j.png]:await e})]);else throw t}},Zw=async(e,t)=>{if(Rw)try{await navigator.clipboard.writeText(e||``);return}catch(e){console.error(e)}try{if(t){if(t.clipboardData?.setData(j.text,e||``),t.clipboardData?.getData(j.text)!==e)throw Error(`Failed to setData on clipboardEvent`);return}}catch(e){console.error(e)}if(!Qw(e))throw Error(`Error copying to clipboard.`)},Qw=e=>{e||=` `;let t=document.documentElement.getAttribute(`dir`)===`rtl`,n=document.createElement(`textarea`);n.style.border=`0`,n.style.padding=`0`,n.style.margin=`0`,n.style.position=`absolute`,n.style[t?`right`:`left`]=`-9999px`;let r=window.pageYOffset||document.documentElement.scrollTop;n.style.top=`${r}px`,n.style.fontSize=`12pt`,n.setAttribute(`readonly`,``),n.value=e,document.body.appendChild(n);let i=!1;try{n.select(),n.setSelectionRange(0,n.value.length),i=document.execCommand(`copy`)}catch(e){console.error(e)}return n.remove(),i},$w=({elements:e,appState:t,files:n,maxWidthOrHeight:r,getDimensions:i,exportPadding:a,exportingFrame:o})=>{let{elements:s,appState:c}=mw({elements:e,appState:t},null,null),{exportBackground:l,viewBackgroundColor:u}=c;return gC(s,{...c,offsetTop:0,offsetLeft:0,width:0,height:0},n||{},{exportBackground:l,exportPadding:a,viewBackgroundColor:u,exportingFrame:o},(e,n)=>{let a=document.createElement(`canvas`);if(r){typeof i==`function`&&console.warn("`getDimensions()` is ignored when `maxWidthOrHeight` is supplied.");let o=Math.max(e,n),s=r<o?r/o:t?.exportScale??1;return a.width=e*s,a.height=n*s,{canvas:a,scale:s}}let o=i?.(e,n)||{width:e,height:n};return a.width=o.width,a.height=o.height,{canvas:a,scale:o.scale??1}})},eT=async e=>{let{mimeType:t=j.png,quality:n}=e;t===j.png&&typeof n==`number`&&console.warn(`"quality" will be ignored for "${j.png}" mimeType`),t===`image/jpg`&&(t=j.jpg),t===j.jpg&&!e.appState?.exportBackground&&(console.warn(`Defaulting "exportBackground" to "true" for "${j.jpg}" mimeType`),e={...e,appState:{...e.appState,exportBackground:!0}});let r=await $w(e);return n||=/image\/jpe?g/.test(t)?.92:.8,new Promise((i,a)=>{r.toBlob(async n=>{if(!n)return a(Error(`couldn't export to blob`));n&&t===j.png&&e.appState?.exportEmbedScene&&(n=await RD({blob:n,metadata:NS(e.elements,e.appState,e.files||{},`local`)})),i(n)},t,n)})},tT=async({elements:e,appState:t=qc(),files:n={},exportPadding:r,renderEmbeddables:i,exportingFrame:a,skipInliningFonts:o,reuseImages:s})=>{let{elements:c,appState:l}=mw({elements:e,appState:t},null,null);return vC(c,{...l,exportPadding:r},n,{exportingFrame:a,renderEmbeddables:i,skipInliningFonts:o,reuseImages:s})},nT=e=>e.type===`diamond`?[P(e.width/2,0),P(e.width,e.height/2),P(e.width/2,e.height),P(0,e.height/2)]:[P(0,0),P(0+e.width,0),P(0+e.width,e.height),P(0,e.height)],rT=e=>yd(e)||_d(e)?e.points:nT(e),iT=e=>{let t=e.reduce((e,[t,n])=>(e.minY=Math.min(e.minY,n),e.minX=Math.min(e.minX,t),e.maxX=Math.max(e.maxX,t),e.maxY=Math.max(e.maxY,n),e),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,cx:0,cy:0});return t.cx=(t.maxX+t.minX)/2,t.cy=(t.maxY+t.minY)/2,t},aT=e=>{let t=rT(e),{cx:n,cy:r}=iT(t),i=P(n,r),{minX:a,minY:o,maxX:s,maxY:c}=iT(t.map(t=>F(t,i,e.angle)));return[a+e.x,o+e.y,s+e.x,c+e.y]},oT=(e,t,n=!1)=>{let r=aT(e),i=t[0]<=r[0]&&t[2]>=r[2]&&t[1]<=r[1]&&t[3]>=r[3];return n?i?!0:r[0]<=t[0]&&r[2]>=t[2]&&r[1]<=t[1]&&r[3]>=t[3]:i},sT=(e,t)=>{let n=aT(e);return($l(n[0],Xl(t[0],t[2]))||$l(t[0],Xl(n[0],n[2])))&&($l(n[1],Xl(t[1],t[3]))||$l(t[1],Xl(n[1],n[3])))},cT=({elements:e,bounds:t,type:n,errorMargin:r=0})=>{Dd(t)&&(t=yv(t,Nu(e)));let i=[t[0]-r,t[1]-r,t[2]+r,t[3]+r],a=new Set;for(let t of e)if(!a.has(t.id)&&(n===`overlap`?sT(t,i):n===`inside`?oT(t,i):oT(t,i,!0))){if(a.add(t.id),t.boundElements)for(let e of t.boundElements)a.add(e.id);R(t)&&t.containerId&&a.add(t.containerId),bd(t)&&(t.startBinding&&a.add(t.startBinding.elementId),t.endBinding&&a.add(t.endBinding?.elementId))}return e.filter(e=>a.has(e.id))};function lT(e){return[Math.min(e[0][0],e[1][0]),Math.min(e[0][1],e[1][1]),Math.max(e[0][0],e[1][0]),Math.max(e[0][1],e[1][1])]}function uT(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}var dT=1e-6;function fT(e,t){let n=dl(N(e[1],e[0]),N(t,e[0]));return Math.abs(n)<dT}function pT(e,t){return dl(N(e[1],e[0]),N(t,e[0]))<0}function mT(e,t){return fT(e,t[0])||fT(e,t[1])||(pT(e,t[0])?!pT(e,t[1]):pT(e,t[1]))}function hT(e,t){return uT(lT(e),lT(t))&&mT(e,t)&&mT(t,e)}var gT=(e,t,n)=>{let r=Nu(e);for(let e of t)if(e.frameId){let t=n.get(e.id),i=n.get(e.frameId);if(t){let n=r.get(t);n&&K(n,{frameId:i??e.frameId},!1)}}};function _T(e,t,n){let r=ov(t,n),i=ov(e,n);return r.some(e=>i.some(t=>hT(e,t)))}var vT=(e,t,n)=>LT(GT(e,t,n,!1)).filter(e=>!gd(e)&&!e.frameId||e.frameId===t.id),yT=(e,t,n)=>GT([t],e,n).some(e=>e.id===t.id),bT=(e,t,n)=>{let[r,i,a,o]=av(t,n),[s,c,l,u]=bv(e);return r<=s&&i<=c&&a>=l&&o>=u},xT=(e,t,n)=>bT([e],t,n)||_T(e,t,n)||yT(e,t,n),ST=(e,t,n)=>{let[r,i,a,o]=av(t,n);return Ol(P(r,i),P(e.x,e.y),P(a,o))},CT=e=>{let t=new Map;for(let n of e){let r=gd(n)?n.id:n.frameId;r&&!t.has(r)&&t.set(r,wT(e,r))}return t},wT=(e,t)=>{let n=[];for(let r of e.values())r.frameId===t&&n.push(r);return n},TT=e=>e.filter(e=>gd(e)),ET=e=>{let t=Nu(TT(e));return e.filter(e=>t.has(e.id)||!e.frameId||!t.has(e.frameId))},DT=(e,t,n,r)=>{let i=wT(e,t.id),a=new Set(i),o=new Set([...vT(e,t,r),...i.filter(e=>yT(e,t,r))]),s=i.filter(e=>!o.has(e)),c=new Set(Array.from(o).flatMap(e=>e.groupIds));for(let e of s)if(!_T(e,t,r))e.groupIds.length===0&&a.delete(e);else if(e.groupIds.length>0)for(let t of e.groupIds)c.add(t);for(let e of s)if(e.groupIds.length>0){let t=!0;for(let n of e.groupIds)c.has(n)&&(t=!1);t&&a.delete(e)}let l=Array.from(o).filter(e=>e.groupIds.length===0);for(let e of l)a.add(e);let u=Wy(Array.from(o).filter(e=>e.groupIds.length>0),n);for(let[n,i]of Object.entries(u))if(i){let i=qy(e,n);if(bT(i,t,r))for(let e of i)a.add(e)}return[...a].filter(e=>!(R(e)&&e.containerId))},OT=(e,t,n)=>kT(LT(e,vT(e,t,n)),t,n),kT=(e,t,n)=>{let r=[],i=new Map;for(let a of e){let e=!1;if(a.groupIds.length>0){if(a.groupIds.some(e=>i.get(e)))e=!0;else{let r=new Set(a.groupIds.flatMap(e=>qy(n,e)));e=!bT(Array.from(r),t,n)}a.groupIds.forEach(t=>{i.set(t,e)})}e||r.push(a)}return r},AT=(e,t)=>e.frameId&&t.get(e.frameId)||null,jT=(e,t)=>{let n=new Set,r=Nu(e);e=LT(e);for(let r of e)gd(r)&&r.id!==t.id&&n.add(r.id);let i=new Set,a=[];for(let o of e)if(!(gd(o)||o.frameId&&n.has(o.frameId))){if(o.groupIds.length){let n=o.groupIds.at(-1);if(!i.has(n)){i.add(n);let o=qy(e,n);if(o.some(e=>xT(e,t,r)))for(let e of o)a.push(e)}}else xT(o,t,r)&&a.push(o)}return a},MT=(e,t,n,r)=>{let i=Nu(e),a=new Map;for(let t of e.values())t.frameId===n.id&&a.set(t.id,!0);let o=new Set(t.map(e=>e.id)),s=[],c=new Set;for(let e of t)gd(e)&&e.id!==n.id&&c.add(e.id);for(let n of LT(e,t)){if(gd(n)||n.frameId&&c.has(n.frameId)||n.frameId&&r.selectedElementIds[n.id]&&r.selectedElementIds[n.frameId])continue;a.has(n.id)||s.push(n);let e=zb(n,i);e&&!o.has(e.id)&&!a.has(e.id)&&s.push(e)}for(let e of s)K(e,{frameId:n.id},!1);return e},NT=(e,t)=>{let n=new Map,r=new Map;for(let i of e)if(i.frameId){n.set(i.id,i);let e=r.get(i.frameId)||[];e.push(i);let a=zb(i,t);a&&(n.set(a.id,a),e.push(a)),r.set(i.frameId,e)}for(let[,e]of n)K(e,{frameId:null},!1)},PT=(e,t)=>(NT(wT(e,t.id),Nu(e)),e),FT=(e,t,n,r)=>MT(PT(e,n),t,n,r.state).slice(),IT=(e,t,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,elements:e}),i=new Set(r);if(t.editingGroupId)for(let t of r)t.groupIds.length===0?i.add(t):t.groupIds.flatMap(t=>qy(e,t)).forEach(e=>i.add(e));let a=new Set,o=Nu(e);return i.forEach(e=>{e.frameId&&!gd(e)&&!zT(e,o,t)&&a.add(e)}),a.size>0&&NT(a,o),e},LT=(e,t)=>{let n=new Set,r=t||e;for(let e of r.values()){let t=e.groupIds[e.groupIds.length-1];t&&n.add(t)}let i=new Set;for(let t of n)qy(e,t).some(e=>gd(e))&&i.add(t);let a=[];for(let e of r.values())i.has(e.groupIds[e.groupIds.length-1])||a.push(e);return a},RT=(e,t,n)=>{let r=R(e)&&Bb(e,t)||e;return r.frameId&&n.selectedElementIds[r.id]&&n.selectedElementIds[r.frameId]?AT(r,t):n.selectedElementIds[r.id]&&n.selectedElementsAreBeingDragged?n.frameToHighlight:AT(r,t)},zT=(e,t,n,r)=>{let i=r?.targetFrame??RT(e,t,n);if(!i)return!1;let a=R(e)&&Bb(e,t)||e,o=e=>{r?.checkedGroups&&a.groupIds.forEach(t=>{r.checkedGroups?.set(t,e)})};if(!n.selectedElementIds[a.id]||!n.selectedElementsAreBeingDragged||n.selectedElementIds[a.id]&&n.selectedElementIds[i.id])return!0;if(a.groupIds.length===0)return xT(a,i,t);for(let e of a.groupIds)if(r?.checkedGroups?.has(e))return r.checkedGroups.get(e);let s=new Set(a.groupIds.filter(e=>!r?.checkedGroups||!r.checkedGroups.has(e)).flatMap(e=>qy(t,e)));if(n.editingGroupId&&n.selectedElementsAreBeingDragged){let e=new Set(YT(t,n));if(n.frameToHighlight!==null)return!0;e.forEach(e=>{s.delete(e)})}for(let e of s)if(gd(e))return o(!1),!1;for(let e of s)if(xT(e,i,t))return o(!0),!0;return!1},BT=(e,t,n,r,i)=>{if(!n.frameRendering||!n.frameRendering.clip)return!1;let a=_T(e,t,r)||yT(e,t,r);if(a){for(let t of e.groupIds)i?.set(t,!0);return!0}if(!a&&e.groupIds.length>0&&!bT([e],t,r)){let a=!1;if(n.selectedElementsAreBeingDragged)a=zT(e,r,n,{targetFrame:t,checkedGroups:i});else{a=e.frameId===t.id;for(let t of e.groupIds)i?.set(t,a)}for(let t of e.groupIds)i?.set(t,a);return a}return!1},VT=e=>e.name===null?md(e)?`Frame`:`AI Frame`:e.name,HT=(e,t)=>cT({elements:e,bounds:t,type:`overlap`}).filter(e=>!e.frameId||e.frameId===t.id),UT=e=>{let t=Nu(e);return e.length>1&&e.some(e=>e.frameId&&t.has(e.frameId))},WT=e=>{let t=new Set;return e.forEach(e=>{gd(e)&&t.add(e.id)}),e.filter(e=>!(e.frameId&&t.has(e.frameId)))},GT=(e,t,n,r=!0)=>{let[i,a,o,s]=av(t,n),c=e.filter(e=>{let[t,r,c,l]=yv(e,n),u=AT(e,n);if(u){let[e,i,a,o]=yv(u,n);t=Math.max(e,t),r=Math.max(i,r),c=Math.min(a,c),l=Math.min(o,l)}return e.locked===!1&&e.type!==`selection`&&!Ad(e)&&i<=t&&a<=r&&o>=c&&s>=l});return c=r?WT(c):c,c=c.filter(e=>{let t=AT(e,n);return!t||xT(e,t,n)}),c},KT=(e,t,n,r)=>{let i=new Set(t.map(e=>e.id));return e.filter(e=>{let t=sE(e,n.width,n.height,n,r);return!i.has(e.id)&&t})},qT=function(){let e=null,t=null,n=null,r=(r,i)=>(n!=null&&r===e&&i.selectedElementIds===t||(n=r.some(e=>i.selectedElementIds[e.id]),e=r,t=i.selectedElementIds),n);return r.clearCache=()=>{e=null,t=null,n=null},r}(),JT=(e,t,n)=>{let r=Array.from(new Set(YT(e,t).map(e=>n(e))));return r.length===1?r[0]:null},YT=(e,t,n)=>{let r=new Set,i=[];for(let a of e.values()){if(t.selectedElementIds[a.id]){i.push(a),r.add(a.id);continue}if(n?.includeBoundTextElement&&Ad(a)&&t.selectedElementIds[a?.containerId]){i.push(a),r.add(a.id);continue}}if(n?.includeElementsInFrames){let t=[];return i.forEach(n=>{gd(n)&&wT(e,n.id).forEach(e=>!r.has(e.id)&&t.push(e)),t.push(n)}),t}return i},XT=(e,t)=>t.editingTextElement?[t.editingTextElement]:t.newElement?[t.newElement]:YT(e,t,{includeBoundTextElement:!0}),ZT=(e,t)=>Ku(t.selectedElementIds,e)?t.selectedElementIds:e,QT=e=>{let t=new Map,n=[];for(let r of e)r.isDeleted||(n.push(r),t.set(r.id,r));return{elementsMap:t,elements:n}},$T=(0,qi.default)(e=>{(f.DEV||f.MODE===Gs.TEST||window?.DEBUG_FRACTIONAL_INDICES)&&Rx(e,{shouldThrow:f.DEV||f.MODE===Gs.TEST,includeBoundTextValidation:!0})},6e4,{leading:!0,trailing:!1}),eE=e=>{let t=[`includeBoundTextElement`,`includeElementsInFrames`],n=``;for(let r of t)n+=`${r}:${e[r]?`1`:`0`}`;return n},tE=e=>typeof e==`string`,nE=class e{constructor(){v(this,`callbacks`,new Set),v(this,`nonDeletedElements`,[]),v(this,`nonDeletedElementsMap`,rd(new Map)),v(this,`elements`,[]),v(this,`nonDeletedFramesLikes`,[]),v(this,`frames`,[]),v(this,`elementsMap`,rd(new Map)),v(this,`selectedElementsCache`,{selectedElementIds:null,elements:null,cache:new Map}),v(this,`sceneNonce`),v(this,`insertElement`,e=>{let t=e.frameId?this.getElementIndex(e.frameId):this.elements.length;this.insertElementAtIndex(e,t)}),v(this,`insertElements`,e=>{if(!e.length)return;let t=e[0]?.frameId?this.getElementIndex(e[0].frameId):this.elements.length;this.insertElementsAtIndex(e,t)}),v(this,`getContainerElement`,e=>e&&e.containerId&&this.getElement(e.containerId)||null),v(this,`getElementsFromId`,e=>{let t=this.getNonDeletedElementsMap(),n=t.get(e);return n?[n]:qy(t,e)})}static mapElementToScene(e,t){tE(e)?this.sceneMapById.set(e,t):(this.sceneMapByElement.set(e,t),this.sceneMapById.set(e.id,t))}static getScene(e){return tE(e)?this.sceneMapById.get(e)||null:this.sceneMapByElement.get(e)||null}getSceneNonce(){return this.sceneNonce}getNonDeletedElementsMap(){return this.nonDeletedElementsMap}getElementsIncludingDeleted(){return this.elements}getElementsMapIncludingDeleted(){return this.elementsMap}getNonDeletedElements(){return this.nonDeletedElements}getFramesIncludingDeleted(){return this.frames}getSelectedElements(e){let t=eE(e),n=e?.elements||this.nonDeletedElements;if(this.selectedElementsCache.elements===n&&this.selectedElementsCache.selectedElementIds===e.selectedElementIds){let e=this.selectedElementsCache.cache.get(t);if(e)return e}else e?.elements??this.selectedElementsCache.cache.clear();let r=YT(n,{selectedElementIds:e.selectedElementIds},e);return e?.elements??(this.selectedElementsCache.selectedElementIds=e.selectedElementIds,this.selectedElementsCache.elements=this.nonDeletedElements,this.selectedElementsCache.cache.set(t,r)),r}getNonDeletedFramesLikes(){return this.nonDeletedFramesLikes}getElement(e){return this.elementsMap.get(e)||null}getNonDeletedElement(e){let t=this.getElement(e);return t&&tD(t)?t:null}mapElements(e){let t=!1,n=this.elements.map(n=>{let r=e(n);return r!==n&&(t=!0),r});return t&&this.replaceAllElements(n),t}replaceAllElements(t){let n=t instanceof Array?t:Array.from(t.values()),r=[];$T(n),this.elements=Vx(n),this.elementsMap.clear(),this.elements.forEach(t=>{gd(t)&&r.push(t),this.elementsMap.set(t.id,t),e.mapElementToScene(t,this)});let i=QT(this.elements);this.nonDeletedElements=i.elements,this.nonDeletedElementsMap=i.elementsMap,this.frames=r,this.nonDeletedFramesLikes=QT(this.frames).elements,this.triggerUpdate()}triggerUpdate(){this.sceneNonce=hx();for(let e of Array.from(this.callbacks))e()}onUpdate(e){if(this.callbacks.has(e))throw Error();return this.callbacks.add(e),()=>{if(!this.callbacks.has(e))throw Error();this.callbacks.delete(e)}}destroy(){this.elements=[],this.nonDeletedElements=[],this.nonDeletedFramesLikes=[],this.frames=[],this.elementsMap.clear(),this.selectedElementsCache.selectedElementIds=null,this.selectedElementsCache.elements=null,this.selectedElementsCache.cache.clear(),e.sceneMapById.forEach((t,n)=>{t===this&&e.sceneMapById.delete(n)}),this.callbacks.clear()}insertElementAtIndex(e,t){if(!Number.isFinite(t)||t<0)throw Error(`insertElementAtIndex can only be called with index >= 0`);let n=[...this.elements.slice(0,t),e,...this.elements.slice(t)];Bx(n,Nu([e])),this.replaceAllElements(n)}insertElementsAtIndex(e,t){if(!e.length)return;if(!Number.isFinite(t)||t<0)throw Error(`insertElementAtIndex can only be called with index >= 0`);let n=[...this.elements.slice(0,t),...e,...this.elements.slice(t)];Bx(n,Nu(e)),this.replaceAllElements(n)}getElementIndex(e){return this.elements.findIndex(t=>t.id===e)}};v(nE,`sceneMapByElement`,new WeakMap),v(nE,`sceneMapById`,new Map);var rE=nE,K=(e,t,n=!0,r)=>{let i=!1,{points:a,fixedSegments:o,fileId:s,startBinding:c,endBinding:l}=t;if(z(e)&&(Object.keys(t).length===0||typeof a<`u`||typeof o<`u`||typeof c<`u`||typeof l<`u`)){let n=rd(rE.getScene(e)?.getNonDeletedElementsMap()??new Map);t={...t,angle:0,...jC({...e,x:t.x||e.x,y:t.y||e.y},n,{fixedSegments:o,points:a,startBinding:c,endBinding:l},{isDragging:r?.isDragging})}}else typeof a<`u`&&(t={...tv(a),...t});for(let n in t){let r=t[n];if(typeof r<`u`){if(e[n]===r&&(typeof r!=`object`||!r||n===`groupIds`||n===`scale`))continue;if(n===`scale`){let t=e[n],i=r;if(t[0]===i[0]&&t[1]===i[1])continue}else if(n===`points`){let t=e[n],i=r;if(t.length===i.length){let e=!1,n=t.length;for(;--n;){let r=t[n],a=i[n];if(r[0]!==a[0]||r[1]!==a[1]){e=!0;break}}if(!e)continue}}e[n]=r,i=!0}}return i&&((typeof t.height<`u`||typeof t.width<`u`||typeof s<`u`||typeof a<`u`)&&Sf.delete(e),e.version++,e.versionNonce=hx(),e.updated=Mu(),n&&rE.getScene(e)?.triggerUpdate()),e},iE=(e,t,n=!1)=>{let r=!1;for(let n in t){let i=t[n];if(typeof i<`u`){if(e[n]===i&&(typeof i!=`object`||!i))continue;r=!0}}return!r&&!n?e:{...e,...t,updated:Mu(),version:e.version+1,versionNonce:hx()}},aE=(e,t)=>(e.version=(t??e.version)+1,e.versionNonce=hx(),e.updated=Mu(),e),oE=e=>yd(e)||_d(e)?e.points.length<2:e.width===0&&e.height===0,sE=(e,t,n,r,i)=>{let[a,o,s,c]=yv(e,i),l=_u({clientX:r.offsetLeft,clientY:r.offsetTop},r),u=_u({clientX:r.offsetLeft+t,clientY:r.offsetTop+n},r);return l.x<=s&&l.y<=c&&u.x>=a&&u.y>=o},cE=(e,t,n,r,i,a)=>{let[o,s,c,l]=bv(e,i),u=_u({clientX:r.offsetLeft+(a?.left||0),clientY:r.offsetTop+(a?.top||0)},r),d=_u({clientX:r.offsetLeft+t-(a?.right||0),clientY:r.offsetTop+n-(a?.bottom||0)},r);return o>=u.x&&s>=u.y&&c<=d.x&&l<=d.y},lE=(e,t,n)=>{let r=Math.abs(t),i=Math.abs(n);if(e===`line`||e===`arrow`||e===`freedraw`){let e=Math.round(Math.atan(i/r)/Bs)*Bs;e===0?n=0:e===Math.PI/2?t=0:n=r*Math.tan(e)*Math.sign(n)||n}else e!==`selection`&&(n=r*Math.sign(n));return{width:t,height:n}},uE=(e,t,n,r)=>{let i=n-e,a=r-t,o=Math.round(Math.atan(a/i)/Bs)*Bs;if(o===0)a=0;else if(o===Math.PI/2)i=0;else{let s=Math.tan(o),c=t-s*e,l=-1/s,u=r-l*n,d=(-1*u- -1*c)/(s*-1-l*-1),f=(c*l-u*s)/(s*-1-l*-1);i=d-e,a=f-t}return{width:i,height:a}},dE=e=>{let t={width:e.width,height:e.height,x:e.x,y:e.y};if(e.width<0){let n=Math.abs(e.width);t.width=n,t.x=e.x-n}if(e.height<0){let n=Math.abs(e.height);t.height=n,t.y=e.y-n}return t},fE={mouse:8,pen:16,touch:28},pE=16,mE={e:!0,s:!0,n:!0,w:!0},hE={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},gE={e:!0,s:!0,n:!0,w:!0},_E=(e,t,n,r,i,a,o)=>{let[s,c]=F(P(e+n/2,t+r/2),P(i,a),o);return[s-n/2,c-r/2,n,r]},vE=e=>!(e.viewport.isMobile||e.isTouchScreen&&(Ms||Fs)),yE=e=>vE(e)?mE:{},bE=([e,t,n,r,i,a],o,s,c,l={},u=4,d=2)=>{let f=fE[c],p=f/s.value,m=f/s.value,h=f/s.value,g=f/s.value,_=n-e,v=r-t,y=u/s.value,b=(f-d*2)/(2*s.value),x={nw:l.nw?void 0:_E(e-y-h+b,t-y-g+b,p,m,i,a,o),ne:l.ne?void 0:_E(n+y-b,t-y-g+b,p,m,i,a,o),sw:l.sw?void 0:_E(e-y-h+b,r+y-b,p,m,i,a,o),se:l.se?void 0:_E(n+y-b,r+y-b,p,m,i,a,o),rotation:l.rotation?void 0:_E(e+_/2-p/2,t-y-g+b-pE/s.value,p,m,i,a,o)},S=5*fE.mouse/s.value;return Math.abs(_)>S&&(l.n||(x.n=_E(e+_/2-p/2,t-y-g+b,p,m,i,a,o)),l.s||(x.s=_E(e+_/2-p/2,r+y-b,p,m,i,a,o))),Math.abs(v)>S&&(l.w||(x.w=_E(e-y-h+b,t+v/2-m/2,p,m,i,a,o)),l.e||(x.e=_E(n+y-b,t+v/2-m/2,p,m,i,a,o))),x},xE=(e,t,n,r=`mouse`,i=mE)=>{if(e.locked||z(e))return{};if(e.type===`freedraw`||yd(e)){if(e.points.length===2){let[,t]=e.points;t[0]===0||t[1]===0?i=gE:t[0]>0&&t[1]<0?i=hE:t[0]>0&&t[1]>0?i=gE:t[0]<0&&t[1]>0?i=hE:t[0]<0&&t[1]<0&&(i=gE)}}else gd(e)&&(i={...i,rotation:!0});let a=yd(e)?10:ud(e)?0:2;return bE(av(e,n,!0),e.angle,t,r,i,a,ud(e)?0:void 0)},SE=(e,t)=>{if(t.editingLinearElement)return!1;if(e.length>1)return!0;let n=e[0];return z(n)?!1:!yd(n)||n.points.length>2},CE=(e,t,n)=>t>=e[0]&&t<=e[0]+e[2]&&n>=e[1]&&n<=e[1]+e[3],wE=(e,t,n,r,i,a,o,s)=>{if(!n.selectedElementIds[e.id])return!1;let{rotation:c,...l}=xE(e,a,t,o,yE(s));if(c&&CE(c,r,i))return`rotation`;let u=Object.keys(l).filter(e=>{let t=l[e];return t?CE(t,r,i):!1});if(u.length>0)return u[0];if(vE(s)){let[n,o,s,c,l,u]=av(e,t);if(!(yd(e)&&e.points.length<=2)){let t=ud(e)?0:rc/a.value,d=rc/a.value,f=AE(P(n-t,o-t),P(s+t,c+t),P(l,u),e.angle);for(let[e,t]of Object.entries(f))if(jl(P(r,i),t,d))return e}}return!1},TE=(e,t,n,r,i,a,o,s)=>e.reduce((e,c)=>{if(e)return e;let l=wE(c,o,t,n,r,i,a,s);return l?{element:c,transformHandleType:l}:null},null),EE=([e,t,n,r],i,a,o,s,c)=>{let l=bE([e,t,n,r,(e+n)/2,(t+r)/2],0,o,s,yE(c)),u=Object.keys(l).find(e=>{let t=l[e];return t&&CE(t,i,a)});if(u)return u;if(vE(c)){let s=(e+n)/2,c=(t+r)/2,l=rc/o.value,u=AE(P(e-l,t-l),P(n+l,r+l),P(s,c),0);for(let[e,t]of Object.entries(u))if(jl(P(i,a),t,l))return e}return!1},DE=[`ns`,`nesw`,`ew`,`nwse`],OE=(e,t)=>{let n=DE.indexOf(e);return n>=0&&(e=DE[(n+Math.round(t/(Math.PI/4)))%DE.length]),e},kE=e=>{let{element:t,transformHandleType:n}=e,r=t&&Math.sign(t.height)*Math.sign(t.width)===-1,i=null;switch(n){case`n`:case`s`:i=`ns`;break;case`w`:case`e`:i=`ew`;break;case`nw`:case`se`:i=r?`nesw`:`nwse`;break;case`ne`:case`sw`:i=r?`nwse`:`nesw`;break;case`rotation`:return`grab`}return i&&t&&(i=OE(i,t.angle)),i?`${i}-resize`:``},AE=([e,t],[n,r],i,a)=>{let o=F(P(e,t),i,a),s=F(P(n,t),i,a),c=F(P(e,r),i,a),l=F(P(n,r),i,a);return{n:[o,s],e:[s,l],s:[l,c],w:[c,o]}},jE=(e,t,n,r,i,a,o,s,c,l,u,d)=>{if(n.length===1){let[u]=n;if(t===`rotation`)z(u)||(ME(u,r,i,c,l,a),ny(u,r));else{if(R(u)&&t)return FE(e,u,r,t,o,c,l),ny(u,r),!0;if(t){let i=n[0].id,a=r.get(i),u=e.get(i);if(a&&u){let{nextWidth:n,nextHeight:i}=HE(a,u,r,e,t,c,l,{shouldMaintainAspectRatio:s,shouldResizeFromCenter:o});VE(n,i,a,u,r,e,t,{shouldMaintainAspectRatio:s,shouldResizeFromCenter:o})}}}return!0}if(n.length>1){if(t===`rotation`)return IE(e,n,r,i,c,l,a,u,d),!0;if(t){let{nextWidth:a,nextHeight:u,flipByX:d,flipByY:f,originalBoundingBox:p}=UE(n,e,r,t,c,l,{shouldMaintainAspectRatio:s,shouldResizeFromCenter:o});return WE(n,r,t,i,e,{shouldResizeFromCenter:o,shouldMaintainAspectRatio:s,flipByX:d,flipByY:f,nextWidth:a,nextHeight:u,originalBoundingBox:p}),!0}}return!1},ME=(e,t,n,r,i,a)=>{let[o,s,c,l]=av(e,t),u=(o+c)/2,d=(s+l)/2,f;gd(e)?f=0:(f=5*Math.PI/2+Math.atan2(i-d,r-u),a&&(f+=Bs/2,f-=f%Bs),f=ol(f));let p=Rb(e);if(K(e,{angle:f}),p){let t=n.getElement(p);t&&!bd(e)&&K(t,{angle:f})}},NE=(e,t,n,r)=>yd(e)||_d(e)?{points:nv(0,t,nv(1,n,e.points,r),r)}:{},PE=(e,t,n)=>{let r=e.width;if(Ad(e)){let n=Bb(e,t);n&&(r=Yb(n,e))}let i=e.fontSize*(n/r);return i<ec?null:{size:i}},FE=(e,t,n,r,i,a,o)=>{let[s,c,l,u,d,f]=av(t,n),[p,m]=F(P(a,o),P(d,f),-t.angle),h=0,g=0;r!==`e`&&r!==`w`&&(r.includes(`e`)&&(h=(p-s)/(l-s)),r.includes(`w`)&&(h=(l-p)/(l-s)),r.includes(`n`)&&(g=(u-m)/(u-c)),r.includes(`s`)&&(g=(m-c)/(u-c)));let _=Math.max(h,g);if(_>0){let e=t.width*_,a=t.height*_,o=PE(t,n,e);if(o===null)return;let p=[s,c],m=[l,u],h=[d,f],g=P(s,c);if([`n`,`w`,`nw`].includes(r)&&(g=P(m[0]-Math.abs(e),m[1]-Math.abs(a))),r===`ne`){let e=[p[0],m[1]];g=P(e[0],e[1]-Math.abs(a))}if(r===`sw`){let t=[m[0],p[1]];g=P(t[0]-Math.abs(e),t[1])}[`s`,`n`].includes(r)&&(g[0]=h[0]-e/2),[`e`,`w`].includes(r)&&(g[1]=h[1]-a/2),i&&(g[0]=h[0]-Math.abs(e)/2,g[1]=h[1]-Math.abs(a)/2);let v=t.angle;g=F(F(g,P(d,f),v),F(P(g[0]+Math.abs(e)/2,g[1]+Math.abs(a)/2),P(d,f),v),-v);let[y,b]=g;K(t,{fontSize:o.size,width:e,height:a,x:y,y:b})}if(r===`e`||r===`w`){let n=e.get(t.id),[i,s,c,l]=Sv(n,n.width,n.height,!0),u=P(i,s),d=P(c,l),f=wl(u,d),p=F(P(a,o),f,-n.angle),[m,,h]=Sv(t,t.width,t.height,!0),g=h-m,_=d[0]-u[0],v=zd(cu({fontSize:t.fontSize,fontFamily:t.fontFamily}),t.lineHeight),y=_/g;r.includes(`e`)&&(y=(p[0]-u[0])/g),r.includes(`w`)&&(y=(d[0]-p[0])/g);let b=t.width*y<v?v:t.width*y,x=hf(t.originalText,cu(t),Math.abs(b)),S=Id(x,cu(t),t.lineHeight),C=S.height,[w,T,E,D]=Sv(n,b,C,!0),ee=E-w,te=D-T,ne=[...u];[`n`,`w`,`nw`].includes(r)&&(ne=[d[0]-Math.abs(ee),u[1]]);let re=n.angle;ne=F(F(ne,f,re),F(P(ne[0]+Math.abs(ee)/2,ne[1]+Math.abs(te)/2),f,re),-re),K(t,{width:Math.abs(b),height:Math.abs(S.height),x:ne[0],y:ne[1],text:x,autoResize:!1})}},IE=(e,t,n,r,i,a,o,s,c)=>{let l=5*Math.PI/2+Math.atan2(a-c,i-s);o&&(l+=Bs/2,l-=l%Bs);for(let r of t)if(!gd(r)){let[i,a,o,u]=av(r,n),d=(i+o)/2,f=(a+u)/2,p=e.get(r.id)?.angle??r.angle,[m,h]=F(P(d,f),P(s,c),l+p-r.angle);z(r)?K(r,{points:jy(r,n)}):K(r,{x:r.x+(m-d),y:r.y+(h-f),angle:ol(l+p)},!1),ny(r,n,{simultaneouslyUpdated:t});let g=zb(r,n);g&&!bd(r)&&K(g,{x:g.x+(m-d),y:g.y+(h-f),angle:ol(l+p)},!1)}r.triggerUpdate()},LE=(e,t,n,r,i)=>{let[a,o,s,c]=t.length===1?av(t[0],n):bv(t),l=(a+s)/2,u=(o+c)/2,d=t.length===1?t[0].angle:0;switch([r,i]=F(P(r,i),P(l,u),-d),e){case`n`:return F(P(r-(a+s)/2,i-o),P(0,0),d);case`s`:return F(P(r-(a+s)/2,i-c),P(0,0),d);case`w`:return F(P(r-a,i-(o+c)/2),P(0,0),d);case`e`:return F(P(r-s,i-(o+c)/2),P(0,0),d);case`nw`:return F(P(r-a,i-o),P(0,0),d);case`ne`:return F(P(r-s,i-o),P(0,0),d);case`sw`:return F(P(r-a,i-c),P(0,0),d);case`se`:return F(P(r-s,i-c),P(0,0),d);default:return[0,0]}},RE=(e,t)=>{let[,[n,r]]=t.points;return e===`nw`&&(n<0||r<0)||e===`ne`&&n>=0||e===`sw`&&n<=0||e===`se`&&(n>0||r>0)?`end`:`origin`},zE=(e,t,n)=>{if(n)return`center`;if(t)switch(e){case`n`:return`south-side`;case`e`:return`west-side`;case`s`:return`north-side`;case`w`:return`east-side`;case`ne`:return`bottom-left`;case`nw`:return`bottom-right`;case`se`:return`top-left`;case`sw`:return`top-right`}return[`e`,`se`,`s`].includes(e)?`top-left`:[`n`,`nw`,`w`].includes(e)?`bottom-right`:e===`ne`?`bottom-left`:`top-right`},BE=(e,t,n,r,i,a,o,s,c)=>{let l=zE(o,s,c),[u,d]=e;switch(l){case`top-left`:return{x:u+(t-r)/2+(r-t)/2*Math.cos(a)+(n-i)/2*Math.sin(a),y:d+(n-i)/2+(r-t)/2*Math.sin(a)+(i-n)/2*Math.cos(a)};case`top-right`:return{x:u+(t-r)/2*(Math.cos(a)+1)+(n-i)/2*Math.sin(a),y:d+(n-i)/2+(t-r)/2*Math.sin(a)+(i-n)/2*Math.cos(a)};case`bottom-left`:return{x:u+(t-r)/2*(1-Math.cos(a))+(i-n)/2*Math.sin(a),y:d+(n-i)/2*(Math.cos(a)+1)+(r-t)/2*Math.sin(a)};case`bottom-right`:return{x:u+(t-r)/2*(Math.cos(a)+1)+(i-n)/2*Math.sin(a),y:d+(n-i)/2*(Math.cos(a)+1)+(t-r)/2*Math.sin(a)};case`center`:return{x:u-(r-t)/2,y:d-(i-n)/2};case`east-side`:return{x:u+(t-r)/2*(Math.cos(a)+1),y:d+(t-r)/2*Math.sin(a)+(n-i)/2};case`west-side`:return{x:u+(t-r)/2*(1-Math.cos(a)),y:d+(r-t)/2*Math.sin(a)+(n-i)/2};case`north-side`:return{x:u+(t-r)/2+(n-i)/2*Math.sin(a),y:d+(i-n)/2*(Math.cos(a)-1)};case`south-side`:return{x:u+(t-r)/2+(i-n)/2*Math.sin(a),y:d+(n-i)/2*(Math.cos(a)+1)}}},VE=(e,t,n,r,i,a,o,{shouldInformMutation:s=!0,shouldMaintainAspectRatio:c=!1,shouldResizeFromCenter:l=!1}={})=>{let u={},d=zb(n,i);if(d){let r=a.get(d.id);if(r&&(u={fontSize:r.fontSize}),c){let r=PE(d,i,Yb({...n,width:e,height:t},d));if(r===null)return;u={fontSize:r.size}}else{let n=Rd(cu(d),d.lineHeight),r=Gd(d.fontSize,d.lineHeight);e=Math.max(e,n),t=Math.max(t,r)}}let f=NE(r,e,t,!0),p=P(r.x,r.y);if(yd(r)){let[e,t]=yv(r,a);p=P(e,t)}let m=BE(p,r.width,r.height,e,t,r.angle,o,c,l);if(yd(r)&&f.points){let e=r.x-p[0],t=r.y-p[1];m.x+=e,m.y+=t;let n=f.points[0][0],i=f.points[0][1];m.x+=n,m.y+=i,f.points=f.points.map(e=>P(e[0]-n,e[1]-i))}if(e<0&&(m.x+=e),t<0&&(m.y+=t),`scale`in n&&`scale`in r&&K(n,{scale:[(Math.sign(e)||r.scale[0])*r.scale[0],(Math.sign(t)||r.scale[1])*r.scale[1]]}),bd(n)&&d&&c){let t=e/n.width*d.fontSize;if(t<ec)return;u.fontSize=t}e!==0&&t!==0&&Number.isFinite(m.x)&&Number.isFinite(m.y)&&(K(n,{...m,width:Math.abs(e),height:Math.abs(t),...f},s),ny(n,i,{newSize:{width:e,height:t}}),d&&u!=null&&K(d,{fontSize:u.fontSize}),Ib(n,i,o,c))},HE=(e,t,n,r,i,a,o,{shouldMaintainAspectRatio:s=!1,shouldResizeFromCenter:c=!1}={})=>{let[l,u,d,f]=Sv(t,t.width,t.height,!0),p=P(l,u),m=P(d,f),h=wl(p,m),g=F(P(a,o),h,-t.angle),[_,v,y,b]=Sv(e,e.width,e.height,!0),x=y-_,S=b-v,C=m[0]-p[0],w=m[1]-p[1],T=C/x,E=w/S;i.includes(`e`)&&(T=(g[0]-p[0])/x),i.includes(`s`)&&(E=(g[1]-p[1])/S),i.includes(`w`)&&(T=(m[0]-g[0])/x),i.includes(`n`)&&(E=(m[1]-g[1])/S);let D=e.width*T,ee=e.height*E;if(c&&(D=2*D-t.width,ee=2*ee-t.height),s){let e=Math.abs(D)/t.width,n=Math.abs(ee)/t.height;if(i.length===1&&(ee*=e,D*=n),i.length===2){let r=Math.max(e,n);D=t.width*r*Math.sign(D),ee=t.height*r*Math.sign(ee)}}return{nextWidth:D,nextHeight:ee}},UE=(e,t,n,r,i,a,{shouldMaintainAspectRatio:o=!1,shouldResizeFromCenter:s=!1}={})=>{let c=e.map(e=>t.get(e.id)),l=c.reduce((e,r)=>{if(!yd(r))return e;let i=Rb(r);if(!i)return e;let a=t.get(i)??null;return Ad(a)?[...e,{...a,...U.getBoundTextElementPosition(r,a,n)}]:e},[]),u=Tv(c.map(e=>e).concat(l)),{minX:d,minY:f,maxX:p,maxY:m,midX:h,midY:g}=u,_=p-d,v=m-f,y={ne:[d,m],se:[d,f],sw:[p,f],nw:[p,m],e:[d,f+v/2],w:[p,f+v/2],n:[d+_/2,m],s:[d+_/2,f]},[b,x]=s?[h,g]:y[r],S=s?2:1,C=Math.max(Math.abs(i-b)/_||0,Math.abs(a-x)/v||0)*S,w=r.includes(`e`)||r.includes(`w`)?Math.abs(i-b)*S:_,T=r.includes(`n`)||r.includes(`s`)?Math.abs(a-x)*S:v;o&&(w=_*C*Math.sign(i-b),T=v*C*Math.sign(a-x));let[E,D]={ne:[i<b,a>x],se:[i<b,a<x],sw:[i>b,a<x],nw:[i>b,a>x],e:[i<b,!1],w:[i>b,!1],n:[!1,a>x],s:[!1,a<x]}[r].map(e=>e);return{originalBoundingBox:u,nextWidth:w,nextHeight:T,flipByX:E,flipByY:D}},WE=(e,t,n,r,i,{shouldMaintainAspectRatio:a=!1,shouldResizeFromCenter:o=!1,flipByX:s=!1,flipByY:c=!1,nextHeight:l,nextWidth:u,originalBoundingBox:d}={})=>{if(u===void 0&&l===void 0&&s===void 0&&c===void 0||l===0||u===0)return;i||=t;let f=e.reduce((e,t)=>{let n=i.get(t.id);return n&&e.push({orig:n,latest:t}),e},[]),p;if(d)p=d;else{let e=f.reduce((e,{orig:n})=>{if(!yd(n))return e;let r=Rb(n);if(!r)return e;let a=i.get(r)??null;return Ad(a)?[...e,{...a,...U.getBoundTextElementPosition(n,a,t)}]:e},[]);p=Tv(f.map(({orig:e})=>e).concat(e))}let{minX:m,minY:h,maxX:g,maxY:_,midX:v,midY:y}=p,b=g-m,x=_-h;if(u===void 0&&l===void 0&&(u=b,l=x),a&&(u===void 0?u=b/x*l:l===void 0?l=x/b*u:Math.abs(u/l-b/x)>.001&&(u=b/x*l)),u&&l){let e=n.includes(`e`)||n.includes(`w`)?Math.abs(u)/b:1,d=n.includes(`n`)||n.includes(`s`)?Math.abs(l)/x:1,p;p=n.length===1?n.includes(`e`)||n.includes(`w`)?e:d:Math.max(Math.abs(u)/b||0,Math.abs(l)/x||0);let S={ne:[m,_],se:[m,h],sw:[g,h],nw:[g,_],e:[m,h+x/2],w:[g,h+x/2],n:[m+b/2,_],s:[m+b/2,h]},[C,w]=o?[v,y]:S[n],T=a||f.some(e=>e.latest.angle!==0||R(e.latest)||tb(e.latest));T&&(e=p,d=p);let[E,D]=[s?-1:1,c?-1:1],ee=[];for(let{orig:n,latest:r}of f){if(R(n)&&Ad(n))continue;let a=n.width*e,o=n.height*d,l=ol(n.angle*E*D),u=yd(n)||_d(n),f=n.x-C,m=n.y-w,h=s&&!u?a:0,g=c&&!u?o:0,_=C+E*(f*e+h),v=w+D*(m*d+g),y=NE(n,a*E,o*D,!1),b={x:_,y:v,width:a,height:o,angle:l,...y};if(z(n)&&(n.startBinding&&(b.startBinding={...n.startBinding,fixedPoint:[s?-n.startBinding.fixedPoint[0]+1:n.startBinding.fixedPoint[0],c?-n.startBinding.fixedPoint[1]+1:n.startBinding.fixedPoint[1]]}),n.endBinding&&(b.endBinding={...n.endBinding,fixedPoint:[s?-n.endBinding.fixedPoint[0]+1:n.endBinding.fixedPoint[0],c?-n.endBinding.fixedPoint[1]+1:n.endBinding.fixedPoint[1]]}),n.fixedSegments&&y.points&&(b.fixedSegments=n.fixedSegments.map(e=>({...e,start:y.points[e.index-1],end:y.points[e.index]})))),ud(n)&&(b.scale=[n.scale[0]*E,n.scale[1]*D]),R(n)){let e=PE(n,t,a);if(!e)return;b.fontSize=e.size}let x=i.get(Rb(n)??``);if(x){if(T){let e=x.fontSize*p;if(e<ec)return;b.boundTextFontSize=e}else b.boundTextFontSize=x.fontSize}ee.push({element:r,update:b})}let te=ee.map(({element:e})=>e);for(let{element:e,update:{boundTextFontSize:r,...i}}of ee){let{width:a,height:o,angle:s}=i;K(e,i,!1,{isDragging:!0}),ny(e,t,{simultaneouslyUpdated:te,newSize:{width:a,height:o}});let c=zb(e,t);c&&r&&(K(c,{fontSize:r,angle:yd(e)?void 0:s},!1),Ib(e,t,n,!0))}r.triggerUpdate()}},GE=(e,t,n,r,i,a)=>{if(t.length===1&&z(t[0])&&(t[0].startBinding||t[0].endBinding))return;let o=t.filter(e=>{if(z(e)&&e.startBinding&&e.endBinding){let n=t.find(t=>t.id===e.startBinding?.elementId),r=t.find(t=>t.id===e.endBinding?.elementId);return n&&r}return!0}),s=new Set(o),c=o.filter(e=>gd(e)).map(e=>e.id);if(c.length>0)for(let e of r.getNonDeletedElements())e.frameId!==null&&c.includes(e.frameId)&&s.add(e);let l=KE(bv(Array.from(s).map(t=>e.originalElements.get(t.id)??t)),n,i,a);s.forEach(t=>{if(qE(e,t,l),!bd(t)){let n=zb(t,r.getNonDeletedElementsMap());n&&qE(e,n,l),ny(t,r.getElementsMapIncludingDeleted(),{simultaneouslyUpdated:Array.from(s)})}})},KE=(e,t,n,r)=>{let[i,a]=e,o=i+t.x+n.x,s=a+t.y+n.y;if(n.x===0||n.y===0){let[e,c]=Eb(i+t.x,a+t.y,r);n.x===0&&(o=e),n.y===0&&(s=c)}return{x:o-i,y:s-a}},qE=(e,t,n)=>{let r=e.originalElements.get(t.id)??t;K(t,{x:r.x+n.x,y:r.y+n.y})},JE=(e,t,n)=>{let[r,i]=bv(e);return[t-r,n-i]},YE=({newElement:e,elementType:t,originX:n,originY:r,x:i,y:a,width:o,height:s,shouldMaintainAspectRatio:c,shouldResizeFromCenter:l,zoom:u,widthAspectRatio:d=null,originOffset:f=null,informMutation:p=!0})=>{c&&e.type!==`selection`&&(d?s=o/d:(Math.abs(a-r)>Math.abs(i-n)?{width:o,height:s}=lE(t,s,i<n?-o:o):{width:o,height:s}=lE(t,o,a<r?-s:s),s<0&&(s=-s)));let m=i<n?n-o:n,h=a<r?r-s:r;l&&(o+=o,s+=s,m=n-o/2,h=r-s/2);let g=null;if(R(e)){s=e.height;let t=zd(cu({fontSize:e.fontSize,fontFamily:e.fontFamily}),e.lineHeight);o=Math.max(o,t),Math.abs(i-n)>zs/u&&(g={autoResize:!1}),h=r,l&&(m=n-o/2)}if(o!==0&&s!==0){let t=null;ud(e)&&(t={initialWidth:o,initialHeight:s}),K(e,{x:m+(f?.x??0),y:h+(f?.y??0),width:o,height:s,...g,...t},p)}},XE=(e,t)=>!!(!e.viewModeEnabled&&e.openDialog?.name!==`elementLinkSelector`&&(e.activeTool.type!==`custom`&&(e.editingTextElement||e.activeTool.type!==`selection`&&e.activeTool.type!==`eraser`&&e.activeTool.type!==`hand`&&e.activeTool.type!==`laser`)||YT(t,e).length)),ZE=e=>e.reduce((e,t)=>e+t.version,0),QE=e=>{let t=5381;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)+t+r}return t>>>0},$E=e=>e.filter(e=>!e.isDeleted&&!oE(e)),eD=e=>e.filter(e=>!e.isDeleted),tD=e=>!e.isDeleted,nD=e=>eD(e).map(e=>xd(e.type)?{...e,lastCommittedPoint:null}:e),rD=e=>nD(e),iD=e=>nD(e),aD=async e=>{let t;if(e.type===j.png)try{return await(await A(async()=>{let{decodePngMetadata:e}=await import(`./image-GAAHSSAO-D1P4Y62B.js`);return{decodePngMetadata:e}},[],import.meta.url)).decodePngMetadata(e)}catch(e){throw e.message===`INVALID`?new bh(`Image doesn't contain scene`,`IMAGE_NOT_CONTAINS_SCENE_DATA`):new bh(`Error: cannot restore image`)}if(t=`text`in Blob?await e.text():await new Promise(t=>{let n=new FileReader;n.readAsText(e,`utf8`),n.onloadend=()=>{n.readyState===FileReader.DONE&&t(n.result)}}),e.type===j.svg)try{return bC({svg:t})}catch(e){throw e.message===`INVALID`?new bh(`Image doesn't contain scene`,`IMAGE_NOT_CONTAINS_SCENE_DATA`):new bh(`Error: cannot restore image`)}return t},oD=e=>e&&e.name.match(/\.(json|excalidraw|png|svg)$/)?.[1]||null,sD=e=>e===`png`||e===`svg`,cD=e=>{let t=oD(e);return t===`png`||t===`svg`},lD=e=>!!e&&Object.values(cc).includes(e),uD=e=>{let{type:t}=e||{};return lD(t)},dD=async(e,t,n,r)=>{let i=await aD(e),a;try{try{a=JSON.parse(i)}catch(t){throw uD(e)?new bh(`Image doesn't contain scene`,`IMAGE_NOT_CONTAINS_SCENE_DATA`):t}if(IS(a))return{type:j.excalidraw,data:mw({elements:iD(a.elements||[]),appState:{theme:t?.theme,fileHandle:r||e.handle||null,...Xc(a.appState||{}),...t?Fy(a.elements||[],t):{}},files:a.files},t,n,{repairBindings:!0,refreshDimensions:!1})};if(LS(a))return{type:j.excalidrawlib,data:a};throw Error(`Error: invalid file`)}catch(e){throw e instanceof bh?e:Error(`Error: invalid file`)}},fD=async(e,t,n,r)=>{let i=await dD(e,t,n,r);if(i.type!==j.excalidraw)throw Error(`Error: invalid file`);return i.data},pD=(e,t=`unpublished`)=>{let n=JSON.parse(e);if(!LS(n))throw Error(`Invalid library`);return gw(n.libraryItems||n.library,t)},mD=async(e,t=`unpublished`)=>pD(await aD(e),t),hD=async e=>new Promise(async(t,n)=>{try{Uu(e)&&(e=await e),e.toBlob(e=>{if(!e)return n(new vh(`Error: Canvas too big`,`CANVAS_POSSIBLY_TOO_BIG`));t(e)})}catch(e){n(e)}}),gD=async e=>{try{let t=await window.crypto.subtle.digest(`SHA-1`,await kD(e));return ju(new Uint8Array(t))}catch(e){return console.error(e),Wi(40)}},_D=async e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let e=r.result;t(e)},r.onerror=e=>n(e),r.readAsDataURL(e)}),vD=(e,t)=>`data:${t};base64,${ND(AD(e),!0)}`,yD=(e,t=``)=>{let n=e.indexOf(`,`),r=atob(e.slice(n+1)),i=e.slice(0,n).split(`:`)[1].split(`;`)[0],a=new ArrayBuffer(r.length),o=new Uint8Array(a);for(let e=0;e<r.length;e++)o[e]=r.charCodeAt(e);return new File([a],t,{type:i})},bD=e=>PD(e.slice(e.indexOf(`,`)+1)),xD=async(t,n)=>{if(t.type===j.svg)return t;let[r,i]=await Promise.all([A(()=>import(`./pica-xkWDouSg.js`).then(t=>e(t.default,1)).then(e=>e.default),__vite__mapDeps([3,4]),import.meta.url),A(()=>import(`./image-blob-reduce.esm-Dj7YBvMv.js`).then(e=>e.default),[],import.meta.url)]),a=i({pica:r({features:[`js`,`wasm`]})});if(n.outputType){let{outputType:e}=n;a._create_blob=function(t){return this.pica.toBlob(t.out_canvas,e,.8).then(e=>(t.out_blob=e,t))}}if(!uD(t))throw Error(`Error: unsupported file type`,{cause:`UNSUPPORTED`});return new File([await a.toBlob(t,{max:n.maxWidthOrHeight,alpha:!0})],t.name,{type:n.outputType||t.type})},SD=(e,t=``)=>new File([new TextEncoder().encode(e)],t,{type:j.svg}),CD=async(e,t=``)=>{let n;try{n=await fetch(e)}catch{throw Error(`Error: failed to fetch image`,{cause:`FETCH_ERROR`})}if(!n.ok)throw Error(`Error: failed to fetch image`,{cause:`FETCH_ERROR`});let r=await n.blob();if(r.type&&uD(r)){let e=t||r.name||``;return new File([r],e,{type:r.type})}throw Error(`Error: unsupported file type`,{cause:`UNSUPPORTED`})},wD=async e=>{let t=e.dataTransfer.files.item(0),n=await TD(e);return{file:t?await OD(t):null,fileHandle:n}},TD=async e=>{if(fs)try{return await e.dataTransfer.items[0].getAsFileSystemHandle()||null}catch(e){return console.warn(e.name,e.message),null}return null},ED=e=>{let t=null,n=`${[...new Uint8Array(e).slice(0,8)].join(` `)} `,r={png:`137 80 78 71 13 10 26 10 `,jpg:`255 216 255 `,gif:`71 73 70 56 57 97 `};return n===r.png?t=j.png:n.startsWith(r.jpg)?t=j.jpg:n.startsWith(r.gif)&&(t=j.gif),t},DD=(e,t,n)=>new File([e],n||``,{type:t}),OD=async e=>{if(e.type){if(uD(e)){let t=await kD(e),n=ED(t);n&&n!==e.type&&(e=DD(t,n,e.name))}}else if(e?.name?.endsWith(`.excalidrawlib`))e=DD(await kD(e),j.excalidrawlib,e.name);else if(e?.name?.endsWith(`.excalidraw`))e=DD(await kD(e),j.excalidraw,e.name);else{let t=await kD(e),n=ED(t);n&&(e=DD(t,n,e.name))}return e},kD=e=>`arrayBuffer`in e?e.arrayBuffer():new Promise((t,n)=>{let r=new FileReader;r.onload=e=>{if(!e.target?.result)return n(Error(`Couldn't convert blob to ArrayBuffer`));t(e.target.result)},r.readAsArrayBuffer(e)}),AD=e=>{let t=typeof e==`string`?new TextEncoder().encode(e):e instanceof Uint8Array?e:new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return n},jD=e=>{let t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let t=0,r=e.length;t<r;t++)n[t]=e.charCodeAt(t);return t},MD=e=>new TextDecoder(`utf-8`).decode(jD(e)),ND=(e,t=!1)=>t?window.btoa(e):window.btoa(AD(e)),PD=(e,t=!1)=>t?window.atob(e):MD(window.atob(e)),FD=({text:e,compress:t})=>{let n;if(t!==!1)try{n=AD(Vi(e))}catch(e){console.error(`encode: cannot deflate`,e)}return{version:`1`,encoding:`bstring`,compressed:!!n,encoded:n||AD(e)}},ID=e=>{let t;switch(e.encoding){case`bstring`:t=e.compressed?e.encoded:MD(e.encoded);break;default:throw Error(`decode: unknown encoding "${e.encoding}"`)}return e.compressed?Hi(new Uint8Array(jD(t)),{to:`string`}):t},LD=async e=>{let t=(0,E.default)(new Uint8Array(await kD(e))).find(e=>e.name===`tEXt`);return t?D.decode(t.data):null},RD=async({blob:e,metadata:t})=>{let n=(0,E.default)(new Uint8Array(await kD(e))),r=D.encode(j.excalidraw,JSON.stringify(FD({text:t,compress:!0})));return n.splice(-1,0,r),new Blob([(0,ee.default)(n)],{type:j.png})},zD=async e=>{let t=await LD(e);if(t?.keyword===j.excalidraw)try{let e=JSON.parse(t.text);if(!(`encoded`in e)){if(`type`in e&&e.type===dc.excalidraw)return t.text;throw Error(`FAILED`)}return ID(e)}catch(e){throw console.error(e),Error(`FAILED`)}throw Error(`INVALID`)},BD={paste:`Paste`,pasteAsPlaintext:`Paste as plaintext`,pasteCharts:`Paste charts`,selectAll:`Select all`,multiSelect:`Add element to selection`,moveCanvas:`Move canvas`,cut:`Cut`,copy:`Copy`,copyAsPng:`Copy to clipboard as PNG`,copyAsSvg:`Copy to clipboard as SVG`,copyText:`Copy to clipboard as text`,copySource:`Copy source to clipboard`,convertToCode:`Convert to code`,bringForward:`Bring forward`,sendToBack:`Send to back`,bringToFront:`Bring to front`,sendBackward:`Send backward`,delete:`Delete`,copyStyles:`Copy styles`,pasteStyles:`Paste styles`,stroke:`Stroke`,changeStroke:`Change stroke color`,background:`Background`,changeBackground:`Change background color`,fill:`Fill`,strokeWidth:`Stroke width`,strokeStyle:`Stroke style`,strokeStyle_solid:`Solid`,strokeStyle_dashed:`Dashed`,strokeStyle_dotted:`Dotted`,sloppiness:`Sloppiness`,opacity:`Opacity`,textAlign:`Text align`,edges:`Edges`,sharp:`Sharp`,round:`Round`,arrowheads:`Arrowheads`,arrowhead_none:`None`,arrowhead_arrow:`Arrow`,arrowhead_bar:`Bar`,arrowhead_circle:`Circle`,arrowhead_circle_outline:`Circle (outline)`,arrowhead_triangle:`Triangle`,arrowhead_triangle_outline:`Triangle (outline)`,arrowhead_diamond:`Diamond`,arrowhead_diamond_outline:`Diamond (outline)`,arrowhead_crowfoot_many:`Crow's foot (many)`,arrowhead_crowfoot_one:`Crow's foot (one)`,arrowhead_crowfoot_one_or_many:`Crow's foot (one or many)`,more_options:`More options`,arrowtypes:`Arrow type`,arrowtype_sharp:`Sharp arrow`,arrowtype_round:`Curved arrow`,arrowtype_elbowed:`Elbow arrow`,fontSize:`Font size`,fontFamily:`Font family`,addWatermark:`Add "Made with Excalidraw"`,handDrawn:`Hand-drawn`,normal:`Normal`,code:`Code`,small:`Small`,medium:`Medium`,large:`Large`,veryLarge:`Very large`,solid:`Solid`,hachure:`Hachure`,zigzag:`Zigzag`,crossHatch:`Cross-hatch`,thin:`Thin`,bold:`Bold`,left:`Left`,center:`Center`,right:`Right`,extraBold:`Extra bold`,architect:`Architect`,artist:`Artist`,cartoonist:`Cartoonist`,fileTitle:`File name`,colorPicker:`Color picker`,canvasColors:`Used on canvas`,canvasBackground:`Canvas background`,drawingCanvas:`Drawing canvas`,clearCanvas:`Clear canvas`,layers:`Layers`,actions:`Actions`,language:`Language`,liveCollaboration:`Live collaboration...`,duplicateSelection:`Duplicate`,untitled:`Untitled`,name:`Name`,yourName:`Your name`,madeWithExcalidraw:`Made with Excalidraw`,group:`Group selection`,ungroup:`Ungroup selection`,collaborators:`Collaborators`,toggleGrid:`Toggle grid`,addToLibrary:`Add to library`,removeFromLibrary:`Remove from library`,libraryLoadingMessage:`Loading library…`,libraries:`Browse libraries`,loadingScene:`Loading scene…`,loadScene:`Load scene from file`,align:`Align`,alignTop:`Align top`,alignBottom:`Align bottom`,alignLeft:`Align left`,alignRight:`Align right`,centerVertically:`Center vertically`,centerHorizontally:`Center horizontally`,distributeHorizontally:`Distribute horizontally`,distributeVertically:`Distribute vertically`,flipHorizontal:`Flip horizontal`,flipVertical:`Flip vertical`,viewMode:`View mode`,share:`Share`,showStroke:`Show stroke color picker`,showBackground:`Show background color picker`,showFonts:`Show font picker`,toggleTheme:`Toggle light/dark theme`,theme:`Theme`,personalLib:`Personal Library`,excalidrawLib:`Excalidraw Library`,decreaseFontSize:`Decrease font size`,increaseFontSize:`Increase font size`,unbindText:`Unbind text`,bindText:`Bind text to the container`,createContainerFromText:`Wrap text in a container`,link:{edit:`Edit link`,editEmbed:`Edit embeddable link`,create:`Add link`,label:`Link`,labelEmbed:`Link & embed`,empty:`No link is set`,hint:`Type or paste your link here`,goToElement:`Go to target element`},lineEditor:{edit:`Edit line`,editArrow:`Edit arrow`},elementLock:{lock:`Lock`,unlock:`Unlock`,lockAll:`Lock all`,unlockAll:`Unlock all`},statusPublished:`Published`,sidebarLock:`Keep sidebar open`,selectAllElementsInFrame:`Select all elements in frame`,removeAllElementsFromFrame:`Remove all elements from frame`,eyeDropper:`Pick color from canvas`,textToDiagram:`Text to diagram`,prompt:`Prompt`,followUs:`Follow us`,discordChat:`Discord chat`,zoomToFitViewport:`Zoom to fit in viewport`,zoomToFitSelection:`Zoom to fit selection`,zoomToFit:`Zoom to fit all elements`,installPWA:`Install Excalidraw locally (PWA)`,autoResize:`Enable text auto-resizing`,imageCropping:`Image cropping`,unCroppedDimension:`Uncropped dimension`,copyElementLink:`Copy link to object`,linkToElement:`Link to object`,wrapSelectionInFrame:`Wrap selection in frame`},VD={title:`Link to object`,desc:`Click on a shape on canvas or paste a link.`,notFound:`Linked object wasn't found on canvas.`},HD={noItems:`No items added yet...`,hint_emptyLibrary:`Select an item on canvas to add it here, or install a library from the public repository, below.`,hint_emptyPrivateLibrary:`Select an item on canvas to add it here.`},UD={title:`Find on canvas`,noMatch:`No matches found...`,singleResult:`result`,multipleResults:`results`,placeholder:`Find text on canvas...`},WD={clearReset:`Reset the canvas`,exportJSON:`Export to file`,exportImage:`Export image...`,export:`Save to...`,copyToClipboard:`Copy to clipboard`,copyLink:`Copy link`,save:`Save to current file`,saveAs:`Save as`,load:`Open`,getShareableLink:`Get shareable link`,close:`Close`,selectLanguage:`Select language`,scrollBackToContent:`Scroll back to content`,zoomIn:`Zoom in`,zoomOut:`Zoom out`,resetZoom:`Reset zoom`,menu:`Menu`,done:`Done`,edit:`Edit`,undo:`Undo`,redo:`Redo`,resetLibrary:`Reset library`,createNewRoom:`Create new room`,fullScreen:`Full screen`,darkMode:`Dark mode`,lightMode:`Light mode`,systemMode:`System mode`,zenMode:`Zen mode`,objectsSnapMode:`Snap to objects`,exitZenMode:`Exit zen mode`,cancel:`Cancel`,clear:`Clear`,remove:`Remove`,embed:`Toggle embedding`,publishLibrary:`Publish`,submit:`Submit`,confirm:`Confirm`,embeddableInteractionButton:`Click to interact`},GD={clearReset:`This will clear the whole canvas. Are you sure?`,couldNotCreateShareableLink:`Couldn't create shareable link.`,couldNotCreateShareableLinkTooBig:`Couldn't create shareable link: the scene is too big`,couldNotLoadInvalidFile:`Couldn't load invalid file`,importBackendFailed:`Importing from backend failed.`,cannotExportEmptyCanvas:`Cannot export empty canvas.`,couldNotCopyToClipboard:`Couldn't copy to clipboard.`,decryptFailed:`Couldn't decrypt data.`,uploadedSecurly:`The upload has been secured with end-to-end encryption, which means that Excalidraw server and third parties can't read the content.`,loadSceneOverridePrompt:`Loading external drawing will replace your existing content. Do you wish to continue?`,collabStopOverridePrompt:`Stopping the session will overwrite your previous, locally stored drawing. Are you sure?
|
|
49
|
+
|
|
50
|
+
(If you want to keep your local drawing, simply close the browser tab instead.)`,errorAddingToLibrary:`Couldn't add item to the library`,errorRemovingFromLibrary:`Couldn't remove item from the library`,confirmAddLibrary:`This will add {{numShapes}} shape(s) to your library. Are you sure?`,imageDoesNotContainScene:`This image does not seem to contain any scene data. Have you enabled scene embedding during export?`,cannotRestoreFromImage:`Scene couldn't be restored from this image file`,invalidSceneUrl:`Couldn't import scene from the supplied URL. It's either malformed, or doesn't contain valid Excalidraw JSON data.`,resetLibrary:`This will clear your library. Are you sure?`,removeItemsFromsLibrary:`Delete {{count}} item(s) from library?`,invalidEncryptionKey:`Encryption key must be of 22 characters. Live collaboration is disabled.`,collabOfflineWarning:`No internet connection available.
|
|
51
|
+
Your changes will not be saved!`},KD={unsupportedFileType:`Unsupported file type.`,imageInsertError:`Couldn't insert image. Try again later...`,fileTooBig:`File is too big. Maximum allowed size is {{maxSize}}.`,svgImageInsertError:`Couldn't insert SVG image. The SVG markup looks invalid.`,failedToFetchImage:`Failed to fetch image.`,cannotResolveCollabServer:`Couldn't connect to the collab server. Please reload the page and try again.`,importLibraryError:`Couldn't load library`,saveLibraryError:`Couldn't save library to storage. Please save your library to a file locally to make sure you don't lose changes.`,collabSaveFailed:`Couldn't save to the backend database. If problems persist, you should save your file locally to ensure you don't lose your work.`,collabSaveFailed_sizeExceeded:`Couldn't save to the backend database, the canvas seems to be too big. You should save the file locally to ensure you don't lose your work.`,imageToolNotSupported:`Images are disabled.`,brave_measure_text_error:{line1:`Looks like you are using Brave browser with the <bold>Aggressively Block Fingerprinting</bold> setting enabled.`,line2:`This could result in breaking the <bold>Text Elements</bold> in your drawings.`,line3:`We strongly recommend disabling this setting. You can follow <link>these steps</link> on how to do so.`,line4:`If disabling this setting doesn't fix the display of text elements, please open an <issueLink>issue</issueLink> on our GitHub, or write us on <discordLink>Discord</discordLink>`},libraryElementTypeError:{embeddable:`Embeddable elements cannot be added to the library.`,iframe:`IFrame elements cannot be added to the library.`,image:`Support for adding images to the library coming soon!`},asyncPasteFailedOnRead:`Couldn't paste (couldn't read from system clipboard).`,asyncPasteFailedOnParse:`Couldn't paste.`,copyToSystemClipboardFailed:`Couldn't copy to clipboard.`},qD={selection:`Selection`,image:`Insert image`,rectangle:`Rectangle`,diamond:`Diamond`,ellipse:`Ellipse`,arrow:`Arrow`,line:`Line`,freedraw:`Draw`,text:`Text`,library:`Library`,lock:`Keep selected tool active after drawing`,penMode:`Pen mode - prevent touch`,link:`Add / Update link for a selected shape`,eraser:`Eraser`,frame:`Frame tool`,magicframe:`Wireframe to code`,embeddable:`Web Embed`,laser:`Laser pointer`,hand:`Hand (panning tool)`,extraTools:`More tools`,mermaidToExcalidraw:`Mermaid to Excalidraw`},JD={rectangle:`Rectangle`,diamond:`Diamond`,ellipse:`Ellipse`,arrow:`Arrow`,line:`Line`,freedraw:`Freedraw`,text:`Text`,image:`Image`,group:`Group`,frame:`Frame`,magicframe:`Wireframe to code`,embeddable:`Web Embed`,selection:`Selection`,iframe:`IFrame`},YD={canvasActions:`Canvas actions`,selectedShapeActions:`Selected shape actions`,shapes:`Shapes`},XD={dismissSearch:`Escape to dismiss search`,canvasPanning:`To move canvas, hold mouse wheel or spacebar while dragging, or use the hand tool`,linearElement:`Click to start multiple points, drag for single line`,arrowTool:`Click to start multiple points, drag for single line. Press {{arrowShortcut}} again to change arrow type.`,freeDraw:`Click and drag, release when you're finished`,text:`Tip: you can also add text by double-clicking anywhere with the selection tool`,embeddable:`Click-drag to create a website embed`,text_selected:`Double-click or press ENTER to edit text`,text_editing:`Press Escape or CtrlOrCmd+ENTER to finish editing`,linearElementMulti:`Click on last point or press Escape or Enter to finish`,lockAngle:`You can constrain angle by holding SHIFT`,resize:`You can constrain proportions by holding SHIFT while resizing,
|
|
52
|
+
hold ALT to resize from the center`,resizeImage:`You can resize freely by holding SHIFT,
|
|
53
|
+
hold ALT to resize from the center`,rotate:`You can constrain angles by holding SHIFT while rotating`,lineEditor_info:`Hold CtrlOrCmd and Double-click or press CtrlOrCmd + Enter to edit points`,lineEditor_pointSelected:`Press Delete to remove point(s),
|
|
54
|
+
CtrlOrCmd+D to duplicate, or drag to move`,lineEditor_nothingSelected:`Select a point to edit (hold SHIFT to select multiple),
|
|
55
|
+
or hold Alt and click to add new points`,placeImage:`Click to place the image, or click and drag to set its size manually`,publishLibrary:`Publish your own library`,bindTextToElement:`Press enter to add text`,createFlowchart:`Hold CtrlOrCmd and Arrow key to create a flowchart`,deepBoxSelect:`Hold CtrlOrCmd to deep select, and to prevent dragging`,eraserRevert:`Hold Alt to revert the elements marked for deletion`,firefox_clipboard_write:`This feature can likely be enabled by setting the "dom.events.asyncClipboard.clipboardItem" flag to "true". To change the browser flags in Firefox, visit the "about:config" page.`,disableSnapping:`Hold CtrlOrCmd to disable snapping`,enterCropEditor:`Double click the image or press ENTER to crop the image`,leaveCropEditor:`Click outside the image or press ENTER or ESCAPE to finish cropping`},ZD={cannotShowPreview:`Cannot show preview`,canvasTooBig:`The canvas may be too big.`,canvasTooBigTip:`Tip: try moving the farthest elements a bit closer together.`},QD={headingMain:`Encountered an error. Try <button>reloading the page</button>.`,clearCanvasMessage:`If reloading doesn't work, try <button>clearing the canvas</button>.`,clearCanvasCaveat:` This will result in loss of work `,trackedToSentry:`The error with identifier {{eventId}} was tracked on our system.`,openIssueMessage:`We were very cautious not to include your scene information on the error. If your scene is not private, please consider following up on our <button>bug tracker</button>. Please include information below by copying and pasting into the GitHub issue.`,sceneContent:`Scene content:`},$D={or:`Or`},eO={desc_intro:`Invite people to collaborate on your drawing.`,desc_privacy:`Don't worry, the session is end-to-end encrypted, and fully private. Not even our server can see what you draw.`,button_startSession:`Start session`,button_stopSession:`Stop session`,desc_inProgressIntro:`Live-collaboration session is now in progress.`,desc_shareLink:`Share this link with anyone you want to collaborate with:`,desc_exitSession:`Stopping the session will disconnect you from the room, but you'll be able to continue working with the scene, locally. Note that this won't affect other people, and they'll still be able to collaborate on their version.`,shareTitle:`Join a live collaboration session on Excalidraw`},tO={title:`Error`},nO={disk_title:`Save to disk`,disk_details:`Export the scene data to a file from which you can import later.`,disk_button:`Save to file`,link_title:`Shareable link`,link_details:`Export as a read-only link.`,link_button:`Export to Link`,excalidrawplus_description:`Save the scene to your Excalidraw+ workspace.`,excalidrawplus_button:`Export`,excalidrawplus_exportError:`Couldn't export to Excalidraw+ at this moment...`},rO={blog:`Read our blog`,click:`click`,deepSelect:`Deep select`,deepBoxSelect:`Deep select within box, and prevent dragging`,createFlowchart:`Create a flowchart from a generic element`,navigateFlowchart:`Navigate a flowchart`,curvedArrow:`Curved arrow`,curvedLine:`Curved line`,documentation:`Documentation`,doubleClick:`double-click`,drag:`drag`,editor:`Editor`,editLineArrowPoints:`Edit line/arrow points`,editText:`Edit text / add label`,github:`Found an issue? Submit`,howto:`Follow our guides`,or:`or`,preventBinding:`Prevent arrow binding`,tools:`Tools`,shortcuts:`Keyboard shortcuts`,textFinish:`Finish editing (text editor)`,textNewLine:`Add new line (text editor)`,title:`Help`,view:`View`,zoomToFit:`Zoom to fit all elements`,zoomToSelection:`Zoom to selection`,toggleElementLock:`Lock/unlock selection`,movePageUpDown:`Move page up/down`,movePageLeftRight:`Move page left/right`,cropStart:`Crop image`,cropFinish:`Finish image cropping`},iO={title:`Clear canvas`},aO={title:`Publish library`,itemName:`Item name`,authorName:`Author name`,githubUsername:`GitHub username`,twitterUsername:`Twitter username`,libraryName:`Library name`,libraryDesc:`Library description`,website:`Website`,placeholder:{authorName:`Your name or username`,libraryName:`Name of your library`,libraryDesc:`Description of your library to help people understand its usage`,githubHandle:`GitHub handle (optional), so you can edit the library once submitted for review`,twitterHandle:`Twitter username (optional), so we know who to credit when promoting over Twitter`,website:`Link to your personal website or elsewhere (optional)`},errors:{required:`Required`,website:`Enter a valid URL`},noteDescription:`Submit your library to be included in the <link>public library repository</link> for other people to use in their drawings.`,noteGuidelines:`The library needs to be manually approved first. Please read the <link>guidelines</link> before submitting. You will need a GitHub account to communicate and make changes if requested, but it is not strictly required.`,noteLicense:`By submitting, you agree the library will be published under the <link>MIT License</link>, which in short means anyone can use them without restrictions.`,noteItems:`Each library item must have its own name so it's filterable. The following library items will be included:`,atleastOneLibItem:`Please select at least one library item to get started`,republishWarning:`Note: some of the selected items are marked as already published/submitted. You should only resubmit items when updating an existing library or submission.`},oO={title:`Library submitted`,content:`Thank you {{authorName}}. Your library has been submitted for review. You can track the status <link>here</link>`},sO={resetLibrary:`Reset library`,removeItemsFromLib:`Remove selected items from library`},cO={header:`Export image`,label:{withBackground:`Background`,onlySelected:`Only selected`,darkMode:`Dark mode`,embedScene:`Embed scene`,scale:`Scale`,padding:`Padding`},tooltip:{embedScene:`Scene data will be saved into the exported PNG/SVG file so that the scene can be restored from it.
|
|
56
|
+
Will increase exported file size.`},title:{exportToPng:`Export to PNG`,exportToSvg:`Export to SVG`,copyPngToClipboard:`Copy PNG to clipboard`},button:{exportToPng:`PNG`,exportToSvg:`SVG`,copyPngToClipboard:`Copy to clipboard`}},lO={tooltip:`Your drawings are end-to-end encrypted so Excalidraw's servers will never see them.`,link:`Blog post on end-to-end encryption in Excalidraw`},uO={angle:`Angle`,shapes:`Shapes`,height:`Height`,scene:`Scene`,selected:`Selected`,storage:`Storage`,fullTitle:`Canvas & Shape properties`,title:`Properties`,generalStats:`General`,elementProperties:`Shape properties`,total:`Total`,version:`Version`,versionCopy:`Click to copy`,versionNotAvailable:`Version not available`,width:`Width`},dO={addedToLibrary:`Added to library`,copyStyles:`Copied styles.`,copyToClipboard:`Copied to clipboard.`,copyToClipboardAsPng:`Copied {{exportSelection}} to clipboard as PNG
|
|
57
|
+
({{exportColorScheme}})`,copyToClipboardAsSvg:`Copied {{exportSelection}} to clipboard as SVG
|
|
58
|
+
({{exportColorScheme}})`,fileSaved:`File saved.`,fileSavedToFilename:`Saved to {filename}`,canvas:`canvas`,selection:`selection`,pasteAsSingleElement:`Use {{shortcut}} to paste as a single element,
|
|
59
|
+
or paste into an existing text editor`,unableToEmbed:`Embedding this url is currently not allowed. Raise an issue on GitHub to request the url whitelisted`,unrecognizedLinkFormat:`The link you embedded does not match the expected format. Please try to paste the 'embed' string provided by the source site`,elementLinkCopied:`Link copied to clipboard`},fO={transparent:`Transparent`,black:`Black`,white:`White`,red:`Red`,pink:`Pink`,grape:`Grape`,violet:`Violet`,gray:`Gray`,blue:`Blue`,cyan:`Cyan`,teal:`Teal`,green:`Green`,yellow:`Yellow`,orange:`Orange`,bronze:`Bronze`},pO={app:{center_heading:`All your data is saved locally in your browser.`,center_heading_plus:`Did you want to go to the Excalidraw+ instead?`,menuHint:`Export, preferences, languages, ...`},defaults:{menuHint:`Export, preferences, and more...`,center_heading:`Diagrams. Made. Simple.`,toolbarHint:`Pick a tool & Start drawing!`,helpHint:`Shortcuts & help`}},mO={mostUsedCustomColors:`Most used custom colors`,colors:`Colors`,shades:`Shades`,hexCode:`Hex code`,noShades:`No shades available for this color`},hO={action:{exportToImage:{title:`Export as image`,button:`Export as image`,description:`Export the scene data as an image from which you can import later.`},saveToDisk:{title:`Save to disk`,button:`Save to disk`,description:`Export the scene data to a file from which you can import later.`},excalidrawPlus:{title:`Excalidraw+`,button:`Export to Excalidraw+`,description:`Save the scene to your Excalidraw+ workspace.`}},modal:{loadFromFile:{title:`Load from file`,button:`Load from file`,description:`Loading from a file will <bold>replace your existing content</bold>.<br></br>You can back up your drawing first using one of the options below.`},shareableLink:{title:`Load from link`,button:`Replace my content`,description:`Loading external drawing will <bold>replace your existing content</bold>.<br></br>You can back up your drawing first by using one of the options below.`}}},gO={title:`Mermaid to Excalidraw`,button:`Insert`,description:`Currently only <flowchartLink>Flowchart</flowchartLink>,<sequenceLink> Sequence, </sequenceLink> and <classLink>Class </classLink>Diagrams are supported. The other types will be rendered as image in Excalidraw.`,syntax:`Mermaid Syntax`,preview:`Preview`},_O={placeholder:`Quick search`},vO={badge:{old:`old`},sceneFonts:`In this scene`,availableFonts:`Available fonts`,empty:`No fonts found`},yO={empty:`No users found`,hint:{text:`Click on user to follow`,followStatus:`You're currently following this user`,inCall:`User is in a voice call`,micMuted:`User's microphone is muted`,isSpeaking:`User is speaking`}},bO={title:`Command palette`,shortcuts:{select:`Select`,confirm:`Confirm`,close:`Close`},recents:`Recently used`,search:{placeholder:`Search menus, commands, and discover hidden gems`,noMatch:`No matching commands...`},itemNotAvailable:`Command is not available...`,shortcutHint:`For Command palette, use {{shortcut}}`},xO={labels:BD,elementLink:VD,library:HD,search:UD,buttons:WD,alerts:GD,errors:KD,toolBar:qD,element:JD,headings:YD,hints:XD,canvasError:ZD,errorSplash:QD,shareDialog:$D,roomDialog:eO,errorDialog:tO,exportDialog:nO,helpDialog:rO,clearCanvasDialog:iO,publishDialog:aO,publishSuccessDialog:oO,confirmDialog:sO,imageExportDialog:cO,encrypted:lO,stats:uO,toast:dO,colors:fO,welcomeScreen:pO,colorPicker:mO,overwriteConfirm:hO,mermaid:gO,quickSearch:_O,fontList:vO,userList:yO,commandPalette:bO},SO=100,CO=36,wO={"ar-SA":94,"az-AZ":17,"bg-BG":71,"bn-BD":52,"ca-ES":83,"cs-CZ":86,"da-DK":61,"de-DE":100,"el-GR":80,en:100,"es-ES":96,"eu-ES":97,"fa-IR":84,"fi-FI":76,"fr-FR":99,"gl-ES":86,"he-IL":77,"hi-IN":76,"hu-HU":76,"id-ID":91,"it-IT":98,"ja-JP":90,kaa:36,"kab-KAB":76,"kk-KZ":18,"km-KH":83,"ko-KR":100,"ku-TR":87,"lt-LT":48,"lv-LV":77,"mr-IN":98,"my-MM":35,"nb-NO":93,"nl-NL":75,"nn-NO":67,"oc-FR":92,"pa-IN":78,"pl-PL":99,"pt-BR":91,"pt-PT":83,"ro-RO":99,"ru-RU":92,"si-LK":7,"sk-SK":100,"sl-SI":100,"sv-SE":100,"ta-IN":81,"th-TH":44,"tr-TR":87,"uk-UA":93,"vi-VN":49,"zh-CN":100,"zh-HK":22,"zh-TW":100},TO=0;function EO(e,t){let n=`atom${++TO}`,r={toString(){return n}};return typeof e==`function`?r.read=e:(r.init=e,r.read=DO,r.write=OO),t&&(r.write=t),r}function DO(e){return e(this)}function OO(e,t,n){return t(this,typeof n==`function`?n(e(this)):n)}var kO=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,AO=e=>`init`in e,jO=e=>!!e.write,MO=new WeakMap,NO=e=>IO(e)&&!MO.get(e)?.[1],PO=(e,t)=>{let n=MO.get(e);n&&(n[1]=!0,n[0].forEach(e=>e(t)))},FO=e=>{if(MO.has(e))return;let t=[new Set,!1];MO.set(e,t);let n=()=>{t[1]=!0};e.then(n,n),e.onCancel=e=>{t[0].add(e)}},IO=e=>typeof e?.then==`function`,LO=e=>`v`in e||`e`in e,RO=e=>{if(`e`in e)throw e.e;return e.v},zO=(e,t,n)=>{n.p.has(e)||(n.p.add(e),t.then(()=>{n.p.delete(e)},()=>{n.p.delete(e)}))},BO=(e,t,n,r,i)=>{var a;n.d.set(r,i.n),NO(n.v)&&zO(t,n.v,i),(a=i.m)==null||a.t.add(t),e&&WO(e,r,t)},VO=()=>({D:new Map,H:new Set,M:new Set,L:new Set}),HO=(e,t,n)=>{e[t].add(n)},UO=(e,t,n)=>{e.D.has(t)||(e.D.set(t,new Set),HO(e,`M`,()=>{var t;(t=n.m)==null||t.l.forEach(t=>HO(e,`M`,t))}))},WO=(e,t,n)=>{let r=e.D.get(t);r&&r.add(n)},GO=(e,t)=>e.D.get(t),KO=e=>{let t,n=!1,r=e=>{try{e()}catch(e){n||=(t=e,!0)}};for(;e.H.size||e.M.size||e.L.size;)e.D.clear(),e.H.forEach(r),e.H.clear(),e.M.forEach(r),e.M.clear(),e.L.forEach(r),e.L.clear();if(n)throw t},qO=(...[e,t,n,r])=>{let i=(t,n,r)=>{let i=`v`in n,a=n.v,o=NO(n.v)?n.v:null;if(IO(r)){FO(r);for(let i of n.d.keys())zO(t,r,e(i));n.v=r}else n.v=r;delete n.e,delete n.x,(!i||!Object.is(a,n.v))&&(++n.n,o&&PO(o,r))},a=(n,r)=>{var o;let s=e(r);if(LO(s)&&(s.m&&!s.x||Array.from(s.d).every(([e,t])=>a(n,e).n===t)))return s;s.d.clear();let c=!0,l=t=>{if(kO(r,t)){let n=e(t);if(!LO(n)){if(AO(t))i(t,n,t.init);else throw Error(`no atom init`)}return RO(n)}let o=a(n,t);try{return RO(o)}finally{if(c)BO(n,r,s,t,o);else{let e=VO();BO(e,r,s,t,o),d(e,r,s),KO(e)}}},f,p,m={get signal(){return f||=new AbortController,f.signal},get setSelf(){return!p&&jO(r)&&(p=(...e)=>{if(!c)return u(r,...e)}),p}};try{let e=t(r,l,m);if(i(r,s,e),IO(e)){(o=e.onCancel)==null||o.call(e,()=>f?.abort());let t=()=>{if(s.m){let e=VO();d(e,r,s),KO(e)}};e.then(t,t)}return s}catch(e){return delete s.v,s.e=e,delete s.x,++s.n,s}finally{c=!1}},o=e=>RO(a(void 0,e)),s=(t,n,r)=>{var i;let a=new Map;for(let t of r.m?.t||[]){let n=e(t);n.m&&a.set(t,n)}for(let t of r.p)a.set(t,e(t));return(i=GO(t,n))==null||i.forEach(t=>{a.set(t,e(t))}),a},c=(e,t,n)=>{let r=[],i=new Set,o=new Set,c=[[t,n]];for(;c.length>0;){let[t,n]=c[c.length-1];if(o.has(t)){c.pop();continue}if(i.has(t)){r.push([t,n,n.n]),o.add(t),n.x=!0,c.pop();continue}i.add(t);for(let[r,a]of s(e,t,n))t!==r&&!i.has(r)&&c.push([r,a])}HO(e,`H`,()=>{let n=new Set([t]);for(let t=r.length-1;t>=0;--t){let[i,o,s]=r[t],c=!1;for(let e of o.d.keys())if(e!==i&&n.has(e)){c=!0;break}c&&(a(e,i),d(e,i,o),s!==o.n&&(UO(e,i,o),n.add(i))),delete o.x}})},l=(t,r,...o)=>{let s=!0,u=e=>RO(a(t,e)),f=(n,...a)=>{let o=e(n);try{if(kO(r,n)){if(!AO(n))throw Error(`atom not writable`);let e=o.n,r=a[0];i(n,o,r),d(t,n,o),e!==o.n&&(UO(t,n,o),c(t,n,o));return}return l(t,n,...a)}finally{s||KO(t)}};try{return n(r,u,f,...o)}finally{s=!1}},u=(e,...t)=>{let n=VO();try{return l(n,e,...t)}finally{KO(n)}},d=(t,n,r)=>{if(r.m&&!NO(r.v)){for(let i of r.d.keys())r.m.d.has(i)||(f(t,i,e(i)).t.add(n),r.m.d.add(i));for(let i of r.m.d||[])r.d.has(i)||(r.m.d.delete(i),p(t,i,e(i))?.t.delete(n))}},f=(t,n,i)=>{if(!i.m){a(t,n);for(let r of i.d.keys())f(t,r,e(r)).t.add(n);if(i.m={l:new Set,d:new Set(i.d.keys()),t:new Set},jO(n)){let e=i.m,a,o=(e,t)=>{let r=!0;a=(...t)=>{try{return l(e,n,...t)}finally{r||KO(e)}};try{return t()}finally{r=!1}};HO(t,`L`,()=>{let i=o(t,()=>r(n,(...e)=>a(...e)));i&&(e.u=e=>o(e,i))})}}return i.m},p=(t,n,r)=>{if(r.m&&!r.m.l.size&&!Array.from(r.m.t).some(t=>e(t).m?.d.has(n))){let i=r.m.u;i&&HO(t,`L`,()=>i(t)),delete r.m;for(let i of r.d.keys())p(t,i,e(i))?.t.delete(n);return}return r.m};return{get:o,set:u,sub:(t,n)=>{let r=VO(),i=e(t),a=f(r,t,i).l;return a.add(n),KO(r),()=>{a.delete(n);let e=VO();p(e,t,i),KO(e)}},unstable_derive:i=>qO(...i(e,t,n,r))}},JO=()=>{let e=new WeakMap;return qO(t=>{let n=e.get(t);return n||(n={d:new Map,p:new Set,n:0},e.set(t,n)),n},(e,...t)=>e.read(...t),(e,...t)=>e.write(...t),(e,...t)=>e.onMount?.call(e,...t))},YO,XO=()=>(YO||=JO(),YO),ZO=(0,u.createContext)(void 0),QO=e=>{let t=(0,u.useContext)(ZO);return e?.store||t||XO()},$O=e=>typeof e?.then==`function`,ek=e=>{e.status=`pending`,e.then(t=>{e.status=`fulfilled`,e.value=t},t=>{e.status=`rejected`,e.reason=t})},tk=u.default.use||(e=>{if(e.status===`pending`)throw e;if(e.status===`fulfilled`)return e.value;throw e.status===`rejected`?e.reason:(ek(e),e)}),nk=new WeakMap,rk=e=>{let t=nk.get(e);return t||(t=new Promise((n,r)=>{let i=e,a=e=>t=>{i===e&&n(t)},o=e=>t=>{i===e&&r(t)},s=e=>{`onCancel`in e&&typeof e.onCancel==`function`&&e.onCancel(e=>{$O(e)?(nk.set(e,t),i=e,e.then(a(e),o(e)),s(e)):n(e)})};e.then(a(e),o(e)),s(e)}),nk.set(e,t)),t};function ik(e,t){let n=QO(t),[[r,i,a],o]=(0,u.useReducer)(t=>{let r=n.get(e);return Object.is(t[0],r)&&t[1]===n&&t[2]===e?t:[r,n,e]},void 0,()=>[n.get(e),n,e]),s=r;(i!==n||a!==e)&&(o(),s=n.get(e));let c=t?.delay;return(0,u.useEffect)(()=>{let t=n.sub(e,()=>{if(typeof c==`number`){let t=n.get(e);$O(t)&&ek(rk(t)),setTimeout(o,c);return}o()});return o(),t},[n,e,c]),(0,u.useDebugValue)(s),$O(s)?tk(rk(s)):s}function ak(e,t){let n=QO(t);return(0,u.useCallback)((...t)=>n.set(e,...t),[n,e])}function ok(e,t){return[ik(e,t),ak(e,t)]}var sk=new WeakMap;function ck(e,t){let n=QO(t),r=lk(n);for(let[i,a]of e)(!r.has(i)||t?.dangerouslyForceHydrate)&&(r.add(i),n.set(i,a))}var lk=e=>{let t=sk.get(e);return t||(t=new WeakSet,sk.set(e,t)),t};function uk(){return uk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uk.apply(this,arguments)}function dk(){let e=(0,u.createContext)(null);function t({store:t,initialValues:n=[],children:r}){let i=(0,u.useRef)(t);return i.current||=JO(),ck(n,{store:i.current}),(0,k.jsx)(e.Provider,{value:i.current,children:r})}let n=t=>{let n=(0,u.useContext)(e);if(!n)throw Error(`Missing Provider from createIsolation`);return QO(uk({store:n},t))};return{Provider:t,useStore:n,useAtom:(e,t)=>{let r=n();return ok(e,uk({store:r},t))},useAtomValue:(e,t)=>{let r=n();return ik(e,uk({store:r},t))},useSetAtom:(e,t)=>{let r=n();return ak(e,uk({store:r},t))}}}var{read:fk,write:pk}=EO(null);(0,u.createContext)({scope:void 0,baseStore:void 0});var mk=e(c(),1);function hk(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function gk(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function _k(...e){return t=>{let n=!1,r=e.map(e=>{let r=gk(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():gk(e[t],null)}}}}function vk(...e){return u.useCallback(_k(...e),e)}function yk(e,t=[]){let n=[];function r(t,r){let i=u.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=u.useMemo(()=>o,Object.values(o));return(0,k.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=u.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>u.createContext(e));return function(n){let r=n?.[e]||t;return u.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,bk(i,...t)]}function bk(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var xk=u.forwardRef((e,t)=>{let{children:n,...r}=e,i=u.Children.toArray(n),a=i.find(wk);if(a){let e=a.props.children,n=i.map(t=>t===a?u.Children.count(e)>1?u.Children.only(null):u.isValidElement(e)?e.props.children:null:t);return(0,k.jsx)(Sk,{...r,ref:t,children:u.isValidElement(e)?u.cloneElement(e,void 0,n):null})}return(0,k.jsx)(Sk,{...r,ref:t,children:n})});xk.displayName=`Slot`;var Sk=u.forwardRef((e,t)=>{let{children:n,...r}=e;if(u.isValidElement(n)){let e=Ek(n),i=Tk(r,n.props);return n.type!==u.Fragment&&(i.ref=t?_k(t,e):e),u.cloneElement(n,i)}return u.Children.count(n)>1?u.Children.only(null):null});Sk.displayName=`SlotClone`;var Ck=({children:e})=>(0,k.jsx)(k.Fragment,{children:e});function wk(e){return u.isValidElement(e)&&e.type===Ck}function Tk(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{a(...e),i(...e)}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Ek(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Dk=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=u.forwardRef((e,n)=>{let{asChild:r,...i}=e,a=r?xk:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,k.jsx)(a,{...i,ref:n})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Ok(e,t){e&&mk.flushSync(()=>e.dispatchEvent(t))}function kk(e){let t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...e)=>t.current?.(...e),[])}function Ak(e,t=globalThis?.document){let n=kk(e);u.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var jk=`DismissableLayer`,Mk=`dismissableLayer.update`,Nk=`dismissableLayer.pointerDownOutside`,Pk=`dismissableLayer.focusOutside`,Fk,Ik=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Lk=u.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=u.useContext(Ik),[d,f]=u.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=u.useState({}),h=vk(t,e=>f(e)),g=Array.from(l.layers),[_]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(_),y=d?g.indexOf(d):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=Bk(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!x||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},p),C=Vk(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},p);return Ak(e=>{y===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},p),u.useEffect(()=>{if(d)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Fk=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(d)),l.layers.add(d),Hk(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Fk)}},[d,p,n,l]),u.useEffect(()=>()=>{d&&(l.layers.delete(d),l.layersWithOutsidePointerEventsDisabled.delete(d),Hk())},[d,l]),u.useEffect(()=>{let e=()=>m({});return document.addEventListener(Mk,e),()=>document.removeEventListener(Mk,e)},[]),(0,k.jsx)(Dk.div,{...c,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:hk(e.onFocusCapture,C.onFocusCapture),onBlurCapture:hk(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:hk(e.onPointerDownCapture,S.onPointerDownCapture)})});Lk.displayName=jk;var Rk=`DismissableLayerBranch`,zk=u.forwardRef((e,t)=>{let n=u.useContext(Ik),r=u.useRef(null),i=vk(t,r);return u.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,k.jsx)(Dk.div,{...e,ref:i})});zk.displayName=Rk;function Bk(e,t=globalThis?.document){let n=kk(e),r=u.useRef(!1),i=u.useRef(()=>{});return u.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Uk(Nk,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Vk(e,t=globalThis?.document){let n=kk(e),r=u.useRef(!1);return u.useEffect(()=>{let e=e=>{e.target&&!r.current&&Uk(Pk,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Hk(){let e=new CustomEvent(Mk);document.dispatchEvent(e)}function Uk(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Ok(i,a):i.dispatchEvent(a)}var Wk=0;function Gk(){u.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Kk()),document.body.insertAdjacentElement(`beforeend`,e[1]??Kk()),Wk++,()=>{Wk===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Wk--}},[])}function Kk(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var qk=`focusScope.autoFocusOnMount`,Jk=`focusScope.autoFocusOnUnmount`,Yk={bubbles:!1,cancelable:!0},Xk=`FocusScope`,Zk=u.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=u.useState(null),l=kk(i),d=kk(a),f=u.useRef(null),p=vk(t,e=>c(e)),m=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(r){let e=function(e){if(m.paused||!s)return;let t=e.target;s.contains(t)?f.current=t:iA(f.current,{select:!0})},t=function(e){if(m.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||iA(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&iA(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,m.paused]),u.useEffect(()=>{if(s){aA.add(m);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(qk,Yk);s.addEventListener(qk,l),s.dispatchEvent(t),t.defaultPrevented||(Qk(cA(eA(s)),{select:!0}),document.activeElement===e&&iA(s))}return()=>{s.removeEventListener(qk,l),setTimeout(()=>{let t=new CustomEvent(Jk,Yk);s.addEventListener(Jk,d),s.dispatchEvent(t),t.defaultPrevented||iA(e??document.body,{select:!0}),s.removeEventListener(Jk,d),aA.remove(m)},0)}}},[s,l,d,m]);let h=u.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=$k(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&iA(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&iA(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,k.jsx)(Dk.div,{tabIndex:-1,...o,ref:p,onKeyDown:h})});Zk.displayName=Xk;function Qk(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(iA(r,{select:t}),document.activeElement!==n)return}function $k(e){let t=eA(e);return[tA(t,e),tA(t.reverse(),e)]}function eA(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function tA(e,t){for(let n of e)if(!nA(n,{upTo:t}))return n}function nA(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function rA(e){return e instanceof HTMLInputElement&&`select`in e}function iA(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&rA(e)&&t&&e.select()}}var aA=oA();function oA(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=sA(e,t),e.unshift(t)},remove(t){e=sA(e,t),e[0]?.resume()}}}function sA(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function cA(e){return e.filter(e=>e.tagName!==`A`)}var lA=globalThis?.document?u.useLayoutEffect:()=>{},uA=u.useId||(()=>void 0),dA=0;function fA(e){let[t,n]=u.useState(uA());return lA(()=>{e||n(e=>e??String(dA++))},[e]),e||(t?`radix-${t}`:``)}var pA=[`top`,`right`,`bottom`,`left`],mA=Math.min,hA=Math.max,gA=Math.round,_A=Math.floor,vA=e=>({x:e,y:e}),yA={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function bA(e,t,n){return hA(e,mA(t,n))}function xA(e,t){return typeof e==`function`?e(t):e}function SA(e){return e.split(`-`)[0]}function CA(e){return e.split(`-`)[1]}function wA(e){return e===`x`?`y`:`x`}function TA(e){return e===`y`?`height`:`width`}function EA(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function DA(e){return wA(EA(e))}function OA(e,t,n){n===void 0&&(n=!1);let r=CA(e),i=DA(e),a=TA(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=LA(o)),[o,LA(o)]}function kA(e){let t=LA(e);return[AA(e),t,AA(t)]}function AA(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var jA=[`left`,`right`],MA=[`right`,`left`],NA=[`top`,`bottom`],PA=[`bottom`,`top`];function FA(e,t,n){switch(e){case`top`:case`bottom`:return n?t?MA:jA:t?jA:MA;case`left`:case`right`:return t?NA:PA;default:return[]}}function IA(e,t,n,r){let i=CA(e),a=FA(SA(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(AA)))),a}function LA(e){let t=SA(e);return yA[t]+e.slice(t.length)}function RA(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function zA(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:RA(e)}function BA(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function VA(e,t,n){let{reference:r,floating:i}=e,a=EA(t),o=DA(t),s=TA(o),c=SA(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=CA(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function HA(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=xA(t,e),p=zA(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=BA(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=BA(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var UA=50,WA=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:HA},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=VA(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<UA&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=VA(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},GA=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=xA(e,t)||{};if(l==null)return{};let d=zA(u),f={x:n,y:r},p=DA(i),m=TA(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=mA(d[_],T),D=mA(d[v],T),ee=C-h[m]-D,te=C/2-h[m]/2+w,ne=bA(E,te,ee),re=!c.arrow&&CA(i)!=null&&te!==ne&&a.reference[m]/2-(te<E?E:D)-h[m]/2<0,ie=re?te<E?te-E:te-ee:0;return{[p]:f[p]+ie,data:{[p]:ne,centerOffset:te-ne-ie,...re&&{alignmentOffset:ie}},reset:re}}}),KA=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=xA(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=SA(r),_=EA(o),v=SA(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[LA(o)]:kA(o)),x=p!==`none`;!d&&x&&b.push(...IA(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=OA(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===EA(t)||T.every(e=>EA(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=EA(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function qA(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function JA(e){return pA.some(t=>e[t]>=0)}var YA=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=xA(e,t);switch(i){case`referenceHidden`:{let e=qA(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:JA(e)}}}case`escaped`:{let e=qA(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:JA(e)}}}default:return{}}}}},XA=new Set([`left`,`top`]);async function ZA(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=SA(n),s=CA(n),c=EA(n)===`y`,l=XA.has(o)?-1:1,u=a&&c?-1:1,d=xA(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var QA=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ZA(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},$A=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=xA(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=EA(i),p=wA(f),m=u[p],h=u[f],g=(e,t)=>bA(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},ej=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=xA(e,t),u={x:n,y:r},d=EA(i),f=wA(d),p=u[f],m=u[d],h=xA(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=XA.has(SA(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},tj=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=xA(e,t),c=await i.detectOverflow(t,s),l=SA(n),u=CA(n),d=EA(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=mA(p-c[m],g),y=mA(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*hA(c.left,c.right):S=p-2*hA(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function nj(){return typeof window<`u`}function rj(e){return oj(e)?(e.nodeName||``).toLowerCase():`#document`}function ij(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function aj(e){return((oj(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function oj(e){return nj()?e instanceof Node||e instanceof ij(e).Node:!1}function sj(e){return nj()?e instanceof Element||e instanceof ij(e).Element:!1}function cj(e){return nj()?e instanceof HTMLElement||e instanceof ij(e).HTMLElement:!1}function lj(e){return!nj()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof ij(e).ShadowRoot}function uj(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=xj(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function dj(e){return/^(table|td|th)$/.test(rj(e))}function fj(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var pj=/transform|translate|scale|rotate|perspective|filter/,mj=/paint|layout|strict|content/,hj=e=>!!e&&e!==`none`,gj;function _j(e){let t=sj(e)?xj(e):e;return hj(t.transform)||hj(t.translate)||hj(t.scale)||hj(t.rotate)||hj(t.perspective)||!yj()&&(hj(t.backdropFilter)||hj(t.filter))||pj.test(t.willChange||``)||mj.test(t.contain||``)}function vj(e){let t=Cj(e);for(;cj(t)&&!bj(t);){if(_j(t))return t;if(fj(t))return null;t=Cj(t)}return null}function yj(){return gj??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),gj}function bj(e){return/^(html|body|#document)$/.test(rj(e))}function xj(e){return ij(e).getComputedStyle(e)}function Sj(e){return sj(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Cj(e){if(rj(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||lj(e)&&e.host||aj(e);return lj(t)?t.host:t}function wj(e){let t=Cj(e);return bj(t)?(e.ownerDocument||e).body:cj(t)&&uj(t)?t:wj(t)}function Tj(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=wj(e),i=r===e.ownerDocument?.body,a=ij(r);if(i){let e=Ej(a);return t.concat(a,a.visualViewport||[],uj(r)?r:[],e&&n?Tj(e):[])}return t.concat(r,Tj(r,[],n))}function Ej(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Dj(e){let t=xj(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=cj(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=gA(n)!==a||gA(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Oj(e){return sj(e)?e:e.contextElement}function kj(e){let t=Oj(e);if(!cj(t))return vA(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Dj(t),o=(a?gA(n.width):n.width)/r,s=(a?gA(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Aj=vA(0);function jj(e){let t=ij(e);return!yj()||!t.visualViewport?Aj:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Mj(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ij(e)}function Nj(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Oj(e),o=vA(1);t&&(r?sj(r)&&(o=kj(r)):o=kj(e));let s=Mj(a,n,r)?jj(a):vA(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=ij(a),t=sj(r)?ij(r):r,n=e,i=Ej(n);for(;i&&t!==n;){let e=kj(i),t=i.getBoundingClientRect(),r=xj(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=ij(i),i=Ej(n)}}return BA({width:u,height:d,x:c,y:l})}function Pj(e,t){let n=Sj(e).scrollLeft;return t?t.left+n:Nj(aj(e)).left+n}function Fj(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Pj(e,n),y:n.top+t.scrollTop}}function Ij(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=aj(r),s=t?fj(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=vA(1),u=vA(0),d=cj(r);if((d||!a)&&((rj(r)!==`body`||uj(o))&&(c=Sj(r)),d)){let e=Nj(r);l=kj(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Fj(o,c):vA(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Lj(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Rj(e){let t=Sj(e),n=e.ownerDocument.body,r=hA(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=hA(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Pj(e),o=-t.scrollTop;return xj(n).direction===`rtl`&&(a+=hA(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var zj=25;function Bj(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=ij(e),a=aj(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!yj()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Pj(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=zj&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Vj(e,t){let n=Nj(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=kj(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Hj(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Bj(e,n,t);else if(t===`document`)r=Rj(aj(e));else if(sj(t))r=Vj(t,n);else{let n=jj(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return BA(r)}function Uj(e,t){let n=t.get(e);if(n)return n;let r=Tj(e,[],!1).filter(e=>sj(e)&&rj(e)!==`body`),i=null,a=xj(e).position===`fixed`,o=a?Cj(e):e;for(;sj(o)&&!bj(o);){let e=xj(o),t=_j(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Cj(o)}return t.set(e,r),r}function Wj(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?fj(t)?[]:Uj(t,this._c):[].concat(n),r],o=Hj(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Hj(t,a[e],i);s=hA(n.top,s),c=mA(n.right,c),l=mA(n.bottom,l),u=hA(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Gj(e){let{width:t,height:n}=Dj(e);return{width:t,height:n}}function Kj(e,t,n){let r=cj(t),i=aj(t),a=n===`fixed`,o=Nj(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=vA(0);if((r||!a)&&((rj(t)!==`body`||uj(i))&&(s=Sj(t)),r)){let e=Nj(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Pj(i));let l=i&&!r&&!a?Fj(i,s):vA(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function qj(e){return xj(e).position===`static`}function Jj(e,t){if(!cj(e)||xj(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return aj(e)===n&&(n=n.ownerDocument.body),n}function Yj(e,t){let n=ij(e);if(fj(e))return n;if(!cj(e)){let t=Cj(e);for(;t&&!bj(t);){if(sj(t)&&!qj(t))return t;t=Cj(t)}return n}let r=Jj(e,t);for(;r&&dj(r)&&qj(r);)r=Jj(r,t);return r&&bj(r)&&qj(r)&&!_j(r)?n:r||vj(e)||n}var Xj=async function(e){let t=this.getOffsetParent||Yj,n=this.getDimensions,r=await n(e.floating);return{reference:Kj(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Zj(e){return xj(e).direction===`rtl`}var Qj={convertOffsetParentRelativeRectToViewportRelativeRect:Ij,getDocumentElement:aj,getClippingRect:Wj,getOffsetParent:Yj,getElementRects:Xj,getClientRects:Lj,getDimensions:Gj,getScale:kj,isElement:sj,isRTL:Zj};function $j(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function eM(e,t,n){let r=null,i,a=aj(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=_A(d),h=_A(a.clientWidth-(u+f)),g=_A(a.clientHeight-(d+p)),_=_A(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:hA(0,mA(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!$j(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=ij(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function tM(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Oj(e),u=i||a?[...l?Tj(l):[],...t?Tj(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?eM(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Nj(e):null;c&&g();function g(){let t=Nj(e);h&&!$j(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var nM=QA,rM=$A,iM=KA,aM=tj,oM=YA,sM=GA,cM=ej,lM=(e,t,n)=>{let r=new Map,i=n??{},a={...Qj,...i.platform,_c:r};return WA(e,t,{...i,platform:a})},uM=typeof document<`u`?u.useLayoutEffect:function(){};function dM(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!dM(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!dM(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function fM(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pM(e,t){let n=fM(e);return Math.round(t*n)/n}function mM(e){let t=u.useRef(e);return uM(()=>{t.current=e}),t}function hM(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[d,f]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=u.useState(r);dM(p,r)||m(r);let[h,g]=u.useState(null),[_,v]=u.useState(null),y=u.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=u.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=u.useRef(null),w=u.useRef(null),T=u.useRef(d),E=c!=null,D=mM(c),ee=mM(i),te=mM(l),ne=u.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};ee.current&&(e.platform=ee.current),lM(C.current,w.current,e).then(e=>{let t={...e,isPositioned:te.current!==!1};re.current&&!dM(T.current,t)&&(T.current=t,mk.flushSync(()=>{f(t)}))})},[p,t,n,ee,te]);uM(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[l]);let re=u.useRef(!1);uM(()=>(re.current=!0,()=>{re.current=!1}),[]),uM(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,ne);ne()}},[x,S,ne,D,E]);let ie=u.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),ae=u.useMemo(()=>({reference:x,floating:S}),[x,S]),oe=u.useMemo(()=>{let e={position:n,left:0,top:0};if(!ae.floating)return e;let t=pM(ae.floating,d.x),r=pM(ae.floating,d.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...fM(ae.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,ae.floating,d.x,d.y]);return u.useMemo(()=>({...d,update:ne,refs:ie,elements:ae,floatingStyles:oe}),[d,ne,ie,ae,oe])}var gM=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:sM({element:r.current,padding:i}).fn(n):r?sM({element:r,padding:i}).fn(n):{}}}},_M=(e,t)=>{let n=nM(e);return{name:n.name,fn:n.fn,options:[e,t]}},vM=(e,t)=>{let n=rM(e);return{name:n.name,fn:n.fn,options:[e,t]}},yM=(e,t)=>({fn:cM(e).fn,options:[e,t]}),bM=(e,t)=>{let n=iM(e);return{name:n.name,fn:n.fn,options:[e,t]}},xM=(e,t)=>{let n=aM(e);return{name:n.name,fn:n.fn,options:[e,t]}},SM=(e,t)=>{let n=oM(e);return{name:n.name,fn:n.fn,options:[e,t]}},CM=(e,t)=>{let n=gM(e);return{name:n.name,fn:n.fn,options:[e,t]}},wM=`Arrow`,TM=u.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,k.jsx)(Dk.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,k.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});TM.displayName=wM;var EM=TM;function DM(e){let[t,n]=u.useState(void 0);return lA(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}var OM=`Popper`,[kM,AM]=yk(OM),[jM,MM]=kM(OM),NM=e=>{let{__scopePopper:t,children:n}=e,[r,i]=u.useState(null);return(0,k.jsx)(jM,{scope:t,anchor:r,onAnchorChange:i,children:n})};NM.displayName=OM;var PM=`PopperAnchor`,FM=u.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=MM(PM,n),o=u.useRef(null),s=vk(t,o);return u.useEffect(()=>{a.onAnchorChange(r?.current||o.current)}),r?null:(0,k.jsx)(Dk.div,{...i,ref:s})});FM.displayName=PM;var IM=`PopperContent`,[LM,RM]=kM(IM),zM=u.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:d=0,sticky:f=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:m=`optimized`,onPlaced:h,...g}=e,_=MM(IM,n),[v,y]=u.useState(null),b=vk(t,e=>y(e)),[x,S]=u.useState(null),C=DM(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},ee=Array.isArray(l)?l:[l],te=ee.length>0,ne={padding:D,boundary:ee.filter(UM),altBoundary:te},{refs:re,floatingStyles:ie,placement:ae,isPositioned:oe,middlewareData:se}=hM({strategy:`fixed`,placement:E,whileElementsMounted:(...e)=>tM(...e,{animationFrame:m===`always`}),elements:{reference:_.anchor},middleware:[_M({mainAxis:i+T,alignmentAxis:o}),c&&vM({mainAxis:!0,crossAxis:!1,limiter:f===`partial`?yM():void 0,...ne}),c&&bM({...ne}),xM({...ne,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),x&&CM({element:x,padding:s}),WM({arrowWidth:w,arrowHeight:T}),p&&SM({strategy:`referenceHidden`,...ne})]}),[ce,le]=GM(ae),ue=kk(h);lA(()=>{oe&&ue?.()},[oe,ue]);let de=se.arrow?.x,fe=se.arrow?.y,pe=se.arrow?.centerOffset!==0,[me,he]=u.useState();return lA(()=>{v&&he(window.getComputedStyle(v).zIndex)},[v]),(0,k.jsx)(`div`,{ref:re.setFloating,"data-radix-popper-content-wrapper":``,style:{...ie,transform:oe?ie.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:me,"--radix-popper-transform-origin":[se.transformOrigin?.x,se.transformOrigin?.y].join(` `),...se.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,k.jsx)(LM,{scope:n,placedSide:ce,onArrowChange:S,arrowX:de,arrowY:fe,shouldHideArrow:pe,children:(0,k.jsx)(Dk.div,{"data-side":ce,"data-align":le,...g,ref:b,style:{...g.style,animation:oe?void 0:`none`}})})})});zM.displayName=IM;var BM=`PopperArrow`,VM={top:`bottom`,right:`left`,bottom:`top`,left:`right`},HM=u.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=RM(BM,n),a=VM[i.placedSide];return(0,k.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,k.jsx)(EM,{...r,ref:t,style:{...r.style,display:`block`}})})});HM.displayName=BM;function UM(e){return e!==null}var WM=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=GM(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function GM(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var KM=NM,qM=FM,JM=zM,YM=HM,XM=`Portal`,ZM=u.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=u.useState(!1);lA(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?mk.createPortal((0,k.jsx)(Dk.div,{...r,ref:t}),o):null});ZM.displayName=XM;function QM(e,t){return u.useReducer((e,n)=>t[e][n]??e,e)}var $M=e=>{let{present:t,children:n}=e,r=eN(t),i=typeof n==`function`?n({present:r.isPresent}):u.Children.only(n),a=vk(r.ref,nN(i));return typeof n==`function`||r.isPresent?u.cloneElement(i,{ref:a}):null};$M.displayName=`Presence`;function eN(e){let[t,n]=u.useState(),r=u.useRef({}),i=u.useRef(e),a=u.useRef(`none`),[o,s]=QM(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return u.useEffect(()=>{let e=tN(r.current);a.current=o===`mounted`?e:`none`},[o]),lA(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=tN(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),lA(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=tN(r.current).includes(a.animationName);if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=tN(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:u.useCallback(e=>{e&&(r.current=getComputedStyle(e)),n(e)},[])}}function tN(e){return e?.animationName||`none`}function nN(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function rN({prop:e,defaultProp:t,onChange:n=()=>{}}){let[r,i]=iN({defaultProp:t,onChange:n}),a=e!==void 0,o=a?e:r,s=kk(n);return[o,u.useCallback(t=>{if(a){let n=typeof t==`function`?t(e):t;n!==e&&s(n)}else i(t)},[a,e,i,s])]}function iN({defaultProp:e,onChange:t}){let n=u.useState(e),[r]=n,i=u.useRef(r),a=kk(t);return u.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}var aN=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},oN=new WeakMap,sN=new WeakMap,cN={},lN=0,uN=function(e){return e&&(e.host||uN(e.parentNode))},dN=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=uN(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},fN=function(e,t,n,r){var i=dN(t,Array.isArray(e)?e:[e]);cN[n]||(cN[n]=new WeakMap);var a=cN[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(oN.get(e)||0)+1,l=(a.get(e)||0)+1;oN.set(e,c),a.set(e,l),o.push(e),c===1&&i&&sN.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),lN++,function(){o.forEach(function(e){var t=oN.get(e)-1,i=a.get(e)-1;oN.set(e,t),a.set(e,i),t||(sN.has(e)||e.removeAttribute(r),sN.delete(e)),i||e.removeAttribute(n)}),lN--,lN||(oN=new WeakMap,oN=new WeakMap,sN=new WeakMap,cN={})}},pN=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||aN(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),fN(r,i,n,`aria-hidden`)):function(){return null}},mN=function(){return mN=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},mN.apply(this,arguments)};function hN(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}function gN(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var _N=`right-scroll-bar-position`,vN=`width-before-scroll-bar`,yN=`with-scroll-bars-hidden`,bN=`--removed-body-scroll-bar-size`;function xN(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function SN(e,t){var n=(0,u.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var CN=typeof window<`u`?u.useLayoutEffect:u.useEffect,wN=new WeakMap;function TN(e,t){var n=SN(t||null,function(t){return e.forEach(function(e){return xN(e,t)})});return CN(function(){var t=wN.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||xN(e,null)}),i.forEach(function(e){r.has(e)||xN(e,a)})}wN.set(n,e)},[e]),n}function EN(e){return e}function DN(e,t){t===void 0&&(t=EN);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function ON(e){e===void 0&&(e={});var t=DN(null);return t.options=mN({async:!0,ssr:!1},e),t}var kN=function(e){var t=e.sideCar,n=hN(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return u.createElement(r,mN({},n))};kN.isSideCarExport=!0;function AN(e,t){return e.useMedium(t),kN}var jN=ON(),MN=function(){},NN=u.forwardRef(function(e,t){var n=u.useRef(null),r=u.useState({onScrollCapture:MN,onWheelCapture:MN,onTouchMoveCapture:MN}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=hN(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=TN([n,t]),w=mN(mN({},x),i);return u.createElement(u.Fragment,null,d&&u.createElement(S,{sideCar:jN,removeScrollBar:l,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?u.cloneElement(u.Children.only(s),mN(mN({},w),{ref:C})):u.createElement(y,mN({},w,{className:c,ref:C}),s))});NN.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},NN.classNames={fullWidth:vN,zeroRight:_N};var PN=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function FN(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=PN();return t&&e.setAttribute(`nonce`,t),e}function IN(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function LN(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var RN=function(){var e=0,t=null;return{add:function(n){e==0&&(t=FN())&&(IN(t,n),LN(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},zN=function(){var e=RN();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},BN=function(){var e=zN();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},VN={left:0,top:0,right:0,gap:0},HN=function(e){return parseInt(e||``,10)||0},UN=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[HN(n),HN(r),HN(i)]},WN=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return VN;var t=UN(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},GN=BN(),KN=`data-scroll-locked`,qN=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
60
|
+
.${yN} {
|
|
61
|
+
overflow: hidden ${r};
|
|
62
|
+
padding-right: ${s}px ${r};
|
|
63
|
+
}
|
|
64
|
+
body[${KN}] {
|
|
65
|
+
overflow: hidden ${r};
|
|
66
|
+
overscroll-behavior: contain;
|
|
67
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
68
|
+
padding-left: ${i}px;
|
|
69
|
+
padding-top: ${a}px;
|
|
70
|
+
padding-right: ${o}px;
|
|
71
|
+
margin-left:0;
|
|
72
|
+
margin-top:0;
|
|
73
|
+
margin-right: ${s}px ${r};
|
|
74
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.${_N} {
|
|
78
|
+
right: ${s}px ${r};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.${vN} {
|
|
82
|
+
margin-right: ${s}px ${r};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.${_N} .${_N} {
|
|
86
|
+
right: 0 ${r};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.${vN} .${vN} {
|
|
90
|
+
margin-right: 0 ${r};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
body[${KN}] {
|
|
94
|
+
${bN}: ${s}px;
|
|
95
|
+
}
|
|
96
|
+
`},JN=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},YN=function(){u.useEffect(function(){return document.body.setAttribute(KN,(JN()+1).toString()),function(){var e=JN()-1;e<=0?document.body.removeAttribute(KN):document.body.setAttribute(KN,e.toString())}},[])},XN=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;YN();var a=u.useMemo(function(){return WN(i)},[i]);return u.createElement(GN,{styles:qN(a,!t,i,n?``:`!important`)})},ZN=!1;if(typeof window<`u`)try{var QN=Object.defineProperty({},"passive",{get:function(){return ZN=!0,!0}});window.addEventListener(`test`,QN,QN),window.removeEventListener(`test`,QN,QN)}catch{ZN=!1}var $N=ZN?{passive:!1}:!1,eP=function(e){return e.tagName===`TEXTAREA`},tP=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!eP(e)&&n[t]===`visible`)},nP=function(e){return tP(e,`overflowY`)},rP=function(e){return tP(e,`overflowX`)},iP=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),sP(e,r)){var i=cP(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},aP=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},oP=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},sP=function(e,t){return e===`v`?nP(t):rP(t)},cP=function(e,t){return e===`v`?aP(t):oP(t)},lP=function(e,t){return e===`h`&&t===`rtl`?-1:1},uP=function(e,t,n,r,i){var a=lP(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=cP(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&sP(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},dP=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},fP=function(e){return[e.deltaX,e.deltaY]},pP=function(e){return e&&`current`in e?e.current:e},mP=function(e,t){return e[0]===t[0]&&e[1]===t[1]},hP=function(e){return`
|
|
97
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
98
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
99
|
+
`},gP=0,_P=[];function vP(e){var t=u.useRef([]),n=u.useRef([0,0]),r=u.useRef(),i=u.useState(gP++)[0],a=u.useState(BN)[0],o=u.useRef(e);u.useEffect(function(){o.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=gN([e.lockRef.current],(e.shards||[]).map(pP),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=u.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=dP(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=iP(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=iP(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return uP(h,t,e,h===`h`?s:c,!0)},[]),c=u.useCallback(function(e){var n=e;if(!(!_P.length||_P[_P.length-1]!==a)){var r=`deltaY`in n?fP(n):dP(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&mP(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(pP).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=u.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:yP(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=u.useCallback(function(e){n.current=dP(e),r.current=void 0},[]),f=u.useCallback(function(t){l(t.type,fP(t),t.target,s(t,e.lockRef.current))},[]),p=u.useCallback(function(t){l(t.type,dP(t),t.target,s(t,e.lockRef.current))},[]);u.useEffect(function(){return _P.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,c,$N),document.addEventListener(`touchmove`,c,$N),document.addEventListener(`touchstart`,d,$N),function(){_P=_P.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,$N),document.removeEventListener(`touchmove`,c,$N),document.removeEventListener(`touchstart`,d,$N)}},[]);var m=e.removeScrollBar,h=e.inert;return u.createElement(u.Fragment,null,h?u.createElement(a,{styles:hP(i)}):null,m?u.createElement(XN,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function yP(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var bP=AN(jN,vP),xP=u.forwardRef(function(e,t){return u.createElement(NN,mN({},e,{ref:t,sideCar:bP}))});xP.classNames=NN.classNames;var SP=`Popover`,[CP,wP]=yk(SP,[AM]),TP=AM(),[EP,DP]=CP(SP),OP=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=TP(t),c=u.useRef(null),[l,d]=u.useState(!1),[f=!1,p]=rN({prop:r,defaultProp:i,onChange:a});return(0,k.jsx)(KM,{...s,children:(0,k.jsx)(EP,{scope:t,contentId:fA(),triggerRef:c,open:f,onOpenChange:p,onOpenToggle:u.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:l,onCustomAnchorAdd:u.useCallback(()=>d(!0),[]),onCustomAnchorRemove:u.useCallback(()=>d(!1),[]),modal:o,children:n})})};OP.displayName=SP;var kP=`PopoverAnchor`,AP=u.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=DP(kP,n),a=TP(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return u.useEffect(()=>(o(),()=>s()),[o,s]),(0,k.jsx)(qM,{...a,...r,ref:t})});AP.displayName=kP;var jP=`PopoverTrigger`,MP=u.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=DP(jP,n),a=TP(n),o=vk(t,i.triggerRef),s=(0,k.jsx)(Dk.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":KP(i.open),...r,ref:o,onClick:hk(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,k.jsx)(qM,{asChild:!0,...a,children:s})});MP.displayName=jP;var NP=`PopoverPortal`,[PP,FP]=CP(NP,{forceMount:void 0}),IP=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=DP(NP,t);return(0,k.jsx)(PP,{scope:t,forceMount:n,children:(0,k.jsx)($M,{present:n||a.open,children:(0,k.jsx)(ZM,{asChild:!0,container:i,children:r})})})};IP.displayName=NP;var LP=`PopoverContent`,RP=u.forwardRef((e,t)=>{let n=FP(LP,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=DP(LP,e.__scopePopover);return(0,k.jsx)($M,{present:r||a.open,children:a.modal?(0,k.jsx)(zP,{...i,ref:t}):(0,k.jsx)(BP,{...i,ref:t})})});RP.displayName=LP;var zP=u.forwardRef((e,t)=>{let n=DP(LP,e.__scopePopover),r=u.useRef(null),i=vk(t,r),a=u.useRef(!1);return u.useEffect(()=>{let e=r.current;if(e)return pN(e)},[]),(0,k.jsx)(xP,{as:xk,allowPinchZoom:!0,children:(0,k.jsx)(VP,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:hk(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:hk(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:hk(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),BP=u.forwardRef((e,t)=>{let n=DP(LP,e.__scopePopover),r=u.useRef(!1),i=u.useRef(!1);return(0,k.jsx)(VP,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),VP=u.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=DP(LP,n),p=TP(n);return Gk(),(0,k.jsx)(Zk,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,k.jsx)(Lk,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,k.jsx)(JM,{"data-state":KP(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),HP=`PopoverClose`,UP=u.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=DP(HP,n);return(0,k.jsx)(Dk.button,{type:`button`,...r,ref:t,onClick:hk(e.onClick,()=>i.onOpenChange(!1))})});UP.displayName=HP;var WP=`PopoverArrow`,GP=u.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=TP(n);return(0,k.jsx)(YM,{...i,...r,ref:t})});GP.displayName=WP;function KP(e){return e?`open`:`closed`}var qP=OP,JP=MP,YP=IP,XP=RP,ZP=GP,QP=e(n(((e,t)=>{(function(){var n=this,r={};e===void 0?n.fuzzy=r:t.exports=r,r.simpleFilter=function(e,t){return t.filter(function(t){return r.test(e,t)})},r.test=function(e,t){return r.match(e,t)!==null},r.match=function(e,t,n){n||={};var r=0,i=[],a=t.length,o=0,s=0,c=n.pre||``,l=n.post||``,u=n.caseSensitive&&t||t.toLowerCase(),d;e=n.caseSensitive&&e||e.toLowerCase();for(var f=0;f<a;f++)d=t[f],u[f]===e[r]?(d=c+d+l,r+=1,s+=1+s):s=0,o+=s,i[i.length]=d;return r===e.length?(o=u===e?1/0:o,{rendered:i.join(``),score:o}):null},r.filter=function(e,t,n){return!t||t.length===0?[]:typeof e==`string`?(n||={},t.reduce(function(t,i,a,o){var s=i;n.extract&&(s=n.extract(i));var c=r.match(e,s,n);return c!=null&&(t[t.length]={string:c.rendered,score:c.score,index:a,original:i}),t},[]).sort(function(e,t){return t.score-e.score||e.index-t.index})):t}})()}))(),1),$P=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},eF=e=>e?$P(e):$P,tF=n((e=>{var t=i();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),nF=n(((e,t)=>{t.exports=tF()})),rF=n((e=>{var t=i(),n=nF();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:r,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),iF=e(n(((e,t)=>{t.exports=rF()}))(),1),{useDebugValue:aF}=u.default,{useSyncExternalStoreWithSelector:oF}=iF.default,sF=e=>e;function cF(e,t=sF,n){let r=oF(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return aF(r),r}var lF=e=>{let t=typeof e==`function`?eF(e):e,n=(e,n)=>cF(t,e,n);return Object.assign(n,t),n},uF=e=>e?lF(e):lF,dF,fF=typeof window<`u`&&((dF=window.document)!=null&&dF.createElement||window.navigator?.product===`ReactNative`)?u.useLayoutEffect:u.useEffect;function pF(){let e=uF(e=>({current:[],version:0,set:e}));return{In:({children:t})=>{let n=e(e=>e.set),r=e(e=>e.version);return fF(()=>{n(e=>({version:e.version+1}))},[]),fF(()=>(n(({current:e})=>({current:[...e,t]})),()=>n(({current:e})=>({current:e.filter(e=>e!==t)}))),[t,r]),null},Out:()=>{let t=e(e=>e.current);return u.createElement(u.Fragment,null,t)}}}function mF(){return mF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mF.apply(null,arguments)}function hF(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function gF(e,t=[]){let n=[];function r(t,r){let i=(0,u.createContext)(r),a=n.length;n=[...n,r];function o(t){let{scope:n,children:r,...o}=t,s=n?.[e][a]||i,c=(0,u.useMemo)(()=>o,Object.values(o));return(0,u.createElement)(s.Provider,{value:c},r)}function s(n,o){let s=o?.[e][a]||i,c=(0,u.useContext)(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return o.displayName=t+`Provider`,[o,s]}let i=()=>{let t=n.map(e=>(0,u.createContext)(e));return function(n){let r=n?.[e]||t;return(0,u.useMemo)(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,_F(i,...t)]}function _F(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return(0,u.useMemo)(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function vF(e,t){typeof e==`function`?e(t):e!=null&&(e.current=t)}function yF(...e){return t=>e.forEach(e=>vF(e,t))}function bF(...e){return(0,u.useCallback)(yF(...e),e)}var xF=(0,u.forwardRef)((e,t)=>{let{children:n,...r}=e,i=u.Children.toArray(n),a=i.find(wF);if(a){let e=a.props.children,n=i.map(t=>t===a?u.Children.count(e)>1?u.Children.only(null):(0,u.isValidElement)(e)?e.props.children:null:t);return(0,u.createElement)(SF,mF({},r,{ref:t}),(0,u.isValidElement)(e)?(0,u.cloneElement)(e,void 0,n):null)}return(0,u.createElement)(SF,mF({},r,{ref:t}),n)});xF.displayName=`Slot`;var SF=(0,u.forwardRef)((e,t)=>{let{children:n,...r}=e;return(0,u.isValidElement)(n)?(0,u.cloneElement)(n,{...TF(r,n.props),ref:yF(t,n.ref)}):u.Children.count(n)>1?u.Children.only(null):null});SF.displayName=`SlotClone`;var CF=({children:e})=>(0,u.createElement)(u.Fragment,null,e);function wF(e){return(0,u.isValidElement)(e)&&e.type===CF}function TF(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{a(...e),i(...e)}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function EF(e){let t=e+`CollectionProvider`,[n,r]=gF(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=u.useRef(null),a=u.useRef(new Map).current;return u.createElement(i,{scope:t,itemMap:a,collectionRef:r},n)},s=e+`CollectionSlot`,c=u.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=bF(t,a(s,n).collectionRef);return u.createElement(xF,{ref:i},r)}),l=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=u.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=u.useRef(null),s=bF(t,o),c=a(l,n);return u.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),u.createElement(xF,{[d]:``,ref:s},r)});function p(t){let n=a(e+`CollectionConsumer`,t);return u.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:c,ItemSlot:f},p,r]}var DF=globalThis!=null&&globalThis.document?u.useLayoutEffect:()=>{},OF=u.useId||(()=>void 0),kF=0;function AF(e){let[t,n]=u.useState(OF());return DF(()=>{e||n(e=>e??String(kF++))},[e]),e||(t?`radix-${t}`:``)}var jF=[`a`,`button`,`div`,`h2`,`h3`,`img`,`label`,`li`,`nav`,`ol`,`p`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=(0,u.forwardRef)((e,n)=>{let{asChild:r,...i}=e,a=r?xF:t;return(0,u.useEffect)(()=>{window[Symbol.for(`radix-ui`)]=!0},[]),(0,u.createElement)(a,mF({},i,{ref:n}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function MF(e){let t=(0,u.useRef)(e);return(0,u.useEffect)(()=>{t.current=e}),(0,u.useMemo)(()=>(...e)=>t.current?.call(t,...e),[])}function NF({prop:e,defaultProp:t,onChange:n=()=>{}}){let[r,i]=PF({defaultProp:t,onChange:n}),a=e!==void 0,o=a?e:r,s=MF(n);return[o,(0,u.useCallback)(t=>{if(a){let n=typeof t==`function`?t(e):t;n!==e&&s(n)}else i(t)},[a,e,i,s])]}function PF({defaultProp:e,onChange:t}){let n=(0,u.useState)(e),[r]=n,i=(0,u.useRef)(r),a=MF(t);return(0,u.useEffect)(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}var FF=(0,u.createContext)(void 0);function IF(e){let t=(0,u.useContext)(FF);return e||t||`ltr`}var LF=`rovingFocusGroup.onEntryFocus`,RF={bubbles:!1,cancelable:!0},zF=`RovingFocusGroup`,[BF,VF,HF]=EF(zF),[UF,WF]=gF(zF,[HF]),[GF,KF]=UF(zF),qF=(0,u.forwardRef)((e,t)=>(0,u.createElement)(BF.Provider,{scope:e.__scopeRovingFocusGroup},(0,u.createElement)(BF.Slot,{scope:e.__scopeRovingFocusGroup},(0,u.createElement)(JF,mF({},e,{ref:t}))))),JF=(0,u.forwardRef)((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,...d}=e,f=(0,u.useRef)(null),p=bF(t,f),m=IF(a),[h=null,g]=NF({prop:o,defaultProp:s,onChange:c}),[_,v]=(0,u.useState)(!1),y=MF(l),b=VF(n),x=(0,u.useRef)(!1),[S,C]=(0,u.useState)(0);return(0,u.useEffect)(()=>{let e=f.current;if(e)return e.addEventListener(LF,y),()=>e.removeEventListener(LF,y)},[y]),(0,u.createElement)(GF,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:(0,u.useCallback)(e=>g(e),[g]),onItemShiftTab:(0,u.useCallback)(()=>v(!0),[]),onFocusableItemAdd:(0,u.useCallback)(()=>C(e=>e+1),[]),onFocusableItemRemove:(0,u.useCallback)(()=>C(e=>e-1),[])},(0,u.createElement)(jF.div,mF({tabIndex:_||S===0?-1:0,"data-orientation":r},d,{ref:p,style:{outline:`none`,...e.style},onMouseDown:hF(e.onMouseDown,()=>{x.current=!0}),onFocus:hF(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(LF,RF);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);eI([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current))}}x.current=!1}),onBlur:hF(e.onBlur,()=>v(!1))})))}),YF=`RovingFocusGroupItem`,XF=(0,u.forwardRef)((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,...o}=e,s=AF(),c=a||s,l=KF(YF,n),d=l.currentTabStopId===c,f=VF(n),{onFocusableItemAdd:p,onFocusableItemRemove:m}=l;return(0,u.useEffect)(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,u.createElement)(BF.ItemSlot,{scope:n,id:c,focusable:r,active:i},(0,u.createElement)(jF.span,mF({tabIndex:d?0:-1,"data-orientation":l.orientation},o,{ref:t,onMouseDown:hF(e.onMouseDown,e=>{r?l.onItemFocus(c):e.preventDefault()}),onFocus:hF(e.onFocus,()=>l.onItemFocus(c)),onKeyDown:hF(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){l.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=$F(e,l.orientation,l.dir);if(t!==void 0){e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=l.loop?tI(n,r+1):n.slice(r+1)}setTimeout(()=>eI(n))}})})))}),ZF={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function QF(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function $F(e,t,n){let r=QF(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return ZF[r]}function eI(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function tI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var nI=qF,rI=XF;function iI(e,t){return(0,u.useReducer)((e,n)=>t[e][n]??e,e)}var aI=e=>{let{present:t,children:n}=e,r=oI(t),i=typeof n==`function`?n({present:r.isPresent}):u.Children.only(n),a=bF(r.ref,i.ref);return typeof n==`function`||r.isPresent?(0,u.cloneElement)(i,{ref:a}):null};aI.displayName=`Presence`;function oI(e){let[t,n]=(0,u.useState)(),r=(0,u.useRef)({}),i=(0,u.useRef)(e),a=(0,u.useRef)(`none`),[o,s]=iI(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return(0,u.useEffect)(()=>{let e=sI(r.current);a.current=o===`mounted`?e:`none`},[o]),DF(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=sI(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),DF(()=>{if(t){let e=e=>{let n=sI(r.current).includes(e.animationName);e.target===t&&n&&(0,mk.flushSync)(()=>s(`ANIMATION_END`))},n=e=>{e.target===t&&(a.current=sI(r.current))};return t.addEventListener(`animationstart`,n),t.addEventListener(`animationcancel`,e),t.addEventListener(`animationend`,e),()=>{t.removeEventListener(`animationstart`,n),t.removeEventListener(`animationcancel`,e),t.removeEventListener(`animationend`,e)}}s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:(0,u.useCallback)(e=>{e&&(r.current=getComputedStyle(e)),n(e)},[])}}function sI(e){return e?.animationName||`none`}var cI=`Tabs`,[lI,uI]=gF(cI,[WF]),dI=WF(),[fI,pI]=lI(cI),mI=(0,u.forwardRef)((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,d=IF(s),[f,p]=NF({prop:r,onChange:i,defaultProp:a});return(0,u.createElement)(fI,{scope:n,baseId:AF(),value:f,onValueChange:p,orientation:o,dir:d,activationMode:c},(0,u.createElement)(jF.div,mF({dir:d,"data-orientation":o},l,{ref:t})))}),hI=`TabsList`,gI=(0,u.forwardRef)((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=pI(hI,n),o=dI(n);return(0,u.createElement)(nI,mF({asChild:!0},o,{orientation:a.orientation,dir:a.dir,loop:r}),(0,u.createElement)(jF.div,mF({role:`tablist`,"aria-orientation":a.orientation},i,{ref:t})))}),_I=`TabsTrigger`,vI=(0,u.forwardRef)((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=pI(_I,n),s=dI(n),c=xI(o.baseId,r),l=SI(o.baseId,r),d=r===o.value;return(0,u.createElement)(rI,mF({asChild:!0},s,{focusable:!i,active:d}),(0,u.createElement)(jF.button,mF({type:`button`,role:`tab`,"aria-selected":d,"aria-controls":l,"data-state":d?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c},a,{ref:t,onMouseDown:hF(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:hF(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:hF(e.onFocus,()=>{let e=o.activationMode!==`manual`;!d&&!i&&e&&o.onValueChange(r)})})))}),yI=`TabsContent`,bI=(0,u.forwardRef)((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=pI(yI,n),c=xI(s.baseId,r),l=SI(s.baseId,r),d=r===s.value,f=(0,u.useRef)(d);return(0,u.useEffect)(()=>{let e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,u.createElement)(aI,{present:i||d},({present:n})=>(0,u.createElement)(jF.div,mF({"data-state":d?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0},o,{ref:t,style:{...e.style,animationDuration:f.current?`0s`:void 0}}),n&&a))});function xI(e,t){return`${e}-trigger-${t}`}function SI(e,t){return`${e}-content-${t}`}var CI=mI,wI=gI,TI=vI,EI=bI,DI=e(n(((e,t)=>{var n=NaN,r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt,c=typeof global==`object`&&global&&global.Object===Object&&global,l=typeof self==`object`&&self&&self.Object===Object&&self,u=c||l||Function(`return this`)(),d=Object.prototype.toString,f=Math.max,p=Math.min,m=function(){return u.Date.now()};function h(e,t,n){var r,i,a,o,s,c,l=0,u=!1,d=!1,h=!0;if(typeof e!=`function`)throw TypeError(`Expected a function`);t=y(t)||0,g(n)&&(u=!!n.leading,d=`maxWait`in n,a=d?f(y(n.maxWait)||0,t):a,h=`trailing`in n?!!n.trailing:h);function _(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function v(e){return l=e,s=setTimeout(S,t),u?_(e):o}function b(e){var n=e-c,r=e-l,i=t-n;return d?p(i,a-r):i}function x(e){var n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function S(){var e=m();if(x(e))return C(e);s=setTimeout(S,b(e))}function C(e){return s=void 0,h&&r?_(e):(r=i=void 0,o)}function w(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function T(){return s===void 0?o:C(m())}function E(){var e=m(),n=x(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return v(c);if(d)return s=setTimeout(S,t),_(c)}return s===void 0&&(s=setTimeout(S,t)),o}return E.cancel=w,E.flush=T,E}function g(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function _(e){return!!e&&typeof e==`object`}function v(e){return typeof e==`symbol`||_(e)&&d.call(e)==`[object Symbol]`}function y(e){if(typeof e==`number`)return e;if(v(e))return n;if(g(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=g(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=e.replace(r,``);var c=a.test(e);return c||o.test(e)?s(e.slice(2),c?2:8):i.test(e)?n:+e}t.exports=h}))(),1);function OI(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}OI({},`LaserPointer`,()=>UI);function kI([e,t,n],[r,i,a]){return[e+r,t+i,n+a]}function AI([e,t,n],[r,i,a]){return[e-r,t-i,n-a]}function jI([e,t,n],r){return[e*r,t*r,n*r]}function MI([e,t,n]){return[e/Math.sqrt(e**2+t**2),t/Math.sqrt(e**2+t**2),n]}function NI([e,t,n],r){return[Math.cos(r)*e-Math.sin(r)*t,Math.sin(r)*e+Math.cos(r)*t,n]}function PI(e,t,n){return kI(e,jI(AI(t,e),n))}function FI(e,t,n){return Math.atan2(n[1]-e[1],n[0]-e[0])-Math.atan2(t[1]-e[1],t[0]-e[0])}function II(e){return Math.atan2(Math.sin(e),Math.cos(e))}function LI([e,t]){return Math.sqrt(e**2+t**2)}function RI([e,t],[n,r]){return Math.sqrt((n-e)**2+(r-t)**2)}function zI(e){if(e.length<2)return 0;let t=0;for(let n=1;n<=e.length-1;n++)t+=RI(e[n-1],e[n]);return t+=RI(e[e.length-2],e[e.length-1]),t}var BI=(e,t,n)=>Math.max(t,Math.min(n,e));function VI(e,t,n){let r=RI(t,n);if(r===0)return RI(e,t);let i=BI(((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r**2,0,1);return RI([t[0]+i*(n[0]-t[0]),t[1]+i*(n[1]-t[1]),e[2]],e)}function HI(e,t){if(t===0||e.length<=2)return e;let n=e[0],r=e[e.length-1],[i,a]=e.reduce(([e,t],i,a)=>{let o=VI(i,n,r);return o>e?[o,a]:[e,t]},[0,-1]);if(i>=t){let i=e[a];return[...HI([n,...e.slice(1,a),i],t).slice(0,-1),i,...HI([i,...e.slice(a,-1),r],t).slice(1)]}return[n,r]}var UI=class e{static{this.defaults={size:2,streamline:.45,simplify:.1,simplifyPhase:`output`,keepHead:!1,sizeMapping:()=>1}}static{this.constants={cornerDetectionMaxAngle:75,cornerDetectionVariance:e=>e>35?.5:1,maxTailLength:50}}constructor(t){this.originalPoints=[],this.stablePoints=[],this.tailPoints=[],this.isFresh=!0,this.options=Object.assign({},e.defaults,t)}get lastPoint(){return this.tailPoints[this.tailPoints.length-1]??this.stablePoints[this.stablePoints.length-1]}addPoint(t){let n=this.originalPoints[this.originalPoints.length-1];if(!(n&&n[0]===t[0]&&n[1]===t[1])){if(this.originalPoints.push(t),this.isFresh){this.isFresh=!1,this.stablePoints.push(t);return}this.options.streamline>0&&(t=PI(this.lastPoint,t,1-this.options.streamline)),this.tailPoints.push(t),zI(this.tailPoints)>e.constants.maxTailLength&&this.stabilizeTail()}}close(){this.stabilizeTail()}stabilizeTail(){if(this.options.simplify>0&&this.options.simplifyPhase==`tail`)throw Error(`Not implemented yet`);this.stablePoints.push(...this.tailPoints),this.tailPoints=[]}getSize(e,t,n,r,i){return(e??this.options.size)*this.options.sizeMapping({pressure:t,runningLength:i,currentIndex:n,totalLength:r})}getStrokeOutline(t){if(this.isFresh)return[];let n=[...this.stablePoints,...this.tailPoints];this.options.simplify>0&&this.options.simplifyPhase===`input`&&(n=HI(n,this.options.simplify));let r=n.length;if(r===0)return[];if(r===1){let e=n[0],i=this.getSize(t,e[2],0,r,0);if(i<.5)return[];let a=[];for(let t=0;t<=Math.PI*2;t+=Math.PI/16)a.push(kI(e,jI(NI([1,0,0],t),i)));return a.push(kI(e,jI([1,0,0],this.getSize(t,e[2],0,r,0)))),a}if(r===2){let e=n[0],i=n[1],a=this.getSize(t,e[2],0,r,0),o=this.getSize(t,i[2],0,r,0);if(a<.5||o<.5)return[];let s=[],c=FI(e,[e[0],e[1]-100,e[2]],i);for(let t=c;t<=Math.PI+c;t+=Math.PI/16)s.push(kI(e,jI(NI([1,0,0],t),a)));for(let e=Math.PI+c;e<=Math.PI*2+c;e+=Math.PI/16)s.push(kI(i,jI(NI([1,0,0],e),o)));return s.push(s[0]),s}let i=[],a=[],o=0,s=0,c=0,l=0;for(let u=1;u<r-1;u++){let d=n[u-1],f=n[u],p=n[u+1],m=f[2],h=RI(d,f);l+=h,o=s+(h-s)*.2;let g=this.getSize(t,m,u,r,l);if(g===0){c=u+1;continue}let _=MI(AI(d,f)),v=MI(AI(p,f)),y=NI(_,Math.PI/2),b=NI(_,-Math.PI/2),x=NI(v,Math.PI/2),S=NI(v,-Math.PI/2),C=kI(f,jI(y,g)),w=kI(f,jI(b,g)),T=kI(f,jI(x,g)),E=kI(f,jI(S,g)),D=kI(y,S),ee=kI(b,x),te=kI(f,jI(LI(D)===0?_:MI(D),g)),ne=kI(f,jI(LI(ee)===0?v:MI(ee),g)),re=II(FI(f,d,p)),ie=e.constants.cornerDetectionMaxAngle/180*Math.PI*e.constants.cornerDetectionVariance(o);if(Math.abs(re)<ie){let e=Math.abs(II(Math.PI-re));if(e===0)continue;if(re<0){a.push(w,ne);for(let t=0;t<=e;t+=e/4)i.push(kI(f,NI(jI(y,g),t)));for(let t=e;t>=0;t-=e/4)a.push(kI(f,NI(jI(y,g),t)));a.push(ne,T)}else{i.push(C,te);for(let t=0;t<=e;t+=e/4)a.push(kI(f,NI(jI(y,-g),-t)));for(let t=e;t>=0;t-=e/4)i.push(kI(f,NI(jI(y,-g),-t)));i.push(te,E)}}else i.push(te),a.push(ne);s=o}if(c>=r-2){if(this.options.keepHead){let e=n[r-1],t=[];for(let n=0;n<=Math.PI*2;n+=Math.PI/16)t.push(kI(e,jI(NI([1,0,0],n),this.options.size)));return t.push(kI(e,jI([1,0,0],this.options.size))),t}return[]}let u=n[c],d=n[c+1],f=n[r-2],p=n[r-1],m=MI(AI(d,u)),h=MI(AI(f,p)),g=NI(m,-Math.PI/2),_=NI(h,Math.PI/2),v=this.getSize(t,u[2],0,r,0),y=[],b=this.options.keepHead?this.options.size:this.getSize(t,f[2],r-2,r,l),x=[];if(v>1){for(let e=0;e<=Math.PI;e+=Math.PI/16)y.unshift(kI(u,NI(jI(g,v),-e)));y.unshift(kI(u,jI(g,-v)))}else y.push(u);for(let e=0;e<=Math.PI*3;e+=Math.PI/16)x.push(kI(p,NI(jI(_,-b),-e)));let S=[...y,...i,...x.reverse(),...a.reverse()];return y.length>0&&S.push(y[0]),this.options.simplify>0&&this.options.simplifyPhase===`output`?HI(S,this.options.simplify):S}},WI=dk(),{useAtom:GI,useSetAtom:KI,useAtomValue:qI,useStore:JI}=WI,YI=WI.Provider,XI=JO(),ZI=g({"./locales/ar-SA.json":()=>A(()=>import(`./ar-SA-G6X2FPQ2-B6obDqD5.js`),[],import.meta.url),"./locales/az-AZ.json":()=>A(()=>import(`./az-AZ-76LH7QW2-CfV9ZZWy.js`),[],import.meta.url),"./locales/bg-BG.json":()=>A(()=>import(`./bg-BG-XCXSNQG7-DUA8YPCl.js`),[],import.meta.url),"./locales/bn-BD.json":()=>A(()=>import(`./bn-BD-2XOGV67Q-DvE_tajm.js`),[],import.meta.url),"./locales/ca-ES.json":()=>A(()=>import(`./ca-ES-6MX7JW3Y-DHdtT9lh.js`),[],import.meta.url),"./locales/cs-CZ.json":()=>A(()=>import(`./cs-CZ-2BRQDIVT-BamYs5wC.js`),[],import.meta.url),"./locales/da-DK.json":()=>A(()=>import(`./da-DK-5WZEPLOC-B8baJSus.js`),[],import.meta.url),"./locales/de-DE.json":()=>A(()=>import(`./de-DE-XR44H4JA-DKPtPOlk.js`),[],import.meta.url),"./locales/el-GR.json":()=>A(()=>import(`./el-GR-BZB4AONW-FSgeiYUW.js`),[],import.meta.url),"./locales/en.json":()=>A(()=>import(`./en-B4ZKOASM-BAWBMIE-.js`),[],import.meta.url),"./locales/es-ES.json":()=>A(()=>import(`./es-ES-U4NZUMDT-CZ9XqqCk.js`),[],import.meta.url),"./locales/eu-ES.json":()=>A(()=>import(`./eu-ES-A7QVB2H4-CNagAo_o.js`),[],import.meta.url),"./locales/fa-IR.json":()=>A(()=>import(`./fa-IR-HGAKTJCU-CGpX3K56.js`),[],import.meta.url),"./locales/fi-FI.json":()=>A(()=>import(`./fi-FI-Z5N7JZ37-D8ErPXQZ.js`),[],import.meta.url),"./locales/fr-FR.json":()=>A(()=>import(`./fr-FR-RHASNOE6-CgP9qmF-.js`),[],import.meta.url),"./locales/gl-ES.json":()=>A(()=>import(`./gl-ES-HMX3MZ6V-D64w31ga.js`),[],import.meta.url),"./locales/he-IL.json":()=>A(()=>import(`./he-IL-6SHJWFNN-prTy1rRE.js`),[],import.meta.url),"./locales/hi-IN.json":()=>A(()=>import(`./hi-IN-IWLTKZ5I-uvdg8ovV.js`),[],import.meta.url),"./locales/hu-HU.json":()=>A(()=>import(`./hu-HU-A5ZG7DT2-OIhzhh7g.js`),[],import.meta.url),"./locales/id-ID.json":()=>A(()=>import(`./id-ID-SAP4L64H-Bs8DbFR5.js`),[],import.meta.url),"./locales/it-IT.json":()=>A(()=>import(`./it-IT-JPQ66NNP-CVy3c_Ht.js`),[],import.meta.url),"./locales/ja-JP.json":()=>A(()=>import(`./ja-JP-DBVTYXUO-EcX4mq4z.js`),[],import.meta.url),"./locales/kaa.json":()=>A(()=>import(`./kaa-6HZHGXH3-BwP9az-p.js`),[],import.meta.url),"./locales/kab-KAB.json":()=>A(()=>import(`./kab-KAB-ZGHBKWFO-By-AIEWs.js`),[],import.meta.url),"./locales/kk-KZ.json":()=>A(()=>import(`./kk-KZ-P5N5QNE5-DYNjxBd-.js`),[],import.meta.url),"./locales/km-KH.json":()=>A(()=>import(`./km-KH-HSX4SM5Z-DS2ZYG-3.js`),[],import.meta.url),"./locales/ko-KR.json":()=>A(()=>import(`./ko-KR-MTYHY66A-DOz4vl1z.js`),[],import.meta.url),"./locales/ku-TR.json":()=>A(()=>import(`./ku-TR-6OUDTVRD-CxEEWxJq.js`),[],import.meta.url),"./locales/lt-LT.json":()=>A(()=>import(`./lt-LT-XHIRWOB4-CkgB2O8i.js`),[],import.meta.url),"./locales/lv-LV.json":()=>A(()=>import(`./lv-LV-5QDEKY6T-BUDeq4Hb.js`),[],import.meta.url),"./locales/mr-IN.json":()=>A(()=>import(`./mr-IN-CRQNXWMA-DtuuryqC.js`),[],import.meta.url),"./locales/my-MM.json":()=>A(()=>import(`./my-MM-5M5IBNSE-CC79-XBH.js`),[],import.meta.url),"./locales/nb-NO.json":()=>A(()=>import(`./nb-NO-T6EIAALU-CKNIbK-0.js`),[],import.meta.url),"./locales/nl-NL.json":()=>A(()=>import(`./nl-NL-IS3SIHDZ-B3dYZhvS.js`),[],import.meta.url),"./locales/nn-NO.json":()=>A(()=>import(`./nn-NO-6E72VCQL-CdPrOnP4.js`),[],import.meta.url),"./locales/oc-FR.json":()=>A(()=>import(`./oc-FR-POXYY2M6-DUmzGjKc.js`),[],import.meta.url),"./locales/pa-IN.json":()=>A(()=>import(`./pa-IN-N4M65BXN-DH39ZTHj.js`),[],import.meta.url),"./locales/percentages.json":()=>A(()=>import(`./percentages-BXMCSKIN-d5p7s-wT.js`),[],import.meta.url),"./locales/pl-PL.json":()=>A(()=>import(`./pl-PL-T2D74RX3-BNYpL8df.js`),[],import.meta.url),"./locales/pt-BR.json":()=>A(()=>import(`./pt-BR-5N22H2LF-RWmGHl_8.js`),[],import.meta.url),"./locales/pt-PT.json":()=>A(()=>import(`./pt-PT-UZXXM6DQ-smq6YmTY.js`),[],import.meta.url),"./locales/ro-RO.json":()=>A(()=>import(`./ro-RO-JPDTUUEW-BOjKaxCz.js`),[],import.meta.url),"./locales/ru-RU.json":()=>A(()=>import(`./ru-RU-B4JR7IUQ-DOK2ZlyX.js`),[],import.meta.url),"./locales/si-LK.json":()=>A(()=>import(`./si-LK-N5RQ5JYF-BtKkEPfN.js`),[],import.meta.url),"./locales/sk-SK.json":()=>A(()=>import(`./sk-SK-C5VTKIMK-DehBWGkI.js`),[],import.meta.url),"./locales/sl-SI.json":()=>A(()=>import(`./sl-SI-NN7IZMDC-ClR46UYx.js`),[],import.meta.url),"./locales/sv-SE.json":()=>A(()=>import(`./sv-SE-XGPEYMSR-Cq54FLpH.js`),[],import.meta.url),"./locales/ta-IN.json":()=>A(()=>import(`./ta-IN-2NMHFXQM-SCh3n0lB.js`),[],import.meta.url),"./locales/th-TH.json":()=>A(()=>import(`./th-TH-HPSO5L25-BotlAjVv.js`),[],import.meta.url),"./locales/tr-TR.json":()=>A(()=>import(`./tr-TR-DEFEU3FU-B4u6Au2y.js`),[],import.meta.url),"./locales/uk-UA.json":()=>A(()=>import(`./uk-UA-QMV73CPH-CtQkKgv_.js`),[],import.meta.url),"./locales/vi-VN.json":()=>A(()=>import(`./vi-VN-M7AON7JQ-CjZyv0HH.js`),[],import.meta.url),"./locales/zh-CN.json":()=>A(()=>import(`./zh-CN-LNUGB5OW-DyyyDDxj.js`),[],import.meta.url),"./locales/zh-HK.json":()=>A(()=>import(`./zh-HK-E62DVLB3-Ch2pxiFR.js`),[],import.meta.url),"./locales/zh-TW.json":()=>A(()=>import(`./zh-TW-RAJ6MFWO-CSf1_B6H.js`),[],import.meta.url)}),QI=85,$I={code:`en`,label:`English`},eL=[$I,...[{code:`ar-SA`,label:`العربية`,rtl:!0},{code:`bg-BG`,label:`Български`},{code:`ca-ES`,label:`Català`},{code:`cs-CZ`,label:`Česky`},{code:`de-DE`,label:`Deutsch`},{code:`el-GR`,label:`Ελληνικά`},{code:`es-ES`,label:`Español`},{code:`eu-ES`,label:`Euskara`},{code:`fa-IR`,label:`فارسی`,rtl:!0},{code:`fi-FI`,label:`Suomi`},{code:`fr-FR`,label:`Français`},{code:`gl-ES`,label:`Galego`},{code:`he-IL`,label:`עברית`,rtl:!0},{code:`hi-IN`,label:`हिन्दी`},{code:`hu-HU`,label:`Magyar`},{code:`id-ID`,label:`Bahasa Indonesia`},{code:`it-IT`,label:`Italiano`},{code:`ja-JP`,label:`日本語`},{code:`kab-KAB`,label:`Taqbaylit`},{code:`kk-KZ`,label:`Қазақ тілі`},{code:`ko-KR`,label:`한국어`},{code:`ku-TR`,label:`Kurdî`},{code:`lt-LT`,label:`Lietuvių`},{code:`lv-LV`,label:`Latviešu`},{code:`my-MM`,label:`Burmese`},{code:`nb-NO`,label:`Norsk bokmål`},{code:`nl-NL`,label:`Nederlands`},{code:`nn-NO`,label:`Norsk nynorsk`},{code:`oc-FR`,label:`Occitan`},{code:`pa-IN`,label:`ਪੰਜਾਬੀ`},{code:`pl-PL`,label:`Polski`},{code:`pt-BR`,label:`Português Brasileiro`},{code:`pt-PT`,label:`Português`},{code:`ro-RO`,label:`Română`},{code:`ru-RU`,label:`Русский`},{code:`sk-SK`,label:`Slovenčina`},{code:`sv-SE`,label:`Svenska`},{code:`sl-SI`,label:`Slovenščina`},{code:`tr-TR`,label:`Türkçe`},{code:`uk-UA`,label:`Українська`},{code:`zh-CN`,label:`简体中文`},{code:`zh-TW`,label:`繁體中文`},{code:`vi-VN`,label:`Tiếng Việt`},{code:`mr-IN`,label:`मराठी`}].filter(e=>wO[e.code]>=QI).sort((e,t)=>e.label>t.label?1:-1)],tL=`__test__`;f.DEV&&eL.unshift({code:tL,label:`test language`},{code:`${tL}.rtl`,label:`test language (rtl)`,rtl:!0});var nL=$I,rL={},iL=async e=>{if(nL=e,document.documentElement.dir=nL.rtl?`rtl`:`ltr`,document.documentElement.lang=nL.code,e.code.startsWith(tL))rL={};else try{rL=await ZI(`./locales/${nL.code}.json`)}catch(t){console.error(`Failed to load language ${e.code}:`,t.message),rL=xO}XI.set(sL,e.code)},aL=()=>nL,oL=(e,t)=>{for(let n=0;n<t.length;++n){let r=t[n];if(e[r]===void 0)return;e=e[r]}if(typeof e==`string`)return e},q=(e,t,n)=>{if(nL.code.startsWith(tL))return`\u202A[[${t?`${e}(${JSON.stringify(t).slice(1,-1)})`:e}]]\u202C`;let r=e.split(`.`),i=oL(rL,r)||oL(xO,r)||n;if(i===void 0){let t=`Can't find translation for ${e}`;if(f.PROD)return console.warn(t),``;throw Error(t)}if(t)for(let e in t)i=i.replace(`{{${e}}}`,String(t[e]));return i},sL=EO($I.code),cL=()=>({t:q,langCode:qI(sL)}),lL=({size:e=`1em`,circleWidth:t=8,synchronized:n=!1,className:r=``})=>{let i=-(u.useRef(Date.now()).current%1600);return(0,k.jsx)(`div`,{className:`Spinner ${r}`,children:(0,k.jsx)(`svg`,{viewBox:`0 0 100 100`,style:{width:e,height:e,"--spinner-delay":n?`${i}ms`:0},children:(0,k.jsx)(`circle`,{cx:`50`,cy:`50`,r:50-t/2,strokeWidth:t,fill:`none`,strokeMiterlimit:`10`})})})},uL=({delay:e,theme:t})=>{let[n,r]=(0,u.useState)(!!e);return(0,u.useEffect)(()=>{if(!e)return;let t=setTimeout(()=>{r(!1)},e);return()=>clearTimeout(t)},[e]),n?null:(0,k.jsxs)(`div`,{className:O(`LoadingMessage`,{"LoadingMessage--dark":t===Qs.DARK}),children:[(0,k.jsx)(`div`,{children:(0,k.jsx)(lL,{})}),(0,k.jsx)(`div`,{className:`LoadingMessage-text`,children:q(`labels.loadingScene`)})]})},dL=e=>{let[t,n]=(0,u.useState)(!0);return(0,u.useEffect)(()=>{let t=async()=>{await iL(r),n(!1)},r=eL.find(t=>t.code===e.langCode)||$I;t()},[e.langCode]),t?(0,k.jsx)(uL,{theme:e.theme}):e.children},fL=u.forwardRef(({size:e=`medium`,visible:t=!0,className:n=``,...r},i)=>{let{id:a}=Yq(),o=u.useRef(null);u.useImperativeHandle(i,()=>o.current);let s=`ToolIcon_size_${e}`,[c,l]=(0,u.useState)(!1),d=(0,u.useRef)(!0),f=async e=>{let t=`onClick`in r&&r.onClick?.(e);if(Uu(t))try{l(!0),await t}catch(e){if(e instanceof yh)console.warn(e);else throw e}finally{d.current&&l(!1)}};(0,u.useEffect)(()=>(d.current=!0,()=>{d.current=!1}),[]);let p=(0,u.useRef)(null);if(r.type===`button`||r.type===`icon`||r.type===`submit`){let e=r.type===`icon`?`button`:r.type;return(0,k.jsxs)(`button`,{className:O(`ToolIcon_type_button`,s,n,t&&!r.hidden?`ToolIcon_type_button--show`:`ToolIcon_type_button--hide`,{ToolIcon:!r.hidden,"ToolIcon--selected":r.selected,"ToolIcon--plain":r.type===`icon`}),style:r.style,"data-testid":r[`data-testid`],hidden:r.hidden,title:r.title,"aria-label":r[`aria-label`],type:e,onClick:f,ref:o,disabled:c||r.isLoading||!!r.disabled,children:[(r.icon||r.label)&&(0,k.jsxs)(`div`,{className:`ToolIcon__icon`,"aria-hidden":`true`,"aria-disabled":!!r.disabled,children:[r.icon||r.label,r.keyBindingLabel&&(0,k.jsx)(`span`,{className:`ToolIcon__keybinding`,children:r.keyBindingLabel}),r.isLoading&&(0,k.jsx)(lL,{})]}),r.showAriaLabel&&(0,k.jsxs)(`div`,{className:`ToolIcon__label`,children:[r[`aria-label`],` `,c&&(0,k.jsx)(lL,{})]}),r.children]})}return(0,k.jsxs)(`label`,{className:O(`ToolIcon`,n),title:r.title,onPointerDown:e=>{p.current=e.pointerType||null,r.onPointerDown?.({pointerType:e.pointerType||null})},onPointerUp:()=>{requestAnimationFrame(()=>{p.current=null})},children:[(0,k.jsx)(`input`,{className:`ToolIcon_type_radio ${s}`,type:`radio`,name:r.name,"aria-label":r[`aria-label`],"aria-keyshortcuts":r[`aria-keyshortcuts`],"data-testid":r[`data-testid`],id:`${a}-${r.id}`,onChange:()=>{r.onChange?.({pointerType:p.current})},checked:r.checked,ref:o}),(0,k.jsxs)(`div`,{className:`ToolIcon__icon`,children:[r.icon,r.keyBindingLabel&&(0,k.jsx)(`span`,{className:`ToolIcon__keybinding`,children:r.keyBindingLabel})]})]})});fL.displayName=`ToolButton`;var pL=(e,t,n)=>{let r=new Set(YT(e.filter(e=>gd(e)),t).map(e=>e.id)),i={},a=n.scene.getNonDeletedElementsMap(),o=new Set;for(let t of r){let n=wT(e,t);for(let e of n)if(!o.has(e.id)){if(Ad(e)){let t=Bb(e,a);t&&(i[t.id]=!0)}else i[e.id]=!0;o.add(e.id)}}let s=!0,c=e.map(e=>{if(t.selectedElementIds[e.id]){let t=Ad(e)?Bb(e,a):null;return e.frameId&&r.has(e.frameId)?(s=!1,i[e.id]=!0,e):t?.frameId&&r.has(t?.frameId)?e:(e.boundElements&&e.boundElements.forEach(t=>{let r=n.scene.getNonDeletedElementsMap().get(t.id);r&&z(r)&&(K(r,{startBinding:e.id===r.startBinding?.elementId?null:r.startBinding,endBinding:e.id===r.endBinding?.elementId?null:r.endBinding}),K(r,{points:r.points}))}),iE(e,{isDeleted:!0}))}return e.frameId&&r.has(e.frameId)?(s=!1,Ad(e)||(i[e.id]=!0),iE(e,{frameId:null})):Ad(e)&&t.selectedElementIds[e.containerId]?iE(e,{isDeleted:!0}):e}),l=t.editingGroupId;if(s&&t.editingGroupId){let e=qy(c,t.editingGroupId).filter(e=>!e.isDeleted);if(e.length>1)e[0]&&(i[e[0].id]=!0);else{l=null,e[0]&&(i[e[0].id]=!0);let n=e[0];if(n){let e=n.groupIds.findIndex(e=>e===t.editingGroupId),r=n.groupIds[e+1];if(r){let e=qy(c,r).filter(e=>!e.isDeleted);e.length>1&&(l=r,e.forEach(e=>{i[e.id]=!0}))}}}}return{elements:c,appState:{...t,...By({selectedElementIds:i,editingGroupId:l},c,t,null)}}},mL=(e,t)=>{if(e.editingGroupId){let n=qy(eD(t),e.editingGroupId);if(n.length)return{...e,selectedElementIds:{[n[0].id]:!0}}}return e},hL=W({name:`deleteSelectedElements`,label:`labels.delete`,icon:Kf,trackEvent:{category:`element`,action:`delete`},perform:(e,t,n,r)=>{if(t.editingLinearElement){let{elementId:n,selectedPointsIndices:i,startBindingElement:a,endBindingElement:o}=t.editingLinearElement,s=r.scene.getNonDeletedElementsMap(),c=U.getElement(n,s);if(!c||i==null)return!1;if(c.points.length<2){let n=e.map(e=>e.id===c.id?iE(e,{isDeleted:!0}):e);return{elements:n,appState:{...mL(t,n),editingLinearElement:null},captureUpdate:G.IMMEDIATELY}}let l={startBindingElement:i?.includes(0)?null:a,endBindingElement:i?.includes(c.points.length-1)?null:o};return U.deletePoints(c,i),{elements:e,appState:{...t,editingLinearElement:{...t.editingLinearElement,...l,selectedPointsIndices:i?.[0]>0?[i[0]-1]:[0]}},captureUpdate:G.IMMEDIATELY}}let{elements:i,appState:a}=pL(e,t,r);return vy(i,i.filter(e=>e.isDeleted)),a=mL(a,i),{elements:i,appState:{...a,activeTool:gu(t,{type:`selection`}),multiElement:null,activeEmbeddable:null},captureUpdate:qT(eD(e),t)?G.IMMEDIATELY:G.EVENTUALLY}},keyTest:(e,t,n)=>(e.key===H.BACKSPACE||e.key===H.DELETE)&&!e[H.CTRL_OR_CMD],PanelComponent:({elements:e,appState:t,updateData:n})=>(0,k.jsx)(fL,{type:`button`,icon:Kf,title:q(`labels.delete`),"aria-label":q(`labels.delete`),onClick:()=>n(null),visible:qT(eD(e),t)})}),gL=(e,t)=>e.frameId===t||e.id===t,_L=(e,t,n)=>{let r=[],i=[],a=null,o=-1,s=Nu(n||YT(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0}));for(;++o<e.length;){let t=e[o];s.get(t.id)?(i.length&&(r=r.concat(i),i=[]),r.push(o),a=o+1):t.isDeleted&&a===o?(a=o+1,i.push(o)):i=[]}return r},vL=e=>{let t=0;return e.reduce((n,r,i)=>(i>0&&e[i-1]!==r-1&&(t=++t),(n[t]||(n[t]=[])).push(r),n),[])},yL=(e,t,n)=>{if(`containerId`in e&&e.containerId){let r=rE.getScene(e).getElement(e.containerId);if(r)return n===`left`?Math.min(t.indexOf(r),t.indexOf(e)):Math.max(t.indexOf(r),t.indexOf(e))}else{let r=e.boundElements?.find(e=>e.type!==`arrow`)?.id;if(r){let i=rE.getScene(e).getElement(r);if(i)return n===`left`?Math.min(t.indexOf(i),t.indexOf(e)):Math.max(t.indexOf(i),t.indexOf(e))}}},bL=(e,t)=>{let n=-1,r=-1;return e.forEach((e,i)=>{gL(e,t)&&(n===-1&&(n=i),r=i)}),n===-1?[]:e.slice(n,r+1)},xL=(e,t,n,r,i)=>{let a=t[n],o=t=>t.isDeleted?!1:i?t.frameId===i:!e.editingGroupId||t.groupIds.includes(e.editingGroupId),s=r===`left`?Tu(t,e=>o(e),Math.max(0,n-1)):wu(t,e=>o(e),n+1),c=t[s];if(!c)return-1;if(e.editingGroupId){if(a?.groupIds.join(``)===c?.groupIds.join(``))return yL(c,t,r)??s;if(!c?.groupIds.includes(e.editingGroupId))return-1}if(!i&&(c.frameId||gd(c))){let e=bL(t,c.frameId||c.id);return r===`left`?t.indexOf(e[0]):t.indexOf(e[e.length-1])}if(!c.groupIds.length)return yL(c,t,r)??s;let l=qy(t,e.editingGroupId?c.groupIds[c.groupIds.indexOf(e.editingGroupId)-1]:c.groupIds[c.groupIds.length-1]);return l.length?r===`left`?t.indexOf(l[0]):t.indexOf(l[l.length-1]):s},SL=(e,t)=>t.reduce((t,n)=>{let r=e[n];return t.set(r.id,r),t},new Map),CL=(e,t,n)=>{let r=_L(e,t),i=SL(e,r),a=vL(r);n===`right`&&(a=a.reverse());let o=new Set(r.filter(t=>gd(e[t])).map(t=>e[t].id));return a.forEach((r,i)=>{let a=r[0],s=r[r.length-1],c=n===`left`?a:s,l=r.some(t=>{let n=e[t];return n.frameId&&o.has(n.frameId)})?null:e[c]?.frameId,u=xL(t,e,c,n,l);if(u===-1||c===u)return;let d=n===`left`?e.slice(0,u):e.slice(0,a),f=e.slice(a,s+1),p=n===`left`?e.slice(u,a):e.slice(s+1,u+1),m=n===`left`?e.slice(s+1):e.slice(u+1);e=n===`left`?[...d,...f,...p,...m]:[...d,...p,...f,...m]}),Bx(e,i),e},wL=(e,t,n,r,i)=>{let a=_L(e,t,i),o=SL(e,a),s=[],c,l;if(n===`left`){if(r)c=wu(e,e=>gL(e,r));else if(t.editingGroupId){let n=qy(e,t.editingGroupId);if(!n.length)return e;c=e.indexOf(n[0])}else c=0;l=a[a.length-1]}else{if(r)l=Tu(e,e=>gL(e,r));else if(t.editingGroupId){let n=qy(e,t.editingGroupId);if(!n.length)return e;l=e.indexOf(n[n.length-1])}else l=e.length-1;c=a[0]}c===-1&&(c=0);for(let t=c;t<l+1;t++)a.includes(t)||s.push(e[t]);let u=Array.from(o.values()),d=e.slice(0,c),f=e.slice(l+1),p=n===`left`?[...d,...u,...s,...f]:[...d,...s,...u,...f];return Bx(p,o),p};function TL(e,t,n,r){let i=Nu(YT(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0})),a={regularElements:[],frameChildren:new Map},o=new Set;for(let t of e)i.has(t.id)&&gd(t)&&o.add(t.id);for(let t of e)if(i.has(t.id)){if(gd(t)||t.frameId&&o.has(t.frameId))a.regularElements.push(t);else if(!t.frameId)a.regularElements.push(t);else{let e=a.frameChildren.get(t.frameId)||[];e.push(t),a.frameChildren.set(t.frameId,e)}}let s=e,c=Array.from(a.frameChildren.entries());for(let[i,a]of c)s=r(e,t,n,i,a);return r(s,t,n,null,a.regularElements)}var EL=(e,t)=>CL(e,t,`left`),DL=(e,t)=>CL(e,t,`right`),OL=(e,t)=>TL(e,t,`left`,wL),kL=(e,t)=>TL(e,t,`right`,wL),AL=W({name:`sendBackward`,label:`labels.sendBackward`,keywords:[`move down`,`zindex`,`layer`],icon:xp,trackEvent:{category:`element`},perform:(e,t)=>({elements:EL(e,t),appState:t,captureUpdate:G.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[H.CTRL_OR_CMD]&&!e.shiftKey&&e.code===kg.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>(0,k.jsx)(`button`,{type:`button`,className:`zIndexButton`,onClick:()=>e(null),title:`${q(`labels.sendBackward`)} \u2014 ${L(`CtrlOrCmd+[`)}`,children:xp})}),jL=W({name:`bringForward`,label:`labels.bringForward`,keywords:[`move up`,`zindex`,`layer`],icon:bp,trackEvent:{category:`element`},perform:(e,t)=>({elements:DL(e,t),appState:t,captureUpdate:G.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[H.CTRL_OR_CMD]&&!e.shiftKey&&e.code===kg.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>(0,k.jsx)(`button`,{type:`button`,className:`zIndexButton`,onClick:()=>e(null),title:`${q(`labels.bringForward`)} \u2014 ${L(`CtrlOrCmd+]`)}`,children:bp})}),ML=W({name:`sendToBack`,label:`labels.sendToBack`,keywords:[`move down`,`zindex`,`layer`],icon:Cp,trackEvent:{category:`element`},perform:(e,t)=>({elements:OL(e,t),appState:t,captureUpdate:G.IMMEDIATELY}),keyTest:e=>As?e[H.CTRL_OR_CMD]&&e.altKey&&e.code===kg.BRACKET_LEFT:e[H.CTRL_OR_CMD]&&e.shiftKey&&e.code===kg.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>(0,k.jsx)(`button`,{type:`button`,className:`zIndexButton`,onClick:()=>e(null),title:`${q(`labels.sendToBack`)} \u2014 ${L(As?`CtrlOrCmd+Alt+[`:`CtrlOrCmd+Shift+[`)}`,children:Cp})}),NL=W({name:`bringToFront`,label:`labels.bringToFront`,keywords:[`move up`,`zindex`,`layer`],icon:Sp,trackEvent:{category:`element`},perform:(e,t)=>({elements:kL(e,t),appState:t,captureUpdate:G.IMMEDIATELY}),keyTest:e=>As?e[H.CTRL_OR_CMD]&&e.altKey&&e.code===kg.BRACKET_RIGHT:e[H.CTRL_OR_CMD]&&e.shiftKey&&e.code===kg.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>(0,k.jsx)(`button`,{type:`button`,className:`zIndexButton`,onClick:t=>e(null),title:`${q(`labels.bringToFront`)} \u2014 ${L(As?`CtrlOrCmd+Alt+]`:`CtrlOrCmd+Shift+]`)}`,children:Sp})}),PL=W({name:`selectAll`,label:`labels.selectAll`,icon:qm,trackEvent:{category:`canvas`},viewMode:!1,perform:(e,t,n,r)=>{if(t.editingLinearElement)return!1;let i=e.filter(e=>!e.isDeleted&&!(R(e)&&e.containerId)&&!e.locked).reduce((e,t)=>(e[t.id]=!0,e),{});return{appState:{...t,...By({editingGroupId:null,selectedElementIds:i},eD(e),t,r),selectedLinearElement:Object.keys(i).length===1&&yd(e[0])?new U(e[0]):null},captureUpdate:G.IMMEDIATELY}},keyTest:e=>e[H.CTRL_OR_CMD]&&e.key===H.A}),FL=e=>{let t=e.slice(),n=new Set,r=e=>{let t=e[0]?.groupIds?.join(``),n=[e[0]],i=[];for(let r of e.slice(1))r.groupIds?.join(``)===t?n.push(r):i.push(r);return i.length?[...n,...r(i)]:n},i=new Map;return t.forEach((e,a)=>{if(!i.has(e.id)){if(e.groupIds?.length){let o=e.groupIds[e.groupIds.length-1],s=t.slice(a).filter(e=>{let t=e?.groupIds?.some(e=>e===o);return t&&i.set(e.id,!0),t});for(let e of r(s))n.add(e)}else n.add(e)}}),n.size===e.length?[...n]:(console.error(`normalizeGroupElementOrder: lost some elements... bailing!`),e)},IL=e=>{let t=Pu(e),n=e.slice(),r=new Set;return n.forEach((e,i)=>{e&&(e.boundElements?.length?(r.add(e),n[i]=null,e.boundElements.forEach(e=>{let i=t.get(e.id);i&&e.type===`text`&&(r.add(i[0]),n[i[1]]=null)})):e.type===`text`&&e.containerId&&t.get(e.containerId)?.[0].boundElements?.find(t=>t.id===e.id)||(r.add(e),n[i]=null))}),r.size===e.length?[...r]:(console.error(`normalizeBoundElementsOrder: lost some elements... bailing!`),e)},LL=e=>IL(FL(e)),RL=W({name:`duplicateSelection`,label:`labels.duplicateSelection`,icon:Jf,trackEvent:{category:`element`},perform:(e,t,n,r)=>{if(t.editingLinearElement)try{return{elements:e,appState:U.duplicateSelectedPoints(t,r.scene.getNonDeletedElementsMap()),captureUpdate:G.IMMEDIATELY}}catch{return!1}let i=zL(e,t);if(r.props.onDuplicate&&i.elements){let t=r.props.onDuplicate(i.elements,e);t&&(i.elements=t)}return{...i,captureUpdate:G.IMMEDIATELY}},keyTest:e=>e[H.CTRL_OR_CMD]&&e.key===H.D,PanelComponent:({elements:e,appState:t,updateData:n})=>(0,k.jsx)(fL,{type:`button`,icon:Jf,title:`${q(`labels.duplicateSelection`)} \u2014 ${L(`CtrlOrCmd+D`)}`,"aria-label":q(`labels.duplicateSelection`),onClick:()=>n(null),visible:qT(eD(e),t)})}),zL=(e,t)=>{let n=new Map,r=[],i=[],a=new Map,o=new Map,s=Nu(e),c=e=>{let s=cd(e).reduce((e,s)=>{if(u.has(s.id))return e;u.set(s.id,!0);let c=Ix(t.editingGroupId,n,s,{x:s.x+10,y:s.y+10});return u.set(c.id,!0),o.set(c.id,c),a.set(s.id,c.id),i.push(s),r.push(c),e.push(c),e},[]);return Array.isArray(e)?s:s[0]||null};e=LL(e);let l=Nu(YT(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0})),u=new Map,d=e.slice(),f=(e,t)=>{Yu(e!==-1,`targetIndex === -1 `),!(!Array.isArray(t)&&!t)&&d.splice(e+1,0,...cd(t))},p=new Set(e.filter(e=>l.has(e.id)&&gd(e)).map(e=>e.id));for(let n of e){if(u.has(n.id)||!l.has(n.id))continue;let r=Hy(t,n);if(r){let t=qy(e,r).flatMap(t=>gd(t)?[...wT(e,t.id),t]:[t]);f(Tu(d,e=>e.groupIds?.includes(r)),c(t));continue}if(!(n.frameId&&p.has(n.frameId))){if(gd(n)){let t=n.id,r=wT(e,t);f(Tu(d,e=>e.frameId===t||e.id===t),c([...r,n]));continue}if(kd(n)){let e=zb(n,s),t=Tu(d,e=>e.id===n.id||`containerId`in e&&e.containerId===n.id);e?f(t,c([n,e])):f(t,c(n));continue}if(Ad(n)){let e=Bb(n,s),t=Tu(d,t=>t.id===n.id||t.id===e?.id);e?f(t,c([e,n])):f(t,c(n));continue}f(Tu(d,e=>e.id===n.id),c(n))}}Fb(d,i,a),gy(d,i,a),gT(d,i,a);let m=WT(r);return{elements:d,appState:{...t,...By({editingGroupId:t.editingGroupId,selectedElementIds:m.reduce((e,t)=>(Ad(t)||(e[t.id]=!0),e),{})},eD(d),t,null)}}},BL=new Set([`command_palette`,`export`]),VL=(e,t,n,r)=>{try{if(typeof window>`u`||f.VITE_WORKER_ID||f.VITE_APP_ENABLE_TRACKING!==`true`||!BL.has(e)||f.DEV)return;f.PROD||console.info(`trackEvent`,{category:e,action:t,label:n,value:r}),window.sa_event&&window.sa_event(t,{category:e,label:n,value:r})}catch(e){console.error(`error during analytics`,e)}},HL=(0,u.forwardRef)((e,t)=>{let{title:n,className:r,testId:i,active:a,standalone:o,icon:s,onClick:c}=e;return(0,k.jsx)(`button`,{type:`button`,ref:t,title:n,"data-testid":i,className:O(r,{standalone:o,active:a}),onClick:c,children:s},n)}),UL=e=>(0,k.jsx)(`div`,{className:`buttonList`,children:e.options.map(t=>e.type===`button`?(0,k.jsx)(HL,{icon:t.icon,title:t.text,testId:t.testId,active:t.active??e.value===t.value,onClick:n=>e.onClick(t.value,n)},t.text):(0,k.jsxs)(`label`,{className:O({active:e.value===t.value}),title:t.text,children:[(0,k.jsx)(`input`,{type:`radio`,name:e.group,onChange:()=>e.onChange(t.value),checked:e.value===t.value,"data-testid":t.testId}),t.icon]},t.text))}),WL=({onChange:e,type:t,activeColor:n,topPicks:r})=>{let i;return t===`elementStroke`&&(i=Cs),t===`elementBackground`&&(i=ws),t===`canvasBackground`&&(i=Ts),r&&(i=r),i?(0,k.jsx)(`div`,{className:`color-picker__top-picks`,children:i.map(t=>(0,k.jsx)(`button`,{className:O(`color-picker__button`,{active:t===n,"is-transparent":t===`transparent`||!t}),style:{"--swatch-color":t},type:`button`,title:t,onClick:()=>e(t),"data-testid":`color-top-pick-${t}`,children:(0,k.jsx)(`div`,{className:`color-picker__button-outline`})},t))}):(console.error(`Invalid type for TopPicks`),null)},GL=()=>(0,k.jsx)(`div`,{style:{width:1,height:`1rem`,backgroundColor:`var(--default-border-color)`,margin:`0 auto`}}),KL=({palette:e,color:t})=>{for(let[n,r]of Object.entries(e))if(Array.isArray(r)){let e=r.indexOf(t);if(e>-1)return{colorName:n,shade:e}}else if(r===t)return{colorName:n,shade:null};return null},qL=[[`q`,`w`,`e`,`r`,`t`],[`a`,`s`,`d`,`f`,`g`],[`z`,`x`,`c`,`v`,`b`]].flat(),JL=({color:e,palette:t})=>!Object.values(t).flat().includes(e),YL=(e,t,n)=>{let r={elementBackground:`backgroundColor`,elementStroke:`strokeColor`},i=e.filter(e=>{if(e.isDeleted)return!1;let i=e[r[t]];return JL({color:i,palette:n})}),a=new Map;return i.forEach(e=>{let n=e[r[t]];a.has(n)?a.set(n,a.get(n)+1):a.set(n,1)}),[...a.entries()].sort((e,t)=>t[1]-e[1]).map(e=>e[0]).slice(0,5)},XL=EO(null),ZL=(e,t,n)=>(e*299+t*587+n*114)/1e3>=160?`black`:`white`,QL=(e,t)=>{if(t){let t=new Option().style;if(t.color=e,t.color){let e=t.color.replace(/^(rgb|rgba)\(/,``).replace(/\)$/,``).replace(/\s/g,``).split(`,`);return ZL(parseInt(e[0]),parseInt(e[1]),parseInt(e[2]))}}return e===`transparent`?`black`:ZL(parseInt(e.substring(1,3),16),parseInt(e.substring(3,5),16),parseInt(e.substring(5,7),16))},$L=({color:e,keyLabel:t,isCustomColor:n=!1,isShade:r=!1})=>(0,k.jsxs)(`div`,{className:`color-picker__button__hotkey-label`,style:{color:QL(e,n)},children:[r&&`⇧`,t]}),eR=({hex:e,onChange:t,palette:n})=>{let r=KL({color:e||`transparent`,palette:n}),[i,a]=GI(XL),o=(0,u.useRef)(null);if((0,u.useEffect)(()=>{o.current&&i===`shades`&&o.current.focus()},[r,i]),r){let{colorName:e,shade:s}=r,c=n[e];if(Array.isArray(c))return(0,k.jsx)(`div`,{className:`color-picker-content--default shades`,children:c.map((n,r)=>(0,k.jsxs)(`button`,{ref:r===s&&i===`shades`?o:void 0,tabIndex:-1,type:`button`,className:O(`color-picker__button color-picker__button--large`,{active:r===s}),"aria-label":`Shade`,title:`${e} - ${r+1}`,style:n?{"--swatch-color":n}:void 0,onClick:()=>{t(n),a(`shades`)},children:[(0,k.jsx)(`div`,{className:`color-picker__button-outline`}),(0,k.jsx)($L,{color:n,keyLabel:r+1,isShade:!0})]},r))})}return(0,k.jsxs)(`div`,{className:`color-picker-content--default`,style:{position:`relative`},tabIndex:-1,children:[(0,k.jsx)(`button`,{type:`button`,tabIndex:-1,className:`color-picker__button color-picker__button--large color-picker__button--no-focus-visible`}),(0,k.jsx)(`div`,{tabIndex:-1,style:{position:`absolute`,top:0,left:0,right:0,bottom:0,display:`flex`,alignItems:`center`,justifyContent:`center`,textAlign:`center`,fontSize:`0.75rem`},children:q(`colorPicker.noShades`)})]})},tR=({palette:e,color:t,onChange:n,label:r,activeShade:i})=>{let a=KL({color:t||`transparent`,palette:e}),[o,s]=GI(XL),c=(0,u.useRef)(null);return(0,u.useEffect)(()=>{c.current&&o===`baseColors`&&c.current.focus()},[a?.colorName,o]),(0,k.jsx)(`div`,{className:`color-picker-content--default`,children:Object.entries(e).map(([e,t],r)=>{let o=(Array.isArray(t)?t[i]:t)||`transparent`,l=qL[r],u=q(`colors.${e.replace(/\d+/,``)}`,null,``);return(0,k.jsxs)(`button`,{ref:a?.colorName===e?c:void 0,tabIndex:-1,type:`button`,className:O(`color-picker__button color-picker__button--large`,{active:a?.colorName===e,"is-transparent":o===`transparent`||!o}),onClick:()=>{n(o),s(`baseColors`)},title:`${u}${o.startsWith(`#`)?` ${o}`:``} \u2014 ${l}`,"aria-label":`${u} \u2014 ${l}`,style:o?{"--swatch-color":o}:void 0,"data-testid":`color-${e}`,children:[(0,k.jsx)(`div`,{className:`color-picker__button-outline`}),(0,k.jsx)($L,{color:o,keyLabel:l})]},e)})})},nR=({colors:e,color:t,onChange:n,label:r})=>{let[i,a]=GI(XL),o=(0,u.useRef)(null);return(0,u.useEffect)(()=>{o.current&&o.current.focus()},[t,i]),(0,k.jsx)(`div`,{className:`color-picker-content--default`,children:e.map((e,i)=>(0,k.jsxs)(`button`,{ref:t===e?o:void 0,tabIndex:-1,type:`button`,className:O(`color-picker__button color-picker__button--large`,{active:t===e,"is-transparent":e===`transparent`||!e}),onClick:()=>{n(e),a(`custom`)},title:e,"aria-label":r,style:{"--swatch-color":e},children:[(0,k.jsx)(`div`,{className:`color-picker__button-outline`}),(0,k.jsx)($L,{color:e,keyLabel:i+1,isCustomColor:!0})]},i))})},rR=(e,t,n)=>{let r=Math.ceil(n/5);switch(t??=-1,e){case`ArrowLeft`:{let e=t-1;return e<0?n-1:e}case`ArrowRight`:return(t+1)%n;case`ArrowDown`:{let e=t+5;return e>=n?t%5:e}case`ArrowUp`:{let e=t-5,i=e<0?5*r+e:e;return i>=n?void 0:i}}},iR=({e,colorObj:t,onChange:n,palette:r,customColors:i,setActiveColorPickerSection:a,activeShade:o})=>{if(t?.shade!=null&&[`Digit1`,`Digit2`,`Digit3`,`Digit4`,`Digit5`].includes(e.code)&&e.shiftKey){let i=Number(e.code.slice(-1))-1;return n(r[t.colorName][i]),a(`shades`),!0}if([`1`,`2`,`3`,`4`,`5`].includes(e.key)&&i[Number(e.key)-1])return n(i[Number(e.key)-1]),a(`custom`),!0;if(qL.includes(e.key)){let t=qL.indexOf(e.key),i=r[Object.keys(r)[t]];return n(Array.isArray(i)?i[o]:i),a(`baseColors`),!0}return!1},aR=({event:e,activeColorPickerSection:t,palette:n,color:r,onChange:i,customColors:a,setActiveColorPickerSection:o,updateData:s,activeShade:c,onEyeDropperToggle:l,onEscape:u})=>{if(e[H.CTRL_OR_CMD])return!1;if(e.key===H.ESCAPE)return u(e),!0;if(e.key===H.ALT)return l(!0),!0;if(e.key===H.I)return l(),!0;let d=KL({color:r,palette:n});if(e.key===H.TAB){let s={custom:!!a.length,baseColors:!0,shades:d?.shade!=null,hex:!0},c=Object.entries(s).reduce((e,[t,n])=>(n&&e.push(t),e),[]),l=c.indexOf(t),u=e.shiftKey?-1:1,f=c[l+u>c.length-1?0:l+u<0?c.length-1:l+u];return f&&o(f),f===`custom`?i(a[0]):f===`baseColors`&&(Object.entries(n).find(([e,t])=>Array.isArray(t)?t.includes(r):t===r?e:null)||i(xs.black)),e.preventDefault(),e.stopPropagation(),!0}if(iR({e,colorObj:d,onChange:i,palette:n,customColors:a,setActiveColorPickerSection:o,activeShade:c}))return!0;if(t===`shades`&&d){let{shade:t}=d,r=rR(e.key,t,5);if(r!==void 0)return i(n[d.colorName][r]),!0}if(t===`baseColors`&&d){let{colorName:t}=d,r=Object.keys(n),a=r.indexOf(t),o=rR(e.key,a,r.length);if(o!==void 0){let e=n[r[o]];return i(Array.isArray(e)?e[c]:e),!0}}if(t===`custom`){let t=a.indexOf(r),n=rR(e.key,t,a.length);if(n!==void 0){let e=a[n];return i(e),!0}}return!1},oR=({children:e})=>(0,k.jsx)(`div`,{className:`color-picker__heading`,children:e}),sR=({color:e,onChange:t,label:n,type:r,elements:i,palette:a,updateData:o,children:s,onEyeDropperToggle:c,onEscape:l})=>{let[d]=u.useState(()=>r===`canvasBackground`?[]:YL(i,r,a)),[f,p]=GI(XL),m=KL({color:e,palette:a});(0,u.useEffect)(()=>{if(!f){let t=JL({color:e,palette:a}),n=t&&!d.includes(e);p(n?`hex`:t?`custom`:m?.shade==null?`baseColors`:`shades`)}},[f,e,a,p,m,d]);let[h,g]=(0,u.useState)(m?.shade??(r===`elementBackground`?1:4));(0,u.useEffect)(()=>{m?.shade!=null&&g(m.shade);let e=e=>{e.key===H.ALT&&c(!1)};return document.addEventListener(`keyup`,e,{capture:!0}),()=>{document.removeEventListener(`keyup`,e,{capture:!0})}},[m,c]);let _=u.useRef(null);return(0,k.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":q(`labels.colorPicker`),children:(0,k.jsxs)(`div`,{ref:_,onKeyDown:n=>{aR({event:n,activeColorPickerSection:f,palette:a,color:e,onChange:t,onEyeDropperToggle:c,customColors:d,setActiveColorPickerSection:p,updateData:o,activeShade:h,onEscape:l})&&(n.preventDefault(),n.stopPropagation())},className:`color-picker-content properties-content`,tabIndex:-1,children:[!!d.length&&(0,k.jsxs)(`div`,{children:[(0,k.jsx)(oR,{children:q(`colorPicker.mostUsedCustomColors`)}),(0,k.jsx)(nR,{colors:d,color:e,label:q(`colorPicker.mostUsedCustomColors`),onChange:t})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(oR,{children:q(`colorPicker.colors`)}),(0,k.jsx)(tR,{color:e,label:n,palette:a,onChange:t,activeShade:h})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(oR,{children:q(`colorPicker.shades`)}),(0,k.jsx)(eR,{hex:e,onChange:t,palette:a})]}),s]})})},cR=u.createContext(null),lR=()=>u.useContext(cR),uR=e=>{let[t,n]=(0,u.useState)(null),r=Jq(),{theme:i}=lR(),{container:a}=Yq();return(0,u.useLayoutEffect)(()=>{t&&(t.className=``,t.classList.add(`excalidraw`,...e?.className?.split(/\s+/)||[]),t.classList.toggle(`excalidraw--mobile`,r.editor.isMobile),t.classList.toggle(`theme--dark`,i===Qs.DARK))},[t,i,r.editor.isMobile,e?.className]),(0,u.useLayoutEffect)(()=>{let t=e?.parentSelector?a?.querySelector(e.parentSelector):document.body;if(!t)return;let r=document.createElement(`div`);return t.appendChild(r),n(r),()=>{t.removeChild(r)}},[a,e?.parentSelector]),t};function dR(e,t,n){(0,u.useEffect)(()=>{function r(r){let i=r;if(!e.current)return;let a=n?.(i,e.current);if(a!==!0){if(a===!1)return t(i);e.current.contains(i.target)||!document.documentElement.contains(i.target)||i.target.closest(`[data-radix-portal]`)||i.target===document.documentElement&&document.body.style.pointerEvents===`none`||i.target.closest(`[data-prevent-outside-click]`)||t(i)}}return document.addEventListener(`pointerdown`,r),document.addEventListener(`touchstart`,r),()=>{document.removeEventListener(`pointerdown`,r),document.removeEventListener(`touchstart`,r)}},[e,t,n])}var fR=e=>{let t=(0,u.useRef)(e);return Object.assign(t.current,e),t.current},pR=EO(null),mR=({onCancel:e,onChange:t,onSelect:n,colorPickerType:r})=>{let i=uR({className:`excalidraw-eye-dropper-backdrop`,parentSelector:`.excalidraw-eye-dropper-container`}),a=lR(),o=Xq(),s=Kq(),c=fR({app:s,onCancel:e,onChange:t,onSelect:n,selectedElements:YT(o,a)}),{container:l}=Yq();(0,u.useEffect)(()=>{let e=d.current;if(!e||!s.canvas||!i)return;let t=!1,n=s.canvas.getContext(`2d`),o=({clientX:e,clientY:t})=>{let r=n.getImageData((e-a.offsetLeft)*window.devicePixelRatio,(t-a.offsetTop)*window.devicePixelRatio,1,1).data;return ks(r[0],r[1],r[2])},u=({clientX:n,clientY:i,altKey:a})=>{e.style.top=`${i+20}px`,e.style.left=`${n+20}px`;let s=o({clientX:n,clientY:i});t&&c.onChange(r,s,c.selectedElements,{altKey:a}),e.style.background=s},f=()=>{c.onCancel()},p=(e,t)=>{c.onSelect(e,t)},m=e=>{t=!0,e.stopImmediatePropagation()},h=e=>{t=!1,l?.focus(),e.stopImmediatePropagation(),e.preventDefault(),p(o(e),e)},g=e=>{e.key===H.ESCAPE&&(e.preventDefault(),e.stopImmediatePropagation(),f())};return i.tabIndex=-1,i.focus(),u({clientX:c.app.lastViewportPosition.x,clientY:c.app.lastViewportPosition.y,altKey:!1}),i.addEventListener(`keydown`,g),i.addEventListener(`pointerdown`,m),i.addEventListener(`pointerup`,h),window.addEventListener(`pointermove`,u,{passive:!0}),window.addEventListener(`blur`,f),()=>{t=!1,i.removeEventListener(`keydown`,g),i.removeEventListener(`pointerdown`,m),i.removeEventListener(`pointerup`,h),window.removeEventListener(`pointermove`,u),window.removeEventListener(`blur`,f)}},[c,s.canvas,i,r,l,a.offsetLeft,a.offsetTop]);let d=(0,u.useRef)(null);return dR(d,()=>{e()},e=>!!e.target.closest(`.excalidraw-eye-dropper-trigger, .excalidraw-eye-dropper-backdrop`)),i?(0,mk.createPortal)((0,k.jsx)(`div`,{ref:d,className:`excalidraw-eye-dropper-preview`}),i):null},hR=({color:e,onChange:t,label:n,colorPickerType:r})=>{let i=Jq(),[a,o]=(0,u.useState)(e),[s,c]=GI(XL);(0,u.useEffect)(()=>{o(e)},[e]);let l=(0,u.useCallback)(e=>{let n=e.toLowerCase(),r=yR(n);r&&t(r),o(n)},[t]),d=(0,u.useRef)(null),f=(0,u.useRef)(null);(0,u.useEffect)(()=>{d.current&&d.current.focus()},[s]);let[p,m]=GI(pR);return(0,u.useEffect)(()=>()=>{m(null)},[m]),(0,k.jsxs)(`div`,{className:`color-picker__input-label`,children:[(0,k.jsx)(`div`,{className:`color-picker__input-hash`,children:`#`}),(0,k.jsx)(`input`,{ref:s===`hex`?d:void 0,style:{border:0,padding:0},spellCheck:!1,className:`color-picker-input`,"aria-label":n,onChange:e=>{l(e.target.value)},value:(a||``).replace(/^#/,``),onBlur:()=>{o(e)},tabIndex:-1,onFocus:()=>c(`hex`),onKeyDown:e=>{e.key!==H.TAB&&(e.key===H.ESCAPE&&f.current?.focus(),e.stopPropagation())}}),!i.editor.isMobile&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{style:{width:`1px`,height:`1.25rem`,backgroundColor:`var(--default-border-color)`}}),(0,k.jsx)(`div`,{ref:f,className:O(`excalidraw-eye-dropper-trigger`,{selected:p}),onClick:()=>m(e=>e?null:{keepOpenOnAlt:!1,onSelect:e=>t(e),colorPickerType:r}),title:`${q(`labels.eyeDropper`)} \u2014 ${H.I.toLocaleUpperCase()} or ${L(`Alt`)} `,children:jm})]})]})},gR=u.forwardRef(({children:e,padding:t,className:n,style:r},i)=>(0,k.jsx)(`div`,{className:O(`Island`,n),style:{"--padding":t,...r},ref:i,children:e})),_R=u.forwardRef(({className:e,container:t,children:n,style:r,onClose:i,onKeyDown:a,onFocusOutside:o,onPointerLeave:s,onPointerDownOutside:c},l)=>{let u=Jq();return(0,k.jsx)(YP,{container:t,children:(0,k.jsxs)(XP,{ref:l,className:O(`focus-visible-none`,e),"data-prevent-outside-click":!0,side:u.editor.isMobile&&!u.viewport.isLandscape?`bottom`:`right`,align:u.editor.isMobile&&!u.viewport.isLandscape?`center`:`start`,alignOffset:-16,sideOffset:20,style:{zIndex:`var(--zIndex-popup)`},onPointerLeave:s,onKeyDown:a,onFocusOutside:o,onPointerDownOutside:c,onCloseAutoFocus:e=>{e.stopPropagation(),e.preventDefault(),t&&!au(document.activeElement)&&t.focus(),i()},children:[(0,k.jsx)(gR,{padding:3,style:r,children:n}),(0,k.jsx)(ZP,{width:20,height:10,style:{fill:`var(--popup-bg-color)`,filter:`drop-shadow(rgba(0, 0, 0, 0.05) 0px 3px 2px)`}})]})})}),vR=e=>{let t=new Option().style;return t.color=e,!!t.color},yR=e=>Eu(e)?e:vR(`#${e}`)?`#${e}`:vR(e)?e:null,bR=({type:e,color:t,onChange:n,label:r,elements:i,palette:a=xs,updateData:o})=>{let{container:s}=Yq(),[,c]=GI(XL),[l,d]=GI(pR),f=(0,k.jsxs)(`div`,{children:[(0,k.jsx)(oR,{children:q(`colorPicker.hexCode`)}),(0,k.jsx)(hR,{color:t,label:r,onChange:e=>{n(e)},colorPickerType:e})]}),p=(0,u.useRef)(null),m=()=>{p.current?.querySelector(`.color-picker-content`)?.focus()};return(0,k.jsx)(_R,{container:s,style:{maxWidth:`13rem`},onFocusOutside:e=>{m(),e.preventDefault()},onPointerDownOutside:e=>{l&&e.preventDefault()},onClose:()=>{o({openPopup:null}),c(null)},children:a?(0,k.jsx)(sR,{palette:a,color:t,onChange:e=>{n(e)},onEyeDropperToggle:t=>{d(r=>t?(r||={keepOpenOnAlt:!0,onSelect:n,colorPickerType:e},r.keepOpenOnAlt=!0,r):t===!1||r?null:{keepOpenOnAlt:!1,onSelect:n,colorPickerType:e})},onEscape:e=>{l?d(null):o({openPopup:null})},label:r,type:e,elements:i,updateData:o,children:f}):f})},xR=({label:e,color:t,type:n})=>(0,k.jsx)(JP,{type:`button`,className:O(`color-picker__button active-color properties-trigger`,{"is-transparent":t===`transparent`||!t}),"aria-label":e,style:t?{"--swatch-color":t}:void 0,title:q(n===`elementStroke`?`labels.showStroke`:`labels.showBackground`),children:(0,k.jsx)(`div`,{className:`color-picker__button-outline`})}),SR=({type:e,color:t,onChange:n,label:r,elements:i,palette:a=xs,topPicks:o,updateData:s,appState:c})=>(0,k.jsx)(`div`,{children:(0,k.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,className:`color-picker-container`,children:[(0,k.jsx)(WL,{activeColor:t,onChange:n,type:e,topPicks:o}),(0,k.jsx)(GL,{}),(0,k.jsxs)(qP,{open:c.openPopup===e,onOpenChange:t=>{s({openPopup:t?e:null})},children:[(0,k.jsx)(xR,{color:t,label:r,type:e}),c.openPopup===e&&(0,k.jsx)(bR,{type:e,color:t,onChange:n,label:r,elements:i,palette:a,updateData:s})]})]})}),CR=({icon:e})=>(0,k.jsx)(`span`,{style:{width:`1em`,margin:`0 0.5ex 0 0.5ex`,display:`inline-block`,lineHeight:0,verticalAlign:`middle`},children:e}),wR=({label:e,open:t,openTrigger:n,children:r,className:i})=>(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{style:{cursor:`pointer`,display:`flex`,justifyContent:`space-between`,alignItems:`center`},className:i,onClick:n,children:[e,(0,k.jsx)(CR,{icon:t?dh:uh})]}),t&&(0,k.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`},children:r})]}),TR=EO(!1);function ER({options:e,value:t,label:n,onChange:r,onClose:i,numberOfOptionsToAlwaysShow:a=e.length}){let o=Jq(),s=n=>{let o=e.find(e=>e.keyBinding===n.key.toLowerCase());if(!(n.metaKey||n.altKey||n.ctrlKey)&&o)r(o.value),n.preventDefault();else if(n.key===H.TAB){let i=e.findIndex(e=>e.value===t);r(e[n.shiftKey?(e.length+i-1)%e.length:(i+1)%e.length].value)}else if(Ng(n.key)){let i=aL().rtl,o=e.findIndex(e=>e.value===t);if(o!==-1){let t=e.length,s=o;switch(n.key){case i?H.ARROW_LEFT:H.ARROW_RIGHT:s=(o+1)%t;break;case i?H.ARROW_RIGHT:H.ARROW_LEFT:s=(t+o-1)%t;break;case H.ARROW_DOWN:s=(o+(a??1))%t;break;case H.ARROW_UP:s=(t+o-(a??1))%t}r(e[s].value)}n.preventDefault()}else(n.key===H.ESCAPE||n.key===H.ENTER)&&(n.preventDefault(),i());n.nativeEvent.stopImmediatePropagation(),n.stopPropagation()},[c,l]=GI(TR),d=u.useMemo(()=>e.slice(0,a),[e,a]),f=u.useMemo(()=>e.slice(a),[e,a]);(0,u.useEffect)(()=>{d.some(e=>e.value===t)||l(!0)},[t,d,l]);let p=e=>(0,k.jsx)(`div`,{className:`picker-content`,children:e.map((e,n)=>(0,k.jsxs)(`button`,{type:`button`,className:O(`picker-option`,{active:t===e.value}),onClick:t=>{r(e.value)},title:`${e.text} ${e.keyBinding&&`\u2014 ${e.keyBinding.toUpperCase()}`}`,"aria-label":e.text||`none`,"aria-keyshortcuts":e.keyBinding||void 0,ref:n=>{t===e.value&&setTimeout(()=>{n?.focus()},0)},children:[e.icon,e.keyBinding&&(0,k.jsx)(`span`,{className:`picker-keybinding`,children:e.keyBinding})]},e.text))});return(0,k.jsx)(XP,{side:o.editor.isMobile&&!o.viewport.isLandscape?`top`:`bottom`,align:`start`,sideOffset:12,style:{zIndex:`var(--zIndex-popup)`},onKeyDown:s,children:(0,k.jsxs)(`div`,{className:`picker`,role:`dialog`,"aria-modal":`true`,"aria-label":n,children:[p(d),f.length>0&&(0,k.jsx)(wR,{label:q(`labels.more_options`),open:c,openTrigger:()=>{l(e=>!e)},className:`picker-collapsible`,children:p(f)})]})})}function DR({value:e,label:t,options:n,onChange:r,group:i=``,numberOfOptionsToAlwaysShow:a}){let[o,s]=u.useState(!1),c=u.useRef(null);return(0,k.jsx)(`div`,{children:(0,k.jsxs)(qP,{open:o,onOpenChange:e=>s(e),children:[(0,k.jsx)(JP,{name:i,type:`button`,"aria-label":t,onClick:()=>s(!o),ref:c,className:o?`active`:``,children:n.find(t=>t.value===e)?.icon}),o&&(0,k.jsx)(ER,{options:n,value:e,label:t,onChange:r,onClose:()=>{s(!1)},numberOfOptionsToAlwaysShow:a})]})})}var OR=u.forwardRef(({className:e,placeholder:t,onChange:n},r)=>(0,k.jsxs)(`div`,{className:O(`QuickSearch__wrapper`,e),children:[Hm,(0,k.jsx)(`input`,{ref:r,className:`QuickSearch__input`,type:`text`,placeholder:t,onChange:e=>n(e.target.value.trim().toLowerCase())})]})),kR=({className:e,placeholder:t,children:n})=>{let r=!u.Children.count(n);return(0,k.jsx)(`div`,{className:O(`ScrollableList__wrapper`,e),role:`menu`,children:r?(0,k.jsx)(`div`,{className:`empty`,children:t}):n})},AR=({children:e,className:t=``,style:n,title:r})=>(0,k.jsxs)(`div`,{className:`dropdown-menu-group ${t}`,style:n,children:[r&&(0,k.jsx)(`p`,{className:`dropdown-menu-group-title`,children:r}),e]}),jR=AR;AR.displayName=`DropdownMenuGroup`;var MR=u.createContext({}),NR=(e=``,t=!1,n=!1)=>`dropdown-menu-item dropdown-menu-item-base ${e}
|
|
100
|
+
${t?`dropdown-menu-item--selected`:``} ${n?`dropdown-menu-item--hovered`:``}`.trim(),PR=(e,t)=>{let n=(0,u.useContext)(MR);return qu(e,e=>{let r=new CustomEvent(`menu.itemSelect`,{bubbles:!0,cancelable:!0});t?.(r),r.defaultPrevented||n.onSelect?.(r)})},FR=({textStyle:e,icon:t,shortcut:n,children:r})=>{let i=Jq();return(0,k.jsxs)(k.Fragment,{children:[t&&(0,k.jsx)(`div`,{className:`dropdown-menu-item__icon`,children:t}),(0,k.jsx)(`div`,{style:e,className:`dropdown-menu-item__text`,children:r}),n&&!i.editor.isMobile&&(0,k.jsx)(`div`,{className:`dropdown-menu-item__shortcut`,children:n})]})},IR=({icon:e,value:t,order:n,children:r,shortcut:i,className:a,hovered:o,selected:s,textStyle:c,onSelect:l,onClick:d,...f})=>{let p=PR(d,l),m=(0,u.useRef)(null);return(0,u.useEffect)(()=>{o&&(n===0?m.current?.scrollIntoView({block:`end`}):m.current?.scrollIntoView({block:`nearest`}))},[o,n]),(0,k.jsx)(`button`,{...f,ref:m,value:t,onClick:p,className:NR(a,s,o),title:f.title??f[`aria-label`],children:(0,k.jsx)(FR,{textStyle:c,icon:e,shortcut:i,children:r})})};IR.displayName=`DropdownMenuItem`;var LR={GREEN:`green`,RED:`red`,BLUE:`blue`},RR=({type:e=LR.BLUE,children:t})=>{let{theme:n}=Zq(),r={display:`inline-flex`,marginLeft:`auto`,padding:`2px 4px`,borderRadius:6,fontSize:9,fontFamily:`Cascadia, monospace`,border:n===Qs.LIGHT?`1.5px solid white`:`none`};switch(e){case LR.GREEN:Object.assign(r,{backgroundColor:`var(--background-color-badge)`,color:`var(--color-badge)`});break;case LR.RED:Object.assign(r,{backgroundColor:`pink`,color:`darkred`});break;case LR.BLUE:default:Object.assign(r,{background:`var(--color-promo)`,color:`var(--color-surface-lowest)`})}return(0,k.jsx)(`div`,{className:`DropDownMenuItemBadge`,style:r,children:t})};RR.displayName=`DropdownMenuItemBadge`,IR.Badge=RR;var zR=IR,BR=({event:e,inputRef:t,hoveredFont:n,filteredFonts:r,onClose:i,onSelect:a,onHover:o})=>{if(!e[H.CTRL_OR_CMD]&&e.shiftKey&&e.key.toLowerCase()===H.F)return t.current?.focus(),!0;if(e.key===H.ESCAPE)return i(),!0;if(e.key===H.ENTER)return n?.value&&a(n.value),!0;if(e.key===H.ARROW_DOWN)return n?.next?o(n.next.value):r[0]?.value&&o(r[0].value),!0;if(e.key===H.ARROW_UP)return n?.prev?o(n.prev.value):r[r.length-1]?.value&&o(r[r.length-1].value),!0},VR=u.memo(({selectedFontFamily:e,hoveredFontFamily:t,onSelect:n,onHover:r,onLeave:i,onOpen:a,onClose:o})=>{let{container:s}=Yq(),{fonts:c}=Kq(),{showDeprecatedFonts:l}=qq(),[d,f]=(0,u.useState)(``),p=(0,u.useRef)(null),m=(0,u.useMemo)(()=>Array.from(Jh.registered.entries()).filter(([e,{metadata:t}])=>!t.serverSide&&!t.fallback).map(([e,{metadata:t,fontFaces:n}])=>{let r={value:e,icon:t.icon??mm,text:n[0]?.fontFace?.family??`Unknown`};return t.deprecated&&Object.assign(r,{deprecated:t.deprecated,badge:{type:LR.RED,placeholder:q(`fontList.badge.old`)}}),r}).sort((e,t)=>e.text.toLowerCase()>t.text.toLowerCase()?1:-1),[]),h=(0,u.useMemo)(()=>new Set(c.getSceneFamilies()),[e]),g=(0,u.useMemo)(()=>m.filter(e=>h.has(e.value)),[m,h]),_=(0,u.useMemo)(()=>m.filter(e=>!h.has(e.value)&&(l||!e.deprecated)),[m,h,l]),v=(0,u.useMemo)(()=>Iu([...g,..._].filter(e=>e.text?.toLowerCase().includes(d))),[g,_,d]),y=(0,u.useMemo)(()=>{let n;return t?n=v.find(e=>e.value===t):e&&(n=v.find(t=>t.value===e)),!n&&d&&(v[0]?.value?r(v[0].value):i()),n},[t,e,d,v,r,i]),b=(0,u.useCallback)(e=>{BR({event:e,inputRef:p,hoveredFont:y,filteredFonts:v,onSelect:n,onHover:r,onClose:o})&&(e.preventDefault(),e.stopPropagation())},[y,v,n,r,o]);(0,u.useEffect)(()=>(a(),()=>{o()}),[]);let x=(0,u.useMemo)(()=>v.filter(e=>h.has(e.value)),[v,h]),S=(0,u.useMemo)(()=>v.filter(e=>!h.has(e.value)),[v,h]),C=(t,i)=>(0,k.jsxs)(zR,{icon:t.icon,value:t.value,order:i,textStyle:{fontFamily:su({fontFamily:t.value})},hovered:t.value===y?.value,selected:t.value===e,tabIndex:t.value===e?0:-1,onClick:e=>{n(Number(e.currentTarget.value))},onMouseMove:()=>{y?.value!==t.value&&r(t.value)},children:[t.text,t.badge&&(0,k.jsx)(RR,{type:t.badge.type,children:t.badge.placeholder})]},t.value),w=[];return x.length&&w.push((0,k.jsx)(jR,{title:q(`fontList.sceneFonts`),children:x.map(C)},`group_1`)),S.length&&w.push((0,k.jsx)(jR,{title:q(`fontList.availableFonts`),children:S.map((e,t)=>C(e,t+x.length))},`group_2`)),(0,k.jsxs)(_R,{className:`properties-content`,container:s,style:{width:`15rem`},onClose:o,onPointerLeave:i,onKeyDown:b,children:[(0,k.jsx)(OR,{ref:p,placeholder:q(`quickSearch.placeholder`),onChange:lu(f,20)}),(0,k.jsx)(kR,{className:`dropdown-menu fonts manual-hover`,placeholder:q(`fontList.empty`),children:w.length?w:null})]})},(e,t)=>e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily),HR=({selectedFontFamily:e})=>{let t=(0,u.useMemo)(()=>!!(e&&!GR(e)),[e]);return(0,k.jsx)(JP,{asChild:!0,children:(0,k.jsx)(`div`,{children:(0,k.jsx)(HL,{standalone:!0,icon:Bf,title:q(`labels.showFonts`),className:`properties-trigger`,testId:`font-family-show-fonts`,active:t,onClick:()=>{}})})})},UR=[{value:Ys.Excalifont,icon:zf,text:q(`labels.handDrawn`),testId:`font-family-hand-drawn`},{value:Ys.Nunito,icon:mm,text:q(`labels.normal`),testId:`font-family-normal`},{value:Ys[`Comic Shanns`],icon:hm,text:q(`labels.code`),testId:`font-family-code`}],WR=new Set(UR.map(e=>e.value)),GR=e=>e?WR.has(e):!1,KR=u.memo(({isOpened:e,selectedFontFamily:t,hoveredFontFamily:n,onSelect:r,onHover:i,onLeave:a,onPopupChange:o})=>{let s=(0,u.useMemo)(()=>UR,[]),c=(0,u.useCallback)(e=>{e&&r(e)},[r]);return(0,k.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,className:`FontPicker__container`,children:[(0,k.jsx)(UL,{type:`button`,options:s,value:t,onClick:c}),(0,k.jsx)(GL,{}),(0,k.jsxs)(qP,{open:e,onOpenChange:o,children:[(0,k.jsx)(HR,{selectedFontFamily:t}),e&&(0,k.jsx)(VR,{selectedFontFamily:t,hoveredFontFamily:n,onSelect:c,onHover:i,onLeave:a,onOpen:()=>o(!0),onClose:()=>o(!1)})]})]})},(e,t)=>e.isOpened===t.isOpened&&e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily),qR=({updateData:e,appState:t,elements:n,testId:r})=>{let i=u.useRef(null),a=u.useRef(null),o=XR(n,t,e=>e.opacity,!0,t.currentItemOpacity);return(0,u.useEffect)(()=>{if(i.current&&a.current){let e=i.current,t=a.current,n=e.offsetWidth,r=o/100*(n-15)+15/2;t.style.left=`${r}px`,e.style.background=`linear-gradient(to right, var(--color-slider-track) 0%, var(--color-slider-track) ${o}%, var(--button-bg) ${o}%, var(--button-bg) 100%)`}},[o]),(0,k.jsxs)(`label`,{className:`control-label`,children:[q(`labels.opacity`),(0,k.jsxs)(`div`,{className:`range-wrapper`,children:[(0,k.jsx)(`input`,{ref:i,type:`range`,min:`0`,max:`100`,step:`10`,onChange:t=>{e(+t.target.value)},value:o,className:`range-input`,"data-testid":r}),(0,k.jsx)(`div`,{className:`value-bubble`,ref:a,children:o===0?null:o}),(0,k.jsx)(`div`,{className:`zero-label`,children:`0`})]})]})},JR=.1,YR=(e,t,n,r=!1)=>{let i=Nu(YT(e,t,{includeBoundTextElement:r}));return e.map(e=>i.get(e.id)||e.id===t.editingTextElement?.id?n(e):e)},XR=function(e,t,n,r,i){let a=t.editingTextElement,o=eD(e),s=null;return a&&(s=n(a)),s||=qT(o,t)?JT(r===!0?o:o.filter(e=>r(e)),t,n)??(typeof i==`function`?i(!0):i):typeof i==`function`?i(!1):i,s},ZR=(e,t)=>Ad(t)||!t.autoResize?t:K(t,{x:e.textAlign===`left`?e.x:e.x+(e.width-t.width)/(e.textAlign===`center`?2:1),y:e.y+(e.height-t.height)/2},!1),QR=(e,t,n,r,i)=>{let a=new Set,o=YR(e,t,e=>{if(R(e)){let t=r(e);a.add(t);let i=iE(e,{fontSize:t});return Pb(i,n.scene.getContainerElement(e),n.scene.getNonDeletedElementsMap()),i=ZR(e,i),i}return e},!0),s=Nu(o);return YT(e,t,{includeBoundTextElement:!0}).forEach(e=>{R(e)&&ny(e,s)}),{elements:o,appState:{...t,currentItemFontSize:a.size===1?[...a][0]:i??t.currentItemFontSize},captureUpdate:G.IMMEDIATELY}};W({name:`changeStrokeColor`,label:`labels.stroke`,trackEvent:!1,perform:(e,t,n)=>({...n.currentItemStrokeColor&&{elements:YR(e,t,e=>k_(e.type)?iE(e,{strokeColor:n.currentItemStrokeColor}):e,!0)},appState:{...t,...n},captureUpdate:n.currentItemStrokeColor?G.IMMEDIATELY:G.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n,appProps:r})=>(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`h3`,{"aria-hidden":`true`,children:q(`labels.stroke`)}),(0,k.jsx)(SR,{topPicks:Cs,palette:Es,type:`elementStroke`,label:q(`labels.stroke`),color:XR(e,t,e=>e.strokeColor,!0,t.currentItemStrokeColor),onChange:e=>n({currentItemStrokeColor:e}),elements:e,appState:t,updateData:n})]})}),W({name:`changeBackgroundColor`,label:`labels.changeBackground`,trackEvent:!1,perform:(e,t,n)=>({...n.currentItemBackgroundColor&&{elements:YR(e,t,e=>iE(e,{backgroundColor:n.currentItemBackgroundColor}))},appState:{...t,...n},captureUpdate:n.currentItemBackgroundColor?G.IMMEDIATELY:G.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n,appProps:r})=>(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`h3`,{"aria-hidden":`true`,children:q(`labels.background`)}),(0,k.jsx)(SR,{topPicks:ws,palette:Ds,type:`elementBackground`,label:q(`labels.background`),color:XR(e,t,e=>e.backgroundColor,!0,t.currentItemBackgroundColor),onChange:e=>n({currentItemBackgroundColor:e}),elements:e,appState:t,updateData:n})]})}),W({name:`changeFillStyle`,label:`labels.fill`,trackEvent:!1,perform:(e,t,n,r)=>(VL(`element`,`changeFillStyle`,`${n} (${r.device.editor.isMobile?`mobile`:`desktop`})`),{elements:YR(e,t,e=>iE(e,{fillStyle:n})),appState:{...t,currentItemFillStyle:n},captureUpdate:G.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let r=YT(e,t),i=r.length>0&&r.every(e=>e.fillStyle===`zigzag`);return(0,k.jsxs)(`fieldset`,{children:[(0,k.jsx)(`legend`,{children:q(`labels.fill`)}),(0,k.jsx)(UL,{type:`button`,options:[{value:`hachure`,text:`${q(i?`labels.zigzag`:`labels.hachure`)} (${L(`Alt-Click`)})`,icon:i?Ip:Lp,active:i?!0:void 0,testId:`fill-hachure`},{value:`cross-hatch`,text:q(`labels.crossHatch`),icon:Rp,testId:`fill-cross-hatch`},{value:`solid`,text:q(`labels.solid`),icon:zp,testId:`fill-solid`}],value:XR(e,t,e=>e.fillStyle,e=>e.hasOwnProperty(`fillStyle`),e=>e?null:t.currentItemFillStyle),onClick:(e,t)=>{n(t.altKey&&e===`hachure`&&r.every(e=>e.fillStyle===`hachure`)?`zigzag`:e)}})]})}}),W({name:`changeStrokeWidth`,label:`labels.strokeWidth`,trackEvent:!1,perform:(e,t,n)=>({elements:YR(e,t,e=>iE(e,{strokeWidth:n})),appState:{...t,currentItemStrokeWidth:n},captureUpdate:G.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>(0,k.jsxs)(`fieldset`,{children:[(0,k.jsx)(`legend`,{children:q(`labels.strokeWidth`)}),(0,k.jsx)(UL,{group:`stroke-width`,options:[{value:Mc.thin,text:q(`labels.thin`),icon:Bp,testId:`strokeWidth-thin`},{value:Mc.bold,text:q(`labels.bold`),icon:Vp,testId:`strokeWidth-bold`},{value:Mc.extraBold,text:q(`labels.extraBold`),icon:Hp,testId:`strokeWidth-extraBold`}],value:XR(e,t,e=>e.strokeWidth,e=>e.hasOwnProperty(`strokeWidth`),e=>e?null:t.currentItemStrokeWidth),onChange:e=>n(e)})]})}),W({name:`changeSloppiness`,label:`labels.sloppiness`,trackEvent:!1,perform:(e,t,n)=>({elements:YR(e,t,e=>iE(e,{seed:hx(),roughness:n})),appState:{...t,currentItemRoughness:n},captureUpdate:G.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>(0,k.jsxs)(`fieldset`,{children:[(0,k.jsx)(`legend`,{children:q(`labels.sloppiness`)}),(0,k.jsx)(UL,{group:`sloppiness`,options:[{value:0,text:q(`labels.architect`),icon:Gp},{value:1,text:q(`labels.artist`),icon:Kp},{value:2,text:q(`labels.cartoonist`),icon:qp}],value:XR(e,t,e=>e.roughness,e=>e.hasOwnProperty(`roughness`),e=>e?null:t.currentItemRoughness),onChange:e=>n(e)})]})}),W({name:`changeStrokeStyle`,label:`labels.strokeStyle`,trackEvent:!1,perform:(e,t,n)=>({elements:YR(e,t,e=>iE(e,{strokeStyle:n})),appState:{...t,currentItemStrokeStyle:n},captureUpdate:G.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>(0,k.jsxs)(`fieldset`,{children:[(0,k.jsx)(`legend`,{children:q(`labels.strokeStyle`)}),(0,k.jsx)(UL,{group:`strokeStyle`,options:[{value:`solid`,text:q(`labels.strokeStyle_solid`),icon:Bp},{value:`dashed`,text:q(`labels.strokeStyle_dashed`),icon:Up},{value:`dotted`,text:q(`labels.strokeStyle_dotted`),icon:Wp}],value:XR(e,t,e=>e.strokeStyle,e=>e.hasOwnProperty(`strokeStyle`),e=>e?null:t.currentItemStrokeStyle),onChange:e=>n(e)})]})}),W({name:`changeOpacity`,label:`labels.opacity`,trackEvent:!1,perform:(e,t,n)=>({elements:YR(e,t,e=>iE(e,{opacity:n}),!0),appState:{...t,currentItemOpacity:n},captureUpdate:G.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>(0,k.jsx)(qR,{updateData:n,elements:e,appState:t,testId:`opacity`})}),W({name:`changeFontSize`,label:`labels.fontSize`,trackEvent:!1,perform:(e,t,n,r)=>QR(e,t,r,()=>n,n),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>(0,k.jsxs)(`fieldset`,{children:[(0,k.jsx)(`legend`,{children:q(`labels.fontSize`)}),(0,k.jsx)(UL,{group:`font-size`,options:[{value:16,text:q(`labels.small`),icon:cm,testId:`fontSize-small`},{value:20,text:q(`labels.medium`),icon:lm,testId:`fontSize-medium`},{value:28,text:q(`labels.large`),icon:um,testId:`fontSize-large`},{value:36,text:q(`labels.veryLarge`),icon:dm,testId:`fontSize-veryLarge`}],value:XR(e,t,e=>{if(R(e))return e.fontSize;let t=zb(e,r.scene.getNonDeletedElementsMap());return t?t.fontSize:null},e=>R(e)||zb(e,r.scene.getNonDeletedElementsMap())!==null,e=>e?null:t.currentItemFontSize||20),onChange:e=>n(e)})]})});var $R=W({name:`decreaseFontSize`,label:`labels.decreaseFontSize`,icon:fm,trackEvent:!1,perform:(e,t,n,r)=>QR(e,t,r,e=>Math.round(1/(1+JR)*e.fontSize)),keyTest:e=>e[H.CTRL_OR_CMD]&&e.shiftKey&&(e.key===H.CHEVRON_LEFT||e.key===H.COMMA)}),ez=W({name:`increaseFontSize`,label:`labels.increaseFontSize`,icon:fm,trackEvent:!1,perform:(e,t,n,r)=>QR(e,t,r,e=>Math.round(e.fontSize*(1+JR))),keyTest:e=>e[H.CTRL_OR_CMD]&&e.shiftKey&&(e.key===H.CHEVRON_RIGHT||e.key===H.PERIOD)});W({name:`changeFontFamily`,label:`labels.fontFamily`,trackEvent:!1,perform:(e,t,n,r)=>{let{cachedElements:i,resetAll:a,resetContainers:o,...s}=n;if(a)return{elements:YR(e,t,e=>{let t=i?.get(e.id);return t?iE(e,{...t}):e},!0),appState:{...t,...s},captureUpdate:G.NEVER};let{currentItemFontFamily:c,currentHoveredFontFamily:l}=n,u=G.EVENTUALLY,d,f=!1;if(c)d=c,u=G.IMMEDIATELY;else if(l){d=l,u=G.EVENTUALLY;let n=YT(e,t,{includeBoundTextElement:!0}).filter(e=>R(e));if(n.length>200)f=!0;else{let e=0,t=0;for(;e<n.length&&t<5e3;){let r=n[e];t+=r?.originalText.length||0,e++}t>5e3&&(f=!0)}}let p={appState:{...t,...s},captureUpdate:u};if(d&&!f){let n=new Map,a=new Set,s=!1,u=Array.from(Jh.loadedFontsCache.values()),f=Object.entries(Ys).find(([e,t])=>t===d)?.[0];l&&f&&u.some(e=>e.startsWith(f))&&(s=!0),Object.assign(p,{elements:YR(e,t,e=>{if(R(e)&&(e.fontFamily!==d||c)){let t=iE(e,{fontFamily:d,lineHeight:Xh(d)}),c=i?.get(e.containerId||``)||{},l=r.scene.getContainerElement(e);return o&&l&&c&&K(l,{...c},!1),s||(a=new Set([...a,...Array.from(t.originalText)])),n.set(t,l),t}return e},!0)});let m=`10px ${su({fontFamily:d})}`,h=Array.from(a.values()).join();if(s||window.document.fonts.check(m,h))for(let[e,t]of n)Pb(e,t,r.scene.getNonDeletedElementsMap(),!1);else window.document.fonts.load(m,h).then(e=>{for(let[e,t]of n){let n=r.scene.getElement(e.id),i=t?r.scene.getElement(t.id):null;n&&Pb(n,i,r.scene.getNonDeletedElementsMap(),!1)}r.fonts.onLoaded(e)})}return p},PanelComponent:({elements:e,appState:t,app:n,updateData:r})=>{let i=(0,u.useRef)(new Map),a=(0,u.useRef)(null),[o,s]=(0,u.useState)({}),c=(0,u.useRef)(!0),l=(0,u.useMemo)(()=>{let r=(e,n)=>XR(e,t,e=>{if(R(e))return e.fontFamily;let t=zb(e,n);return t?t.fontFamily:null},e=>R(e)||zb(e,n)!==null,e=>e?null:t.currentItemFontFamily||tc);return o.openPopup===`fontFamily`&&t.openPopup===`fontFamily`?r(Array.from(i.current?.values()??[]),i.current):!o.openPopup&&t.openPopup!==`fontFamily`?r(e,n.scene.getNonDeletedElementsMap()):a.current},[o.openPopup,t,e,n.scene]);return(0,u.useEffect)(()=>{a.current=l},[l]),(0,u.useEffect)(()=>{Object.keys(o).length&&(r(o),s({}))},[o]),(0,u.useEffect)(()=>(c.current=!1,()=>{c.current=!0}),[]),(0,k.jsxs)(`fieldset`,{children:[(0,k.jsx)(`legend`,{children:q(`labels.fontFamily`)}),(0,k.jsx)(KR,{isOpened:t.openPopup===`fontFamily`,selectedFontFamily:l,hoveredFontFamily:t.currentHoveredFontFamily,onSelect:e=>{s({openPopup:null,currentHoveredFontFamily:null,currentItemFontFamily:e}),i.current.clear()},onHover:e=>{s({currentHoveredFontFamily:e,cachedElements:new Map(i.current),resetContainers:!0})},onLeave:()=>{s({currentHoveredFontFamily:null,cachedElements:new Map(i.current),resetAll:!0})},onPopupChange:a=>{if(a){i.current.clear();let{editingTextElement:r}=t;if(r?.type===`text`){let e=n.scene.getElement(r.id);i.current.set(r.id,iE(e||r,{},!0))}else{let n=YT(e,t,{includeBoundTextElement:!0});for(let e of n)i.current.set(e.id,iE(e,{},!0))}s({openPopup:`fontFamily`})}else{let e={openPopup:null,currentHoveredFontFamily:null,cachedElements:new Map(i.current),resetAll:!0};c.current?r({...o,...e}):s(e),i.current.clear()}}})]})}}),W({name:`changeTextAlign`,label:`Change text alignment`,trackEvent:!1,perform:(e,t,n,r)=>({elements:YR(e,t,e=>{if(R(e)){let t=iE(e,{textAlign:n});return Pb(t,r.scene.getContainerElement(e),r.scene.getNonDeletedElementsMap()),t}return e},!0),appState:{...t,currentItemTextAlign:n},captureUpdate:G.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>{let i=r.scene.getNonDeletedElementsMap();return(0,k.jsxs)(`fieldset`,{children:[(0,k.jsx)(`legend`,{children:q(`labels.textAlign`)}),(0,k.jsx)(UL,{group:`text-align`,options:[{value:`left`,text:q(`labels.left`),icon:gm,testId:`align-left`},{value:`center`,text:q(`labels.center`),icon:_m,testId:`align-horizontal-center`},{value:`right`,text:q(`labels.right`),icon:vm,testId:`align-right`}],value:XR(e,t,e=>{if(R(e))return e.textAlign;let t=zb(e,i);return t?t.textAlign:null},e=>R(e)||zb(e,i)!==null,e=>e?null:t.currentItemTextAlign),onChange:e=>n(e)})]})}}),W({name:`changeVerticalAlign`,label:`Change vertical alignment`,trackEvent:{category:`element`},perform:(e,t,n,r)=>({elements:YR(e,t,e=>{if(R(e)){let t=iE(e,{verticalAlign:n});return Pb(t,r.scene.getContainerElement(e),r.scene.getNonDeletedElementsMap()),t}return e},!0),appState:{...t},captureUpdate:G.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>(0,k.jsx)(`fieldset`,{children:(0,k.jsx)(UL,{group:`text-align`,options:[{value:Ec.TOP,text:q(`labels.alignTop`),icon:(0,k.jsx)(ym,{theme:t.theme}),testId:`align-top`},{value:Ec.MIDDLE,text:q(`labels.centerVertically`),icon:(0,k.jsx)(xm,{theme:t.theme}),testId:`align-middle`},{value:Ec.BOTTOM,text:q(`labels.alignBottom`),icon:(0,k.jsx)(bm,{theme:t.theme}),testId:`align-bottom`}],value:XR(e,t,e=>{if(R(e)&&e.containerId)return e.verticalAlign;let t=zb(e,r.scene.getNonDeletedElementsMap());return t?t.verticalAlign:null},e=>R(e)||zb(e,r.scene.getNonDeletedElementsMap())!==null,e=>e?null:Ec.MIDDLE),onChange:e=>n(e)})})}),W({name:`changeRoundness`,label:`Change edge roundness`,trackEvent:!1,perform:(e,t,n)=>({elements:YR(e,t,e=>z(e)?e:iE(e,{roundness:n===`round`?{type:jd(e.type)?jc.ADAPTIVE_RADIUS:jc.PROPORTIONAL_RADIUS}:null})),appState:{...t,currentItemRoundness:n},captureUpdate:G.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let r=XT(eD(e),t).some(e=>e.roundness?.type===jc.LEGACY);return(0,k.jsxs)(`fieldset`,{children:[(0,k.jsx)(`legend`,{children:q(`labels.edges`)}),(0,k.jsx)(UL,{group:`edges`,options:[{value:`sharp`,text:q(`labels.sharp`),icon:Jp},{value:`round`,text:q(`labels.round`),icon:Yp}],value:XR(e,t,e=>r?null:e.roundness?`round`:`sharp`,e=>!bd(e)&&e.hasOwnProperty(`roundness`),e=>e?null:t.currentItemRoundness),onChange:e=>n(e)})]})}});var tz=e=>[{value:null,text:q(`labels.arrowhead_none`),keyBinding:`q`,icon:Xp},{value:`arrow`,text:q(`labels.arrowhead_arrow`),keyBinding:`w`,icon:(0,k.jsx)(Zp,{flip:e})},{value:`triangle`,text:q(`labels.arrowhead_triangle`),icon:(0,k.jsx)(tm,{flip:e}),keyBinding:`e`},{value:`triangle_outline`,text:q(`labels.arrowhead_triangle_outline`),icon:(0,k.jsx)(nm,{flip:e}),keyBinding:`r`},{value:`circle`,text:q(`labels.arrowhead_circle`),keyBinding:`a`,icon:(0,k.jsx)(Qp,{flip:e})},{value:`circle_outline`,text:q(`labels.arrowhead_circle_outline`),keyBinding:`s`,icon:(0,k.jsx)($p,{flip:e})},{value:`diamond`,text:q(`labels.arrowhead_diamond`),icon:(0,k.jsx)(rm,{flip:e}),keyBinding:`d`},{value:`diamond_outline`,text:q(`labels.arrowhead_diamond_outline`),icon:(0,k.jsx)(im,{flip:e}),keyBinding:`f`},{value:`bar`,text:q(`labels.arrowhead_bar`),keyBinding:`z`,icon:(0,k.jsx)(em,{flip:e})},{value:`crowfoot_one`,text:q(`labels.arrowhead_crowfoot_one`),icon:(0,k.jsx)(om,{flip:e}),keyBinding:`c`},{value:`crowfoot_many`,text:q(`labels.arrowhead_crowfoot_many`),icon:(0,k.jsx)(am,{flip:e}),keyBinding:`x`},{value:`crowfoot_one_or_many`,text:q(`labels.arrowhead_crowfoot_one_or_many`),icon:(0,k.jsx)(sm,{flip:e}),keyBinding:`v`}];W({name:`changeArrowhead`,label:`Change arrowheads`,trackEvent:!1,perform:(e,t,n)=>({elements:YR(e,t,e=>{if(yd(e)){let{position:t,type:r}=n;if(t===`start`)return iE(e,{startArrowhead:r});if(t===`end`)return iE(e,{endArrowhead:r})}return e}),appState:{...t,[n.position===`start`?`currentItemStartArrowhead`:`currentItemEndArrowhead`]:n.type},captureUpdate:G.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let r=aL().rtl;return(0,k.jsxs)(`fieldset`,{children:[(0,k.jsx)(`legend`,{children:q(`labels.arrowheads`)}),(0,k.jsxs)(`div`,{className:`iconSelectList buttonList`,children:[(0,k.jsx)(DR,{label:`arrowhead_start`,options:tz(!r),value:XR(e,t,e=>yd(e)&&P_(e.type)?e.startArrowhead:t.currentItemStartArrowhead,!0,t.currentItemStartArrowhead),onChange:e=>n({position:`start`,type:e}),numberOfOptionsToAlwaysShow:4}),(0,k.jsx)(DR,{label:`arrowhead_end`,group:`arrowheads`,options:tz(!!r),value:XR(e,t,e=>yd(e)&&P_(e.type)?e.endArrowhead:t.currentItemEndArrowhead,!0,t.currentItemEndArrowhead),onChange:e=>n({position:`end`,type:e}),numberOfOptionsToAlwaysShow:4})]})]})}}),W({name:`changeArrowType`,label:`Change arrow types`,trackEvent:!1,perform:(e,t,n,r)=>{let i=YR(e,t,i=>{if(!bd(i))return i;let a=iE(i,{roundness:n===Vc.round?{type:jc.PROPORTIONAL_RADIUS}:null,elbowed:n===Vc.elbow,points:n===Vc.elbow||i.elbowed?[i.points[0],i.points[i.points.length-1]]:i.points});if(z(a)){let n=r.scene.getNonDeletedElementsMap();r.dismissLinearEditor();let i=U.getPointAtIndexGlobalCoordinates(a,0,n),o=U.getPointAtIndexGlobalCoordinates(a,-1,n),s=!a.startBinding&&Qv(Su(i),e,n,t.zoom,!1,!0),c=!a.endBinding&&Qv(Su(o),e,n,t.zoom,!1,!0),l=s||a.startBinding&&n.get(a.startBinding.elementId),u=c||a.endBinding&&n.get(a.endBinding.elementId),d=s?sy(a,s,`start`):i,f=c?sy(a,c,`end`):o;s&&qv(a,s,`start`,n),c&&qv(a,c,`end`,n),K(a,{points:[d,f].map(e=>P(e[0]-a.x,e[1]-a.y)),...l&&a.startBinding?{startBinding:{...a.startBinding,...fy(a,l,`start`,n)}}:{},...u&&a.endBinding?{endBinding:{...a.endBinding,...fy(a,u,`end`,n)}}:{}}),U.updateEditorMidPointsCache(a,n,r.state)}return a}),a={...t,currentItemArrowType:n},o=t.selectedLinearElement?.elementId;if(o){let e=i.find(e=>e.id===o);e&&(a.selectedLinearElement=new U(e))}return{elements:i,appState:a,captureUpdate:G.IMMEDIATELY}},PanelComponent:({elements:e,appState:t,updateData:n})=>(0,k.jsxs)(`fieldset`,{children:[(0,k.jsx)(`legend`,{children:q(`labels.arrowtypes`)}),(0,k.jsx)(UL,{group:`arrowtypes`,options:[{value:Vc.sharp,text:q(`labels.arrowtype_sharp`),icon:sh,testId:`sharp-arrow`},{value:Vc.round,text:q(`labels.arrowtype_round`),icon:lh,testId:`round-arrow`},{value:Vc.elbow,text:q(`labels.arrowtype_elbowed`),icon:ch,testId:`elbow-arrow`}],value:XR(e,t,e=>bd(e)?e.elbowed?Vc.elbow:e.roundness?Vc.round:Vc.sharp:null,e=>bd(e),e=>e?null:t.currentItemArrowType),onChange:e=>n(e)})]})});var nz=({viewportX:e,viewportY:t,nextZoom:n},r)=>{let i=e-r.offsetLeft,a=t-r.offsetTop,o=r.zoom.value,s=r.scrollX+(i-i/o),c=r.scrollY+(a-a/o),l=-(i-i/n),u=-(a-a/n);return{scrollX:s+l,scrollY:c+u,zoom:{value:n}}},rz=()=>{let e=document.querySelector(`.excalidraw-tooltip`);if(e)return e;let t=document.createElement(`div`);return document.body.appendChild(t),t.classList.add(`excalidraw-tooltip`),t},iz=(e,t,n=`bottom`)=>{let r=e.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight,o=t.left+t.width/2-r.width/2;o<0?o=5:o+r.width>=i&&(o=i-r.width-5);let s;n===`bottom`?(s=t.top+t.height+5,s+r.height>=a&&(s=t.top-r.height-5)):(s=t.top-r.height-5,s<0&&(s=t.top+t.height+5)),Object.assign(e.style,{top:`${s}px`,left:`${o}px`})},az=(e,t,n,r)=>{t.classList.add(`excalidraw-tooltip--visible`),t.style.minWidth=r?`50ch`:`10ch`,t.style.maxWidth=r?`50ch`:`15ch`,t.textContent=n,iz(t,e.getBoundingClientRect())},oz=({children:e,label:t,long:n=!1,style:r,disabled:i})=>((0,u.useEffect)(()=>()=>rz().classList.remove(`excalidraw-tooltip--visible`),[]),i?null:(0,k.jsx)(`div`,{className:`excalidraw-tooltip-wrapper`,onPointerEnter:e=>az(e.currentTarget,rz(),t,n),onPointerLeave:()=>rz().classList.remove(`excalidraw-tooltip--visible`),style:r,children:e}));W({name:`changeViewBackgroundColor`,label:`labels.canvasBackground`,paletteName:`Change canvas background color`,trackEvent:!1,predicate:(e,t,n,r)=>!!r.props.UIOptions.canvasActions.changeViewBackgroundColor&&!t.viewModeEnabled,perform:(e,t,n)=>({appState:{...t,...n},captureUpdate:n.viewBackgroundColor?G.IMMEDIATELY:G.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n,appProps:r})=>(0,k.jsx)(SR,{palette:null,topPicks:Ts,label:q(`labels.canvasBackground`),type:`canvasBackground`,color:t.viewBackgroundColor,onChange:e=>n({viewBackgroundColor:e}),"data-testid":`canvas-background-picker`,elements:e,appState:t,updateData:n})});var sz=W({name:`clearCanvas`,label:`labels.clearCanvas`,paletteName:`Clear canvas`,icon:Kf,trackEvent:{category:`canvas`},predicate:(e,t,n,r)=>!!r.props.UIOptions.canvasActions.clearCanvas&&!t.viewModeEnabled&&t.openDialog?.name!==`elementLinkSelector`,perform:(e,t,n,r)=>(r.imageCache.clear(),{elements:e.map(e=>iE(e,{isDeleted:!0})),appState:{...qc(),files:{},theme:t.theme,penMode:t.penMode,penDetected:t.penDetected,exportBackground:t.exportBackground,exportEmbedScene:t.exportEmbedScene,gridSize:t.gridSize,gridStep:t.gridStep,gridModeEnabled:t.gridModeEnabled,stats:t.stats,pasteDialog:t.pasteDialog,activeTool:t.activeTool.type===`image`?{...t.activeTool,type:`selection`}:t.activeTool},captureUpdate:G.IMMEDIATELY})}),cz=W({name:`zoomIn`,label:`buttons.zoomIn`,viewMode:!0,icon:Uf,trackEvent:{category:`canvas`},perform:(e,t,n,r)=>({appState:{...t,...nz({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Iy(t.zoom.value+pc)},t),userToFollow:null},captureUpdate:G.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>(0,k.jsx)(fL,{type:`button`,className:`zoom-in-button zoom-button`,icon:Uf,title:`${q(`buttons.zoomIn`)} \u2014 ${L(`CtrlOrCmd++`)}`,"aria-label":q(`buttons.zoomIn`),disabled:t.zoom.value>=30,onClick:()=>{e(null)}}),keyTest:e=>(e.code===kg.EQUAL||e.code===kg.NUM_ADD)&&(e[H.CTRL_OR_CMD]||e.shiftKey)}),lz=W({name:`zoomOut`,label:`buttons.zoomOut`,icon:Wf,viewMode:!0,trackEvent:{category:`canvas`},perform:(e,t,n,r)=>({appState:{...t,...nz({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Iy(t.zoom.value-pc)},t),userToFollow:null},captureUpdate:G.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>(0,k.jsx)(fL,{type:`button`,className:`zoom-out-button zoom-button`,icon:Wf,title:`${q(`buttons.zoomOut`)} \u2014 ${L(`CtrlOrCmd+-`)}`,"aria-label":q(`buttons.zoomOut`),disabled:t.zoom.value<=mc,onClick:()=>{e(null)}}),keyTest:e=>(e.code===kg.MINUS||e.code===kg.NUM_SUBTRACT)&&(e[H.CTRL_OR_CMD]||e.shiftKey)}),uz=W({name:`resetZoom`,label:`buttons.resetZoom`,icon:Gf,viewMode:!0,trackEvent:{category:`canvas`},perform:(e,t,n,r)=>({appState:{...t,...nz({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Iy(1)},t),userToFollow:null},captureUpdate:G.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>(0,k.jsx)(oz,{label:q(`buttons.resetZoom`),style:{height:`100%`},children:(0,k.jsxs)(fL,{type:`button`,className:`reset-zoom-button zoom-button`,title:q(`buttons.resetZoom`),"aria-label":q(`buttons.resetZoom`),onClick:()=>{e(null)},children:[(t.zoom.value*100).toFixed(0),`%`]})}),keyTest:e=>(e.code===kg.ZERO||e.code===kg.NUM_ZERO)&&(e[H.CTRL_OR_CMD]||e.shiftKey)}),dz=(e,t,n=1)=>{let[r,i,a,o]=e,s=a-r,c=t.width/s,l=o-i,u=t.height/l,d=Math.min(c,u)*el(n,.1,1);return Math.min(d,1)},fz=({bounds:e,appState:t,canvasOffsets:n,fitToViewport:r=!1,viewportZoomFactor:i=1,minZoom:a=-1/0,maxZoom:o=1/0})=>{i=el(i,mc,30);let[s,c,l,u]=e,d=(s+l)/2,f=(c+u)/2,p=n?.left??0,m=n?.top??0,h=n?.right??0,g=n?.bottom??0,_=t.width-p-h,v=t.height-m-g,y;if(r){let e=l-s,t=u-c;y=Math.min(_/e,v/t)*i}else y=dz(e,{width:_,height:v},i);let b=Iy(el(nl(y,pc,`floor`),a,o)),x=Py({scenePoint:{x:d,y:f},viewportDimensions:{width:t.width,height:t.height},offsets:n,zoom:{value:b}});return{appState:{...t,scrollX:x.scrollX,scrollY:x.scrollY,zoom:{value:b}},captureUpdate:G.EVENTUALLY}},pz=({canvasOffsets:e,targetElements:t,appState:n,fitToViewport:r,viewportZoomFactor:i,minZoom:a,maxZoom:o})=>fz({canvasOffsets:e,bounds:bv(eD(t)),appState:n,fitToViewport:r,viewportZoomFactor:i,minZoom:a,maxZoom:o});W({name:`zoomToFitSelectionInViewport`,label:`labels.zoomToFitViewport`,icon:Qm,trackEvent:{category:`canvas`},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t);return pz({targetElements:i.length?i:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:r.getEditorUIOffsets()})},keyTest:e=>e.code===kg.TWO&&e.shiftKey&&!e.altKey&&!e[H.CTRL_OR_CMD]}),W({name:`zoomToFitSelection`,label:`helpDialog.zoomToSelection`,icon:Qm,trackEvent:{category:`canvas`},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t);return pz({targetElements:i.length?i:e,appState:{...t,userToFollow:null},fitToViewport:!0,canvasOffsets:r.getEditorUIOffsets()})},keyTest:e=>e.code===kg.THREE&&e.shiftKey&&!e.altKey&&!e[H.CTRL_OR_CMD]}),W({name:`zoomToFit`,label:`helpDialog.zoomToFit`,icon:Qm,viewMode:!0,trackEvent:{category:`canvas`},perform:(e,t,n,r)=>pz({targetElements:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:r.getEditorUIOffsets()}),keyTest:e=>e.code===kg.ONE&&e.shiftKey&&!e.altKey&&!e[H.CTRL_OR_CMD]});var mz=W({name:`toggleTheme`,label:(e,t)=>t.theme===Qs.DARK?`buttons.lightMode`:`buttons.darkMode`,keywords:[`toggle`,`dark`,`light`,`mode`,`theme`],icon:e=>e.theme===Qs.LIGHT?Yf:Xf,viewMode:!0,trackEvent:{category:`canvas`},perform:(e,t,n)=>({appState:{...t,theme:n||(t.theme===Qs.LIGHT?Qs.DARK:Qs.LIGHT)},captureUpdate:G.EVENTUALLY}),keyTest:e=>e.altKey&&e.shiftKey&&e.code===kg.D,predicate:(e,t,n,r)=>!!r.props.UIOptions.canvasActions.toggleTheme});W({name:`toggleEraserTool`,label:`toolBar.eraser`,trackEvent:{category:`toolbar`},perform:(e,t)=>{let n;return n=Qc(t)?gu(t,{...t.activeTool.lastActiveTool||{type:`selection`},lastActiveToolBeforeEraser:null}):gu(t,{type:`eraser`,lastActiveToolBeforeEraser:t.activeTool}),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:n},captureUpdate:G.IMMEDIATELY}},keyTest:e=>e.key===H.E});var hz=W({name:`toggleHandTool`,label:`toolBar.hand`,paletteName:`Toggle hand tool`,trackEvent:{category:`toolbar`},icon:wm,viewMode:!1,perform:(e,t,n,r)=>{let i;return $c(t)?i=gu(t,{...t.activeTool.lastActiveTool||{type:`selection`},lastActiveToolBeforeEraser:null}):(i=gu(t,{type:`hand`,lastActiveToolBeforeEraser:t.activeTool}),cx(r.interactiveCanvas,Vs.GRAB)),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:i},captureUpdate:G.IMMEDIATELY}},keyTest:e=>!e.altKey&&!e[H.CTRL_OR_CMD]&&e.key===H.H}),gz=W({name:`finalize`,label:``,trackEvent:!1,perform:(e,t,n,r)=>{let{interactiveCanvas:i,focusContainer:a,scene:o}=r,s=o.getNonDeletedElementsMap();if(t.editingLinearElement){let{elementId:n,startBindingElement:r,endBindingElement:i}=t.editingLinearElement,a=U.getElement(n,s);if(a)return Sd(a)&&Lv(a,r,i,s,o),{elements:a.points.length<2||oE(a)?e.filter(e=>e.id!==a.id):void 0,appState:{...t,cursorButton:`up`,editingLinearElement:null},captureUpdate:G.IMMEDIATELY}}let c=e,l=t.pendingImageElementId&&o.getElement(t.pendingImageElementId);l&&K(l,{isDeleted:!0},!1),window.document.activeElement instanceof HTMLElement&&a();let u=t.multiElement?t.multiElement:t.newElement?.type===`freedraw`?t.newElement:null;if(u){if(u.type!==`freedraw`&&t.lastPointerDownWith!==`touch`){let{points:e,lastCommittedPoint:t}=u;(!t||e[e.length-1]!==t)&&K(u,{points:u.points.slice(0,-1)})}oE(u)&&(c=c.filter(e=>e.id!==u.id));let n=Xg(u.points,t.zoom.value);if((u.type===`line`||u.type===`freedraw`)&&n){let e=u.points,t=e[0];K(u,{points:e.map((n,r)=>r===e.length-1?P(t[0],t[1]):n)})}if(Sd(u)&&!n&&u.points.length>1){let[n,r]=U.getPointAtIndexGlobalCoordinates(u,-1,Nu(e));Gv(u,t,{x:n,y:r},s,e)}}(!t.activeTool.locked&&t.activeTool.type!==`freedraw`||!u)&&sx(i);let d;return d=t.activeTool.type===`eraser`?gu(t,{...t.activeTool.lastActiveTool||{type:`selection`},lastActiveToolBeforeEraser:null}):gu(t,{type:`selection`}),{elements:c,appState:{...t,cursorButton:`up`,activeTool:(t.activeTool.locked||t.activeTool.type===`freedraw`)&&u?t.activeTool:d,activeEmbeddable:null,newElement:null,selectionElement:null,multiElement:null,editingTextElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:u&&!t.activeTool.locked&&t.activeTool.type!==`freedraw`?{...t.selectedElementIds,[u.id]:!0}:t.selectedElementIds,selectedLinearElement:u&&yd(u)?new U(u):t.selectedLinearElement,pendingImageElementId:null},captureUpdate:G.IMMEDIATELY}},keyTest:(e,t)=>e.key===H.ESCAPE&&(t.editingLinearElement!==null||!t.newElement&&t.multiElement===null)||(e.key===H.ESCAPE||e.key===H.ENTER)&&t.multiElement!==null,PanelComponent:({appState:e,updateData:t,data:n})=>(0,k.jsx)(fL,{type:`button`,icon:mp,title:q(`buttons.done`),"aria-label":q(`buttons.done`),onClick:t,visible:e.multiElement!=null,size:n?.size||`medium`,style:{pointerEvents:`all`}})}),_z=e=>{let{id:t}=Yq(),[n,r]=(0,u.useState)(e.value);return(0,k.jsxs)(`div`,{className:`ProjectName`,children:[(0,k.jsx)(`label`,{className:`ProjectName-label`,htmlFor:`filename`,children:`${e.label}:`}),(0,k.jsx)(`input`,{type:`text`,className:`TextInput`,onBlur:t=>{e.ignoreFocus||Au(t.target);let n=t.target.value;n!==e.value&&e.onChange(n)},onKeyDown:e=>{if(e.key===H.ENTER){if(e.preventDefault(),e.nativeEvent.isComposing||e.keyCode===229)return;e.currentTarget.blur()}},id:`${t}-filename`,value:n,onChange:e=>r(e.target.value)})]})},vz=e=>{let t=e.title||(e.value===Qs.DARK?q(`buttons.lightMode`):q(`buttons.darkMode`));return(0,k.jsx)(fL,{type:`icon`,icon:e.value===Qs.LIGHT?yz.MOON:yz.SUN,title:t,"aria-label":t,onClick:()=>e.onChange(e.value===Qs.DARK?Qs.LIGHT:Qs.DARK),"data-testid":`toggle-dark-mode`})},yz={SUN:(0,k.jsx)(`svg`,{width:`512`,height:`512`,className:`rtl-mirror`,viewBox:`0 0 512 512`,children:(0,k.jsx)(`path`,{fill:`currentColor`,d:`M256 160c-52.9 0-96 43.1-96 96s43.1 96 96 96 96-43.1 96-96-43.1-96-96-96zm246.4 80.5l-94.7-47.3 33.5-100.4c4.5-13.6-8.4-26.5-21.9-21.9l-100.4 33.5-47.4-94.8c-6.4-12.8-24.6-12.8-31 0l-47.3 94.7L92.7 70.8c-13.6-4.5-26.5 8.4-21.9 21.9l33.5 100.4-94.7 47.4c-12.8 6.4-12.8 24.6 0 31l94.7 47.3-33.5 100.5c-4.5 13.6 8.4 26.5 21.9 21.9l100.4-33.5 47.3 94.7c6.4 12.8 24.6 12.8 31 0l47.3-94.7 100.4 33.5c13.6 4.5 26.5-8.4 21.9-21.9l-33.5-100.4 94.7-47.3c13-6.5 13-24.7.2-31.1zm-155.9 106c-49.9 49.9-131.1 49.9-181 0-49.9-49.9-49.9-131.1 0-181 49.9-49.9 131.1-49.9 181 0 49.9 49.9 49.9 131.1 0 181z`})}),MOON:(0,k.jsx)(`svg`,{width:`512`,height:`512`,className:`rtl-mirror`,viewBox:`0 0 512 512`,children:(0,k.jsx)(`path`,{fill:`currentColor`,d:`M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z`})})},bz=(e,{selectedElementIds:t},n)=>{e=eD(e);let r=n&&qT(e,{selectedElementIds:t}),i=null,a=r?YT(e,{selectedElementIds:t},{includeBoundTextElement:!0}):e;return r&&(a.length===1&&gd(a[0])?(i=a[0],a=HT(e,i)):a.length>1&&(a=YT(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}))),{exportingFrame:i,exportedElements:Qu(a)}},xz=async(e,t,n,r,{exportBackground:i,exportPadding:a=10,viewBackgroundColor:o,name:s=n.name||`Untitled`,fileHandle:c=null,exportingFrame:l=null})=>{if(t.length===0)throw Error(q(`alerts.cannotExportEmptyCanvas`));if(e===`svg`||e===`clipboard-svg`){let u=vC(t,{exportBackground:i,exportWithDarkMode:n.exportWithDarkMode,viewBackgroundColor:o,exportPadding:a,exportScale:n.exportScale,exportEmbedScene:n.exportEmbedScene&&e===`svg`},r,{exportingFrame:l});if(e===`svg`)return jS(u.then(e=>new Blob([e.outerHTML],{type:j.svg})),{description:`Export to SVG`,name:s,extension:n.exportEmbedScene?`excalidraw.svg`:`svg`,mimeTypes:[cc.svg],fileHandle:c});if(e===`clipboard-svg`){let e=await u.then(e=>e.outerHTML);try{await Zw(e)}catch{throw Error(q(`errors.copyToSystemClipboardFailed`))}return}}let u=gC(t,n,r,{exportBackground:i,viewBackgroundColor:o,exportPadding:a,exportingFrame:l});if(e===`png`){let e=hD(u);return n.exportEmbedScene&&(e=e.then(e=>A(async()=>{let{encodePngMetadata:e}=await import(`./image-GAAHSSAO-D1P4Y62B.js`);return{encodePngMetadata:e}},[],import.meta.url).then(({encodePngMetadata:i})=>i({blob:e,metadata:NS(t,n,r,`local`)})))),jS(e,{description:`Export to PNG`,name:s,extension:n.exportEmbedScene?`excalidraw.png`:`png`,mimeTypes:[cc.png],fileHandle:c})}if(e===`clipboard`)try{await Xw(hD(u))}catch(e){throw console.warn(e),e.name===`CANVAS_POSSIBLY_TOO_BIG`?Error(q(`canvasError.canvasTooBig`)):Ns&&e.name===`TypeError`?Error(`${q(`alerts.couldNotCopyToClipboard`)}
|
|
101
|
+
|
|
102
|
+
${q(`hints.firefox_clipboard_write`)}`):Error(q(`alerts.couldNotCopyToClipboard`))}else throw Error(`Unsupported export type`)},Sz=async(e,t,n,r)=>{let{exportBackground:i,viewBackgroundColor:a,fileHandle:o}=t,s=oD(o);if(!o||!sD(s))throw Error(`fileHandle should exist and should be of type svg or png when resaving`);t={...t,exportEmbedScene:!0};let{exportedElements:c,exportingFrame:l}=bz(e,t,!1);return await xz(s,c,t,n,{exportBackground:i,viewBackgroundColor:a,name:r,fileHandle:o,exportingFrame:l}),{fileHandle:o}},Cz=({children:e,checked:t,onChange:n,className:r})=>(0,k.jsxs)(`div`,{className:O(`Checkbox`,r,{"is-checked":t}),onClick:e=>{n(!t,e),e.currentTarget.querySelector(`.Checkbox-box`).focus()},children:[(0,k.jsx)(`button`,{type:`button`,className:`Checkbox-box`,role:`checkbox`,"aria-checked":t,children:ap}),(0,k.jsx)(`div`,{className:`Checkbox-label`,children:e})]}),wz=W({name:`changeProjectName`,label:`labels.fileTitle`,trackEvent:!1,perform:(e,t,n)=>({appState:{...t,name:n},captureUpdate:G.EVENTUALLY}),PanelComponent:({appState:e,updateData:t,appProps:n,data:r,app:i})=>(0,k.jsx)(_z,{label:q(`labels.fileTitle`),value:i.getName(),onChange:e=>t(e),ignoreFocus:r?.ignoreFocus??!1})}),Tz=W({name:`changeExportScale`,label:`imageExportDialog.scale`,trackEvent:{category:`export`,action:`scale`},perform:(e,t,n)=>({appState:{...t,exportScale:n},captureUpdate:G.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let r=eD(e),i=qT(r,t)?YT(r,t):r;return(0,k.jsx)(k.Fragment,{children:yc.map(e=>{let[r,a]=SC(i,10,e),o=`${q(`imageExportDialog.label.scale`)} ${e}x (${r}x${a})`;return(0,k.jsx)(fL,{size:`small`,type:`radio`,icon:`${e}x`,name:`export-canvas-scale`,title:o,"aria-label":o,id:`export-canvas-scale`,checked:e===t.exportScale,onChange:()=>n(e)},e)})})}}),Ez=W({name:`changeExportBackground`,label:`imageExportDialog.label.withBackground`,trackEvent:{category:`export`,action:`toggleBackground`},perform:(e,t,n)=>({appState:{...t,exportBackground:n},captureUpdate:G.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>(0,k.jsx)(Cz,{checked:e.exportBackground,onChange:e=>t(e),children:q(`imageExportDialog.label.withBackground`)})}),Dz=W({name:`changeExportEmbedScene`,label:`imageExportDialog.tooltip.embedScene`,trackEvent:{category:`export`,action:`embedScene`},perform:(e,t,n)=>({appState:{...t,exportEmbedScene:n},captureUpdate:G.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>(0,k.jsxs)(Cz,{checked:e.exportEmbedScene,onChange:e=>t(e),children:[q(`imageExportDialog.label.embedScene`),(0,k.jsx)(oz,{label:q(`imageExportDialog.tooltip.embedScene`),long:!0,children:(0,k.jsx)(`div`,{className:`excalidraw-tooltip-icon`,children:_p})})]})}),Oz=W({name:`saveToActiveFile`,label:`buttons.save`,icon:Qf,trackEvent:{category:`export`},predicate:(e,t,n,r)=>!!r.props.UIOptions.canvasActions.saveToActiveFile&&!!t.fileHandle&&!t.viewModeEnabled,perform:async(e,t,n,r)=>{let i=!!t.fileHandle;try{let{fileHandle:n}=cD(t.fileHandle)?await Sz(e,t,r.files,r.getName()):await PS(e,t,r.files,r.getName());return{captureUpdate:G.EVENTUALLY,appState:{...t,fileHandle:n,toast:i?{message:n?.name?q(`toast.fileSavedToFilename`).replace(`{filename}`,`"${n.name}"`):q(`toast.fileSaved`)}:null}}}catch(e){return e?.name===`AbortError`?console.warn(e):console.error(e),{captureUpdate:G.EVENTUALLY}}},keyTest:e=>e.key===H.S&&e[H.CTRL_OR_CMD]&&!e.shiftKey}),kz=W({name:`saveFileToDisk`,label:`exportDialog.disk_title`,icon:Qf,viewMode:!0,trackEvent:{category:`export`},perform:async(e,t,n,r)=>{try{let{fileHandle:n}=await PS(e,{...t,fileHandle:null},r.files,r.getName());return{captureUpdate:G.EVENTUALLY,appState:{...t,openDialog:null,fileHandle:n,toast:{message:q(`toast.fileSaved`)}}}}catch(e){return e?.name===`AbortError`?console.warn(e):console.error(e),{captureUpdate:G.EVENTUALLY}}},keyTest:e=>e.key===H.S&&e.shiftKey&&e[H.CTRL_OR_CMD],PanelComponent:({updateData:e})=>(0,k.jsx)(fL,{type:`button`,icon:cp,title:q(`buttons.saveAs`),"aria-label":q(`buttons.saveAs`),showAriaLabel:Jq().editor.isMobile,hidden:!fs,onClick:()=>e(null),"data-testid":`save-as-button`})}),Az=W({name:`loadScene`,label:`buttons.load`,trackEvent:{category:`export`},predicate:(e,t,n,r)=>!!r.props.UIOptions.canvasActions.loadScene&&!t.viewModeEnabled,perform:async(e,t,n,r)=>{try{let{elements:n,appState:r,files:i}=await FS(t,e);return{elements:n,appState:r,files:i,captureUpdate:G.IMMEDIATELY}}catch(n){return n?.name===`AbortError`?(console.warn(n),!1):{elements:e,appState:{...t,errorMessage:n.message},files:r.files,captureUpdate:G.EVENTUALLY}}},keyTest:e=>e[H.CTRL_OR_CMD]&&e.key===H.O}),jz=W({name:`exportWithDarkMode`,label:`imageExportDialog.label.darkMode`,trackEvent:{category:`export`,action:`toggleTheme`},perform:(e,t,n)=>({appState:{...t,exportWithDarkMode:n},captureUpdate:G.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>(0,k.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginTop:`-45px`,marginBottom:`10px`},children:(0,k.jsx)(vz,{value:e.exportWithDarkMode?Qs.DARK:Qs.LIGHT,onChange:e=>{t(e===Qs.DARK)},title:q(`imageExportDialog.label.darkMode`)})})}),Mz=`{}`,Nz=W({name:`copyStyles`,label:`labels.copyStyles`,icon:Zm,trackEvent:{category:`element`},perform:(e,t,n,r)=>{let i=[],a=e.find(e=>t.selectedElementIds[e.id]);if(i.push(a),a&&kd(a)){let e=zb(a,r.scene.getNonDeletedElementsMap());i.push(e)}return a&&(Mz=JSON.stringify(i)),{appState:{...t,toast:{message:q(`toast.copyStyles`)}},captureUpdate:G.EVENTUALLY}},keyTest:e=>e[H.CTRL_OR_CMD]&&e.altKey&&e.code===kg.C}),Pz=W({name:`pasteStyles`,label:`labels.pasteStyles`,icon:Zm,trackEvent:{category:`element`},perform:(e,t,n,r)=>{let i=JSON.parse(Mz),a=i[0],o=i[1];if(!Dd(a))return{elements:e,captureUpdate:G.EVENTUALLY};let s=YT(e,t,{includeBoundTextElement:!0}),c=s.map(e=>e.id);return{elements:e.map(e=>{if(c.includes(e.id)){let t=a;if(R(e)&&e.containerId&&(t=o),!t)return e;let n=iE(e,{backgroundColor:t?.backgroundColor,strokeWidth:t?.strokeWidth,strokeColor:t?.strokeColor,strokeStyle:t?.strokeStyle,fillStyle:t?.fillStyle,opacity:t?.opacity,roughness:t?.roughness,roundness:t.roundness?Nd(t.roundness.type,e)?t.roundness:Pd(e):null});if(R(n)){let e=t.fontSize||20,i=t.fontFamily||tc;n=iE(n,{fontSize:e,fontFamily:i,textAlign:t.textAlign||`left`,lineHeight:t.lineHeight||Xh(i)});let a=null;n.containerId&&(a=s.find(e=>R(n)&&e.id===n.containerId)||null),Pb(n,a,r.scene.getNonDeletedElementsMap())}return n.type===`arrow`&&bd(t)&&(n=iE(n,{startArrowhead:t.startArrowhead,endArrowhead:t.endArrowhead})),gd(e)&&(n=iE(n,{roundness:null,backgroundColor:`transparent`})),n}return e}),captureUpdate:G.IMMEDIATELY}},keyTest:e=>e[H.CTRL_OR_CMD]&&e.altKey&&e.code===kg.V});W({name:`toggleCanvasMenu`,label:`buttons.menu`,trackEvent:{category:`menu`},perform:(e,t)=>({appState:{...t,openMenu:t.openMenu===`canvas`?null:`canvas`},captureUpdate:G.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>(0,k.jsx)(fL,{type:`button`,icon:Zf,"aria-label":q(`buttons.menu`),onClick:t,selected:e.openMenu===`canvas`})}),W({name:`toggleEditMenu`,label:`buttons.edit`,trackEvent:{category:`menu`},perform:(e,t)=>({appState:{...t,openMenu:t.openMenu===`shape`?null:`shape`},captureUpdate:G.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n})=>(0,k.jsx)(fL,{visible:XE(t,eD(e)),type:`button`,icon:up,"aria-label":q(`buttons.edit`),onClick:n,selected:t.openMenu===`shape`})});var Fz=W({name:`toggleShortcuts`,label:`welcomeScreen.defaults.helpHint`,icon:ep,viewMode:!0,trackEvent:{category:`menu`,action:`toggleHelpDialog`},perform:(e,t,n,{focusContainer:r})=>(t.openDialog?.name===`help`&&r(),{appState:{...t,openDialog:t.openDialog?.name===`help`?null:{name:`help`}},captureUpdate:G.EVENTUALLY}),keyTest:e=>e.key===H.QUESTION_MARK}),Iz=e=>{if(e.length>=2){let t=e[0].groupIds;for(let n of t)if(e.reduce((e,t)=>e&&Ky(t,n),!0))return!0}return!1},Lz=(e,t,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});return r.length>=2&&!Iz(r)&&!UT(r)},Rz=W({name:`group`,label:`labels.group`,icon:e=>(0,k.jsx)(Pp,{theme:e.theme}),trackEvent:{category:`element`},perform:(e,t,n,r)=>{let i=ET(r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}));if(i.length<2)return{appState:t,elements:e,captureUpdate:G.EVENTUALLY};let a=Uy(t);if(a.length===1){let n=a[0],r=new Set(qy(e,n).map(e=>e.id)),o=new Set(i.map(e=>e.id));if(new Set([...Array.from(r),...Array.from(o)]).size===r.size)return{appState:t,elements:e,captureUpdate:G.EVENTUALLY}}let o=[...e];new Set(i.map(e=>e.frameId)).size>1&&CT(i).forEach((e,t)=>{NT(e,r.scene.getNonDeletedElementsMap())});let s=gx(),c=Nu(i);o=o.map(e=>c.get(e.id)?iE(e,{groupIds:Xy(e.groupIds,s,t.editingGroupId)}):e);let l=qy(o,s),u=l[l.length-1],d=o.lastIndexOf(u),f=o.slice(d+1),p=Bx([...o.slice(0,d).filter(e=>!Ky(e,s)),...l,...f],Nu(l));return{appState:{...t,...zy(s,{...t,selectedGroupIds:{}},eD(o))},elements:p,captureUpdate:G.IMMEDIATELY}},predicate:(e,t,n,r)=>Lz(e,t,r),keyTest:e=>!e.shiftKey&&e[H.CTRL_OR_CMD]&&e.key===H.G,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>(0,k.jsx)(fL,{hidden:!Lz(e,t,r),type:`button`,icon:(0,k.jsx)(Pp,{theme:t.theme}),onClick:()=>n(null),title:`${q(`labels.group`)} \u2014 ${L(`CtrlOrCmd+G`)}`,"aria-label":q(`labels.group`),visible:qT(eD(e),t)})}),zz=W({name:`ungroup`,label:`labels.ungroup`,icon:e=>(0,k.jsx)(Fp,{theme:e.theme}),trackEvent:{category:`element`},perform:(e,t,n,r)=>{let i=Uy(t),a=Nu(e);if(i.length===0)return{appState:t,elements:e,captureUpdate:G.EVENTUALLY};let o=[...e],s=[];o=o.map(e=>{Ad(e)&&s.push(e.id);let n=Zy(e.groupIds,t.selectedGroupIds);return n.length===e.groupIds.length?e:iE(e,{groupIds:n})});let c=By(t,eD(o),t,null),l=r.scene.getSelectedElements(t),u=new Set(l.filter(e=>e.frameId).map(e=>e.frameId));return TT(e).filter(e=>u.has(e.id)).forEach(e=>{e&&(o=FT(o,DT(o,e,t,a),e,r))}),c.selectedElementIds=Object.entries(c.selectedElementIds).reduce((e,[t,n])=>(n&&!s.includes(t)&&(e[t]=!0),e),{}),{appState:{...t,...c},elements:o,captureUpdate:G.IMMEDIATELY}},keyTest:e=>e.shiftKey&&e[H.CTRL_OR_CMD]&&e.key===H.G.toUpperCase(),predicate:(e,t)=>Uy(t).length>0,PanelComponent:({elements:e,appState:t,updateData:n})=>(0,k.jsx)(fL,{type:`button`,hidden:Uy(t).length===0,icon:(0,k.jsx)(Fp,{theme:t.theme}),onClick:()=>n(null),title:`${q(`labels.ungroup`)} \u2014 ${L(`CtrlOrCmd+Shift+G`)}`,"aria-label":q(`labels.ungroup`),visible:qT(eD(e),t)})}),Bz=(e,t,n,r,i,a,o)=>{e.beginPath(),e.moveTo(t+a,n),e.lineTo(t+r-a,n),e.quadraticCurveTo(t+r,n,t+r,n+a),e.lineTo(t+r,n+i-a),e.quadraticCurveTo(t+r,n+i,t+r-a,n+i),e.lineTo(t+a,n+i),e.quadraticCurveTo(t,n+i,t,n+i-a),e.lineTo(t,n+a),e.quadraticCurveTo(t,n,t+a,n),e.closePath(),e.fill(),o&&(e.strokeStyle=o),e.stroke()};function Vz(e){let t=0;if(e.length===0)return t;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r}return t}var Hz=(e,t)=>`hsl(${Math.abs(Vz(t?.id||e))%37*10}, 100%, 83%)`,Uz=e=>{let t=e?.trim()?.codePointAt(0);return(t?String.fromCodePoint(t):`?`).toUpperCase()},Wz=({context:e,renderConfig:t,appState:n,normalizedWidth:r,normalizedHeight:i})=>{for(let[a,o]of t.remotePointerViewportCoords){let{x:s,y:c}=o,l=n.collaborators.get(a);s-=n.offsetLeft,c-=n.offsetTop;let u=s<0||s>r-11||c<0||c>i-14;s=Math.max(s,0),s=Math.min(s,r-11),c=Math.max(c,0),c=Math.min(c,i-14);let d=Hz(a,l);e.save(),e.strokeStyle=d,e.fillStyle=d;let f=t.remotePointerUserStates.get(a),p=u||f===`idle`||f===`away`;p&&(e.globalAlpha=.3),t.remotePointerButton.get(a)===`down`&&(e.beginPath(),e.arc(s,c,15,0,2*Math.PI,!1),e.lineWidth=3,e.strokeStyle=`#ffffff88`,e.stroke(),e.closePath(),e.beginPath(),e.arc(s,c,15,0,2*Math.PI,!1),e.lineWidth=1,e.strokeStyle=d,e.stroke(),e.closePath());let m=n.theme===Qs.DARK?`#2f6330`:oc,h=l?.isSpeaking;h&&(e.fillStyle=m,e.strokeStyle=m,e.lineWidth=10,e.lineJoin=`round`,e.beginPath(),e.moveTo(s,c),e.lineTo(s+0,c+14),e.lineTo(s+4,c+9),e.lineTo(s+11,c+8),e.closePath(),e.stroke(),e.fill()),e.fillStyle=ac,e.strokeStyle=ac,e.lineWidth=6,e.lineJoin=`round`,e.beginPath(),e.moveTo(s,c),e.lineTo(s+0,c+14),e.lineTo(s+4,c+9),e.lineTo(s+11,c+8),e.closePath(),e.stroke(),e.fill(),e.fillStyle=d,e.strokeStyle=d,e.lineWidth=2,e.lineJoin=`round`,e.beginPath(),p?(e.moveTo(s-1,c-1),e.lineTo(s-1,c+15),e.lineTo(s+5,c+10),e.lineTo(s+12,c+9),e.closePath(),e.fill()):(e.moveTo(s,c),e.lineTo(s+0,c+14),e.lineTo(s+4,c+9),e.lineTo(s+11,c+8),e.closePath(),e.fill(),e.stroke());let g=t.remotePointerUsernames.get(a)||``;if(!u&&g){e.font=`600 12px sans-serif`;let t=(h?s+0:s)+11/2,n=(h?c+0:c)+14+2,r=e.measureText(g),i=r.actualBoundingBoxDescent+r.actualBoundingBoxAscent,a=Math.max(i,12),o=t-1,l=n-1,u=r.width+2+10+2,f=a+2+6+2;e.roundRect?(e.beginPath(),e.roundRect(o,l,u,f,8),e.fillStyle=d,e.fill(),e.strokeStyle=`#ffffff`,e.stroke(),h&&(e.beginPath(),e.roundRect(o-2,l-2,u+4,f+4,8),e.strokeStyle=m,e.stroke())):Bz(e,o,l,u,f,8,`#ffffff`),e.fillStyle=`#1e1e1e`,e.fillText(g,t+5+1,n+3+r.actualBoundingBoxAscent+Math.floor((a-i)/2)+2),h&&(e.fillStyle=m,e.fillRect(o+u+8,l+(f/2-4),2,8),e.fillRect(o+u+8+5,l+(f/2-8),2,16),e.fillRect(o+u+8+10,l+(f/2-4),2,8))}e.restore(),e.closePath()}},Gz=({color:e,onClick:t,name:n,src:r,className:i})=>{let a=Uz(n),[o,s]=(0,u.useState)(!1),c=!o&&r,l=c?void 0:{background:e};return(0,k.jsx)(`div`,{className:O(`Avatar`,i),style:l,onClick:t,children:c?(0,k.jsx)(`img`,{className:`Avatar-img`,src:r,alt:a,referrerPolicy:`no-referrer`,onError:()=>s(!0)}):a})};W({name:`goToCollaborator`,label:`Go to a collaborator`,viewMode:!0,trackEvent:{category:`collab`},perform:(e,t,n)=>!n.socketId||t.userToFollow?.socketId===n.socketId||n.isCurrentUser?{appState:{...t,userToFollow:null},captureUpdate:G.EVENTUALLY}:{appState:{...t,userToFollow:{socketId:n.socketId,username:n.username||``},openMenu:t.openMenu===`canvas`?null:t.openMenu},captureUpdate:G.EVENTUALLY},PanelComponent:({updateData:e,data:t,appState:n})=>{let{socketId:r,collaborator:i,withName:a,isBeingFollowed:o}=t,s=Hz(r,i),c=O({"is-followed":o,"is-current-user":i.isCurrentUser===!0,"is-speaking":i.isSpeaking,"is-in-call":i.isInCall,"is-muted":i.isMuted}),l=i.isInCall?i.isSpeaking?(0,k.jsxs)(`div`,{className:`UserList__collaborator-status-icon-speaking-indicator`,title:q(`userList.hint.isSpeaking`),children:[(0,k.jsx)(`div`,{}),(0,k.jsx)(`div`,{}),(0,k.jsx)(`div`,{})]}):i.isMuted?(0,k.jsx)(`div`,{className:`UserList__collaborator-status-icon-microphone-muted`,title:q(`userList.hint.micMuted`),children:Gm}):(0,k.jsx)(`div`,{title:q(`userList.hint.inCall`),children:Wm}):null;return a?(0,k.jsxs)(`div`,{className:`dropdown-menu-item dropdown-menu-item-base UserList__collaborator ${c}`,style:{"--avatar-size":`1.5rem`},onClick:()=>e(i),children:[(0,k.jsx)(Gz,{color:s,onClick:()=>{},name:i.username||``,src:i.avatarUrl,className:c}),(0,k.jsx)(`div`,{className:`UserList__collaborator-name`,children:i.username}),(0,k.jsxs)(`div`,{className:`UserList__collaborator-status-icons`,"aria-hidden":!0,children:[o&&(0,k.jsx)(`div`,{className:`UserList__collaborator-status-icon-is-followed`,title:q(`userList.hint.followStatus`),children:zm}),l]})]}):(0,k.jsxs)(`div`,{className:`UserList__collaborator UserList__collaborator--avatar-only ${c}`,children:[(0,k.jsx)(Gz,{color:s,onClick:()=>{e(i)},name:i.username||``,src:i.avatarUrl,className:c}),l&&(0,k.jsx)(`div`,{className:`UserList__collaborator-status-icon`,children:l})]})}});var Kz=W({name:`addToLibrary`,trackEvent:{category:`element`},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});for(let e of Lc)if(i.some(t=>t.type===e))return{captureUpdate:G.EVENTUALLY,appState:{...t,errorMessage:q(`errors.libraryElementTypeError.${e}`)}};return r.library.getLatestLibrary().then(e=>r.library.setLibrary([{id:gx(),status:`unpublished`,elements:i.map(Nx),created:Date.now()},...e])).then(()=>({captureUpdate:G.EVENTUALLY,appState:{...t,toast:{message:q(`toast.addedToLibrary`)}}})).catch(e=>({captureUpdate:G.EVENTUALLY,appState:{...t,errorMessage:e.message}}))},label:`labels.addToLibrary`}),qz=(e,t,n,r)=>{let i=Qy(e,t),a=Tv(e);return i.flatMap(e=>{let t=Jz(e,a,n);return e.map(n=>{let i=K(n,{x:n.x+t.x,y:n.y+t.y});return ny(n,r.getNonDeletedElementsMap(),{simultaneouslyUpdated:e}),i})})},Jz=(e,t,{axis:n,position:r})=>{let i=Tv(e),[a,o]=n===`x`?[`minX`,`maxX`]:[`minY`,`maxY`],s={x:0,y:0};return r===`start`?{...s,[n]:t[a]-i[a]}:r===`end`?{...s,[n]:t[o]-i[o]}:{...s,[n]:(t[a]+t[o])/2-(i[a]+i[o])/2}},Yz=(e,t)=>{let n=t.scene.getSelectedElements(e);return n.length>1&&!n.some(e=>gd(e))},Xz=(e,t,n,r)=>{let i=Nu(qz(n.scene.getSelectedElements(t),Nu(e),r,n.scene));return IT(e.map(e=>i.get(e.id)||e),t,n)};W({name:`alignTop`,label:`labels.alignTop`,icon:wp,trackEvent:{category:`element`},predicate:(e,t,n,r)=>Yz(t,r),perform:(e,t,n,r)=>({appState:t,elements:Xz(e,t,r,{position:`start`,axis:`y`}),captureUpdate:G.IMMEDIATELY}),keyTest:e=>e[H.CTRL_OR_CMD]&&e.shiftKey&&e.key===H.ARROW_UP,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>(0,k.jsx)(fL,{hidden:!Yz(t,r),type:`button`,icon:wp,onClick:()=>n(null),title:`${q(`labels.alignTop`)} \u2014 ${L(`CtrlOrCmd+Shift+Up`)}`,"aria-label":q(`labels.alignTop`),visible:qT(eD(e),t)})}),W({name:`alignBottom`,label:`labels.alignBottom`,icon:Tp,trackEvent:{category:`element`},predicate:(e,t,n,r)=>Yz(t,r),perform:(e,t,n,r)=>({appState:t,elements:Xz(e,t,r,{position:`end`,axis:`y`}),captureUpdate:G.IMMEDIATELY}),keyTest:e=>e[H.CTRL_OR_CMD]&&e.shiftKey&&e.key===H.ARROW_DOWN,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>(0,k.jsx)(fL,{hidden:!Yz(t,r),type:`button`,icon:Tp,onClick:()=>n(null),title:`${q(`labels.alignBottom`)} \u2014 ${L(`CtrlOrCmd+Shift+Down`)}`,"aria-label":q(`labels.alignBottom`),visible:qT(eD(e),t)})}),W({name:`alignLeft`,label:`labels.alignLeft`,icon:Ep,trackEvent:{category:`element`},predicate:(e,t,n,r)=>Yz(t,r),perform:(e,t,n,r)=>({appState:t,elements:Xz(e,t,r,{position:`start`,axis:`x`}),captureUpdate:G.IMMEDIATELY}),keyTest:e=>e[H.CTRL_OR_CMD]&&e.shiftKey&&e.key===H.ARROW_LEFT,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>(0,k.jsx)(fL,{hidden:!Yz(t,r),type:`button`,icon:Ep,onClick:()=>n(null),title:`${q(`labels.alignLeft`)} \u2014 ${L(`CtrlOrCmd+Shift+Left`)}`,"aria-label":q(`labels.alignLeft`),visible:qT(eD(e),t)})}),W({name:`alignRight`,label:`labels.alignRight`,icon:Dp,trackEvent:{category:`element`},predicate:(e,t,n,r)=>Yz(t,r),perform:(e,t,n,r)=>({appState:t,elements:Xz(e,t,r,{position:`end`,axis:`x`}),captureUpdate:G.IMMEDIATELY}),keyTest:e=>e[H.CTRL_OR_CMD]&&e.shiftKey&&e.key===H.ARROW_RIGHT,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>(0,k.jsx)(fL,{hidden:!Yz(t,r),type:`button`,icon:Dp,onClick:()=>n(null),title:`${q(`labels.alignRight`)} \u2014 ${L(`CtrlOrCmd+Shift+Right`)}`,"aria-label":q(`labels.alignRight`),visible:qT(eD(e),t)})}),W({name:`alignVerticallyCentered`,label:`labels.centerVertically`,icon:Ap,trackEvent:{category:`element`},predicate:(e,t,n,r)=>Yz(t,r),perform:(e,t,n,r)=>({appState:t,elements:Xz(e,t,r,{position:`center`,axis:`y`}),captureUpdate:G.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>(0,k.jsx)(fL,{hidden:!Yz(t,r),type:`button`,icon:Ap,onClick:()=>n(null),title:q(`labels.centerVertically`),"aria-label":q(`labels.centerVertically`),visible:qT(eD(e),t)})}),W({name:`alignHorizontallyCentered`,label:`labels.centerHorizontally`,icon:jp,trackEvent:{category:`element`},predicate:(e,t,n,r)=>Yz(t,r),perform:(e,t,n,r)=>({appState:t,elements:Xz(e,t,r,{position:`center`,axis:`x`}),captureUpdate:G.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>(0,k.jsx)(fL,{hidden:!Yz(t,r),type:`button`,icon:jp,onClick:()=>n(null),title:q(`labels.centerHorizontally`),"aria-label":q(`labels.centerHorizontally`),visible:qT(eD(e),t)})});var Zz=(e,t,n)=>{let[r,i,a,o]=n.axis===`x`?[`minX`,`midX`,`maxX`,`width`]:[`minY`,`midY`,`maxY`,`height`],s=Tv(e),c=Qy(e,t).map(e=>[e,Tv(e)]).sort((e,t)=>e[1][i]-t[1][i]),l=0;for(let e of c)l+=e[1][o];let u=(s[o]-l)/(c.length-1);if(u<0){let e=c.findIndex(e=>e[1][r]===s[r]),t=c.findIndex(e=>e[1][a]===s[a]),o=(c[t][1][i]-c[e][1][i])/(c.length-1),l=c[e][1][i];return c.flatMap(([r,a],s)=>{let c={x:0,y:0};return s!==e&&s!==t&&(l+=o,c[n.axis]=l-a[i]),r.map(e=>iE(e,{x:e.x+c.x,y:e.y+c.y}))})}let d=s[r];return c.flatMap(([e,t])=>{let i={x:0,y:0};return i[n.axis]=d-t[r],d+=u,d+=t[o],e.map(e=>iE(e,{x:e.x+i.x,y:e.y+i.y}))})},Qz=(e,t)=>{let n=t.scene.getSelectedElements(e);return n.length>1&&!n.some(e=>gd(e))},$z=(e,t,n,r)=>{let i=Nu(Zz(n.scene.getSelectedElements(t),n.scene.getNonDeletedElementsMap(),r));return IT(e.map(e=>i.get(e.id)||e),t,n)};W({name:`distributeHorizontally`,label:`labels.distributeHorizontally`,trackEvent:{category:`element`},perform:(e,t,n,r)=>({appState:t,elements:$z(e,t,r,{space:`between`,axis:`x`}),captureUpdate:G.IMMEDIATELY}),keyTest:e=>!e[H.CTRL_OR_CMD]&&e.altKey&&e.code===kg.H,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>(0,k.jsx)(fL,{hidden:!Qz(t,r),type:`button`,icon:Op,onClick:()=>n(null),title:`${q(`labels.distributeHorizontally`)} \u2014 ${L(`Alt+H`)}`,"aria-label":q(`labels.distributeHorizontally`),visible:qT(eD(e),t)})}),W({name:`distributeVertically`,label:`labels.distributeVertically`,trackEvent:{category:`element`},perform:(e,t,n,r)=>({appState:t,elements:$z(e,t,r,{space:`between`,axis:`y`}),captureUpdate:G.IMMEDIATELY}),keyTest:e=>!e[H.CTRL_OR_CMD]&&e.altKey&&e.code===kg.V,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>(0,k.jsx)(fL,{hidden:!Qz(t,r),type:`button`,icon:kp,onClick:()=>n(null),title:`${q(`labels.distributeVertically`)} \u2014 ${L(`Alt+V`)}`,"aria-label":q(`labels.distributeVertically`),visible:qT(eD(e),t)})});var eB=W({name:`flipHorizontal`,label:`labels.flipHorizontal`,icon:Xm,trackEvent:{category:`element`},perform:(e,t,n,r)=>({elements:IT(nB(e,r.scene.getNonDeletedElementsMap(),t,`horizontal`,r),t,r),appState:t,captureUpdate:G.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===kg.H}),tB=W({name:`flipVertical`,label:`labels.flipVertical`,icon:Ym,trackEvent:{category:`element`},perform:(e,t,n,r)=>({elements:IT(nB(e,r.scene.getNonDeletedElementsMap(),t,`vertical`,r),t,r),appState:t,captureUpdate:G.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===kg.V&&!e[H.CTRL_OR_CMD]}),nB=(e,t,n,r,i)=>{let a=Nu(rB(YT(eD(e),n,{includeBoundTextElement:!0,includeElementsInFrames:!0}),t,n,r,i));return e.map(e=>a.get(e.id)||e)},rB=(e,t,n,r,i)=>{if(e.every(e=>bd(e)&&(e.startBinding||e.endBinding)))return e.map(e=>{let t=e;return iE(t,{startArrowhead:t.endArrowhead,endArrowhead:t.startArrowhead})});let{midX:a,midY:o}=Tv(e);WE(e,t,`nw`,i.scene,new Map(Array.from(t.values()).map(e=>[e.id,Nx(e)])),{flipByX:r===`horizontal`,flipByY:r===`vertical`,shouldResizeFromCenter:!0,shouldMaintainAspectRatio:!0}),Uv(e.filter(yd),t,i.scene.getNonDeletedElements(),i.scene,Pv(n),[],n.zoom);let{elbowArrows:s,otherElements:c}=e.reduce((e,t)=>z(t)?{...e,elbowArrows:e.elbowArrows.concat(t)}:{...e,otherElements:e.otherElements.concat(t)},{elbowArrows:[],otherElements:[]}),{midX:l,midY:u}=Tv(e),[d,f]=[a-l,o-u];return c.forEach(e=>K(e,{x:e.x+d,y:e.y+f})),s.forEach(e=>K(e,{x:e.x+d,y:e.y+f})),e},iB=W({name:`copy`,label:`labels.copy`,icon:Jf,trackEvent:{category:`element`},perform:async(e,t,n,r)=>{let i=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});try{await Uw(i,r.files,n)}catch(e){return{captureUpdate:G.EVENTUALLY,appState:{...t,errorMessage:e.message}}}return{captureUpdate:G.EVENTUALLY}},keyTest:void 0}),aB=W({name:`paste`,label:`labels.paste`,trackEvent:{category:`element`},perform:async(e,t,n,r)=>{let i;try{i=await qw()}catch(e){return e.name===`AbortError`||e.name===`NotAllowedError`?!1:(console.error(`actionPaste ${e.name}: ${e.message}`),Ns?{captureUpdate:G.EVENTUALLY,appState:{...t,errorMessage:q(`hints.firefox_clipboard_write`)}}:{captureUpdate:G.EVENTUALLY,appState:{...t,errorMessage:q(`errors.asyncPasteFailedOnRead`)}})}try{r.pasteFromClipboard(Vw({types:i}))}catch(e){return console.error(e),{captureUpdate:G.EVENTUALLY,appState:{...t,errorMessage:q(`errors.asyncPasteFailedOnParse`)}}}return{captureUpdate:G.EVENTUALLY}},keyTest:void 0}),oB=W({name:`cut`,label:`labels.cut`,icon:Dm,trackEvent:{category:`element`},perform:(e,t,n,r)=>(iB.perform(e,t,n,r),hL.perform(e,t,null,r)),keyTest:e=>e[H.CTRL_OR_CMD]&&e.key===H.X}),sB=W({name:`copyAsSvg`,label:`labels.copyAsSvg`,icon:$m,trackEvent:{category:`element`},perform:async(e,t,n,r)=>{if(!r.canvas)return{captureUpdate:G.EVENTUALLY};let{exportedElements:i,exportingFrame:a}=bz(e,t,!0);try{return await xz(`clipboard-svg`,i,t,r.files,{...t,exportingFrame:a,name:r.getName()}),{appState:{toast:{message:q(`toast.copyToClipboardAsSvg`,{exportSelection:r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}).length?q(`toast.selection`):q(`toast.canvas`),exportColorScheme:t.exportWithDarkMode?q(`buttons.darkMode`):q(`buttons.lightMode`)})}},captureUpdate:G.EVENTUALLY}}catch(e){return console.error(e),{appState:{errorMessage:e.message},captureUpdate:G.EVENTUALLY}}},predicate:e=>Rw&&e.length>0,keywords:[`svg`,`clipboard`,`copy`]}),cB=W({name:`copyAsPng`,label:`labels.copyAsPng`,icon:eh,trackEvent:{category:`element`},perform:async(e,t,n,r)=>{if(!r.canvas)return{captureUpdate:G.EVENTUALLY};let i=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}),{exportedElements:a,exportingFrame:o}=bz(e,t,!0);try{return await xz(`clipboard`,a,t,r.files,{...t,exportingFrame:o,name:r.getName()}),{appState:{...t,toast:{message:q(`toast.copyToClipboardAsPng`,{exportSelection:i.length?q(`toast.selection`):q(`toast.canvas`),exportColorScheme:t.exportWithDarkMode?q(`buttons.darkMode`):q(`buttons.lightMode`)})}},captureUpdate:G.EVENTUALLY}}catch(e){return console.error(e),{appState:{...t,errorMessage:e.message},captureUpdate:G.EVENTUALLY}}},predicate:e=>zw&&e.length>0,keyTest:e=>e.code===kg.C&&e.altKey&&e.shiftKey,keywords:[`png`,`clipboard`,`copy`]}),lB=W({name:`copyText`,label:`labels.copyText`,trackEvent:{category:`element`},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});try{Zw(Zb(i))}catch{throw Error(q(`errors.copyToSystemClipboardFailed`))}return{captureUpdate:G.EVENTUALLY}},predicate:(e,t,n,r)=>Rw&&r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}).some(R),keywords:[`text`,`clipboard`,`copy`]}),uB=W({name:`gridMode`,icon:ah,keywords:[`snap`],label:`labels.toggleGrid`,viewMode:!0,trackEvent:{category:`canvas`,predicate:e=>e.gridModeEnabled},perform(e,t){return{appState:{...t,gridModeEnabled:!this.checked(t),objectsSnapModeEnabled:!1},captureUpdate:G.EVENTUALLY}},checked:e=>e.gridModeEnabled,predicate:(e,t,n)=>n.gridModeEnabled===void 0,keyTest:e=>e[H.CTRL_OR_CMD]&&e.code===kg.QUOTE}),dB=W({name:`zenMode`,label:`buttons.zenMode`,icon:nh,paletteName:`Toggle zen mode`,viewMode:!0,trackEvent:{category:`canvas`,predicate:e=>!e.zenModeEnabled},perform(e,t){return{appState:{...t,zenModeEnabled:!this.checked(t)},captureUpdate:G.EVENTUALLY}},checked:e=>e.zenModeEnabled,predicate:(e,t,n)=>typeof n.zenModeEnabled>`u`,keyTest:e=>!e[H.CTRL_OR_CMD]&&e.altKey&&e.code===kg.Z}),fB=W({name:`objectsSnapMode`,label:`buttons.objectsSnapMode`,icon:th,viewMode:!1,trackEvent:{category:`canvas`,predicate:e=>!e.objectsSnapModeEnabled},perform(e,t){return{appState:{...t,objectsSnapModeEnabled:!this.checked(t),gridModeEnabled:!1},captureUpdate:G.EVENTUALLY}},checked:e=>e.objectsSnapModeEnabled,predicate:(e,t,n)=>typeof n.objectsSnapModeEnabled>`u`,keyTest:e=>!e[H.CTRL_OR_CMD]&&e.altKey&&e.code===kg.S}),pB=W({name:`stats`,label:`stats.fullTitle`,icon:Jm,paletteName:`Toggle stats`,viewMode:!0,trackEvent:{category:`menu`},keywords:[`edit`,`attributes`,`customize`],perform(e,t){return{appState:{...t,stats:{...t.stats,open:!this.checked(t)}},captureUpdate:G.EVENTUALLY}},checked:e=>e.stats.open,keyTest:e=>!e[H.CTRL_OR_CMD]&&e.altKey&&e.code===kg.SLASH}),mB=W({name:`unbindText`,label:`labels.unbindText`,trackEvent:{category:`element`},predicate:(e,t,n,r)=>r.scene.getSelectedElements(t).some(e=>kd(e)),perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t),a=r.scene.getNonDeletedElementsMap();return i.forEach(e=>{let t=zb(e,a);if(t){let{width:n,height:r}=Id(t.originalText,cu(t),t.lineHeight),i=Nb(e.id);Mb(e.id);let{x:o,y:s}=Lb(e,t,a);K(t,{containerId:null,width:n,height:r,text:t.originalText,x:o,y:s}),K(e,{boundElements:e.boundElements?.filter(e=>e.id!==t.id),height:i||e.height})}}),{elements:e,appState:t,captureUpdate:G.IMMEDIATELY}}}),hB=W({name:`bindText`,label:`labels.bindText`,trackEvent:{category:`element`},predicate:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t);if(i.length===2){let e=R(i[0])||R(i[1]),t;if(Ed(i[0])?t=i[0]:Ed(i[1])&&(t=i[1]),e&&t&&zb(t,r.scene.getNonDeletedElementsMap())===null)return!0}return!1},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t),a,o;R(i[0])&&Ed(i[1])?(a=i[0],o=i[1]):(a=i[1],o=i[0]),K(a,{containerId:o.id,verticalAlign:Ec.MIDDLE,textAlign:Dc.CENTER,autoResize:!0}),K(o,{boundElements:(o.boundElements||[]).concat({type:`text`,id:a.id})});let s=o.height;return Pb(a,o,r.scene.getNonDeletedElementsMap()),jb(o.id,s),{elements:gB(e,o,a),appState:{...t,selectedElementIds:{[o.id]:!0}},captureUpdate:G.IMMEDIATELY}}}),gB=(e,t,n)=>{let r=e.slice(),i=r.findIndex(e=>e.id===n.id);r.splice(i,1);let a=r.findIndex(e=>e.id===t.id);return r.splice(a+1,0,n),Bx(r,Nu([t,n])),r},_B=(e,t,n)=>{let r=e.slice(),i=r.findIndex(e=>e.id===t.id);r.splice(i,1);let a=r.findIndex(e=>e.id===n.id);return r.splice(a,0,t),Bx(r,Nu([t,n])),r},vB=W({name:`wrapTextInContainer`,label:`labels.createContainerFromText`,trackEvent:{category:`element`},predicate:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t),a=i.every(e=>R(e));return i.length>0&&a},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t),a=e.slice(),o={};for(let e of i)if(R(e)){let n=vx({type:`rectangle`,backgroundColor:t.currentItemBackgroundColor,boundElements:[...e.boundElements||[],{id:e.id,type:`text`}],angle:e.angle,fillStyle:t.currentItemFillStyle,strokeColor:t.currentItemStrokeColor,roughness:t.currentItemRoughness,strokeWidth:t.currentItemStrokeWidth,strokeStyle:t.currentItemStrokeStyle,roundness:t.currentItemRoundness===`round`?{type:jd(`rectangle`)?jc.ADAPTIVE_RADIUS:jc.PROPORTIONAL_RADIUS}:null,opacity:100,locked:!1,x:e.x-5,y:e.y-5,width:Jb(e.width,`rectangle`),height:Jb(e.height,`rectangle`),groupIds:e.groupIds,frameId:e.frameId});if(e.boundElements?.length){let t=e.boundElements.filter(e=>e.type===`arrow`).map(e=>e.id);a.filter(e=>t.includes(e.id)).forEach(t=>{let r=t.startBinding,i=t.endBinding;r?.elementId===e.id&&(r={...r,elementId:n.id}),i?.elementId===e.id&&(i={...i,elementId:n.id}),(r||i)&&K(t,{startBinding:r,endBinding:i},!1)})}K(e,{containerId:n.id,verticalAlign:Ec.MIDDLE,boundElements:null,textAlign:Dc.CENTER,autoResize:!0},!1),Pb(e,n,r.scene.getNonDeletedElementsMap()),a=_B([...a,n],n,e),o[n.id]=!0}return{elements:a,appState:{...t,selectedElementIds:o},captureUpdate:G.IMMEDIATELY}}}),yB=380,bB=42,xB=5,SB=85,CB=500,wB=!1,TB=new Map,EB=({element:e,elementsMap:t,setAppState:n,onLinkOpen:r,setToast:i,updateEmbedValidationStatus:a})=>{let o=Zq(),s=qq(),c=Jq(),l=e.link||``,[d,f]=(0,u.useState)(l),p=(0,u.useRef)(null),m=o.showHyperlinkPopup===`editor`,h=(0,u.useCallback)(()=>{if(!p.current)return;let t=Qb(p.current.value)||null;if(!e.link&&t&&VL(`hyperlink`,`create`),dd(e)){if(o.activeEmbeddable?.element===e&&n({activeEmbeddable:null}),!t){K(e,{link:null}),a(e,!1);return}if(!wS(t,s.validateEmbeddable))t&&i({message:q(`toast.unableToEmbed`),closable:!0}),e.link&&TB.set(e.id,e.link),K(e,{link:t}),a(e,!1);else{let{width:n,height:r}=e,o=bS(t);o?.error instanceof URIError&&i({message:q(`toast.unrecognizedLinkFormat`),closable:!0});let s=o?o.intrinsicSize.w/o.intrinsicSize.h:1;K(e,{...TB.get(e.id)===e.link?{}:{width:o?.type===`video`?n>r?n:r*s:n,height:o?.type===`video`&&n>r?n/s:r},link:t}),a(e,!0),TB.has(e.id)&&TB.delete(e.id)}}else K(e,{link:t})},[e,i,s.validateEmbeddable,o.activeEmbeddable,n,a]);(0,u.useLayoutEffect)(()=>()=>{h()},[h]),(0,u.useEffect)(()=>{m&&p?.current&&!(c.viewport.isMobile||c.isTouchScreen)&&p.current.select()},[m,c.viewport.isMobile,c.isTouchScreen]),(0,u.useEffect)(()=>{let r=null,i=i=>{m||(r&&clearTimeout(r),NB(e,t,o,P(i.clientX,i.clientY))&&(r=window.setTimeout(()=>{n({showHyperlinkPopup:!1})},CB)))};return window.addEventListener(`pointermove`,i,!1),()=>{window.removeEventListener(`pointermove`,i,!1),r&&clearTimeout(r)}},[o,e,m,n,t]);let g=(0,u.useCallback)(()=>{VL(`hyperlink`,`delete`),K(e,{link:null}),n({showHyperlinkPopup:!1})},[n,e]),_=()=>{VL(`hyperlink`,`edit`,`popup-ui`),n({showHyperlinkPopup:`editor`})},{x:v,y}=DB(e,o,t);return o.contextMenu||o.selectedElementsAreBeingDragged||o.resizingElement||o.isRotating||o.openMenu||o.viewModeEnabled?null:(0,k.jsxs)(`div`,{className:`excalidraw-hyperlinkContainer`,style:{top:`${y}px`,left:`${v}px`,width:yB,padding:xB},children:[m?(0,k.jsx)(`input`,{className:O(`excalidraw-hyperlinkContainer-input`),placeholder:q(`labels.link.hint`),ref:p,value:d,onChange:e=>f(e.target.value),autoFocus:!0,onKeyDown:e=>{e.stopPropagation(),e[H.CTRL_OR_CMD]&&e.key===H.K&&e.preventDefault(),(e.key===H.ENTER||e.key===H.ESCAPE)&&(h(),n({showHyperlinkPopup:`info`}))}}):e.link?(0,k.jsx)(`a`,{href:Qb(e.link||``),className:`excalidraw-hyperlinkContainer-link`,target:$b(e.link)?`_self`:`_blank`,onClick:t=>{if(e.link&&r){let n=Bu(`excalidraw-link`,t.nativeEvent);r({...e,link:Qb(e.link)},n),n.defaultPrevented&&t.preventDefault()}},rel:`noopener noreferrer`,children:e.link}):(0,k.jsx)(`div`,{className:`excalidraw-hyperlinkContainer-link`,children:q(`labels.link.empty`)}),(0,k.jsxs)(`div`,{className:`excalidraw-hyperlinkContainer__buttons`,children:[!m&&(0,k.jsx)(fL,{type:`button`,title:q(`buttons.edit`),"aria-label":q(`buttons.edit`),label:q(`buttons.edit`),onClick:_,className:`excalidraw-hyperlinkContainer--edit`,icon:zf}),(0,k.jsx)(fL,{type:`button`,title:q(`labels.linkToElement`),"aria-label":q(`labels.linkToElement`),label:q(`labels.linkToElement`),onClick:()=>{n({openDialog:{name:`elementLinkSelector`,sourceElementId:e.id}})},icon:mh}),l&&!dd(e)&&(0,k.jsx)(fL,{type:`button`,title:q(`buttons.remove`),"aria-label":q(`buttons.remove`),label:q(`buttons.remove`),onClick:g,className:`excalidraw-hyperlinkContainer--remove`,icon:Kf})]})]})},DB=(e,t,n)=>{let[r,i]=av(e,n),{x:a,y:o}=vu({sceneX:r+e.width/2,sceneY:i},t);return{x:a-t.offsetLeft-yB/2,y:o-t.offsetTop-SB}},OB=(e,t)=>{let n=YT(e,t);return dd(n[0])?`labels.link.editEmbed`:n[0]?.link?`labels.link.edit`:`labels.link.create`},kB=null,AB=(e,t,n)=>{kB&&clearTimeout(kB),kB=window.setTimeout(()=>jB(e,t,n),300)},jB=(e,t,n)=>{if(!e.link)return;let r=rz();r.classList.add(`excalidraw-tooltip--visible`),r.style.maxWidth=`20rem`,r.textContent=nC(e.link)?q(`labels.link.goToElement`):e.link;let[i,a,o,s]=av(e,n),[c,l,u,d]=qS([i,a,o,s],e.angle,t),f=vu({sceneX:c,sceneY:l},t);iz(r,{left:f.x,top:f.y,width:u,height:d},`top`),VL(`hyperlink`,`tooltip`,`link-icon`),wB=!0},MB=()=>{kB&&clearTimeout(kB),wB&&(wB=!1,rz().classList.remove(`excalidraw-tooltip--visible`))},NB=(e,t,n,[r,i])=>{let{x:a,y:o}=_u({clientX:r,clientY:i},n),s=15/n.zoom.value;if(Sg(a,o,e,t))return!1;let[c,l,u]=av(e,t);if(a>=c&&a<=u&&o>=l-SB&&o<=l)return!1;let{x:d,y:f}=DB(e,n,t);return!(r>=d-s&&r<=d+yB+xB*2+s&&i>=f-s&&i<=f+s+xB*2+bB)},PB=W({name:`hyperlink`,label:(e,t)=>OB(e,t),icon:op,perform:(e,t)=>t.showHyperlinkPopup!==`editor`&&{elements:e,appState:{...t,showHyperlinkPopup:`editor`,openMenu:null},captureUpdate:G.IMMEDIATELY},trackEvent:{category:`hyperlink`,action:`click`},keyTest:e=>e[H.CTRL_OR_CMD]&&e.key===H.K,predicate:(e,t)=>YT(e,t).length===1,PanelComponent:({elements:e,appState:t,updateData:n})=>{let r=YT(e,t);return(0,k.jsx)(fL,{type:`button`,icon:op,"aria-label":q(OB(e,t)),title:`${dd(e[0])?q(`labels.link.labelEmbed`):q(`labels.link.label`)} - ${L(`CtrlOrCmd+K`)}`,onClick:()=>n(null),selected:r.length===1&&!!r[0].link})}}),FB=e=>e.every(e=>!e.locked),IB=W({name:`toggleElementLock`,label:(e,t,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1});return r.length===1&&!gd(r[0])?r[0].locked?`labels.elementLock.unlock`:`labels.elementLock.lock`:FB(r)?`labels.elementLock.lockAll`:`labels.elementLock.unlockAll`},icon:(e,t)=>FB(YT(t,e))?jf:Af,trackEvent:{category:`element`},predicate:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t);return i.length>0&&!i.some(e=>e.locked&&e.frameId)},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});if(!i.length)return!1;let a=FB(i),o=Nu(i);return{elements:e.map(e=>o.has(e.id)?iE(e,{locked:a}):e),appState:{...t,selectedLinearElement:a?null:t.selectedLinearElement},captureUpdate:G.IMMEDIATELY}},keyTest:(e,t,n,r)=>e.key.toLocaleLowerCase()===H.L&&e[H.CTRL_OR_CMD]&&e.shiftKey&&r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1}).length>0}),LB=W({name:`unlockAllElements`,paletteName:`Unlock all elements`,trackEvent:{category:`canvas`},viewMode:!1,icon:Af,predicate:(e,t)=>YT(e,t).length===0&&e.some(e=>e.locked),perform:(e,t)=>{let n=e.filter(e=>e.locked);return{elements:e.map(e=>e.locked?iE(e,{locked:!1}):e),appState:{...t,selectedElementIds:Object.fromEntries(n.map(e=>[e.id,!0]))},captureUpdate:G.IMMEDIATELY}},label:`labels.elementLock.unlockAll`}),RB=()=>{let[e,t]=(0,u.useState)(null);return[e,(0,u.useCallback)(e=>t(e),[])]},zB=e=>{let{closeOnClickOutside:t=!0}=e,n=uR({className:`excalidraw-modal-container`}),r=(0,u.useRef)(document.body.classList.contains(`excalidraw-animations-disabled`));return n?(0,mk.createPortal)((0,k.jsxs)(`div`,{className:O(`Modal`,e.className,{"animations-disabled":r.current}),role:`dialog`,"aria-modal":`true`,onKeyDown:t=>{t.key===H.ESCAPE&&(t.nativeEvent.stopImmediatePropagation(),t.stopPropagation(),e.onCloseRequest())},"aria-labelledby":e.labelledBy,"data-prevent-outside-click":!0,children:[(0,k.jsx)(`div`,{className:`Modal__background`,onClick:t?e.onCloseRequest:void 0}),(0,k.jsx)(`div`,{className:`Modal__content`,style:{"--max-width":`${e.maxWidth}px`},tabIndex:0,children:e.children})]}),n):null},BB=EO(new Map),VB=async e=>await tT({elements:e,appState:{exportBackground:!1,viewBackgroundColor:xs.white},files:null,renderEmbeddables:!1,skipInliningFonts:!0}),HB=(e,t,n)=>{let[r,i]=(0,u.useState)();return(0,u.useEffect)(()=>{if(t){if(e){let r=n.get(e);r?i(r):(async()=>{let r=await VB(t);r.querySelector(`.style-fonts`)?.remove(),r&&(n.set(e,r),i(r))})()}else(async()=>{let e=await VB(t);i(e)})()}},[e,t,n,i]),r},UB=()=>{let[e]=GI(BB);return{clearLibraryCache:()=>e.clear(),deleteItemsFromLibraryCache:t=>{t.forEach(t=>e.delete(t))},svgCache:e}},WB=class{constructor(){v(this,`jobs`,[]),v(this,`running`,!1)}tick(){if(this.running)return;let e=this.jobs.shift();e?(this.running=!0,e.promise.resolve(id(e.jobFactory,...e.args).finally(()=>{this.running=!1,this.tick()}))):this.running=!1}push(e,...t){let n=Ou();return this.jobs.push({jobFactory:e,promise:n,args:t}),this.tick(),n}},GB=new Zx,KB=EO({status:`loaded`,isInitialized:!1,libraryItems:[]}),qB=e=>Qu(e),JB=(e,t)=>!e.find(e=>e.elements.length===t.elements.length&&e.elements.every((e,n)=>e.id===t.elements[n].id&&e.versionNonce===t.elements[n].versionNonce)),YB=(e,t)=>{let n=[];for(let r of t)JB(e,r)&&n.push(r);return[...n,...e]},XB=(e,t)=>{let n=Nu(t),r={deletedItems:new Map,addedItems:new Map};for(let t of e)n.has(t.id)||r.deletedItems.set(t.id,t);let i=Nu(e);for(let e of t)i.has(e.id)||r.addedItems.set(e.id,e);return r},ZB=class{constructor(e){v(this,`currLibraryItems`,[]),v(this,`prevLibraryItems`,qB(this.currLibraryItems)),v(this,`app`),v(this,`updateQueue`,[]),v(this,`getLastUpdateTask`,()=>this.updateQueue[this.updateQueue.length-1]),v(this,`notifyListeners`,()=>{if(this.updateQueue.length>0)XI.set(KB,e=>({status:`loading`,libraryItems:this.currLibraryItems,isInitialized:e.isInitialized}));else{XI.set(KB,{status:`loaded`,libraryItems:this.currLibraryItems,isInitialized:!0});try{let e=this.prevLibraryItems;this.prevLibraryItems=qB(this.currLibraryItems);let t=qB(this.currLibraryItems);this.app.props.onLibraryChange?.(t),GB.trigger(XB(e,t),t)}catch(e){console.error(e)}}}),v(this,`destroy`,()=>{this.updateQueue=[],this.currLibraryItems=[],XI.set(BB,new Map)}),v(this,`resetLibrary`,()=>this.setLibrary([])),v(this,`getLatestLibrary`,()=>new Promise(async e=>{try{let t=await(this.getLastUpdateTask()||this.currLibraryItems);this.updateQueue.length>0?e(this.getLatestLibrary()):e(qB(t))}catch{return e(this.currLibraryItems)}})),v(this,`updateLibrary`,async({libraryItems:e,prompt:t=!1,merge:n=!1,openLibraryMenu:r=!1,defaultStatus:i=`unpublished`})=>(r&&this.app.setState({openSidebar:{name:Ic.name,tab:`library`}}),this.setLibrary(()=>new Promise(async(r,a)=>{try{let o=await(typeof e==`function`&&!(e instanceof Blob)?e(this.currLibraryItems):e),s;s=o instanceof Blob?await mD(o,i):gw(o,i),!t||window.confirm(q(`alerts.confirmAddLibrary`,{numShapes:s.length}))?(t&&this.app.focusContainer(),r(n?YB(this.currLibraryItems,s):s)):a(new yh)}catch(e){a(e)}})))),v(this,`setLibrary`,e=>{let t=new Promise(async(t,n)=>{try{await this.getLastUpdateTask(),typeof e==`function`&&(e=e(this.currLibraryItems)),this.currLibraryItems=qB(await e),t(this.currLibraryItems)}catch(e){n(e)}}).catch(e=>{if(e.name===`AbortError`)return console.warn(`Library update aborted by user`),this.currLibraryItems;throw e}).finally(()=>{this.updateQueue=this.updateQueue.filter(e=>e!==t),this.notifyListeners()});return this.updateQueue.push(t),this.notifyListeners(),t}),this.app=e}},QB=e=>{let t=Math.ceil(Math.sqrt(e.length)),n=[],r=n=>e.slice(n*t,n*t+t).reduce((e,t)=>{let{height:n}=Tv(t.elements);return Math.max(e,n)},0),i=n=>{let r=0,i=0,a=0;for(let o of e){if(r%t===0&&(i=0),i===n){let{width:e}=Tv(o.elements);a=Math.max(a,e)}r++,i++}return a},a=0,o=0,s=0,c=0,l=0,u=0,d=0;for(let f of e){l&&l%t===0&&(o+=s+50,a=0,u=0,d++),u===0&&(s=r(d)),c=i(u);let{minX:e,minY:p,width:m,height:h}=Tv(f.elements),g=(c-m)/2,_=(s-h)/2;n.push(...f.elements.map(t=>({...t,x:t.x+a+g-e,y:t.y+o+_-p}))),a+=c+50,l++,u++}return n},$B=class e{constructor(e){v(this,`adapter`),this.adapter=e}static async getLibraryItems(t,n,r=!0){let i=()=>new Promise(async(e,r)=>{try{e(gw((await t.load({source:n}))?.libraryItems||[],`published`))}catch(e){r(e)}});return r?e.queue.push(i):i()}getLibraryItems(t){return e.getLibraryItems(this.adapter,t,!1)}};v($B,`queue`,new WB),v($B,`run`,async(e,t)=>{let n=new $B(e);return $B.queue.push(()=>t(n))});var eV={Row:(0,u.forwardRef)(({children:e,gap:t,align:n,justifyContent:r,className:i,style:a},o)=>(0,k.jsx)(`div`,{className:O(`Stack Stack_horizontal`,i),style:{"--gap":t,alignItems:n,justifyContent:r,...a},ref:o,children:e})),Col:(0,u.forwardRef)(({children:e,gap:t,align:n,justifyContent:r,className:i,style:a},o)=>(0,k.jsx)(`div`,{className:O(`Stack Stack_vertical`,i),style:{"--gap":t,justifyItems:n,justifyContent:r,...a},ref:o,children:e}))},tV=({theme:e,id:t,libraryReturnUrl:n})=>{let r=n||window.location.origin+window.location.pathname;return(0,k.jsx)(`a`,{className:`library-menu-browse-button`,href:`${f.VITE_APP_LIBRARY_URL}?target=${window.name||`_blank`}&referrer=${r}&useHash=true&token=${t}&theme=${e}&version=${Cc.excalidrawLibrary}`,target:`_excalidraw_libraries`,children:q(`labels.libraries`)})},nV=({libraryReturnUrl:e,theme:t,id:n,style:r,children:i,className:a})=>(0,k.jsxs)(`div`,{className:O(`library-menu-control-buttons`,a),style:r,children:[(0,k.jsx)(tV,{id:n,libraryReturnUrl:e,theme:t}),i]}),rV=/({{[\w-]+}})|(<[\w-]+>)|(<\/[\w-]+>)/g,iV=/{{([\w-]+)}}/,aV=/<([\w-]+)>/,oV=/<\/([\w-]+)>/,sV=(e,t)=>{let n=[{name:``,children:[]}];return e.split(rV).filter(Boolean).forEach(r=>{let i=r.match(aV),a=r.match(oV),o=r.match(iV);if(i!==null){let r=i[1];t.hasOwnProperty(r)?n.push({name:r,children:[]}):console.warn(`Trans: missed to pass in prop ${r} for interpolating ${e}`)}else if(a!==null){if(a[1]===n[n.length-1].name){let e=n.pop(),r=u.createElement(u.Fragment,{},...e.children),i=t[e.name];typeof i==`function`&&n[n.length-1].children.push(i(r))}else console.warn(`Trans: unexpected end tag ${r} for interpolating ${e}`)}else if(o!==null){let r=o[1];t.hasOwnProperty(r)?n[n.length-1].children.push(t[r]):console.warn(`Trans: key ${r} not in props for interpolating ${e}`)}else n[n.length-1].children.push(r)}),n.length!==1&&console.warn(`Trans: stack not empty for interpolating ${e}`),n[0].children},cV=({i18nKey:e,children:t,...n})=>{let{t:r}=cL();return u.createElement(u.Fragment,{},...sV(r(e),n))},lV=({label:e,onClick:t,className:n,children:r,actionType:i,type:a=`button`,isLoading:o,...s})=>{let c=i?`Dialog__action-button--${i}`:``;return(0,k.jsxs)(`button`,{className:O(`Dialog__action-button`,c,n),type:a,"aria-label":e,onClick:t,...s,children:[r&&(0,k.jsx)(`div`,{style:o?{visibility:`hidden`}:{},children:r}),(0,k.jsx)(`div`,{style:o?{visibility:`hidden`}:{},children:e}),o&&(0,k.jsx)(`div`,{style:{position:`absolute`,inset:0},children:(0,k.jsx)(lL,{})})]})},uV=e=>{let{onConfirm:t,onCancel:n,children:r,confirmText:i=q(`buttons.confirm`),cancelText:a=q(`buttons.cancel`),className:o=``,...s}=e,c=Qq(),l=KI(HV),{container:u}=Yq();return(0,k.jsxs)(YV,{onCloseRequest:n,size:`small`,...s,className:`confirm-dialog ${o}`,children:[r,(0,k.jsxs)(`div`,{className:`confirm-dialog-buttons`,children:[(0,k.jsx)(lV,{label:a,onClick:()=>{c({openMenu:null}),l(!1),(0,mk.flushSync)(()=>{n()}),u?.focus()}}),(0,k.jsx)(lV,{label:i,onClick:()=>{c({openMenu:null}),l(!1),(0,mk.flushSync)(()=>{t()}),u?.focus()},actionType:`danger`})]})]})},dV=class{static has(e){try{return!!window.localStorage.getItem(e)}catch(e){return console.warn(`localStorage.getItem error: ${e.message}`),!1}}static get(e){try{let t=window.localStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return console.warn(`localStorage.getItem error: ${e.message}`),null}}};v(dV,`set`,(e,t)=>{try{return window.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){return console.warn(`localStorage.setItem error: ${e.message}`),!1}}),v(dV,`delete`,e=>{try{window.localStorage.removeItem(e)}catch(e){console.warn(`localStorage.removeItem error: ${e.message}`)}});var fV=async e=>{let t=mu(e,6),n=document.createElement(`canvas`);n.width=t[0].length*128+(t[0].length+1)*16-16,n.height=t.length*128+(t.length+1)*16-16;let r=n.getContext(`2d`);r.fillStyle=Ui.white,r.fillRect(0,0,n.width,n.height);for(let[t,n]of e.entries()){let e=await $w({elements:n.elements,files:null,maxWidthOrHeight:128}),{width:i,height:a}=e,o=Math.floor(t/6)*144,s=t%6*144;r.drawImage(e,s+(128-i)/2+8,o+(128-a)/2+8),r.lineWidth=2,r.strokeStyle=Ui.gray[4],r.strokeRect(s+4,o+4,136,136)}return await xD(new File([await hD(n)],`preview`,{type:j.png}),{outputType:j.jpg,maxWidthOrHeight:5e3})},pV=({libItem:e,appState:t,index:n,onChange:r,onRemove:i})=>{let a=(0,u.useRef)(null),o=(0,u.useRef)(null);return(0,u.useEffect)(()=>{let n=a.current;n&&(async()=>{let r=await tT({elements:e.elements,appState:{...t,viewBackgroundColor:Ui.white,exportBackground:!0},files:null,skipInliningFonts:!0});n.innerHTML=r.outerHTML})()},[e.elements,t]),(0,k.jsxs)(`div`,{className:`single-library-item`,children:[e.status===`published`&&(0,k.jsx)(`span`,{className:`single-library-item-status`,children:q(`labels.statusPublished`)}),(0,k.jsx)(`div`,{ref:a,className:`single-library-item__svg`}),(0,k.jsx)(fL,{"aria-label":q(`buttons.remove`),type:`button`,icon:Np,className:`single-library-item--remove`,onClick:i.bind(null,e.id),title:q(`buttons.remove`)}),(0,k.jsxs)(`div`,{style:{display:`flex`,margin:`0.8rem 0`,width:`100%`,fontSize:`14px`,fontWeight:500,flexDirection:`column`},children:[(0,k.jsxs)(`label`,{style:{display:`flex`,justifyContent:`space-between`,flexDirection:`column`},children:[(0,k.jsxs)(`div`,{style:{padding:`0.5em 0`},children:[(0,k.jsx)(`span`,{style:{fontWeight:500,color:Ui.gray[6]},children:q(`publishDialog.itemName`)}),(0,k.jsx)(`span`,{"aria-hidden":`true`,className:`required`,children:`*`})]}),(0,k.jsx)(`input`,{type:`text`,ref:o,style:{width:`80%`,padding:`0.2rem`},defaultValue:e.name,placeholder:`Item name`,onChange:e=>{r(e.target.value,n)}})]}),(0,k.jsx)(`span`,{className:`error`,children:e.error})]})]})},mV=({onClose:e,libraryItems:t,appState:n,onSuccess:r,onError:i,updateItemsInStorage:a,onRemove:o})=>{let[s,c]=(0,u.useState)({authorName:``,githubHandle:``,name:``,description:``,twitterHandle:``,website:``}),[l,d]=(0,u.useState)(!1);(0,u.useEffect)(()=>{let e=dV.get(zc.PUBLISH_LIBRARY);e&&c(e)},[]);let[p,m]=(0,u.useState)(t.slice());(0,u.useEffect)(()=>{m(t.slice())},[t]);let h=e=>{c({...s,[e.target.name]:e.target.value})},g=async e=>{e.preventDefault(),d(!0);let t=[],n=!1;if(p.forEach(e=>{let r=``;e.name||(r=q(`publishDialog.errors.required`),n=!0),t.push({...e,error:r})}),n){m(t),d(!1);return}let a=await fV(p),o={type:dc.excalidrawLibrary,version:Cc.excalidrawLibrary,source:fc,libraryItems:p},c=JSON.stringify(o,null,2),l=new Blob([c],{type:`application/json`}),u=new FormData;u.append(`excalidrawLib`,l),u.append(`previewImage`,a),u.append(`previewImageType`,a.type),u.append(`title`,s.name),u.append(`authorName`,s.authorName),u.append(`githubHandle`,s.githubHandle),u.append(`name`,s.name),u.append(`description`,s.description),u.append(`twitterHandle`,s.twitterHandle),u.append(`website`,s.website),fetch(`${f.VITE_APP_LIBRARY_BACKEND}/submit`,{method:`post`,body:u}).then(e=>e.ok?e.json().then(({url:e})=>{dV.delete(zc.PUBLISH_LIBRARY),r({url:e,authorName:s.authorName,items:p})}):e.json().catch(()=>{throw Error(e.statusText||`something went wrong`)}).then(t=>{throw Error(t.message||e.statusText||`something went wrong`)}),e=>{console.error(e),i(e),d(!1)}).catch(e=>{console.error(e),i(e),d(!1)})},_=()=>{let e=[];return p.forEach((t,r)=>{e.push((0,k.jsx)(`div`,{className:`single-library-item-wrapper`,children:(0,k.jsx)(pV,{libItem:t,appState:n,index:r,onChange:(e,t)=>{let n=p.slice();n[t].name=e,m(n)},onRemove:o})},r))}),(0,k.jsx)(`div`,{className:`selected-library-items`,children:e})},v=(0,u.useCallback)(()=>{a(p),dV.set(zc.PUBLISH_LIBRARY,s),e()},[p,e,a,s]),y=!!t.length,b=t.some(e=>e.status===`published`);return(0,k.jsx)(YV,{onCloseRequest:v,title:q(`publishDialog.title`),className:`publish-library`,children:y?(0,k.jsxs)(`form`,{onSubmit:g,children:[(0,k.jsx)(`div`,{className:`publish-library-note`,children:(0,k.jsx)(cV,{i18nKey:`publishDialog.noteDescription`,link:e=>(0,k.jsx)(`a`,{href:`https://libraries.excalidraw.com`,target:`_blank`,rel:`noopener noreferrer`,children:e})})}),(0,k.jsx)(`span`,{className:`publish-library-note`,children:(0,k.jsx)(cV,{i18nKey:`publishDialog.noteGuidelines`,link:e=>(0,k.jsx)(`a`,{href:`https://github.com/excalidraw/excalidraw-libraries#guidelines`,target:`_blank`,rel:`noopener noreferrer`,children:e})})}),(0,k.jsx)(`div`,{className:`publish-library-note`,children:q(`publishDialog.noteItems`)}),b&&(0,k.jsx)(`span`,{className:`publish-library-note publish-library-warning`,children:q(`publishDialog.republishWarning`)}),_(),(0,k.jsxs)(`div`,{className:`publish-library__fields`,children:[(0,k.jsxs)(`label`,{children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`span`,{children:q(`publishDialog.libraryName`)}),(0,k.jsx)(`span`,{"aria-hidden":`true`,className:`required`,children:`*`})]}),(0,k.jsx)(`input`,{type:`text`,name:`name`,required:!0,value:s.name,onChange:h,placeholder:q(`publishDialog.placeholder.libraryName`)})]}),(0,k.jsxs)(`label`,{style:{alignItems:`flex-start`},children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`span`,{children:q(`publishDialog.libraryDesc`)}),(0,k.jsx)(`span`,{"aria-hidden":`true`,className:`required`,children:`*`})]}),(0,k.jsx)(`textarea`,{name:`description`,rows:4,required:!0,value:s.description,onChange:h,placeholder:q(`publishDialog.placeholder.libraryDesc`)})]}),(0,k.jsxs)(`label`,{children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`span`,{children:q(`publishDialog.authorName`)}),(0,k.jsx)(`span`,{"aria-hidden":`true`,className:`required`,children:`*`})]}),(0,k.jsx)(`input`,{type:`text`,name:`authorName`,required:!0,value:s.authorName,onChange:h,placeholder:q(`publishDialog.placeholder.authorName`)})]}),(0,k.jsxs)(`label`,{children:[(0,k.jsx)(`span`,{children:q(`publishDialog.githubUsername`)}),(0,k.jsx)(`input`,{type:`text`,name:`githubHandle`,value:s.githubHandle,onChange:h,placeholder:q(`publishDialog.placeholder.githubHandle`)})]}),(0,k.jsxs)(`label`,{children:[(0,k.jsx)(`span`,{children:q(`publishDialog.twitterUsername`)}),(0,k.jsx)(`input`,{type:`text`,name:`twitterHandle`,value:s.twitterHandle,onChange:h,placeholder:q(`publishDialog.placeholder.twitterHandle`)})]}),(0,k.jsxs)(`label`,{children:[(0,k.jsx)(`span`,{children:q(`publishDialog.website`)}),(0,k.jsx)(`input`,{type:`text`,name:`website`,pattern:`https?://.+`,title:q(`publishDialog.errors.website`),value:s.website,onChange:h,placeholder:q(`publishDialog.placeholder.website`)})]}),(0,k.jsx)(`span`,{className:`publish-library-note`,children:(0,k.jsx)(cV,{i18nKey:`publishDialog.noteLicense`,link:e=>(0,k.jsx)(`a`,{href:`https://github.com/excalidraw/excalidraw-libraries/blob/main/LICENSE`,target:`_blank`,rel:`noopener noreferrer`,children:e})})})]}),(0,k.jsxs)(`div`,{className:`publish-library__buttons`,children:[(0,k.jsx)(lV,{label:q(`buttons.cancel`),onClick:v,"data-testid":`cancel-clear-canvas-button`}),(0,k.jsx)(lV,{type:`submit`,label:q(`buttons.submit`),actionType:`primary`,isLoading:l})]})]}):(0,k.jsx)(`p`,{style:{padding:`1em`,textAlign:`center`,fontWeight:500},children:q(`publishDialog.atleastOneLibItem`)})})},hV=({className:e=``,children:t,onToggle:n,title:r,...i})=>{let a=Jq(),o=O(`dropdown-menu-button ${e}`,`zen-mode-transition`,{"dropdown-menu-button--mobile":a.editor.isMobile}).trim();return(0,k.jsx)(`button`,{"data-prevent-outside-click":!0,className:o,onClick:n,type:`button`,"data-testid":`dropdown-menu-button`,title:r,...i,children:t})},gV=hV;hV.displayName=`DropdownMenuTrigger`;var _V=()=>(0,k.jsx)(`div`,{style:{height:`1px`,backgroundColor:`var(--default-border-color)`,margin:`.5rem 0`}}),vV=_V;_V.displayName=`DropdownMenuSeparator`;var yV=({children:e,onClickOutside:t,className:n=``,onSelect:r,style:i})=>{let a=Jq(),o=(0,u.useRef)(null),s=fR({onClickOutside:t});dR(o,()=>{s.onClickOutside?.()}),(0,u.useEffect)(()=>{let e=e=>{e.key===H.ESCAPE&&(e.stopImmediatePropagation(),s.onClickOutside?.())},t={capture:!0};return document.addEventListener(`keydown`,e,t),()=>{document.removeEventListener(`keydown`,e,t)}},[s]);let c=O(`dropdown-menu ${n}`,{"dropdown-menu--mobile":a.editor.isMobile}).trim();return(0,k.jsx)(MR.Provider,{value:{onSelect:r},children:(0,k.jsx)(`div`,{ref:o,className:c,style:i,"data-testid":`dropdown-menu`,children:a.editor.isMobile?(0,k.jsx)(eV.Col,{className:`dropdown-menu-container`,children:e}):(0,k.jsx)(gR,{className:`dropdown-menu-container`,padding:2,style:{zIndex:2},children:e})})})};yV.displayName=`DropdownMenuContent`;var bV=yV,xV=({icon:e,shortcut:t,href:n,children:r,onSelect:i,className:a=``,selected:o,rel:s=`noreferrer`,...c})=>{let l=PR(c.onClick,i);return(0,k.jsx)(`a`,{...c,href:n,target:`_blank`,rel:`noreferrer`,className:NR(a,o),title:c.title??c[`aria-label`],onClick:l,children:(0,k.jsx)(FR,{icon:e,shortcut:t,children:r})})},SV=xV;xV.displayName=`DropdownMenuItemLink`;var CV=({children:e,className:t=``,selected:n,...r})=>(0,k.jsx)(`div`,{...r,className:`dropdown-menu-item-base dropdown-menu-item-custom ${t} ${n?`dropdown-menu-item--selected`:``}`.trim(),children:e}),wV=e=>u.Children.toArray(e).find(e=>u.isValidElement(e)&&typeof e.type!=`string`&&e?.type.displayName&&e.type.displayName===`DropdownMenuTrigger`)||null,TV=e=>u.Children.toArray(e).find(e=>u.isValidElement(e)&&typeof e.type!=`string`&&e?.type.displayName&&e.type.displayName===`DropdownMenuContent`)||null,EV=({children:e,open:t})=>{let n=wV(e),r=TV(e);return(0,k.jsxs)(k.Fragment,{children:[n,t&&r]})};EV.Trigger=gV,EV.Content=bV,EV.Item=zR,EV.ItemLink=SV,EV.ItemCustom=CV,EV.Group=jR,EV.Separator=vV;var DV=EV;EV.displayName=`DropdownMenu`;var OV=(e,t)=>e.filter(e=>t.includes(e.id)),kV=({setAppState:e,selectedItems:t,library:n,onRemoveFromLibrary:r,resetLibrary:i,onSelectItems:a,appState:o,className:s})=>{let[c]=GI(KB),[l,d]=GI(HV),f=()=>{let e=t.length?q(`alerts.removeItemsFromsLibrary`,{count:t.length}):q(`alerts.resetLibrary`),n=t.length?q(`confirmDialog.removeItemsFromLib`):q(`confirmDialog.resetLibrary`);return(0,k.jsx)(uV,{onConfirm:()=>{t.length?r():i(),m(!1)},onCancel:()=>{m(!1)},title:n,children:(0,k.jsx)(`p`,{children:e})})},[p,m]=(0,u.useState)(!1),h=!!t.length,g=h?c.libraryItems.filter(e=>t.includes(e.id)):c.libraryItems,_=q(h?`buttons.remove`:`buttons.resetLibrary`),[v,y]=(0,u.useState)(!1),[b,x]=(0,u.useState)(null),S=(0,u.useCallback)(()=>(0,k.jsxs)(YV,{onCloseRequest:()=>x(null),title:q(`publishSuccessDialog.title`),className:`publish-library-success`,size:`small`,children:[(0,k.jsx)(`p`,{children:(0,k.jsx)(cV,{i18nKey:`publishSuccessDialog.content`,authorName:b.authorName,link:e=>(0,k.jsx)(`a`,{href:b?.url,target:`_blank`,rel:`noopener noreferrer`,children:e})})}),(0,k.jsx)(fL,{type:`button`,title:q(`buttons.close`),"aria-label":q(`buttons.close`),label:q(`buttons.close`),onClick:()=>x(null),"data-testid":`publish-library-success-close`,className:`publish-library-success-close`})]}),[x,b]),C=(e,r)=>{y(!1),x({url:e.url,authorName:e.authorName});let i=r.slice();i.forEach(e=>{t.includes(e.id)&&(e.status=`published`)}),n.setLibrary(i)};return(0,k.jsxs)(`div`,{className:O(`library-menu-dropdown-container`,s),children:[(0,k.jsxs)(DV,{open:l,children:[(0,k.jsx)(DV.Trigger,{onToggle:()=>d(!l),children:Of}),(0,k.jsxs)(DV.Content,{onClickOutside:()=>d(!1),onSelect:()=>d(!1),className:`library-menu`,children:[!h&&(0,k.jsx)(DV.Item,{onSelect:async()=>{try{await n.updateLibrary({libraryItems:AS({description:`Excalidraw library files`}),merge:!0,openLibraryMenu:!0})}catch(t){if(t?.name===`AbortError`){console.warn(t);return}e({errorMessage:q(`errors.importLibraryError`)})}},icon:lp,"data-testid":`lib-dropdown--load`,children:q(`buttons.load`)}),!!g.length&&(0,k.jsx)(DV.Item,{onSelect:async()=>{zS(h?g:await n.getLatestLibrary()).catch(Cu).catch(t=>{e({errorMessage:t.message})})},icon:Qf,"data-testid":`lib-dropdown--export`,children:q(`buttons.export`)}),!!g.length&&(0,k.jsx)(DV.Item,{onSelect:()=>m(!0),icon:Kf,children:_}),h&&(0,k.jsx)(DV.Item,{icon:Cm,onSelect:()=>y(!0),"data-testid":`lib-dropdown--remove`,children:q(`buttons.publishLibrary`)})]})]}),t.length>0&&(0,k.jsx)(`div`,{className:`library-actions-counter`,children:t.length}),p&&f(),v&&(0,k.jsx)(mV,{onClose:()=>y(!1),libraryItems:OV(c.libraryItems,t),appState:o,onSuccess:e=>C(e,c.libraryItems),onError:e=>window.alert(e),updateItemsInStorage:()=>n.setLibrary(c.libraryItems),onRemove:e=>a(t.filter(t=>t!==e))}),b&&S()]})},AV=({selectedItems:e,onSelectItems:t,className:n})=>{let{library:r}=Kq(),{clearLibraryCache:i,deleteItemsFromLibraryCache:a}=UB(),o=lR(),s=Qq(),[c]=GI(KB),l=async n=>{let i=n.filter(t=>!e.includes(t.id));r.setLibrary(i).catch(()=>{s({errorMessage:q(`alerts.errorRemovingFromLibrary`)})}),a(e),t([])};return(0,k.jsx)(kV,{appState:o,setAppState:s,selectedItems:e,onSelectItems:t,library:r,onRemoveFromLibrary:()=>l(c.libraryItems),resetLibrary:()=>{r.resetLibrary(),i()},className:n})},jV=(0,u.memo)(({id:e,elements:t,isPending:n,onClick:r,selected:i,onToggle:a,onDrag:o,svgCache:s})=>{let c=(0,u.useRef)(null),l=HB(e,t,s);(0,u.useEffect)(()=>{let e=c.current;if(e)return l&&(e.innerHTML=l.outerHTML),()=>{e.innerHTML=``}},[l]);let[d,f]=(0,u.useState)(!1),p=Jq().editor.isMobile,m=n&&(0,k.jsx)(`div`,{className:`library-unit__adder`,children:Df});return(0,k.jsxs)(`div`,{className:O(`library-unit`,{"library-unit__active":t,"library-unit--hover":t&&d,"library-unit--selected":i,"library-unit--skeleton":!l}),onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:[(0,k.jsx)(`div`,{className:O(`library-unit__dragger`,{"library-unit__pulse":!!n}),ref:c,draggable:!!t,onClick:t||n?t=>{e&&t.shiftKey?a(e,t):r(e)}:void 0,onDragStart:t=>{if(!e){t.preventDefault();return}f(!1),o(e,t)}}),m,e&&t&&(d||p||i)&&(0,k.jsx)(Cz,{checked:i,onChange:(t,n)=>a(e,n),className:`library-unit__checkbox`})]})}),MV=()=>(0,k.jsx)(`div`,{className:`library-unit library-unit--skeleton`});function NV(){return[!1,(0,u.useCallback)(e=>e(),[])]}var PV=u.useTransition||NV,FV=({children:e})=>(0,k.jsx)(`div`,{className:`library-menu-items-container__grid`,children:e}),IV=(0,u.memo)(({items:e,onItemSelectToggle:t,onItemDrag:n,isItemSelected:r,onClick:i,svgCache:a,itemsRenderedPerBatch:o})=>{let[,s]=PV(),[c,l]=(0,u.useState)(0);return(0,u.useEffect)(()=>{c<e.length&&s(()=>{l(c+o)})},[c,e.length,s,o]),(0,k.jsx)(k.Fragment,{children:e.map((e,o)=>o<c?(0,k.jsx)(jV,{elements:e?.elements,isPending:!e?.id&&!!e?.elements,onClick:i,svgCache:a,id:e?.id,selected:r(e.id),onToggle:t,onDrag:n},e?.id??o):(0,k.jsx)(MV,{},o))})}),LV=EO(0),RV=e=>{let[t,n]=GI(LV);return(0,u.useEffect)(()=>{let{current:t}=e;if(!t)return;let r=(0,qi.default)(()=>{let{scrollTop:e}=t;n(e)},200);return t.addEventListener(`scroll`,r),()=>{r.cancel(),t.removeEventListener(`scroll`,r)}},[e,n]),t},zV=17,BV=64;function VV({isLoading:e,libraryItems:t,onAddToLibrary:n,onInsertLibraryItems:r,pendingElements:i,theme:a,id:o,libraryReturnUrl:s,onSelectItems:c,selectedItems:l}){let d=(0,u.useRef)(null),f=RV(d);(0,u.useEffect)(()=>{f>0&&d.current?.scrollTo(0,f)},[]);let{svgCache:p}=UB(),m=(0,u.useMemo)(()=>t.filter(e=>e.status!==`published`),[t]),h=(0,u.useMemo)(()=>t.filter(e=>e.status===`published`),[t]),g=!t.length&&!i.length,_=!i.length&&!m.length&&!h.length,[v,y]=(0,u.useState)(null),b=(0,u.useCallback)((e,t)=>{let n=!l.includes(e),r=[...m,...h];if(n){if(t.shiftKey&&v){let t=r.findIndex(e=>e.id===v),n=r.findIndex(t=>t.id===e);if(t===-1||n===-1){c([...l,e]);return}let i=Nu(l);c(r.reduce((e,r,a)=>((a>=t&&a<=n||i.has(r.id))&&e.push(r.id),e),[]))}else c([...l,e]);y(e)}else y(null),c(l.filter(t=>t!==e))},[v,c,h,l,m]),x=(0,u.useCallback)(e=>{let n;return n=l.includes(e)?t.filter(e=>l.includes(e.id)):t.filter(t=>t.id===e),n.map(e=>({...e,elements:Lx(e.elements,{randomizeSeed:!0})}))},[t,l]),S=(0,u.useCallback)((e,t)=>{t.dataTransfer.setData(j.excalidrawlib,RS(x(e)))},[x]),C=(0,u.useCallback)(e=>e?l.includes(e):!1,[l]),w=(0,u.useCallback)(()=>{n(i)},[i,n]),T=(0,u.useCallback)(e=>{e&&r(x(e))},[x,r]),E=p.size>=t.length?BV:zV;return(0,k.jsxs)(`div`,{className:`library-menu-items-container`,style:i.length||m.length||h.length?{justifyContent:`flex-start`}:{borderBottom:0},children:[!_&&(0,k.jsx)(AV,{selectedItems:l,onSelectItems:c,className:`library-menu-dropdown-container--in-heading`}),(0,k.jsxs)(eV.Col,{className:`library-menu-items-container__items`,align:`start`,gap:1,style:{flex:h.length>0?1:`0 1 auto`,marginBottom:0},ref:d,children:[(0,k.jsxs)(k.Fragment,{children:[!_&&(0,k.jsx)(`div`,{className:`library-menu-items-container__header`,children:q(`labels.personalLib`)}),e&&(0,k.jsx)(`div`,{style:{position:`absolute`,top:`var(--container-padding-y)`,right:`var(--container-padding-x)`,transform:`translateY(50%)`},children:(0,k.jsx)(lL,{})}),!i.length&&!m.length?(0,k.jsxs)(`div`,{className:`library-menu-items__no-items`,children:[(0,k.jsx)(`div`,{className:`library-menu-items__no-items__label`,children:q(`library.noItems`)}),(0,k.jsx)(`div`,{className:`library-menu-items__no-items__hint`,children:h.length>0?q(`library.hint_emptyPrivateLibrary`):q(`library.hint_emptyLibrary`)})]}):(0,k.jsxs)(FV,{children:[i.length>0&&(0,k.jsx)(IV,{itemsRenderedPerBatch:E,items:[{id:null,elements:i}],onItemSelectToggle:b,onItemDrag:S,onClick:w,isItemSelected:C,svgCache:p}),(0,k.jsx)(IV,{itemsRenderedPerBatch:E,items:m,onItemSelectToggle:b,onItemDrag:S,onClick:T,isItemSelected:C,svgCache:p})]})]}),(0,k.jsxs)(k.Fragment,{children:[(h.length>0||i.length>0||m.length>0)&&(0,k.jsx)(`div`,{className:`library-menu-items-container__header library-menu-items-container__header--excal`,children:q(`labels.excalidrawLib`)}),h.length>0?(0,k.jsx)(FV,{children:(0,k.jsx)(IV,{itemsRenderedPerBatch:E,items:h,onItemSelectToggle:b,onItemDrag:S,onClick:T,isItemSelected:C,svgCache:p})}):m.length>0?(0,k.jsx)(`div`,{style:{margin:`1rem 0`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,width:`100%`,fontSize:`.9rem`},children:q(`library.noItems`)}):null]}),g&&(0,k.jsx)(nV,{style:{padding:`16px 0`,width:`100%`},id:o,libraryReturnUrl:s,theme:a,children:(0,k.jsx)(AV,{selectedItems:l,onSelectItems:c})})]})]})}var HV=EO(!1),UV=({children:e})=>(0,k.jsx)(`div`,{className:`layer-ui__library`,children:e}),WV=(0,u.memo)(({onInsertLibraryItems:e,pendingElements:t,onAddToLibrary:n,setAppState:r,libraryReturnUrl:i,library:a,id:o,theme:s,selectedItems:c,onSelectItems:l})=>{let[d]=GI(KB),f=(0,u.useCallback)(e=>{(async(e,t)=>{VL(`element`,`addToLibrary`,`ui`);for(let t of Lc)if(e.some(e=>e.type===t))return r({errorMessage:q(`errors.libraryElementTypeError.${t}`)});let i=[{status:`unpublished`,elements:e,id:gx(),created:Date.now()},...t];n(),a.setLibrary(i).catch(()=>{r({errorMessage:q(`alerts.errorAddingToLibrary`)})})})(e,d.libraryItems)},[n,a,r,d.libraryItems]),p=(0,u.useMemo)(()=>d.libraryItems,[d]);if(d.status===`loading`&&!d.isInitialized)return(0,k.jsx)(UV,{children:(0,k.jsx)(`div`,{className:`layer-ui__library-message`,children:(0,k.jsxs)(`div`,{children:[(0,k.jsx)(lL,{size:`2em`}),(0,k.jsx)(`span`,{children:q(`labels.libraryLoadingMessage`)})]})})});let m=d.libraryItems.length>0||t.length>0;return(0,k.jsxs)(UV,{children:[(0,k.jsx)(VV,{isLoading:d.status===`loading`,libraryItems:p,onAddToLibrary:f,onInsertLibraryItems:e,pendingElements:t,id:o,libraryReturnUrl:i,theme:s,onSelectItems:l,selectedItems:c}),m&&(0,k.jsx)(nV,{className:`library-menu-control-buttons--at-bottom`,style:{padding:`16px 12px 0 12px`},id:o,libraryReturnUrl:i,theme:s})]})}),GV=(e,t)=>({elements:e,pending:YT(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}),selectedElementIds:t}),KV=(e,t)=>{let n=Xq(),[r,i]=(0,u.useState)(()=>GV(n,e.selectedElementIds)),a=(0,u.useRef)(new Map);return(0,u.useEffect)(()=>{for(let e of r.pending)a.current.set(e.id,e.version)},[r.pending]),(0,u.useEffect)(()=>{t.state.cursorButton===`up`&&t.state.activeTool.type===`selection`&&i(r=>{if(!Ku(r.selectedElementIds,e.selectedElementIds))return a.current.clear(),GV(n,e.selectedElementIds);let i=t.scene.getNonDeletedElementsMap();for(let t of Object.keys(e.selectedElementIds)){let r=i.get(t)?.version;if(r&&r!==a.current.get(t))return GV(n,e.selectedElementIds)}return r})},[t,t.state.cursorButton,t.state.activeTool.type,e.selectedElementIds,n]),r.pending},qV=(0,u.memo)(()=>{let e=Kq(),{onInsertElements:t}=e,n=qq(),r=lR(),i=Qq(),[a,o]=(0,u.useState)([]),s=(0,u.useMemo)(()=>e.library,[e.library]),c=KV(r,e),l=(0,u.useCallback)(e=>{t(QB(e))},[t]),d=(0,u.useCallback)(()=>{i({selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null})},[i]);return(0,k.jsx)(WV,{pendingElements:c,onInsertLibraryItems:l,onAddToLibrary:d,setAppState:i,libraryReturnUrl:n.libraryReturnUrl,library:s,id:e.id,theme:r.theme,selectedItems:a,onSelectItems:o})});function JV(e){if(e&&typeof e==`number`)return e;switch(e){case`small`:return 550;case`wide`:return 1024;default:return 800}}var YV=e=>{let[t,n]=RB(),[r]=(0,u.useState)(document.activeElement),{id:i}=Yq(),a=Jq().viewport.isMobile;(0,u.useEffect)(()=>{if(!t)return;let n=Wu(t);setTimeout(()=>{n.length>0&&e.autofocus!==!1&&(n[1]||n[0]).focus()});let r=e=>{if(e.key===H.TAB){let n=Wu(t),{activeElement:r}=document,i=n.findIndex(e=>e===r);i===0&&e.shiftKey?(n[n.length-1].focus(),e.preventDefault()):i===n.length-1&&!e.shiftKey&&(n[0].focus(),e.preventDefault())}};return t.addEventListener(`keydown`,r),()=>t.removeEventListener(`keydown`,r)},[t,e.autofocus]);let o=Qq(),s=KI(HV),c=()=>{o({openMenu:null}),s(!1),r.focus(),e.onCloseRequest()};return(0,k.jsx)(zB,{className:O(`Dialog`,e.className,{"Dialog--fullscreen":a}),labelledBy:`dialog-title`,maxWidth:JV(e.size),onCloseRequest:c,closeOnClickOutside:e.closeOnClickOutside,children:(0,k.jsxs)(gR,{ref:n,children:[e.title&&(0,k.jsx)(`h2`,{id:`${i}-dialog-title`,className:`Dialog__title`,children:(0,k.jsx)(`span`,{className:`Dialog__titleContent`,children:e.title})}),a&&(0,k.jsx)(`button`,{className:`Dialog__close`,onClick:c,title:q(`buttons.close`),"aria-label":q(`buttons.close`),type:`button`,children:Np}),(0,k.jsx)(`div`,{className:`Dialog__content`,children:e.children})]})})},XV=({type:e=`button`,onSelect:t,selected:n,children:r,className:i=``,...a})=>(0,k.jsx)(`button`,{onClick:qu(a.onClick,e=>{t()}),type:e,className:O(`excalidraw-button`,i,{selected:n}),...a,children:r}),ZV=(0,u.forwardRef)(({onChange:e,label:t,fullWidth:n,placeholder:r,readonly:i,selectOnRender:a,onKeyDown:o,isRedacted:s=!1,icon:c,className:l,...d},f)=>{let p=(0,u.useRef)(null);(0,u.useImperativeHandle)(f,()=>p.current),(0,u.useLayoutEffect)(()=>{a&&(p.current?.focus(),p.current?.select())},[a]);let[m,h]=(0,u.useState)(!1);return(0,k.jsxs)(`div`,{className:O(`ExcTextField`,l,{"ExcTextField--fullWidth":n,"ExcTextField--hasIcon":!!c}),onClick:()=>{p.current?.focus()},children:[c,t&&(0,k.jsx)(`div`,{className:`ExcTextField__label`,children:t}),(0,k.jsxs)(`div`,{className:O(`ExcTextField__input`,{"ExcTextField__input--readonly":i}),children:[(0,k.jsx)(`input`,{className:O({"is-redacted":`value`in d&&d.value&&s&&!m}),readOnly:i,value:`value`in d?d.value:void 0,defaultValue:`defaultValue`in d?d.defaultValue:void 0,placeholder:r,ref:p,onChange:t=>e?.(t.target.value),onKeyDown:o}),s&&(0,k.jsx)(XV,{onSelect:()=>h(!m),style:{border:0,userSelect:`none`},children:m?Bm:zm})]})]})}),QV={toggleTheme:[L(`Shift+Alt+D`)],saveScene:[L(`CtrlOrCmd+S`)],loadScene:[L(`CtrlOrCmd+O`)],clearCanvas:[L(`CtrlOrCmd+Delete`)],imageExport:[L(`CtrlOrCmd+Shift+E`)],commandPalette:[L(`CtrlOrCmd+/`),L(`CtrlOrCmd+Shift+P`)],cut:[L(`CtrlOrCmd+X`)],copy:[L(`CtrlOrCmd+C`)],paste:[L(`CtrlOrCmd+V`)],copyStyles:[L(`CtrlOrCmd+Alt+C`)],pasteStyles:[L(`CtrlOrCmd+Alt+V`)],selectAll:[L(`CtrlOrCmd+A`)],deleteSelectedElements:[L(`Delete`)],duplicateSelection:[L(`CtrlOrCmd+D`),L(`Alt+${q(`helpDialog.drag`)}`)],sendBackward:[L(`CtrlOrCmd+[`)],bringForward:[L(`CtrlOrCmd+]`)],sendToBack:[L(As?`CtrlOrCmd+Alt+[`:`CtrlOrCmd+Shift+[`)],bringToFront:[L(As?`CtrlOrCmd+Alt+]`:`CtrlOrCmd+Shift+]`)],copyAsPng:[L(`Shift+Alt+C`)],group:[L(`CtrlOrCmd+G`)],ungroup:[L(`CtrlOrCmd+Shift+G`)],gridMode:[L(`CtrlOrCmd+'`)],zenMode:[L(`Alt+Z`)],objectsSnapMode:[L(`Alt+S`)],stats:[L(`Alt+/`)],addToLibrary:[],flipHorizontal:[L(`Shift+H`)],flipVertical:[L(`Shift+V`)],viewMode:[L(`Alt+R`)],hyperlink:[L(`CtrlOrCmd+K`)],toggleElementLock:[L(`CtrlOrCmd+Shift+L`)],resetZoom:[L(`CtrlOrCmd+0`)],zoomOut:[L(`CtrlOrCmd+-`)],zoomIn:[L(`CtrlOrCmd++`)],zoomToFitSelection:[L(`Shift+3`)],zoomToFit:[L(`Shift+1`)],zoomToFitSelectionInViewport:[L(`Shift+2`)],toggleEraserTool:[L(`E`)],toggleHandTool:[L(`H`)],setFrameAsActiveTool:[L(`F`)],saveFileToDisk:[L(`CtrlOrCmd+S`)],saveToActiveFile:[L(`CtrlOrCmd+S`)],toggleShortcuts:[L(`?`)],searchMenu:[L(`CtrlOrCmd+F`)],wrapSelectionInFrame:[]},$V=(e,t=0)=>{let n=QV[e];return n&&n.length>0?n[t]||n[0]:``},eH=RegExp(`[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]`,`g`),tH=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,nH={À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`A`,Å:`A`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`a`,å:`a`,Ç:`C`,ç:`c`,Ð:`D`,ð:`d`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,è:`e`,é:`e`,ê:`e`,ë:`e`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,ì:`i`,í:`i`,î:`i`,ï:`i`,Ñ:`N`,ñ:`n`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`O`,Ø:`O`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`o`,ø:`o`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`U`,ù:`u`,ú:`u`,û:`u`,ü:`u`,Ý:`Y`,ý:`y`,ÿ:`y`,Æ:`E`,æ:`e`,Þ:`T`,þ:`t`,ß:`s`,Ā:`A`,Ă:`A`,Ą:`A`,ā:`a`,ă:`a`,ą:`a`,Ć:`C`,Ĉ:`C`,Ċ:`C`,Č:`C`,ć:`c`,ĉ:`c`,ċ:`c`,č:`c`,Ď:`D`,Đ:`D`,ď:`d`,đ:`d`,Ē:`E`,Ĕ:`E`,Ė:`E`,Ę:`E`,Ě:`E`,ē:`e`,ĕ:`e`,ė:`e`,ę:`e`,ě:`e`,Ĝ:`G`,Ğ:`G`,Ġ:`G`,Ģ:`G`,ĝ:`g`,ğ:`g`,ġ:`g`,ģ:`g`,Ĥ:`H`,Ħ:`H`,ĥ:`h`,ħ:`h`,Ĩ:`I`,Ī:`I`,Ĭ:`I`,Į:`I`,İ:`I`,ĩ:`i`,ī:`i`,ĭ:`i`,į:`i`,ı:`i`,Ĵ:`J`,ĵ:`j`,Ķ:`K`,ķ:`k`,ĸ:`k`,Ĺ:`L`,Ļ:`L`,Ľ:`L`,Ŀ:`L`,Ł:`L`,ĺ:`l`,ļ:`l`,ľ:`l`,ŀ:`l`,ł:`l`,Ń:`N`,Ņ:`N`,Ň:`N`,Ŋ:`N`,ń:`n`,ņ:`n`,ň:`n`,ŋ:`n`,Ō:`O`,Ŏ:`O`,Ő:`O`,ō:`o`,ŏ:`o`,ő:`o`,Ŕ:`R`,Ŗ:`R`,Ř:`R`,ŕ:`r`,ŗ:`r`,ř:`r`,Ś:`S`,Ŝ:`S`,Ş:`S`,Š:`S`,ś:`s`,ŝ:`s`,ş:`s`,š:`s`,Ţ:`T`,Ť:`T`,Ŧ:`T`,ţ:`t`,ť:`t`,ŧ:`t`,Ũ:`U`,Ū:`U`,Ŭ:`U`,Ů:`U`,Ű:`U`,Ų:`U`,ũ:`u`,ū:`u`,ŭ:`u`,ů:`u`,ű:`u`,ų:`u`,Ŵ:`W`,ŵ:`w`,Ŷ:`Y`,ŷ:`y`,Ÿ:`Y`,Ź:`Z`,Ż:`Z`,Ž:`Z`,ź:`z`,ż:`z`,ž:`z`,IJ:`I`,ij:`i`,Œ:`E`,œ:`e`,ʼn:`n`,ſ:`s`},rH=e=>e.replace(tH,e=>nH[e]||e).replace(eH,``),iH=u.createContext(null),aH=()=>u.useContext(iH),oH=dk(),sH=()=>u.useMemo(()=>({MainMenuTunnel:pF(),WelcomeScreenMenuHintTunnel:pF(),WelcomeScreenToolbarHintTunnel:pF(),WelcomeScreenHelpHintTunnel:pF(),WelcomeScreenCenterTunnel:pF(),FooterCenterTunnel:pF(),DefaultSidebarTriggerTunnel:pF(),DefaultSidebarTabTriggersTunnel:pF(),OverwriteConfirmDialogTunnel:pF(),TTDDialogTriggerTunnel:pF(),tunnelsJotai:oH}),[]),cH=(e,t)=>{let n=t[0]?.type||null;for(let e of t)if(e.type!==n){n=null;break}return k_(e.activeTool.type)&&e.activeTool.type!==`image`&&n!==`image`&&n!==`frame`&&n!==`magicframe`||t.some(e=>k_(e.type))},lH=(e,t)=>O_(e.activeTool.type)||t.some(e=>O_(e.type)),uH=({appState:e,elementsMap:t,renderAction:n,app:r})=>{let i=XT(t,e),a=!1;i.length===2&&(kd(i[0])||kd(i[1]))&&(a=!0);let o=!!(e.editingTextElement||e.newElement),s=Jq(),c=document.documentElement.getAttribute(`dir`)===`rtl`,l=O_(e.activeTool.type)&&!Eu(e.currentItemBackgroundColor)||i.some(e=>O_(e.type)&&!Eu(e.backgroundColor)),u=i.length===1||a,d=!e.editingLinearElement&&i.length===1&&yd(i[0])&&!z(i[0]),f=!e.croppingElementId&&i.length===1&&ud(i[0]),p=!a&&Yz(e,r);return(0,k.jsxs)(`div`,{className:`panelColumn`,children:[(0,k.jsx)(`div`,{children:cH(e,i)&&n(`changeStrokeColor`)}),lH(e,i)&&(0,k.jsx)(`div`,{children:n(`changeBackgroundColor`)}),l&&n(`changeFillStyle`),(A_(e.activeTool.type)||i.some(e=>A_(e.type)))&&n(`changeStrokeWidth`),(e.activeTool.type===`freedraw`||i.some(e=>e.type===`freedraw`))&&n(`changeStrokeShape`),(j_(e.activeTool.type)||i.some(e=>j_(e.type)))&&(0,k.jsxs)(k.Fragment,{children:[n(`changeStrokeStyle`),n(`changeSloppiness`)]}),(M_(e.activeTool.type)||i.some(e=>M_(e.type)))&&(0,k.jsx)(k.Fragment,{children:n(`changeRoundness`)}),(N_(e.activeTool.type)||i.some(e=>N_(e.type)))&&(0,k.jsx)(k.Fragment,{children:n(`changeArrowType`)}),(e.activeTool.type===`text`||i.some(R))&&(0,k.jsxs)(k.Fragment,{children:[n(`changeFontFamily`),n(`changeFontSize`),(e.activeTool.type===`text`||Gb(i,t))&&n(`changeTextAlign`)]}),Wb(i,t)&&n(`changeVerticalAlign`),(P_(e.activeTool.type)||i.some(e=>P_(e.type)))&&(0,k.jsx)(k.Fragment,{children:n(`changeArrowhead`)}),n(`changeOpacity`),(0,k.jsxs)(`fieldset`,{children:[(0,k.jsx)(`legend`,{children:q(`labels.layers`)}),(0,k.jsxs)(`div`,{className:`buttonList`,children:[n(`sendToBack`),n(`sendBackward`),n(`bringForward`),n(`bringToFront`)]})]}),p&&!a&&(0,k.jsxs)(`fieldset`,{children:[(0,k.jsx)(`legend`,{children:q(`labels.align`)}),(0,k.jsxs)(`div`,{className:`buttonList`,children:[c?(0,k.jsxs)(k.Fragment,{children:[n(`alignRight`),n(`alignHorizontallyCentered`),n(`alignLeft`)]}):(0,k.jsxs)(k.Fragment,{children:[n(`alignLeft`),n(`alignHorizontallyCentered`),n(`alignRight`)]}),i.length>2&&n(`distributeHorizontally`),(0,k.jsx)(`div`,{style:{flexBasis:`100%`,height:0}}),(0,k.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:`.5rem`,marginTop:`-0.5rem`},children:[n(`alignTop`),n(`alignVerticallyCentered`),n(`alignBottom`),i.length>2&&n(`distributeVertically`)]})]})]}),!o&&i.length>0&&(0,k.jsxs)(`fieldset`,{children:[(0,k.jsx)(`legend`,{children:q(`labels.actions`)}),(0,k.jsxs)(`div`,{className:`buttonList`,children:[!s.editor.isMobile&&n(`duplicateSelection`),!s.editor.isMobile&&n(`deleteSelectedElements`),n(`group`),n(`ungroup`),u&&n(`hyperlink`),f&&n(`cropEditor`),d&&n(`toggleLinearEditor`)]})]})]})},dH=({activeTool:e,appState:t,app:n,UIOptions:r})=>{let[i,a]=(0,u.useState)(!1),o=e.type===`frame`,s=e.type===`laser`,c=e.type===`embeddable`,{TTDDialogTriggerTunnel:l}=aH();return(0,k.jsxs)(k.Fragment,{children:[Lg.map(({value:i,icon:a,key:o,numericKey:s,fillable:c},l)=>{if(r.tools?.[i]===!1)return null;let u=q(`toolBar.${i}`),d=o&&nu(typeof o==`string`?o:o[0]),f=d?`${d} ${q(`helpDialog.or`)} ${s}`:`${s}`;return(0,k.jsx)(fL,{className:O(`Shape`,{fillable:c}),type:`radio`,icon:a,checked:e.type===i,name:`editor-current-shape`,title:`${nu(u)} \u2014 ${f}`,keyBindingLabel:s||d,"aria-label":nu(u),"aria-keyshortcuts":f,"data-testid":`toolbar-${i}`,onPointerDown:({pointerType:e})=>{!t.penDetected&&e===`pen`&&n.togglePenMode(!0)},onChange:({pointerType:e})=>{t.activeTool.type!==i&&VL(`toolbar`,i,`ui`),i===`image`?n.setActiveTool({type:i,insertOnCanvasDirectly:e!==`mouse`}):n.setActiveTool({type:i})}},i)}),(0,k.jsx)(`div`,{className:`App-toolbar__divider`}),(0,k.jsxs)(DV,{open:i,children:[(0,k.jsx)(DV.Trigger,{className:O(`App-toolbar__extra-tools-trigger`,{"App-toolbar__extra-tools-trigger--selected":o||c||s&&!n.props.isCollaborating}),onToggle:()=>a(!i),title:q(`toolBar.extraTools`),children:Mm}),(0,k.jsxs)(DV.Content,{onClickOutside:()=>a(!1),onSelect:()=>a(!1),className:`App-toolbar__extra-tools-dropdown`,children:[(0,k.jsx)(DV.Item,{onSelect:()=>n.setActiveTool({type:`frame`}),icon:Nm,shortcut:H.F.toLocaleUpperCase(),"data-testid":`toolbar-frame`,selected:o,children:q(`toolBar.frame`)}),(0,k.jsx)(DV.Item,{onSelect:()=>n.setActiveTool({type:`embeddable`}),icon:qf,"data-testid":`toolbar-embeddable`,selected:c,children:q(`toolBar.embeddable`)}),(0,k.jsx)(DV.Item,{onSelect:()=>n.setActiveTool({type:`laser`}),icon:Im,"data-testid":`toolbar-laser`,selected:s,shortcut:H.K.toLocaleUpperCase(),children:q(`toolBar.laser`)}),(0,k.jsx)(`div`,{style:{margin:`6px 0`,fontSize:14,fontWeight:600},children:`Generate`}),n.props.aiEnabled!==!1&&(0,k.jsx)(l.Out,{}),(0,k.jsx)(DV.Item,{onSelect:()=>n.setOpenDialog({name:`ttd`,tab:`mermaid`}),icon:Pm,"data-testid":`toolbar-embeddable`,children:q(`toolBar.mermaidToExcalidraw`)}),n.props.aiEnabled!==!1&&n.plugins.diagramToCode&&(0,k.jsx)(k.Fragment,{children:(0,k.jsxs)(DV.Item,{onSelect:()=>n.onMagicframeToolSelect(),icon:Lm,"data-testid":`toolbar-magicframe`,children:[q(`toolBar.magicframe`),(0,k.jsx)(DV.Item.Badge,{children:`AI`})]})})]})]})]})},fH=({renderAction:e,zoom:t})=>(0,k.jsx)(eV.Col,{gap:1,className:Ks.ZOOM_ACTIONS,children:(0,k.jsxs)(eV.Row,{align:`center`,children:[e(`zoomOut`),e(`resetZoom`),e(`zoomIn`)]})}),pH=({renderAction:e,className:t})=>(0,k.jsxs)(`div`,{className:`undo-redo-buttons ${t}`,children:[(0,k.jsx)(`div`,{className:`undo-button-container`,children:(0,k.jsx)(oz,{label:q(`buttons.undo`),children:e(`undo`)})}),(0,k.jsx)(`div`,{className:`redo-button-container`,children:(0,k.jsxs)(oz,{label:q(`buttons.redo`),children:[` `,e(`redo`)]})})]}),mH=({actionManager:e,showExitZenModeBtn:t})=>(0,k.jsx)(`button`,{type:`button`,className:O(`disable-zen-mode`,{"disable-zen-mode--visible":t}),onClick:()=>e.executeAction(dB),children:q(`buttons.exitZenMode`)}),hH=({renderAction:e,className:t})=>(0,k.jsx)(`div`,{className:`finalize-button ${t}`,children:e(`finalize`,{size:`small`})}),gH=e=>{let t=(0,u.useRef)({userFn:e});return t.current.userFn=e,t.current.stableFn||(t.current.stableFn=(...e)=>t.current.userFn(...e)),t.current.stableFn},_H=EO(null),vH=()=>{let[e,t]=GI(_H),n=$q();return e&&e===`clearCanvas`?(0,k.jsx)(uV,{onConfirm:()=>{n.executeAction(sz),t(null)},onCancel:()=>t(null),title:q(`clearCanvasDialog.title`),children:(0,k.jsxs)(`p`,{className:`clear-canvas__content`,children:[` `,q(`alerts.clearReset`)]})}):null},yH={};_(yH,{toggleTheme:()=>bH});var bH={...mz,category:`App`,label:`Toggle theme`,perform:({actionManager:e})=>{e.executeAction(mz,`commandPalette`)}},xH=W({name:`copyElementLink`,label:`labels.copyElementLink`,icon:Em,trackEvent:{category:`element`},perform:async(e,t,n,r)=>{let i=YT(e,t);try{if(window.location){let n=eC(i,t);return n?(await Zw(r.props.generateLinkForSelection?r.props.generateLinkForSelection(n.id,n.type):$S(n.id,n.type)),{appState:{toast:{message:q(`toast.elementLinkCopied`),closable:!0}},captureUpdate:G.EVENTUALLY}):{appState:t,elements:e,app:r,captureUpdate:G.EVENTUALLY}}}catch(e){console.error(e)}return{appState:t,elements:e,app:r,captureUpdate:G.EVENTUALLY}},predicate:(e,t)=>tC(YT(e,t))}),SH=W({name:`linkToElement`,label:`labels.linkToElement`,icon:mh,perform:(e,t,n,r)=>{let i=YT(e,t);return i.length!==1||!tC(i)?{elements:e,appState:t,app:r,captureUpdate:G.EVENTUALLY}:{appState:{...t,openDialog:{name:`elementLinkSelector`,sourceElementId:YT(e,t)[0].id}},captureUpdate:G.IMMEDIATELY}},predicate:(e,t,n,r)=>{let i=YT(e,t);return t.openDialog?.name!==`elementLinkSelector`&&i.length===1&&tC(i)},trackEvent:!1}),CH=EO(null),wH={app:`App`,export:`Export`,tools:`Tools`,editor:`Editor`,elements:`Elements`,links:`Links`},TH=e=>{switch(e){case wH.app:return 1;case wH.export:return 2;case wH.editor:return 3;case wH.tools:return 4;case wH.elements:return 5;case wH.links:return 6;default:return 10}},EH=({shortcut:e,className:t,children:n})=>{let r=e.replace(`++`,`+$`).split(`+`);return(0,k.jsxs)(`div`,{className:O(`shortcut`,t),children:[r.map((e,t)=>(0,k.jsx)(`div`,{className:`shortcut-wrapper`,children:(0,k.jsx)(`div`,{className:`shortcut-key`,children:e===`$`?`+`:e})},e)),(0,k.jsx)(`div`,{className:`shortcut-desc`,children:n})]})},DH=e=>!e.altKey&&e[H.CTRL_OR_CMD]&&(e.shiftKey&&e.key.toLowerCase()===H.P||e.key===H.SLASH);Object.assign(e=>{let t=lR(),n=Qq();return(0,u.useEffect)(()=>{let e=e=>{DH(e)&&(e.preventDefault(),e.stopPropagation(),n(e=>{let t=e.openDialog?.name===`commandPalette`?null:{name:`commandPalette`};return t&&VL(`command_palette`,`open`,`shortcut`),{openDialog:t}}))};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},[n]),t.openDialog?.name===`commandPalette`?(0,k.jsx)(OH,{...e}):null},{defaultItems:yH});function OH({customCommandPaletteItems:e}){let t=Kq(),n=lR(),r=Qq(),i=qq(),a=$q(),[o,s]=GI(CH),[c,l]=(0,u.useState)(null),d=(0,u.useRef)(null),f=fR({uiAppState:n,customCommandPaletteItems:e,appProps:i});(0,u.useEffect)(()=>{let{uiAppState:e,customCommandPaletteItems:n,appProps:i}=f,c=n=>{let r=``;return n.label&&(r=typeof n.label==`function`?q(n.label(t.scene.getNonDeletedElements(),e,t)):q(n.label)),r},u=n=>typeof n.icon==`function`?n.icon(e,t.scene.getNonDeletedElements()):n.icon,d=[],p=(e,t,n)=>{let r={label:c(e),icon:u(e),category:t,shortcut:$V(e.name),keywords:e.keywords,predicate:e.predicate,viewMode:e.viewMode,perform:()=>{a.executeAction(e,`commandPalette`)}};return n?n(r,e):r};if(e&&t.scene&&a){let f=[a.actions.group,a.actions.ungroup,a.actions.cut,a.actions.copy,a.actions.deleteSelectedElements,a.actions.wrapSelectionInFrame,a.actions.copyStyles,a.actions.pasteStyles,a.actions.bringToFront,a.actions.bringForward,a.actions.sendBackward,a.actions.sendToBack,a.actions.alignTop,a.actions.alignBottom,a.actions.alignLeft,a.actions.alignRight,a.actions.alignVerticallyCentered,a.actions.alignHorizontallyCentered,a.actions.duplicateSelection,a.actions.flipHorizontal,a.actions.flipVertical,a.actions.zoomToFitSelection,a.actions.zoomToFitSelectionInViewport,a.actions.increaseFontSize,a.actions.decreaseFontSize,a.actions.toggleLinearEditor,a.actions.cropEditor,PB,xH,SH].map(e=>p(e,wH.elements,(e,t)=>({...e,predicate:t.predicate?t.predicate:(e,t,n,r)=>YT(e,t).length>0}))),m=[a.actions.toggleHandTool,a.actions.setFrameAsActiveTool].map(e=>p(e,wH.tools)),h=[a.actions.undo,a.actions.redo,a.actions.zoomIn,a.actions.zoomOut,a.actions.resetZoom,a.actions.zoomToFit,a.actions.zenMode,a.actions.viewMode,a.actions.gridMode,a.actions.objectsSnapMode,a.actions.toggleShortcuts,a.actions.selectAll,a.actions.toggleElementLock,a.actions.unlockAllElements,a.actions.stats].map(e=>p(e,wH.editor)),g=[a.actions.saveToActiveFile,a.actions.saveFileToDisk,a.actions.copyAsPng,a.actions.copyAsSvg].map(e=>p(e,wH.export));d=[...f,...h,{label:c(sz),icon:u(sz),shortcut:$V(sz.name),category:wH.editor,keywords:[`delete`,`destroy`],viewMode:!1,perform:()=>{XI.set(_H,`clearCanvas`)}},{label:q(`buttons.exportImage`),category:wH.export,icon:fp,shortcut:$V(`imageExport`),keywords:[`export`,`image`,`png`,`jpeg`,`svg`,`clipboard`,`picture`],perform:()=>{r({openDialog:{name:`imageExport`}})}},...g];let _=[{label:q(`toolBar.library`),category:wH.app,icon:Ef,viewMode:!1,perform:()=>{e.openSidebar?r({openSidebar:null}):r({openSidebar:{name:Ic.name,tab:Ic.defaultTab}})}},{label:q(`search.title`),category:wH.app,icon:Hm,viewMode:!0,perform:()=>{a.executeAction(jH)}},{label:q(`labels.changeStroke`),keywords:[`color`,`outline`],category:wH.elements,icon:dp,viewMode:!1,predicate:(e,t)=>{let n=YT(e,t);return n.length>0&&cH(t,n)},perform:()=>{r(e=>({openMenu:e.openMenu===`shape`?null:`shape`,openPopup:`elementStroke`}))}},{label:q(`labels.changeBackground`),keywords:[`color`,`fill`],icon:dp,category:wH.elements,viewMode:!1,predicate:(e,t)=>{let n=YT(e,t);return n.length>0&&lH(t,n)},perform:()=>{r(e=>({openMenu:e.openMenu===`shape`?null:`shape`,openPopup:`elementBackground`}))}},{label:q(`labels.canvasBackground`),keywords:[`color`],icon:dp,category:wH.editor,viewMode:!1,perform:()=>{r(e=>({openMenu:e.openMenu===`canvas`?null:`canvas`,openPopup:`canvasBackground`}))}},...Lg.reduce((e,n)=>{let{value:r,icon:a,key:o,numericKey:s}=n;if(i.UIOptions.tools?.[r]===!1)return e;let c=o&&nu(typeof o==`string`?o:o[0])||s,l={label:q(`toolBar.${r}`),category:wH.tools,shortcut:c,icon:a,keywords:[`toolbar`],viewMode:!1,perform:({event:e})=>{r===`image`?t.setActiveTool({type:r,insertOnCanvasDirectly:e.type===`keydown`}):t.setActiveTool({type:r})}};return e.push(l),e},[]),...m,{label:q(`toolBar.lock`),category:wH.tools,icon:e.activeTool.locked?jf:Af,shortcut:H.Q.toLocaleUpperCase(),viewMode:!1,perform:()=>{t.toggleLock()}},{label:`${q(`labels.textToDiagram`)}...`,category:wH.tools,icon:Vm,viewMode:!1,predicate:i.aiEnabled,perform:()=>{r(e=>({...e,openDialog:{name:`ttd`,tab:`text-to-diagram`}}))}},{label:`${q(`toolBar.mermaidToExcalidraw`)}...`,category:wH.tools,icon:Pm,viewMode:!1,predicate:i.aiEnabled,perform:()=>{r(e=>({...e,openDialog:{name:`ttd`,tab:`mermaid`}}))}}],v=[...d,..._,...n||[]].map(e=>({...e,icon:e.icon||Km,order:e.order??TH(e.category),haystack:`${rH(e.label.toLocaleLowerCase())} ${e.keywords?.join(` `)||``}`}));l(v),s(v.find(e=>e.label===o?.label)??null)}},[f,t,a,l,o?.label,s,r]);let[p,m]=(0,u.useState)(``),[h,g]=(0,u.useState)(null),[_,v]=(0,u.useState)({}),y=e=>{r({openDialog:null},e),m(``)},b=(e,t)=>{n.openDialog?.name===`commandPalette`&&(t.stopPropagation(),t.preventDefault(),document.body.classList.add(`excalidraw-animations-disabled`),y(()=>{e.perform({actionManager:a,event:t}),s(e),requestAnimationFrame(()=>{document.body.classList.remove(`excalidraw-animations-disabled`)})}))},x=gH(e=>e.viewMode===!1&&n.viewModeEnabled?!1:typeof e.predicate==`function`?e.predicate(t.scene.getNonDeletedElements(),n,i,t):e.predicate===void 0||e.predicate),S=gH(e=>{let t=ou(e.target)||DH(e)||e.key===H.ESCAPE;if(t&&e.key!==H.ARROW_UP&&e.key!==H.ARROW_DOWN&&e.key!==H.ENTER)return;let n=Object.values(_).flat(),r=o&&!p&&x(o);if(e.key===H.ARROW_UP){e.preventDefault();let t=n.findIndex(e=>e.label===h?.label);if(r){if(t===0){g(o);return}if(h===o){let e=n[n.length-1];e&&g(e);return}}let i;i=t===-1||t===0?n.length-1:(t-1)%n.length;let a=n[i];a&&g(a);return}if(e.key===H.ARROW_DOWN){e.preventDefault();let t=n.findIndex(e=>e.label===h?.label);if(r){if(!h||t===n.length-1){g(o);return}if(h===o){let e=n[0];e&&g(e);return}}let i=n[(t+1)%n.length];i&&g(i);return}if(e.key===H.ENTER&&h&&setTimeout(()=>{b(h,e)}),!t){if(e.stopPropagation(),/^[a-zA-Z0-9]$/.test(e.key)){d?.current?.focus();return}e.preventDefault()}});return(0,u.useEffect)(()=>(window.addEventListener(`keydown`,S,{capture:!0}),()=>window.removeEventListener(`keydown`,S,{capture:!0})),[S]),(0,u.useEffect)(()=>{if(!c)return;let e=e=>{let t={};for(let n of e)t[n.category]?t[n.category].push(n):t[n.category]=[n];return t},t=c.filter(x).sort((e,t)=>e.order-t.order),n=!p&&o&&x(o);if(!p){v(e(n?t.filter(e=>e.label!==o?.label):t)),g(n?o:t[0]||null);return}let r=rH(p.toLocaleLowerCase().replace(/[<>_| -]/g,``));t=QP.default.filter(r,t,{extract:e=>e.haystack}).sort((e,t)=>t.score-e.score).map(e=>e.original),v(e(t)),g(t[0]??null)},[p,c,x,o]),(0,k.jsxs)(YV,{onCloseRequest:()=>y(),closeOnClickOutside:!0,title:!1,size:720,autofocus:!0,className:`command-palette-dialog`,children:[(0,k.jsx)(ZV,{value:p,placeholder:q(`commandPalette.search.placeholder`),onChange:e=>{m(e)},selectOnRender:!0,ref:d}),!t.device.viewport.isMobile&&(0,k.jsxs)(`div`,{className:`shortcuts-wrapper`,children:[(0,k.jsx)(EH,{shortcut:`↑↓`,children:q(`commandPalette.shortcuts.select`)}),(0,k.jsx)(EH,{shortcut:`↵`,children:q(`commandPalette.shortcuts.confirm`)}),(0,k.jsx)(EH,{shortcut:L(`Esc`),children:q(`commandPalette.shortcuts.close`)})]}),(0,k.jsxs)(`div`,{className:`commands`,children:[o&&!p&&(0,k.jsxs)(`div`,{className:`command-category`,children:[(0,k.jsxs)(`div`,{className:`command-category-title`,children:[q(`commandPalette.recents`),(0,k.jsx)(`div`,{className:`icon`,style:{marginLeft:`6px`},children:Um})]}),(0,k.jsx)(kH,{command:o,isSelected:o.label===h?.label,onClick:e=>b(o,e),disabled:!x(o),onMouseMove:()=>g(o),showShortcut:!t.device.viewport.isMobile,appState:n})]}),Object.keys(_).length>0?Object.keys(_).map((e,r)=>(0,k.jsxs)(`div`,{className:`command-category`,children:[(0,k.jsx)(`div`,{className:`command-category-title`,children:e}),_[e].map(e=>(0,k.jsx)(kH,{command:e,isSelected:e.label===h?.label,onClick:t=>b(e,t),onMouseMove:()=>g(e),showShortcut:!t.device.viewport.isMobile,appState:n},e.label))]},e)):c?(0,k.jsxs)(`div`,{className:`no-match`,children:[(0,k.jsx)(`div`,{className:`icon`,children:Hm}),` `,q(`commandPalette.search.noMatch`)]}):null]})]})}var kH=({command:e,isSelected:t,disabled:n,onMouseMove:r,onClick:i,showShortcut:a,appState:o})=>{let s=()=>{};return(0,k.jsxs)(`div`,{className:O(`command-item`,{"item-selected":t,"item-disabled":n}),ref:e=>{t&&!n&&e?.scrollIntoView?.({block:`nearest`})},onClick:n?s:i,onMouseMove:n?s:r,title:n?q(`commandPalette.itemNotAvailable`):``,children:[(0,k.jsxs)(`div`,{className:`name`,children:[e.icon&&(0,k.jsx)(CR,{icon:typeof e.icon==`function`?e.icon(o):e.icon}),e.label]}),a&&e.shortcut&&(0,k.jsx)(EH,{shortcut:e.shortcut})]})},AH=W({name:`toggleLinearEditor`,category:wH.elements,label:(e,t,n)=>n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds})[0]?.type===`arrow`?`labels.lineEditor.editArrow`:`labels.lineEditor.edit`,keywords:[`line`],trackEvent:{category:`element`},predicate:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t);return!!(!t.editingLinearElement&&i.length===1&&yd(i[0])&&!z(i[0]))},perform(e,t,n,r){let i=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0})[0],a=t.editingLinearElement?.elementId===i.id?null:new U(i);return{appState:{...t,editingLinearElement:a},captureUpdate:G.IMMEDIATELY}},PanelComponent:({appState:e,updateData:t,app:n})=>{let r=n.scene.getSelectedElements({selectedElementIds:e.selectedElementIds})[0],i=q(r.type===`arrow`?`labels.lineEditor.editArrow`:`labels.lineEditor.edit`);return(0,k.jsx)(fL,{type:`button`,icon:oh,title:i,"aria-label":i,onClick:()=>t(null)})}}),jH=W({name:`searchMenu`,icon:Hm,keywords:[`search`,`find`],label:`search.title`,viewMode:!0,trackEvent:{category:`search_menu`,action:`toggle`,predicate:e=>e.gridModeEnabled},perform(e,t,n,r){if(t.openSidebar?.name===Ic.name&&t.openSidebar.tab===`search`){let e=r.excalidrawContainerValue.container?.querySelector(`.${Ks.SEARCH_MENU_INPUT_WRAPPER} input`);return e?.matches(`:focus`)?{appState:{...t,openSidebar:null},captureUpdate:G.EVENTUALLY}:(e?.focus(),e?.select(),!1)}return{appState:{...t,openSidebar:{name:Ic.name,tab:Fc},openDialog:null},captureUpdate:G.EVENTUALLY}},checked:e=>e.gridModeEnabled,predicate:(e,t,n)=>n.gridModeEnabled===void 0,keyTest:e=>e[H.CTRL_OR_CMD]&&e.key===H.F}),MH=W({name:`cropEditor`,label:`helpDialog.cropStart`,icon:ph,viewMode:!0,trackEvent:{category:`menu`},keywords:[`image`,`crop`],perform(e,t,n,r){let i=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0})[0];return{appState:{...t,isCropping:!1,croppingElementId:i.id},captureUpdate:G.IMMEDIATELY}},predicate:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t);return!!(!t.croppingElementId&&i.length===1&&ud(i[0]))},PanelComponent:({appState:e,updateData:t,app:n})=>{let r=q(`helpDialog.cropStart`);return(0,k.jsx)(fL,{type:`button`,icon:ph,title:r,"aria-label":r,onClick:()=>t(null)})}}),NH=class{constructor(e=!0,t=!0){this.isUndoStackEmpty=e,this.isRedoStackEmpty=t}},PH=class e{constructor(){v(this,`onHistoryChangedEmitter`,new Zx),v(this,`undoStack`,[]),v(this,`redoStack`,[])}get isUndoStackEmpty(){return this.undoStack.length===0}get isRedoStackEmpty(){return this.redoStack.length===0}clear(){this.undoStack.length=0,this.redoStack.length=0}record(e,t){let n=FH.create(t,e);n.isEmpty()||(this.undoStack.push(n.inverse()),n.elementsChange.isEmpty()||(this.redoStack.length=0),this.onHistoryChangedEmitter.trigger(new NH(this.isUndoStackEmpty,this.isRedoStackEmpty)))}undo(t,n,r){return this.perform(t,n,r,()=>e.pop(this.undoStack),n=>e.push(this.redoStack,n,t))}redo(t,n,r){return this.perform(t,n,r,()=>e.pop(this.redoStack),n=>e.push(this.undoStack,n,t))}perform(e,t,n,r,i){try{let a=r();if(a===null)return;let o=e,s=t,c=!1;for(;a;){try{[o,s,c]=a.applyTo(o,s,n)}finally{i(a)}if(c)break;a=r()}return[o,s]}finally{this.onHistoryChangedEmitter.trigger(new NH(this.isUndoStackEmpty,this.isRedoStackEmpty))}}static pop(e){if(!e.length)return null;let t=e.pop();return t===void 0?null:t}static push(e,t,n){let r=t.inverse().applyLatestChanges(n);return e.push(r)}},FH=class e{constructor(e,t){this.appStateChange=e,this.elementsChange=t}static create(t,n){return new e(t,n)}inverse(){return new e(this.appStateChange.inverse(),this.elementsChange.inverse())}applyTo(e,t,n){let[r,i]=this.elementsChange.applyTo(e,n.elements),[a,o]=this.appStateChange.applyTo(t,r);return[r,a,i||o]}applyLatestChanges(t){let n=this.elementsChange.applyLatestChanges(t);return e.create(this.appStateChange,n)}isEmpty(){return this.appStateChange.isEmpty()&&this.elementsChange.isEmpty()}},IH=(e,t)=>{let[n,r]=(0,u.useState)(t);return(0,u.useEffect)(()=>{let t=e.on(e=>{r(e)});return()=>{t()}},[e]),n},LH=(e,t,n)=>{if(!t.multiElement&&!t.resizingElement&&!t.editingTextElement&&!t.newElement&&!t.selectedElementsAreBeingDragged&&!t.selectionElement&&!e.flowChartCreator.isCreatingChart){let e=n();if(!e)return{captureUpdate:G.EVENTUALLY};let[t,r]=e;return{appState:r,elements:Array.from(t.values()),captureUpdate:G.NEVER}}return{captureUpdate:G.EVENTUALLY}},RH=(e,t)=>({name:`undo`,label:`buttons.undo`,icon:hp,trackEvent:{category:`history`},viewMode:!1,perform:(n,r,i,a)=>LH(a,r,()=>e.undo(Nu(n),r,t.snapshot)),keyTest:e=>e[H.CTRL_OR_CMD]&&Mg(e,H.Z)&&!e.shiftKey,PanelComponent:({updateData:t,data:n})=>{let{isUndoStackEmpty:r}=IH(e.onHistoryChangedEmitter,new NH(e.isUndoStackEmpty,e.isRedoStackEmpty));return(0,k.jsx)(fL,{type:`button`,icon:hp,"aria-label":q(`buttons.undo`),onClick:t,size:n?.size||`medium`,disabled:r,"data-testid":`button-undo`})}}),zH=(e,t)=>({name:`redo`,label:`buttons.redo`,icon:gp,trackEvent:{category:`history`},viewMode:!1,perform:(n,r,i,a)=>LH(a,r,()=>e.redo(Nu(n),r,t.snapshot)),keyTest:e=>e[H.CTRL_OR_CMD]&&e.shiftKey&&Mg(e,H.Z)||js&&e.ctrlKey&&!e.shiftKey&&Mg(e,H.Y),PanelComponent:({updateData:t,data:n})=>{let{isRedoStackEmpty:r}=IH(e.onHistoryChangedEmitter,new NH(e.isUndoStackEmpty,e.isRedoStackEmpty));return(0,k.jsx)(fL,{type:`button`,icon:gp,"aria-label":q(`buttons.redo`),onClick:t,size:n?.size||`medium`,disabled:r,"data-testid":`button-redo`})}}),BH=(e,t,n,r,i,a)=>{if(e.trackEvent)try{typeof e.trackEvent==`object`&&(!e.trackEvent.predicate||e.trackEvent.predicate(n,r,a))&&VL(e.trackEvent.category,e.trackEvent.action||e.name,`${t} (${i.device.editor.isMobile?`mobile`:`desktop`})`)}catch(e){console.error(`error while logging action:`,e)}},VH=class{constructor(e,t,n,r){v(this,`actions`,{}),v(this,`updater`),v(this,`getAppState`),v(this,`getElementsIncludingDeleted`),v(this,`app`),v(this,`renderAction`,(e,t)=>{let n=this.app.props.UIOptions.canvasActions;if(this.actions[e]&&`PanelComponent`in this.actions[e]&&(!(e in n)||n[e])){let n=this.actions[e],r=n.PanelComponent;r.displayName=`PanelComponent`;let i=this.getElementsIncludingDeleted(),a=this.getAppState();return(0,k.jsx)(r,{elements:this.getElementsIncludingDeleted(),appState:this.getAppState(),updateData:e=>{BH(n,`ui`,a,i,this.app,e),this.updater(n.perform(this.getElementsIncludingDeleted(),this.getAppState(),e,this.app))},appProps:this.app.props,app:this.app,data:t})}return null}),v(this,`isActionEnabled`,e=>{let t=this.getElementsIncludingDeleted(),n=this.getAppState();return!e.predicate||e.predicate(t,n,this.app.props,this.app)}),this.updater=t=>{if(Uu(t))t.then(t=>e(t));else return e(t)},this.getAppState=t,this.getElementsIncludingDeleted=n,this.app=r}registerAction(e){this.actions[e.name]=e}registerAll(e){e.forEach(e=>this.registerAction(e))}handleKeyDown(e){let t=this.app.props.UIOptions.canvasActions,n=Object.values(this.actions).sort((e,t)=>(t.keyPriority||0)-(e.keyPriority||0)).filter(n=>(n.name in t?t[n.name]:!0)&&n.keyTest&&n.keyTest(e,this.getAppState(),this.getElementsIncludingDeleted(),this.app));if(n.length!==1)return n.length>1&&console.warn(`Canceling as multiple actions match this shortcut`,n),!1;let r=n[0];if(this.getAppState().viewModeEnabled&&r.viewMode!==!0)return!1;let i=this.getElementsIncludingDeleted(),a=this.getAppState();return BH(r,`keyboard`,a,i,this.app,null),e.preventDefault(),e.stopPropagation(),this.updater(n[0].perform(i,a,null,this.app)),!0}executeAction(e,t=`api`,n=null){let r=this.getElementsIncludingDeleted(),i=this.getAppState();BH(e,t,i,r,this.app,n),this.updater(e.perform(r,i,n,this.app))}},HH=e=>{let t=Array.from(e.values());return{x:WH(t,e=>e.x)/t.length,y:WH(t,e=>e.y)/t.length}},UH=([e,t])=>Math.hypot(e.x-t.x,e.y-t.y),WH=(e,t)=>e.reduce((e,n)=>e+t(n),0),GH=({children:e,left:t,top:n,onCloseRequest:r,fitInViewport:i=!1,offsetLeft:a=0,offsetTop:o=0,viewportWidth:s=window.innerWidth,viewportHeight:c=window.innerHeight})=>{let l=(0,u.useRef)(null);(0,u.useEffect)(()=>{let e=l.current;if(!e)return;e.contains(document.activeElement)||e.focus();let t=t=>{if(t.key===H.TAB){let n=Wu(e),{activeElement:r}=document,i=n.findIndex(e=>e===r);r===e?(t.shiftKey?n[n.length-1]?.focus():n[0].focus(),t.preventDefault(),t.stopImmediatePropagation()):i===0&&t.shiftKey?(n[n.length-1]?.focus(),t.preventDefault(),t.stopImmediatePropagation()):i===n.length-1&&!t.shiftKey&&(n[0]?.focus(),t.preventDefault(),t.stopImmediatePropagation())}};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)},[]);let d=(0,u.useRef)(null);return(0,u.useLayoutEffect)(()=>{if(i&&l.current&&n!=null&&t!=null){let e=l.current,{width:r,height:i}=e.getBoundingClientRect();if(d.current?.top===n&&d.current?.left===t)return;d.current={top:n,left:t},r>=s?(e.style.width=`${s}px`,e.style.left=`0px`,e.style.overflowX=`scroll`):t+r-a>s?e.style.left=`${s-r-10}px`:e.style.left=`${t}px`,i>=c?(e.style.height=`${c-20}px`,e.style.top=`10px`,e.style.overflowY=`scroll`):n+i-o>c?e.style.top=`${c-i}px`:e.style.top=`${n}px`}},[n,t,i,s,c,a,o]),(0,u.useEffect)(()=>{if(r){let e=e=>{l.current?.contains(e.target)||(0,mk.unstable_batchedUpdates)(()=>r(e))};return document.addEventListener(`pointerdown`,e,!1),()=>document.removeEventListener(`pointerdown`,e,!1)}},[r]),(0,k.jsx)(`div`,{className:`popover`,ref:l,tabIndex:-1,children:e})},KH=`separator`,qH=u.memo(({actionManager:e,items:t,top:n,left:r,onClose:i})=>{let a=Zq(),o=Xq(),s=t.reduce((t,n)=>(n&&(n===KH||!n.predicate||n.predicate(o,a,e.app.props,e.app))&&t.push(n),t),[]);return(0,k.jsx)(GH,{onCloseRequest:()=>{i()},top:n,left:r,fitInViewport:!0,offsetLeft:a.offsetLeft,offsetTop:a.offsetTop,viewportWidth:a.width,viewportHeight:a.height,children:(0,k.jsx)(`ul`,{className:`context-menu`,onContextMenu:e=>e.preventDefault(),children:s.map((t,n)=>{if(t===KH)return!s[n-1]||s[n-1]===KH?null:(0,k.jsx)(`hr`,{className:`context-menu-item-separator`},n);let r=t.name,c=``;return t.label&&(c=typeof t.label==`function`?q(t.label(o,a,e.app)):q(t.label)),(0,k.jsx)(`li`,{"data-testid":r,onClick:()=>{i(()=>{e.executeAction(t,`contextMenu`)})},children:(0,k.jsxs)(`button`,{type:`button`,className:O(`context-menu-item`,{dangerous:r===`deleteSelectedElements`,checkmark:t.checked?.(a)}),children:[(0,k.jsx)(`div`,{className:`context-menu-item__label`,children:c}),(0,k.jsx)(`kbd`,{className:`context-menu-item__shortcut`,children:r?$V(r):``})]})},n)})})})}),JH=({children:e,onClose:t})=>{let[n,r]=(0,u.useState)(!!e),{container:i}=Yq(),a=u.useCallback(()=>{r(!1),t&&t(),i?.focus()},[t,i]);return(0,k.jsx)(k.Fragment,{children:n&&(0,k.jsx)(YV,{size:`small`,onCloseRequest:a,title:q(`errorDialog.title`),children:(0,k.jsx)(`div`,{style:{whiteSpace:`pre-wrap`},children:e})})})},YH=function({onChange:e,value:t,choices:n,name:r}){return(0,k.jsx)(`div`,{className:`RadioGroup`,children:n.map(n=>(0,k.jsxs)(`div`,{className:O(`RadioGroup__choice`,{active:n.value===t}),title:n.ariaLabel,children:[(0,k.jsx)(`input`,{name:r,type:`radio`,checked:n.value===t,onChange:()=>e(n.value),"aria-label":n.ariaLabel}),n.label]},String(n.value)))})},XH=({title:e,name:t,checked:n,onChange:r,disabled:i=!1})=>(0,k.jsx)(`div`,{className:O(`Switch`,{toggled:n,disabled:i}),children:(0,k.jsx)(`input`,{name:t,id:t,title:e,type:`checkbox`,checked:n,disabled:i,onChange:()=>r(!n),onKeyDown:e=>{e.key===` `&&r(!n)}})}),ZH=(0,u.forwardRef)(({children:e,icon:t,onClick:n,label:r,variant:i=`filled`,color:a=`primary`,size:o=`medium`,fullWidth:s,className:c,status:l},d)=>{let[f,p]=(0,u.useState)(!1),m=async e=>{let t=n?.(e);if(Uu(t)){let e=window.setTimeout(()=>{p(!0)},50);try{await t}catch(e){if(e instanceof yh)console.warn(e);else throw e}finally{clearTimeout(e),p(!1)}}},h=f?`loading`:l;return a=h===`success`?`success`:a,(0,k.jsx)(`button`,{className:O(`ExcButton`,`ExcButton--color-${a}`,`ExcButton--variant-${i}`,`ExcButton--size-${o}`,`ExcButton--status-${h}`,{"ExcButton--fullWidth":s},c),onClick:m,type:`button`,"aria-label":r,ref:d,disabled:h===`loading`||h===`success`,children:(0,k.jsxs)(`div`,{className:`ExcButton__contents`,children:[h===`loading`?(0,k.jsx)(lL,{className:`ExcButton__statusIcon`}):h===`success`&&(0,k.jsx)(`div`,{className:`ExcButton__statusIcon`,children:km}),t&&(0,k.jsx)(`div`,{className:`ExcButton__icon`,"aria-hidden":!0,children:t}),i!==`icon`&&(e??r)]})})}),QH=2e3,$H=()=>{let[e,t]=(0,u.useState)(null),n=(0,u.useRef)(0);return{copyStatus:e,resetCopyStatus:(0,u.useCallback)(()=>{t(null)},[]),onCopy:()=>{clearTimeout(n.current),t(`success`),n.current=window.setTimeout(()=>{t(null)},QH)}}},eU=`filter`in document.createElement(`canvas`).getContext(`2d`),tU=()=>(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`h3`,{children:q(`canvasError.cannotShowPreview`)}),(0,k.jsx)(`p`,{children:(0,k.jsx)(`span`,{children:q(`canvasError.canvasTooBig`)})}),(0,k.jsxs)(`em`,{children:[`(`,q(`canvasError.canvasTooBigTip`),`)`]})]}),nU=({appStateSnapshot:e,elementsSnapshot:t,files:n,actionManager:r,onExportImage:i,name:a})=>{let o=qT(t,e),[s,c]=(0,u.useState)(a),[l,d]=(0,u.useState)(o),[f,p]=(0,u.useState)(e.exportBackground),[m,h]=(0,u.useState)(e.exportWithDarkMode),[g,_]=(0,u.useState)(e.exportEmbedScene),[v,y]=(0,u.useState)(e.exportScale),b=(0,u.useRef)(null),[x,S]=(0,u.useState)(null),{onCopy:C,copyStatus:w,resetCopyStatus:T}=$H();(0,u.useEffect)(()=>{T()},[s,f,m,v,g,T]);let{exportedElements:E,exportingFrame:D}=bz(t,e,l);return(0,u.useEffect)(()=>{let t=b.current;if(!t)return;let r=t.offsetWidth,i=t.offsetHeight;r&&$w({elements:E,appState:{...e,name:s,exportBackground:f,exportWithDarkMode:m,exportScale:v,exportEmbedScene:g},files:n,exportPadding:10,maxWidthOrHeight:Math.max(r,i),exportingFrame:D}).then(e=>(S(null),hD(e).then(()=>{t.replaceChildren(e)}).catch(e=>{throw e.name===`CANVAS_POSSIBLY_TOO_BIG`?Error(q(`canvasError.canvasTooBig`)):e}))).catch(e=>{console.error(e),S(e)})},[e,n,E,D,s,f,m,v,g]),(0,k.jsxs)(`div`,{className:`ImageExportModal`,children:[(0,k.jsx)(`h3`,{children:q(`imageExportDialog.header`)}),(0,k.jsxs)(`div`,{className:`ImageExportModal__preview`,children:[(0,k.jsx)(`div`,{className:`ImageExportModal__preview__canvas`,ref:b,children:x&&(0,k.jsx)(tU,{})}),(0,k.jsx)(`div`,{className:`ImageExportModal__preview__filename`,children:!fs&&(0,k.jsx)(`input`,{type:`text`,className:`TextInput`,value:s,style:{width:`30ch`},onChange:e=>{c(e.target.value),r.executeAction(wz,`ui`,e.target.value)}})})]}),(0,k.jsxs)(`div`,{className:`ImageExportModal__settings`,children:[(0,k.jsx)(`h3`,{children:q(`imageExportDialog.header`)}),o&&(0,k.jsx)(rU,{label:q(`imageExportDialog.label.onlySelected`),name:`exportOnlySelected`,children:(0,k.jsx)(XH,{name:`exportOnlySelected`,checked:l,onChange:e=>{d(e)}})}),(0,k.jsx)(rU,{label:q(`imageExportDialog.label.withBackground`),name:`exportBackgroundSwitch`,children:(0,k.jsx)(XH,{name:`exportBackgroundSwitch`,checked:f,onChange:e=>{p(e),r.executeAction(Ez,`ui`,e)}})}),eU&&(0,k.jsx)(rU,{label:q(`imageExportDialog.label.darkMode`),name:`exportDarkModeSwitch`,children:(0,k.jsx)(XH,{name:`exportDarkModeSwitch`,checked:m,onChange:e=>{h(e),r.executeAction(jz,`ui`,e)}})}),(0,k.jsx)(rU,{label:q(`imageExportDialog.label.embedScene`),tooltip:q(`imageExportDialog.tooltip.embedScene`),name:`exportEmbedSwitch`,children:(0,k.jsx)(XH,{name:`exportEmbedSwitch`,checked:g,onChange:e=>{_(e),r.executeAction(Dz,`ui`,e)}})}),(0,k.jsx)(rU,{label:q(`imageExportDialog.label.scale`),name:`exportScale`,children:(0,k.jsx)(YH,{name:`exportScale`,value:v,onChange:e=>{y(e),r.executeAction(Tz,`ui`,e)},choices:yc.map(e=>({value:e,label:`${e}\xD7`}))})}),(0,k.jsxs)(`div`,{className:`ImageExportModal__settings__buttons`,children:[(0,k.jsx)(ZH,{className:`ImageExportModal__settings__buttons__button`,label:q(`imageExportDialog.title.exportToPng`),onClick:()=>i(uc.png,E,{exportingFrame:D}),icon:Tm,children:q(`imageExportDialog.button.exportToPng`)}),(0,k.jsx)(ZH,{className:`ImageExportModal__settings__buttons__button`,label:q(`imageExportDialog.title.exportToSvg`),onClick:()=>i(uc.svg,E,{exportingFrame:D}),icon:Tm,children:q(`imageExportDialog.button.exportToSvg`)}),(zw||Ns)&&(0,k.jsx)(ZH,{className:`ImageExportModal__settings__buttons__button`,label:q(`imageExportDialog.title.copyPngToClipboard`),status:w,onClick:async()=>{await i(uc.clipboard,E,{exportingFrame:D}),C()},icon:Em,children:q(`imageExportDialog.button.copyPngToClipboard`)})]})]})]})},rU=({label:e,children:t,tooltip:n,name:r})=>(0,k.jsxs)(`div`,{className:`ImageExportModal__settings__setting`,title:e,children:[(0,k.jsxs)(`label`,{htmlFor:r,className:`ImageExportModal__settings__setting__label`,children:[e,n&&(0,k.jsx)(oz,{label:n,long:!0,children:Om})]}),(0,k.jsx)(`div`,{className:`ImageExportModal__settings__setting__content`,children:t})]}),iU=({elements:e,appState:t,files:n,actionManager:r,onExportImage:i,onCloseRequest:a,name:o})=>{let[{appStateSnapshot:s,elementsSnapshot:c}]=(0,u.useState)(()=>({appStateSnapshot:Qu(t),elementsSnapshot:Qu(e)}));return(0,k.jsx)(YV,{onCloseRequest:a,size:`wide`,title:!1,children:(0,k.jsx)(nU,{elementsSnapshot:c,appStateSnapshot:s,files:n,actionManager:r,onExportImage:i,name:o})})},aU=({children:e,side:t,className:n})=>(0,k.jsx)(`div`,{className:O(`FixedSideContainer`,`FixedSideContainer_side_${t}`,n),children:e}),oU=100,sU=100,cU=e=>{switch(e){case H.ARROW_UP:return`up`;case H.ARROW_DOWN:return`down`;case H.ARROW_RIGHT:return`right`;case H.ARROW_LEFT:return`left`;default:return`right`}},lU=(e,t,n,r)=>{let i=[...n.values()].reduce((r,i)=>{let a;if(z(i)&&(a=i[e===`predecessors`?`startBinding`:`endBinding`])&&i[e===`predecessors`?`endBinding`:`startBinding`]?.elementId===t.id){let o=n.get(a.elementId);if(!o)return r;Yu(wd(o),`not an ExcalidrawBindableElement`);let s=e===`predecessors`?i.points[i.points.length-1]:[0,0],c=G_(t,qg(t),[s[0]+i.x,s[1]+i.y]);r.push({relative:o,heading:c})}return r},[]);switch(r){case`up`:return i.filter(e=>U_(e.heading,R_)).map(e=>e.relative);case`down`:return i.filter(e=>U_(e.heading,I_)).map(e=>e.relative);case`right`:return i.filter(e=>U_(e.heading,F_)).map(e=>e.relative);case`left`:return i.filter(e=>U_(e.heading,L_)).map(e=>e.relative)}},uU=(e,t,n)=>lU(`successors`,e,t,n),dU=(e,t,n)=>lU(`predecessors`,e,t,n),fU=(e,t,n)=>{let r=sU+e.width;if(n===`up`||n===`down`){let r=oU+e.height,i=e.x,a=e.x+e.width;if(t.every(e=>e.x+e.width<i||e.x>a))return{x:0,y:r*(n===`up`?-1:1)}}else if(n===`right`||n===`left`){let r=e.y,i=e.y+e.height;if(t.every(e=>e.y+e.height<r||e.y>i))return{x:(sU+e.width)*(n===`left`?-1:1),y:0}}if(n===`up`||n===`down`){let i=oU+e.height,a=(t.length,i),o=t.length===0?0:(t.length+1)%2==0?(t.length+1)/2*r:t.length/2*r*-1;return n===`up`?{x:o,y:a*-1}:{x:o,y:a}}let i=oU+e.height,a=(t.length,sU+e.width),o=t.length===0?0:(t.length+1)%2==0?(t.length+1)/2*i:t.length/2*i*-1;return n===`left`?{x:a*-1,y:o}:{x:a,y:o}},pU=(e,t,n,r)=>{let i=uU(e,t,r),a=dU(e,t,r),o=fU(e,[...i,...a],r),s=vx({type:e.type,x:e.x+o.x,y:e.y+o.y,width:e.width,height:e.height,roundness:e.roundness,roughness:e.roughness,backgroundColor:e.backgroundColor,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,opacity:e.opacity,fillStyle:e.fillStyle,strokeStyle:e.strokeStyle});return Yu(Od(s),`not an ExcalidrawFlowchartNodeElement`),{nextNode:s,bindingArrow:hU(e,s,t,r,n)}},mU=(e,t,n,r,i)=>{let a=[];for(let o=0;o<i;o++){let s,c;if(r===`left`||r===`right`){let t=oU*(i-1)+i*e.height,n=e.y+e.height/2-t/2,a=sU+e.width;r===`left`&&(a*=-1),s=e.x+a,c=n+(oU+e.height)*o}else{let t=sU*(i-1)+i*e.width,n=e.x+e.width/2-t/2,a=oU+e.height;r===`up`&&(a*=-1),c=e.y+a,s=n+(sU+e.width)*o}let l=vx({type:e.type,x:s,y:c,width:e.width,height:e.height,roundness:e.roundness,roughness:e.roughness,backgroundColor:e.backgroundColor,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,opacity:e.opacity,fillStyle:e.fillStyle,strokeStyle:e.strokeStyle});Yu(Od(l),`not an ExcalidrawFlowchartNodeElement`);let u=hU(e,l,t,r,n);a.push(l),a.push(u)}return a},hU=(e,t,n,r,i)=>{let a,o;switch(r){case`up`:a=e.x+e.width/2,o=e.y-6;break;case`down`:a=e.x+e.width/2,o=e.y+e.height+6;break;case`right`:a=e.x+e.width+6,o=e.y+e.height/2;break;case`left`:a=e.x-6,o=e.y+e.height/2}let s,c;switch(r){case`up`:s=t.x+t.width/2-a,c=t.y+t.height-o+6;break;case`down`:s=t.x+t.width/2-a,c=t.y-o-6;break;case`right`:s=t.x-a-6,c=t.y-o+t.height/2;break;case`left`:s=t.x+t.width-a+6,c=t.y-o+t.height/2}let l=Ax({type:`arrow`,x:a,y:o,startArrowhead:null,endArrowhead:i.currentItemEndArrowhead,strokeColor:e.strokeColor,strokeStyle:e.strokeStyle,strokeWidth:e.strokeWidth,opacity:e.opacity,roughness:e.roughness,points:[P(0,0),P(s,c)],elbowed:!0});qv(l,e,`start`,n),qv(l,t,`end`,n);let u=new Map;u.set(e.id,e),u.set(t.id,t),u.set(l.id,l),U.movePoints(l,[{index:1,point:l.points[1]}]);let d=jC(l,rd(new Map([...n.entries(),[e.id,e],[t.id,t],[l.id,l]])),{points:l.points});return{...l,...d}},gU=class{constructor(){v(this,`isExploring`,!1),v(this,`sameLevelNodes`,[]),v(this,`sameLevelIndex`,0),v(this,`direction`,null),v(this,`visitedNodes`,new Set)}clear(){this.isExploring=!1,this.sameLevelNodes=[],this.sameLevelIndex=0,this.direction=null,this.visitedNodes.clear()}exploreByDirection(e,t,n){if(!wd(e))return null;if(n!==this.direction&&this.clear(),this.visitedNodes.has(e.id)||this.visitedNodes.add(e.id),this.isExploring&&n===this.direction&&this.sameLevelNodes.length>1)return this.sameLevelIndex=(this.sameLevelIndex+1)%this.sameLevelNodes.length,this.sameLevelNodes[this.sameLevelIndex].id;let r=[...uU(e,t,n),...dU(e,t,n)];if(r.length>0)return this.sameLevelIndex=0,this.isExploring=!0,this.sameLevelNodes=r,this.direction=n,this.visitedNodes.add(r[0].id),r[0].id;if(n===this.direction||!this.isExploring){this.isExploring||this.visitedNodes.add(e.id);let r=[`up`,`right`,`down`,`left`].filter(e=>e!==n).map(n=>[...uU(e,t,n),...dU(e,t,n)]).flat().filter(e=>!this.visitedNodes.has(e.id));for(let e of r)if(!this.visitedNodes.has(e.id))return this.visitedNodes.add(e.id),this.isExploring=!0,this.direction=n,e.id}return null}},_U=class{constructor(){v(this,`isCreatingChart`,!1),v(this,`numberOfNodes`,0),v(this,`direction`,`right`),v(this,`pendingNodes`,null)}createNodes(e,t,n,r){if(r!==this.direction){let{nextNode:i,bindingArrow:a}=pU(e,t,n,r);this.numberOfNodes=1,this.isCreatingChart=!0,this.direction=r,this.pendingNodes=[i,a]}else{this.numberOfNodes+=1;let i=mU(e,t,n,r,this.numberOfNodes);this.isCreatingChart=!0,this.direction=r,this.pendingNodes=i}if(e.frameId){let n=t.get(e.frameId);Yu(n&&md(n),`not an ExcalidrawFrameElement`),n&&this.pendingNodes.every(e=>bT([e],n,t)||xT(e,n,t))&&(this.pendingNodes=this.pendingNodes.map(t=>K(t,{frameId:e.frameId},!1)))}}clear(){this.isCreatingChart=!1,this.pendingNodes=null,this.direction=null,this.numberOfNodes=0}},vU=(e,t)=>{for(let[,n]of t)if(n.type===`arrow`&&(n.startBinding?.elementId===e.id||n.endBinding?.elementId===e.id))return!0;return!1},yU=({appState:e,isMobile:t,device:n,app:r})=>{let{activeTool:i,isResizing:a,isRotating:o,lastPointerDownWith:s}=e,c=e.multiElement!==null;if(e.openSidebar?.name===Ic.name&&e.openSidebar.tab===`search`&&e.searchMatches?.length)return q(`hints.dismissSearch`);if(e.openSidebar&&!n.editor.canFitSidebar)return null;if(Qc(e))return q(`hints.eraserRevert`);if(i.type===`arrow`||i.type===`line`)return c?q(`hints.linearElementMulti`):i.type===`arrow`?q(`hints.arrowTool`,{arrowShortcut:L(`A`)}):q(`hints.linearElement`);if(i.type===`freedraw`)return q(`hints.freeDraw`);if(i.type===`text`)return q(`hints.text`);if(i.type===`embeddable`)return q(`hints.embeddable`);if(e.activeTool.type===`image`&&e.pendingImageElementId)return q(`hints.placeImage`);let l=r.scene.getSelectedElements(e);if(a&&s===`mouse`&&l.length===1){let e=l[0];return yd(e)&&e.points.length===2?q(`hints.lockAngle`):ud(e)?q(`hints.resizeImage`):q(`hints.resize`)}if(o&&s===`mouse`)return q(`hints.rotate`);if(l.length===1&&R(l[0]))return q(`hints.text_selected`);if(e.editingTextElement)return q(`hints.text_editing`);if(e.croppingElementId)return q(`hints.leaveCropEditor`);if(l.length===1&&ud(l[0]))return q(`hints.enterCropEditor`);if(i.type===`selection`){if(e.selectionElement&&!l.length&&!e.editingTextElement&&!e.editingLinearElement)return q(`hints.deepBoxSelect`);if(sb(r)&&e.selectedElementsAreBeingDragged)return q(`hints.disableSnapping`);if(!l.length&&!t)return q(`hints.canvasPanning`);if(l.length===1){if(yd(l[0]))return e.editingLinearElement?e.editingLinearElement.selectedPointsIndices?q(`hints.lineEditor_pointSelected`):q(`hints.lineEditor_nothingSelected`):q(`hints.lineEditor_info`);if(!e.newElement&&!e.selectedElementsAreBeingDragged&&Ed(l[0]))return Od(l[0])?(vU(l[0],r.scene.getNonDeletedElementsMap()),[q(`hints.bindTextToElement`),q(`hints.createFlowchart`)]):q(`hints.bindTextToElement`)}}return null},bU=({appState:e,isMobile:t,device:n,app:r})=>{let i=yU({appState:e,isMobile:t,device:n,app:r});if(!i)return null;let a=Array.isArray(i)?i.map(e=>L(e).replace(/\. ?$/,``)).join(`. `):L(i);return(0,k.jsx)(`div`,{className:`HintViewer`,children:(0,k.jsx)(`span`,{children:a})})},xU=`medium`,SU={CHECKED:jf,UNCHECKED:Af},CU=e=>(0,k.jsxs)(`label`,{className:O(`ToolIcon ToolIcon__lock`,`ToolIcon_size_${xU}`,{"is-mobile":e.isMobile}),title:`${e.title} \u2014 Q`,children:[(0,k.jsx)(`input`,{className:`ToolIcon_type_checkbox`,type:`checkbox`,name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title,"data-testid":`toolbar-lock`}),(0,k.jsx)(`div`,{className:`ToolIcon__icon`,children:e.checked?SU.CHECKED:SU.UNCHECKED})]}),wU=({heading:e,children:t,...n})=>{let{id:r}=Yq(),i=(0,k.jsx)(`h2`,{className:`visually-hidden`,id:`${r}-${e}-title`,children:q(`headings.${e}`)});return(0,k.jsx)(`section`,{...n,"aria-labelledby":`${r}-${e}-title`,children:typeof t==`function`?t(i):(0,k.jsxs)(k.Fragment,{children:[i,t]})})},TU=4,EU=6,DU=`rgba(0,0,0,0.3)`,OU=(e,t,n,r)=>{if(!e.length)return{horizontal:null,vertical:null};let[i,a,o,s]=bv(e),c=t/r.zoom.value,l=n/r.zoom.value,u=t-c,d=n-l,f={top:parseInt(yu(`sat`))||0,bottom:parseInt(yu(`sab`))||0,left:parseInt(yu(`sal`))||0,right:parseInt(yu(`sar`))||0},p=aL().rtl,m=-r.scrollX+u/2+f.left,h=-r.scrollY+d/2+f.top,g=m+c-f.right,_=h+l-f.bottom,v=Math.min(i,m),y=Math.min(a,h),b=Math.max(o,g),x=Math.max(s,_);return{horizontal:m===v&&g===b?null:{x:Math.max(f.left,TU)+(m-v)/(b-v)*t,y:n-EU-Math.max(TU,f.bottom),width:(g-m)/(b-v)*t-Math.max(TU*2,f.left+f.right),height:EU},vertical:h===y&&_===x?null:{x:p?Math.max(f.left,TU):t-EU-Math.max(f.right,TU),y:(h-y)/(x-y)*n+Math.max(f.top,TU),width:EU,height:(_-h)/(x-y)*n-Math.max(TU*2,f.top+f.bottom)}}},kU=(e,t,n)=>{let[r,i]=[e.horizontal,e.vertical].map(e=>e!=null&&e.x<=t&&t<=e.x+e.width&&e.y<=n&&n<=e.y+e.height);return{isOverEither:r||i,isOverHorizontal:r,isOverVertical:i}},AU=`medium`,jU=e=>e.penDetected?(0,k.jsxs)(`label`,{className:O(`ToolIcon ToolIcon__penMode`,`ToolIcon_size_${AU}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[(0,k.jsx)(`input`,{className:`ToolIcon_type_checkbox`,type:`checkbox`,name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),(0,k.jsx)(`div`,{className:`ToolIcon__icon`,children:Rf})]}):null,MU=e=>(0,k.jsx)(fL,{className:O(`Shape`,{fillable:!1}),type:`radio`,icon:wm,name:`editor-current-shape`,checked:e.checked,title:`${e.title} \u2014 H`,keyBindingLabel:e.isMobile?void 0:H.H.toLocaleUpperCase(),"aria-label":`${e.title} \u2014 H`,"aria-keyshortcuts":H.H,"data-testid":`toolbar-hand`,onChange:()=>e.onChange?.()}),NU=({appState:e,elements:t,actionManager:n,setAppState:r,onLockToggle:i,onHandToolToggle:a,onPenModeToggle:o,renderTopRightUI:s,renderCustomStats:c,renderSidebars:l,device:u,renderWelcomeScreen:d,UIOptions:f,app:p})=>{let{WelcomeScreenCenterTunnel:m,MainMenuTunnel:h,DefaultSidebarTriggerTunnel:g}=aH();return(0,k.jsxs)(k.Fragment,{children:[l(),!e.viewModeEnabled&&e.openDialog?.name!==`elementLinkSelector`&&(0,k.jsxs)(aU,{side:`top`,className:`App-top-bar`,children:[d&&(0,k.jsx)(m.Out,{}),(0,k.jsx)(wU,{heading:`shapes`,children:t=>(0,k.jsx)(eV.Col,{gap:4,align:`center`,children:(0,k.jsxs)(eV.Row,{gap:1,className:`App-toolbar-container`,children:[(0,k.jsxs)(gR,{padding:1,className:`App-toolbar App-toolbar--mobile`,children:[t,(0,k.jsx)(eV.Row,{gap:1,children:(0,k.jsx)(dH,{appState:e,activeTool:e.activeTool,UIOptions:f,app:p})})]}),s&&s(!0,e),(0,k.jsxs)(`div`,{className:`mobile-misc-tools-container`,children:[!e.viewModeEnabled&&e.openDialog?.name!==`elementLinkSelector`&&(0,k.jsx)(g.Out,{}),(0,k.jsx)(jU,{checked:e.penMode,onChange:()=>o(null),title:q(`toolBar.penMode`),isMobile:!0,penDetected:e.penDetected}),(0,k.jsx)(CU,{checked:e.activeTool.locked,onChange:i,title:q(`toolBar.lock`),isMobile:!0}),(0,k.jsx)(MU,{checked:$c(e),onChange:()=>a(),title:q(`toolBar.hand`),isMobile:!0})]})]})})}),(0,k.jsx)(bU,{appState:e,isMobile:!0,device:u,app:p})]}),(0,k.jsx)(`div`,{className:`App-bottom-bar`,style:{marginBottom:EU+TU*2,marginLeft:EU+TU*2,marginRight:EU+TU*2},children:(0,k.jsxs)(gR,{padding:0,children:[e.openMenu===`shape`&&!e.viewModeEnabled&&e.openDialog?.name!==`elementLinkSelector`&&XE(e,t)?(0,k.jsx)(wU,{className:`App-mobile-menu`,heading:`selectedShapeActions`,children:(0,k.jsx)(uH,{appState:e,elementsMap:p.scene.getNonDeletedElementsMap(),renderAction:n.renderAction,app:p})}):null,(0,k.jsxs)(`footer`,{className:`App-toolbar`,children:[e.viewModeEnabled||e.openDialog?.name===`elementLinkSelector`?(0,k.jsx)(`div`,{className:`App-toolbar-content`,children:(0,k.jsx)(h.Out,{})}):(0,k.jsxs)(`div`,{className:`App-toolbar-content`,children:[(0,k.jsx)(h.Out,{}),n.renderAction(`toggleEditMenu`),n.renderAction(e.multiElement?`finalize`:`duplicateSelection`),n.renderAction(`deleteSelectedElements`),(0,k.jsxs)(`div`,{children:[n.renderAction(`undo`),n.renderAction(`redo`)]})]}),e.scrolledOutside&&!e.openMenu&&!e.openSidebar&&(0,k.jsx)(`button`,{type:`button`,className:`scroll-back-to-content`,onClick:()=>{r(e=>({...Fy(t,e)}))},children:q(`buttons.scrollBackToContent`)})]})]})})]})},PU=e=>{let t=(0,u.useRef)(null),[n,r]=(0,u.useState)(null);return(0,u.useLayoutEffect)(()=>{if(!e.spreadsheet)return;let n=Lw(e.chartType,e.spreadsheet,0,0);r(n);let i,a=t.current;return(async()=>(i=await vC(n,{exportBackground:!1,viewBackgroundColor:Ui.white},null,{skipInliningFonts:!0}),i.querySelector(`.style-fonts`)?.remove(),a.replaceChildren(),a.appendChild(i),e.selected&&a.parentNode.focus()))(),()=>{a.replaceChildren()}},[e.spreadsheet,e.chartType,e.selected]),(0,k.jsx)(`button`,{type:`button`,className:`ChartPreview`,onClick:()=>{n&&e.onClick(e.chartType,n)},children:(0,k.jsx)(`div`,{ref:t})})},FU=({setAppState:e,appState:t,onClose:n})=>{let{onInsertElements:r}=Kq(),i=u.useCallback(()=>{n&&n()},[n]),a=(t,n)=>{r(n),VL(`paste`,`chart`,t),e({currentChartType:t,pasteDialog:{shown:!1,data:null}})};return(0,k.jsx)(YV,{size:`small`,onCloseRequest:i,title:q(`labels.pasteCharts`),className:`PasteChartDialog`,autofocus:!1,children:(0,k.jsxs)(`div`,{className:`container`,children:[(0,k.jsx)(PU,{chartType:`bar`,spreadsheet:t.pasteDialog.data,selected:t.currentChartType===`bar`,onClick:a}),(0,k.jsx)(PU,{chartType:`line`,spreadsheet:t.pasteDialog.data,selected:t.currentChartType===`line`,onClick:a})]})})},IU=()=>(0,k.jsxs)(`div`,{className:`HelpDialog__header`,children:[(0,k.jsxs)(`a`,{className:`HelpDialog__btn`,href:`https://docs.excalidraw.com`,target:`_blank`,rel:`noopener noreferrer`,children:[(0,k.jsx)(`div`,{className:`HelpDialog__link-icon`,children:tp}),q(`helpDialog.documentation`)]}),(0,k.jsxs)(`a`,{className:`HelpDialog__btn`,href:`https://plus.excalidraw.com/blog`,target:`_blank`,rel:`noopener noreferrer`,children:[(0,k.jsx)(`div`,{className:`HelpDialog__link-icon`,children:tp}),q(`helpDialog.blog`)]}),(0,k.jsxs)(`a`,{className:`HelpDialog__btn`,href:`https://github.com/excalidraw/excalidraw/issues`,target:`_blank`,rel:`noopener noreferrer`,children:[(0,k.jsx)(`div`,{className:`HelpDialog__link-icon`,children:np}),q(`helpDialog.github`)]}),(0,k.jsxs)(`a`,{className:`HelpDialog__btn`,href:`https://youtube.com/@excalidraw`,target:`_blank`,rel:`noopener noreferrer`,children:[(0,k.jsx)(`div`,{className:`HelpDialog__link-icon`,children:ih}),`YouTube`]})]}),LU=e=>(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`h3`,{children:e.title}),(0,k.jsx)(`div`,{className:`HelpDialog__islands-container`,children:e.children})]}),RU=e=>(0,k.jsxs)(`div`,{className:`HelpDialog__island ${e.className}`,children:[(0,k.jsx)(`h4`,{className:`HelpDialog__island-title`,children:e.caption}),(0,k.jsx)(`div`,{className:`HelpDialog__island-content`,children:e.children})]});function*zU(e,t){let n=!0;for(let r of e)n||(yield t),n=!1,yield r}var BU=e=>e.replace(/\b[a-z]\b/,e=>e.toUpperCase()),J=({label:e,shortcuts:t,isOr:n=!0})=>{let r=t.map(e=>(e.endsWith(`++`)?[...e.slice(0,-2).split(`+`),`+`]:e.split(`+`)).map(e=>(0,k.jsx)(VU,{children:BU(e)},e)));return(0,k.jsxs)(`div`,{className:`HelpDialog__shortcut`,children:[(0,k.jsx)(`div`,{children:e}),(0,k.jsx)(`div`,{className:`HelpDialog__key-container`,children:[...zU(r,n?q(`helpDialog.or`):null)]})]})},VU=e=>(0,k.jsx)(`kbd`,{className:`HelpDialog__key`,...e}),HU=({onClose:e})=>{let t=u.useCallback(()=>{e&&e()},[e]);return(0,k.jsx)(k.Fragment,{children:(0,k.jsxs)(YV,{onCloseRequest:t,title:q(`helpDialog.title`),className:`HelpDialog`,children:[(0,k.jsx)(IU,{}),(0,k.jsxs)(LU,{title:q(`helpDialog.shortcuts`),children:[(0,k.jsxs)(RU,{className:`HelpDialog__island--tools`,caption:q(`helpDialog.tools`),children:[(0,k.jsx)(J,{label:q(`toolBar.hand`),shortcuts:[H.H]}),(0,k.jsx)(J,{label:q(`toolBar.selection`),shortcuts:[H.V,H[1]]}),(0,k.jsx)(J,{label:q(`toolBar.rectangle`),shortcuts:[H.R,H[2]]}),(0,k.jsx)(J,{label:q(`toolBar.diamond`),shortcuts:[H.D,H[3]]}),(0,k.jsx)(J,{label:q(`toolBar.ellipse`),shortcuts:[H.O,H[4]]}),(0,k.jsx)(J,{label:q(`toolBar.arrow`),shortcuts:[H.A,H[5]]}),(0,k.jsx)(J,{label:q(`toolBar.line`),shortcuts:[H.L,H[6]]}),(0,k.jsx)(J,{label:q(`toolBar.freedraw`),shortcuts:[H.P,H[7]]}),(0,k.jsx)(J,{label:q(`toolBar.text`),shortcuts:[H.T,H[8]]}),(0,k.jsx)(J,{label:q(`toolBar.image`),shortcuts:[H[9]]}),(0,k.jsx)(J,{label:q(`toolBar.eraser`),shortcuts:[H.E,H[0]]}),(0,k.jsx)(J,{label:q(`toolBar.frame`),shortcuts:[H.F]}),(0,k.jsx)(J,{label:q(`toolBar.laser`),shortcuts:[H.K]}),(0,k.jsx)(J,{label:q(`labels.eyeDropper`),shortcuts:[H.I,`Shift+S`,`Shift+G`]}),(0,k.jsx)(J,{label:q(`helpDialog.editLineArrowPoints`),shortcuts:[L(`CtrlOrCmd+Enter`)]}),(0,k.jsx)(J,{label:q(`helpDialog.editText`),shortcuts:[L(`Enter`)]}),(0,k.jsx)(J,{label:q(`helpDialog.textNewLine`),shortcuts:[L(`Enter`),L(`Shift+Enter`)]}),(0,k.jsx)(J,{label:q(`helpDialog.textFinish`),shortcuts:[L(`Esc`),L(`CtrlOrCmd+Enter`)]}),(0,k.jsx)(J,{label:q(`helpDialog.curvedArrow`),shortcuts:[`A`,q(`helpDialog.click`),q(`helpDialog.click`),q(`helpDialog.click`)],isOr:!1}),(0,k.jsx)(J,{label:q(`helpDialog.curvedLine`),shortcuts:[`L`,q(`helpDialog.click`),q(`helpDialog.click`),q(`helpDialog.click`)],isOr:!1}),(0,k.jsx)(J,{label:q(`helpDialog.cropStart`),shortcuts:[q(`helpDialog.doubleClick`),L(`Enter`)],isOr:!0}),(0,k.jsx)(J,{label:q(`helpDialog.cropFinish`),shortcuts:[L(`Enter`),L(`Escape`)],isOr:!0}),(0,k.jsx)(J,{label:q(`toolBar.lock`),shortcuts:[H.Q]}),(0,k.jsx)(J,{label:q(`helpDialog.preventBinding`),shortcuts:[L(`CtrlOrCmd`)]}),(0,k.jsx)(J,{label:q(`toolBar.link`),shortcuts:[L(`CtrlOrCmd+K`)]})]}),(0,k.jsxs)(RU,{className:`HelpDialog__island--view`,caption:q(`helpDialog.view`),children:[(0,k.jsx)(J,{label:q(`buttons.zoomIn`),shortcuts:[L(`CtrlOrCmd++`)]}),(0,k.jsx)(J,{label:q(`buttons.zoomOut`),shortcuts:[L(`CtrlOrCmd+-`)]}),(0,k.jsx)(J,{label:q(`buttons.resetZoom`),shortcuts:[L(`CtrlOrCmd+0`)]}),(0,k.jsx)(J,{label:q(`helpDialog.zoomToFit`),shortcuts:[`Shift+1`]}),(0,k.jsx)(J,{label:q(`helpDialog.zoomToSelection`),shortcuts:[`Shift+2`]}),(0,k.jsx)(J,{label:q(`helpDialog.movePageUpDown`),shortcuts:[`PgUp/PgDn`]}),(0,k.jsx)(J,{label:q(`helpDialog.movePageLeftRight`),shortcuts:[`Shift+PgUp/PgDn`]}),(0,k.jsx)(J,{label:q(`buttons.zenMode`),shortcuts:[L(`Alt+Z`)]}),(0,k.jsx)(J,{label:q(`buttons.objectsSnapMode`),shortcuts:[L(`Alt+S`)]}),(0,k.jsx)(J,{label:q(`labels.toggleGrid`),shortcuts:[L(`CtrlOrCmd+'`)]}),(0,k.jsx)(J,{label:q(`labels.viewMode`),shortcuts:[L(`Alt+R`)]}),(0,k.jsx)(J,{label:q(`labels.toggleTheme`),shortcuts:[L(`Alt+Shift+D`)]}),(0,k.jsx)(J,{label:q(`stats.fullTitle`),shortcuts:[L(`Alt+/`)]}),(0,k.jsx)(J,{label:q(`search.title`),shortcuts:[$V(`searchMenu`)]}),(0,k.jsx)(J,{label:q(`commandPalette.title`),shortcuts:Ns?[$V(`commandPalette`)]:[$V(`commandPalette`),$V(`commandPalette`,1)]})]}),(0,k.jsxs)(RU,{className:`HelpDialog__island--editor`,caption:q(`helpDialog.editor`),children:[(0,k.jsx)(J,{label:q(`helpDialog.createFlowchart`),shortcuts:[L(`CtrlOrCmd+Arrow Key`)],isOr:!0}),(0,k.jsx)(J,{label:q(`helpDialog.navigateFlowchart`),shortcuts:[L(`Alt+Arrow Key`)],isOr:!0}),(0,k.jsx)(J,{label:q(`labels.moveCanvas`),shortcuts:[L(`Space+${q(`helpDialog.drag`)}`),L(`Wheel+${q(`helpDialog.drag`)}`)],isOr:!0}),(0,k.jsx)(J,{label:q(`buttons.clearReset`),shortcuts:[L(`CtrlOrCmd+Delete`)]}),(0,k.jsx)(J,{label:q(`labels.delete`),shortcuts:[L(`Delete`)]}),(0,k.jsx)(J,{label:q(`labels.cut`),shortcuts:[L(`CtrlOrCmd+X`)]}),(0,k.jsx)(J,{label:q(`labels.copy`),shortcuts:[L(`CtrlOrCmd+C`)]}),(0,k.jsx)(J,{label:q(`labels.paste`),shortcuts:[L(`CtrlOrCmd+V`)]}),(0,k.jsx)(J,{label:q(`labels.pasteAsPlaintext`),shortcuts:[L(`CtrlOrCmd+Shift+V`)]}),(0,k.jsx)(J,{label:q(`labels.selectAll`),shortcuts:[L(`CtrlOrCmd+A`)]}),(0,k.jsx)(J,{label:q(`labels.multiSelect`),shortcuts:[L(`Shift+${q(`helpDialog.click`)}`)]}),(0,k.jsx)(J,{label:q(`helpDialog.deepSelect`),shortcuts:[L(`CtrlOrCmd+${q(`helpDialog.click`)}`)]}),(0,k.jsx)(J,{label:q(`helpDialog.deepBoxSelect`),shortcuts:[L(`CtrlOrCmd+${q(`helpDialog.drag`)}`)]}),(zw||Ns)&&(0,k.jsx)(J,{label:q(`labels.copyAsPng`),shortcuts:[L(`Shift+Alt+C`)]}),(0,k.jsx)(J,{label:q(`labels.copyStyles`),shortcuts:[L(`CtrlOrCmd+Alt+C`)]}),(0,k.jsx)(J,{label:q(`labels.pasteStyles`),shortcuts:[L(`CtrlOrCmd+Alt+V`)]}),(0,k.jsx)(J,{label:q(`labels.sendToBack`),shortcuts:[L(As?`CtrlOrCmd+Alt+[`:`CtrlOrCmd+Shift+[`)]}),(0,k.jsx)(J,{label:q(`labels.bringToFront`),shortcuts:[L(As?`CtrlOrCmd+Alt+]`:`CtrlOrCmd+Shift+]`)]}),(0,k.jsx)(J,{label:q(`labels.sendBackward`),shortcuts:[L(`CtrlOrCmd+[`)]}),(0,k.jsx)(J,{label:q(`labels.bringForward`),shortcuts:[L(`CtrlOrCmd+]`)]}),(0,k.jsx)(J,{label:q(`labels.alignTop`),shortcuts:[L(`CtrlOrCmd+Shift+Up`)]}),(0,k.jsx)(J,{label:q(`labels.alignBottom`),shortcuts:[L(`CtrlOrCmd+Shift+Down`)]}),(0,k.jsx)(J,{label:q(`labels.alignLeft`),shortcuts:[L(`CtrlOrCmd+Shift+Left`)]}),(0,k.jsx)(J,{label:q(`labels.alignRight`),shortcuts:[L(`CtrlOrCmd+Shift+Right`)]}),(0,k.jsx)(J,{label:q(`labels.duplicateSelection`),shortcuts:[L(`CtrlOrCmd+D`),L(`Alt+${q(`helpDialog.drag`)}`)]}),(0,k.jsx)(J,{label:q(`helpDialog.toggleElementLock`),shortcuts:[L(`CtrlOrCmd+Shift+L`)]}),(0,k.jsx)(J,{label:q(`buttons.undo`),shortcuts:[L(`CtrlOrCmd+Z`)]}),(0,k.jsx)(J,{label:q(`buttons.redo`),shortcuts:js?[L(`CtrlOrCmd+Y`),L(`CtrlOrCmd+Shift+Z`)]:[L(`CtrlOrCmd+Shift+Z`)]}),(0,k.jsx)(J,{label:q(`labels.group`),shortcuts:[L(`CtrlOrCmd+G`)]}),(0,k.jsx)(J,{label:q(`labels.ungroup`),shortcuts:[L(`CtrlOrCmd+Shift+G`)]}),(0,k.jsx)(J,{label:q(`labels.flipHorizontal`),shortcuts:[L(`Shift+H`)]}),(0,k.jsx)(J,{label:q(`labels.flipVertical`),shortcuts:[L(`Shift+V`)]}),(0,k.jsx)(J,{label:q(`labels.showStroke`),shortcuts:[L(`S`)]}),(0,k.jsx)(J,{label:q(`labels.showBackground`),shortcuts:[L(`G`)]}),(0,k.jsx)(J,{label:q(`labels.showFonts`),shortcuts:[L(`Shift+F`)]}),(0,k.jsx)(J,{label:q(`labels.decreaseFontSize`),shortcuts:[L(`CtrlOrCmd+Shift+<`)]}),(0,k.jsx)(J,{label:q(`labels.increaseFontSize`),shortcuts:[L(`CtrlOrCmd+Shift+>`)]})]})]})]})})},UU=4,WU=8,GU=({shouldWrap:e,children:t,username:n})=>e?(0,k.jsx)(oz,{label:n||`Unknown user`,children:t}):(0,k.jsx)(k.Fragment,{children:t}),KU=({actionManager:e,collaborator:t,socketId:n,withName:r=!1,shouldWrapWithTooltip:i=!1,isBeingFollowed:a})=>{let o={socketId:n,collaborator:t,withName:r,isBeingFollowed:a},s=e.renderAction(`goToCollaborator`,o);return(0,k.jsx)(GU,{username:t.username,shouldWrap:i,children:s},n)},qU=[`avatarUrl`,`id`,`socketId`,`username`,`isInCall`,`isSpeaking`,`isMuted`],JU=u.memo(({className:e,mobile:t,collaborators:n,userToFollow:r})=>{let i=$q(),a=new Map;n.forEach((e,t)=>{let n=e.id||t;a.set(n,{...e,socketId:t})});let o=Array.from(a.values()).filter(e=>e.username?.trim()),[s,c]=u.useState(``),l=o.filter(e=>e.username?.toLowerCase().includes(s)),d=u.useRef(null);(0,u.useLayoutEffect)(()=>{if(d.current){let e=e=>{let t=Math.max(1,Math.min(8,Math.floor(e/38)));p(t)};if(e(d.current.clientWidth),!Ls)return;let t=new ResizeObserver(t=>{for(let n of t){let{width:t}=n.contentRect;e(t)}});return t.observe(d.current),()=>{t.disconnect()}}},[]);let[f,p]=u.useState(UU),m=o.slice(0,f-1).map(e=>KU({actionManager:i,collaborator:e,socketId:e.socketId,shouldWrapWithTooltip:!0,isBeingFollowed:e.socketId===r}));return t?(0,k.jsx)(`div`,{className:O(`UserList UserList_mobile`,e),children:o.map(e=>KU({actionManager:i,collaborator:e,socketId:e.socketId,shouldWrapWithTooltip:!0,isBeingFollowed:e.socketId===r}))}):(0,k.jsx)(`div`,{className:`UserList__wrapper`,ref:d,children:(0,k.jsxs)(`div`,{className:O(`UserList`,e),style:{"--max-avatars":f},children:[m,o.length>f-1&&(0,k.jsxs)(qP,{children:[(0,k.jsxs)(JP,{className:`UserList__more`,children:[`+`,o.length-f+1]}),(0,k.jsx)(XP,{style:{zIndex:2,width:`15rem`,textAlign:`left`},align:`end`,sideOffset:10,children:(0,k.jsxs)(gR,{padding:2,children:[o.length>=WU&&(0,k.jsx)(OR,{placeholder:q(`quickSearch.placeholder`),onChange:c}),(0,k.jsx)(kR,{className:`dropdown-menu UserList__collaborators`,placeholder:q(`userList.empty`),children:l.length>0?[(0,k.jsx)(`div`,{className:`hint`,children:q(`userList.hint.text`)}),l.map(e=>KU({actionManager:i,collaborator:e,socketId:e.socketId,withName:!0,isBeingFollowed:e.socketId===r}))]:[]}),(0,k.jsx)(ZP,{width:20,height:10,style:{fill:`var(--popup-bg-color)`,filter:`drop-shadow(rgba(0, 0, 0, 0.05) 0px 3px 2px)`}})]})})]})]})})},(e,t)=>{if(e.collaborators.size!==t.collaborators.size||e.mobile!==t.mobile||e.className!==t.className||e.userToFollow!==t.userToFollow)return!1;let n=t.collaborators.keys();for(let[r,i]of e.collaborators){let e=t.collaborators.get(r);if(!e||r!==n.next().value||!Ku(i,e,qU))return!1}return!0}),YU=({children:e,color:t})=>(0,k.jsx)(`div`,{className:`Card`,style:{"--card-color":t===`primary`?`var(--color-primary)`:Ui[t][7],"--card-color-darker":t===`primary`?`var(--color-primary-darker)`:Ui[t][8],"--card-color-darkest":t===`primary`?`var(--color-primary-darkest)`:Ui[t][9]},children:e}),XU=({elements:e,appState:t,setAppState:n,files:r,actionManager:i,exportOpts:a,canvas:o,onCloseRequest:s})=>{let{onExportToBackend:c}=a;return(0,k.jsx)(`div`,{className:`ExportDialog ExportDialog--json`,children:(0,k.jsxs)(`div`,{className:`ExportDialog-cards`,children:[a.saveFileToDisk&&(0,k.jsxs)(YU,{color:`lime`,children:[(0,k.jsx)(`div`,{className:`Card-icon`,children:pp}),(0,k.jsx)(`h2`,{children:q(`exportDialog.disk_title`)}),(0,k.jsxs)(`div`,{className:`Card-details`,children:[q(`exportDialog.disk_details`),!fs&&i.renderAction(`changeProjectName`)]}),(0,k.jsx)(fL,{className:`Card-button`,type:`button`,title:q(`exportDialog.disk_button`),"aria-label":q(`exportDialog.disk_button`),showAriaLabel:!0,onClick:()=>{i.executeAction(kz,`ui`)}})]}),c&&(0,k.jsxs)(YU,{color:`pink`,children:[(0,k.jsx)(`div`,{className:`Card-icon`,children:op}),(0,k.jsx)(`h2`,{children:q(`exportDialog.link_title`)}),(0,k.jsx)(`div`,{className:`Card-details`,children:q(`exportDialog.link_details`)}),(0,k.jsx)(fL,{className:`Card-button`,type:`button`,title:q(`exportDialog.link_button`),"aria-label":q(`exportDialog.link_button`),showAriaLabel:!0,onClick:async()=>{try{VL(`export`,`link`,`ui (${Hu()})`),await c(e,t,r),s()}catch(e){n({errorMessage:e.message})}}})]}),a.renderCustomUI&&a.renderCustomUI(e,t,r,o)]})})},ZU=({elements:e,appState:t,files:n,actionManager:r,exportOpts:i,canvas:a,setAppState:o})=>{let s=u.useCallback(()=>{o({openDialog:null})},[o]);return(0,k.jsx)(k.Fragment,{children:t.openDialog?.name===`jsonExport`&&(0,k.jsx)(YV,{onCloseRequest:s,title:q(`buttons.export`),children:(0,k.jsx)(XU,{elements:e,appState:t,setAppState:o,files:n,actionManager:r,onCloseRequest:s,exportOpts:i,canvas:a})})})},QU=e=>(0,k.jsx)(`button`,{className:`help-icon`,onClick:e.onClick,type:`button`,title:`${q(`helpDialog.title`)} \u2014 ?`,"aria-label":q(`helpDialog.title`),children:$f}),$U=({appState:e,actionManager:t,showExitZenModeBtn:n,renderWelcomeScreen:r})=>{let{FooterCenterTunnel:i,WelcomeScreenHelpHintTunnel:a}=aH(),o=Jq(),s=!e.viewModeEnabled&&e.multiElement&&o.isTouchScreen;return(0,k.jsxs)(`footer`,{role:`contentinfo`,className:`layer-ui__wrapper__footer App-menu App-menu_bottom`,children:[(0,k.jsx)(`div`,{className:O(`layer-ui__wrapper__footer-left zen-mode-transition`,{"layer-ui__wrapper__footer-left--transition-left":e.zenModeEnabled}),children:(0,k.jsx)(eV.Col,{gap:2,children:(0,k.jsxs)(wU,{heading:`canvasActions`,children:[(0,k.jsx)(fH,{renderAction:t.renderAction,zoom:e.zoom}),!e.viewModeEnabled&&(0,k.jsx)(pH,{renderAction:t.renderAction,className:O(`zen-mode-transition`,{"layer-ui__wrapper__footer-left--transition-bottom":e.zenModeEnabled})}),s&&(0,k.jsx)(hH,{renderAction:t.renderAction,className:O(`zen-mode-transition`,{"layer-ui__wrapper__footer-left--transition-left":e.zenModeEnabled})})]})})}),(0,k.jsx)(i.Out,{}),(0,k.jsx)(`div`,{className:O(`layer-ui__wrapper__footer-right zen-mode-transition`,{"transition-right":e.zenModeEnabled}),children:(0,k.jsxs)(`div`,{style:{position:`relative`},children:[r&&(0,k.jsx)(a.Out,{}),(0,k.jsx)(QU,{onClick:()=>t.executeAction(Fz)})]})}),(0,k.jsx)(mH,{actionManager:t,showExitZenModeBtn:n})]})},eW=$U;$U.displayName=`Footer`;var tW=u.createContext({}),nW=({children:e,className:t})=>{let n=Jq(),r=(0,u.useContext)(tW),i=!!(n.editor.canFitSidebar&&r.shouldRenderDockButton);return(0,k.jsxs)(`div`,{className:O(`sidebar__header`,t),"data-testid":`sidebar-header`,children:[e,(0,k.jsxs)(`div`,{className:`sidebar__header__buttons`,children:[i&&(0,k.jsx)(oz,{label:q(`labels.sidebarLock`),children:(0,k.jsx)(XV,{onSelect:()=>r.onDock?.(!r.docked),selected:!!r.docked,className:`sidebar__dock`,"data-testid":`sidebar-dock`,"aria-label":q(`labels.sidebarLock`),children:kf})}),(0,k.jsx)(XV,{"data-testid":`sidebar-close`,className:`sidebar__close`,onSelect:r.onCloseRequest,"aria-label":q(`buttons.close`),children:Np})]})]})};nW.displayName=`SidebarHeader`;var rW=({name:e,tab:t,icon:n,title:r,children:i,onToggle:a,className:o,style:s})=>{let c=Qq(),l=lR();return(0,k.jsxs)(`label`,{title:r,className:`sidebar-trigger__label-element`,children:[(0,k.jsx)(`input`,{className:`ToolIcon_type_checkbox`,type:`checkbox`,onChange:n=>{document.querySelector(`.layer-ui__wrapper`)?.classList.remove(`animate`);let r=n.target.checked;c({openSidebar:r?{name:e,tab:t}:null}),a?.(r)},checked:l.openSidebar?.name===e,"aria-label":r,"aria-keyshortcuts":`0`}),(0,k.jsxs)(`div`,{className:O(`sidebar-trigger`,o),style:s,children:[n&&(0,k.jsx)(`div`,{children:n}),i&&(0,k.jsx)(`div`,{className:`sidebar-trigger__label`,children:i})]})]})};rW.displayName=`SidebarTrigger`;var iW=({children:e,...t})=>(0,k.jsx)(wI,{className:`sidebar-triggers`,...t,children:e});iW.displayName=`SidebarTabTriggers`;var aW=({children:e,tab:t,onSelect:n,...r})=>(0,k.jsx)(TI,{value:t,asChild:!0,onSelect:n,children:(0,k.jsx)(`button`,{type:`button`,className:`excalidraw-button sidebar-tab-trigger`,...r,children:e})});aW.displayName=`SidebarTabTrigger`;var oW=({children:e,...t})=>{let n=lR(),r=Qq();if(!n.openSidebar)return null;let{name:i}=n.openSidebar;return(0,k.jsx)(CI,{className:`sidebar-tabs-root`,value:n.openSidebar.tab,onValueChange:e=>r(t=>({...t,openSidebar:{...t.openSidebar,name:i,tab:e}})),...t,children:e})};oW.displayName=`SidebarTabs`;var sW=({tab:e,children:t,...n})=>(0,k.jsx)(EI,{...n,value:e,"data-testid":e,children:t});sW.displayName=`SidebarTab`;var cW=EO(!1),lW=(0,u.forwardRef)(({name:e,children:t,onDock:n,docked:r,className:i,...a},o)=>{f.DEV&&n&&r==null&&console.warn("Sidebar: `docked` must be set when `onDock` is supplied for the sidebar to be user-dockable. To hide this message, either pass `docked` or remove `onDock`");let s=Qq(),c=KI(cW);(0,u.useLayoutEffect)(()=>(c(!!r),()=>{c(!1)}),[c,r]);let l=(0,u.useRef)({});l.current.onCloseRequest=()=>{s({openSidebar:null})},l.current.onDock=e=>n?.(e),l.current=Vu(l.current,{docked:r,shouldRenderDockButton:!!n&&r!=null});let d=(0,u.useRef)(null);(0,u.useImperativeHandle)(o,()=>d.current);let p=Jq(),m=(0,u.useCallback)(()=>{document.querySelector(`.Dialog`)||s({openSidebar:null})},[s]);return dR(d,(0,u.useCallback)(e=>{e.target.closest(`.sidebar-trigger`)||(!r||!p.editor.canFitSidebar)&&m()},[m,r,p.editor.canFitSidebar])),(0,u.useEffect)(()=>{let e=e=>{e.key===H.ESCAPE&&(!r||!p.editor.canFitSidebar)&&m()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[m,r,p.editor.canFitSidebar]),(0,k.jsx)(gR,{...a,className:O(`sidebar`,{"sidebar--docked":r},i),ref:d,children:(0,k.jsx)(tW.Provider,{value:l.current,children:t})})});lW.displayName=`SidebarInner`;var uW=Object.assign((0,u.forwardRef)((e,t)=>{let n=lR(),{onStateChange:r}=e,i=(0,u.useRef)(n.openSidebar);(0,u.useEffect)(()=>{(!n.openSidebar&&i?.current?.name===e.name||n.openSidebar?.name===e.name&&i?.current?.name!==e.name||i.current?.name===e.name)&&n.openSidebar!==i.current&&r?.(n.openSidebar?.name===e.name?n.openSidebar:null),i.current=n.openSidebar},[n.openSidebar,r,e.name]);let[a,o]=(0,u.useState)(!1);return(0,u.useLayoutEffect)(()=>(o(!0),()=>o(!1)),[]),a&&n.openSidebar?.name===e.name?(0,u.createElement)(lW,{...e,ref:t,key:e.name}):null}),{Header:nW,TabTriggers:iW,TabTrigger:aW,Tabs:oW,Tab:sW,Trigger:rW});uW.displayName=`Sidebar`;var dW={};_(dW,{ChangeCanvasBackground:()=>wW,ClearCanvas:()=>SW,CommandPalette:()=>yW,Export:()=>TW,Help:()=>xW,LiveCollaborationTrigger:()=>DW,LoadScene:()=>gW,SaveAsImage:()=>vW,SaveToActiveFile:()=>_W,SearchMenu:()=>bW,Socials:()=>EW,ToggleTheme:()=>CW});var fW=EO({active:!1});async function pW({title:e,description:t,actionLabel:n,color:r}){return new Promise(i=>{XI.set(fW,{active:!0,onConfirm:()=>i(!0),onClose:()=>i(!1),onReject:()=>i(!1),title:e,description:t,actionLabel:n,color:r})})}var mW=({value:e,shortcut:t,onChange:n,choices:r,children:i,name:a})=>{let o=Jq();return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`dropdown-menu-item-base dropdown-menu-item-bare`,children:[(0,k.jsx)(`label`,{className:`dropdown-menu-item__text`,htmlFor:a,children:i}),(0,k.jsx)(YH,{name:a,value:e,onChange:n,choices:r})]}),t&&!o.editor.isMobile&&(0,k.jsx)(`div`,{className:`dropdown-menu-item__shortcut dropdown-menu-item__shortcut--orphaned`,children:t})]})};mW.displayName=`DropdownMenuItemContentRadio`;var hW=mW,gW=()=>{let{t:e}=cL(),t=$q(),n=Xq();return t.isActionEnabled(Az)?(0,k.jsx)(zR,{icon:lp,onSelect:async()=>{(!n.length||await pW({title:e(`overwriteConfirm.modal.loadFromFile.title`),actionLabel:e(`overwriteConfirm.modal.loadFromFile.button`),color:`warning`,description:(0,k.jsx)(cV,{i18nKey:`overwriteConfirm.modal.loadFromFile.description`,bold:e=>(0,k.jsx)(`strong`,{children:e}),br:()=>(0,k.jsx)(`br`,{})})}))&&t.executeAction(Az)},"data-testid":`load-button`,shortcut:$V(`loadScene`),"aria-label":e(`buttons.load`),children:e(`buttons.load`)}):null};gW.displayName=`LoadScene`;var _W=()=>{let{t:e}=cL(),t=$q();return t.isActionEnabled(Oz)?(0,k.jsx)(zR,{shortcut:$V(`saveScene`),"data-testid":`save-button`,onSelect:()=>t.executeAction(Oz),icon:sp,"aria-label":`${e(`buttons.save`)}`,children:`${e(`buttons.save`)}`}):null};_W.displayName=`SaveToActiveFile`;var vW=()=>{let e=Qq(),{t}=cL();return(0,k.jsx)(zR,{icon:fp,"data-testid":`image-export-button`,onSelect:()=>e({openDialog:{name:`imageExport`}}),shortcut:$V(`imageExport`),"aria-label":t(`buttons.exportImage`),children:t(`buttons.exportImage`)})};vW.displayName=`SaveAsImage`;var yW=e=>{let t=Qq(),{t:n}=cL();return(0,k.jsx)(zR,{icon:Km,"data-testid":`command-palette-button`,onSelect:()=>{VL(`command_palette`,`open`,`menu`),t({openDialog:{name:`commandPalette`}})},shortcut:$V(`commandPalette`),"aria-label":n(`commandPalette.title`),className:e?.className,children:n(`commandPalette.title`)})};yW.displayName=`CommandPalette`;var bW=e=>{let{t}=cL(),n=$q();return(0,k.jsx)(zR,{icon:Hm,"data-testid":`search-menu-button`,onSelect:()=>{n.executeAction(jH)},shortcut:$V(`searchMenu`),"aria-label":t(`search.title`),className:e?.className,children:t(`search.title`)})};bW.displayName=`SearchMenu`;var xW=()=>{let{t:e}=cL(),t=$q();return(0,k.jsx)(zR,{"data-testid":`help-menu-item`,icon:$f,onSelect:()=>t.executeAction(Fz),shortcut:`?`,"aria-label":e(`helpDialog.title`),children:e(`helpDialog.title`)})};xW.displayName=`Help`;var SW=()=>{let{t:e}=cL(),t=KI(_H);return $q().isActionEnabled(sz)?(0,k.jsx)(zR,{icon:Kf,onSelect:()=>t(`clearCanvas`),"data-testid":`clear-canvas-button`,"aria-label":e(`buttons.clearReset`),children:e(`buttons.clearReset`)}):null};SW.displayName=`ClearCanvas`;var CW=e=>{let{t}=cL(),n=lR(),r=$q(),i=$V(`toggleTheme`);return r.isActionEnabled(mz)?e?.allowSystemTheme?(0,k.jsx)(hW,{name:`theme`,value:e.theme,onChange:t=>e.onSelect(t),choices:[{value:Qs.LIGHT,label:Xf,ariaLabel:`${t(`buttons.lightMode`)} - ${i}`},{value:Qs.DARK,label:Yf,ariaLabel:`${t(`buttons.darkMode`)} - ${i}`},{value:`system`,label:rh,ariaLabel:t(`buttons.systemMode`)}],children:t(`labels.theme`)}):(0,k.jsx)(zR,{onSelect:t=>{if(t.preventDefault(),e?.onSelect)e.onSelect(n.theme===Qs.DARK?Qs.LIGHT:Qs.DARK);else return r.executeAction(mz)},icon:n.theme===Qs.DARK?Xf:Yf,"data-testid":`toggle-dark-mode`,shortcut:i,"aria-label":n.theme===Qs.DARK?t(`buttons.lightMode`):t(`buttons.darkMode`),children:n.theme===Qs.DARK?t(`buttons.lightMode`):t(`buttons.darkMode`)}):null};CW.displayName=`ToggleTheme`;var wW=()=>{let{t:e}=cL(),t=lR(),n=$q(),r=qq();return t.viewModeEnabled||!r.UIOptions.canvasActions.changeViewBackgroundColor?null:(0,k.jsxs)(`div`,{style:{marginTop:`0.5rem`},children:[(0,k.jsx)(`div`,{"data-testid":`canvas-background-label`,style:{fontSize:`.75rem`,marginBottom:`.5rem`},children:e(`labels.canvasBackground`)}),(0,k.jsx)(`div`,{style:{padding:`0 0.625rem`},children:n.renderAction(`changeViewBackgroundColor`)})]})};wW.displayName=`ChangeCanvasBackground`;var TW=()=>{let{t:e}=cL(),t=Qq();return(0,k.jsx)(zR,{icon:Qf,onSelect:()=>{t({openDialog:{name:`jsonExport`}})},"data-testid":`json-export-button`,"aria-label":e(`buttons.export`),children:e(`buttons.export`)})};TW.displayName=`Export`;var EW=()=>{let{t:e}=cL();return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(SV,{icon:np,href:`https://github.com/excalidraw/excalidraw`,"aria-label":`GitHub`,children:`GitHub`}),(0,k.jsx)(SV,{icon:ip,href:`https://x.com/excalidraw`,"aria-label":`X`,children:e(`labels.followUs`)}),(0,k.jsx)(SV,{icon:rp,href:`https://discord.gg/UexuTaE`,"aria-label":`Discord`,children:e(`labels.discordChat`)})]})};EW.displayName=`Socials`;var DW=({onSelect:e,isCollaborating:t})=>{let{t:n}=cL();return(0,k.jsx)(zR,{"data-testid":`collab-button`,icon:Mp,className:O({"active-collab":t}),onSelect:e,children:n(`labels.liveCollaboration`)})};DW.displayName=`LiveCollaborationTrigger`;var OW=(e,t)=>{let n=EO(0),r=e=>{let{tunnelsJotai:{useAtom:r}}=aH(),[,i]=r(n),a=(0,u.useRef)({preferHost:!1,counter:0});return(0,u.useLayoutEffect)(()=>{let e=a.current;return i(t=>{let n=t+1;return e.counter=n,n}),()=>{i(t=>{let n=t-1;return e.counter=n,n||(e.preferHost=!1),n})}},[i]),e.__fallback||(a.current.preferHost=!0),!a.current.counter&&e.__fallback&&a.current.preferHost||a.current.counter>1&&e.__fallback?null:(0,k.jsx)(t,{...e})};return r.displayName=e,r},kW=Object.assign(OW(`MainMenu`,({children:e,onSelect:t})=>{let{MainMenuTunnel:n}=aH(),r=Jq(),i=lR(),a=Qq(),o=r.editor.isMobile?void 0:()=>a({openMenu:null});return(0,k.jsx)(n.In,{children:(0,k.jsxs)(DV,{open:i.openMenu===`canvas`,children:[(0,k.jsx)(DV.Trigger,{onToggle:()=>{a({openMenu:i.openMenu===`canvas`?null:`canvas`})},"data-testid":`main-menu-trigger`,className:`main-menu-trigger`,children:Zf}),(0,k.jsxs)(DV.Content,{onClickOutside:o,onSelect:qu(t,()=>{a({openMenu:null})}),children:[e,r.editor.isMobile&&i.collaborators.size>0&&(0,k.jsxs)(`fieldset`,{className:`UserList-Wrapper`,children:[(0,k.jsx)(`legend`,{children:q(`labels.collaborators`)}),(0,k.jsx)(JU,{mobile:!0,collaborators:i.collaborators,userToFollow:i.userToFollow?.socketId||null})]})]})]})})}),{Trigger:DV.Trigger,Item:DV.Item,ItemLink:DV.ItemLink,ItemCustom:DV.ItemCustom,Group:DV.Group,Separator:DV.Separator,DefaultItems:dW}),AW=({title:e,children:t,actionLabel:n,onClick:r})=>(0,k.jsxs)(`div`,{className:`OverwriteConfirm__Actions__Action`,children:[(0,k.jsx)(`h4`,{children:e}),(0,k.jsx)(`div`,{className:`OverwriteConfirm__Actions__Action__content`,children:t}),(0,k.jsx)(ZH,{variant:`outlined`,color:`muted`,label:n,size:`large`,fullWidth:!0,onClick:r})]}),jW=Object.assign(({children:e})=>(0,k.jsx)(`div`,{className:`OverwriteConfirm__Actions`,children:e}),{ExportToImage:()=>{let{t:e}=cL(),t=$q(),n=Qq();return(0,k.jsx)(AW,{title:e(`overwriteConfirm.action.exportToImage.title`),actionLabel:e(`overwriteConfirm.action.exportToImage.button`),onClick:()=>{t.executeAction(Dz,`ui`,!0),n({openDialog:{name:`imageExport`}})},children:e(`overwriteConfirm.action.exportToImage.description`)})},SaveToDisk:()=>{let{t:e}=cL(),t=$q();return(0,k.jsx)(AW,{title:e(`overwriteConfirm.action.saveToDisk.title`),actionLabel:e(`overwriteConfirm.action.saveToDisk.button`),onClick:()=>{t.executeAction(kz,`ui`)},children:e(`overwriteConfirm.action.saveToDisk.description`)})}}),MW=Object.assign(OW(`OverwriteConfirmDialog`,({children:e})=>{let{OverwriteConfirmDialogTunnel:t}=aH(),[n,r]=GI(fW);return n.active?(0,k.jsx)(t.In,{children:(0,k.jsx)(YV,{onCloseRequest:()=>{n.onClose(),r(e=>({...e,active:!1}))},title:!1,size:916,children:(0,k.jsxs)(`div`,{className:`OverwriteConfirm`,children:[(0,k.jsx)(`h3`,{children:n.title}),(0,k.jsxs)(`div`,{className:`OverwriteConfirm__Description OverwriteConfirm__Description--color-${n.color}`,children:[(0,k.jsx)(`div`,{className:`OverwriteConfirm__Description__icon`,children:Am}),(0,k.jsx)(`div`,{children:n.description}),(0,k.jsx)(`div`,{className:`OverwriteConfirm__Description__spacer`}),(0,k.jsx)(ZH,{color:n.color,size:`large`,label:n.actionLabel,onClick:()=>{n.onConfirm(),r(e=>({...e,active:!1}))}})]}),(0,k.jsx)(jW,{children:e})]})})}):null}),{Actions:jW,Action:AW}),NW=EO(``),PW=EO(null),FW=350,IW=()=>{let e=Kq(),t=Qq(),n=(0,u.useRef)(null),[r,i]=GI(NW),a=r.trim(),[o,s]=(0,u.useState)(!1),[c,l]=(0,u.useState)({nonce:null,items:[]}),d=(0,u.useRef)(null),f=(0,u.useRef)(void 0),[p,m]=GI(PW),h=e.scene.getNonDeletedElementsMap();(0,u.useEffect)(()=>{o||(a!==d.current||e.scene.getSceneNonce()!==f.current)&&(d.current=null,UW(a,e,(n,r)=>{l({nonce:hx(),items:n}),d.current=a,f.current=e.scene.getSceneNonce(),t({searchMatches:n.map(e=>({id:e.textElement.id,focus:!1,matchedLines:e.matchedLines}))})}))},[o,a,h,e,t,m,f]);let g=()=>{c.items.length>0&&m(e=>e===null?0:(e+1)%c.items.length)},_=()=>{c.items.length>0&&m(e=>e===null?0:e-1<0?c.items.length-1:e-1)};(0,u.useEffect)(()=>{t(e=>({searchMatches:e.searchMatches.map((e,t)=>t===p?{...e,focus:!0}:{...e,focus:!1})}))},[p,t]),(0,u.useEffect)(()=>{if(c.items.length>0&&p!==null){let t=c.items[p];if(t){let n=e.state.zoom.value,r=wx({text:t.searchQuery,x:t.textElement.x+(t.matchedLines[0]?.offsetX??0),y:t.textElement.y+(t.matchedLines[0]?.offsetY??0),width:t.matchedLines[0]?.width,height:t.matchedLines[0]?.height,fontSize:t.textElement.fontSize,fontFamily:t.textElement.fontFamily}),i=t.textElement.fontSize,a=i*n<14;if(!cE([r],e.canvas.width/window.devicePixelRatio,e.canvas.height/window.devicePixelRatio,{offsetLeft:e.state.offsetLeft,offsetTop:e.state.offsetTop,scrollX:e.state.scrollX,scrollY:e.state.scrollY,zoom:e.state.zoom},e.scene.getNonDeletedElementsMap(),e.getEditorUIOffsets())||a){let t;t=a?i>=14?{fitToContent:!0}:{fitToViewport:!0,maxZoom:tl(14/i,1)}:{fitToContent:!0},e.scrollToContent(r,{animate:!0,duration:300,...t,canvasOffsets:e.getEditorUIOffsets()})}}}},[p,c,e]),(0,u.useEffect)(()=>()=>{m(null),d.current=null,f.current=void 0,t({searchMatches:[]}),s(!1)},[t,m]);let v=fR({goToNextItem:g,goToPreviousItem:_,searchMatches:c});(0,u.useEffect)(()=>ed(window,`keydown`,r=>{if(r.key===H.ESCAPE&&!e.state.openDialog&&!e.state.openPopup){r.preventDefault(),r.stopPropagation(),t({openSidebar:null});return}r[H.CTRL_OR_CMD]&&r.key===H.F&&(r.preventDefault(),r.stopPropagation(),n.current?.matches(`:focus`)?t({openSidebar:null}):(e.state.openDialog&&t({openDialog:null}),n.current?.focus(),n.current?.select())),r.target instanceof HTMLElement&&r.target.closest(`.layer-ui__search`)&&v.searchMatches.items.length&&(r.key===H.ENTER&&(r.stopPropagation(),v.goToNextItem()),r.key===H.ARROW_UP?(r.stopPropagation(),v.goToPreviousItem()):r.key===H.ARROW_DOWN&&(r.stopPropagation(),v.goToNextItem()))},{capture:!0,passive:!1}),[t,v,e]);let y=`${c.items.length} ${c.items.length===1?q(`search.singleResult`):q(`search.multipleResults`)}`;return(0,k.jsxs)(`div`,{className:`layer-ui__search`,children:[(0,k.jsx)(`div`,{className:`layer-ui__search-header`,children:(0,k.jsx)(ZV,{className:Ks.SEARCH_MENU_INPUT_WRAPPER,value:r,ref:n,placeholder:q(`search.placeholder`),icon:Hm,onChange:n=>{i(n),s(!0);let r=n.trim();UW(r,e,(n,i)=>{l({nonce:hx(),items:n}),m(i),d.current=r,f.current=e.scene.getSceneNonce(),t({searchMatches:n.map(e=>({id:e.textElement.id,focus:!1,matchedLines:e.matchedLines}))}),s(!1)})},selectOnRender:!0})}),(0,k.jsxs)(`div`,{className:`layer-ui__search-count`,children:[c.items.length>0&&(0,k.jsxs)(k.Fragment,{children:[p!==null&&p>-1?(0,k.jsxs)(`div`,{children:[p+1,` / `,y]}):(0,k.jsx)(`div`,{children:y}),(0,k.jsxs)(`div`,{className:`result-nav`,children:[(0,k.jsx)(XV,{onSelect:()=>{g()},className:`result-nav-btn`,children:uh}),(0,k.jsx)(XV,{onSelect:()=>{_()},className:`result-nav-btn`,children:fh})]})]}),c.items.length===0&&a&&d.current&&(0,k.jsx)(`div`,{style:{margin:`1rem auto`},children:q(`search.noMatch`)})]}),(0,k.jsx)(RW,{matches:c,onItemClick:m,focusIndex:p,searchQuery:a})]})},LW=e=>{let t=[e.preview.moreBefore?`...`:``,e.preview.previewText.slice(0,e.preview.indexInSearchQuery),e.preview.previewText.slice(e.preview.indexInSearchQuery,e.preview.indexInSearchQuery+e.searchQuery.length),e.preview.previewText.slice(e.preview.indexInSearchQuery+e.searchQuery.length),e.preview.moreAfter?`...`:``];return(0,k.jsx)(`div`,{tabIndex:-1,className:O(`layer-ui__result-item`,{active:e.highlighted}),onClick:e.onClick,ref:t=>{e.highlighted&&t?.scrollIntoView({behavior:`auto`,block:`nearest`})},children:(0,k.jsx)(`div`,{className:`preview-text`,children:t.flatMap((e,t)=>(0,k.jsx)(u.Fragment,{children:t===2?(0,k.jsx)(`b`,{children:e}):e},t))})})},RW=(0,u.memo)(e=>(0,k.jsx)(`div`,{className:`layer-ui__search-result-container`,children:e.matches.items.map((t,n)=>(0,k.jsx)(LW,{searchQuery:e.searchQuery,preview:t.preview,highlighted:n===e.focusIndex,onClick:()=>e.onItemClick(n)},t.textElement.id+t.index))}),(e,t)=>e.matches.nonce===t.matches.nonce&&e.focusIndex===t.focusIndex),zW=(e,t,n)=>{let r=e.slice(0,t),i=r.split(/\s+/),a=r.endsWith(` `),o=i.length-2-1-!a,s=i.slice(o<=0?0:o).join(` `)+(a?` `:``);s=s.length>20?s.slice(-20):s;let c=e.slice(t+n.length),l=c.split(/\s+/),u=!c.startsWith(` `),d=u?6:5,f=(u?``:` `)+l.slice(0,d).join(` `);return{indexInSearchQuery:s.length,previewText:s+n+f,moreBefore:o>0,moreAfter:l.length>d}},BW=(e,t)=>{let n=e.split(`
|
|
103
|
+
`),r=[],i=0;for(let e=0;e<n.length;e++){let a=n[e],o=n[e+1];if(o){let e=t.indexOf(o,i);if(e>a.length+i){let t=e-(a.length+i);for(;t>0;)a+=` `,t--}}r.push(a),i+=a.length}return r.join(`
|
|
104
|
+
`)},VW=(e,t,n)=>{let r=BW(e.text,e.originalText).split(`
|
|
105
|
+
`),i=[],a=0,o=0;for(let e of r){let t=a,n=t+e.length-1;i.push({line:e,startIndex:t,endIndex:n,lineNumber:o}),a=n+1,o++}let s=n,c=e.originalText.slice(n,n+t.length),l=[];for(let t of i){if(c===``)break;if(s>=t.startIndex&&s<=t.endIndex){let n=t.endIndex+1-s,r=t.line.slice(0,s-t.startIndex),i=c.slice(0,n);c=c.slice(n);let a=Id(r,cu(e),e.lineHeight);if(r===``&&(a.width=0),e.textAlign!==`left`&&t.line.length>0){let n=Id(t.line,cu(e),e.lineHeight),r=e.textAlign===`center`?(e.width-n.width)/2:e.width-n.width;a.width+=r}let{width:o,height:u}=Id(i,cu(e),e.lineHeight),d=a.width,f=t.lineNumber*a.height;l.push({offsetX:d,offsetY:f,width:o,height:u}),s+=n}}return l},HW=e=>e.replace(/[.*+?^${}()|[\]\\-]/g,`\\$&`),UW=(0,DI.default)((e,t,n)=>{if(!e||e===``){n([],null);return}let r=t.scene.getNonDeletedElements().filter(e=>R(e));r.sort((e,t)=>e.y-t.y);let i=[],a=new RegExp(HW(e),`gi`);for(let t of r){let n=null,r=t.originalText;for(;(n=a.exec(r))!==null;){let a=zW(r,n.index,e),o=VW(t,e,n.index);o.length>0&&i.push({textElement:t,searchQuery:e,preview:a,index:n.index,matchedLines:o})}}let o=new Set(t.visibleElements.map(e=>e.id));n(i,i.findIndex(e=>o.has(e.textElement.id))??null)},FW),WW=OW(`DefaultSidebarTrigger`,e=>{let{DefaultSidebarTriggerTunnel:t}=aH();return(0,k.jsx)(t.In,{children:(0,k.jsx)(uW.Trigger,{...e,className:`default-sidebar-trigger`,name:Ic.name})})});WW.displayName=`DefaultSidebarTrigger`;var GW=({children:e})=>{let{DefaultSidebarTabTriggersTunnel:t}=aH();return(0,k.jsx)(t.In,{children:e})};GW.displayName=`DefaultTabTriggers`;var KW=Object.assign(OW(`DefaultSidebar`,({children:e,className:t,onDock:n,docked:r,...i})=>{let a=lR(),o=Qq(),{DefaultSidebarTabTriggersTunnel:s}=aH(),c=a.openSidebar?.tab===Fc;return(0,u.createElement)(uW,{...i,name:`default`,key:`default`,className:O(`default-sidebar`,t),docked:c||(r??a.defaultSidebarDockedPreference),onDock:c||n===!1||!n&&r!=null?void 0:qu(n,e=>{o({defaultSidebarDockedPreference:e})})},(0,k.jsxs)(uW.Tabs,{children:[(0,k.jsx)(uW.Header,{children:(0,k.jsxs)(uW.TabTriggers,{children:[(0,k.jsx)(uW.TabTrigger,{tab:Fc,children:Hm}),(0,k.jsx)(uW.TabTrigger,{tab:Pc,children:Ef}),(0,k.jsx)(s.Out,{})]})}),(0,k.jsx)(uW.Tab,{tab:Pc,children:(0,k.jsx)(qV,{})}),(0,k.jsx)(uW.Tab,{tab:Fc,children:(0,k.jsx)(IW,{})}),e]}))}),{Trigger:WW,TabTriggers:GW}),qW=`small`,JW=e=>(0,k.jsxs)(`label`,{className:O(`ToolIcon ToolIcon__LaserPointer`,`ToolIcon_size_${qW}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[(0,k.jsx)(`input`,{className:`ToolIcon_type_checkbox`,type:`checkbox`,name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title,"data-testid":`toolbar-LaserPointer`}),(0,k.jsx)(`div`,{className:`ToolIcon__icon`,children:Im})]}),YW=({canvasRef:e,setError:t})=>{let n=e.current;if(!n)return;let r=n.parentElement;r&&(r.style.background=``,t(null),n.replaceChildren())},XW=async({canvasRef:e,mermaidToExcalidrawLib:t,mermaidDefinition:n,setError:r,data:i})=>{let a=e.current,o=a?.parentElement;if(!(!a||!o)){if(!n){YW({canvasRef:e,setError:r});return}try{let e=await t.api,s;try{s=await e.parseMermaidToExcalidraw(n)}catch{s=await e.parseMermaidToExcalidraw(n.replace(/"/g,`'`))}let{elements:c,files:l={}}=s;r(null),i.current={elements:MK(c,{regenerateIds:!0}),files:l};let u=await $w({elements:i.current.elements,files:i.current.files,exportPadding:10,maxWidthOrHeight:Math.max(o.offsetWidth,o.offsetHeight)*window.devicePixelRatio});try{await hD(u)}catch(e){throw e.name===`CANVAS_POSSIBLY_TOO_BIG`?Error(q(`canvasError.canvasTooBig`)):e}o.style.background=`var(--default-bg-color)`,a.replaceChildren(u)}catch(e){throw o.style.background=`var(--default-bg-color)`,n&&r(e),e}}},ZW=e=>{dV.set(zc.MERMAID_TO_EXCALIDRAW,e)},QW=({app:e,data:t,text:n,shouldSaveMermaidDataToStorage:r})=>{let{elements:i,files:a}=t.current;i.length&&(e.addElementsFromPasteOrLibrary({elements:i,files:a,position:`center`,fitToContent:!0}),e.setOpenDialog(null),r&&n&&ZW(n))},$W=({children:e})=>(0,k.jsx)(`div`,{className:`ttd-dialog-panels`,children:e}),eG=({label:e,children:t,panelAction:n,panelActionDisabled:r=!1,onTextSubmitInProgess:i,renderTopRight:a,renderSubmitShortcut:o,renderBottomRight:s})=>(0,k.jsxs)(`div`,{className:`ttd-dialog-panel`,children:[(0,k.jsxs)(`div`,{className:`ttd-dialog-panel__header`,children:[(0,k.jsx)(`label`,{children:e}),a?.()]}),t,(0,k.jsxs)(`div`,{className:O(`ttd-dialog-panel-button-container`,{invisible:!n}),style:{display:`flex`,alignItems:`center`},children:[(0,k.jsxs)(XV,{className:`ttd-dialog-panel-button`,onSelect:n?n.action:()=>{},disabled:r||i,children:[(0,k.jsxs)(`div`,{className:O({invisible:i}),children:[n?.label,n?.icon&&(0,k.jsx)(`span`,{children:n.icon})]}),i&&(0,k.jsx)(lL,{})]}),!r&&!i&&o?.(),s?.()]})]}),tG=({input:e,placeholder:t,onChange:n,onKeyboardSubmit:r})=>{let i=(0,u.useRef)(null),a=(0,u.useRef)(r);return a.current=r,(0,u.useEffect)(()=>{if(!a.current)return;let e=i.current;if(e){let t=e=>{e[H.CTRL_OR_CMD]&&e.key===H.ENTER&&(e.preventDefault(),a.current?.())};return e.addEventListener(`keydown`,t),()=>{e.removeEventListener(`keydown`,t)}}},[]),(0,k.jsx)(`textarea`,{className:`ttd-dialog-input`,onChange:n,value:e,placeholder:t,autoFocus:!0,ref:i})},nG=({error:e})=>(0,k.jsxs)(`div`,{"data-testid":`ttd-dialog-output-error`,className:`ttd-dialog-output-error`,children:[`Error! `,(0,k.jsx)(`p`,{children:e})]}),rG=({error:e,canvasRef:t,loaded:n})=>(0,k.jsxs)(`div`,{className:`ttd-dialog-output-wrapper`,children:[e&&(0,k.jsx)(nG,{error:e.message}),n?(0,k.jsx)(`div`,{ref:t,style:{opacity:e?`0.15`:1},className:`ttd-dialog-output-canvas-container`}):(0,k.jsx)(lL,{size:`2rem`})]}),iG=()=>(0,k.jsxs)(`div`,{className:`ttd-dialog-submit-shortcut`,children:[(0,k.jsx)(`div`,{className:`ttd-dialog-submit-shortcut__key`,children:L(`CtrlOrCmd`)}),(0,k.jsx)(`div`,{className:`ttd-dialog-submit-shortcut__key`,children:L(`Enter`)})]}),aG=`flowchart TD
|
|
106
|
+
A[Christmas] -->|Get money| B(Go shopping)
|
|
107
|
+
B --> C{Let me think}
|
|
108
|
+
C -->|One| D[Laptop]
|
|
109
|
+
C -->|Two| E[iPhone]
|
|
110
|
+
C -->|Three| F[Car]`,oG=lu(ZW,300),sG=({mermaidToExcalidrawLib:e})=>{let[t,n]=(0,u.useState)(()=>dV.get(zc.MERMAID_TO_EXCALIDRAW)||aG),r=(0,u.useDeferredValue)(t.trim()),[i,a]=(0,u.useState)(null),o=(0,u.useRef)(null),s=(0,u.useRef)({elements:[],files:null}),c=Kq();(0,u.useEffect)(()=>{XW({canvasRef:o,data:s,mermaidToExcalidrawLib:e,setError:a,mermaidDefinition:r}).catch(e=>{Ru()&&console.error(`Failed to parse mermaid definition`,e)}),oG(r)},[r,e]),(0,u.useEffect)(()=>()=>{oG.flush()},[]);let l=()=>{QW({app:c,data:s,text:t,shouldSaveMermaidDataToStorage:!0})};return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`ttd-dialog-desc`,children:(0,k.jsx)(cV,{i18nKey:`mermaid.description`,flowchartLink:e=>(0,k.jsx)(`a`,{href:`https://mermaid.js.org/syntax/flowchart.html`,children:e}),sequenceLink:e=>(0,k.jsx)(`a`,{href:`https://mermaid.js.org/syntax/sequenceDiagram.html`,children:e}),classLink:e=>(0,k.jsx)(`a`,{href:`https://mermaid.js.org/syntax/classDiagram.html`,children:e})})}),(0,k.jsxs)($W,{children:[(0,k.jsx)(eG,{label:q(`mermaid.syntax`),children:(0,k.jsx)(tG,{input:t,placeholder:`Write Mermaid diagram defintion here...`,onChange:e=>n(e.target.value),onKeyboardSubmit:()=>{l()}})}),(0,k.jsx)(eG,{label:q(`mermaid.preview`),panelAction:{action:()=>{l()},label:q(`mermaid.button`),icon:Fm},renderSubmitShortcut:()=>(0,k.jsx)(iG,{}),children:(0,k.jsx)(rG,{canvasRef:o,loaded:e.loaded,error:i})})]})]})},cG=e=>{let t=Qq(),n=(0,u.useRef)(null),r=(0,u.useRef)(0);return(0,k.jsx)(CI,{ref:n,className:`ttd-dialog-tabs-root`,value:e.tab,onValueChange:i=>{if(!i)return;let a=n.current?.closest(`.Modal__content`);if(a){let e=a.offsetHeight||0;e>r.current&&(r.current=e,a.style.minHeight=`min(${r.current}px, 100%)`)}e.dialog===`ttd`&&Zu([`text-to-diagram`,`mermaid`],i)&&t({openDialog:{name:e.dialog,tab:i}})},children:e.children})};cG.displayName=`TTDDialogTabs`;var lG=cG,uG=({children:e,...t})=>(0,k.jsx)(wI,{className:`ttd-dialog-triggers`,...t,children:e});uG.displayName=`TTDDialogTabTriggers`;var dG=({children:e,tab:t,onSelect:n,...r})=>(0,k.jsx)(TI,{value:t,asChild:!0,onSelect:n,children:(0,k.jsx)(`button`,{type:`button`,className:`ttd-dialog-tab-trigger`,...r,children:e})});dG.displayName=`TTDDialogTabTrigger`;var fG=({tab:e,children:t,...n})=>(0,k.jsx)(EI,{...n,value:e,children:t});fG.displayName=`TTDDialogTab`;var pG=3,mG=1e3,hG=EO(null),gG=EO(null),_G=e=>{let t=lR();return t.openDialog?.name===`ttd`?(0,k.jsx)(vG,{...e,tab:t.openDialog.tab}):null},vG=OW(`TTDDialogBase`,({tab:e,...t})=>{let n=Kq(),r=Qq(),i=(0,u.useRef)(null),[a,o]=GI(gG),[s,c]=(0,u.useState)(a?.prompt??``),l=s.trim(),d=e=>{c(e.target.value),o(t=>({generatedResponse:t?.generatedResponse??null,prompt:e.target.value}))},[f,p]=(0,u.useState)(!1),[m,h]=GI(hG),g=async()=>{if(l.length>mG||l.length<pG||f||m?.rateLimitRemaining===0||`__fallback`in t){l.length<pG&&S(Error(`Prompt is too short (min ${pG} characters)`)),l.length>mG&&S(Error(`Prompt is too long (max ${mG} characters)`));return}try{p(!0),VL(`ai`,`generate`,`ttd`);let{generatedResponse:e,error:n,rateLimit:r,rateLimitRemaining:a}=await t.onTextSubmit(l);if(typeof e==`string`&&o(t=>({generatedResponse:e,prompt:t?.prompt??null})),il(r)&&il(a)&&h({rateLimit:r,rateLimitRemaining:a}),n){S(n);return}if(!e){S(Error(`Generation failed`));return}try{await XW({canvasRef:i,data:b,mermaidToExcalidrawLib:v,setError:S,mermaidDefinition:e}),VL(`ai`,`mermaid parse success`,`ttd`)}catch(e){console.info(`%cTTD mermaid render errror: ${e.message}`,`color: red`),console.info(`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
|
111
|
+
TTD mermaid definition render errror: ${e.message}`,`color: yellow`),VL(`ai`,`mermaid parse failed`,`ttd`),S(Error(`Generated an invalid diagram :(. You may also try a different prompt.`))}}catch(e){let t=e.message;(!t||t===`Failed to fetch`)&&(t=`Request failed`),S(Error(t))}finally{p(!1)}},_=(0,u.useRef)(g);_.current=g;let[v,y]=(0,u.useState)({loaded:!1,api:A(()=>import(`./dist-C2o0r0se.js`).then(e=>e.t),__vite__mapDeps([5,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]),import.meta.url)});(0,u.useEffect)(()=>{(async()=>{await v.api,y(e=>({...e,loaded:!0}))})()},[v.api]);let b=(0,u.useRef)({elements:[],files:null}),[x,S]=(0,u.useState)(null);return(0,k.jsx)(YV,{className:`ttd-dialog`,onCloseRequest:()=>{n.setOpenDialog(null)},size:1200,title:!1,...t,autofocus:!1,children:(0,k.jsxs)(lG,{dialog:`ttd`,tab:e,children:[`__fallback`in t&&t.__fallback?(0,k.jsx)(`p`,{className:`dialog-mermaid-title`,children:q(`mermaid.title`)}):(0,k.jsxs)(uG,{children:[(0,k.jsx)(dG,{tab:`text-to-diagram`,children:(0,k.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`},children:[q(`labels.textToDiagram`),(0,k.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,padding:`1px 6px`,marginLeft:`10px`,fontSize:10,borderRadius:`12px`,background:`var(--color-promo)`,color:`var(--color-surface-lowest)`},children:`AI Beta`})]})}),(0,k.jsx)(dG,{tab:`mermaid`,children:`Mermaid`})]}),(0,k.jsx)(fG,{className:`ttd-dialog-content`,tab:`mermaid`,children:(0,k.jsx)(sG,{mermaidToExcalidrawLib:v})}),!(`__fallback`in t)&&(0,k.jsxs)(fG,{className:`ttd-dialog-content`,tab:`text-to-diagram`,children:[(0,k.jsx)(`div`,{className:`ttd-dialog-desc`,children:`Currently we use Mermaid as a middle step, so you'll get best results if you describe a diagram, workflow, flow chart, and similar.`}),(0,k.jsxs)($W,{children:[(0,k.jsx)(eG,{label:q(`labels.prompt`),panelAction:{action:g,label:`Generate`,icon:Fm},onTextSubmitInProgess:f,panelActionDisabled:l.length>mG||m?.rateLimitRemaining===0,renderTopRight:()=>m?(0,k.jsxs)(`div`,{className:`ttd-dialog-rate-limit`,style:{fontSize:12,marginLeft:`auto`,color:m.rateLimitRemaining===0?`var(--color-danger)`:void 0},children:[m.rateLimitRemaining,` requests left today`]}):null,renderSubmitShortcut:()=>(0,k.jsx)(iG,{}),renderBottomRight:()=>{if(typeof a?.generatedResponse==`string`)return(0,k.jsxs)(`div`,{className:`excalidraw-link`,style:{marginLeft:`auto`,fontSize:14},onClick:()=>{typeof a?.generatedResponse==`string`&&(ZW(a.generatedResponse),r({openDialog:{name:`ttd`,tab:`mermaid`}}))},children:[`View as Mermaid`,(0,k.jsx)(CR,{icon:Fm})]});let e=l.length/mG;return e>.8?(0,k.jsxs)(`div`,{style:{marginLeft:`auto`,fontSize:12,fontFamily:`monospace`,color:e>1?`var(--color-danger)`:void 0},children:[`Length: `,l.length,`/`,mG]}):null},children:(0,k.jsx)(tG,{onChange:d,input:s,placeholder:`Describe what you want to see...`,onKeyboardSubmit:()=>{_.current()}})}),(0,k.jsx)(eG,{label:`Preview`,panelAction:{action:()=>{console.info(`Panel action clicked`),QW({app:n,data:b})},label:`Insert`,icon:Fm},children:(0,k.jsx)(rG,{canvasRef:i,error:x,loaded:v.loaded})})]})]})]})})}),yG=.01,bG=(e,t)=>!(t===`height`&&R(e)||t===`width`&&R(e)||t===`angle`&&gd(e)),xG=(e,t)=>{let n=e+t/2;return n-n%t},SG=(e,t,n)=>Object.keys(e).map(e=>({original:(n??t).get(e),latest:t.get(e)})).filter(e=>e.original!==void 0&&e.latest!==void 0),CG=(e,t,n,r,i,a,o,s=!0)=>{let c=r.get(n.id);if(!c)return;let[l,u]=[n.x+n.width/2,n.y+n.height/2],[d,f]=F(P(n.x,n.y),P(l,u),n.angle),p=e-d,m=t-f,[h,g]=F(P(e,t),P(l+p,u+m),-n.angle);K(c,{x:h,y:g},s),TG(c,r,i,a);let _=zb(n,o);if(_){let e=r.get(_.id);e&&K(e,{x:_.x+p,y:_.y+m},s)}},wG=(e,t)=>{let n=Uy(t).map(t=>qy(e,t).reduce((e,t)=>(e[t.id]=!0,e),{}));return e.filter(e=>!tb(e)).forEach(e=>{n.push({[e.id]:!0})}),n},TG=(e,t,n,r,i)=>{yd(e)?Uv([e],t,n,r,!0,[],i?.zoom):ny(e,t,i)},EG=({label:e,icon:t,dragInputCallback:n,value:r,elements:i,editable:a=!0,shouldKeepAspectRatio:o,property:s,scene:c,appState:l,sensitivity:d=1})=>{let f=Kq(),p=(0,u.useRef)(null),m=(0,u.useRef)(null),[h,g]=(0,u.useState)(r.toString()),_=(0,u.useRef)(null);_.current||={originalAppState:Qu(l),originalElements:i,lastUpdatedValue:h,updatePending:!1},(0,u.useEffect)(()=>{let e=r.toString();g(e),_.current.lastUpdatedValue=e},[r]);let v=(e,t,i)=>{if(!_.current.updatePending)return!1;_.current.updatePending=!1;let a=Number(e);if(isNaN(a)){g(r.toString());return}let l=Number(a.toFixed(2)),u=Number(r);(isNaN(u)||Math.abs(l-u)>=yG)&&(_.current.lastUpdatedValue=e,n({accumulatedChange:0,instantChange:0,originalElements:t,originalElementsMap:f.scene.getNonDeletedElementsMap(),shouldKeepAspectRatio:o,shouldChangeByStepSize:!1,scene:c,nextValue:l,property:s,originalAppState:i,setInputValue:e=>g(String(e))}),f.syncActionResult({captureUpdate:G.IMMEDIATELY}))},y=(0,u.useRef)({});return y.current.handleInputValue=v,(0,u.useEffect)(()=>{let e=p.current,t=y.current;return()=>{let n=e?.value;n&&t.handleInputValue?.(n,_.current.originalElements,_.current.originalAppState),window.removeEventListener(`pointermove`,t.onPointerMove,!1),window.removeEventListener(`pointerup`,t.onPointerUp,!1)}},[a]),a?(0,k.jsxs)(`div`,{className:O(`drag-input-container`,!a&&`disabled`),"data-testid":e,children:[(0,k.jsx)(`div`,{className:`drag-input-label`,ref:m,onPointerDown:e=>{if(p.current&&a){document.body.classList.add(`excalidraw-cursor-resize`);let e=Number(p.current.value);isNaN(e)&&(e=0);let t=null,r=f.scene.getNonDeletedElements().reduce((e,t)=>(e.set(t.id,Nx(t)),e),new Map),a=i.map(e=>r.get(e.id)),u=Qu(l),m=0,h=0,_=e=>{if(t&&r!==null&&a!==null){let i=e.clientX-t.x;i!==0&&(h+=i,Math.abs(h)>=d&&(h=Math.sign(h)*Math.floor(Math.abs(h)/d),m+=h,n({accumulatedChange:m,instantChange:h,originalElements:a,originalElementsMap:r,shouldKeepAspectRatio:o,shouldChangeByStepSize:e.shiftKey,property:s,scene:c,originalAppState:u,setInputValue:e=>g(String(e))}),h=0))}t={x:e.clientX,y:e.clientY}},v=()=>{window.removeEventListener(`pointermove`,_,!1),f.syncActionResult({captureUpdate:G.IMMEDIATELY}),t=null,m=0,h=0,a=null,r=null,document.body.classList.remove(`excalidraw-cursor-resize`),window.removeEventListener(`pointerup`,v,!1)};y.current.onPointerMove=_,y.current.onPointerUp=v,window.addEventListener(`pointermove`,_,!1),window.addEventListener(`pointerup`,v,!1)}},onPointerEnter:()=>{m.current&&(m.current.style.cursor=`ew-resize`)},children:t?(0,k.jsx)(CR,{icon:t}):e}),(0,k.jsx)(`input`,{className:`drag-input`,autoComplete:`off`,spellCheck:`false`,onKeyDown:e=>{if(a){let t=e.target;t instanceof HTMLInputElement&&e.key===H.ENTER&&(v(t.value,i,l),f.focusContainer())}},ref:p,value:h,onChange:e=>{_.current.updatePending=!0,g(e.target.value)},onFocus:e=>{e.target.select(),_.current.originalElements=i,_.current.originalAppState=Qu(l)},onBlur:e=>{h?a&&v(e.target.value,_.current.originalElements,_.current.originalAppState):g(r.toString())},disabled:!a})]}):null},DG=10,OG=e=>e.type===`image`,kG=({accumulatedChange:e,originalElements:t,originalElementsMap:n,shouldKeepAspectRatio:r,shouldChangeByStepSize:i,nextValue:a,property:o,originalAppState:s,instantChange:c,scene:l})=>{let u=l.getNonDeletedElementsMap(),d=t[0],f=u.get(d.id);if(d&&f){let t=r||OG(d),l=d.width/d.height;if(s.croppingElementId===d.id){let e=u.get(d.id);if(!e||!ud(e)||!e.crop)return;let t=e.crop,n={...t},r=e.scale[0]===-1,i=e.scale[1]===-1,{width:s,height:l}=e_(e),f=t.naturalWidth/s,p=t.naturalHeight/l,m=r?t.width+t.x:t.naturalWidth-t.x,h=i?t.height+t.y:t.naturalHeight-t.y,g=10*f,_=10*p;if(a!==void 0){if(o===`width`){let e=el(a*f,g,m);n={...n,width:e,x:r?t.x+t.width-e:t.x}}else if(o===`height`){let e=el(a*p,_,h);n={...n,height:e,y:i?t.y+t.height-e:t.y}}K(e,{crop:n,width:n.width/(t.naturalWidth/s),height:n.height/(t.naturalHeight/l)});return}let v=o===`width`?c:0,y=o===`height`?c:0,b=el(t.width+v,g,m),x=el(t.height+y,g,h);n={...t,x:r?t.x+t.width-b:t.x,y:i?t.y+t.height-x:t.y,width:b,height:x},K(e,{crop:n,width:n.width/(t.naturalWidth/s),height:n.height/(t.naturalHeight/l)});return}if(a!==void 0){VE(Math.max(o===`width`?a:t?a*l:d.width,1),Math.max(o===`height`?a:t?a/l:d.height,1),f,d,u,n,o===`width`?`e`:`s`,{shouldMaintainAspectRatio:t});return}let p=o===`width`?e:0,m=o===`height`?e:0,h=Math.max(0,d.width+p);o===`width`&&(h=i?xG(h,DG):Math.round(h));let g=Math.max(0,d.height+m);o===`height`&&(g=i?xG(g,DG):Math.round(g)),t&&(o===`width`?g=Math.round(h/l*100)/100:h=Math.round(g*l*100)/100),g=Math.max(1,g),h=Math.max(1,h),VE(h,g,f,d,u,n,o===`width`?`e`:`s`,{shouldMaintainAspectRatio:t})}},AG=({property:e,element:t,scene:n,appState:r})=>{let i=tl(e===`width`?t.width:t.height,2);if(r.croppingElementId&&r.croppingElementId===t.id&&ud(t)&&t.crop){let{width:n,height:r}=e_(t);if(e===`width`){let e=n/t.crop.naturalWidth;i=tl(t.crop.width*e,2)}if(e===`height`){let e=r/t.crop.naturalHeight;i=tl(t.crop.height*e,2)}}return(0,k.jsx)(EG,{label:e===`width`?`W`:`H`,elements:[t],dragInputCallback:kG,value:i,editable:bG(t,e),scene:n,appState:r,property:e})},jG=15,MG=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:r,scene:i})=>{let a=i.getNonDeletedElementsMap(),o=i.getNonDeletedElements(),s=t[0];if(s&&!z(s)){let t=a.get(s.id);if(!t)return;if(r!==void 0){let e=sl(r);K(t,{angle:e}),TG(t,a,o,i);let n=zb(t,a);n&&!bd(t)&&K(n,{angle:e});return}let c=(Math.round(cl(s.angle)*100)/100+Math.round(e))%360;n&&(c=xG(c,jG)),c=c<0?c+360:c;let l=sl(c);K(t,{angle:l}),TG(t,a,o,i);let u=zb(t,a);u&&!bd(t)&&K(u,{angle:l})}},NG=({element:e,scene:t,appState:n,property:r})=>(0,k.jsx)(EG,{label:`A`,icon:Sm,value:Math.round(cl(e.angle)%360*100)/100,elements:[e],dragInputCallback:MG,editable:bG(e,`angle`),scene:t,appState:n,property:r}),PG=4,FG=4,IG=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:r,scene:i})=>{let a=i.getNonDeletedElementsMap(),o=t[0];if(o){let t=a.get(o.id);if(!t||!R(t))return;let s;if(r!==void 0)s=Math.max(Math.round(r),PG);else if(o.type===`text`){let t=Math.round(o.fontSize);s=Math.max(t+Math.round(e),PG),n&&(s=xG(s,FG))}s&&(K(t,{fontSize:s}),Pb(t,i.getContainerElement(t),i.getNonDeletedElementsMap()))}},LG=({element:e,scene:t,appState:n,property:r})=>{let i=R(e)?e:kd(e)?zb(e,t.getNonDeletedElementsMap()):null;return i?(0,k.jsx)(EG,{label:`F`,value:Math.round(i.fontSize*10)/10,elements:[i],dragInputCallback:IG,icon:fm,appState:n,scene:t,property:r}):null},RG=10,zG=(e,t,n,r)=>{let i=r.x-e,a=r.y-t,o=r.width*n,s=r.height*n;return{width:o,height:s,x:e+i*n,y:t+a*n,...NE(r,o,s,!1),...R(r)?{fontSize:r.fontSize*n}:{}}},BG=(e,t,n,r,i,a,o,s)=>{let c=zG(e,t,r,a);K(i,c,!1);let l=zb(a,s);if(l){let e=l.fontSize*r;ny(i,o,{newSize:{width:c.width,height:c.height}});let t=o.get(l.id);t&&R(t)&&(K(t,{fontSize:e},!1),Ib(i,o,n===`width`?`e`:`s`,!0))}},VG=(e,t,n,r,i,a,o,s,c,l)=>{a===`width`?t=Math.round(e/r*100)/100:e=Math.round(t*r*100)/100;let u=t/n;for(let e=0;e<s.length;e++){let t=s[e],n=o[e];BG(i[0],i[1],a,u,n,t,c,l)}},HG=({accumulatedChange:e,originalElements:t,originalElementsMap:n,originalAppState:r,shouldChangeByStepSize:i,nextValue:a,scene:o,property:s})=>{let c=o.getNonDeletedElementsMap(),l=wG(t,r);if(a!==void 0){for(let e of l){let t=SG(e,c,n);if(t.length>1){let e=t.map(e=>e.latest),r=t.map(e=>e.original),[i,o,l,u]=bv(r),d=l-i,f=u-o,p=d/f;VG(Math.max(1,s===`width`?Math.max(0,a):d),Math.max(1,s===`height`?Math.max(0,a):f),f,p,P(i,o),s,e,r,c,n)}else{let[e]=t,r=e?.latest,o=e?.original;if(r&&o&&bG(r,s)){let e=s===`width`?Math.max(0,a):r.width;s===`width`&&(e=i?xG(e,RG):Math.round(e));let t=s===`height`?Math.max(0,a):r.height;s===`height`&&(t=i?xG(t,RG):Math.round(t)),e=Math.max(1,e),t=Math.max(1,t),VE(e,t,r,o,c,n,s===`width`?`e`:`s`,{shouldInformMutation:!1})}}}o.triggerUpdate();return}let u=s===`width`?e:0,d=s===`height`?e:0;for(let e of l){let t=SG(e,c,n);if(t.length>1){let e=t.map(e=>e.latest),r=t.map(e=>e.original),[a,o,l,f]=bv(r),p=l-a,m=f-o,h=p/m,g=Math.max(0,p+u);s===`width`&&(g=i?xG(g,RG):Math.round(g));let _=Math.max(0,m+d);s===`height`&&(_=i?xG(_,RG):Math.round(_)),g=Math.max(1,g),_=Math.max(1,_),VG(g,_,m,h,P(a,o),s,e,r,c,n)}else{let[e]=t,r=e?.latest,a=e?.original;if(r&&a&&bG(r,s)){let e=Math.max(0,a.width+u);s===`width`&&(e=i?xG(e,RG):Math.round(e));let t=Math.max(0,a.height+d);s===`height`&&(t=i?xG(t,RG):Math.round(t)),e=Math.max(1,e),t=Math.max(1,t),VE(e,t,r,a,c,n,s===`width`?`e`:`s`,{shouldInformMutation:!1})}}}o.triggerUpdate()},UG=({property:e,elements:t,elementsMap:n,atomicUnits:r,scene:i,appState:a})=>{let o=(0,u.useMemo)(()=>r.map(t=>{let r=SG(t,n);if(r.length>1){let[t,n,i,a]=bv(r.map(e=>e.latest));return Math.round((e===`width`?i-t:a-n)*100)/100}let[i]=r;return Math.round((e===`width`?i.latest.width:i.latest.height)*100)/100}),[n,r,e]),s=new Set(o).size===1?Math.round(o[0]*100)/100:`Mixed`,c=o.length>0;return(0,k.jsx)(EG,{label:e===`width`?`W`:`H`,elements:t,dragInputCallback:HG,value:s,editable:c,appState:a,property:e,scene:i})},WG=15,GG=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:r,property:i,scene:a})=>{let o=a.getNonDeletedElementsMap(),s=t.map(e=>o.get(e.id)).filter(e=>e&&!tb(e)&&bG(e,i)),c=t.filter(e=>!tb(e)&&bG(e,i));if(r!==void 0){let e=sl(r);for(let t of s){if(!t)continue;K(t,{angle:e},!1);let n=zb(t,o);n&&!bd(t)&&K(n,{angle:e},!1)}a.triggerUpdate();return}for(let t=0;t<s.length;t++){let r=s[t];if(!r)continue;let i=c[t],a=(Math.round(cl(i.angle)*100)/100+Math.round(e))%360;n&&(a=xG(a,WG)),a=a<0?a+360:a;let l=sl(a);K(r,{angle:l},!1);let u=zb(r,o);u&&!bd(r)&&K(u,{angle:l},!1)}a.triggerUpdate()},KG=({elements:e,scene:t,appState:n,property:r})=>{let i=e.filter(e=>!tb(e)&&bG(e,`angle`)),a=i.map(e=>Math.round(cl(e.angle)%360*100)/100),o=new Set(a).size===1?a[0]:`Mixed`,s=i.some(e=>bG(e,`angle`));return(0,k.jsx)(EG,{label:`A`,icon:Sm,value:o,elements:e,dragInputCallback:GG,editable:s,appState:n,scene:t,property:r})},qG=4,JG=4,YG=(e,t)=>e.reduce((e,n)=>{if(!n||tb(n))return e;if(R(n))return e.push(n),e;if(kd(n)){let r=zb(n,t);if(r)return e.push(r),e}return e},[]),XG=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:r,scene:i})=>{let a=i.getNonDeletedElementsMap(),o=t.map(e=>a.get(e.id)),s;if(r){s=Math.max(Math.round(r),qG);for(let e of o)K(e,{fontSize:s},!1),Pb(e,i.getContainerElement(e),a,!1);i.triggerUpdate()}else{let r=t;for(let t=0;t<o.length;t++){let s=o[t],c=r[t],l=Math.round(c.fontSize),u=Math.max(l+Math.round(e),qG);n&&(u=xG(u,JG)),K(s,{fontSize:u},!1),Pb(s,i.getContainerElement(s),a,!1)}i.triggerUpdate()}},ZG=({elements:e,scene:t,appState:n,property:r,elementsMap:i})=>{let a=YG(e,i);if(!a.length)return null;let o=a.map(e=>Math.round(e.fontSize*10)/10),s=new Set(o).size===1?o[0]:`Mixed`,c=o.length>0;return(0,k.jsx)(EG,{label:`F`,icon:fm,elements:a,dragInputCallback:XG,value:s,editable:c,scene:t,property:r,appState:n})},QG=10,$G=({accumulatedChange:e,instantChange:t,originalElements:n,originalElementsMap:r,shouldChangeByStepSize:i,nextValue:a,property:o,scene:s,originalAppState:c})=>{let l=s.getNonDeletedElementsMap(),u=s.getNonDeletedElements(),d=n[0],[f,p]=[d.x+d.width/2,d.y+d.height/2],[m,h]=F(P(d.x,d.y),P(f,p),d.angle);if(c.croppingElementId===d.id){let e=l.get(d.id);if(!e||!ud(e)||!e.crop)return;let n=e.crop,r=n,i=e.scale[0]===-1,s=e.scale[1]===-1,{width:c,height:u}=e_(e);if(a!==void 0){if(o===`x`){let e=a*(n.naturalWidth/c);r=i?{...n,x:el(n.naturalWidth-e-n.width,0,n.naturalWidth-n.width)}:{...n,x:el(a*(n.naturalWidth/c),0,n.naturalWidth-n.width)}}o===`y`&&(r={...n,y:el(a*(n.naturalHeight/u),0,n.naturalHeight-n.height)}),K(e,{crop:r});return}let f=(o===`x`?t:0)*(i?-1:1),p=(o===`y`?t:0)*(s?-1:1);r={...n,x:el(n.x+f,0,n.naturalWidth-n.width),y:el(n.y+p,0,n.naturalHeight-n.height)},K(e,{crop:r});return}if(a!==void 0){CG(o===`x`?a:m,o===`y`?a:h,d,l,u,s,r);return}let g=o===`x`?e:0,_=o===`y`?e:0;CG(o===`x`?Math.round(i?xG(d.x+g,QG):m+g):m,o===`y`?Math.round(i?xG(d.y+_,QG):h+_):h,d,l,u,s,r)},eK=({property:e,element:t,elementsMap:n,scene:r,appState:i})=>{let[a,o]=F(P(t.x,t.y),P(t.x+t.width/2,t.y+t.height/2),t.angle),s=tl(e===`x`?a:o,2);if(i.croppingElementId===t.id&&ud(t)&&t.crop){let n=n_(t);n&&(s=tl(e===`x`?n.x:n.y,2))}return(0,k.jsx)(EG,{label:e===`x`?`X`:`Y`,elements:[t],dragInputCallback:$G,scene:r,value:s,property:e,appState:i})},tK=10,nK=(e,t,n,r,i,a,o,s)=>{for(let c=0;c<r.length;c++){let l=i[c],[u,d]=[l.x+l.width/2,l.y+l.height/2],[f,p]=F(P(l.x,l.y),P(u,d),l.angle);CG(e===`x`?Math.round(f+t):f,e===`y`?Math.round(p+n):p,l,a,r,s,o,!1)}},rK=(e,t,n,r,i,a,o)=>{let[s,c,,]=bv(n),l=e-s,u=t-c;for(let e=0;e<n.length;e++){let t=n[e],s=r.get(t.id);if(s&&(!R(s)||!s.containerId)){let[e,n]=[s.x+s.width/2,s.y+s.height/2],[c,d]=F(P(s.x,s.y),P(e,n),s.angle);CG(c+l,d+u,t,r,i,o,a,!1)}}},iK=({accumulatedChange:e,originalElements:t,originalElementsMap:n,shouldChangeByStepSize:r,nextValue:i,property:a,scene:o,originalAppState:s})=>{let c=o.getNonDeletedElementsMap(),l=o.getNonDeletedElements();if(i!==void 0){for(let e of wG(t,s)){let t=SG(e,c,n);if(t.length>1){let[e,r,,]=bv(t.map(e=>e.latest));rK(a===`x`?i:e,a===`y`?i:r,t.map(e=>e.original),c,l,n,o)}else{let e=t[0]?.original,r=t[0]?.latest;if(e&&r&&bG(r,a)){let[t,r]=[e.x+e.width/2,e.y+e.height/2],[s,u]=F(P(e.x,e.y),P(t,r),e.angle);CG(a===`x`?i:s,a===`y`?i:u,e,c,l,o,n,!1)}}}o.triggerUpdate();return}let u=r?xG(e,tK):e;nK(a,a===`x`?u:0,a===`y`?u:0,t,t,c,n,o),o.triggerUpdate()},aK=({property:e,elements:t,elementsMap:n,atomicUnits:r,scene:i,appState:a})=>{let o=(0,u.useMemo)(()=>r.map(t=>{let r=Object.keys(t).map(e=>n.get(e)).filter(e=>e!==void 0);if(r.length>1){let[t,n]=bv(r);return Math.round((e===`x`?t:n)*100)/100}let[i]=r,[a,o]=[i.x+i.width/2,i.y+i.height/2],[s,c]=F(P(i.x,i.y),P(a,o),i.angle);return Math.round((e===`x`?s:c)*100)/100}),[r,n,e]),s=new Set(o).size===1?o[0]:`Mixed`;return(0,k.jsx)(EG,{label:e===`x`?`X`:`Y`,elements:t,dragInputCallback:iK,value:s,property:e,scene:i,appState:a})},oK=5,sK=({property:e,scene:t,appState:n,setAppState:r})=>(0,k.jsx)(EG,{label:`Grid step`,sensitivity:8,elements:[],dragInputCallback:({nextValue:e,instantChange:t,shouldChangeByStepSize:n,setInputValue:i})=>{r(r=>{let a;return e?a=e:t&&(a=n?xG(r.gridStep+oK*Math.sign(t),oK):r.gridStep+t),a?(a=Ry(a),i(a),{gridStep:a}):(i(r.gridStep),null)})},scene:t,value:n.gridStep,property:e,appState:n}),cK=50,lK=e=>{let t=Zq(),n=e.app.scene.getSceneNonce()||1,r=e.app.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1}),i=sb(e.app);return(0,k.jsx)(fK,{...e,appState:t,sceneNonce:n,selectedElements:r,gridModeEnabled:i})},uK=({children:e,columns:t=1,heading:n,style:r,...i})=>(0,k.jsx)(`div`,{className:O(`exc-stats__row`,{"exc-stats__row--heading":n}),style:{gridTemplateColumns:`repeat(${t}, 1fr)`,...r},...i,children:e});uK.displayName=`StatsRow`;var dK=({children:e,order:t,style:n,...r})=>(0,k.jsx)(`div`,{className:`exc-stats__rows`,style:{order:t,...n},...r,children:e});dK.displayName=`StatsRows`,lK.StatsRow=uK,lK.StatsRows=dK;var fK=(0,u.memo)(({app:e,onClose:t,renderCustomStats:n,selectedElements:r,appState:i,sceneNonce:a,gridModeEnabled:o})=>{let s=e.scene,c=s.getNonDeletedElements(),l=s.getNonDeletedElementsMap(),d=Qq(),f=r.length===1?r[0]:null,p=r.length>1?r:null,m=i.croppingElementId&&ud(f),h=m?e_(f):null,[g,_]=(0,u.useState)({width:0,height:0}),v=(0,u.useMemo)(()=>(0,qi.default)(e=>{let t=bv(e);_({width:Math.round(t[2])-Math.round(t[0]),height:Math.round(t[3])-Math.round(t[1])})},cK),[]);(0,u.useEffect)(()=>{v(c)},[a,c,v]),(0,u.useEffect)(()=>()=>v.cancel(),[v]);let y=(0,u.useMemo)(()=>wG(r,i),[r,i]),b=(0,u.useMemo)(()=>UT(r),[r]);return(0,k.jsx)(`div`,{className:`exc-stats`,children:(0,k.jsxs)(gR,{padding:3,children:[(0,k.jsxs)(`div`,{className:`title`,children:[(0,k.jsx)(`h2`,{children:q(`stats.title`)}),(0,k.jsx)(`div`,{className:`close`,onClick:t,children:Np})]}),(0,k.jsxs)(wR,{label:(0,k.jsx)(`h3`,{children:q(`stats.generalStats`)}),open:!!(i.stats.panels&Bc.generalStats),openTrigger:()=>d(e=>({stats:{open:!0,panels:e.stats.panels^Bc.generalStats}})),children:[(0,k.jsxs)(dK,{children:[(0,k.jsx)(uK,{heading:!0,children:q(`stats.scene`)}),(0,k.jsxs)(uK,{columns:2,children:[(0,k.jsx)(`div`,{children:q(`stats.shapes`)}),(0,k.jsx)(`div`,{children:c.length})]}),(0,k.jsxs)(uK,{columns:2,children:[(0,k.jsx)(`div`,{children:q(`stats.width`)}),(0,k.jsx)(`div`,{children:g.width})]}),(0,k.jsxs)(uK,{columns:2,children:[(0,k.jsx)(`div`,{children:q(`stats.height`)}),(0,k.jsx)(`div`,{children:g.height})]}),o&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(uK,{heading:!0,children:`Canvas`}),(0,k.jsx)(uK,{children:(0,k.jsx)(sK,{property:`gridStep`,scene:s,appState:i,setAppState:d})})]})]}),n?.(c,i)]}),!b&&r.length>0&&(0,k.jsx)(`div`,{id:`elementStats`,style:{marginTop:12},children:(0,k.jsx)(wR,{label:(0,k.jsx)(`h3`,{children:q(`stats.elementProperties`)}),open:!!(i.stats.panels&Bc.elementProperties),openTrigger:()=>d(e=>({stats:{open:!0,panels:e.stats.panels^Bc.elementProperties}})),children:(0,k.jsxs)(dK,{children:[f&&(0,k.jsxs)(k.Fragment,{children:[m&&(0,k.jsx)(uK,{heading:!0,children:q(`labels.unCroppedDimension`)}),i.croppingElementId&&ud(f)&&h&&(0,k.jsxs)(uK,{columns:2,children:[(0,k.jsx)(`div`,{children:q(`stats.width`)}),(0,k.jsx)(`div`,{children:tl(h.width,2)})]}),i.croppingElementId&&ud(f)&&h&&(0,k.jsxs)(uK,{columns:2,children:[(0,k.jsx)(`div`,{children:q(`stats.height`)}),(0,k.jsx)(`div`,{children:tl(h.height,2)})]}),(0,k.jsx)(uK,{heading:!0,"data-testid":`stats-element-type`,children:i.croppingElementId?q(`labels.imageCropping`):q(`element.${f.type}`)}),(0,k.jsx)(uK,{children:(0,k.jsx)(eK,{element:f,property:`x`,elementsMap:l,scene:s,appState:i})}),(0,k.jsx)(uK,{children:(0,k.jsx)(eK,{element:f,property:`y`,elementsMap:l,scene:s,appState:i})}),(0,k.jsx)(uK,{children:(0,k.jsx)(AG,{property:`width`,element:f,scene:s,appState:i})}),(0,k.jsx)(uK,{children:(0,k.jsx)(AG,{property:`height`,element:f,scene:s,appState:i})}),!z(f)&&(0,k.jsx)(uK,{children:(0,k.jsx)(NG,{property:`angle`,element:f,scene:s,appState:i})}),(0,k.jsx)(uK,{children:(0,k.jsx)(LG,{property:`fontSize`,element:f,scene:s,appState:i})})]}),p&&(0,k.jsxs)(k.Fragment,{children:[eb(p)&&(0,k.jsx)(uK,{heading:!0,children:q(`element.group`)}),(0,k.jsxs)(uK,{columns:2,style:{margin:`0.3125rem 0`},children:[(0,k.jsx)(`div`,{children:q(`stats.shapes`)}),(0,k.jsx)(`div`,{children:r.length})]}),(0,k.jsx)(uK,{children:(0,k.jsx)(aK,{property:`x`,elements:p,elementsMap:l,atomicUnits:y,scene:s,appState:i})}),(0,k.jsx)(uK,{children:(0,k.jsx)(aK,{property:`y`,elements:p,elementsMap:l,atomicUnits:y,scene:s,appState:i})}),(0,k.jsx)(uK,{children:(0,k.jsx)(UG,{property:`width`,elements:p,elementsMap:l,atomicUnits:y,scene:s,appState:i})}),(0,k.jsx)(uK,{children:(0,k.jsx)(UG,{property:`height`,elements:p,elementsMap:l,atomicUnits:y,scene:s,appState:i})}),(0,k.jsx)(uK,{children:(0,k.jsx)(KG,{property:`angle`,elements:p,scene:s,appState:i})}),(0,k.jsx)(uK,{children:(0,k.jsx)(ZG,{property:`fontSize`,elements:p,scene:s,appState:i,elementsMap:l})})]})]})})})]})})},(e,t)=>e.sceneNonce===t.sceneNonce&&e.selectedElements===t.selectedElements&&e.appState.stats.panels===t.appState.stats.panels&&e.gridModeEnabled===t.gridModeEnabled&&e.appState.gridStep===t.appState.gridStep&&e.appState.croppingElementId===t.appState.croppingElementId),pK=({sourceElementId:e,onClose:t,elementsMap:n,appState:r,generateLinkForSelection:i=$S})=>{let a=n.get(e)?.link??null,[o,s]=(0,u.useState)(a),[c,l]=(0,u.useState)(!1);(0,u.useEffect)(()=>{let e=YT(n,r),t=a;if(e.length>0&&i){let n=eC(e,r);n&&(t=Qb(i(n.id,n.type)))}s(t)},[n,r,r.selectedElementIds,a,i]);let d=(0,u.useCallback)(()=>{if(o&&o!==n.get(e)?.link){let t=n.get(e);t&&K(t,{link:o})}if(!o&&c&&e){let t=n.get(e);t&&K(t,{link:null})}t?.()},[e,o,n,c,t]);return(0,u.useEffect)(()=>{let e=e=>{r.openDialog?.name===`elementLinkSelector`&&e.key===H.ENTER&&d(),r.openDialog?.name===`elementLinkSelector`&&e.key===H.ESCAPE&&t?.()};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[r,t,d]),(0,k.jsxs)(`div`,{className:`ElementLinkDialog`,children:[(0,k.jsxs)(`div`,{className:`ElementLinkDialog__header`,children:[(0,k.jsx)(`h2`,{children:q(`elementLink.title`)}),(0,k.jsx)(`p`,{children:q(`elementLink.desc`)})]}),(0,k.jsxs)(`div`,{className:`ElementLinkDialog__input`,children:[(0,k.jsx)(ZV,{value:o??``,onChange:e=>{c||l(!0),s(e)},onKeyDown:e=>{e.key===H.ENTER&&d()},className:`ElementLinkDialog__input-field`,selectOnRender:!0}),a&&o&&(0,k.jsx)(fL,{type:`button`,title:q(`buttons.remove`),"aria-label":q(`buttons.remove`),label:q(`buttons.remove`),onClick:()=>{s(null),l(!0)},className:`ElementLinkDialog__remove`,icon:Kf})]}),(0,k.jsxs)(`div`,{className:`ElementLinkDialog__actions`,children:[(0,k.jsx)(lV,{label:q(`buttons.cancel`),onClick:()=>{t?.()},style:{marginRight:10}}),(0,k.jsx)(lV,{label:q(`buttons.confirm`),onClick:d,actionType:`primary`})]})]})},mK=({UIOptions:e})=>(0,k.jsxs)(kW,{__fallback:!0,children:[(0,k.jsx)(kW.DefaultItems.LoadScene,{}),(0,k.jsx)(kW.DefaultItems.SaveToActiveFile,{}),e.canvasActions.export&&(0,k.jsx)(kW.DefaultItems.Export,{}),e.canvasActions.saveAsImage&&(0,k.jsx)(kW.DefaultItems.SaveAsImage,{}),(0,k.jsx)(kW.DefaultItems.SearchMenu,{}),(0,k.jsx)(kW.DefaultItems.Help,{}),(0,k.jsx)(kW.DefaultItems.ClearCanvas,{}),(0,k.jsx)(kW.Separator,{}),(0,k.jsx)(kW.Group,{title:`Excalidraw links`,children:(0,k.jsx)(kW.DefaultItems.Socials,{})}),(0,k.jsx)(kW.Separator,{}),(0,k.jsx)(kW.DefaultItems.ToggleTheme,{}),(0,k.jsx)(kW.DefaultItems.ChangeCanvasBackground,{})]}),hK=()=>(0,k.jsxs)(MW,{__fallback:!0,children:[(0,k.jsx)(MW.Actions.SaveToDisk,{}),(0,k.jsx)(MW.Actions.ExportToImage,{})]}),gK=({actionManager:e,appState:t,files:n,setAppState:r,elements:i,canvas:a,onLockToggle:o,onHandToolToggle:s,onPenModeToggle:c,showExitZenModeBtn:l,renderTopRightUI:u,renderCustomStats:d,UIOptions:f,onExportImage:p,renderWelcomeScreen:m,children:h,app:g,isCollaborating:_,generateLinkForSelection:v})=>{let y=Jq(),b=sH(),x=b.tunnelsJotai.Provider,[S,C]=GI(pR),w=()=>f.canvasActions.export?(0,k.jsx)(ZU,{elements:i,appState:t,files:n,actionManager:e,exportOpts:f.canvasActions.export,canvas:a,setAppState:r}):null,T=()=>!f.canvasActions.saveAsImage||t.openDialog?.name!==`imageExport`?null:(0,k.jsx)(iU,{elements:i,appState:t,files:n,actionManager:e,onExportImage:p,onCloseRequest:()=>r({openDialog:null}),name:g.getName()}),E=()=>(0,k.jsxs)(`div`,{style:{position:`relative`},children:[(0,k.jsx)(b.MainMenuTunnel.Out,{}),m&&(0,k.jsx)(b.WelcomeScreenMenuHintTunnel.Out,{})]}),D=()=>(0,k.jsx)(wU,{heading:`selectedShapeActions`,className:O(`selected-shape-actions zen-mode-transition`,{"transition-left":t.zenModeEnabled}),children:(0,k.jsx)(gR,{className:Ks.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:`${t.height-166}px`},children:(0,k.jsx)(uH,{appState:t,elementsMap:g.scene.getNonDeletedElementsMap(),renderAction:e.renderAction,app:g})})}),ee=()=>{let n=XE(t,i),r=t.stats.open&&!t.zenModeEnabled&&!t.viewModeEnabled&&t.openDialog?.name!==`elementLinkSelector`;return(0,k.jsx)(aU,{side:`top`,children:(0,k.jsxs)(`div`,{className:`App-menu App-menu_top`,children:[(0,k.jsxs)(eV.Col,{gap:6,className:O(`App-menu_top__left`),children:[E(),n&&D()]}),!t.viewModeEnabled&&t.openDialog?.name!==`elementLinkSelector`&&(0,k.jsx)(wU,{heading:`shapes`,className:`shapes-section`,children:e=>(0,k.jsxs)(`div`,{style:{position:`relative`},children:[m&&(0,k.jsx)(b.WelcomeScreenToolbarHintTunnel.Out,{}),(0,k.jsx)(eV.Col,{gap:4,align:`start`,children:(0,k.jsxs)(eV.Row,{gap:1,className:O(`App-toolbar-container`,{"zen-mode":t.zenModeEnabled}),children:[(0,k.jsxs)(gR,{padding:1,className:O(`App-toolbar`,{"zen-mode":t.zenModeEnabled}),children:[(0,k.jsx)(bU,{appState:t,isMobile:y.editor.isMobile,device:y,app:g}),e,(0,k.jsxs)(eV.Row,{gap:1,children:[(0,k.jsx)(jU,{zenModeEnabled:t.zenModeEnabled,checked:t.penMode,onChange:()=>c(null),title:q(`toolBar.penMode`),penDetected:t.penDetected}),(0,k.jsx)(CU,{checked:t.activeTool.locked,onChange:o,title:q(`toolBar.lock`)}),(0,k.jsx)(`div`,{className:`App-toolbar__divider`}),(0,k.jsx)(MU,{checked:$c(t),onChange:()=>s(),title:q(`toolBar.hand`),isMobile:!0}),(0,k.jsx)(dH,{appState:t,activeTool:t.activeTool,UIOptions:f,app:g})]})]}),_&&(0,k.jsx)(gR,{style:{marginLeft:8,alignSelf:`center`,height:`fit-content`},children:(0,k.jsx)(JW,{title:q(`toolBar.laser`),checked:t.activeTool.type===Rc.laser,onChange:()=>g.setActiveTool({type:Rc.laser}),isMobile:!0})})]})})]})}),(0,k.jsxs)(`div`,{className:O(`layer-ui__wrapper__top-right zen-mode-transition`,{"transition-right":t.zenModeEnabled}),children:[t.collaborators.size>0&&(0,k.jsx)(JU,{collaborators:t.collaborators,userToFollow:t.userToFollow?.socketId||null}),u?.(y.editor.isMobile,t),!t.viewModeEnabled&&t.openDialog?.name!==`elementLinkSelector`&&(!ne||t.openSidebar?.name!==Ic.name)&&(0,k.jsx)(b.DefaultSidebarTriggerTunnel.Out,{}),r&&(0,k.jsx)(lK,{app:g,onClose:()=>{e.executeAction(pB)},renderCustomStats:d})]})]})})},te=()=>(0,k.jsx)(KW,{__fallback:!0,onDock:e=>{VL(`sidebar`,`toggleDock (${e?`dock`:`undock`})`,`(${y.editor.isMobile?`mobile`:`desktop`})`)}}),ne=qI(cW),re=(0,k.jsxs)(k.Fragment,{children:[h,(0,k.jsx)(mK,{UIOptions:f}),(0,k.jsx)(KW.Trigger,{__fallback:!0,icon:Ef,title:nu(q(`toolBar.library`)),onToggle:e=>{e&&VL(`sidebar`,`${Ic.name} (open)`,`button (${y.editor.isMobile?`mobile`:`desktop`})`)},tab:Ic.defaultTab,children:q(`toolBar.library`)}),(0,k.jsx)(hK,{}),t.openDialog?.name===`ttd`&&(0,k.jsx)(_G,{__fallback:!0}),t.isLoading&&(0,k.jsx)(uL,{delay:250}),t.errorMessage&&(0,k.jsx)(JH,{onClose:()=>r({errorMessage:null}),children:t.errorMessage}),S&&!y.editor.isMobile&&(0,k.jsx)(mR,{colorPickerType:S.colorPickerType,onCancel:()=>{C(null)},onChange:(e,t,n,{altKey:i})=>{if(e===`elementBackground`||e===`elementStroke`){if(n.length){for(let r of n)K(r,{[i&&S.swapPreviewOnAlt?e===`elementBackground`?`strokeColor`:`backgroundColor`:e===`elementBackground`?`backgroundColor`:`strokeColor`]:t},!1),Sf.delete(r);rE.getScene(n[0])?.triggerUpdate()}else r(e===`elementBackground`?{currentItemBackgroundColor:t}:{currentItemStrokeColor:t})}},onSelect:(e,t)=>{C(e=>e?.keepOpenOnAlt&&t.altKey?e:null),S?.onSelect?.(e,t)}}),t.openDialog?.name===`help`&&(0,k.jsx)(HU,{onClose:()=>{r({openDialog:null})}}),(0,k.jsx)(vH,{}),t.openDialog?.name===`elementLinkSelector`&&(0,k.jsx)(pK,{sourceElementId:t.openDialog.sourceElementId,onClose:()=>{r({openDialog:null})},elementsMap:g.scene.getNonDeletedElementsMap(),appState:t,generateLinkForSelection:v}),(0,k.jsx)(b.OverwriteConfirmDialogTunnel.Out,{}),T(),w(),t.pasteDialog.shown&&(0,k.jsx)(FU,{setAppState:r,appState:t,onClose:()=>r({pasteDialog:{shown:!1,data:null}})}),y.editor.isMobile&&(0,k.jsx)(NU,{app:g,appState:t,elements:i,actionManager:e,renderJSONExportDialog:w,renderImageExportDialog:T,setAppState:r,onLockToggle:o,onHandToolToggle:s,onPenModeToggle:c,renderTopRightUI:u,renderCustomStats:d,renderSidebars:te,device:y,renderWelcomeScreen:m,UIOptions:f}),!y.editor.isMobile&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`layer-ui__wrapper`,style:t.openSidebar&&ne&&y.editor.canFitSidebar?{width:`calc(100% - var(--right-sidebar-width))`}:{},children:[m&&(0,k.jsx)(b.WelcomeScreenCenterTunnel.Out,{}),ee(),(0,k.jsx)(eW,{appState:t,actionManager:e,showExitZenModeBtn:l,renderWelcomeScreen:m}),t.scrolledOutside&&(0,k.jsx)(`button`,{type:`button`,className:`scroll-back-to-content`,onClick:()=>{r(e=>({...Fy(i,e)}))},children:q(`buttons.scrollBackToContent`)})]}),te()]})]});return(0,k.jsx)(cR.Provider,{value:t,children:(0,k.jsx)(x,{children:(0,k.jsx)(iH.Provider,{value:b,children:re})})})},_K=e=>{let{suggestedBindings:t,startBoundElement:n,cursorButton:r,scrollX:i,scrollY:a,...o}=e;return o},vK=u.memo(gK,(e,t)=>{if(e.children!==t.children)return!1;let{canvas:n,appState:r,...i}=e,{canvas:a,appState:o,...s}=t;return Ku(_K(r),_K(o),{selectedElementIds:Ku,selectedGroupIds:Ku})&&Ku(i,s)}),yK=5e3,bK=({message:e,onClose:t,closable:n=!1,duration:r=yK,style:i})=>{let a=(0,u.useRef)(0),o=r!==1/0,s=(0,u.useCallback)(()=>{o&&(a.current=window.setTimeout(()=>t(),r))},[t,r,o]);return(0,u.useEffect)(()=>{if(o)return s(),()=>clearTimeout(a.current)},[s,e,r,o]),(0,k.jsxs)(`div`,{className:`Toast`,onMouseEnter:o?()=>clearTimeout(a?.current):void 0,onMouseLeave:o?s:void 0,style:i,children:[(0,k.jsx)(`p`,{className:`Toast__message`,children:e}),n&&(0,k.jsx)(fL,{icon:Np,"aria-label":`close`,type:`icon`,onClick:t,className:`close`})]})},xK=W({name:`viewMode`,label:`labels.viewMode`,paletteName:`Toggle view mode`,icon:zm,viewMode:!0,trackEvent:{category:`canvas`,predicate:e=>!e.viewModeEnabled},perform(e,t){return{appState:{...t,viewModeEnabled:!this.checked(t)},captureUpdate:G.EVENTUALLY}},checked:e=>e.viewModeEnabled,predicate:(e,t,n)=>typeof n.viewModeEnabled>`u`,keyTest:e=>!e[H.CTRL_OR_CMD]&&e.altKey&&e.code===kg.R}),SK=(e,t)=>{let n=t.scene.getSelectedElements(e);return n.length===1&&gd(n[0])},CK=W({name:`selectAllElementsInFrame`,label:`labels.selectAllElementsInFrame`,trackEvent:{category:`canvas`},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t).at(0)||null;if(gd(i)){let n=wT(eD(e),i.id).filter(e=>!(e.type===`text`&&e.containerId));return{elements:e,appState:{...t,selectedElementIds:n.reduce((e,t)=>(e[t.id]=!0,e),{})},captureUpdate:G.IMMEDIATELY}}return{elements:e,appState:t,captureUpdate:G.EVENTUALLY}},predicate:(e,t,n,r)=>SK(t,r)}),wK=W({name:`removeAllElementsFromFrame`,label:`labels.removeAllElementsFromFrame`,trackEvent:{category:`history`},perform:(e,t,n,r)=>{let i=r.scene.getSelectedElements(t).at(0)||null;return gd(i)?{elements:PT(e,i),appState:{...t,selectedElementIds:{[i.id]:!0}},captureUpdate:G.IMMEDIATELY}:{elements:e,appState:t,captureUpdate:G.EVENTUALLY}},predicate:(e,t,n,r)=>SK(t,r)});W({name:`updateFrameRendering`,label:`labels.updateFrameRendering`,viewMode:!0,trackEvent:{category:`canvas`},perform:(e,t)=>({elements:e,appState:{...t,frameRendering:{...t.frameRendering,enabled:!t.frameRendering.enabled}},captureUpdate:G.EVENTUALLY}),checked:e=>e.frameRendering.enabled}),W({name:`setFrameAsActiveTool`,label:`toolBar.frame`,trackEvent:{category:`toolbar`},icon:Nm,viewMode:!1,perform:(e,t,n,r)=>{let i=gu(t,{type:`frame`});return fx(r.interactiveCanvas,{...t,activeTool:i}),{elements:e,appState:{...t,activeTool:gu(t,{type:`frame`})},captureUpdate:G.EVENTUALLY}},keyTest:e=>!e[H.CTRL_OR_CMD]&&!e.shiftKey&&!e.altKey&&e.key.toLocaleLowerCase()===H.F});var TK=W({name:`wrapSelectionInFrame`,label:`labels.wrapSelectionInFrame`,trackEvent:{category:`element`},predicate:(e,t,n,r)=>{let i=YT(e,t);return i.length>0&&!i.some(e=>gd(e))},perform:(e,t,n,r)=>{let i=YT(e,t),[a,o,s,c]=bv(i,r.scene.getNonDeletedElementsMap()),l=xx({x:a-16,y:o-16,width:s-a+32,height:c-o+32});if(t.editingGroupId){let e=qy(i,t.editingGroupId);for(let n of e){let e=n.groupIds.indexOf(t.editingGroupId);K(n,{groupIds:n.groupIds.slice(0,e)},!1)}}return{elements:MT([...r.scene.getElementsIncludingDeleted(),l],i,l,t),appState:{selectedElementIds:{[l.id]:!0}},captureUpdate:G.IMMEDIATELY}}}),EK=()=>(0,k.jsxs)(`div`,{"data-testid":`brave-measure-text-error`,children:[(0,k.jsx)(`p`,{children:(0,k.jsx)(cV,{i18nKey:`errors.brave_measure_text_error.line1`,bold:e=>(0,k.jsx)(`span`,{style:{fontWeight:600},children:e})})}),(0,k.jsx)(`p`,{children:(0,k.jsx)(cV,{i18nKey:`errors.brave_measure_text_error.line2`,bold:e=>(0,k.jsx)(`span`,{style:{fontWeight:600},children:e})})}),(0,k.jsx)(`p`,{children:(0,k.jsx)(cV,{i18nKey:`errors.brave_measure_text_error.line3`,link:e=>(0,k.jsx)(`a`,{href:`http://docs.excalidraw.com/docs/@excalidraw/excalidraw/faq#turning-off-aggresive-block-fingerprinting-in-brave-browser`,children:e})})}),(0,k.jsx)(`p`,{children:(0,k.jsx)(cV,{i18nKey:`errors.brave_measure_text_error.line4`,issueLink:e=>(0,k.jsx)(`a`,{href:`https://github.com/excalidraw/excalidraw/issues/new`,children:e}),discordLink:e=>(0,k.jsxs)(`a`,{href:`https://discord.gg/UexuTaE`,children:[e,`.`]})})})]}),DK={width:100,height:0},OK=100,kK=(e,t,n)=>{let r=wx({x:0,y:0,textAlign:Dc.CENTER,verticalAlign:Ec.MIDDLE,...t,containerId:e.id,strokeColor:t.strokeColor||e.strokeColor});return Object.assign(e,{boundElements:(e.boundElements||[]).concat({type:`text`,id:r.id})}),Pb(r,e,n),[e,r]},AK=(e,t,n,r,i)=>{let a,o;if(Object.assign(e,{startBinding:e?.startBinding||null,endBinding:e.endBinding||null}),t){let n=t?.width??OK,o=t?.height??OK,s;t.id&&(s=r.getElement(t.id),s||console.error(`No element for start binding with id ${t.id} found`));let c=t.x||e.x-n,l=t.y||e.y-o/2,u=s?s.type:t.type;if(u){if(u===`text`){let n=``;s&&s.type===`text`?n=s.text:t.type===`text`&&(n=t.text),n||console.error(`No text found for start binding text element for ${e.id}`),a=wx({x:c,y:l,type:`text`,...s,...t,text:n}),Object.assign(a,{x:t.x||e.x-a.width,y:t.y||e.y-a.height/2})}else switch(u){case`rectangle`:case`ellipse`:case`diamond`:a=vx({x:c,y:l,width:n,height:o,...s,...t,type:u});break;default:Ju(e,`Unhandled element start type "${t.type}"`,!0)}qv(e,a,`start`,i)}}if(n){let t=n?.height??OK,a=n?.width??OK,s;n.id&&(s=r.getElement(n.id),s||console.error(`No element for end binding with id ${n.id} found`));let c=n.x||e.x+e.width,l=n.y||e.y-t/2,u=s?s.type:n.type;if(u){if(u===`text`){let t=``;s&&s.type===`text`?t=s.text:n.type===`text`&&(t=n.text),t||console.error(`No text found for end binding text element for ${e.id}`),o=wx({x:c,y:l,type:`text`,...s,...n,text:t}),Object.assign(o,{y:n.y||e.y-o.height/2})}else switch(u){case`rectangle`:case`ellipse`:case`diamond`:o=vx({x:c,y:l,width:a,height:t,...s,...n,type:u});break;default:Ju(e,`Unhandled element end type "${u}"`,!0)}qv(e,o,`end`,i)}}if(e.points.length<2)return{linearElement:e,startBoundElement:a,endBoundElement:o};let s=e.points.length-1,c=.5,l=Qu(e.points);return e.points[s][0]>e.points[s-1][0]&&(l[0][0]=c,l[s][0]-=c),e.points[s][0]<e.points[s-1][0]&&(l[0][0]=-.5,l[s][0]+=c),e.points[s][1]>e.points[s-1][1]&&(l[0][1]=c,l[s][1]-=c),e.points[s][1]<e.points[s-1][1]&&(l[0][1]=-.5,l[s][1]+=c),Object.assign(e,{points:l}),{linearElement:e,startBoundElement:a,endBoundElement:o}},jK=class{constructor(){v(this,`excalidrawElements`,new Map),v(this,`add`,e=>{e&&this.excalidrawElements.set(e.id,e)}),v(this,`getElements`,()=>Vx(Array.from(this.excalidrawElements.values()))),v(this,`getElementsMap`,()=>rd(Nu(this.getElements()))),v(this,`getElement`,e=>this.excalidrawElements.get(e))}},MK=(e,t)=>{if(!e)return[];let n=Qu(e),r=new jK,i=new Map,a=new Map;for(let e of n){let n,o=e.id;switch(t?.regenerateIds!==!1&&Object.assign(e,{id:gx()}),e.type){case`rectangle`:case`ellipse`:case`diamond`:{let t=e?.label?.text&&e.width===void 0?0:e?.width||OK,r=e?.label?.text&&e.height===void 0?0:e?.height||OK;n=vx({...e,width:t,height:r});break}case`line`:{let t=e.width||DK.width,r=e.height||DK.height;n=kx({width:t,height:r,points:[P(0,0),P(t,r)],...e});break}case`arrow`:{let t=e.width||DK.width,r=e.height||DK.height;n=Ax({width:t,height:r,endArrowhead:`arrow`,points:[P(0,0),P(t,r)],...e,type:`arrow`}),Object.assign(n,tv(n.points));break}case`text`:{let t=e?.fontFamily||tc,r=e?.fontSize||20,i=e?.lineHeight||Xh(t),a=Id(Vd(e.text??``),cu({fontFamily:t,fontSize:r}),i);n=wx({width:a.width,height:a.height,fontFamily:t,fontSize:r,...e});break}case`image`:n=jx({width:e?.width||OK,height:e?.height||OK,...e});break;case`frame`:n=xx({x:0,y:0,...e});break;case`magicframe`:n=Sx({x:0,y:0,...e});break;case`freedraw`:case`iframe`:case`embeddable`:n=e;break;default:n=e,Ju(e,`Unhandled element type "${e.type}"`,!0)}r.getElement(n.id)?console.error(`Duplicate id found for ${n.id}`):(r.add(n),i.set(n.id,e),o&&a.set(o,n.id))}let o=r.getElementsMap();for(let[e,t]of i){let n=r.getElement(e);switch(t.type){case`rectangle`:case`ellipse`:case`diamond`:case`arrow`:if(t.label?.text){let[e,i]=kK(n,t?.label,o);if(r.add(e),r.add(i),bd(e)){let n=t.type===`arrow`?t?.start:void 0,i=t.type===`arrow`?t?.end:void 0;if(n&&n.id){let e=a.get(n.id);e&&Object.assign(n,{id:e})}if(i&&i.id){let e=a.get(i.id);e&&Object.assign(i,{id:e})}let{linearElement:s,startBoundElement:c,endBoundElement:l}=AK(e,n,i,r,o);e=s,r.add(s),r.add(c),r.add(l)}}else switch(t.type){case`arrow`:{let{start:e,end:i}=t;if(e&&e.id){let t=a.get(e.id);Object.assign(e,{id:t})}if(i&&i.id){let e=a.get(i.id);Object.assign(i,{id:e})}let{linearElement:s,startBoundElement:c,endBoundElement:l}=AK(n,e,i,r,o);r.add(s),r.add(c),r.add(l);break}}}}for(let[e,t]of i){if(t.type!==`frame`&&t.type!==`magicframe`)continue;let n=r.getElement(e);if(!n)throw Error(`Excalidraw element with id ${e} doesn't exist`);let i=[];t.children.forEach(e=>{let t=a.get(e);if(!t)throw Error(`Element with ${e} wasn't mapped correctly`);let o=r.getElement(t);if(!o)throw Error(`Frame element with id ${t} doesn't exist`);Object.assign(o,{frameId:n.id}),o?.boundElements?.forEach(e=>{let t=r.getElement(e.id);if(!t)throw Error(`Bound element with id ${e.id} doesn't exist`);Object.assign(t,{frameId:n.id}),i.push(t)}),i.push(o)});let[o,s,c,l]=bv(i);o-=10,s-=10,c+=10,l+=10;let u=n?.x||o,d=n?.y||s,f=n?.width||c-o,p=n?.height||l-s;Object.assign(n,{x:u,y:d,width:f,height:p}),Ru()&&t.children.length&&(n?.x||n?.y||n?.width||n?.height)&&console.info(`User provided frame attributes are being considered, if you find this inaccurate, please remove any of the attributes - x, y, width and height so frame coordinates and dimensions are calculated automatically`)}return r.getElements()},NK=e=>t=>{(0,mk.unstable_batchedUpdates)(e,t)},PK=e=>uu(t=>{(0,mk.unstable_batchedUpdates)(e,t)}),FK=(()=>{let e;try{let t=u.version.split(`.`);e=Number(t[0])>17}catch{e=!1}let t=!1;return()=>window.EXCALIDRAW_THROTTLE_RENDER===!0?e?!0:(t||(t=!0,console.warn(`Excalidraw: render throttling is disabled on React versions < 18.`)),!1):!1})(),IK=`#ff6b6b`,LK=`#ff0000`,RK=1,zK=2,BK=(e,t)=>{if(!t.snapLines.length)return;let n=t.theme===Qs.LIGHT||t.zenModeEnabled?IK:LK,r=(t.zenModeEnabled?RK*1.5:RK)/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY);for(let i of t.snapLines)i.type===`pointer`?(e.lineWidth=r,e.strokeStyle=n,HK(i,e,t)):i.type===`gap`?(e.lineWidth=r,e.strokeStyle=n,GK(i.points[0],i.points[1],i.direction,t,e)):i.type===`points`&&(e.lineWidth=r,e.strokeStyle=n,VK(i,e,t));e.restore()},VK=(e,t,n)=>{if(!n.zenModeEnabled){let n=e.points[0],r=e.points[e.points.length-1];WK(n,r,t)}for(let r of e.points)UK(r,n,t)},HK=(e,t,n)=>{UK(e.points[0],n,t),n.zenModeEnabled||WK(e.points[0],e.points[1],t)},UK=([e,t],n,r)=>{r.save();let i=(n.zenModeEnabled?zK*1.5:zK)/n.zoom.value;r.beginPath(),r.moveTo(e-i,t-i),r.lineTo(e+i,t+i),r.moveTo(e+i,t-i),r.lineTo(e-i,t+i),r.stroke(),r.restore()},WK=(e,t,n)=>{n.beginPath(),n.lineTo(e[0],e[1]),n.lineTo(t[0],t[1]),n.stroke()},GK=(e,t,n,r,i)=>{let a=8/r.zoom.value,o=a/2,s=a/4;if(n===`horizontal`){let n=[(e[0]+t[0])/2,e[1]];r.zenModeEnabled||WK(P(e[0],e[1]-a),P(e[0],e[1]+a),i),WK(P(n[0]-s,n[1]-o),P(n[0]-s,n[1]+o),i),WK(P(n[0]+s,n[1]-o),P(n[0]+s,n[1]+o),i),r.zenModeEnabled||(WK(P(t[0],t[1]-a),P(t[0],t[1]+a),i),WK(e,t,i))}else{let n=[e[0],(e[1]+t[1])/2];r.zenModeEnabled||WK(P(e[0]-a,e[1]),P(e[0]+a,e[1]),i),WK(P(n[0]-o,n[1]-s),P(n[0]+o,n[1]-s),i),WK(P(n[0]-o,n[1]+s),P(n[0]+o,n[1]+s),i),r.zenModeEnabled||(WK(P(t[0]-a,t[1]),P(t[0]+a,t[1]),i),WK(e,t,i))}},KK=(e,t)=>{Yu(t.selectedLinearElement,`selectedLinearElement is null`);let{segmentMidPointHoveredCoords:n}=t.selectedLinearElement;Yu(n,`midPointCoords is null`),e.save(),e.translate(t.scrollX,t.scrollY),JK(n,e,t),e.restore()},qK=(e,t,n)=>{let{elementId:r,hoverPointIndex:i}=t.selectedLinearElement;if(t.editingLinearElement?.selectedPointsIndices?.includes(i))return;let a=U.getElement(r,n);if(!a)return;let o=U.getPointAtIndexGlobalCoordinates(a,i,n);e.save(),e.translate(t.scrollX,t.scrollY),JK(o,e,t),e.restore()},JK=(e,t,n)=>{t.fillStyle=`rgba(105, 101, 219, 0.4)`,XS(t,e[0],e[1],U.POINT_HANDLE_SIZE/n.zoom.value,!1)},YK=(e,t,n,r,i,a,o,s,c=!1,l=0)=>{e.save(),e.translate(a,o),e.rotate(s),c&&e.fillRect(t-a,n-o,r,i),l&&e.roundRect?(e.beginPath(),e.roundRect(t-a,n-o,r,i,l),e.stroke(),e.closePath()):e.strokeRect(t-a,n-o,r,i),e.restore()},XK=(e,t,n,r,i,a)=>{e.save(),e.translate(r,i),e.rotate(a),e.beginPath(),e.moveTo(0,n/2),e.lineTo(t/2,0),e.lineTo(0,-n/2),e.lineTo(-t/2,0),e.closePath(),e.stroke(),e.restore()},ZK=(e,t,n,r,i,a=!1)=>{e.strokeStyle=`#5e5ad8`,e.setLineDash([]),e.fillStyle=`rgba(255, 255, 255, 0.9)`,i?e.fillStyle=`rgba(134, 131, 226, 0.9)`:a&&(e.fillStyle=`rgba(177, 151, 252, 0.7)`),XS(e,n[0],n[1],r/t.zoom.value,!a)},QK=(e,t,n,r,i,a)=>{e.beginPath(),e.ellipse(r,i,t/2,n/2,a,0,Math.PI*2),e.stroke()},$K=(e,t,n,r)=>{let[i,a,o,s]=av(t,n),c=o-i,l=s-a;e.strokeStyle=`rgba(0,0,0,.05)`,e.lineWidth=10/(r.value<1?r.value:1);let u=e.lineWidth/2+4,d=Yg(Math.min(t.width,t.height),t);switch(t.type){case`rectangle`:case`text`:case`image`:case`iframe`:case`embeddable`:case`frame`:case`magicframe`:YK(e,i-u,a-u,c+u*2,l+u*2,i+c/2,a+l/2,t.angle,void 0,d);break;case`diamond`:let n=Math.hypot(c,l),r=u*n/l,o=u*n/c;XK(e,c+r*2,l+o*2,i+c/2,a+l/2,t.angle);break;case`ellipse`:QK(e,c+u*2,l+u*2,i+c/2,a+l/2,t.angle)}},eq=(e,t,n,r)=>{let[i,a,o]=t,s=xy(o,o.width,o.height,r);e.strokeStyle=`rgba(0,0,0,0)`,e.fillStyle=`rgba(0,0,0,.05)`,(a===`both`?[0,-1]:a===`start`?[0]:[-1]).forEach(t=>{let[r,a]=U.getPointAtIndexGlobalCoordinates(i,t,n);XS(e,r,a,s)})},tq=(e,t,n)=>{let{angle:r,x1:i,y1:a,x2:o,y2:s,selectionColors:c,cx:l,cy:u,dashed:d,activeEmbeddable:f}=n,p=o-i,m=s-a,h=(n.padding??4)/t.zoom.value,g=8/t.zoom.value,_=4/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=(f?4:1)/t.zoom.value;let v=c.length;for(let t=0;t<v;++t)e.strokeStyle=c[t],d&&e.setLineDash([g,_+(g+_)*(v-1)]),e.lineDashOffset=(g+_)*t,YK(e,i-h,a-h,p+h*2,m+h*2,l,u,r);e.restore()},nq=(e,t,n,r)=>{let i=Array.isArray(n)?eq:$K;e.save(),e.translate(t.scrollX,t.scrollY),i(e,n,r,t.zoom),e.restore()},rq=(e,t,n,r)=>{let[i,a,o,s]=av(n,r),c=o-i,l=s-a;e.strokeStyle=`rgb(0,118,255)`,e.lineWidth=$s.strokeWidth/t.zoom.value,e.save(),e.translate(t.scrollX,t.scrollY),YK(e,i,a,c,l,i+c/2,a+l/2,n.angle,!1,$s.radius/t.zoom.value),e.restore()},iq=(e,t,n)=>{let r=n.filter(e=>e.groupIds.length===0),i=n.filter(e=>e.groupIds.length>0),a=e=>{let[t,n,r,i]=bv(e);return{angle:0,x1:t,x2:r,y1:n,y2:i,selectionColors:[`rgb(0,118,255)`],dashed:!1,cx:t+(r-t)/2,cy:n+(i-n)/2,activeEmbeddable:!1}},o=e=>{let t=qy(n,e);return a(t)};Object.entries(Wy(i,t)).filter(([e,t])=>t).map(([e,t])=>e).map(e=>o(e)).concat(r.map(e=>a([e]))).forEach(n=>tq(e,t,n))},aq=(e,t,n,r)=>{if(!t.selectedLinearElement)return;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=1/t.zoom.value;let i=U.getPointsGlobalCoordinates(n,r),{POINT_HANDLE_SIZE:a}=U,o=t.editingLinearElement?a:a/2;if(i.forEach((r,a)=>{if(z(n)&&a!==0&&a!==i.length-1)return;let s=!!t.editingLinearElement?.selectedPointsIndices?.includes(a);ZK(e,t,r,o,s)}),z(n)){let r=n.fixedSegments?.map(e=>e.index)||[];i.slice(0,-1).forEach((o,s)=>{U.isSegmentTooShort(n,i[s+1],i[s],s,t.zoom)||ZK(e,t,P((o[0]+i[s+1][0])/2,(o[1]+i[s+1][1])/2),a/2,!1,!r.includes(s+1))})}else U.getEditorMidPoints(n,r,t).filter((e,t,r)=>e!==null&&!(z(n)&&(t===0||t===r.length-1))).forEach(n=>{(t.editingLinearElement||i.length===2)&&ZK(e,t,n,a/2,!1,!0)});e.restore()},oq=(e,t,n,r,i)=>{Object.keys(r).forEach(a=>{let o=r[a];if(o!==void 0){let[r,s,c,l]=o;e.save(),e.lineWidth=1/n.zoom.value,t.selectionColor&&(e.strokeStyle=t.selectionColor),a===`rotation`?XS(e,r+c/2,s+l/2,c/2):e.roundRect?(e.beginPath(),e.roundRect(r,s,c,l,2/n.zoom.value),e.fill(),e.stroke()):YK(e,r,s,c,l,r+c/2,s+l/2,i,!0),e.restore()}})},sq=(e,t,n,r,i)=>{let[a,o,,,s,c]=av(r,i),l=3/n.zoom.value,u=l/2,d=s-a+l,f=c-o+l,p=Math.min(20/n.zoom.value,d),m=Math.min(20/n.zoom.value,f);e.save(),e.fillStyle=t.selectionColor,e.strokeStyle=t.selectionColor,e.lineWidth=l,[[[-d,-f],[0,u],[p,u],[u,0],[u,m]],[[d-u,-f],[u,u],[-p+u,u],[0,0],[0,m]],[[-d,f],[0,-u],[p,-u],[u,0],[u,-m]],[[d-u,f],[u,-u],[-p+u,-u],[0,0],[0,-m]]].forEach(t=>{let[[n,i],[a,o],[l,u],[d,f],[p,m]]=t;e.save(),e.translate(s,c),e.rotate(r.angle),e.beginPath(),e.moveTo(n+a,i+o),e.lineTo(n+l,i+u),e.stroke(),e.beginPath(),e.moveTo(n+d,i+f),e.lineTo(n+p,i+m),e.stroke(),e.restore()}),e.restore()},cq=(e,t,n,r)=>{t.save();let i=4/n.zoom.value,a=e.width+i*2,o=e.height+i*2,s=e.x+a/2,c=e.y+o/2,l=-(a/2+i),u=-(o/2+i);t.translate(s+n.scrollX,c+n.scrollY),t.rotate(e.angle),t.lineWidth=1/n.zoom.value,t.strokeStyle=r,t.strokeRect(l,u,a,o),t.restore()},lq=({canvas:e,elementsMap:t,visibleElements:n,selectedElements:r,allElementsMap:i,scale:a,appState:o,renderConfig:s,device:c})=>{if(e===null)return{atLeastOneVisibleElement:!1,elementsMap:t};let[l,u]=ZS(e,a),d=QS({canvas:e,scale:a,normalizedWidth:l,normalizedHeight:u});d.save(),d.scale(o.zoom.value,o.zoom.value);let f;if(n.forEach(e=>{o.editingLinearElement?.elementId===e.id&&e&&(f=e)}),f&&aq(d,o,f,t),o.selectionElement&&!o.isCropping)try{y_(o.selectionElement,d,o,s.selectionColor)}catch(e){console.error(e)}if(o.editingTextElement&&R(o.editingTextElement)){let e=i.get(o.editingTextElement.id);e&&!e.autoResize&&cq(e,d,o,s.selectionColor)}o.isBindingEnabled&&o.suggestedBindings.filter(e=>e!=null).forEach(e=>{nq(d,o,e,t)}),o.frameToHighlight&&rq(d,o,o.frameToHighlight,t),o.elementsToHighlight&&iq(d,o,o.elementsToHighlight);let p=r.some(e=>gd(e));if(r.length===1&&o.editingLinearElement?.elementId===r[0].id&&aq(d,o,r[0],t),z(r[0])&&o.selectedLinearElement&&o.selectedLinearElement.segmentMidPointHoveredCoords?KK(d,o):o.selectedLinearElement&&o.selectedLinearElement.hoverPointIndex>=0&&!(z(r[0])&&o.selectedLinearElement.hoverPointIndex>0&&o.selectedLinearElement.hoverPointIndex<r[0].points.length-1)&&qK(d,o,t),!o.multiElement&&!o.editingLinearElement){let e=SE(r,o),n=r.length===1&&yd(r[0]);n&&o.selectedLinearElement?.elementId===r[0].id&&!r[0].locked&&aq(d,o,r[0],t);let i=s.selectionColor||Ui.black;if(e){let e=Nu(r),a=[];for(let r of t.values()){let c=[],l=s.remoteSelectedElementIds.get(r.id);if(n&&z(r)&&(r.startBinding||r.endBinding)||(e.has(r.id)&&!Vy(o,r)&&c.push(i),l&&c.push(...l.map(e=>Hz(e,o.collaborators.get(e))))),c.length){let[e,n,i,s,u,d]=av(r,t,!0);a.push({angle:r.angle,x1:e,y1:n,x2:i,y2:s,selectionColors:c,dashed:!!l,cx:u,cy:d,activeEmbeddable:o.activeEmbeddable?.element===r&&o.activeEmbeddable.state===`active`,padding:r.id===o.croppingElementId||ud(r)?0:void 0})}}let c=e=>{let[n,r,i,o]=bv(qy(t,e));a.push({angle:0,x1:n,x2:i,y1:r,y2:o,selectionColors:[Ui.black],dashed:!0,cx:n+(i-n)/2,cy:r+(o-r)/2,activeEmbeddable:!1})};for(let e of Uy(o))c(e);o.editingGroupId&&c(o.editingGroupId),a.forEach(e=>tq(d,o,e))}if(d.save(),d.translate(o.scrollX,o.scrollY),r.length===1){d.fillStyle=Ui.white;let n=xE(r[0],o.zoom,t,`mouse`,yE(c));if(!o.viewModeEnabled&&e&&!R(o.editingTextElement)&&!o.croppingElementId&&oq(d,s,o,n,r[0].angle),o.croppingElementId&&!o.isCropping){let e=t.get(o.croppingElementId);e&&ud(e)&&sq(d,s,o,e,t)}}else if(r.length>1&&!o.isRotating){let e=4/o.zoom.value;d.fillStyle=Ui.white;let[t,n,a,l]=bv(r),u=d.getLineDash();d.setLineDash([2/o.zoom.value]);let f=d.lineWidth;d.lineWidth=1/o.zoom.value,d.strokeStyle=i,YK(d,t-e,n-e,a-t+e*2,l-n+e*2,(t+a)/2,(n+l)/2,0),d.lineWidth=f,d.setLineDash(u);let m=bE([t,n,a,l,(t+a)/2,(n+l)/2],0,o.zoom,`mouse`,p?{...yE(c),rotation:!0}:yE(c));r.some(e=>!e.locked)&&oq(d,s,o,m,0)}d.restore()}o.searchMatches.forEach(({id:e,focus:n,matchedLines:r})=>{let i=t.get(e);if(i&&R(i)){let[e,a,,,s,c]=av(i,t,!0);d.save(),o.theme===Qs.LIGHT?n?d.fillStyle=`rgba(255, 124, 0, 0.4)`:d.fillStyle=`rgba(255, 226, 0, 0.4)`:n?d.fillStyle=`rgba(229, 82, 0, 0.4)`:d.fillStyle=`rgba(99, 52, 0, 0.4)`,d.translate(o.scrollX,o.scrollY),d.translate(s,c),d.rotate(i.angle),r.forEach(t=>{d.fillRect(e+t.offsetX-s,a+t.offsetY-c,t.width,t.height)}),d.restore()}}),BK(d,o),d.restore(),Wz({context:d,renderConfig:s,appState:o,normalizedWidth:l,normalizedHeight:u});let m;return s.renderScrollbars&&(m=OU(n,l,u,o),d.save(),d.fillStyle=DU,d.strokeStyle=`rgba(255,255,255,0.8)`,[m.horizontal,m.vertical].forEach(e=>{e&&Bz(d,e.x,e.y,e.width,e.height,EU/2)}),d.restore()),{scrollBars:m,atLeastOneVisibleElement:n.length>0,elementsMap:t}},uq=uu(e=>{let t=lq(e);e.callback?.(t)},{trailing:!0}),dq=(e,t)=>{if(t){uq(e);return}let n=lq(e);return e.callback(n),n},fq=e=>{let t=(0,u.useRef)(!1);return(0,u.useEffect)(()=>{if(!t.current){t.current=!0;return}let n=new Map,r=new Map,i=new Map,a=new Map,o=new Map;e.appState.collaborators.forEach((t,s)=>{if(t.selectedElementIds)for(let e of Object.keys(t.selectedElementIds))i.has(e)||i.set(e,[]),i.get(e).push(s);!t.pointer||t.pointer.renderCursor===!1||(t.username&&a.set(s,t.username),t.userState&&o.set(s,t.userState),r.set(s,vu({sceneX:t.pointer.x,sceneY:t.pointer.y},e.appState)),n.set(s,t.button))});let s=e.containerRef?.current&&getComputedStyle(e.containerRef.current).getPropertyValue(`--color-selection`)||`#6965db`;dq({canvas:e.canvas,elementsMap:e.elementsMap,visibleElements:e.visibleElements,selectedElements:e.selectedElements,allElementsMap:e.allElementsMap,scale:window.devicePixelRatio,appState:e.appState,renderConfig:{remotePointerViewportCoords:r,remotePointerButton:n,remoteSelectedElementIds:i,remotePointerUsernames:a,remotePointerUserStates:o,selectionColor:s,renderScrollbars:!1},device:e.device,callback:e.renderInteractiveSceneCallback},FK())}),(0,k.jsx)(`canvas`,{className:`excalidraw__canvas interactive`,style:{width:e.appState.width,height:e.appState.height,cursor:e.appState.viewModeEnabled?Vs.GRAB:Vs.AUTO},width:e.appState.width*e.scale,height:e.appState.height*e.scale,ref:e.handleCanvasRef,onContextMenu:e.onContextMenu,onPointerMove:e.onPointerMove,onPointerUp:e.onPointerUp,onPointerCancel:e.onPointerCancel,onTouchMove:e.onTouchMove,onPointerDown:e.onPointerDown,onDoubleClick:e.appState.viewModeEnabled?void 0:e.onDoubleClick,children:q(`labels.drawingCanvas`)})},pq=e=>({zoom:e.zoom,scrollX:e.scrollX,scrollY:e.scrollY,width:e.width,height:e.height,viewModeEnabled:e.viewModeEnabled,openDialog:e.openDialog,editingGroupId:e.editingGroupId,editingLinearElement:e.editingLinearElement,selectedElementIds:e.selectedElementIds,frameToHighlight:e.frameToHighlight,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,theme:e.theme,pendingImageElementId:e.pendingImageElementId,selectionElement:e.selectionElement,selectedGroupIds:e.selectedGroupIds,selectedLinearElement:e.selectedLinearElement,multiElement:e.multiElement,isBindingEnabled:e.isBindingEnabled,suggestedBindings:e.suggestedBindings,isRotating:e.isRotating,elementsToHighlight:e.elementsToHighlight,collaborators:e.collaborators,activeEmbeddable:e.activeEmbeddable,snapLines:e.snapLines,zenModeEnabled:e.zenModeEnabled,editingTextElement:e.editingTextElement,isCropping:e.isCropping,croppingElementId:e.croppingElementId,searchMatches:e.searchMatches}),mq=u.memo(fq,(e,t)=>e.selectionNonce!==t.selectionNonce||e.sceneNonce!==t.sceneNonce||e.scale!==t.scale||e.elementsMap!==t.elementsMap||e.visibleElements!==t.visibleElements||e.selectedElements!==t.selectedElements?!1:Ku(pq(e.appState),pq(t.appState))),hq=e=>{let t=(0,u.useRef)(null),n=(0,u.useRef)(!1);return(0,u.useEffect)(()=>{let r=t.current;if(!r)return;let i=e.canvas;n.current||(n.current=!0,r.replaceChildren(i),i.classList.add(`excalidraw__canvas`,`static`));let a=`${e.appState.width}px`,o=`${e.appState.height}px`;i.style.width!==a&&(i.style.width=a),i.style.height!==o&&(i.style.height=o);let s=e.appState.width*e.scale,c=e.appState.height*e.scale;i.width!==s&&(i.width=s),i.height!==c&&(i.height=c),dC({canvas:i,rc:e.rc,scale:e.scale,elementsMap:e.elementsMap,allElementsMap:e.allElementsMap,visibleElements:e.visibleElements,appState:e.appState,renderConfig:e.renderConfig},FK())}),(0,k.jsx)(`div`,{className:`excalidraw__canvas-wrapper`,ref:t})},gq=e=>({zoom:e.zoom,scrollX:e.scrollX,scrollY:e.scrollY,width:e.width,height:e.height,viewModeEnabled:e.viewModeEnabled,openDialog:e.openDialog,hoveredElementIds:e.hoveredElementIds,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,theme:e.theme,pendingImageElementId:e.pendingImageElementId,shouldCacheIgnoreZoom:e.shouldCacheIgnoreZoom,viewBackgroundColor:e.viewBackgroundColor,exportScale:e.exportScale,selectedElementsAreBeingDragged:e.selectedElementsAreBeingDragged,gridSize:e.gridSize,gridStep:e.gridStep,frameRendering:e.frameRendering,selectedElementIds:e.selectedElementIds,frameToHighlight:e.frameToHighlight,editingGroupId:e.editingGroupId,currentHoveredFontFamily:e.currentHoveredFontFamily,croppingElementId:e.croppingElementId}),_q=u.memo(hq,(e,t)=>e.sceneNonce!==t.sceneNonce||e.scale!==t.scale||e.elementsMap!==t.elementsMap||e.visibleElements!==t.visibleElements?!1:Ku(gq(e.appState),gq(t.appState))&&Ku(e.renderConfig,t.renderConfig)),vq=class{constructor(e){v(this,`scene`),v(this,`getRenderableElements`,(()=>{let e=({elementsMap:e,zoom:t,offsetLeft:n,offsetTop:r,scrollX:i,scrollY:a,height:o,width:s})=>{let c=[];for(let l of e.values())sE(l,s,o,{zoom:t,offsetLeft:n,offsetTop:r,scrollX:i,scrollY:a},e)&&c.push(l);return c},t=({elements:e,editingTextElement:t,newElementId:n,pendingImageElementId:r})=>{let i=rd(new Map);for(let a of e)ud(a)&&r===a.id||n!==a.id&&(!t||t.type!==`text`||a.id!==t.id)&&i.set(a.id,a);return i};return Xu(({zoom:n,offsetLeft:r,offsetTop:i,scrollX:a,scrollY:o,height:s,width:c,editingTextElement:l,newElementId:u,pendingImageElementId:d,sceneNonce:f})=>{let p=this.scene.getNonDeletedElements(),m=t({elements:p,editingTextElement:l,newElementId:u,pendingImageElementId:d});return{elementsMap:m,visibleElements:e({elementsMap:m,zoom:n,offsetLeft:r,offsetTop:i,scrollX:a,scrollY:o,height:s,width:c})}})})()),this.scene=e}destroy(){uq.cancel(),uC.cancel(),this.getRenderableElements.clear()}},yq=({trails:e})=>{let t=(0,u.useRef)(null);return(0,u.useEffect)(()=>{if(t.current)for(let n of e)n.start(t.current);return()=>{for(let t of e)t.stop()}},e),(0,k.jsx)(`div`,{className:`SVGLayer`,children:(0,k.jsx)(`svg`,{ref:t})})},bq=5,xq=(e,t,n)=>{let[r,i]=av(e,n),{x:a,y:o}=vu({sceneX:r+e.width,sceneY:i},t);return{x:a-t.offsetLeft+10,y:o-t.offsetTop}},Sq=({children:e,element:t,elementsMap:n})=>{let r=Zq();if(r.contextMenu||r.newElement||r.resizingElement||r.isRotating||r.openMenu||r.viewModeEnabled)return null;let{x:i,y:a}=xq(t,r,n);return(0,k.jsx)(`div`,{className:`excalidraw-canvas-buttons`,style:{top:`${a}px`,left:`${i}px`,padding:bq},children:e})},Cq=`small`,wq=e=>(0,k.jsxs)(`label`,{className:O(`ToolIcon ToolIcon__MagicButton`,`ToolIcon_size_${Cq}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[(0,k.jsx)(`input`,{className:`ToolIcon_type_checkbox`,type:`checkbox`,name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),(0,k.jsx)(`div`,{className:`ToolIcon__icon`,children:e.icon})]}),Tq=({height:e,width:t,userToFollow:n,onDisconnect:r})=>(0,k.jsx)(`div`,{className:`follow-mode`,style:{width:t,height:e},children:(0,k.jsxs)(`div`,{className:`follow-mode__badge`,children:[(0,k.jsxs)(`div`,{className:`follow-mode__badge__label`,children:[`Following`,` `,(0,k.jsx)(`span`,{className:`follow-mode__badge__username`,title:n.username,children:n.username})]}),(0,k.jsx)(`button`,{type:`button`,onClick:r,className:`follow-mode__disconnect-btn`,children:Np})]})}),Eq=class{constructor(){v(this,`targets`,new WeakMap),v(this,`rafIds`,new WeakMap)}register(e,t){this.targets.set(e,{callback:t,stopped:!0})}start(e){let t=this.targets.get(e);t&&(this.rafIds.has(e)||(this.targets.set(e,{...t,stopped:!1}),this.scheduleFrame(e)))}stop(e){let t=this.targets.get(e);t&&!t.stopped&&this.targets.set(e,{...t,stopped:!0}),this.cancelFrame(e)}constructFrame(e){return t=>{let n=this.targets.get(e);if(!n)return;let r=this.onFrame(n,t);!n.stopped&&!r?this.scheduleFrame(e):this.cancelFrame(e)}}scheduleFrame(e){let t=requestAnimationFrame(this.constructFrame(e));this.rafIds.set(e,t)}cancelFrame(e){if(this.rafIds.has(e)){let t=this.rafIds.get(e);cancelAnimationFrame(t)}this.rafIds.delete(e)}onFrame(e,t){return e.callback(t)??!1}},Dq=class{constructor(e,t,n){this.animationFrameHandler=e,this.app=t,this.options=n,v(this,`currentTrail`),v(this,`pastTrails`,[]),v(this,`container`),v(this,`trailElement`),this.animationFrameHandler.register(this,this.onFrame.bind(this)),this.trailElement=document.createElementNS(Sc,`path`)}get hasCurrentTrail(){return!!this.currentTrail}hasLastPoint(e,t){if(this.currentTrail){let n=this.currentTrail.originalPoints.length;return this.currentTrail.originalPoints[n-1][0]===e&&this.currentTrail.originalPoints[n-1][1]===t}return!1}start(e){e&&(this.container=e),this.trailElement.parentNode!==this.container&&this.container&&this.container.appendChild(this.trailElement),this.animationFrameHandler.start(this)}stop(){this.animationFrameHandler.stop(this),this.trailElement.parentNode===this.container&&this.container?.removeChild(this.trailElement)}startPath(e,t){this.currentTrail=new UI(this.options),this.currentTrail.addPoint([e,t,performance.now()]),this.update()}addPointToPath(e,t){this.currentTrail&&(this.currentTrail.addPoint([e,t,performance.now()]),this.update())}endPath(){this.currentTrail&&(this.currentTrail.close(),this.currentTrail.options.keepHead=!1,this.pastTrails.push(this.currentTrail),this.currentTrail=void 0,this.update())}update(){this.start()}onFrame(){let e=[];for(let t of this.pastTrails)e.push(this.drawTrail(t,this.app.state));if(this.currentTrail){let t=this.drawTrail(this.currentTrail,this.app.state);e.push(t)}this.pastTrails=this.pastTrails.filter(e=>e.getStrokeOutline().length!==0),e.length===0&&this.stop();let t=e.join(` `).trim();this.trailElement.setAttribute(`d`,t),this.trailElement.setAttribute(`fill`,(this.options.fill??(()=>`black`))(this))}drawTrail(e,t){return td(e.getStrokeOutline(e.options.size/t.zoom.value).map(([e,n])=>{let r=vu({sceneX:e,sceneY:n},t);return[r.x,r.y]}),!0)}},Oq=class{constructor(e,t){this.animationFrameHandler=e,this.app=t,v(this,`localTrail`),v(this,`collabTrails`,new Map),v(this,`container`),this.animationFrameHandler.register(this,this.onFrame.bind(this)),this.localTrail=new Dq(e,t,{...this.getTrailOptions(),fill:()=>`red`})}getTrailOptions(){return{simplify:0,streamline:.4,sizeMapping:e=>{let t=Math.max(0,1-(performance.now()-e.pressure)/1e3),n=(50-Math.min(50,e.totalLength-e.currentIndex))/50;return Math.min(du(n),du(t))}}}startPath(e,t){this.localTrail.startPath(e,t)}addPointToPath(e,t){this.localTrail.addPointToPath(e,t)}endPath(){this.localTrail.endPath()}start(e){this.container=e,this.animationFrameHandler.start(this),this.localTrail.start(e)}stop(){this.animationFrameHandler.stop(this),this.localTrail.stop()}onFrame(){this.updateCollabTrails()}updateCollabTrails(){if(!(!this.container||this.app.state.collaborators.size===0)){for(let[e,t]of this.app.state.collaborators.entries()){let n;this.collabTrails.has(e)?n=this.collabTrails.get(e):(n=new Dq(this.animationFrameHandler,this.app,{...this.getTrailOptions(),fill:()=>t.pointer?.laserColor||Hz(e,t)}),n.start(this.container),this.collabTrails.set(e,n)),t.pointer&&t.pointer.tool===`laser`&&(t.button===`down`&&!n.hasCurrentTrail&&n.startPath(t.pointer.x,t.pointer.y),t.button===`down`&&n.hasCurrentTrail&&!n.hasLastPoint(t.pointer.x,t.pointer.y)&&n.addPointToPath(t.pointer.x,t.pointer.y),t.button===`up`&&n.hasCurrentTrail&&(n.addPointToPath(t.pointer.x,t.pointer.y),n.endPath()))}for(let e of this.collabTrails.keys())this.app.state.collaborators.has(e)||(this.collabTrails.get(e).stop(),this.collabTrails.delete(e))}}},kq=(e,t,n,r,i,a)=>{let{zoom:o}=r,s=180*n/Math.PI,c=e*(o.value-1)/2,l=t*(o.value-1)/2;return e>i&&o.value!==1&&(c=i*(o.value-1)/2),t>a&&o.value!==1&&(l=a*(o.value-1)/2),`translate(${c}px, ${l}px) scale(${o.value}) rotate(${s}deg)`},Aq=({id:e,onChange:t,onSubmit:n,getViewportCoords:r,element:i,canvas:a,excalidrawContainer:o,app:s,autoSelect:c=!0})=>{let l=(e,t)=>{if(!t.style.fontFamily||!t.style.fontSize)return!1;let n=t.style.fontFamily.replace(/"/g,``);return su({fontFamily:e.fontFamily})!==n||`${e.fontSize}px`!==t.style.fontSize},u=()=>{let t=s.state,n=rE.getScene(i)?.getElement(e);if(!n)return;let{textAlign:a,verticalAlign:o}=n,c=s.scene.getNonDeletedElementsMap();if(n&&R(n)){let e=n.x,i=n.y,u=Bb(n,s.scene.getNonDeletedElementsMap()),f=n.width,p=n.height,m=n.width,h=n.height;if(u&&n.containerId){if(bd(u)){let t=U.getBoundTextElementPosition(u,n,c);e=t.x,i=t.y}let t=l(n,d),r;if(t?r=jb(u.id,u.height):(r=Ab[u.id],r||=jb(u.id,u.height)),m=Yb(u,n),h=Xb(u,n),!bd(u)&&p>h){K(u,{height:Jb(p,u.type)});return}if(!bd(u)&&u.height>r.height&&p<h)K(u,{height:Jb(p,u.type)});else{let{y:e}=Lb(u,n,c);i=e}}let[g,_]=r(e,i),v=d.selectionStart,y=d.selectionEnd,b=d.value.length;if(v===y&&y!==b){let e=b-y;d.selectionStart=d.value.length-e,d.selectionEnd=d.value.length-e}u?f+=.5:(m=(t.width-8-g)/t.zoom.value,f=Math.min(f,m)),p*=1.05;let x=cu(n),S=(t.height-_)/t.zoom.value;Object.assign(d.style,{font:x,lineHeight:n.lineHeight,width:`${f}px`,height:`${p}px`,left:`${g}px`,top:`${_}px`,transform:kq(f,p,Ub(n,u),t,m,S),textAlign:a,verticalAlign:o,color:n.strokeColor,opacity:n.opacity/100,filter:`var(--theme-filter)`,maxHeight:`${S}px`}),d.scrollTop=0,Lu()&&(d.style.fontFamily=su(n)),K(n,{x:e,y:i})}},d=document.createElement(`textarea`);d.dir=`auto`,d.tabIndex=0,d.dataset.type=`wysiwyg`,d.wrap=`off`,d.classList.add(`excalidraw-wysiwyg`);let f=`pre`,p=`normal`;(Ad(i)||!i.autoResize)&&(f=`pre-wrap`,p=`break-word`),Object.assign(d.style,{position:`absolute`,display:`inline-block`,minHeight:`1em`,backfaceVisibility:`hidden`,margin:0,padding:0,border:0,outline:0,resize:`none`,background:`transparent`,overflow:`hidden`,zIndex:`var(--zIndex-wysiwyg)`,wordBreak:p,whiteSpace:f,overflowWrap:`break-word`,boxSizing:`content-box`}),d.value=i.originalText,u(),t&&(d.onpaste=async e=>{let t=await Yw(e,!0);if(!t.text)return;let n=Vd(t.text);if(!n)return;let r=Bb(i,s.scene.getNonDeletedElementsMap()),a=cu({fontSize:s.state.currentItemFontSize,fontFamily:s.state.currentItemFontFamily});if(r){let e=zb(r,s.scene.getNonDeletedElementsMap()),t=Yd(hf(`${d.value}${n}`,a,Yb(r,e)),a);d.style.width=`${t}px`}},d.oninput=()=>{let e=Vd(d.value);if(d.value!==e){let t=d.selectionStart;d.value=e,d.selectionStart=t,d.selectionEnd=t}t(d.value)}),d.onkeydown=e=>{if(!e.shiftKey&&cz.keyTest(e))e.preventDefault(),s.actionManager.executeAction(cz),u();else if(!e.shiftKey&&lz.keyTest(e))e.preventDefault(),s.actionManager.executeAction(lz),u();else if(!e.shiftKey&&uz.keyTest(e))e.preventDefault(),s.actionManager.executeAction(uz),u();else if($R.keyTest(e))s.actionManager.executeAction($R);else if(ez.keyTest(e))s.actionManager.executeAction(ez);else if(e.key===H.ESCAPE)e.preventDefault(),b=!0,x();else if(e.key===H.ENTER&&e[H.CTRL_OR_CMD]){if(e.preventDefault(),e.isComposing||e.keyCode===229)return;b=!0,x()}else if(e.key===H.TAB||e[H.CTRL_OR_CMD]&&(e.code===kg.BRACKET_LEFT||e.code===kg.BRACKET_RIGHT)){if(e.preventDefault(),e.isComposing)return;e.shiftKey||e.code===kg.BRACKET_LEFT?_():g(),d.dispatchEvent(new Event(`input`))}};let m=` `.repeat(4),h=RegExp(`^ {1,4}`),g=()=>{let{selectionStart:e,selectionEnd:t}=d,n=v(),r=d.value;n.forEach(e=>{let t=r.slice(0,e),n=r.slice(e);r=`${t}${m}${n}`}),d.value=r,d.selectionStart=e+4,d.selectionEnd=t+4*n.length},_=()=>{let{selectionStart:e,selectionEnd:t}=d,n=v(),r=[],i=d.value;n.forEach(e=>{let t=i.slice(e,e+4).match(h);t&&(i=`${i.slice(0,e)}${i.slice(e+t[0].length)}`,r.push(e))}),d.value=i,r.length&&(e>r[r.length-1]?d.selectionStart=Math.max(e-4,r[r.length-1]):d.selectionStart=e,d.selectionEnd=Math.max(d.selectionStart,t-4*r.length))},v=()=>{let{selectionStart:e,selectionEnd:t,value:n}=d,r=n.slice(0,e).match(/[^\n]*$/)[0].length;return e-=r,n.slice(e,t).split(`
|
|
112
|
+
`).reduce((t,n,r,i)=>t.concat(r?t[r-1]+i[r-1].length+1:e),[]).reverse()},y=e=>{e.target instanceof HTMLCanvasElement&&(e.preventDefault(),e.stopPropagation())},b=!1,x=()=>{if(ee)return;ee=!0,S();let e=rE.getScene(i)?.getElement(i.id);if(!e)return;let t=Bb(e,s.scene.getNonDeletedElementsMap());if(t){if(d.value.trim()){let e=Rb(t);!e||e!==i.id?K(t,{boundElements:(t.boundElements||[]).concat({type:`text`,id:i.id})}):bd(t)&&aE(t)}else K(t,{boundElements:t.boundElements?.filter(e=>!R(e))});Pb(e,t,s.scene.getNonDeletedElementsMap())}n({viaKeyboard:b,nextOriginalText:d.value})},S=()=>{d.onblur=null,d.oninput=null,d.onkeydown=null,te&&te.disconnect(),window.removeEventListener(`resize`,u),window.removeEventListener(`wheel`,y,!0),window.removeEventListener(`pointerdown`,T),window.removeEventListener(`pointerup`,C),window.removeEventListener(`blur`,x),window.removeEventListener(`beforeunload`,x),E(),D(),d.remove()},C=e=>{window.removeEventListener(`pointerup`,C);let t=e?.target,n=t instanceof HTMLElement&&t.classList.contains(`properties-trigger`);setTimeout(()=>{d.onblur=x,n||d.focus()})},w=()=>{d.onblur=null,window.addEventListener(`pointerup`,C),window.addEventListener(`blur`,x)},T=e=>{let t=e?.target;if(e.button===Hs.WHEEL){t instanceof HTMLTextAreaElement&&(e.preventDefault(),s.handleCanvasPanUsingWheelOrSpaceDrag(e)),w();return}let n=t instanceof HTMLElement&&t.classList.contains(`properties-trigger`);(e.target instanceof HTMLElement||e.target instanceof SVGElement)&&e.target.closest(`.${Ks.SHAPE_ACTIONS_MENU}, .${Ks.ZOOM_ACTIONS}`)&&!ou(e.target)||n?w():e.target instanceof HTMLCanvasElement&&!Lu()&&requestAnimationFrame(()=>{x()})},E=s.scene.onUpdate(()=>{u(),document.activeElement?.closest(`.properties-content`)||d.focus()}),D=s.onScrollChangeEmitter.on(()=>{u()}),ee=!1;c&&d.select(),C();let te=null;a&&`ResizeObserver`in window?(te=new window.ResizeObserver(()=>{u()}),te.observe(a)):window.addEventListener(`resize`,u),d.onpointerdown=e=>e.stopPropagation(),requestAnimationFrame(()=>{window.addEventListener(`pointerdown`,T,{capture:!0})}),window.addEventListener(`beforeunload`,x),o?.querySelector(`.excalidraw-textEditorContainer`).appendChild(d)},jq=W({name:`autoResize`,label:`labels.autoResize`,icon:null,trackEvent:{category:`element`},predicate:(e,t,n,r)=>{let i=YT(e,t);return i.length===1&&R(i[0])&&!i[0].autoResize},perform:(e,t,n,r)=>{let i=YT(e,t);return{appState:t,elements:e.map(e=>{if(e.id===i[0].id&&R(e)){let t=Id(e.originalText,cu(e),e.lineHeight);return iE(e,{autoResize:!0,width:t.width,height:t.height,text:e.originalText})}return e}),captureUpdate:G.IMMEDIATELY}}}),Mq=e=>RegExp(`^(?:%%{.*?}%%[\\s\\n]*)?\\b(?:${[`flowchart`,`graph`,`sequenceDiagram`,`classDiagram`,`stateDiagram`,`stateDiagram-v2`,`erDiagram`,`journey`,`gantt`,`pie`,`quadrantChart`,`requirementDiagram`,`gitGraph`,`C4Context`,`mindmap`,`timeline`,`zenuml`,`sankey`,`xychart`,`block`].map(e=>`\\s*${e}(-beta)?`).join(`|`)})\\b`).test(e.trim()),Nq=({canvas:e,rc:t,newElement:n,elementsMap:r,allElementsMap:i,scale:a,appState:o,renderConfig:s})=>{if(e){let[c,l]=ZS(e,a),u=QS({canvas:e,scale:a,normalizedWidth:c,normalizedHeight:l});u.save(),u.scale(o.zoom.value,o.zoom.value),n&&n.type!==`selection`?b_(n,r,i,t,u,s,o):u.clearRect(0,0,c,l)}},Pq=uu(e=>{Nq(e)},{trailing:!0}),Fq=(e,t)=>{if(t){Pq(e);return}Nq(e)},Iq=e=>{let t=(0,u.useRef)(null);return(0,u.useEffect)(()=>{t.current&&Fq({canvas:t.current,scale:e.scale,newElement:e.appState.newElement,elementsMap:e.elementsMap,allElementsMap:e.allElementsMap,rc:e.rc,renderConfig:e.renderConfig,appState:e.appState},FK())}),(0,k.jsx)(`canvas`,{className:`excalidraw__canvas`,style:{width:e.appState.width,height:e.appState.height},width:e.appState.width*e.scale,height:e.appState.height*e.scale,ref:t})},Lq=u.createContext(null),Rq=u.createContext(null),zq={viewport:{isMobile:!1,isLandscape:!1},editor:{isMobile:!1,canFitSidebar:!1},isTouchScreen:!1},Bq=u.createContext(zq);Bq.displayName=`DeviceContext`;var Vq=u.createContext({container:null,id:null});Vq.displayName=`ExcalidrawContainerContext`;var Hq=u.createContext([]);Hq.displayName=`ExcalidrawElementsContext`;var Uq=u.createContext({...qc(),width:0,height:0,offsetLeft:0,offsetTop:0});Uq.displayName=`ExcalidrawAppStateContext`;var Wq=u.createContext(()=>{console.warn(`Uninitialized ExcalidrawSetAppStateContext context!`)});Wq.displayName=`ExcalidrawSetAppStateContext`;var Gq=u.createContext(null);Gq.displayName=`ExcalidrawActionManagerContext`;var Kq=()=>(0,u.useContext)(Lq),qq=()=>(0,u.useContext)(Rq),Jq=()=>(0,u.useContext)(Bq),Yq=()=>(0,u.useContext)(Vq),Xq=()=>(0,u.useContext)(Hq),Zq=()=>(0,u.useContext)(Uq),Qq=()=>(0,u.useContext)(Wq),$q=()=>(0,u.useContext)(Gq),eJ=!1,tJ=0,nJ=!1,rJ=!1,iJ=!1,aJ={horizontal:null,vertical:null},oJ=0,sJ=!1,cJ=new Map,lJ=!1,uJ=0,dJ=!1,fJ=null,pJ={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null},mJ=class e extends u.Component{constructor(t){super(t),v(this,`canvas`),v(this,`interactiveCanvas`,null),v(this,`rc`),v(this,`unmounted`,!1),v(this,`actionManager`),v(this,`device`,zq),v(this,`excalidrawContainerRef`,u.createRef()),v(this,`scene`),v(this,`fonts`),v(this,`renderer`),v(this,`visibleElements`),v(this,`resizeObserver`),v(this,`nearestScrollableContainer`),v(this,`library`),v(this,`libraryItemsFromStorage`),v(this,`id`),v(this,`store`),v(this,`history`),v(this,`excalidrawContainerValue`),v(this,`files`,{}),v(this,`imageCache`,new Map),v(this,`iFrameRefs`,new Map),v(this,`embedsValidationStatus`,new Map),v(this,`initializedEmbeds`,new Set),v(this,`elementsPendingErasure`,new Set),v(this,`flowChartCreator`,new _U),v(this,`flowChartNavigator`,new gU),v(this,`hitLinkElement`),v(this,`lastPointerDownEvent`,null),v(this,`lastPointerUpEvent`,null),v(this,`lastPointerMoveEvent`,null),v(this,`lastPointerMoveCoords`,null),v(this,`lastViewportPosition`,{x:0,y:0}),v(this,`animationFrameHandler`,new Eq),v(this,`laserTrails`,new Oq(this.animationFrameHandler,this)),v(this,`eraserTrail`,new Dq(this.animationFrameHandler,this,{streamline:.2,size:5,keepHead:!0,sizeMapping:e=>{let t=Math.max(0,1-(performance.now()-e.pressure)/200),n=(10-Math.min(10,e.totalLength-e.currentIndex))/10;return Math.min(du(n),du(t))},fill:()=>this.state.theme===Qs.LIGHT?`rgba(0, 0, 0, 0.2)`:`rgba(255, 255, 255, 0.2)`})),v(this,`onChangeEmitter`,new Zx),v(this,`onPointerDownEmitter`,new Zx),v(this,`onPointerUpEmitter`,new Zx),v(this,`onUserFollowEmitter`,new Zx),v(this,`onScrollChangeEmitter`,new Zx),v(this,`missingPointerEventCleanupEmitter`,new Zx),v(this,`onRemoveEventListenersEmitter`,new Zx),v(this,`getEffectiveGridSize`,()=>sb(this)?this.state.gridSize:null),v(this,`updateEmbedValidationStatus`,(e,t)=>{this.embedsValidationStatus.set(e.id,t),Sf.delete(e)}),v(this,`updateEmbeddables`,()=>{let e=new Set,t=!1;this.scene.getNonDeletedElements().filter(n=>{if(dd(n)){if(e.add(n.id),!this.embedsValidationStatus.has(n.id)){t=!0;let e=wS(n.link,this.props.validateEmbeddable);this.updateEmbedValidationStatus(n,e)}}else fd(n)&&e.add(n.id);return!1}),t&&this.scene.triggerUpdate(),this.iFrameRefs.forEach((t,n)=>{e.has(n)||this.iFrameRefs.delete(n)})}),v(this,`getFrameNameDOMId`,e=>`${this.id}-frame-name-${e.id}`),v(this,`frameNameBoundsCache`,{get:e=>{let t=this.frameNameBoundsCache._cache.get(e.id);if(!t||t.zoom!==this.state.zoom.value||t.versionNonce!==e.versionNonce){let n=document.getElementById(this.getFrameNameDOMId(e));if(n){let r=n.getBoundingClientRect(),i=_u({clientX:r.x,clientY:r.y},this.state),a=_u({clientX:r.right,clientY:r.bottom},this.state);return t={x:i.x,y:i.y,width:a.x-i.x,height:a.y-i.y,angle:0,zoom:this.state.zoom.value,versionNonce:e.versionNonce},this.frameNameBoundsCache._cache.set(e.id,t),t}return null}return t},_cache:new Map}),v(this,`resetEditingFrame`,e=>{e&&K(e,{name:e.name?.trim()||null}),this.setState({editingFrame:null})}),v(this,`renderFrameNames`,()=>{if(!this.state.frameRendering.enabled||!this.state.frameRendering.name)return this.state.editingFrame&&this.resetEditingFrame(null),null;let e=this.state.theme===Qs.DARK;return this.scene.getNonDeletedFramesLikes().map(t=>{if(!sE(t,this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap()))return this.state.editingFrame===t.id&&this.resetEditingFrame(t),null;let{x:n,y:r}=vu({sceneX:t.x,sceneY:t.y},this.state),i,a=VT(t);if(t.id===this.state.editingFrame){let r=a;i=(0,k.jsx)(`input`,{autoFocus:!0,value:r,onChange:e=>{K(t,{name:e.target.value})},onFocus:e=>e.target.select(),onBlur:()=>this.resetEditingFrame(t),onKeyDown:e=>{(e.key===H.ESCAPE||e.key===H.ENTER)&&this.resetEditingFrame(t)},style:{background:this.state.viewBackgroundColor,filter:e?hc:`none`,zIndex:2,border:`none`,display:`block`,padding:`6px`,borderRadius:4,boxShadow:`inset 0 0 0 1px var(--color-primary)`,fontFamily:`Assistant`,fontSize:`14px`,transform:`translate(-6px, 6px)`,color:`var(--color-gray-80)`,overflow:`hidden`,maxWidth:`${document.body.clientWidth-n-6}px`},size:r.length+1||1,dir:`auto`,autoComplete:`off`,autoCapitalize:`off`,autoCorrect:`off`})}else i=a;return(0,k.jsx)(`div`,{id:this.getFrameNameDOMId(t),style:{position:`absolute`,bottom:`${this.state.height+$s.nameOffsetY-r+this.state.offsetTop}px`,left:`${n-this.state.offsetLeft}px`,zIndex:2,fontSize:$s.nameFontSize,color:e?$s.nameColorDarkTheme:$s.nameColorLightTheme,lineHeight:$s.nameLineHeight,width:`max-content`,maxWidth:`${t.width}px`,overflow:t.id===this.state.editingFrame?`visible`:`hidden`,whiteSpace:`nowrap`,textOverflow:`ellipsis`,cursor:Vs.MOVE,pointerEvents:this.state.viewModeEnabled?Us.disabled:Us.enabled},onPointerDown:e=>this.handleCanvasPointerDown(e),onWheel:e=>this.handleWheel(e),onContextMenu:this.handleCanvasContextMenu,onDoubleClick:()=>{this.setState({editingFrame:t.id})},children:i},t.id)})}),v(this,`focusContainer`,()=>{this.excalidrawContainerRef.current?.focus()}),v(this,`getSceneElementsIncludingDeleted`,()=>this.scene.getElementsIncludingDeleted()),v(this,`getSceneElements`,()=>this.scene.getNonDeletedElements()),v(this,`onInsertElements`,e=>{this.addElementsFromPasteOrLibrary({elements:e,position:`center`,files:null})}),v(this,`onExportImage`,async(e,t,n)=>{VL(`export`,e,`ui`);let r=await xz(e,t,this.state,this.files,{exportBackground:this.state.exportBackground,name:this.getName(),viewBackgroundColor:this.state.viewBackgroundColor,exportingFrame:n.exportingFrame}).catch(Cu).catch(e=>{console.error(e),this.setState({errorMessage:e.message})});this.state.exportEmbedScene&&r&&cD(r)&&this.setState({fileHandle:r})}),v(this,`magicGenerations`,new Map),v(this,`updateMagicGeneration`,({frameElement:e,data:t})=>{t.status===`pending`?K(e,{customData:{generationData:void 0}},!1):K(e,{customData:{generationData:t}},!1),this.magicGenerations.set(e.id,t),this.triggerRender()}),v(this,`plugins`,{}),v(this,`onMagicframeToolSelect`,()=>{let e=this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds});if(e.length===0)this.setActiveTool({type:Rc.magicframe}),VL(`ai`,`tool-select (empty-selection)`,`d2c`);else{let t=e.length===1&&hd(e[0])&&e[0];if(!t&&e.some(e=>gd(e)||e.frameId)){this.setActiveTool({type:Rc.magicframe});return}VL(`ai`,`tool-select (existing selection)`,`d2c`);let n;if(t)n=t;else{let[t,r,i,a]=bv(e);n=Sx({...$s,x:t-50,y:r-50,width:i-t+100,height:a-r+100,opacity:100,locked:!1}),this.scene.insertElement(n);for(let t of e)K(t,{frameId:n.id});this.setState({selectedElementIds:{[n.id]:!0}})}this.onMagicFrameGenerate(n,`upstream`)}}),v(this,`openEyeDropper`,({type:e})=>{XI.set(pR,{swapPreviewOnAlt:!0,colorPickerType:e===`stroke`?`elementStroke`:`elementBackground`,onSelect:(t,n)=>{let r=e===`background`&&n.altKey||e===`stroke`&&!n.altKey;!this.scene.getSelectedElements(this.state).length||this.state.activeTool.type!==`selection`?r?this.syncActionResult({appState:{...this.state,currentItemStrokeColor:t},captureUpdate:G.IMMEDIATELY}):this.syncActionResult({appState:{...this.state,currentItemBackgroundColor:t},captureUpdate:G.IMMEDIATELY}):this.updateScene({elements:this.scene.getElementsIncludingDeleted().map(e=>this.state.selectedElementIds[e.id]?iE(e,{[r?`strokeColor`:`backgroundColor`]:t}):e),captureUpdate:G.IMMEDIATELY})},keepOpenOnAlt:!1})}),v(this,`dismissLinearEditor`,()=>{setTimeout(()=>{this.setState({editingLinearElement:null})})}),v(this,`syncActionResult`,NK(e=>{if(this.unmounted||e===!1)return;e.captureUpdate===G.NEVER?this.store.shouldUpdateSnapshot():e.captureUpdate===G.IMMEDIATELY&&this.store.shouldCaptureIncrement();let t=!1,n=null;if(e.elements&&(this.scene.replaceAllElements(e.elements),t=!0),e.files&&(this.addMissingFiles(e.files,e.replaceFiles),this.addNewImagesToImageCache()),e.appState||n||this.state.contextMenu){let r=e?.appState?.viewModeEnabled||!1,i=e?.appState?.zenModeEnabled||!1,a=e?.appState?.theme||this.props.theme||Qs.LIGHT,o=e?.appState?.name??this.state.name,s=e?.appState?.errorMessage??this.state.errorMessage;typeof this.props.viewModeEnabled<`u`&&(r=this.props.viewModeEnabled),typeof this.props.zenModeEnabled<`u`&&(i=this.props.zenModeEnabled),n=e.appState?.editingTextElement||null,e.elements&&n&&e.elements.forEach(e=>{n?.id===e.id&&n!==e&&tD(e)&&R(e)&&(n=e)}),n?.isDeleted&&(n=null),this.setState(t=>{let c=e.appState||{};return{...t,...c,contextMenu:null,editingTextElement:n,viewModeEnabled:r,zenModeEnabled:i,theme:a,name:o,errorMessage:s}}),t=!0}!t&&e.captureUpdate!==G.EVENTUALLY&&this.scene.triggerUpdate()})),v(this,`onBlur`,NK(()=>{nJ=!1,this.setState({isBindingEnabled:!0})})),v(this,`onUnload`,()=>{this.onBlur()}),v(this,`disableEvent`,e=>{e.preventDefault()}),v(this,`resetHistory`,()=>{this.history.clear()}),v(this,`resetStore`,()=>{this.store.clear()}),v(this,`resetScene`,NK(e=>{this.scene.replaceAllElements([]),this.setState(t=>({...qc(),isLoading:!e?.resetLoadingState&&t.isLoading,theme:this.state.theme})),this.resetStore(),this.resetHistory()})),v(this,`initializeScene`,async()=>{`launchQueue`in window&&`LaunchParams`in window&&window.launchQueue.setConsumer(async e=>{if(!e.files.length)return;let t=e.files[0],n=await t.getFile();this.loadFileToCanvas(new File([n],n.name||``,{type:n.type}),t)}),this.props.theme&&this.setState({theme:this.props.theme}),this.state.isLoading||this.setState({isLoading:!0});let e=null;try{e=typeof this.props.initialData==`function`?await this.props.initialData()||null:await this.props.initialData||null,e?.libraryItems&&this.library.updateLibrary({libraryItems:e.libraryItems,merge:!0}).catch(e=>{console.error(e)})}catch(t){console.error(t),e={appState:{errorMessage:t.message||`Encountered an error during importing or restoring scene data`}}}let t=mw(e,null,null,{repairBindings:!0});t.appState={...t.appState,theme:this.props.theme||t.appState.theme,openSidebar:t.appState?.openSidebar||this.state.openSidebar,activeTool:t.appState.activeTool.type===`image`?{...t.appState.activeTool,type:`selection`}:t.appState.activeTool,isLoading:!1,toast:this.state.toast},e?.scrollToContent&&(t.appState={...t.appState,...Fy(t.elements,{...t.appState,width:this.state.width,height:this.state.height,offsetTop:this.state.offsetTop,offsetLeft:this.state.offsetLeft})}),this.resetStore(),this.resetHistory(),this.syncActionResult({...t,captureUpdate:G.NEVER}),this.clearImageShapeCache(),this.fonts.loadSceneFonts().then(e=>{this.fonts.onLoaded(e)}),nC(window.location.href)&&this.scrollToContent(window.location.href,{animate:!1})}),v(this,`isMobileBreakpoint`,(e,t)=>e<730||t<500&&e<1e3),v(this,`refreshViewportBreakpoints`,()=>{if(!this.excalidrawContainerRef.current)return;let{clientWidth:e,clientHeight:t}=document.body,n=this.device.viewport,r=Vu(n,{isLandscape:e>t,isMobile:this.isMobileBreakpoint(e,t)});return n!==r&&(this.device={...this.device,viewport:r},!0)}),v(this,`refreshEditorBreakpoints`,()=>{let e=this.excalidrawContainerRef.current;if(!e)return;let{width:t,height:n}=e.getBoundingClientRect(),r=this.props.UIOptions.dockedSidebarBreakpoint==null?_c:this.props.UIOptions.dockedSidebarBreakpoint,i=this.device.editor,a=Vu(i,{isMobile:this.isMobileBreakpoint(t,n),canFitSidebar:t>r});return i!==a&&(this.device={...this.device,editor:a},!0)}),v(this,`onResize`,NK(()=>{this.scene.getElementsIncludingDeleted().forEach(e=>Sf.delete(e)),this.refreshViewportBreakpoints(),this.updateDOMRect(),Ls||this.refreshEditorBreakpoints(),this.setState({})})),v(this,`onFullscreenChange`,()=>{!document.fullscreenElement&&this.state.activeEmbeddable?.state===`active`&&this.setState({activeEmbeddable:null})}),v(this,`renderInteractiveSceneCallback`,({atLeastOneVisibleElement:e,scrollBars:t,elementsMap:n})=>{t&&(aJ=t);let r=!this.state.editingTextElement&&!e&&n.size>0;this.state.scrolledOutside!==r&&this.setState({scrolledOutside:r}),this.scheduleImageRefresh()}),v(this,`onScroll`,lu(()=>{let{offsetTop:e,offsetLeft:t}=this.getCanvasOffsets();this.setState(n=>n.offsetLeft===t&&n.offsetTop===e?null:{offsetTop:e,offsetLeft:t})},100)),v(this,`onCut`,NK(e=>{!this.excalidrawContainerRef.current?.contains(document.activeElement)||ou(e.target)||(this.actionManager.executeAction(oB,`keyboard`,e),e.preventDefault(),e.stopPropagation())})),v(this,`onCopy`,NK(e=>{!this.excalidrawContainerRef.current?.contains(document.activeElement)||ou(e.target)||(this.actionManager.executeAction(iB,`keyboard`,e),e.preventDefault(),e.stopPropagation())})),v(this,`onTouchStart`,t=>{if(Fs&&t.preventDefault(),!eJ){eJ=!0,clearTimeout(tJ),tJ=window.setTimeout(e.resetTapTwice,300);return}if(eJ&&t.touches.length===1){let e=t.touches[0];this.handleCanvasDoubleClick({clientX:e.clientX,clientY:e.clientY}),eJ=!1,clearTimeout(tJ)}t.touches.length===2&&this.setState({selectedElementIds:ZT({},this.state),activeEmbeddable:null})}),v(this,`onTouchEnd`,e=>{this.resetContextMenuTimer(),e.touches.length>0?this.setState({previousSelectedElementIds:{},selectedElementIds:ZT(this.state.previousSelectedElementIds,this.state)}):pJ.pointers.clear()}),v(this,`pasteFromClipboard`,NK(async e=>{let t=!!lJ,n=document.activeElement,r=this.excalidrawContainerRef.current?.contains(n);if(e&&!r)return;let i=document.elementFromPoint(this.lastViewportPosition.x,this.lastViewportPosition.y);if(e&&(!(i instanceof HTMLCanvasElement)||ou(n)))return;let{x:a,y:o}=_u({clientX:this.lastViewportPosition.x,clientY:this.lastViewportPosition.y},this.state),s=e?.clipboardData?.files[0],c=await Yw(e,t);if(!s&&!t){if(c.mixedContent)return this.addElementsFromMixedContentPaste(c.mixedContent,{isPlainPaste:t,sceneX:a,sceneY:o});if(c.text){let e=c.text.trim();e.startsWith(`<svg`)&&e.endsWith(`</svg>`)&&(s=SD(e))}}if(uD(s)&&!c.spreadsheet){if(!this.isToolSupported(`image`)){this.setState({errorMessage:q(`errors.imageToolNotSupported`)});return}let e=this.createImageElement({sceneX:a,sceneY:o});this.insertImageElement(e,s),this.initializeImageDimensions(e),this.setState({selectedElementIds:ZT({[e.id]:!0},this.state)});return}if(this.props.onPaste)try{if(await this.props.onPaste(c,e)===!1)return}catch(e){console.error(e)}if(c.errorMessage)this.setState({errorMessage:c.errorMessage});else if(c.spreadsheet&&!t)this.setState({pasteDialog:{data:c.spreadsheet,shown:!0}});else if(c.elements){let e=c.programmaticAPI?MK(c.elements):c.elements;this.addElementsFromPasteOrLibrary({elements:e,files:c.files||null,position:`cursor`,retainSeed:t})}else if(c.text){if(c.text&&Mq(c.text)){let e=await A(()=>import(`./dist-C2o0r0se.js`).then(e=>e.t),__vite__mapDeps([5,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]),import.meta.url);try{let{elements:t,files:n={}}=await e.parseMermaidToExcalidraw(c.text),r=MK(t,{regenerateIds:!0});this.addElementsFromPasteOrLibrary({elements:r,files:n,position:`cursor`});return}catch(e){console.warn(`parsing pasted text as mermaid definition failed: ${e.message}`)}}let e=nd(c.text).split(/\n+/).map(e=>e.trim()).filter(Boolean),n=e.map(e=>CS(e)).filter(e=>wS(e,this.props.validateEmbeddable)&&(/^(http|https):\/\/[^\s/$.?#].[^\s]*$/.test(e)||bS(e)?.type===`video`));if(!lJ&&n.length>0&&n.length===e.length){let e=[];for(let t of n){let n=e[e.length-1],r=this.insertEmbeddableElement({sceneX:n?n.x+n.width+20:a,sceneY:o,link:Qb(t)});r&&e.push(r)}e.length&&this.setState({selectedElementIds:Object.fromEntries(e.map(e=>[e.id,!0]))});return}this.addTextFromPaste(c.text,t)}this.setActiveTool({type:`selection`}),e?.preventDefault()})),v(this,`addElementsFromPasteOrLibrary`,e=>{let t=uw(e.elements,null,void 0),[n,r,i,a]=bv(t),o=hu(n,i)/2,s=hu(r,a)/2,{x:c,y:l}=_u({clientX:typeof e.position==`object`?e.position.clientX:e.position===`cursor`?this.lastViewportPosition.x:this.state.width/2+this.state.offsetLeft,clientY:typeof e.position==`object`?e.position.clientY:e.position===`cursor`?this.lastViewportPosition.y:this.state.height/2+this.state.offsetTop},this.state),[u,d]=Eb(c-o,l-s,this.getEffectiveGridSize()),f=Lx(t.map(e=>iE(e,{x:e.x+u-n,y:e.y+d-r})),{randomizeSeed:!e.retainSeed}),p=this.scene.getElementsIncludingDeleted(),m=[...p,...f];m=this.props.onDuplicate?.(m,p)||m,Bx(m,Nu(f));let h=this.getTopLayerFrameAtSceneCoords({x:c,y:l});if(h){let e=jT(f,h);MT(m,e,h,this.state)}this.scene.replaceAllElements(m),f.forEach(e=>{R(e)&&Ad(e)&&Pb(e,Bb(e,this.scene.getElementsMapIncludingDeleted()),this.scene.getElementsMapIncludingDeleted())}),Ps&&Jh.loadElementsFonts(f).then(e=>{this.fonts.onLoaded(e)}),e.files&&this.addMissingFiles(e.files),this.store.shouldCaptureIncrement();let g=WT(f);this.setState({...this.state,openSidebar:this.state.openSidebar&&this.device.editor.canFitSidebar&&XI.get(cW)?this.state.openSidebar:null,...By({editingGroupId:null,selectedElementIds:g.reduce((e,t)=>(Ad(t)||(e[t.id]=!0),e),{})},this.scene.getNonDeletedElements(),this.state,this)},()=>{e.files&&this.addNewImagesToImageCache()}),this.setActiveTool({type:`selection`}),e.fitToContent&&this.scrollToContent(f,{fitToContent:!0,canvasOffsets:this.getEditorUIOffsets()})}),v(this,`setAppState`,(e,t)=>{this.setState(e,t)}),v(this,`removePointer`,e=>{oJ&&this.resetContextMenuTimer(),pJ.pointers.delete(e.pointerId)}),v(this,`toggleLock`,(e=`ui`)=>{this.state.activeTool.locked||VL(`toolbar`,`toggleLock`,`${e} (${this.device.editor.isMobile?`mobile`:`desktop`})`),this.setState(e=>({activeTool:{...e.activeTool,...gu(this.state,e.activeTool.locked?{type:`selection`}:e.activeTool),locked:!e.activeTool.locked}}))}),v(this,`updateFrameRendering`,e=>{this.setState(t=>{let n=typeof e==`function`?e(t.frameRendering):e;return{frameRendering:{enabled:n?.enabled??t.frameRendering.enabled,clip:n?.clip??t.frameRendering.clip,name:n?.name??t.frameRendering.name,outline:n?.outline??t.frameRendering.outline}}})}),v(this,`togglePenMode`,e=>{this.setState(t=>({penMode:e??!t.penMode,penDetected:!0}))}),v(this,`onHandToolToggle`,()=>{this.actionManager.executeAction(hz)}),v(this,`zoomCanvas`,e=>{this.setState({...nz({viewportX:this.state.width/2+this.state.offsetLeft,viewportY:this.state.height/2+this.state.offsetTop,nextZoom:Iy(e)},this.state)})}),v(this,`cancelInProgressAnimation`,null),v(this,`scrollToContent`,(e=this.scene.getNonDeletedElements(),t)=>{if(typeof e==`string`){let n;if(n=nC(e)?rC(e):e,n){let r=this.scene.getElementsFromId(n);r?.length?this.scrollToContent(r,{fitToContent:t?.fitToContent??!0,animate:t?.animate??!0}):nC(e)&&this.setState({toast:{message:q(`elementLink.notFound`),duration:3e3,closable:!0}})}return}this.cancelInProgressAnimation?.();let n=Array.isArray(e)?e:[e],r=this.state.zoom,i=this.state.scrollX,a=this.state.scrollY;if(t?.fitToContent||t?.fitToViewport){let{appState:e}=pz({canvasOffsets:t.canvasOffsets,targetElements:n,appState:this.state,fitToViewport:!!t?.fitToViewport,viewportZoomFactor:t?.viewportZoomFactor,minZoom:t?.minZoom,maxZoom:t?.maxZoom});r=e.zoom,i=e.scrollX,a=e.scrollY}else{let e=Fy(n,this.state);i=e.scrollX,a=e.scrollY}if(t?.animate){let e=this.state.scrollX,n=this.state.scrollY,o=this.state.zoom.value,s=pu({fromValues:{scrollX:e,scrollY:n,zoom:o},toValues:{scrollX:i,scrollY:a,zoom:r.value},interpolateValue:(e,t,n,r)=>{if(r===`zoom`)return e*(t/e)**+du(n)},onStep:({scrollX:e,scrollY:t,zoom:n})=>{this.setState({scrollX:e,scrollY:t,zoom:{value:n}})},onStart:()=>{this.setState({shouldCacheIgnoreZoom:!0})},onEnd:()=>{this.setState({shouldCacheIgnoreZoom:!1})},onCancel:()=>{this.setState({shouldCacheIgnoreZoom:!1})},duration:t?.duration??500});this.cancelInProgressAnimation=()=>{s(),this.cancelInProgressAnimation=null}}else this.setState({scrollX:i,scrollY:a,zoom:r})}),v(this,`maybeUnfollowRemoteUser`,()=>{this.state.userToFollow&&this.setState({userToFollow:null})}),v(this,`translateCanvas`,e=>{this.cancelInProgressAnimation?.(),this.maybeUnfollowRemoteUser(),this.setState(e)}),v(this,`setToast`,e=>{this.setState({toast:e})}),v(this,`restoreFileFromShare`,async()=>{try{let e=await caches.open(`web-share-target`),t=await e.match(`shared-file`);if(t){let n=await t.blob(),r=new File([n],n.name||``,{type:n.type});this.loadFileToCanvas(r,null),await e.delete(`shared-file`),window.history.replaceState(null,Rs,window.location.pathname)}}catch(e){this.setState({errorMessage:e.message})}}),v(this,`addFiles`,NK(e=>{let{addedFiles:t}=this.addMissingFiles(e);this.clearImageShapeCache(t),this.scene.triggerUpdate(),this.addNewImagesToImageCache()})),v(this,`addMissingFiles`,(e,t=!1)=>{let n=t?{}:{...this.files},r={},i=Array.isArray(e)?e:Object.values(e);for(let e of i)if(!n[e.id]&&(r[e.id]=e,n[e.id]=e,e.mimeType===j.svg))try{let t=vD(WS(bD(e.dataURL)),j.svg);e.dataURL!==t&&(e.version=(e.version??1)+1,e.dataURL=t)}catch(e){console.error(e)}return this.files=n,{addedFiles:r}}),v(this,`updateScene`,NK(e=>{let t=Vx(e.elements??[]);if(e.captureUpdate&&e.captureUpdate!==G.EVENTUALLY){let n=this.store.snapshot.appState,r=this.store.snapshot.elements,i=e.appState?Object.assign({},n,e.appState):n,a=e.elements?this.store.filterUncomittedElements(this.scene.getElementsMapIncludingDeleted(),Nu(t)):r;e.captureUpdate===G.IMMEDIATELY?this.store.captureIncrement(a,i):e.captureUpdate===G.NEVER&&this.store.updateSnapshot(a,i)}e.appState&&this.setState(e.appState),e.elements&&this.scene.replaceAllElements(t),e.collaborators&&this.setState({collaborators:e.collaborators})})),v(this,`triggerRender`,e=>{e===!0?this.scene.triggerUpdate():this.setState({})}),v(this,`toggleSidebar`,({name:e,tab:t,force:n})=>{let r;r=n===void 0?this.state.openSidebar?.name===e&&this.state.openSidebar?.tab===t?null:e:n?e:null;let i=r?{name:r}:null;return i&&t&&(i.tab=t),this.setState({openSidebar:i}),!!r}),v(this,`updateCurrentCursorPosition`,NK(e=>{this.lastViewportPosition.x=e.clientX,this.lastViewportPosition.y=e.clientY})),v(this,`getEditorUIOffsets`,()=>{let e=this.excalidrawContainerRef?.current?.querySelector(`.App-toolbar`)?.getBoundingClientRect()?.bottom??0,t=this.excalidrawContainerRef?.current?.querySelector(`.sidebar`)?.getBoundingClientRect(),n=this.excalidrawContainerRef?.current?.querySelector(`.App-menu__left`)?.getBoundingClientRect();return aL().rtl?{top:e+16,right:Math.max(this.state.width-(n?.left??this.state.width),0)+16,bottom:16,left:Math.max(t?.right??0,0)+16}:{top:e+16,right:Math.max(this.state.width-(t?.left??this.state.width)+16,0),bottom:16,left:Math.max(n?.right??0,0)+16}}),v(this,`onKeyDown`,NK(e=>{if(`Proxy`in window&&(!e.shiftKey&&/^[A-Z]$/.test(e.key)||e.shiftKey&&/^[a-z]$/.test(e.key))&&(e=new Proxy(e,{get(t,n){let r=t[n];return typeof r==`function`?r.bind(t):n===`key`?e.shiftKey?t.key.toUpperCase():t.key.toLowerCase():r}})),!iu(e.target)){if((e.key===H.ESCAPE||e.key===H.ENTER)&&this.state.croppingElementId){this.finishImageCropping();return}let t=YT(this.scene.getNonDeletedElementsMap(),this.state);if(t.length===1&&ud(t[0])&&e.key===H.ENTER){this.startImageCropping(t[0]);return}if(e.key===H.ESCAPE&&this.flowChartCreator.isCreatingChart){this.flowChartCreator.clear(),this.triggerRender(!0);return}let n=Ng(e.key);if(e[H.CTRL_OR_CMD]&&n&&!e.shiftKey){e.preventDefault();let t=YT(this.scene.getNonDeletedElementsMap(),this.state);t.length===1&&Od(t[0])&&this.flowChartCreator.createNodes(t[0],this.scene.getNonDeletedElementsMap(),this.state,cU(e.key)),this.flowChartCreator.pendingNodes?.length&&!cE(this.flowChartCreator.pendingNodes,this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())&&this.scrollToContent(this.flowChartCreator.pendingNodes,{animate:!0,duration:300,fitToContent:!0,canvasOffsets:this.getEditorUIOffsets()});return}if(e.altKey){let t=YT(this.scene.getNonDeletedElementsMap(),this.state);if(t.length===1&&n){e.preventDefault();let n=this.flowChartNavigator.exploreByDirection(t[0],this.scene.getNonDeletedElementsMap(),cU(e.key));if(n){this.setState(e=>({selectedElementIds:ZT({[n]:!0},e)}));let e=this.scene.getNonDeletedElementsMap().get(n);e&&!cE([e],this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())&&this.scrollToContent(e,{animate:!0,duration:300,canvasOffsets:this.getEditorUIOffsets()})}return}}}if(e[H.CTRL_OR_CMD]&&e.key===H.P&&!e.shiftKey&&!e.altKey){this.setToast({message:q(`commandPalette.shortcutHint`,{shortcut:$V(`commandPalette`)})}),e.preventDefault();return}if(e[H.CTRL_OR_CMD]&&e.key.toLowerCase()===H.V&&(lJ=e.shiftKey,clearTimeout(uJ),uJ=window.setTimeout(()=>{lJ=!1},100)),e[H.CTRL_OR_CMD]&&ou(e.target)&&(e.code===kg.MINUS||e.code===kg.EQUAL)){e.preventDefault();return}if(ou(e.target)&&e.key!==H.ESCAPE||Ng(e.key)&&iu(e.target))return;if(e.key===H.QUESTION_MARK){this.setState({openDialog:{name:`help`}});return}if(e.key.toLowerCase()===H.E&&e.shiftKey&&e[H.CTRL_OR_CMD]){e.preventDefault(),this.setState({openDialog:{name:`imageExport`}});return}if(e.key===H.PAGE_UP||e.key===H.PAGE_DOWN){let t=(e.shiftKey?this.state.width:this.state.height)/this.state.zoom.value;e.key===H.PAGE_DOWN&&(t=-t),e.shiftKey?this.translateCanvas(e=>({scrollX:e.scrollX+t})):this.translateCanvas(e=>({scrollY:e.scrollY+t}))}if(this.state.openDialog?.name===`elementLinkSelector`||this.actionManager.handleKeyDown(e)||this.state.viewModeEnabled)return;if(e[H.CTRL_OR_CMD]&&this.state.isBindingEnabled&&this.setState({isBindingEnabled:!1}),Ng(e.key)){let t=this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}),n=t.find(z),r=new Set;t.filter(z).filter(e=>{let n=e.startBinding&&!t.some(t=>t.id===e.startBinding?.elementId),r=e.endBinding&&!t.some(t=>t.id===e.endBinding?.elementId);return n||r}).forEach(e=>r.add(e.id)),t=t.filter(e=>!r.has(e.id));let i=this.getEffectiveGridSize()&&(e.shiftKey?1:this.getEffectiveGridSize())||(e.shiftKey?5:1),a=0,o=0;e.key===H.ARROW_LEFT?a=-i:e.key===H.ARROW_RIGHT?a=i:e.key===H.ARROW_UP?o=-i:e.key===H.ARROW_DOWN&&(o=i),t.forEach(e=>{K(e,{x:e.x+a,y:e.y+o},!1),ny(e,this.scene.getNonDeletedElementsMap(),{simultaneouslyUpdated:t})}),this.setState({suggestedBindings:Wv(t.filter(e=>e.id!==n?.id||i!==0),this.scene.getNonDeletedElementsMap(),this.state.zoom)}),this.scene.triggerUpdate(),e.preventDefault()}else if(e.key===H.ENTER){let t=this.scene.getSelectedElements(this.state);if(t.length===1){let n=t[0];if(e[H.CTRL_OR_CMD])yd(n)&&(!this.state.editingLinearElement||this.state.editingLinearElement.elementId!==t[0].id)&&(this.store.shouldCaptureIncrement(),z(n)||this.setState({editingLinearElement:new U(n)}));else if(R(n)||qb(n)){let t;R(n)||(t=n);let r=Vb(n,this.state,this.scene.getNonDeletedElementsMap()),i=r.x,a=r.y;this.startTextEditing({sceneX:i,sceneY:a,container:t}),e.preventDefault();return}else gd(n)&&this.setState({editingFrame:n.id})}}else if(!e.ctrlKey&&!e.altKey&&!e.metaKey&&!this.state.newElement&&!this.state.selectionElement&&!this.state.selectedElementsAreBeingDragged){let t=Rg(e.key);t?(this.state.activeTool.type!==t&&VL(`toolbar`,t,`keyboard (${this.device.editor.isMobile?`mobile`:`desktop`})`),t===`arrow`&&this.state.activeTool.type===`arrow`&&this.setState(e=>({currentItemArrowType:e.currentItemArrowType===Vc.sharp?Vc.round:e.currentItemArrowType===Vc.round?Vc.elbow:Vc.sharp})),this.setActiveTool({type:t}),e.stopPropagation()):e.key===H.Q&&(this.toggleLock(`keyboard`),e.stopPropagation())}if(e.key===H.SPACE&&pJ.pointers.size===0&&(nJ=!0,cx(this.interactiveCanvas,Vs.GRAB),e.preventDefault()),(e.key===H.G||e.key===H.S)&&!e.altKey&&!e[H.CTRL_OR_CMD]){let t=this.scene.getSelectedElements(this.state);if(this.state.activeTool.type===`selection`&&!t.length)return;e.key===H.G&&(O_(this.state.activeTool.type)||t.some(e=>O_(e.type)))&&(this.setState({openPopup:`elementBackground`}),e.stopPropagation()),e.key===H.S&&(this.setState({openPopup:`elementStroke`}),e.stopPropagation())}if(!e[H.CTRL_OR_CMD]&&e.shiftKey&&e.key.toLowerCase()===H.F){let t=this.scene.getSelectedElements(this.state);if(this.state.activeTool.type===`selection`&&!t.length)return;(this.state.activeTool.type===`text`||t.find(e=>R(e)||zb(e,this.scene.getNonDeletedElementsMap())))&&(e.preventDefault(),this.setState({openPopup:`fontFamily`}))}if(e.key===H.K&&!e.altKey&&!e[H.CTRL_OR_CMD]){this.state.activeTool.type===`laser`?this.setActiveTool({type:`selection`}):this.setActiveTool({type:`laser`});return}e[H.CTRL_OR_CMD]&&(e.key===H.BACKSPACE||e.key===H.DELETE)&&XI.set(_H,`clearCanvas`);let t=e.key.toLocaleLowerCase(),n=t===H.S&&e.shiftKey,r=e.key===H.I||t===H.G&&e.shiftKey;(n||r)&&this.openEyeDropper({type:n?`stroke`:`background`})})),v(this,`onKeyUp`,NK(e=>{if(e.key===H.SPACE&&(this.state.viewModeEnabled||this.state.openDialog?.name===`elementLinkSelector`?cx(this.interactiveCanvas,Vs.GRAB):this.state.activeTool.type===`selection`?sx(this.interactiveCanvas):(fx(this.interactiveCanvas,this.state),this.setState({selectedElementIds:ZT({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})),nJ=!1),!e[H.CTRL_OR_CMD]&&!this.state.isBindingEnabled&&this.setState({isBindingEnabled:!0}),Ng(e.key)&&(Uv(this.scene.getSelectedElements(this.state).filter(yd),this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements(),this.scene,Pv(this.state),this.state.selectedLinearElement?.selectedPointsIndices??[],this.state.zoom),this.setState({suggestedBindings:[]})),e.altKey||this.flowChartNavigator.isExploring&&(this.flowChartNavigator.clear(),this.syncActionResult({captureUpdate:G.IMMEDIATELY})),!e[H.CTRL_OR_CMD]&&this.flowChartCreator.isCreatingChart){this.flowChartCreator.pendingNodes?.length&&this.scene.insertElements(this.flowChartCreator.pendingNodes);let e=this.flowChartCreator.pendingNodes?.[0];e&&(this.setState(t=>({selectedElementIds:ZT({[e.id]:!0},t)})),cE([e],this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())||this.scrollToContent(e,{animate:!0,duration:300,canvasOffsets:this.getEditorUIOffsets()})),this.flowChartCreator.clear(),this.syncActionResult({captureUpdate:G.IMMEDIATELY})}})),v(this,`isToolSupported`,e=>this.props.UIOptions.tools?.[e]!==!1),v(this,`setActiveTool`,e=>{if(!this.isToolSupported(e.type)){console.warn(`"${e.type}" tool is disabled via "UIOptions.canvasActions.tools.${e.type}"`);return}let t=gu(this.state,e);t.type===`hand`?cx(this.interactiveCanvas,Vs.GRAB):nJ||fx(this.interactiveCanvas,{...this.state,activeTool:t}),ru(document.activeElement)&&this.focusContainer(),xd(t.type)||this.setState({suggestedBindings:[]}),t.type===`image`&&this.onImageAction({insertOnCanvasDirectly:(e.type===`image`&&e.insertOnCanvasDirectly)??!1}),this.setState(e=>{let n={snapLines:e.snapLines.length?[]:e.snapLines,originSnapOffset:null,activeEmbeddable:null};return t.type===`freedraw`&&this.store.shouldCaptureIncrement(),t.type===`selection`?{...e,activeTool:t,...n}:{...e,activeTool:t,selectedElementIds:ZT({},e),selectedGroupIds:ZT({},e),editingGroupId:null,multiElement:null,...n}})}),v(this,`setOpenDialog`,e=>{this.setState({openDialog:e})}),v(this,`setCursor`,e=>{cx(this.interactiveCanvas,e)}),v(this,`resetCursor`,()=>{sx(this.interactiveCanvas)}),v(this,`isTouchScreenMultiTouchGesture`,()=>pJ.pointers.size>=2),v(this,`getName`,()=>this.state.name||this.props.name||`${q(`labels.untitled`)}-${tu()}`),v(this,`onGestureStart`,NK(e=>{e.preventDefault(),this.isTouchScreenMultiTouchGesture()&&this.setState({selectedElementIds:ZT({},this.state),activeEmbeddable:null}),pJ.initialScale=this.state.zoom.value})),v(this,`onGestureChange`,NK(e=>{if(e.preventDefault(),this.isTouchScreenMultiTouchGesture())return;let t=pJ.initialScale;t&&this.setState(n=>({...nz({viewportX:this.lastViewportPosition.x,viewportY:this.lastViewportPosition.y,nextZoom:Iy(t*e.scale)},n)}))})),v(this,`onGestureEnd`,NK(e=>{e.preventDefault(),this.isTouchScreenMultiTouchGesture()&&this.setState({previousSelectedElementIds:{},selectedElementIds:ZT(this.state.previousSelectedElementIds,this.state)}),pJ.initialScale=null})),v(this,`startTextEditing`,({sceneX:e,sceneY:t,insertAtParentCenter:n=!0,container:r,autoEdit:i=!0})=>{let a=!1,o=n&&this.getTextWysiwygSnappedToCenterPosition(e,t,this.state,r);r&&o&&(zb(r,this.scene.getNonDeletedElementsMap())||(a=!0));let s=null,c=this.scene.getSelectedElements(this.state);s=c.length===1?R(c[0])?c[0]:r?zb(c[0],this.scene.getNonDeletedElementsMap()):this.getTextElementAtPosition(e,t):this.getTextElementAtPosition(e,t);let l=s?.fontFamily||this.state.currentItemFontFamily,u=s?.lineHeight||Xh(l),d=this.state.currentItemFontSize;if(!s&&a&&r&&!bd(r)){let n=Rd(cu({fontSize:d,fontFamily:l}),u),i=Gd(d,u),a=Math.max(r.height,i),s=Math.max(r.width,n);K(r,{height:a,width:s}),e=r.x+s/2,t=r.y+a/2,o&&=this.getTextWysiwygSnappedToCenterPosition(e,t,this.state,r)}let f=this.getTopLayerFrameAtSceneCoords({x:e,y:t}),p=s||wx({x:o?o.elementCenterX:e,y:o?o.elementCenterY:t,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,text:``,fontSize:d,fontFamily:l,textAlign:o?`center`:this.state.currentItemTextAlign,verticalAlign:o?Ec.MIDDLE:`top`,containerId:a?r?.id:void 0,groupIds:r?.groupIds??[],lineHeight:u,angle:r?.angle??0,frameId:f?f.id:null});if(!s&&a&&r&&K(r,{boundElements:(r.boundElements||[]).concat({type:`text`,id:p.id})}),this.setState({editingTextElement:p}),!s){if(r&&a){let e=this.scene.getElementIndex(r.id);this.scene.insertElementAtIndex(p,e+1)}else this.scene.insertElement(p)}i||s||r?this.handleTextWysiwyg(p,{isExistingElement:!!s}):this.setState({newElement:p,multiElement:null})}),v(this,`startImageCropping`,e=>{this.store.shouldCaptureIncrement(),this.setState({croppingElementId:e.id})}),v(this,`finishImageCropping`,()=>{this.state.croppingElementId&&(this.store.shouldCaptureIncrement(),this.setState({croppingElementId:null}))}),v(this,`handleCanvasDoubleClick`,e=>{if(this.state.multiElement||this.state.activeTool.type!==`selection`)return;let t=this.scene.getSelectedElements(this.state),{x:n,y:r}=_u(e,this.state);if(t.length===1&&yd(t[0])){if(e[H.CTRL_OR_CMD]&&(!this.state.editingLinearElement||this.state.editingLinearElement.elementId!==t[0].id)&&!z(t[0])){this.store.shouldCaptureIncrement(),this.setState({editingLinearElement:new U(t[0])});return}if(this.state.selectedLinearElement&&z(t[0])){let e=U.getSegmentMidpointHitCoords(this.state.selectedLinearElement,{x:n,y:r},this.state,this.scene.getNonDeletedElementsMap()),i=e?U.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,e,this.scene.getNonDeletedElementsMap()):-1;if(i&&i>-1){this.store.shouldCaptureIncrement(),U.deleteFixedSegment(t[0],i);let a=U.getSegmentMidpointHitCoords({...this.state.selectedLinearElement,segmentMidPointHoveredCoords:null},{x:n,y:r},this.state,this.scene.getNonDeletedElementsMap()),o=a?U.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,a,this.scene.getNonDeletedElementsMap()):null;this.setState({selectedLinearElement:{...this.state.selectedLinearElement,pointerDownState:{...this.state.selectedLinearElement.pointerDownState,segmentMidpoint:{index:o,value:e,added:!1}},segmentMidPointHoveredCoords:a}});return}}}if(t.length===1&&ud(t[0])){this.startImageCropping(t[0]);return}if(sx(this.interactiveCanvas),Uy(this.state).length>0){let e=this.getElementAtPosition(n,r),t=e&&Jy(e,this.state.selectedGroupIds);if(t){this.store.shouldCaptureIncrement(),this.setState(n=>({...n,...By({editingGroupId:t,selectedElementIds:{[e.id]:!0}},this.scene.getNonDeletedElements(),n,this)}));return}}if(sx(this.interactiveCanvas),!e[H.CTRL_OR_CMD]&&!this.state.viewModeEnabled){let t=this.getElementAtPosition(n,r);if(pd(t)){this.setState({activeEmbeddable:{element:t,state:`active`}});return}let i=this.getTextBindableContainerAtPosition(n,r);if(i&&(kd(i)||!Eu(i.backgroundColor)||xg({x:n,y:r,element:i,shape:zg(i,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()}))){let e=Vb(i,this.state,this.scene.getNonDeletedElementsMap());n=e.x,r=e.y}this.startTextEditing({sceneX:n,sceneY:r,insertAtParentCenter:!e.altKey,container:i})}}),v(this,`getElementLinkAtPosition`,(e,t)=>{let n=this.scene.getNonDeletedElements(),r=-1;for(let i=n.length-1;i>=0;i--){let a=n[i];if(t&&a.id===t.id&&(r=i),a.link&&i>=r&&YS(a,this.scene.getNonDeletedElementsMap(),this.state,P(e.x,e.y),this.device.editor.isMobile))return a}}),v(this,`redirectToLink`,(e,t)=>{let n=Tl(P(this.lastPointerDownEvent.clientX,this.lastPointerDownEvent.clientY),P(this.lastPointerUpEvent.clientX,this.lastPointerUpEvent.clientY));if(!this.hitLinkElement||n>10)return;let r=_u(this.lastPointerDownEvent,this.state),i=this.scene.getNonDeletedElementsMap(),a=YS(this.hitLinkElement,i,this.state,P(r.x,r.y),this.device.editor.isMobile),o=_u(this.lastPointerUpEvent,this.state),s=YS(this.hitLinkElement,i,this.state,P(o.x,o.y),this.device.editor.isMobile);if(a&&s){MB();let t=this.hitLinkElement.link;if(t){t=Qb(t);let n;if(this.props.onLinkOpen&&(n=Bu(`excalidraw-link`,e.nativeEvent),this.props.onLinkOpen({...this.hitLinkElement,link:t},n)),!n?.defaultPrevented){let e=$b(t)?`_self`:`_blank`,n=window.open(void 0,e);n&&(n.opener=null,n.location=t)}}}}),v(this,`getTopLayerFrameAtSceneCoords`,e=>{let t=this.scene.getNonDeletedElementsMap(),n=this.scene.getNonDeletedFramesLikes().filter(n=>ST(e,n,t));return n.length?n[n.length-1]:null}),v(this,`handleCanvasPointerMove`,e=>{this.savePointer(e.clientX,e.clientY,this.state.cursorButton),this.lastPointerMoveEvent=e.nativeEvent,pJ.pointers.has(e.pointerId)&&pJ.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY});let t=pJ.initialScale;if(pJ.pointers.size===2&&pJ.lastCenter&&t&&pJ.initialDistance){let e=HH(pJ.pointers),n=e.x-pJ.lastCenter.x,r=e.y-pJ.lastCenter.y;pJ.lastCenter=e;let i=UH(Array.from(pJ.pointers.values())),a=this.state.activeTool.type===`freedraw`&&this.state.penMode?1:i/pJ.initialDistance,o=a?Iy(t*a):this.state.zoom.value;this.setState(t=>{let i=nz({viewportX:e.x,viewportY:e.y,nextZoom:o},t);this.translateCanvas({zoom:i.zoom,scrollX:i.scrollX+n/o*2,scrollY:i.scrollY+r/o*2,shouldCacheIgnoreZoom:!0})}),this.resetShouldCacheIgnoreZoomDebounced()}else pJ.lastCenter=pJ.initialDistance=pJ.initialScale=null;if(nJ||rJ||iJ||$c(this.state))return;let n=kU(aJ,e.clientX-this.state.offsetLeft,e.clientY-this.state.offsetTop).isOverEither;!this.state.newElement&&!this.state.selectionElement&&!this.state.selectedElementsAreBeingDragged&&!this.state.multiElement&&(n?sx(this.interactiveCanvas):fx(this.interactiveCanvas,this.state));let r=_u(e,this.state),{x:i,y:a}=r;if(!this.state.newElement&&Tb(this.state.activeTool.type)){let{originOffset:t,snapLines:n}=wb(this.scene.getNonDeletedElements(),this,{x:i,y:a},e,this.scene.getNonDeletedElementsMap());this.setState(e=>{let r=$u(e.snapLines,n),i=e.originSnapOffset?$u(e.originSnapOffset,t):t;return e.snapLines===r&&e.originSnapOffset===i?null:{snapLines:r,originSnapOffset:i}})}else!this.state.newElement&&!this.state.selectedElementsAreBeingDragged&&!this.state.selectionElement&&this.setState(e=>e.snapLines.length?{snapLines:[]}:null);if(this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging){let t=U.handlePointerMove(e,i,a,this,this.scene.getNonDeletedElementsMap());t&&t!==this.state.editingLinearElement&&(0,mk.flushSync)(()=>{this.setState({editingLinearElement:t})}),t?.lastUncommittedPoint==null?(0,mk.flushSync)(()=>{this.setState({suggestedBindings:[]})}):this.maybeSuggestBindingAtCursor(r,t.elbowed)}if(Cd(this.state.activeTool.type)){let{newElement:e}=this.state;Sd(e,!1)?this.maybeSuggestBindingsForLinearElementAtCoords(e,[r],this.state.startBoundElement):this.maybeSuggestBindingAtCursor(r,!1)}if(this.state.multiElement){let{multiElement:t}=this.state,{x:n,y:r}=t,{points:o,lastCommittedPoint:s}=t,c=o[o.length-1];if(fx(this.interactiveCanvas,this.state),c===s)Tl(P(i-n,a-r),c)>=8?K(t,{points:[...o,P(i-n,a-r)]},!1):cx(this.interactiveCanvas,Vs.POINTER);else if(o.length>2&&s&&Tl(P(i-n,a-r),s)<8)cx(this.interactiveCanvas,Vs.POINTER),K(t,{points:o.slice(0,-1)},!1);else{let[s,c]=Eb(i,a,e[H.CTRL_OR_CMD]||z(t)?null:this.getEffectiveGridSize()),[l,u]=t?.lastCommittedPoint??[0,0],d=s-n-l,f=c-r-u;Ig(e)&&({width:d,height:f}=uE(l+n,u+r,s,c)),Xg(o,this.state.zoom.value)&&cx(this.interactiveCanvas,Vs.POINTER),K(t,{points:[...o.slice(0,-1),P(l+d,u+f)]},!1,{isDragging:!0}),this.triggerRender(!1)}return}if(e.buttons||this.state.activeTool.type!==`selection`&&this.state.activeTool.type!==`text`&&this.state.activeTool.type!==`eraser`)return;let o=this.scene.getNonDeletedElements(),s=this.scene.getSelectedElements(this.state);if(s.length===1&&!n&&!this.state.editingLinearElement){if(this.state.selectedLinearElement&&this.handleHoverSelectedLinearElement(this.state.selectedLinearElement,i,a),(!this.state.selectedLinearElement||this.state.selectedLinearElement.hoverPointIndex===-1)&&this.state.openDialog?.name!==`elementLinkSelector`&&!(s.length===1&&z(s[0]))){let t=TE(o,this.state,i,a,this.state.zoom,e.pointerType,this.scene.getNonDeletedElementsMap(),this.device);if(t&&t.transformHandleType){cx(this.interactiveCanvas,kE(t));return}}}else if(s.length>1&&!n&&this.state.openDialog?.name!==`elementLinkSelector`){let t=EE(bv(s),i,a,this.state.zoom,e.pointerType,this.device);if(t){cx(this.interactiveCanvas,kE({transformHandleType:t}));return}}let c=this.getElementAtPosition(r.x,r.y);this.hitLinkElement=this.getElementLinkAtPosition(r,c),!Qc(this.state)&&(this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id]?(cx(this.interactiveCanvas,Vs.POINTER),AB(this.hitLinkElement,this.state,this.scene.getNonDeletedElementsMap())):(MB(),c&&(c.link||dd(c))&&this.state.selectedElementIds[c.id]&&!this.state.contextMenu&&!this.state.showHyperlinkPopup?this.setState({showHyperlinkPopup:`info`}):this.state.activeTool.type===`text`?cx(this.interactiveCanvas,R(c)?Vs.TEXT:Vs.CROSSHAIR):this.state.viewModeEnabled?cx(this.interactiveCanvas,Vs.GRAB):this.state.openDialog?.name===`elementLinkSelector`||n?cx(this.interactiveCanvas,Vs.AUTO):this.state.selectedLinearElement?this.handleHoverSelectedLinearElement(this.state.selectedLinearElement,i,a):e[H.CTRL_OR_CMD]?cx(this.interactiveCanvas,Vs.AUTO):(c||this.isHittingCommonBoundingBoxOfSelectedElements(r,s))&&!c?.locked&&(c&&pd(c)&&this.isIframeLikeElementCenter(c,e,i,a)?(cx(this.interactiveCanvas,Vs.POINTER),this.setState({activeEmbeddable:{element:c,state:`hover`}})):(!c||!z(c))&&(cx(this.interactiveCanvas,Vs.MOVE),this.state.activeEmbeddable?.state===`hover`&&this.setState({activeEmbeddable:null})))),this.state.openDialog?.name===`elementLinkSelector`&&c?this.setState(e=>({hoveredElementIds:$u(e.hoveredElementIds,By({editingGroupId:e.editingGroupId,selectedElementIds:{[c.id]:!0}},this.scene.getNonDeletedElements(),e,this).selectedElementIds)})):this.state.openDialog?.name===`elementLinkSelector`&&!c&&this.setState(e=>({hoveredElementIds:$u(e.hoveredElementIds,{})})))}),v(this,`handleEraser`,(e,t,n)=>{this.eraserTrail.addPointToPath(n.x,n.y);let r=!1,i=new Set,a=this.scene.getNonDeletedElements(),o=t=>{for(let n of t){if(n.locked)return;if(e.altKey?this.elementsPendingErasure.delete(n.id)&&(r=!0):this.elementsPendingErasure.has(n.id)||(r=!0,this.elementsPendingErasure.add(n.id)),r&&n.groupIds?.length){let t=n.groupIds.at(-1);if(!i.has(t)){i.add(t);let n=qy(a,t);for(let t of n)e.altKey?this.elementsPendingErasure.delete(t.id):this.elementsPendingErasure.add(t.id)}}}},s=Tl(P(t.lastCoords.x,t.lastCoords.y),P(n.x,n.y)),c=this.getElementHitThreshold(),l={...t.lastCoords},u=0;for(;u<=s&&(o(this.getElementsAtPosition(l.x,l.y)),u!==s);){u=Math.min(u+c,s);let e=u/s,t=(1-e)*l.x+e*n.x,r=(1-e)*l.y+e*n.y;l.x=t,l.y=r}if(t.lastCoords.x=n.x,t.lastCoords.y=n.y,r){for(let t of this.scene.getNonDeletedElements())Ad(t)&&(this.elementsPendingErasure.has(t.id)||this.elementsPendingErasure.has(t.containerId))&&(e.altKey?(this.elementsPendingErasure.delete(t.id),this.elementsPendingErasure.delete(t.containerId)):(this.elementsPendingErasure.add(t.id),this.elementsPendingErasure.add(t.containerId)));this.elementsPendingErasure=new Set(this.elementsPendingErasure),this.triggerRender()}}),v(this,`handleTouchMove`,e=>{sJ=!0}),v(this,`handleCanvasPointerDown`,e=>{let t=e.target;if(t.setPointerCapture&&t.setPointerCapture(e.pointerId),this.maybeCleanupAfterMissingPointerUp(e.nativeEvent),this.maybeUnfollowRemoteUser(),this.state.searchMatches&&(this.setState(e=>({searchMatches:e.searchMatches.map(e=>({...e,focus:!1}))})),XI.set(PW,null)),this.state.contextMenu&&this.setState({contextMenu:null}),this.state.snapLines&&this.setAppState({snapLines:[]}),this.updateGestureOnPointerDown(e),e.pointerType===`touch`&&this.state.newElement&&this.state.newElement.type===`freedraw`){let e=this.state.newElement;this.updateScene({...e.points.length<10?{elements:this.scene.getElementsIncludingDeleted().filter(t=>t.id!==e.id)}:{},appState:{newElement:null,editingTextElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:ZT(Object.keys(this.state.selectedElementIds).filter(t=>t!==e.id).reduce((e,t)=>(e[t]=this.state.selectedElementIds[t],e),{}),this.state)},captureUpdate:this.state.openDialog?.name===`elementLinkSelector`?G.EVENTUALLY:G.NEVER});return}let n=document.getSelection();if(n?.anchorNode&&n.removeAllRanges(),this.maybeOpenContextMenuAfterPointerDownOnTouchDevices(e),!this.state.penDetected&&e.pointerType===`pen`&&this.setState(e=>({penMode:!0,penDetected:!0})),!this.device.isTouchScreen&&[`pen`,`touch`].includes(e.pointerType)&&(this.device=Vu(this.device,{isTouchScreen:!0})),rJ||(this.lastPointerDownEvent=e,this.handleCanvasPanUsingWheelOrSpaceDrag(e)))return;if(this.setState({lastPointerDownWith:e.pointerType,cursorButton:`down`}),this.savePointer(e.clientX,e.clientY,`down`),e.button===Hs.ERASER&&this.state.activeTool.type!==Rc.eraser){this.setState({activeTool:gu(this.state,{type:Rc.eraser,lastActiveToolBeforeEraser:this.state.activeTool})},()=>{this.handleCanvasPointerDown(e);let t=()=>{n(),r?.(),Qc(this.state)&&this.setState({activeTool:gu(this.state,{...this.state.activeTool.lastActiveTool||{type:Rc.selection},lastActiveToolBeforeEraser:null})})},n=ed(window,`pointerup`,t,{once:!0}),r;requestAnimationFrame(()=>{r=this.missingPointerEventCleanupEmitter.once(t)})});return}if(e.button!==Hs.MAIN&&e.button!==Hs.TOUCH&&e.button!==Hs.ERASER||pJ.pointers.size>1)return;let r=this.initialPointerDownState(e);if(this.setState({selectedElementsAreBeingDragged:!1}),this.handleDraggingScrollBar(e,r)||(this.clearSelectionIfNotUsingSelection(),this.updateBindingEnabledOnPointerMove(e),this.handleSelectionOnPointerDown(e,r))||!(!this.state.penMode||e.pointerType!==`touch`||this.state.activeTool.type===`selection`||this.state.activeTool.type===`text`||this.state.activeTool.type===`image`))return;if(this.state.activeTool.type===`text`)this.handleTextOnPointerDown(e,r);else if(this.state.activeTool.type===`arrow`||this.state.activeTool.type===`line`)this.handleLinearElementOnPointerDown(e,this.state.activeTool.type,r);else if(this.state.activeTool.type===`image`){cx(this.interactiveCanvas,Vs.CROSSHAIR);let t=this.state.pendingImageElementId&&this.scene.getElement(this.state.pendingImageElementId);if(!t)return;this.setState({newElement:t,pendingImageElementId:null,multiElement:null});let{x:n,y:r}=_u(e,this.state),i=this.getTopLayerFrameAtSceneCoords({x:n,y:r});K(t,{x:n,y:r,frameId:i?i.id:null})}else this.state.activeTool.type===`freedraw`?this.handleFreeDrawElementOnPointerDown(e,this.state.activeTool.type,r):this.state.activeTool.type===`custom`?fx(this.interactiveCanvas,this.state):this.state.activeTool.type===Rc.frame||this.state.activeTool.type===Rc.magicframe?this.createFrameElementOnPointerDown(r,this.state.activeTool.type):this.state.activeTool.type===`laser`?this.laserTrails.startPath(r.lastCoords.x,r.lastCoords.y):this.state.activeTool.type!==`eraser`&&this.state.activeTool.type!==`hand`&&this.createGenericElementOnPointerDown(this.state.activeTool.type,r);this.props?.onPointerDown?.(this.state.activeTool,r),this.onPointerDownEmitter.trigger(this.state.activeTool,r,e),this.state.activeTool.type===`eraser`&&this.eraserTrail.startPath(r.lastCoords.x,r.lastCoords.y);let i=this.onPointerMoveFromPointerDownHandler(r),a=this.onPointerUpFromPointerDownHandler(r),o=this.onKeyDownFromPointerDownHandler(r),s=this.onKeyUpFromPointerDownHandler(r);this.missingPointerEventCleanupEmitter.once(t=>a(t||e.nativeEvent)),(!this.state.viewModeEnabled||this.state.activeTool.type===`laser`)&&(window.addEventListener(`pointermove`,i),window.addEventListener(`pointerup`,a),window.addEventListener(`keydown`,o),window.addEventListener(`keyup`,s),r.eventListeners.onMove=i,r.eventListeners.onUp=a,r.eventListeners.onKeyUp=s,r.eventListeners.onKeyDown=o)}),v(this,`handleCanvasPointerUp`,e=>{this.removePointer(e),this.lastPointerUpEvent=e;let t=_u({clientX:e.clientX,clientY:e.clientY},this.state),n=e.timeStamp-(this.lastPointerDownEvent?.timeStamp??0);if(this.device.editor.isMobile&&n<300){let n=this.getElementAtPosition(t.x,t.y);if(pd(n)&&this.isIframeLikeElementCenter(n,e,t.x,t.y)){this.handleEmbeddableCenterClick(n);return}}if(this.device.isTouchScreen){let e=this.getElementAtPosition(t.x,t.y);this.hitLinkElement=this.getElementLinkAtPosition(t,e)}this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id]?n<300&&pd(this.hitLinkElement)&&!JS(this.hitLinkElement,this.scene.getNonDeletedElementsMap(),this.state,P(t.x,t.y))?this.handleEmbeddableCenterClick(this.hitLinkElement):this.redirectToLink(e,this.device.isTouchScreen):this.state.viewModeEnabled&&this.setState({activeEmbeddable:null,selectedElementIds:{}})}),v(this,`maybeOpenContextMenuAfterPointerDownOnTouchDevices`,e=>{e.pointerType===`touch`&&(sJ=!1,oJ?sJ=!0:oJ=window.setTimeout(()=>{oJ=0,sJ||this.handleCanvasContextMenu(e)},500))}),v(this,`resetContextMenuTimer`,()=>{clearTimeout(oJ),oJ=0,sJ=!1}),v(this,`maybeCleanupAfterMissingPointerUp`,e=>{fJ?.(),this.missingPointerEventCleanupEmitter.trigger(e).clear()}),v(this,`handleCanvasPanUsingWheelOrSpaceDrag`,e=>{if(!(pJ.pointers.size<=1&&(e.button===Hs.WHEEL||e.button===Hs.MAIN&&nJ||$c(this.state)||this.state.viewModeEnabled)))return!1;rJ=!0,this.focusContainer(),this.state.editingTextElement||e.preventDefault();let t=!1,n=/Linux/.test(window.navigator.platform);cx(this.interactiveCanvas,Vs.GRABBING);let{clientX:r,clientY:i}=e,a=PK(e=>{let a=r-e.clientX,o=i-e.clientY;if(r=e.clientX,i=e.clientY,n&&!t&&(Math.abs(a)>1||Math.abs(o)>1)){t=!0;let e=t=>{document.body.removeEventListener(`paste`,e),t.stopPropagation()},n=()=>{setTimeout(()=>{document.body.removeEventListener(`paste`,e),window.removeEventListener(`pointerup`,n)},100)};document.body.addEventListener(`paste`,e),window.addEventListener(`pointerup`,n)}this.translateCanvas({scrollX:this.state.scrollX-a/this.state.zoom.value,scrollY:this.state.scrollY-o/this.state.zoom.value})}),o=NK(fJ=()=>{fJ=null,rJ=!1,nJ||(this.state.viewModeEnabled?cx(this.interactiveCanvas,Vs.GRAB):fx(this.interactiveCanvas,this.state)),this.setState({cursorButton:`up`}),this.savePointer(e.clientX,e.clientY,`up`),window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o),window.removeEventListener(`blur`,o),a.flush()});return window.addEventListener(`blur`,o),window.addEventListener(`pointermove`,a,{passive:!0}),window.addEventListener(`pointerup`,o),!0}),v(this,`clearSelectionIfNotUsingSelection`,()=>{this.state.activeTool.type!==`selection`&&this.setState({selectedElementIds:ZT({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})}),v(this,`handleSelectionOnPointerDown`,(e,t)=>{if(this.state.activeTool.type===`selection`){let n=this.scene.getNonDeletedElements(),r=this.scene.getNonDeletedElementsMap(),i=this.scene.getSelectedElements(this.state);if(i.length===1&&!this.state.editingLinearElement&&!z(i[0])&&!(this.state.selectedLinearElement&&this.state.selectedLinearElement.hoverPointIndex!==-1)){let r=TE(n,this.state,t.origin.x,t.origin.y,this.state.zoom,e.pointerType,this.scene.getNonDeletedElementsMap(),this.device);r!=null&&(r.transformHandleType===`rotation`?(this.setState({resizingElement:r.element}),t.resize.handleType=r.transformHandleType):(this.state.croppingElementId||this.setState({resizingElement:r.element}),t.resize.handleType=r.transformHandleType))}else i.length>1&&(t.resize.handleType=EE(bv(i),t.origin.x,t.origin.y,this.state.zoom,e.pointerType,this.device));if(t.resize.handleType)t.resize.isResizing=!0,t.resize.offset=Su(LE(t.resize.handleType,i,r,t.origin.x,t.origin.y)),i.length===1&&yd(i[0])&&i[0].points.length===2&&(t.resize.arrowDirection=RE(t.resize.handleType,i[0]));else{if(this.state.selectedLinearElement){let n=this.state.editingLinearElement||this.state.selectedLinearElement,r=U.handlePointerDown(e,this,this.store,t.origin,n,this.scene);if(r.hitElement&&(t.hit.element=r.hitElement),r.linearElementEditor&&(this.setState({selectedLinearElement:r.linearElementEditor}),this.state.editingLinearElement&&this.setState({editingLinearElement:r.linearElementEditor})),r.didAddPoint)return!0}if(t.hit.element=t.hit.element??this.getElementAtPosition(t.origin.x,t.origin.y),this.hitLinkElement=this.getElementLinkAtPosition(t.origin,t.hit.element),this.hitLinkElement)return!0;if(this.state.croppingElementId&&t.hit.element?.id!==this.state.croppingElementId&&this.finishImageCropping(),t.hit.element&&this.getElementLinkAtPosition({x:t.origin.x,y:t.origin.y},t.hit.element))return!1;t.hit.allHitElements=this.getElementsAtPosition(t.origin.x,t.origin.y);let n=t.hit.element,r=t.hit.allHitElements.some(e=>this.isASelectedElement(e));if((n===null||!r)&&!e.shiftKey&&!t.hit.hasHitCommonBoundingBoxOfSelectedElements&&this.clearSelection(n),this.state.editingLinearElement)this.setState({selectedElementIds:ZT({[this.state.editingLinearElement.elementId]:!0},this.state)});else if(n!=null){if(e[H.CTRL_OR_CMD])return this.state.selectedElementIds[n.id]||(t.hit.wasAddedToSelection=!0),this.setState(e=>({...Gy(e,n),previousSelectedElementIds:this.state.selectedElementIds})),!1;this.state.selectedElementIds[n.id]||(this.state.editingGroupId&&!Ky(n,this.state.editingGroupId)&&this.setState({selectedElementIds:ZT({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null}),!r&&!t.hit.hasHitCommonBoundingBoxOfSelectedElements&&(this.setState(e=>{let t={...e.selectedElementIds,[n.id]:!0},r=[];if(Object.keys(e.selectedElementIds).forEach(e=>{let t=this.scene.getElement(e);t&&r.push(t)}),gd(n))wT(r,n.id).forEach(e=>{delete t[e.id]});else if(n.frameId)t[n.frameId]&&delete t[n.id];else{let e=n.groupIds,i=new Set(e.flatMap(e=>qy(this.scene.getNonDeletedElements(),e)).filter(e=>gd(e)).map(e=>e.id));i.size>0&&r.forEach(e=>{e.frameId&&i.has(e.frameId)&&(delete t[e.id],e.groupIds.flatMap(e=>qy(this.scene.getNonDeletedElements(),e)).forEach(e=>{delete t[e.id]}))})}return e.openDialog?.name===`elementLinkSelector`&&(n.groupIds.some(t=>e.selectedGroupIds[t])||(t={[n.id]:!0})),{...By({editingGroupId:e.editingGroupId,selectedElementIds:t},this.scene.getNonDeletedElements(),e,this),showHyperlinkPopup:n.link||dd(n)?`info`:!1}}),t.hit.wasAddedToSelection=!0))}this.setState({previousSelectedElementIds:this.state.selectedElementIds})}}return!1}),v(this,`handleTextOnPointerDown`,(e,t)=>{if(this.state.editingTextElement)return;let n=t.origin.x,r=t.origin.y,i=this.getElementAtPosition(n,r,{includeBoundTextElement:!0}),a=this.getTextBindableContainerAtPosition(n,r);kd(i)&&(a=i,n=i.x+i.width/2,r=i.y+i.height/2),this.startTextEditing({sceneX:n,sceneY:r,insertAtParentCenter:!e.altKey,container:a,autoEdit:!1}),sx(this.interactiveCanvas),this.state.activeTool.locked||this.setState({activeTool:gu(this.state,{type:`selection`})})}),v(this,`handleFreeDrawElementOnPointerDown`,(e,t,n)=>{let[r,i]=Eb(n.origin.x,n.origin.y,null),a=this.getTopLayerFrameAtSceneCoords({x:r,y:i}),o=e.pressure===.5,s=Ox({type:t,x:r,y:i,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:null,simulatePressure:o,locked:!1,frameId:a?a.id:null,points:[P(0,0)],pressures:o?[]:[e.pressure]});this.scene.insertElement(s),this.setState(e=>{let t={...e.selectedElementIds};return delete t[s.id],{selectedElementIds:ZT(t,e)}});let c=Qv(n.origin,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom);this.setState({newElement:s,startBoundElement:c,suggestedBindings:[]})}),v(this,`insertIframeElement`,({sceneX:e,sceneY:t,width:n,height:r})=>{let[i,a]=Eb(e,t,this.lastPointerDownEvent?.[H.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),o=bx({type:`iframe`,x:i,y:a,strokeColor:`transparent`,backgroundColor:`transparent`,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:this.getCurrentItemRoundness(`iframe`),opacity:this.state.currentItemOpacity,locked:!1,width:n,height:r});return this.scene.insertElement(o),o}),v(this,`insertEmbeddableElement`,({sceneX:e,sceneY:t,link:n})=>{let[r,i]=Eb(e,t,this.lastPointerDownEvent?.[H.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),a=bS(n);if(!a)return;a.error instanceof URIError&&this.setToast({message:q(`toast.unrecognizedLinkFormat`),closable:!0});let o=yx({type:`embeddable`,x:r,y:i,strokeColor:`transparent`,backgroundColor:`transparent`,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:this.getCurrentItemRoundness(`embeddable`),opacity:this.state.currentItemOpacity,locked:!1,width:a.intrinsicSize.w,height:a.intrinsicSize.h,link:n});return this.scene.insertElement(o),o}),v(this,`createImageElement`,({sceneX:e,sceneY:t,addToFrameUnderCursor:n=!0})=>{let[r,i]=Eb(e,t,this.lastPointerDownEvent?.[H.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),a=n?this.getTopLayerFrameAtSceneCoords({x:r,y:i}):null;return jx({type:`image`,x:r,y:i,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:null,opacity:this.state.currentItemOpacity,locked:!1,frameId:a?a.id:null})}),v(this,`handleLinearElementOnPointerDown`,(e,t,n)=>{if(this.state.multiElement){let{multiElement:e}=this.state;if(e.type===`line`&&Xg(e.points,this.state.zoom.value)){K(e,{lastCommittedPoint:e.points[e.points.length-1]}),this.actionManager.executeAction(gz);return}if(z(e)&&e.points.length>1){K(e,{lastCommittedPoint:e.points[e.points.length-1]}),this.actionManager.executeAction(gz);return}let{x:t,y:r,lastCommittedPoint:i}=e;if(e.points.length>1&&i&&Tl(P(n.origin.x-t,n.origin.y-r),i)<8){this.actionManager.executeAction(gz);return}this.setState(t=>({selectedElementIds:ZT({...t.selectedElementIds,[e.id]:!0},t)})),K(e,{lastCommittedPoint:e.points[e.points.length-1]}),cx(this.interactiveCanvas,Vs.POINTER)}else{let[r,i]=Eb(n.origin.x,n.origin.y,e[H.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),a=this.getTopLayerFrameAtSceneCoords({x:r,y:i}),{currentItemStartArrowhead:o,currentItemEndArrowhead:s}=this.state,[c,l]=t===`arrow`?[o,s]:[null,null],u=t===`arrow`?Ax({type:t,x:r,y:i,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:this.state.currentItemArrowType===Vc.round?{type:jc.PROPORTIONAL_RADIUS}:null,startArrowhead:c,endArrowhead:l,locked:!1,frameId:a?a.id:null,elbowed:this.state.currentItemArrowType===Vc.elbow,fixedSegments:this.state.currentItemArrowType===Vc.elbow?[]:null}):kx({type:t,x:r,y:i,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:this.state.currentItemRoundness===`round`?{type:jc.PROPORTIONAL_RADIUS}:null,locked:!1,frameId:a?a.id:null});this.setState(e=>{let t={...e.selectedElementIds};return delete t[u.id],{selectedElementIds:ZT(t,e)}}),K(u,{points:[...u.points,P(0,0)]});let d=Qv(n.origin,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,z(u),z(u));this.scene.insertElement(u),this.setState({newElement:u,startBoundElement:d,suggestedBindings:[]})}}),v(this,`createGenericElementOnPointerDown`,(e,t)=>{let[n,r]=Eb(t.origin.x,t.origin.y,this.lastPointerDownEvent?.[H.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),i=this.getTopLayerFrameAtSceneCoords({x:n,y:r}),a={x:n,y:r,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:this.getCurrentItemRoundness(e),locked:!1,frameId:i?i.id:null},o;o=e===`embeddable`?yx({type:`embeddable`,...a}):vx({type:e,...a}),o.type===`selection`?this.setState({selectionElement:o}):(this.scene.insertElement(o),this.setState({multiElement:null,newElement:o}))}),v(this,`createFrameElementOnPointerDown`,(e,t)=>{let[n,r]=Eb(e.origin.x,e.origin.y,this.lastPointerDownEvent?.[H.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),i={x:n,y:r,opacity:this.state.currentItemOpacity,locked:!1,...$s},a=t===Rc.magicframe?Sx(i):xx(i);this.scene.insertElement(a),this.setState({multiElement:null,newElement:a})}),v(this,`restoreReadyToEraseElements`,()=>{this.elementsPendingErasure=new Set,this.triggerRender()}),v(this,`eraseElements`,()=>{let e=!1,t=this.scene.getElementsIncludingDeleted().map(t=>this.elementsPendingErasure.has(t.id)||t.frameId&&this.elementsPendingErasure.has(t.frameId)||Ad(t)&&this.elementsPendingErasure.has(t.containerId)?(e=!0,iE(t,{isDeleted:!0})):t);this.elementsPendingErasure=new Set,e&&(this.store.shouldCaptureIncrement(),this.scene.replaceAllElements(t))}),v(this,`initializeImage`,async({imageFile:e,imageElement:t,showCursorImagePreview:n=!1})=>{if(!uD(e))throw Error(q(`errors.unsupportedFileType`));let r=e.type;if(cx(this.interactiveCanvas,`wait`),r===j.svg)try{e=SD(WS(await e.text()),e.name)}catch(e){throw console.warn(e),Error(q(`errors.svgImageInsertError`))}let i=await(this.props.generateIdForFile?.(e)||gD(e));if(!i)throw console.warn("Couldn't generate file id or the supplied `generateIdForFile` didn't resolve to one."),Error(q(`errors.imageInsertError`));if(!this.files[i]?.dataURL){try{e=await xD(e,{maxWidthOrHeight:bc})}catch(e){console.error(`Error trying to resizing image file on insertion`,e)}if(e.size>4194304)throw Error(q(`errors.fileTooBig`,{maxSize:`${Math.trunc(xc/1024/1024)}MB`}))}if(n){let t=this.files[i]?.dataURL,n=t&&yD(t);this.setImagePreviewCursor(n||e)}let a=this.files[i]?.dataURL||await _D(e),o=K(t,{fileId:i},!1);return new Promise(async(e,t)=>{try{this.addMissingFiles([{mimeType:r,id:i,dataURL:a,created:Date.now(),lastRetrieved:Date.now()}]);let t=this.imageCache.get(i);t||(this.addNewImagesToImageCache(),await this.updateImageCache([o])),t?.image instanceof Promise&&await t.image,this.state.pendingImageElementId!==o.id&&this.state.newElement?.id!==o.id&&this.initializeImageDimensions(o,!0),e(o)}catch(e){console.error(e),t(Error(q(`errors.imageInsertError`)))}finally{n||sx(this.interactiveCanvas)}})}),v(this,`insertImageElement`,async(e,t,n)=>{if(!this.isToolSupported(`image`)){this.setState({errorMessage:q(`errors.imageToolNotSupported`)});return}this.scene.insertElement(e);try{return await this.initializeImage({imageFile:t,imageElement:e,showCursorImagePreview:n})}catch(t){return K(e,{isDeleted:!0}),this.actionManager.executeAction(gz),this.setState({errorMessage:t.message||q(`errors.imageInsertError`)}),null}}),v(this,`setImagePreviewCursor`,async e=>{let t;try{t=await xD(e,{maxWidthOrHeight:96})}catch(e){throw e.cause===`UNSUPPORTED`?Error(q(`errors.unsupportedFileType`)):e}let n=await _D(t);if(e.type===j.svg){let e=await BS(n),t=Math.min(e.height,96),r=t*(e.width/e.height);r>96&&(r=96,t=r*(e.height/e.width));let i=document.createElement(`canvas`);i.height=t,i.width=r,i.getContext(`2d`).drawImage(e,0,0,r,t),n=i.toDataURL(j.svg)}this.state.pendingImageElementId&&cx(this.interactiveCanvas,`url(${n}) 4 4, auto`)}),v(this,`onImageAction`,async({insertOnCanvasDirectly:e})=>{try{let{x:t,y:n}=_u({clientX:this.state.width/2+this.state.offsetLeft,clientY:this.state.height/2+this.state.offsetTop},this.state),r=await AS({description:`Image`,extensions:Object.keys(cc)}),i=this.createImageElement({sceneX:t,sceneY:n,addToFrameUnderCursor:!1});e?(this.insertImageElement(i,r),this.initializeImageDimensions(i),this.setState({selectedElementIds:ZT({[i.id]:!0},this.state)},()=>{this.actionManager.executeAction(gz)})):this.setState({pendingImageElementId:i.id},()=>{this.insertImageElement(i,r,!0)})}catch(e){e.name===`AbortError`?console.warn(e):console.error(e),this.setState({pendingImageElementId:null,newElement:null,activeTool:gu(this.state,{type:`selection`})},()=>{this.actionManager.executeAction(gz)})}}),v(this,`initializeImageDimensions`,(e,t=!1)=>{let n=ld(e)&&this.imageCache.get(e.fileId)?.image;if(!n||n instanceof Promise){if(e.width<10/this.state.zoom.value&&e.height<10/this.state.zoom.value){let t=100/this.state.zoom.value;K(e,{x:e.x-t/2,y:e.y-t/2,width:t,height:t})}return}if(t||e.width<10/this.state.zoom.value&&e.height<10/this.state.zoom.value){let t=Math.max(this.state.height-120,160),r=Math.min(t,Math.floor(this.state.height*.5)/this.state.zoom.value),i=Math.min(n.naturalHeight,r),a=i*(n.naturalWidth/n.naturalHeight);K(e,{x:e.x+e.width/2-a/2,y:e.y+e.height/2-i/2,width:a,height:i,crop:null})}}),v(this,`updateImageCache`,async(e,t=this.files)=>{let{updatedFiles:n,erroredFiles:r}=await VS({imageCache:this.imageCache,fileIds:e.map(e=>e.fileId),files:t});if(n.size||r.size)for(let t of e)n.has(t.fileId)&&Sf.delete(t);return r.size&&this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().map(e=>ld(e)&&r.has(e.fileId)?iE(e,{status:`error`}):e)),{updatedFiles:n,erroredFiles:r}}),v(this,`addNewImagesToImageCache`,async(e=HS(this.scene.getNonDeletedElements()),t=this.files)=>{let n=e.filter(e=>!e.isDeleted&&!this.imageCache.has(e.fileId));if(n.length){let{updatedFiles:e}=await this.updateImageCache(n,t);e.size&&this.scene.triggerUpdate()}}),v(this,`scheduleImageRefresh`,(0,qi.default)(()=>{this.addNewImagesToImageCache()},500)),v(this,`updateBindingEnabledOnPointerMove`,e=>{let t=Nv(e);this.state.isBindingEnabled!==t&&this.setState({isBindingEnabled:t})}),v(this,`maybeSuggestBindingAtCursor`,(e,t)=>{let n=Qv(e,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,!1,t);this.setState({suggestedBindings:n==null?[]:[n]})}),v(this,`maybeSuggestBindingsForLinearElementAtCoords`,(e,t,n)=>{if(!t.length)return;let r=t.reduce((t,r)=>{let i=Qv(r,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,z(e),z(e));return i!=null&&!Yv(e,n?.id,i)&&t.push(i),t},[]);this.setState({suggestedBindings:r})}),v(this,`handleInteractiveCanvasRef`,e=>{e===null?(this.interactiveCanvas?.removeEventListener(`touchstart`,this.onTouchStart),this.interactiveCanvas?.removeEventListener(`touchend`,this.onTouchEnd)):(this.interactiveCanvas=e,this.interactiveCanvas.addEventListener(`touchstart`,this.onTouchStart,{passive:!1}),this.interactiveCanvas.addEventListener(`touchend`,this.onTouchEnd))}),v(this,`handleAppOnDrop`,async e=>{let{file:t,fileHandle:n}=await wD(e),{x:r,y:i}=_u(e,this.state);try{if(uD(t)&&this.isToolSupported(`image`)){if(t?.type===j.png||t?.type===j.svg)try{let e=await fD(t,this.state,this.scene.getElementsIncludingDeleted(),n);this.syncActionResult({...e,appState:{...e.appState||this.state,isLoading:!1},replaceFiles:!0,captureUpdate:G.IMMEDIATELY});return}catch(e){if(e.name!==`EncodingError`)throw Error(q(`alerts.couldNotLoadInvalidFile`))}let e=this.createImageElement({sceneX:r,sceneY:i});this.insertImageElement(e,t),this.initializeImageDimensions(e),this.setState({selectedElementIds:ZT({[e.id]:!0},this.state)});return}}catch(e){return this.setState({isLoading:!1,errorMessage:e.message})}let a=e.dataTransfer.getData(j.excalidrawlib);if(a&&typeof a==`string`){try{let t=pD(a);this.addElementsFromPasteOrLibrary({elements:QB(t),position:e,files:null})}catch(e){this.setState({errorMessage:e.message})}return}if(t&&await this.loadFileToCanvas(t,n),e.dataTransfer?.types?.includes(`text/plain`)){let t=e.dataTransfer?.getData(`text`);if(t&&wS(t,this.props.validateEmbeddable)&&(/^(http|https):\/\/[^\s/$.?#].[^\s]*$/.test(t)||bS(t)?.type===`video`)){let e=this.insertEmbeddableElement({sceneX:r,sceneY:i,link:Qb(t)});e&&this.setState({selectedElementIds:{[e.id]:!0}})}}}),v(this,`loadFileToCanvas`,async(e,t)=>{e=await OD(e);try{let n=this.scene.getElementsIncludingDeleted(),r;try{r=await dD(e,this.state,n,t)}catch(e){let t=e instanceof bh;if(t&&e.code===`IMAGE_NOT_CONTAINS_SCENE_DATA`&&!this.isToolSupported(`image`)){this.setState({isLoading:!1,errorMessage:q(`errors.imageToolNotSupported`)});return}let n=q(t?`alerts.cannotRestoreFromImage`:`alerts.couldNotLoadInvalidFile`);this.setState({isLoading:!1,errorMessage:n})}if(!r)return;r.type===j.excalidraw?(Vx(n.concat(r.data.elements)),this.store.updateSnapshot(Nu(n),this.state),this.setState({isLoading:!0}),this.syncActionResult({...r.data,appState:{...r.data.appState||this.state,isLoading:!1},replaceFiles:!0,captureUpdate:G.IMMEDIATELY})):r.type===j.excalidrawlib&&await this.library.updateLibrary({libraryItems:e,merge:!0,openLibraryMenu:!0}).catch(e=>{console.error(e),this.setState({errorMessage:q(`errors.importLibraryError`)})})}catch(e){this.setState({isLoading:!1,errorMessage:e.message})}}),v(this,`handleCanvasContextMenu`,e=>{if(e.preventDefault(),(`pointerType`in e.nativeEvent&&e.nativeEvent.pointerType===`touch`||`pointerType`in e.nativeEvent&&e.nativeEvent.pointerType===`pen`&&e.button!==Hs.SECONDARY)&&this.state.activeTool.type!==`selection`)return;let{x:t,y:n}=_u(e,this.state),r=this.getElementAtPosition(t,n,{preferSelected:!0,includeLockedElements:!0}),i=this.scene.getSelectedElements(this.state),a=this.isHittingCommonBoundingBoxOfSelectedElements({x:t,y:n},i),o=r||a?`element`:`canvas`,{top:s,left:c}=this.excalidrawContainerRef.current.getBoundingClientRect(),l=e.clientX-c,u=e.clientY-s;VL(`contextMenu`,`openContextMenu`,o),this.setState({...r&&!this.state.selectedElementIds[r.id]?{...this.state,...By({editingGroupId:this.state.editingGroupId,selectedElementIds:{[r.id]:!0}},this.scene.getNonDeletedElements(),this.state,this),selectedLinearElement:yd(r)?new U(r):null}:this.state,showHyperlinkPopup:!1},()=>{this.setState({contextMenu:{top:u,left:l,items:this.getContextMenuItems(o)}})})}),v(this,`maybeDragNewGenericElement`,(e,t,n=!0)=>{let r=this.state.selectionElement,i=e.lastCoords;if(r&&this.state.activeTool.type!==`eraser`){YE({newElement:r,elementType:this.state.activeTool.type,originX:e.origin.x,originY:e.origin.y,x:i.x,y:i.y,width:hu(e.origin.x,i.x),height:hu(e.origin.y,i.y),shouldMaintainAspectRatio:Fg(t),shouldResizeFromCenter:Pg(t),zoom:this.state.zoom.value,informMutation:n});return}let a=this.state.newElement;if(!a)return;let[o,s]=Eb(i.x,i.y,t[H.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),c=ld(a)&&this.imageCache.get(a.fileId)?.image,l=c&&!(c instanceof Promise)?c.width/c.height:null;this.maybeCacheReferenceSnapPoints(t,[a]);let{snapOffset:u,snapLines:d}=Cb(a,this,t,{x:e.originInGrid.x+(this.state.originSnapOffset?.x??0),y:e.originInGrid.y+(this.state.originSnapOffset?.y??0)},{x:o-e.originInGrid.x,y:s-e.originInGrid.y},this.scene.getNonDeletedElementsMap());o+=u.x,s+=u.y,this.setState({snapLines:d}),YE({newElement:a,elementType:this.state.activeTool.type,originX:e.originInGrid.x,originY:e.originInGrid.y,x:o,y:s,width:hu(e.originInGrid.x,o),height:hu(e.originInGrid.y,s),shouldMaintainAspectRatio:ud(a)?!Fg(t):Fg(t),shouldResizeFromCenter:Pg(t),zoom:this.state.zoom.value,widthAspectRatio:l,originOffset:this.state.originSnapOffset,informMutation:n}),this.setState({newElement:a}),(this.state.activeTool.type===Rc.frame||this.state.activeTool.type===Rc.magicframe)&&this.setState({elementsToHighlight:DT(this.scene.getNonDeletedElements(),a,this.state,this.scene.getNonDeletedElementsMap())})}),v(this,`maybeHandleCrop`,(e,t)=>{if(!this.state.croppingElementId)return!1;let n=e.resize.handleType,r=e.lastCoords,[i,a]=Eb(r.x-e.resize.offset.x,r.y-e.resize.offset.y,t[H.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),o=this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);if(n&&o&&ud(o)){let s=e.originalElements.get(o.id),c=ld(o)&&this.imageCache.get(o.fileId)?.image;if(s&&ud(s)&&c&&!(c instanceof Promise)){let[l,u]=Eb(r.x,r.y,t[H.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),d={x:l-e.originInGrid.x,y:u-e.originInGrid.y};this.maybeCacheReferenceSnapPoints(t,[o]);let{snapOffset:f,snapLines:p}=Sb([o],[s],this,t,d,n);K(o,Zg(o,n,c.naturalWidth,c.naturalHeight,i+f.x,a+f.y,t.shiftKey?s.width/s.height:void 0)),ny(o,this.scene.getNonDeletedElementsMap(),{newSize:{width:o.width,height:o.height}}),this.setState({isCropping:n&&n!==`rotation`,snapLines:p})}return!0}return!1}),v(this,`maybeHandleResize`,(e,t)=>{let n=this.scene.getSelectedElements(this.state),r=n.filter(e=>gd(e)),i=e.resize.handleType;if(r.length>0&&i===`rotation`||n.length===1&&z(n[0])||this.state.croppingElementId)return!1;this.setState({isResizing:i&&i!==`rotation`,isRotating:i===`rotation`,activeEmbeddable:null});let a=e.lastCoords,[o,s]=Eb(a.x-e.resize.offset.x,a.y-e.resize.offset.y,t[H.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),c=new Map;if(r.forEach(e=>{wT(this.scene.getNonDeletedElements(),e.id).forEach(t=>{c.set(e.id+t.id,{x:t.x-e.x,y:t.y-e.y})})}),!this.state.selectedElementsAreBeingDragged){let[r,c]=Eb(a.x,a.y,t[H.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),l={x:r-e.originInGrid.x,y:c-e.originInGrid.y},u=[...e.originalElements.values()];this.maybeCacheReferenceSnapPoints(t,n);let{snapOffset:d,snapLines:f}=Sb(n,YT(u,this.state),this,t,l,i);o+=d.x,s+=d.y,this.setState({snapLines:f})}if(jE(e.originalElements,i,n,this.scene.getElementsMapIncludingDeleted(),this.scene,Ig(t),Pg(t),n.some(e=>ud(e))?!Fg(t):Fg(t),o,s,e.resize.center.x,e.resize.center.y)){let e=Wv(n,this.scene.getNonDeletedElementsMap(),this.state.zoom),t=new Set;return r.forEach(e=>{DT(this.scene.getNonDeletedElements(),e,this.state,this.scene.getNonDeletedElementsMap()).forEach(e=>t.add(e))}),this.setState({elementsToHighlight:[...t],suggestedBindings:e}),!0}return!1}),v(this,`getContextMenuItems`,e=>{let t=[];return t.push(cB,sB),e===`canvas`?this.state.viewModeEnabled?[...t,uB,dB,xK,pB]:[aB,KH,cB,sB,lB,KH,PL,LB,KH,uB,fB,dB,xK,pB]:(t.push(lB),this.state.viewModeEnabled?[iB,...t]:[KH,oB,iB,aB,KH,CK,wK,TK,KH,MH,KH,...t,KH,Nz,Pz,KH,Rz,jq,mB,hB,vB,zz,KH,Kz,KH,AL,jL,ML,NL,KH,eB,tB,KH,AH,KH,PB,xH,KH,RL,IB,KH,hL])}),v(this,`handleWheel`,NK(e=>{if(!(e.target instanceof HTMLCanvasElement||e.target instanceof HTMLTextAreaElement||e.target instanceof HTMLIFrameElement)){e[H.CTRL_OR_CMD]&&e.preventDefault();return}if(e.preventDefault(),rJ)return;let{deltaX:t,deltaY:n}=e;if(e.metaKey||e.ctrlKey){let e=Math.sign(n),t=pc*100,r=Math.abs(n),i=n;r>t&&(i=t*e);let a=this.state.zoom.value-i/100;a+=Math.log10(Math.max(1,this.state.zoom.value))*-e*Math.min(1,r/20),this.translateCanvas(e=>({...nz({viewportX:this.lastViewportPosition.x,viewportY:this.lastViewportPosition.y,nextZoom:Iy(a)},e),shouldCacheIgnoreZoom:!0})),this.resetShouldCacheIgnoreZoomDebounced();return}if(e.shiftKey){this.translateCanvas(({zoom:e,scrollX:r})=>({scrollX:r-(n||t)/e.value}));return}this.translateCanvas(({zoom:e,scrollX:r,scrollY:i})=>({scrollX:r-t/e.value,scrollY:i-n/e.value}))})),v(this,`savePointer`,(e,t,n)=>{if(!e||!t)return;let{x:r,y:i}=_u({clientX:e,clientY:t},this.state),a={x:r,y:i,tool:this.state.activeTool.type===`laser`?`laser`:`pointer`};this.props.onPointerUpdate?.({pointer:a,button:n,pointersMap:pJ.pointers})}),v(this,`resetShouldCacheIgnoreZoomDebounced`,lu(()=>{this.unmounted||this.setState({shouldCacheIgnoreZoom:!1})},300)),v(this,`updateDOMRect`,e=>{if(this.excalidrawContainerRef?.current){let{width:t,height:n,left:r,top:i}=this.excalidrawContainerRef.current.getBoundingClientRect(),{width:a,height:o,offsetTop:s,offsetLeft:c}=this.state;if(t===a&&n===o&&r===c&&i===s){e&&e();return}this.setState({width:t,height:n,offsetLeft:r,offsetTop:i},()=>{e&&e()})}}),v(this,`refresh`,()=>{this.setState({...this.getCanvasOffsets()})});let n=qc(),{excalidrawAPI:r,viewModeEnabled:i=!1,zenModeEnabled:a=!1,gridModeEnabled:o=!1,objectsSnapModeEnabled:s=!1,theme:c=n.theme,name:l=`${q(`labels.untitled`)}-${tu()}`}=t;if(this.state={...n,theme:c,isLoading:!0,...this.getCanvasOffsets(),viewModeEnabled:i,zenModeEnabled:a,objectsSnapModeEnabled:s,gridModeEnabled:o??n.gridModeEnabled,name:l,width:window.innerWidth,height:window.innerHeight},this.id=Wi(),this.library=new ZB(this),this.actionManager=new VH(this.syncActionResult,()=>this.state,()=>this.scene.getElementsIncludingDeleted(),this),this.scene=new rE,this.canvas=document.createElement(`canvas`),this.rc=go.canvas(this.canvas),this.renderer=new vq(this.scene),this.visibleElements=[],this.store=new nS,this.history=new PH,r){let e={updateScene:this.updateScene,updateLibrary:this.library.updateLibrary,addFiles:this.addFiles,resetScene:this.resetScene,getSceneElementsIncludingDeleted:this.getSceneElementsIncludingDeleted,history:{clear:this.resetHistory},scrollToContent:this.scrollToContent,getSceneElements:this.getSceneElements,getAppState:()=>this.state,getFiles:()=>this.files,getName:this.getName,registerAction:e=>{this.actionManager.registerAction(e)},refresh:this.refresh,setToast:this.setToast,id:this.id,setActiveTool:this.setActiveTool,setCursor:this.setCursor,resetCursor:this.resetCursor,updateFrameRendering:this.updateFrameRendering,toggleSidebar:this.toggleSidebar,onChange:e=>this.onChangeEmitter.on(e),onPointerDown:e=>this.onPointerDownEmitter.on(e),onPointerUp:e=>this.onPointerUpEmitter.on(e),onScrollChange:e=>this.onScrollChangeEmitter.on(e),onUserFollow:e=>this.onUserFollowEmitter.on(e)};typeof r==`function`?r(e):console.error(`excalidrawAPI should be a function!`)}this.excalidrawContainerValue={container:this.excalidrawContainerRef.current,id:this.id},this.fonts=new Jh(this.scene),this.history=new PH,this.actionManager.registerAll(tx),this.actionManager.registerAction(RH(this.history,this.store)),this.actionManager.registerAction(zH(this.history,this.store))}onWindowMessage(e){if(e.origin!==`https://player.vimeo.com`&&e.origin!==`https://www.youtube.com`)return;let t=null;try{t=JSON.parse(e.data)}catch{}if(t)switch(e.origin){case`https://player.vimeo.com`:if(t.method===`paused`){let n=null,r=document.body.querySelectorAll(`iframe.excalidraw__embeddable`);if(!r)break;for(let t of r)t.contentWindow===e.source&&(n=t.contentWindow);n?.postMessage(JSON.stringify({method:t.value?`play`:`pause`,value:!0}),`*`)}break;case`https://www.youtube.com`:if(t.event===`infoDelivery`&&t.info&&t.id&&typeof t.info.playerState==`number`){let e=t.id,n=t.info.playerState;Object.values(Ws).includes(n)&&cJ.set(e,n)}break}}cacheEmbeddableRef(e,t){t&&this.iFrameRefs.set(e.id,t)}getHTMLIFrameElement(e){return this.iFrameRefs.get(e.id)}handleEmbeddableCenterClick(e){if(this.state.activeEmbeddable?.element===e&&this.state.activeEmbeddable?.state===`active`||(setTimeout(()=>{this.setState({activeEmbeddable:{element:e,state:`active`},selectedElementIds:{[e.id]:!0},newElement:null,selectionElement:null})},100),fd(e)))return;let t=this.getHTMLIFrameElement(e);if(t?.contentWindow){if(t.src.includes(`youtube`)){let n=cJ.get(e.id);switch(n||(cJ.set(e.id,Ws.UNSTARTED),t.contentWindow.postMessage(JSON.stringify({event:`listening`,id:e.id}),`*`)),n){case Ws.PLAYING:case Ws.BUFFERING:t.contentWindow?.postMessage(JSON.stringify({event:`command`,func:`pauseVideo`,args:``}),`*`);break;default:t.contentWindow?.postMessage(JSON.stringify({event:`command`,func:`playVideo`,args:``}),`*`)}}t.src.includes(`player.vimeo.com`)&&t.contentWindow.postMessage(JSON.stringify({method:`paused`}),`*`)}}isIframeLikeElementCenter(e,t,n,r){return e&&!t.altKey&&!t.shiftKey&&!t.metaKey&&!t.ctrlKey&&(this.state.activeEmbeddable?.element!==e||this.state.activeEmbeddable?.state===`hover`||!this.state.activeEmbeddable)&&n>=e.x+e.width/3&&n<=e.x+2*e.width/3&&r>=e.y+e.height/3&&r<=e.y+2*e.height/3}renderEmbeddables(){let e=this.state.zoom.value,t=this.state.width,n=this.state.height,r=this.scene.getNonDeletedElements().filter(e=>dd(e)&&this.embedsValidationStatus.get(e.id)===!0||fd(e));return(0,k.jsx)(k.Fragment,{children:r.map(r=>{let{x:i,y:a}=vu({sceneX:r.x,sceneY:r.y},this.state),o=sE(r,t,n,this.state,this.scene.getNonDeletedElementsMap()),s=this.initializedEmbeds.has(r.id);if(o&&!s&&this.initializedEmbeds.add(r.id),!(o||s))return null;let c;if(fd(r)){c=null;let e=(r.customData?.generationData??this.magicGenerations.get(r.id))||{status:`error`,message:`No generation data`,code:`ERR_NO_GENERATION_DATA`};if(e.status===`done`){let t=e.html;c={intrinsicSize:{w:r.width,h:r.height},type:`document`,srcdoc:()=>t}}else if(e.status===`pending`)c={intrinsicSize:{w:r.width,h:r.height},type:`document`,srcdoc:()=>yS(`
|
|
113
|
+
<style>
|
|
114
|
+
html, body {
|
|
115
|
+
width: 100%;
|
|
116
|
+
height: 100%;
|
|
117
|
+
color: ${this.state.theme===Qs.DARK?`white`:`black`};
|
|
118
|
+
}
|
|
119
|
+
body {
|
|
120
|
+
display: flex;
|
|
121
|
+
align-items: center;
|
|
122
|
+
justify-content: center;
|
|
123
|
+
flex-direction: column;
|
|
124
|
+
gap: 1rem;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.Spinner {
|
|
128
|
+
display: flex;
|
|
129
|
+
align-items: center;
|
|
130
|
+
justify-content: center;
|
|
131
|
+
margin-left: auto;
|
|
132
|
+
margin-right: auto;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.Spinner svg {
|
|
136
|
+
animation: rotate 1.6s linear infinite;
|
|
137
|
+
transform-origin: center center;
|
|
138
|
+
width: 40px;
|
|
139
|
+
height: 40px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.Spinner circle {
|
|
143
|
+
stroke: currentColor;
|
|
144
|
+
animation: dash 1.6s linear 0s infinite;
|
|
145
|
+
stroke-linecap: round;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
@keyframes rotate {
|
|
149
|
+
100% {
|
|
150
|
+
transform: rotate(360deg);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
@keyframes dash {
|
|
155
|
+
0% {
|
|
156
|
+
stroke-dasharray: 1, 300;
|
|
157
|
+
stroke-dashoffset: 0;
|
|
158
|
+
}
|
|
159
|
+
50% {
|
|
160
|
+
stroke-dasharray: 150, 300;
|
|
161
|
+
stroke-dashoffset: -200;
|
|
162
|
+
}
|
|
163
|
+
100% {
|
|
164
|
+
stroke-dasharray: 1, 300;
|
|
165
|
+
stroke-dashoffset: -280;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
</style>
|
|
169
|
+
<div class="Spinner">
|
|
170
|
+
<svg
|
|
171
|
+
viewBox="0 0 100 100"
|
|
172
|
+
>
|
|
173
|
+
<circle
|
|
174
|
+
cx="50"
|
|
175
|
+
cy="50"
|
|
176
|
+
r="46"
|
|
177
|
+
stroke-width="8"
|
|
178
|
+
fill="none"
|
|
179
|
+
stroke-miter-limit="10"
|
|
180
|
+
/>
|
|
181
|
+
</svg>
|
|
182
|
+
</div>
|
|
183
|
+
<div>Generating...</div>
|
|
184
|
+
`)};else{let t;t=e.code===`ERR_GENERATION_INTERRUPTED`?`Generation was interrupted...`:e.message||`Generation failed`,c={intrinsicSize:{w:r.width,h:r.height},type:`document`,srcdoc:()=>yS(`
|
|
185
|
+
<style>
|
|
186
|
+
html, body {
|
|
187
|
+
height: 100%;
|
|
188
|
+
}
|
|
189
|
+
body {
|
|
190
|
+
display: flex;
|
|
191
|
+
flex-direction: column;
|
|
192
|
+
align-items: center;
|
|
193
|
+
justify-content: center;
|
|
194
|
+
color: ${xs.red[3]};
|
|
195
|
+
}
|
|
196
|
+
h1, h3 {
|
|
197
|
+
margin-top: 0;
|
|
198
|
+
margin-bottom: 0.5rem;
|
|
199
|
+
}
|
|
200
|
+
</style>
|
|
201
|
+
<h1>Error!</h1>
|
|
202
|
+
<h3>${t}</h3>
|
|
203
|
+
`)}}}else c=bS(ex(r.link||``));let l=this.state.activeEmbeddable?.element===r&&this.state.activeEmbeddable?.state===`active`,u=this.state.activeEmbeddable?.element===r&&this.state.activeEmbeddable?.state===`hover`;return(0,k.jsx)(`div`,{className:O(`excalidraw__embeddable-container`,{"is-hovered":u}),style:{transform:o?`translate(${i-this.state.offsetLeft}px, ${a-this.state.offsetTop}px) scale(${e})`:`none`,display:o?`block`:`none`,opacity:c_(r,AT(r,this.scene.getNonDeletedElementsMap()),this.elementsPendingErasure,null,this.state.openDialog?.name===`elementLinkSelector`?Hc:1),"--embeddable-radius":`${Yg(Math.min(r.width,r.height),r)}px`},children:(0,k.jsxs)(`div`,{className:`excalidraw__embeddable-container__inner`,style:{width:o?`${r.width}px`:0,height:o?`${r.height}px`:0,transform:o?`rotate(${r.angle}rad)`:`none`,pointerEvents:l?Us.enabled:Us.disabled},children:[u&&(0,k.jsx)(`div`,{className:`excalidraw__embeddable-hint`,children:q(`buttons.embeddableInteractionButton`)}),(0,k.jsx)(`div`,{className:`excalidraw__embeddable__outer`,style:{padding:`${r.strokeWidth}px`},children:(dd(r)?this.props.renderEmbeddable?.(r,this.state):null)??(0,k.jsx)(`iframe`,{ref:e=>this.cacheEmbeddableRef(r,e),className:`excalidraw__embeddable`,srcDoc:c?.type===`document`?c.srcdoc(this.state.theme):void 0,src:c?.type===`document`?void 0:c?.link??``,scrolling:`no`,referrerPolicy:`no-referrer-when-downgrade`,title:`Excalidraw Embedded Content`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture`,allowFullScreen:!0,sandbox:`${c?.sandbox?.allowSameOrigin?`allow-same-origin`:``} allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation allow-downloads`})})]})},r.id)})})}toggleOverscrollBehavior(e){document.documentElement.style.overscrollBehaviorX=e.type===`pointerenter`?`none`:`auto`}render(){let e=this.scene.getSelectedElements(this.state),{renderTopRightUI:t,renderCustomStats:n}=this.props,r=this.scene.getSceneNonce(),{elementsMap:i,visibleElements:a}=this.renderer.getRenderableElements({sceneNonce:r,zoom:this.state.zoom,offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,height:this.state.height,width:this.state.width,editingTextElement:this.state.editingTextElement,newElementId:this.state.newElement?.id,pendingImageElementId:this.state.pendingImageElementId});this.visibleElements=a;let o=this.scene.getNonDeletedElementsMap(),s=`setPointerCapture`in HTMLElement.prototype?!1:this.state.selectionElement||this.state.newElement||this.state.selectedElementsAreBeingDragged||this.state.resizingElement||this.state.activeTool.type===`laser`&&this.state.cursorButton===`down`,c=e[0];return(0,k.jsx)(`div`,{className:O(`excalidraw excalidraw-container`,{"excalidraw--view-mode":this.state.viewModeEnabled||this.state.openDialog?.name===`elementLinkSelector`,"excalidraw--mobile":this.device.editor.isMobile}),style:{"--ui-pointerEvents":s?Us.disabled:Us.enabled,"--right-sidebar-width":`302px`},ref:this.excalidrawContainerRef,onDrop:this.handleAppOnDrop,tabIndex:0,onKeyDown:this.props.handleKeyboardGlobally?void 0:this.onKeyDown,onPointerEnter:this.toggleOverscrollBehavior,onPointerLeave:this.toggleOverscrollBehavior,children:(0,k.jsx)(Lq.Provider,{value:this,children:(0,k.jsx)(Rq.Provider,{value:this.props,children:(0,k.jsx)(Vq.Provider,{value:this.excalidrawContainerValue,children:(0,k.jsx)(Bq.Provider,{value:this.device,children:(0,k.jsx)(Wq.Provider,{value:this.setAppState,children:(0,k.jsx)(Uq.Provider,{value:this.state,children:(0,k.jsxs)(Hq.Provider,{value:this.scene.getNonDeletedElements(),children:[(0,k.jsxs)(Gq.Provider,{value:this.actionManager,children:[(0,k.jsx)(vK,{canvas:this.canvas,appState:this.state,files:this.files,setAppState:this.setAppState,actionManager:this.actionManager,elements:this.scene.getNonDeletedElements(),onLockToggle:this.toggleLock,onPenModeToggle:this.togglePenMode,onHandToolToggle:this.onHandToolToggle,langCode:aL().code,renderTopRightUI:t,renderCustomStats:n,showExitZenModeBtn:typeof this.props?.zenModeEnabled>`u`&&this.state.zenModeEnabled,UIOptions:this.props.UIOptions,onExportImage:this.onExportImage,renderWelcomeScreen:!this.state.isLoading&&this.state.showWelcomeScreen&&this.state.activeTool.type===`selection`&&!this.state.zenModeEnabled&&!this.scene.getElementsIncludingDeleted().length,app:this,isCollaborating:this.props.isCollaborating,generateLinkForSelection:this.props.generateLinkForSelection,children:this.props.children}),(0,k.jsx)(`div`,{className:`excalidraw-textEditorContainer`}),(0,k.jsx)(`div`,{className:`excalidraw-contextMenuContainer`}),(0,k.jsx)(`div`,{className:`excalidraw-eye-dropper-container`}),(0,k.jsx)(yq,{trails:[this.laserTrails,this.eraserTrail]}),e.length===1&&this.state.openDialog?.name!==`elementLinkSelector`&&this.state.showHyperlinkPopup&&(0,k.jsx)(EB,{element:c,elementsMap:o,setAppState:this.setAppState,onLinkOpen:this.props.onLinkOpen,setToast:this.setToast,updateEmbedValidationStatus:this.updateEmbedValidationStatus},c.id),this.props.aiEnabled!==!1&&e.length===1&&hd(c)&&(0,k.jsx)(Sq,{element:c,elementsMap:i,children:(0,k.jsx)(wq,{title:q(`labels.convertToCode`),icon:Lm,checked:!1,onChange:()=>this.onMagicFrameGenerate(c,`button`)})}),e.length===1&&fd(c)&&c.customData?.generationData?.status===`done`&&(0,k.jsxs)(Sq,{element:c,elementsMap:i,children:[(0,k.jsx)(wq,{title:q(`labels.copySource`),icon:Em,checked:!1,onChange:()=>this.onIframeSrcCopy(c)}),(0,k.jsx)(wq,{title:`Enter fullscreen`,icon:Rm,checked:!1,onChange:()=>{let e=this.getHTMLIFrameElement(c);if(e)try{e.requestFullscreen(),this.setState({activeEmbeddable:{element:c,state:`active`},selectedElementIds:{[c.id]:!0},newElement:null,selectionElement:null})}catch(e){console.warn(e),this.setState({errorMessage:`Couldn't enter fullscreen`})}}})]}),this.state.toast!==null&&(0,k.jsx)(bK,{message:this.state.toast.message,onClose:()=>this.setToast(null),duration:this.state.toast.duration,closable:this.state.toast.closable}),this.state.contextMenu&&(0,k.jsx)(qH,{items:this.state.contextMenu.items,top:this.state.contextMenu.top,left:this.state.contextMenu.left,actionManager:this.actionManager,onClose:e=>{this.setState({contextMenu:null},()=>{this.focusContainer(),e?.()})}}),(0,k.jsx)(_q,{canvas:this.canvas,rc:this.rc,elementsMap:i,allElementsMap:o,visibleElements:a,sceneNonce:r,selectionNonce:this.state.selectionElement?.versionNonce,scale:window.devicePixelRatio,appState:this.state,renderConfig:{imageCache:this.imageCache,isExporting:!1,renderGrid:sb(this),canvasBackgroundColor:this.state.viewBackgroundColor,embedsValidationStatus:this.embedsValidationStatus,elementsPendingErasure:this.elementsPendingErasure,pendingFlowchartNodes:this.flowChartCreator.pendingNodes}}),this.state.newElement&&(0,k.jsx)(Iq,{appState:this.state,scale:window.devicePixelRatio,rc:this.rc,elementsMap:i,allElementsMap:o,renderConfig:{imageCache:this.imageCache,isExporting:!1,renderGrid:!1,canvasBackgroundColor:this.state.viewBackgroundColor,embedsValidationStatus:this.embedsValidationStatus,elementsPendingErasure:this.elementsPendingErasure,pendingFlowchartNodes:null}}),(0,k.jsx)(mq,{containerRef:this.excalidrawContainerRef,canvas:this.interactiveCanvas,elementsMap:i,visibleElements:a,allElementsMap:o,selectedElements:e,sceneNonce:r,selectionNonce:this.state.selectionElement?.versionNonce,scale:window.devicePixelRatio,appState:this.state,device:this.device,renderInteractiveSceneCallback:this.renderInteractiveSceneCallback,handleCanvasRef:this.handleInteractiveCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.handleCanvasPointerUp,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,onPointerDown:this.handleCanvasPointerDown,onDoubleClick:this.handleCanvasDoubleClick}),this.state.userToFollow&&(0,k.jsx)(Tq,{width:this.state.width,height:this.state.height,userToFollow:this.state.userToFollow,onDisconnect:this.maybeUnfollowRemoteUser}),this.renderFrameNames()]}),this.renderEmbeddables()]})})})})})})})})}setPlugins(e){Object.assign(this.plugins,e)}async onMagicFrameGenerate(e,t){let n=this.plugins.diagramToCode?.generate;if(!n){this.setState({errorMessage:`No diagram to code plugin found`});return}let r=HT(this.scene.getNonDeletedElements(),e).filter(e=>!hd(e));if(!r.length){t===`button`?(this.setState({errorMessage:`Cannot generate from an empty frame`}),VL(`ai`,`generate (no-children)`,`d2c`)):this.setActiveTool({type:`magicframe`});return}let i=this.insertIframeElement({sceneX:e.x+e.width+30,sceneY:e.y,width:e.width,height:e.height});if(i){this.updateMagicGeneration({frameElement:i,data:{status:`pending`}}),this.setState({selectedElementIds:{[i.id]:!0}}),VL(`ai`,`generate (start)`,`d2c`);try{let{html:t}=await n({frame:e,children:r});if(VL(`ai`,`generate (success)`,`d2c`),!t.trim()){this.updateMagicGeneration({frameElement:i,data:{status:`error`,code:`ERR_OAI`,message:`Nothing genereated :(`}});return}let a=t.includes(`<!DOCTYPE html>`)&&t.includes(`</html>`)?t.slice(t.indexOf(`<!DOCTYPE html>`),t.indexOf(`</html>`)+7):t;this.updateMagicGeneration({frameElement:i,data:{status:`done`,html:a}})}catch(e){VL(`ai`,`generate (failed)`,`d2c`),this.updateMagicGeneration({frameElement:i,data:{status:`error`,code:`ERR_OAI`,message:e.message||`Unknown error during generation`}})}}}onIframeSrcCopy(e){e.customData?.generationData?.status===`done`&&(Zw(e.customData.generationData.html),this.setToast({message:`copied to clipboard`,closable:!1,duration:1500}))}clearImageShapeCache(e){let t=e??this.files;this.scene.getNonDeletedElements().forEach(e=>{ld(e)&&t[e.fileId]&&(this.imageCache.delete(e.fileId),Sf.delete(e))})}async componentDidMount(){this.unmounted=!1,this.excalidrawContainerValue.container=this.excalidrawContainerRef.current,(f.MODE===Gs.TEST||f.DEV)&&(this.setState.bind(this),Object.defineProperties(window.h,{state:{configurable:!0,get:()=>this.state},setState:{configurable:!0,value:(...e)=>this.setState(...e)},app:{configurable:!0,value:this},history:{configurable:!0,value:this.history},store:{configurable:!0,value:this.store},fonts:{configurable:!0,value:this.fonts}})),this.store.onStoreIncrementEmitter.on(e=>{this.history.record(e.elementsChange,e.appStateChange)}),this.scene.onUpdate(this.triggerRender),this.addEventListeners(),this.props.autoFocus&&this.excalidrawContainerRef.current&&this.focusContainer(),Lu()||(this.refreshViewportBreakpoints(),this.refreshEditorBreakpoints()),Ls&&this.excalidrawContainerRef.current&&(this.resizeObserver=new ResizeObserver(()=>{this.refreshEditorBreakpoints(),this.updateDOMRect()}),this.resizeObserver?.observe(this.excalidrawContainerRef.current)),new URLSearchParams(window.location.search.slice(1)).has(`web-share-target`)?this.restoreFileFromShare():this.updateDOMRect(this.initializeScene),Is()&&!Bd()&&this.setState({errorMessage:(0,k.jsx)(EK,{})})}componentWillUnmount(){window.launchQueue?.setConsumer(()=>{}),this.renderer.destroy(),this.scene.destroy(),this.scene=new rE,this.fonts=new Jh(this.scene),this.renderer=new vq(this.scene),this.files={},this.imageCache.clear(),this.resizeObserver?.disconnect(),this.unmounted=!0,this.removeEventListeners(),this.library.destroy(),this.laserTrails.stop(),this.eraserTrail.stop(),this.onChangeEmitter.clear(),this.store.onStoreIncrementEmitter.clear(),Sf.destroy(),ob.destroy(),clearTimeout(oJ),qT.clearCache(),By.clearCache(),oJ=0,document.documentElement.style.overscrollBehaviorX=``}removeEventListeners(){this.onRemoveEventListenersEmitter.trigger()}addEventListeners(){this.removeEventListeners(),this.props.handleKeyboardGlobally&&this.onRemoveEventListenersEmitter.once(ed(document,`keydown`,this.onKeyDown,!1)),this.onRemoveEventListenersEmitter.once(ed(this.excalidrawContainerRef.current,`wheel`,this.handleWheel,{passive:!1}),ed(window,`message`,this.onWindowMessage,!1),ed(document,`pointerup`,this.removePointer,{passive:!1}),ed(document,`copy`,this.onCopy,{passive:!1}),ed(document,`keyup`,this.onKeyUp,{passive:!0}),ed(document,`pointermove`,this.updateCurrentCursorPosition,{passive:!1}),ed(document.fonts,`loadingdone`,e=>{let t=e.fontfaces;this.fonts.onLoaded(t)},{passive:!1}),ed(document,`gesturestart`,this.onGestureStart,!1),ed(document,`gesturechange`,this.onGestureChange,!1),ed(document,`gestureend`,this.onGestureEnd,!1),ed(window,`focus`,()=>{this.maybeCleanupAfterMissingPointerUp(null),this.triggerRender(!0)},{passive:!1})),!this.state.viewModeEnabled&&(this.onRemoveEventListenersEmitter.once(ed(document,`fullscreenchange`,this.onFullscreenChange,{passive:!1}),ed(document,`paste`,this.pasteFromClipboard,{passive:!1}),ed(document,`cut`,this.onCut,{passive:!1}),ed(window,`resize`,this.onResize,!1),ed(window,`unload`,this.onUnload,!1),ed(window,`blur`,this.onBlur,!1),ed(this.excalidrawContainerRef.current,`wheel`,this.handleWheel,{passive:!1}),ed(this.excalidrawContainerRef.current,`dragover`,this.disableEvent,!1),ed(this.excalidrawContainerRef.current,`drop`,this.disableEvent,!1)),this.props.detectScroll&&this.onRemoveEventListenersEmitter.once(ed(ku(this.excalidrawContainerRef.current),`scroll`,this.onScroll,{passive:!1})))}componentDidUpdate(e,t){this.updateEmbeddables();let n=this.scene.getElementsIncludingDeleted(),r=this.scene.getElementsMapIncludingDeleted(),i=this.scene.getNonDeletedElementsMap();!this.state.showWelcomeScreen&&!n.length&&this.setState({showWelcomeScreen:!0}),e.UIOptions.dockedSidebarBreakpoint!==this.props.UIOptions.dockedSidebarBreakpoint&&this.refreshEditorBreakpoints(),t.userToFollow&&!this.state.collaborators.has(t.userToFollow.socketId)&&this.maybeUnfollowRemoteUser(),(t.zoom.value!==this.state.zoom.value||t.scrollX!==this.state.scrollX||t.scrollY!==this.state.scrollY)&&(this.props?.onScrollChange?.(this.state.scrollX,this.state.scrollY,this.state.zoom),this.onScrollChangeEmitter.trigger(this.state.scrollX,this.state.scrollY,this.state.zoom)),t.userToFollow!==this.state.userToFollow&&(t.userToFollow&&this.onUserFollowEmitter.trigger({userToFollow:t.userToFollow,action:`UNFOLLOW`}),this.state.userToFollow&&this.onUserFollowEmitter.trigger({userToFollow:this.state.userToFollow,action:`FOLLOW`})),Object.keys(this.state.selectedElementIds).length&&Qc(this.state)&&this.setState({activeTool:gu(this.state,{type:`selection`})}),this.state.activeTool.type===`eraser`&&t.theme!==this.state.theme&&dx(this.interactiveCanvas,this.state.theme),t.activeTool.type===`selection`&&this.state.activeTool.type!==`selection`&&this.state.showHyperlinkPopup&&this.setState({showHyperlinkPopup:!1}),e.langCode!==this.props.langCode&&this.updateLanguage(),Qc(t)&&!Qc(this.state)&&this.eraserTrail.endPath(),e.viewModeEnabled!==this.props.viewModeEnabled&&this.setState({viewModeEnabled:!!this.props.viewModeEnabled}),t.viewModeEnabled!==this.state.viewModeEnabled&&(this.addEventListeners(),this.deselectElements()),(t.openDialog?.name===`elementLinkSelector`||this.state.openDialog?.name===`elementLinkSelector`)&&t.openDialog?.name!==this.state.openDialog?.name&&(this.deselectElements(),this.setState({hoveredElementIds:{}})),e.zenModeEnabled!==this.props.zenModeEnabled&&this.setState({zenModeEnabled:!!this.props.zenModeEnabled}),e.theme!==this.props.theme&&this.props.theme&&this.setState({theme:this.props.theme}),this.excalidrawContainerRef.current?.classList.toggle(`theme--dark`,this.state.theme===Qs.DARK),this.state.editingLinearElement&&!this.state.selectedElementIds[this.state.editingLinearElement.elementId]&&setTimeout(()=>{this.state.editingLinearElement&&this.actionManager.executeAction(gz)}),this.state.editingTextElement?.isDeleted&&this.setState({editingTextElement:null}),this.state.selectedLinearElement&&!this.state.selectedElementIds[this.state.selectedLinearElement.elementId]&&this.setState({selectedLinearElement:null});let{multiElement:a}=t;t.activeTool!==this.state.activeTool&&a!=null&&Pv(this.state)&&Sd(a,!1)&&Gv(a,this.state,Su(U.getPointAtIndexGlobalCoordinates(a,-1,i)),this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements()),this.store.commit(r,this.state),this.state.isLoading||(this.props.onChange?.(n,this.state,this.files),this.onChangeEmitter.trigger(n,this.state,this.files))}static resetTapTwice(){eJ=!1}async addElementsFromMixedContentPaste(e,{isPlainPaste:t,sceneX:n,sceneY:r}){if(!t&&e.some(e=>e.type===`imageUrl`)&&this.isToolSupported(`image`)){let t=e.filter(e=>e.type===`imageUrl`).map(e=>e.value),i=await Promise.all(t.map(async e=>{try{return{file:await CD(e)}}catch(e){let t=e.message;return e.cause===`FETCH_ERROR`?t=q(`errors.failedToFetchImage`):e.cause===`UNSUPPORTED`&&(t=q(`errors.unsupportedFileType`)),{errorMessage:t}}})),a=r,o=!1,s={};for(let e of i)if(e.file){let t=this.createImageElement({sceneX:n,sceneY:a}),r=await this.insertImageElement(t,e.file);r&&(o||(o=!0,a-=r.height/2),K(r,{y:a},!1),a=t.y+t.height+25,s[t.id]=!0)}this.setState({selectedElementIds:ZT(s,this.state)});let c=i.find(e=>!!e.errorMessage);c&&c.errorMessage&&this.setState({errorMessage:c.errorMessage})}else{let n=e.filter(e=>e.type===`text`);n.length&&this.addTextFromPaste(n.map(e=>e.value).join(`
|
|
204
|
+
|
|
205
|
+
`),t)}}addTextFromPaste(e,t=!1){let{x:n,y:r}=_u({clientX:this.lastViewportPosition.x,clientY:this.lastViewportPosition.y},this.state),i={x:n,y:r,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roundness:null,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,text:e,fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily,textAlign:nc,verticalAlign:`top`,locked:!1},a=cu({fontSize:i.fontSize,fontFamily:i.fontFamily}),o=Xh(i.fontFamily),[s,,c]=Ev(this.state),l=Math.max(Math.min((c-s)*.5,800),200),u=r,d=t?[e]:e.split(`
|
|
206
|
+
`),f=d.reduce((e,t,r)=>{let s=Vd(t).trim();if(s.length){let t=this.getTopLayerFrameAtSceneCoords({x:n,y:u}),r=Id(s,a,o),c=r.width>l,d=c?hf(s,a,l):s;r=c?Id(d,a,o):r;let f=n-r.width/2,p=u-r.height/2,m=wx({...i,x:f,y:p,text:d,originalText:s,lineHeight:o,autoResize:!c,frameId:t?t.id:null});e.push(m),u+=m.height+10}else d[r-1]?.trim()&&(u+=Wd(i.fontSize,o)+10);return e},[]);f.length!==0&&(this.scene.insertElements(f),this.setState({selectedElementIds:ZT(Object.fromEntries(f.map(e=>[e.id,!0])),this.state)}),!t&&f.length>1&&dJ===!1&&!this.device.editor.isMobile&&(this.setToast({message:q(`toast.pasteAsSingleElement`,{shortcut:L(`CtrlOrCmd+Shift+V`)}),duration:5e3}),dJ=!0),this.store.shouldCaptureIncrement())}handleTextWysiwyg(e,{isExistingElement:t=!1}){let n=this.scene.getElementsMapIncludingDeleted(),r=(t,r)=>{this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted().map(i=>i.id===e.id&&R(i)?iE(i,{originalText:t,isDeleted:r??i.isDeleted,...Dx(i,Bb(i,n),n,t)}):i)])};Aq({id:e.id,canvas:this.canvas,getViewportCoords:(e,t)=>{let{x:n,y:r}=vu({sceneX:e,sceneY:t},this.state);return[n-this.state.offsetLeft,r-this.state.offsetTop]},onChange:NK(t=>{r(t,!1),tD(e)&&ny(e,this.scene.getNonDeletedElementsMap())}),onSubmit:NK(({viaKeyboard:n,nextOriginalText:i})=>{let a=!i.trim();if(r(i,a),!a&&n){let t=e.containerId?e.containerId:e.id;(0,mk.flushSync)(()=>{this.setState(e=>({selectedElementIds:ZT({...e.selectedElementIds,[t]:!0},e)}))})}a&&vy(this.scene.getNonDeletedElements(),[e]),(!a||t)&&this.store.shouldCaptureIncrement(),(0,mk.flushSync)(()=>{this.setState({newElement:null,editingTextElement:null})}),this.state.activeTool.locked&&fx(this.interactiveCanvas,this.state),this.focusContainer()}),element:e,excalidrawContainer:this.excalidrawContainerRef.current,app:this,autoSelect:!this.device.isTouchScreen}),this.deselectElements(),r(e.originalText,!1)}deselectElements(){this.setState({selectedElementIds:ZT({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})}getTextElementAtPosition(e,t){let n=this.getElementAtPosition(e,t,{includeBoundTextElement:!0});return n&&R(n)&&!n.isDeleted?n:null}getElementAtPosition(e,t,n){let r=this.getElementsAtPosition(e,t,n?.includeBoundTextElement,n?.includeLockedElements);if(r.length>1){if(n?.preferSelected){for(let e=r.length-1;e>-1;e--)if(this.state.selectedElementIds[r[e].id])return r[e]}let i=r[r.length-1];return xg({x:e,y:t,element:i,shape:zg(i,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()/2,frameNameBound:gd(i)?this.frameNameBoundsCache.get(i):null})?i:r[r.length-2]}return r.length===1?r[0]:null}getElementsAtPosition(e,t,n=!1,r=!1){let i=[],a=this.scene.getNonDeletedElementsMap();return(n&&r?this.scene.getNonDeletedElements():this.scene.getNonDeletedElements().filter(e=>(r||!e.locked)&&(n||!(R(e)&&e.containerId)))).filter(n=>this.hitElement(e,t,n)).filter(n=>{let r=AT(n,a);return r&&this.state.frameRendering.enabled&&this.state.frameRendering.clip?ST({x:e,y:t},r,a):!0}).filter(e=>!fd(e)||(i.push(e),!1)).concat(i)}getElementHitThreshold(){return ic/this.state.zoom.value}hitElement(e,t,n,r=!0){if(r&&this.state.selectedElementIds[n.id]&&SE([n],this.state)){let r=Qh(n,this.scene.getNonDeletedElementsMap(),ud(n)?0:this.getElementHitThreshold());if(lg(P(e,t),r))return!0}return wg(e,t,Bg(n,this.scene.getNonDeletedElementsMap()))?!0:xg({x:e,y:t,element:n,shape:zg(n,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold(),frameNameBound:gd(n)?this.frameNameBoundsCache.get(n):null})}getTextBindableContainerAtPosition(e,t){let n=this.scene.getNonDeletedElements(),r=this.scene.getSelectedElements(this.state);if(r.length===1)return Ed(r[0],!1)?r[0]:null;let i=null;for(let r=n.length-1;r>=0;--r){if(n[r].isDeleted)continue;let[a,o,s,c]=av(n[r],this.scene.getNonDeletedElementsMap());if(bd(n[r])&&xg({x:e,y:t,element:n[r],shape:zg(n[r],this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()})){i=n[r];break}if(a<e&&e<s&&o<t&&t<c){i=n[r];break}}return Ed(i,!1)?i:null}handleHoverSelectedLinearElement(e,t,n){let r=this.scene.getNonDeletedElementsMap(),i=U.getElement(e.elementId,r);if(i){if(this.state.selectedLinearElement){let a=-1,o=null;xg({x:t,y:n,element:i,shape:zg(i,this.scene.getNonDeletedElementsMap())})?(a=U.getPointIndexUnderCursor(i,r,this.state.zoom,t,n),o=U.getSegmentMidpointHitCoords(e,{x:t,y:n},this.state,this.scene.getNonDeletedElementsMap()),(z(i)?a===0||a===i.points.length-1:a>=0)||o?cx(this.interactiveCanvas,Vs.POINTER):this.hitElement(t,n,i)&&cx(this.interactiveCanvas,Vs.MOVE)):this.hitElement(t,n,i)&&(!z(i)||!(i.startBinding||i.endBinding))&&cx(this.interactiveCanvas,Vs.MOVE),this.state.selectedLinearElement.hoverPointIndex!==a&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,hoverPointIndex:a}}),U.arePointsEqual(this.state.selectedLinearElement.segmentMidPointHoveredCoords,o)||this.setState({selectedLinearElement:{...this.state.selectedLinearElement,segmentMidPointHoveredCoords:o}})}else cx(this.interactiveCanvas,Vs.AUTO)}}updateGestureOnPointerDown(e){pJ.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),pJ.pointers.size===2&&(pJ.lastCenter=HH(pJ.pointers),pJ.initialScale=this.state.zoom.value,pJ.initialDistance=UH(Array.from(pJ.pointers.values())))}initialPointerDownState(e){let t=_u(e,this.state),n=this.scene.getSelectedElements(this.state),[r,i,a,o]=bv(n),s=n.findIndex(z)===0;return{origin:t,withCmdOrCtrl:e[H.CTRL_OR_CMD],originInGrid:Su(Eb(t.x,t.y,e[H.CTRL_OR_CMD]||s?null:this.getEffectiveGridSize())),scrollbars:kU(aJ,e.clientX-this.state.offsetLeft,e.clientY-this.state.offsetTop),lastCoords:{...t},originalElements:this.scene.getNonDeletedElements().reduce((e,t)=>(e.set(t.id,Nx(t)),e),new Map),resize:{handleType:!1,isResizing:!1,offset:{x:0,y:0},arrowDirection:`origin`,center:{x:(a+r)/2,y:(o+i)/2}},hit:{element:null,allHitElements:[],wasAddedToSelection:!1,hasBeenDuplicated:!1,hasHitCommonBoundingBoxOfSelectedElements:this.isHittingCommonBoundingBoxOfSelectedElements(t,n)},drag:{hasOccurred:!1,offset:null},eventListeners:{onMove:null,onUp:null,onKeyUp:null,onKeyDown:null},boxSelection:{hasOccurred:!1}}}handleDraggingScrollBar(e,t){if(!(t.scrollbars.isOverEither&&!this.state.multiElement))return!1;iJ=!0,t.lastCoords.x=e.clientX,t.lastCoords.y=e.clientY;let n=PK(e=>{e.target instanceof HTMLElement&&this.handlePointerMoveOverScrollbars(e,t)}),r=NK(()=>{fJ=null,iJ=!1,fx(this.interactiveCanvas,this.state),this.setState({cursorButton:`up`}),this.savePointer(e.clientX,e.clientY,`up`),window.removeEventListener(`pointermove`,n),window.removeEventListener(`pointerup`,r),n.flush()});return fJ=r,window.addEventListener(`pointermove`,n),window.addEventListener(`pointerup`,r),!0}isASelectedElement(e){return e!=null&&this.state.selectedElementIds[e.id]}isHittingCommonBoundingBoxOfSelectedElements(e,t){if(t.length<2)return!1;let n=this.getElementHitThreshold(),[r,i,a,o]=bv(t);return e.x>r-n&&e.x<a+n&&e.y>i-n&&e.y<o+n}getCurrentItemRoundness(e){return this.state.currentItemRoundness===`round`?{type:jd(e)?jc.ADAPTIVE_RADIUS:jc.PROPORTIONAL_RADIUS}:null}maybeCacheReferenceSnapPoints(e,t,n=!1){cb({event:e,app:this,selectedElements:t})&&(n||!ob.getReferenceSnapPoints())&&ob.setReferenceSnapPoints(mb(this.scene.getNonDeletedElements(),t,this.state,this.scene.getNonDeletedElementsMap()))}maybeCacheVisibleGaps(e,t,n=!1){cb({event:e,app:this,selectedElements:t})&&(n||!ob.getVisibleGaps())&&ob.setVisibleGaps(fb(this.scene.getNonDeletedElements(),t,this.state,this.scene.getNonDeletedElementsMap()))}onKeyDownFromPointerDownHandler(e){return NK(t=>{this.maybeHandleResize(e,t)||this.maybeDragNewGenericElement(e,t)})}onKeyUpFromPointerDownHandler(e){return NK(t=>{t.key===H.ALT&&t.preventDefault(),!this.maybeHandleResize(e,t)&&this.maybeDragNewGenericElement(e,t)})}onPointerMoveFromPointerDownHandler(e){return PK(t=>{if(this.state.openDialog?.name===`elementLinkSelector`)return;let n=_u(t,this.state);if(this.state.selectedLinearElement&&this.state.selectedLinearElement.elbowed&&this.state.selectedLinearElement.pointerDownState.segmentMidpoint.index){let[e,r]=Eb(n.x,n.y,t[H.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),i=this.state.selectedLinearElement.pointerDownState.segmentMidpoint.index;if(i<0){let t=U.getSegmentMidpointHitCoords({...this.state.selectedLinearElement,segmentMidPointHoveredCoords:null},{x:e,y:r},this.state,this.scene.getNonDeletedElementsMap());i=t?U.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,t,this.scene.getNonDeletedElementsMap()):-1}let a=U.moveFixedSegment(this.state.selectedLinearElement,i,e,r,this.scene.getNonDeletedElementsMap());(0,mk.flushSync)(()=>{this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,segmentMidPointHoveredCoords:a.segmentMidPointHoveredCoords,pointerDownState:a.pointerDownState}})});return}let r=this.lastPointerMoveCoords??e.origin;if(this.lastPointerMoveCoords=n,e.drag.offset===null&&(e.drag.offset=Su(JE(this.scene.getSelectedElements(this.state),e.origin.x,e.origin.y))),!(t.target instanceof HTMLElement)||this.handlePointerMoveOverScrollbars(t,e))return;if(Qc(this.state)){this.handleEraser(t,e,n);return}this.state.activeTool.type===`laser`&&this.laserTrails.addPointToPath(n.x,n.y);let[i,a]=Eb(n.x,n.y,t[H.CTRL_OR_CMD]?null:this.getEffectiveGridSize());if(!e.drag.hasOccurred&&(this.state.activeTool.type===`arrow`||this.state.activeTool.type===`line`)&&Tl(P(n.x,n.y),P(e.origin.x,e.origin.y))<10)return;if(e.resize.isResizing&&(e.lastCoords.x=n.x,e.lastCoords.y=n.y,this.maybeHandleCrop(e,t)||this.maybeHandleResize(e,t)))return!0;let o=this.scene.getNonDeletedElementsMap();if(this.state.selectedLinearElement){let r=this.state.editingLinearElement||this.state.selectedLinearElement;if(U.shouldAddMidpoint(this.state.selectedLinearElement,n,this.state,o)){let e=U.addMidpoint(this.state.selectedLinearElement,n,this,!t[H.CTRL_OR_CMD],o);if(!e)return;(0,mk.flushSync)(()=>{this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,pointerDownState:e.pointerDownState,selectedPointsIndices:e.selectedPointsIndices}}),this.state.editingLinearElement&&this.setState({editingLinearElement:{...this.state.editingLinearElement,pointerDownState:e.pointerDownState,selectedPointsIndices:e.selectedPointsIndices}})});return}if(r.pointerDownState.segmentMidpoint.value!==null&&!r.pointerDownState.segmentMidpoint.added)return;if(U.handlePointDragging(t,this,n.x,n.y,(e,t)=>{this.maybeSuggestBindingsForLinearElementAtCoords(e,t)},r,this.scene)){e.lastCoords.x=n.x,e.lastCoords.y=n.y,e.drag.hasOccurred=!0,this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging&&this.setState({editingLinearElement:{...this.state.editingLinearElement,isDragging:!0}}),this.state.selectedLinearElement.isDragging||this.setState({selectedLinearElement:{...this.state.selectedLinearElement,isDragging:!0}});return}}let s=e.hit.allHitElements.some(e=>this.isASelectedElement(e)),c=this.state.editingLinearElement&&t.shiftKey&&this.state.editingLinearElement.elementId===e.hit.element?.id;if((s||e.hit.hasHitCommonBoundingBoxOfSelectedElements)&&!c){let i=this.scene.getSelectedElements(this.state);if(i.every(e=>e.locked))return;let a=i.find(e=>gd(e)),s=this.getTopLayerFrameAtSceneCoords(n),c=s&&!a?s:null;if(this.state.frameToHighlight!==c&&(0,mk.flushSync)(()=>{this.setState({frameToHighlight:c})}),e.drag.hasOccurred=!0,i.length>0&&!e.withCmdOrCtrl&&!this.state.editingTextElement&&this.state.activeEmbeddable?.state!==`active`){let a={x:n.x-e.origin.x,y:n.y-e.origin.y},s=[...e.originalElements.values()],c=t.shiftKey;if(c){let e=Math.abs(a.x),t=Math.abs(a.y),n=c&&e<t,r=c&&e>t;n&&(a.x=0),r&&(a.y=0)}if(this.state.croppingElementId){let t=this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);if(t&&ud(t)&&t.crop!==null&&e.hit.element===t){let e=t.crop,i=ld(t)&&this.imageCache.get(t.fileId)?.image;if(i&&!(i instanceof Promise)){let a=hl(ul(n.x-r.x,n.y-r.y),Math.max(this.state.zoom.value,2)),[s,c,l,u,d,f]=av(t,o),p=N(F(P(s,c),P(d,f),t.angle)),m=N(F(P(l,c),P(d,f),t.angle)),h=N(F(P(s,u),P(d,f),t.angle)),g=vl(ml(m,p)),_=vl(ml(h,p)),v=ul(fl(a,g),fl(a,_));K(t,{crop:{...e,x:el(e.x-v[0]*Math.sign(t.scale[0]),0,i.naturalWidth-e.width),y:el(e.y-v[1]*Math.sign(t.scale[1]),0,i.naturalHeight-e.height)}});return}}}this.maybeCacheVisibleGaps(t,i),this.maybeCacheReferenceSnapPoints(t,i);let{snapOffset:l,snapLines:u}=gb(s,a,this,t,this.scene.getNonDeletedElementsMap());if(this.setState({snapLines:u}),this.state.editingFrame||GE(e,i,a,this.scene,l,t[H.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),this.setState({selectedElementsAreBeingDragged:!0,selectionElement:null}),(i.length!==1||!z(i[0]))&&this.setState({suggestedBindings:Wv(i,this.scene.getNonDeletedElementsMap(),this.state.zoom)}),t.altKey&&!e.hit.hasBeenDuplicated){e.hit.hasBeenDuplicated=!0;let n=[],r=[],a=new Map,o=new Map,s=e.hit.element,c=new Set(this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}).map(e=>e.id)),l=this.scene.getElementsIncludingDeleted();for(let t of l){let i=c.has(t.id)||t.id===s?.id&&e.hit.wasAddedToSelection;if(Math.abs(t.x)>1e7||Math.abs(t.x)>1e7||Math.abs(t.width)>1e7||Math.abs(t.height)>1e7){console.error(`Alt+dragging element in scene with invalid dimensions`,t.x,t.y,t.width,t.height,i);return}if(i){let i=Ix(this.state.editingGroupId,a,t);if(Math.abs(i.x)>1e7||Math.abs(i.x)>1e7||Math.abs(i.width)>1e7||Math.abs(i.height)>1e7){console.error(`Alt+dragging duplicated element with invalid dimensions`,i.x,i.y,i.width,i.height);return}let s=e.originalElements.get(t.id);if(Math.abs(s.x)>1e7||Math.abs(s.x)>1e7||Math.abs(s.width)>1e7||Math.abs(s.height)>1e7){console.error(`Alt+dragging duplicated element with invalid dimensions`,s.x,s.y,s.width,s.height);return}K(i,{x:s.x,y:s.y}),e.originalElements.set(i.id,i),n.push(i),r.push(t),o.set(t.id,i.id)}else n.push(t)}let u=[...n,...r];u=this.props.onDuplicate?.(u,l)||u,Bx(u,Nu(r)),Fb(n,r,o),gy(u,r,o,`duplicatesServeAsOld`),gT(u,r,o),this.scene.replaceAllElements(u),this.maybeCacheVisibleGaps(t,i,!0),this.maybeCacheReferenceSnapPoints(t,i,!0)}return}}if(this.state.selectionElement)e.lastCoords.x=n.x,e.lastCoords.y=n.y,this.maybeDragNewGenericElement(e,t);else{let r=this.state.newElement;if(!r)return;if(r.type===`freedraw`){let e=r.points,i=n.x-r.x,a=n.y-r.y,o=e.length>0&&e[e.length-1];if(!(o&&o[0]===i&&o[1]===a)){let n=r.simulatePressure?r.pressures:[...r.pressures,t.pressure];K(r,{points:[...e,P(i,a)],pressures:n},!1),this.setState({newElement:r})}}else if(yd(r)){e.drag.hasOccurred=!0;let o=r.points,s=i-r.x,c=a-r.y;Ig(t)&&o.length===2&&({width:s,height:c}=uE(r.x,r.y,n.x,n.y)),o.length===1?K(r,{points:[...o,P(s,c)]},!1):(o.length===2||o.length>1&&z(r))&&K(r,{points:[...o.slice(0,-1),P(s,c)]},!1,{isDragging:!0}),this.setState({newElement:r}),Sd(r,!1)&&this.maybeSuggestBindingsForLinearElementAtCoords(r,[n],this.state.startBoundElement)}else e.lastCoords.x=n.x,e.lastCoords.y=n.y,this.maybeDragNewGenericElement(e,t,!1)}if(this.state.activeTool.type===`selection`){e.boxSelection.hasOccurred=!0;let n=this.scene.getNonDeletedElements();if(this.state.editingLinearElement)U.handleBoxSelection(t,this.state,this.setState.bind(this),this.scene.getNonDeletedElementsMap());else{let r=!0;!t.shiftKey&&qT(n,this.state)&&(e.withCmdOrCtrl&&e.hit.element?this.setState(t=>By({...t,selectedElementIds:{[e.hit.element.id]:!0}},this.scene.getNonDeletedElements(),t,this)):r=!1);let i=this.state.selectionElement?GT(n,this.state.selectionElement,this.scene.getNonDeletedElementsMap(),!1):[];this.setState(t=>{let n={...r&&t.selectedElementIds,...i.reduce((e,t)=>(e[t.id]=!0,e),{})};return e.hit.element&&(i.length?delete n[e.hit.element.id]:n[e.hit.element.id]=!0),t=r?t:{...t,selectedGroupIds:{},editingGroupId:null},{...By({editingGroupId:t.editingGroupId,selectedElementIds:n},this.scene.getNonDeletedElements(),t,this),selectedLinearElement:i.length===1&&yd(i[0])?new U(i[0]):null,showHyperlinkPopup:i.length===1&&(i[0].link||dd(i[0]))?`info`:!1}})}}})}handlePointerMoveOverScrollbars(e,t){if(t.scrollbars.isOverHorizontal){let n=e.clientX,r=n-t.lastCoords.x;return this.translateCanvas({scrollX:this.state.scrollX-r/this.state.zoom.value}),t.lastCoords.x=n,!0}if(t.scrollbars.isOverVertical){let n=e.clientY,r=n-t.lastCoords.y;return this.translateCanvas({scrollY:this.state.scrollY-r/this.state.zoom.value}),t.lastCoords.y=n,!0}return!1}onPointerUpFromPointerDownHandler(e){return NK(t=>{this.removePointer(t),e.eventListeners.onMove&&e.eventListeners.onMove.flush();let{newElement:n,resizingElement:r,croppingElementId:i,multiElement:a,activeTool:o,isResizing:s,isRotating:c,isCropping:l}=this.state;this.setState(e=>({isResizing:!1,isRotating:!1,isCropping:!1,resizingElement:null,selectionElement:null,frameToHighlight:null,elementsToHighlight:null,cursorButton:`up`,snapLines:$u(e.snapLines,[]),originSnapOffset:null})),this.lastPointerMoveCoords=null,ob.setReferenceSnapPoints(null),ob.setVisibleGaps(null),this.savePointer(t.clientX,t.clientY,`up`),this.setState({selectedElementsAreBeingDragged:!1});let u=this.scene.getNonDeletedElementsMap();if(e.drag.hasOccurred&&e.hit?.element?.id){let t=u.get(e.hit.element.id);wd(t)&&t.boundElements?.filter(e=>e.type===`arrow`).map(e=>u.get(e.id)).filter(e=>z(e)).forEach(e=>{e&&K(e,{},!0)})}if(this.state.editingLinearElement){if(!e.boxSelection.hasOccurred&&e.hit?.element?.id!==this.state.editingLinearElement.elementId)this.actionManager.executeAction(gz);else{let e=U.handlePointerUp(t,this.state.editingLinearElement,this.state,this.scene);e!==this.state.editingLinearElement&&this.setState({editingLinearElement:e,suggestedBindings:[]})}}else if(this.state.selectedLinearElement){if(this.state.selectedLinearElement.elbowed){let e=U.getElement(this.state.selectedLinearElement.elementId,this.scene.getNonDeletedElementsMap());e&&K(e,{},!0)}if(e.hit?.element?.id!==this.state.selectedLinearElement.elementId)this.scene.getSelectedElements(this.state).length>1&&this.setState({selectedLinearElement:null});else{let e=U.handlePointerUp(t,this.state.selectedLinearElement,this.state,this.scene),{startBindingElement:n,endBindingElement:r}=e,i=this.scene.getElement(e.elementId);Sd(i)&&Lv(i,n,r,u,this.scene),e!==this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...e,selectedPointsIndices:null},suggestedBindings:[]})}}if(this.missingPointerEventCleanupEmitter.clear(),window.removeEventListener(`pointermove`,e.eventListeners.onMove),window.removeEventListener(`pointerup`,e.eventListeners.onUp),window.removeEventListener(`keydown`,e.eventListeners.onKeyDown),window.removeEventListener(`keyup`,e.eventListeners.onKeyUp),this.state.pendingImageElementId&&this.setState({pendingImageElementId:null}),this.props?.onPointerUp?.(o,e),this.onPointerUpEmitter.trigger(this.state.activeTool,e,t),n?.type===`freedraw`){let e=_u(t,this.state),r=n.points,i=e.x-n.x,a=e.y-n.y;i===r[0][0]&&a===r[0][1]&&(a+=1e-4,i+=1e-4);let o=n.simulatePressure?[]:[...n.pressures,t.pressure];K(n,{points:[...r,P(i,a)],pressures:o,lastCommittedPoint:P(i,a)}),this.actionManager.executeAction(gz);return}if(ud(n)){let e=n;try{this.initializeImageDimensions(e),this.setState({selectedElementIds:ZT({[e.id]:!0},this.state)},()=>{this.actionManager.executeAction(gz)})}catch(t){console.error(t),this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter(t=>t.id!==e.id)),this.actionManager.executeAction(gz)}return}if(yd(n)){n.points.length>1&&this.store.shouldCaptureIncrement();let r=_u(t,this.state);!e.drag.hasOccurred&&n&&!a?(K(n,{points:[...n.points,P(r.x-n.x,r.y-n.y)]}),this.setState({multiElement:n,newElement:n})):e.drag.hasOccurred&&!a&&(Pv(this.state)&&Sd(n,!1)&&Gv(n,this.state,r,this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements()),this.setState({suggestedBindings:[],startBoundElement:null}),o.locked?this.setState(e=>({newElement:null})):(sx(this.interactiveCanvas),this.setState(e=>({newElement:null,activeTool:gu(this.state,{type:`selection`}),selectedElementIds:ZT({...e.selectedElementIds,[n.id]:!0},e),selectedLinearElement:new U(n)}))),this.scene.triggerUpdate());return}if(R(n)){let e=zd(cu({fontSize:n.fontSize,fontFamily:n.fontFamily}),n.lineHeight);n.width<e&&K(n,{autoResize:!0}),this.resetCursor(),this.handleTextWysiwyg(n,{isExistingElement:!0})}if(o.type!==`selection`&&n&&oE(n)){this.updateScene({elements:this.scene.getElementsIncludingDeleted().filter(e=>e.id!==n.id),appState:{newElement:null},captureUpdate:G.NEVER});return}if(gd(n)){let e=OT(this.scene.getElementsIncludingDeleted(),n,this.scene.getNonDeletedElementsMap());this.scene.replaceAllElements(MT(this.scene.getElementsMapIncludingDeleted(),e,n,this.state))}if(n&&(K(n,dE(n)),this.scene.triggerUpdate()),e.drag.hasOccurred){let e=_u(t,this.state);if(this.state.selectedLinearElement&&this.state.selectedLinearElement.isDragging){let e=this.scene.getElement(this.state.selectedLinearElement.elementId);if(e?.frameId){let t=AT(e,u);t&&e&&(xT(e,t,this.scene.getNonDeletedElementsMap())||(K(e,{groupIds:[]}),NT([e],this.scene.getNonDeletedElementsMap()),this.scene.triggerUpdate()))}}else{let t=this.getTopLayerFrameAtSceneCoords(e),n=this.scene.getSelectedElements(this.state),r=this.scene.getElementsMapIncludingDeleted(),i=e=>{if(e.length>0){for(let t of e){let e=t.groupIds.indexOf(this.state.editingGroupId);K(t,{groupIds:t.groupIds.slice(0,e)},!1)}r.forEach(e=>{e.groupIds.length&&qy(r,e.groupIds[e.groupIds.length-1]).length<2&&K(e,{groupIds:[]},!1)}),this.setState({editingGroupId:null})}};if(t&&!this.state.selectedElementIds[t.id]){let e=n.filter(e=>e.frameId!==t.id&&zT(e,r,this.state));this.state.editingGroupId&&i(e),r=MT(r,e,t,this.state)}else!t&&this.state.editingGroupId&&i(n.filter(e=>e.frameId&&!zT(e,r,this.state)));r=IT(r,this.state,this),this.scene.replaceAllElements(r)}}if(r&&this.store.shouldCaptureIncrement(),r&&oE(r)&&this.updateScene({elements:this.scene.getElementsIncludingDeleted().filter(e=>e.id!==r.id),captureUpdate:G.NEVER}),e.resize.isResizing){let e=IT(this.scene.getElementsIncludingDeleted(),this.state,this),t=this.scene.getSelectedElements(this.state).filter(e=>gd(e));for(let n of t)e=FT(e,DT(this.scene.getElementsIncludingDeleted(),n,this.state,u),n,this);this.scene.replaceAllElements(e)}let d=e.hit.element;this.state.selectedLinearElement?.elementId!==d?.id&&yd(d)&&this.scene.getSelectedElements(this.state).length===1&&this.setState({selectedLinearElement:new U(d)}),(!i||i&&(!d&&!l||d&&d.id!==i))&&this.finishImageCropping();let f=this.lastPointerDownEvent,p=this.lastPointerUpEvent||this.lastPointerMoveEvent;if(Qc(this.state)&&f&&p){if(this.eraserTrail.endPath(),Tl(P(f.clientX,f.clientY),P(p.clientX,p.clientY))===0){let e=_u({clientX:p.clientX,clientY:p.clientY},this.state);this.getElementsAtPosition(e.x,e.y).forEach(e=>this.elementsPendingErasure.add(e.id))}this.eraseElements();return}if(this.elementsPendingErasure.size&&this.restoreReadyToEraseElements(),d&&!e.drag.hasOccurred&&!e.hit.wasAddedToSelection&&(!this.state.editingLinearElement||!e.boxSelection.hasOccurred)&&(t.shiftKey&&!this.state.editingLinearElement?this.state.selectedElementIds[d.id]?Vy(this.state,d)?this.setState(e=>{let t={...e.selectedElementIds};for(let e of d.groupIds.flatMap(e=>qy(this.scene.getNonDeletedElements(),e)))delete t[e.id];return{selectedGroupIds:{...e.selectedElementIds,...d.groupIds.map(e=>({[e]:!1})).reduce((e,t)=>({...e,...t}),{})},selectedElementIds:ZT(t,e)}}):this.state.selectedLinearElement?.isDragging||this.setState(e=>{let t={...e.selectedElementIds};delete t[d.id];let n=YT(this.scene.getNonDeletedElements(),{selectedElementIds:t});return{...By({editingGroupId:e.editingGroupId,selectedElementIds:t},this.scene.getNonDeletedElements(),e,this),selectedLinearElement:n.length===1&&yd(n[0])?new U(n[0]):e.selectedLinearElement}}):d.frameId&&this.state.selectedElementIds[d.frameId]?this.setState(e=>{let t={...e.selectedElementIds,[d.id]:!0};return delete t[d.frameId],(this.scene.getElement(d.frameId)?.groupIds??[]).flatMap(e=>qy(this.scene.getNonDeletedElements(),e)).forEach(e=>{delete t[e.id]}),{...By({editingGroupId:e.editingGroupId,selectedElementIds:t},this.scene.getNonDeletedElements(),e,this),showHyperlinkPopup:d.link||dd(d)?`info`:!1}}):this.setState(e=>({selectedElementIds:ZT({...e.selectedElementIds,[d.id]:!0},e)})):this.setState(e=>({...By({editingGroupId:e.editingGroupId,selectedElementIds:{[d.id]:!0}},this.scene.getNonDeletedElements(),e,this),selectedLinearElement:yd(d)&&e.selectedLinearElement?.elementId!==d.id?new U(d):e.selectedLinearElement}))),!(d&&z(d))&&!e.drag.hasOccurred&&!this.state.isResizing&&(d&&Cg({x:e.origin.x,y:e.origin.y,element:d,shape:zg(d,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold(),frameNameBound:gd(d)?this.frameNameBoundsCache.get(d):null},u)||!d&&e.hit.hasHitCommonBoundingBoxOfSelectedElements)){this.state.editingLinearElement?this.setState({editingLinearElement:null}):this.setState({selectedElementIds:ZT({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null}),cx(this.interactiveCanvas,Vs.AUTO);return}if(!o.locked&&o.type!==`freedraw`&&n&&this.setState(e=>({selectedElementIds:ZT({...e.selectedElementIds,[n.id]:!0},e),showHyperlinkPopup:dd(n)&&!n.link?`editor`:e.showHyperlinkPopup})),(o.type!==`selection`||qT(this.scene.getNonDeletedElements(),this.state)||!Ku(this.state.previousSelectedElementIds,this.state.selectedElementIds))&&this.store.shouldCaptureIncrement(),(e.drag.hasOccurred||s||c||l)&&Uv(this.scene.getSelectedElements(this.state).filter(yd),this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements(),this.scene,Pv(this.state),this.state.selectedLinearElement?.selectedPointsIndices??[],this.state.zoom),o.type===`laser`){this.laserTrails.endPath();return}!o.locked&&o.type!==`freedraw`?(sx(this.interactiveCanvas),this.setState({newElement:null,suggestedBindings:[],activeTool:gu(this.state,{type:`selection`})})):this.setState({newElement:null,suggestedBindings:[]}),d&&this.lastPointerUpEvent&&this.lastPointerDownEvent&&this.lastPointerUpEvent.timeStamp-this.lastPointerDownEvent.timeStamp<300&&pJ.pointers.size<=1&&pd(d)&&this.isIframeLikeElementCenter(d,this.lastPointerUpEvent,e.origin.x,e.origin.y)&&this.handleEmbeddableCenterClick(d)})}clearSelection(e){this.setState(t=>({selectedElementIds:ZT({},t),activeEmbeddable:null,selectedGroupIds:{},editingGroupId:t.editingGroupId&&e!=null&&Ky(e,t.editingGroupId)?t.editingGroupId:null})),this.setState({selectedElementIds:ZT({},this.state),activeEmbeddable:null,previousSelectedElementIds:this.state.selectedElementIds})}getTextWysiwygSnappedToCenterPosition(e,t,n,r){if(r){let i=r.x+r.width/2,a=r.y+r.height/2,o=Vb(r,n,this.scene.getNonDeletedElementsMap());if(o&&(i=o.x,a=o.y),Math.hypot(e-i,t-a)<30){let{x:e,y:t}=vu({sceneX:i,sceneY:a},n);return{viewportX:e,viewportY:t,elementCenterX:i,elementCenterY:a}}}}getCanvasOffsets(){if(this.excalidrawContainerRef?.current){let{left:e,top:t}=this.excalidrawContainerRef.current.getBoundingClientRect();return{offsetLeft:e,offsetTop:t}}return{offsetLeft:0,offsetTop:0}}async updateLanguage(){await iL(eL.find(e=>e.code===this.props.langCode)||$I),this.setAppState({})}};(f.MODE===Gs.TEST||f.DEV)&&(window.h=window.h||{},Object.defineProperties(window.h,{elements:{configurable:!0,get(){return this.app?.scene.getElementsIncludingDeleted()},set(e){return this.app?.scene.replaceAllElements(Vx(e))}},scene:{configurable:!0,get(){return this.app?.scene}}}));var hJ=mJ;(0,qi.default)((e,t,n)=>{(f.DEV||f.MODE===Gs.TEST||window?.DEBUG_FRACTIONAL_INDICES)&&Rx(Vx(e.map(e=>({...e}))),{shouldThrow:f.DEV||f.MODE===Gs.TEST,includeBoundTextValidation:!0,reconciliationContext:{localElements:t,remoteElements:n}})},6e4,{leading:!0,trailing:!1}),Array.prototype.at||Object.defineProperty(Array.prototype,"at",{value:function(e){if(e=Math.trunc(e)||0,e<0&&(e+=this.length),!(e<0||e>=this.length))return this[e]},writable:!0,enumerable:!1,configurable:!0}),Element.prototype.replaceChildren||(Element.prototype.replaceChildren=function(...e){this.innerHTML=``,this.append(...e)});var gJ=u.memo(e=>{let{onChange:t,initialData:n,excalidrawAPI:r,isCollaborating:i=!1,onPointerUpdate:a,renderTopRightUI:o,langCode:s=$I.code,viewModeEnabled:c,zenModeEnabled:l,gridModeEnabled:d,libraryReturnUrl:f,theme:p,name:m,renderCustomStats:h,onPaste:g,detectScroll:_=!0,handleKeyboardGlobally:v=!1,onLibraryChange:y,autoFocus:b=!1,generateIdForFile:x,onLinkOpen:S,generateLinkForSelection:C,onPointerDown:w,onPointerUp:T,onScrollChange:E,onDuplicate:D,children:ee,validateEmbeddable:te,renderEmbeddable:ne,aiEnabled:re,showDeprecatedFonts:ie}=e,ae=e.UIOptions?.canvasActions,oe={...e.UIOptions,canvasActions:{...gc.canvasActions,...ae},tools:{image:e.UIOptions?.tools?.image??!0}};return ae?.export&&(oe.canvasActions.export.saveFileToDisk=ae.export?.saveFileToDisk??gc.canvasActions.export.saveFileToDisk),oe.canvasActions.toggleTheme===null&&typeof p>`u`&&(oe.canvasActions.toggleTheme=!0),(0,u.useEffect)(()=>{(async()=>{await A(()=>import(`./roundRect-D01gJrlt.js`),[],import.meta.url)})();let e=e=>{typeof e.scale==`number`&&e.scale!==1&&e.preventDefault()};return document.addEventListener(`touchmove`,e,{passive:!1}),()=>{document.removeEventListener(`touchmove`,e)}},[]),(0,k.jsx)(YI,{store:XI,children:(0,k.jsx)(dL,{langCode:s,theme:p,children:(0,k.jsx)(hJ,{onChange:t,initialData:n,excalidrawAPI:r,isCollaborating:i,onPointerUpdate:a,renderTopRightUI:o,langCode:s,viewModeEnabled:c,zenModeEnabled:l,gridModeEnabled:d,libraryReturnUrl:f,theme:p,name:m,renderCustomStats:h,UIOptions:oe,onPaste:g,detectScroll:_,handleKeyboardGlobally:v,onLibraryChange:y,autoFocus:b,generateIdForFile:x,onLinkOpen:S,generateLinkForSelection:C,onPointerDown:w,onPointerUp:T,onScrollChange:E,onDuplicate:D,validateEmbeddable:te,renderEmbeddable:ne,aiEnabled:re!==!1,showDeprecatedFonts:ie,children:ee})})})},(e,t)=>{if(e.children!==t.children)return!1;let{initialData:n,UIOptions:r={},...i}=e,{initialData:a,UIOptions:o={},...s}=t,c=Object.keys(r),l=Object.keys(o);return c.length===l.length&&c.every(e=>e===`canvasActions`?Object.keys(r.canvasActions).every(e=>e===`export`&&r?.canvasActions?.export&&o?.canvasActions?.export?r.canvasActions.export.saveFileToDisk===o.canvasActions.export.saveFileToDisk:r?.canvasActions?.[e]===o?.canvasActions?.[e]):r[e]===o[e])&&Ku(i,s)});gJ.displayName=`Excalidraw`;var _J;function Y(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var vJ=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},yJ=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(_J=globalThis).__zod_globalConfig??(_J.__zod_globalConfig={});var bJ=globalThis.__zod_globalConfig;function xJ(e){return e&&Object.assign(bJ,e),bJ}function SJ(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function CJ(e,t){return typeof t==`bigint`?t.toString():t}function wJ(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function TJ(e){return e==null}function EJ(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function DJ(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var OJ=Symbol(`evaluating`);function kJ(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==OJ)return r===void 0&&(r=OJ,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function AJ(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function jJ(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function MJ(e){return JSON.stringify(e)}function NJ(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var PJ=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function FJ(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var IJ=wJ(()=>{if(bJ.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function LJ(e){if(FJ(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return FJ(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function RJ(e){return LJ(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var zJ=new Set([`string`,`number`,`symbol`]);function BJ(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function VJ(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function HJ(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function UJ(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var WJ={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function GJ(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return VJ(e,jJ(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return AJ(this,`shape`,e),e},checks:[]}))}function KJ(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return VJ(e,jJ(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return AJ(this,`shape`,r),r},checks:[]}))}function qJ(e,t){if(!LJ(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return VJ(e,jJ(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return AJ(this,`shape`,n),n}}))}function JJ(e,t){if(!LJ(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return VJ(e,jJ(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return AJ(this,`shape`,n),n}}))}function YJ(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return VJ(e,jJ(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return AJ(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function XJ(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return VJ(t,jJ(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return AJ(this,`shape`,i),i},checks:[]}))}function ZJ(e,t,n){return VJ(t,jJ(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return AJ(this,`shape`,i),i}}))}function QJ(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function $J(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function eY(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function tY(e){return typeof e==`string`?e:e?.message}function nY(e,t,n){let r=e.message?e.message:tY(e.inst?._zod.def?.error?.(e))??tY(t?.error?.(e))??tY(n.customError?.(e))??tY(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function rY(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function iY(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var aY=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,CJ,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},oY=Y(`$ZodError`,aY),sY=Y(`$ZodError`,aY,{Parent:Error});function cY(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function lY(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var uY=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new vJ;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>nY(e,a,xJ())));throw PJ(t,i?.callee),t}return o.value},dY=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>nY(e,a,xJ())));throw PJ(t,i?.callee),t}return o.value},fY=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new vJ;return a.issues.length?{success:!1,error:new(e??oY)(a.issues.map(e=>nY(e,i,xJ())))}:{success:!0,data:a.value}},pY=fY(sY),mY=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>nY(e,i,xJ())))}:{success:!0,data:a.value}},hY=mY(sY),gY=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return uY(e)(t,n,i)},_Y=e=>(t,n,r)=>uY(e)(t,n,r),vY=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return dY(e)(t,n,i)},yY=e=>async(t,n,r)=>dY(e)(t,n,r),bY=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return fY(e)(t,n,i)},xY=e=>(t,n,r)=>fY(e)(t,n,r),SY=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return mY(e)(t,n,i)},CY=e=>async(t,n,r)=>mY(e)(t,n,r),wY=/^[cC][0-9a-z]{6,}$/,TY=/^[0-9a-z]+$/,EY=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,DY=/^[0-9a-vA-V]{20}$/,OY=/^[A-Za-z0-9]{27}$/,kY=/^[a-zA-Z0-9_-]{21}$/,AY=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,jY=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,MY=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,NY=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,PY=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function FY(){return new RegExp(PY,`u`)}var IY=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,LY=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,RY=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,zY=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,BY=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,VY=/^[A-Za-z0-9_-]*$/,HY=/^https?$/,UY=/^\+[1-9]\d{6,14}$/,WY=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,GY=RegExp(`^${WY}$`);function KY(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function qY(e){return RegExp(`^${KY(e)}$`)}function JY(e){let t=KY({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${WY}T(?:${r})$`)}var YY=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},XY=/^-?\d+$/,ZY=/^-?\d+(?:\.\d+)?$/,QY=/^(?:true|false)$/i,$Y=/^[^A-Z]*$/,eX=/^[^a-z]*$/,tX=Y(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),nX={number:`number`,bigint:`bigint`,object:`date`},rX=Y(`$ZodCheckLessThan`,(e,t)=>{tX.init(e,t);let n=nX[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),iX=Y(`$ZodCheckGreaterThan`,(e,t)=>{tX.init(e,t);let n=nX[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),aX=Y(`$ZodCheckMultipleOf`,(e,t)=>{tX.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):DJ(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),oX=Y(`$ZodCheckNumberFormat`,(e,t)=>{tX.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=WJ[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=XY)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),sX=Y(`$ZodCheckMaxLength`,(e,t)=>{var n;tX.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!TJ(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=rY(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),cX=Y(`$ZodCheckMinLength`,(e,t)=>{var n;tX.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!TJ(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=rY(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),lX=Y(`$ZodCheckLengthEquals`,(e,t)=>{var n;tX.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!TJ(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=rY(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),uX=Y(`$ZodCheckStringFormat`,(e,t)=>{var n,r;tX.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),dX=Y(`$ZodCheckRegex`,(e,t)=>{uX.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),fX=Y(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=$Y,uX.init(e,t)}),pX=Y(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=eX,uX.init(e,t)}),mX=Y(`$ZodCheckIncludes`,(e,t)=>{tX.init(e,t);let n=BJ(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),hX=Y(`$ZodCheckStartsWith`,(e,t)=>{tX.init(e,t);let n=RegExp(`^${BJ(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),gX=Y(`$ZodCheckEndsWith`,(e,t)=>{tX.init(e,t);let n=RegExp(`.*${BJ(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),_X=Y(`$ZodCheckOverwrite`,(e,t)=>{tX.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),vX=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
207
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
208
|
+
`))}},yX={major:4,minor:4,patch:3},bX=Y(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=yX;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=QJ(e),i;for(let a of t){if(a._zod.def.when){if($J(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new vJ;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=QJ(e,t))});else{if(e.issues.length===t)continue;r||=QJ(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(QJ(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new vJ;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new vJ;return o.then(e=>t(e,r,a))}return t(o,r,a)}}kJ(e,`~standard`,()=>({validate:t=>{try{let n=pY(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return hY(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),xX=Y(`$ZodString`,(e,t)=>{bX.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??YY(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),SX=Y(`$ZodStringFormat`,(e,t)=>{uX.init(e,t),xX.init(e,t)}),CX=Y(`$ZodGUID`,(e,t)=>{t.pattern??=jY,SX.init(e,t)}),wX=Y(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=MY(e)}else t.pattern??=MY();SX.init(e,t)}),TX=Y(`$ZodEmail`,(e,t)=>{t.pattern??=NY,SX.init(e,t)}),EX=Y(`$ZodURL`,(e,t)=>{SX.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===HY.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),n.value=t.normalize?i.href:r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),DX=Y(`$ZodEmoji`,(e,t)=>{t.pattern??=FY(),SX.init(e,t)}),OX=Y(`$ZodNanoID`,(e,t)=>{t.pattern??=kY,SX.init(e,t)}),kX=Y(`$ZodCUID`,(e,t)=>{t.pattern??=wY,SX.init(e,t)}),AX=Y(`$ZodCUID2`,(e,t)=>{t.pattern??=TY,SX.init(e,t)}),jX=Y(`$ZodULID`,(e,t)=>{t.pattern??=EY,SX.init(e,t)}),MX=Y(`$ZodXID`,(e,t)=>{t.pattern??=DY,SX.init(e,t)}),NX=Y(`$ZodKSUID`,(e,t)=>{t.pattern??=OY,SX.init(e,t)}),PX=Y(`$ZodISODateTime`,(e,t)=>{t.pattern??=JY(t),SX.init(e,t)}),FX=Y(`$ZodISODate`,(e,t)=>{t.pattern??=GY,SX.init(e,t)}),IX=Y(`$ZodISOTime`,(e,t)=>{t.pattern??=qY(t),SX.init(e,t)}),LX=Y(`$ZodISODuration`,(e,t)=>{t.pattern??=AY,SX.init(e,t)}),RX=Y(`$ZodIPv4`,(e,t)=>{t.pattern??=IY,SX.init(e,t),e._zod.bag.format=`ipv4`}),zX=Y(`$ZodIPv6`,(e,t)=>{t.pattern??=LY,SX.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),BX=Y(`$ZodCIDRv4`,(e,t)=>{t.pattern??=RY,SX.init(e,t)}),VX=Y(`$ZodCIDRv6`,(e,t)=>{t.pattern??=zY,SX.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function HX(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var UX=Y(`$ZodBase64`,(e,t)=>{t.pattern??=BY,SX.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{HX(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function WX(e){if(!VY.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return HX(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var GX=Y(`$ZodBase64URL`,(e,t)=>{t.pattern??=VY,SX.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{WX(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),KX=Y(`$ZodE164`,(e,t)=>{t.pattern??=UY,SX.init(e,t)});function qX(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var JX=Y(`$ZodJWT`,(e,t)=>{SX.init(e,t),e._zod.check=n=>{qX(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),YX=Y(`$ZodNumber`,(e,t)=>{bX.init(e,t),e._zod.pattern=e._zod.bag.pattern??ZY,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),XX=Y(`$ZodNumberFormat`,(e,t)=>{oX.init(e,t),YX.init(e,t)}),ZX=Y(`$ZodBoolean`,(e,t)=>{bX.init(e,t),e._zod.pattern=QY,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),QX=Y(`$ZodUnknown`,(e,t)=>{bX.init(e,t),e._zod.parse=e=>e}),$X=Y(`$ZodNever`,(e,t)=>{bX.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function eZ(e,t,n){e.issues.length&&t.issues.push(...eY(n,e.issues)),t.value[n]=e.value}var tZ=Y(`$ZodArray`,(e,t)=>{bX.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>eZ(t,n,e))):eZ(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function nZ(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...eY(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function rZ(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=UJ(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function iZ(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>nZ(e,n,i,t,u,d))):nZ(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var aZ=Y(`$ZodObject`,(e,t)=>{if(bX.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=wJ(()=>rZ(t));kJ(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=FJ,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>nZ(n,t,e,s,r,i))):nZ(a,t,e,s,r,i)}return i?iZ(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),oZ=Y(`$ZodObjectJIT`,(e,t)=>{aZ.init(e,t);let n=e._zod.parse,r=wJ(()=>rZ(t)),i=e=>{let t=new vX([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=MJ(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=MJ(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
209
|
+
if (${n}.issues.length) {
|
|
210
|
+
if (${o} in input) {
|
|
211
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
212
|
+
...iss,
|
|
213
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
214
|
+
})));
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (${n}.value === undefined) {
|
|
219
|
+
if (${o} in input) {
|
|
220
|
+
newResult[${o}] = undefined;
|
|
221
|
+
}
|
|
222
|
+
} else {
|
|
223
|
+
newResult[${o}] = ${n}.value;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
`):c?t.write(`
|
|
227
|
+
if (${n}.issues.length) {
|
|
228
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
229
|
+
...iss,
|
|
230
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
231
|
+
})));
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if (${n}.value === undefined) {
|
|
235
|
+
if (${o} in input) {
|
|
236
|
+
newResult[${o}] = undefined;
|
|
237
|
+
}
|
|
238
|
+
} else {
|
|
239
|
+
newResult[${o}] = ${n}.value;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
`):t.write(`
|
|
243
|
+
const ${n}_present = ${o} in input;
|
|
244
|
+
if (${n}.issues.length) {
|
|
245
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
246
|
+
...iss,
|
|
247
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
248
|
+
})));
|
|
249
|
+
}
|
|
250
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
251
|
+
payload.issues.push({
|
|
252
|
+
code: "invalid_type",
|
|
253
|
+
expected: "nonoptional",
|
|
254
|
+
input: undefined,
|
|
255
|
+
path: [${o}]
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
if (${n}_present) {
|
|
260
|
+
if (${n}.value === undefined) {
|
|
261
|
+
newResult[${o}] = undefined;
|
|
262
|
+
} else {
|
|
263
|
+
newResult[${o}] = ${n}.value;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=FJ,s=!bJ.jitless,c=s&&IJ.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?iZ([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function sZ(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!QJ(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>nY(e,r,xJ())))}),t)}var cZ=Y(`$ZodUnion`,(e,t)=>{bX.init(e,t),kJ(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),kJ(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),kJ(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),kJ(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>EJ(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>sZ(t,r,e,i)):sZ(o,r,e,i)}}),lZ=Y(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,cZ.init(e,t);let n=e._zod.parse;kJ(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=wJ(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!FJ(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),uZ=Y(`$ZodIntersection`,(e,t)=>{bX.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>fZ(e,t,n)):fZ(e,i,a)}});function dZ(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(LJ(e)&&LJ(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=dZ(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=dZ(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function fZ(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),QJ(e))return e;let o=dZ(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var pZ=Y(`$ZodTuple`,(e,t)=>{bX.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:`tuple`,code:`invalid_type`}),r;r.value=[];let o=[],s=mZ(n,`optin`),c=mZ(n,`optout`);if(!t.rest){if(a.length<s)return r.issues.push({code:`too_small`,minimum:s,inclusive:!0,input:a,inst:e,origin:`array`}),r;a.length>n.length&&r.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:a,inst:e,origin:`array`})}let l=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:a[e],issues:[]},i);t instanceof Promise?o.push(t.then(t=>{l[e]=t})):l[e]=t}if(t.rest){let e=n.length-1,s=a.slice(n.length);for(let n of s){e++;let a=t.rest._zod.run({value:n,issues:[]},i);a instanceof Promise?o.push(a.then(t=>hZ(t,r,e))):hZ(a,r,e)}}return o.length?Promise.all(o).then(()=>gZ(l,r,n,a,c)):gZ(l,r,n,a,c)}});function mZ(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!==`optional`)return n+1;return 0}function hZ(e,t,n){e.issues.length&&t.issues.push(...eY(n,e.issues)),t.value[n]=e.value}function gZ(e,t,n,r,i){for(let a=0;a<n.length;a++){let n=e[a],o=a<r.length;if(n.issues.length){if(!o&&a>=i){t.value.length=a;break}t.issues.push(...eY(a,n.issues))}t.value[a]=n.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}var _Z=Y(`$ZodRecord`,(e,t)=>{bX.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!LJ(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>nY(e,r,xJ())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...eY(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...eY(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&ZY.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>nY(e,r,xJ())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...eY(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...eY(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),vZ=Y(`$ZodEnum`,(e,t)=>{bX.init(e,t);let n=SJ(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>zJ.has(typeof e)).map(e=>typeof e==`string`?BJ(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),yZ=Y(`$ZodLiteral`,(e,t)=>{if(bX.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?BJ(e):e?BJ(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),bZ=Y(`$ZodTransform`,(e,t)=>{bX.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new yJ(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new vJ;return n.value=i,n.fallback=!0,n}});function xZ(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var SZ=Y(`$ZodOptional`,(e,t)=>{bX.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,kJ(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),kJ(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${EJ(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>xZ(e,r)):xZ(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),CZ=Y(`$ZodExactOptional`,(e,t)=>{SZ.init(e,t),kJ(e._zod,`values`,()=>t.innerType._zod.values),kJ(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),wZ=Y(`$ZodNullable`,(e,t)=>{bX.init(e,t),kJ(e._zod,`optin`,()=>t.innerType._zod.optin),kJ(e._zod,`optout`,()=>t.innerType._zod.optout),kJ(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${EJ(e.source)}|null)$`):void 0}),kJ(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),TZ=Y(`$ZodDefault`,(e,t)=>{bX.init(e,t),e._zod.optin=`optional`,kJ(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>EZ(e,t)):EZ(r,t)}});function EZ(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var DZ=Y(`$ZodPrefault`,(e,t)=>{bX.init(e,t),e._zod.optin=`optional`,kJ(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),OZ=Y(`$ZodNonOptional`,(e,t)=>{bX.init(e,t),kJ(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>kZ(t,e)):kZ(i,e)}});function kZ(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var AZ=Y(`$ZodCatch`,(e,t)=>{bX.init(e,t),e._zod.optin=`optional`,kJ(e._zod,`optout`,()=>t.innerType._zod.optout),kJ(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>nY(e,n,xJ()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>nY(e,n,xJ()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),jZ=Y(`$ZodPipe`,(e,t)=>{bX.init(e,t),kJ(e._zod,`values`,()=>t.in._zod.values),kJ(e._zod,`optin`,()=>t.in._zod.optin),kJ(e._zod,`optout`,()=>t.out._zod.optout),kJ(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>MZ(e,t.in,n)):MZ(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>MZ(e,t.out,n)):MZ(r,t.out,n)}});function MZ(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var NZ=Y(`$ZodReadonly`,(e,t)=>{bX.init(e,t),kJ(e._zod,`propValues`,()=>t.innerType._zod.propValues),kJ(e._zod,`values`,()=>t.innerType._zod.values),kJ(e._zod,`optin`,()=>t.innerType?._zod?.optin),kJ(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(PZ):PZ(r)}});function PZ(e){return e.value=Object.freeze(e.value),e}var FZ=Y(`$ZodCustom`,(e,t)=>{tX.init(e,t),bX.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>IZ(t,n,r,e));IZ(i,n,r,e)}});function IZ(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(iY(e))}}var LZ,RZ=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function zZ(){return new RZ}(LZ=globalThis).__zod_globalRegistry??(LZ.__zod_globalRegistry=zZ());var BZ=globalThis.__zod_globalRegistry;function VZ(e,t){return new e({type:`string`,...HJ(t)})}function HZ(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...HJ(t)})}function UZ(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...HJ(t)})}function WZ(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...HJ(t)})}function GZ(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...HJ(t)})}function KZ(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...HJ(t)})}function qZ(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...HJ(t)})}function JZ(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...HJ(t)})}function YZ(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...HJ(t)})}function XZ(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...HJ(t)})}function ZZ(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...HJ(t)})}function QZ(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...HJ(t)})}function $Z(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...HJ(t)})}function eQ(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...HJ(t)})}function tQ(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...HJ(t)})}function nQ(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...HJ(t)})}function rQ(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...HJ(t)})}function iQ(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...HJ(t)})}function aQ(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...HJ(t)})}function oQ(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...HJ(t)})}function sQ(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...HJ(t)})}function cQ(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...HJ(t)})}function lQ(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...HJ(t)})}function uQ(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...HJ(t)})}function dQ(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...HJ(t)})}function fQ(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...HJ(t)})}function pQ(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...HJ(t)})}function mQ(e,t){return new e({type:`number`,checks:[],...HJ(t)})}function hQ(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...HJ(t)})}function gQ(e,t){return new e({type:`boolean`,...HJ(t)})}function _Q(e){return new e({type:`unknown`})}function vQ(e,t){return new e({type:`never`,...HJ(t)})}function yQ(e,t){return new rX({check:`less_than`,...HJ(t),value:e,inclusive:!1})}function bQ(e,t){return new rX({check:`less_than`,...HJ(t),value:e,inclusive:!0})}function xQ(e,t){return new iX({check:`greater_than`,...HJ(t),value:e,inclusive:!1})}function SQ(e,t){return new iX({check:`greater_than`,...HJ(t),value:e,inclusive:!0})}function CQ(e,t){return new aX({check:`multiple_of`,...HJ(t),value:e})}function wQ(e,t){return new sX({check:`max_length`,...HJ(t),maximum:e})}function TQ(e,t){return new cX({check:`min_length`,...HJ(t),minimum:e})}function EQ(e,t){return new lX({check:`length_equals`,...HJ(t),length:e})}function DQ(e,t){return new dX({check:`string_format`,format:`regex`,...HJ(t),pattern:e})}function OQ(e){return new fX({check:`string_format`,format:`lowercase`,...HJ(e)})}function kQ(e){return new pX({check:`string_format`,format:`uppercase`,...HJ(e)})}function AQ(e,t){return new mX({check:`string_format`,format:`includes`,...HJ(t),includes:e})}function jQ(e,t){return new hX({check:`string_format`,format:`starts_with`,...HJ(t),prefix:e})}function MQ(e,t){return new gX({check:`string_format`,format:`ends_with`,...HJ(t),suffix:e})}function NQ(e){return new _X({check:`overwrite`,tx:e})}function PQ(e){return NQ(t=>t.normalize(e))}function FQ(){return NQ(e=>e.trim())}function IQ(){return NQ(e=>e.toLowerCase())}function LQ(){return NQ(e=>e.toUpperCase())}function RQ(){return NQ(e=>NJ(e))}function zQ(e,t,n){return new e({type:`array`,element:t,...HJ(n)})}function BQ(e,t,n){let r=HJ(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function VQ(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...HJ(n)})}function HQ(e,t){let n=UQ(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(iY(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(iY(r))}},e(t.value,t)),t);return n}function UQ(e,t){let n=new tX({check:`custom`,...HJ(t)});return n._zod.check=e,n}function WQ(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??BZ,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function GQ(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,GQ(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&JQ(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function KQ(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
268
|
+
|
|
269
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function qQ(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:XQ(t,`input`,e.processors),output:XQ(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function JQ(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return JQ(r.element,n);if(r.type===`set`)return JQ(r.valueType,n);if(r.type===`lazy`)return JQ(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return JQ(r.innerType,n);if(r.type===`intersection`)return JQ(r.left,n)||JQ(r.right,n);if(r.type===`record`||r.type===`map`)return JQ(r.keyType,n)||JQ(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:JQ(r.in,n)||JQ(r.out,n);if(r.type===`object`){for(let e in r.shape)if(JQ(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(JQ(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(JQ(e,n))return!0;return!!(r.rest&&JQ(r.rest,n))}return!1}var YQ=(e,t={})=>n=>{let r=WQ({...n,processors:t});return GQ(e,r),KQ(r,e),qQ(r,e)},XQ=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=WQ({...i??{},target:a,io:t,processors:n});return GQ(e,o),KQ(o,e),qQ(o,e)},ZQ={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},QQ=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ZQ[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},$Q=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},e$=(e,t,n,r)=>{n.type=`boolean`},t$=(e,t,n,r)=>{n.not={}},n$=(e,t,n,r)=>{let i=e._zod.def,a=SJ(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},r$=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},i$=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},a$=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},o$=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=GQ(a.element,t,{...r,path:[...r.path,`items`]})},s$=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=GQ(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=GQ(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},c$=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>GQ(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},l$=(e,t,n,r)=>{let i=e._zod.def,a=GQ(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=GQ(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},u$=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>GQ(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?GQ(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},d$=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=GQ(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=GQ(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=GQ(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},f$=(e,t,n,r)=>{let i=e._zod.def,a=GQ(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},p$=(e,t,n,r)=>{let i=e._zod.def;GQ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},m$=(e,t,n,r)=>{let i=e._zod.def;GQ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},h$=(e,t,n,r)=>{let i=e._zod.def;GQ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},g$=(e,t,n,r)=>{let i=e._zod.def;GQ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},_$=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;GQ(o,t,r);let s=t.seen.get(e);s.ref=o},v$=(e,t,n,r)=>{let i=e._zod.def;GQ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},y$=(e,t,n,r)=>{let i=e._zod.def;GQ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},b$=Y(`ZodISODateTime`,(e,t)=>{PX.init(e,t),K$.init(e,t)});function x$(e){return uQ(b$,e)}var S$=Y(`ZodISODate`,(e,t)=>{FX.init(e,t),K$.init(e,t)});function C$(e){return dQ(S$,e)}var w$=Y(`ZodISOTime`,(e,t)=>{IX.init(e,t),K$.init(e,t)});function T$(e){return fQ(w$,e)}var E$=Y(`ZodISODuration`,(e,t)=>{LX.init(e,t),K$.init(e,t)});function D$(e){return pQ(E$,e)}var O$=Y(`ZodError`,(e,t)=>{oY.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>lY(e,t)},flatten:{value:t=>cY(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,CJ,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,CJ,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),k$=uY(O$),A$=dY(O$),j$=fY(O$),M$=mY(O$),N$=gY(O$),P$=_Y(O$),F$=vY(O$),I$=yY(O$),L$=bY(O$),R$=xY(O$),z$=SY(O$),B$=CY(O$),V$=new WeakMap;function H$(e,t,n){let r=Object.getPrototypeOf(e),i=V$.get(r);if(i||(i=new Set,V$.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var U$=Y(`ZodType`,(e,t)=>(bX.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:XQ(e,`input`),output:XQ(e,`output`)}}),e.toJSONSchema=YQ(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>k$(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>j$(e,t,n),e.parseAsync=async(t,n)=>A$(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>M$(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>N$(e,t,n),e.decode=(t,n)=>P$(e,t,n),e.encodeAsync=async(t,n)=>F$(e,t,n),e.decodeAsync=async(t,n)=>I$(e,t,n),e.safeEncode=(t,n)=>L$(e,t,n),e.safeDecode=(t,n)=>R$(e,t,n),e.safeEncodeAsync=async(t,n)=>z$(e,t,n),e.safeDecodeAsync=async(t,n)=>B$(e,t,n),H$(e,`ZodType`,{check(...e){let t=this.def;return this.clone(jJ(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return VJ(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(s0(e,t))},superRefine(e,t){return this.check(c0(e,t))},overwrite(e){return this.check(NQ(e))},optional(){return H1(this)},exactOptional(){return W1(this)},nullable(){return K1(this)},nullish(){return H1(K1(this))},nonoptional(e){return Q1(this,e)},array(){return Q(this)},or(e){return E1([this,e])},and(e){return A1(this,e)},transform(e){return n0(this,B1(e))},default(e){return J1(this,e)},prefault(e){return X1(this,e)},catch(e){return e0(this,e)},pipe(e){return n0(this,e)},readonly(){return i0(this)},describe(e){let t=this.clone();return BZ.add(t,{description:e}),t},meta(...e){if(e.length===0)return BZ.get(this);let t=this.clone();return BZ.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return BZ.get(e)?.description},configurable:!0}),e)),W$=Y(`_ZodString`,(e,t)=>{xX.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>QQ(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,H$(e,`_ZodString`,{regex(...e){return this.check(DQ(...e))},includes(...e){return this.check(AQ(...e))},startsWith(...e){return this.check(jQ(...e))},endsWith(...e){return this.check(MQ(...e))},min(...e){return this.check(TQ(...e))},max(...e){return this.check(wQ(...e))},length(...e){return this.check(EQ(...e))},nonempty(...e){return this.check(TQ(1,...e))},lowercase(e){return this.check(OQ(e))},uppercase(e){return this.check(kQ(e))},trim(){return this.check(FQ())},normalize(...e){return this.check(PQ(...e))},toLowerCase(){return this.check(IQ())},toUpperCase(){return this.check(LQ())},slugify(){return this.check(RQ())}})}),G$=Y(`ZodString`,(e,t)=>{xX.init(e,t),W$.init(e,t),e.email=t=>e.check(HZ(q$,t)),e.url=t=>e.check(JZ(X$,t)),e.jwt=t=>e.check(lQ(d1,t)),e.emoji=t=>e.check(YZ(Z$,t)),e.guid=t=>e.check(UZ(J$,t)),e.uuid=t=>e.check(WZ(Y$,t)),e.uuidv4=t=>e.check(GZ(Y$,t)),e.uuidv6=t=>e.check(KZ(Y$,t)),e.uuidv7=t=>e.check(qZ(Y$,t)),e.nanoid=t=>e.check(XZ(Q$,t)),e.guid=t=>e.check(UZ(J$,t)),e.cuid=t=>e.check(ZZ($$,t)),e.cuid2=t=>e.check(QZ(e1,t)),e.ulid=t=>e.check($Z(t1,t)),e.base64=t=>e.check(oQ(c1,t)),e.base64url=t=>e.check(sQ(l1,t)),e.xid=t=>e.check(eQ(n1,t)),e.ksuid=t=>e.check(tQ(r1,t)),e.ipv4=t=>e.check(nQ(i1,t)),e.ipv6=t=>e.check(rQ(a1,t)),e.cidrv4=t=>e.check(iQ(o1,t)),e.cidrv6=t=>e.check(aQ(s1,t)),e.e164=t=>e.check(cQ(u1,t)),e.datetime=t=>e.check(x$(t)),e.date=t=>e.check(C$(t)),e.time=t=>e.check(T$(t)),e.duration=t=>e.check(D$(t))});function X(e){return VZ(G$,e)}var K$=Y(`ZodStringFormat`,(e,t)=>{SX.init(e,t),W$.init(e,t)}),q$=Y(`ZodEmail`,(e,t)=>{TX.init(e,t),K$.init(e,t)}),J$=Y(`ZodGUID`,(e,t)=>{CX.init(e,t),K$.init(e,t)}),Y$=Y(`ZodUUID`,(e,t)=>{wX.init(e,t),K$.init(e,t)}),X$=Y(`ZodURL`,(e,t)=>{EX.init(e,t),K$.init(e,t)}),Z$=Y(`ZodEmoji`,(e,t)=>{DX.init(e,t),K$.init(e,t)}),Q$=Y(`ZodNanoID`,(e,t)=>{OX.init(e,t),K$.init(e,t)}),$$=Y(`ZodCUID`,(e,t)=>{kX.init(e,t),K$.init(e,t)}),e1=Y(`ZodCUID2`,(e,t)=>{AX.init(e,t),K$.init(e,t)}),t1=Y(`ZodULID`,(e,t)=>{jX.init(e,t),K$.init(e,t)}),n1=Y(`ZodXID`,(e,t)=>{MX.init(e,t),K$.init(e,t)}),r1=Y(`ZodKSUID`,(e,t)=>{NX.init(e,t),K$.init(e,t)}),i1=Y(`ZodIPv4`,(e,t)=>{RX.init(e,t),K$.init(e,t)}),a1=Y(`ZodIPv6`,(e,t)=>{zX.init(e,t),K$.init(e,t)}),o1=Y(`ZodCIDRv4`,(e,t)=>{BX.init(e,t),K$.init(e,t)}),s1=Y(`ZodCIDRv6`,(e,t)=>{VX.init(e,t),K$.init(e,t)}),c1=Y(`ZodBase64`,(e,t)=>{UX.init(e,t),K$.init(e,t)}),l1=Y(`ZodBase64URL`,(e,t)=>{GX.init(e,t),K$.init(e,t)}),u1=Y(`ZodE164`,(e,t)=>{KX.init(e,t),K$.init(e,t)}),d1=Y(`ZodJWT`,(e,t)=>{JX.init(e,t),K$.init(e,t)}),f1=Y(`ZodNumber`,(e,t)=>{YX.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$Q(e,t,n,r),H$(e,`ZodNumber`,{gt(e,t){return this.check(xQ(e,t))},gte(e,t){return this.check(SQ(e,t))},min(e,t){return this.check(SQ(e,t))},lt(e,t){return this.check(yQ(e,t))},lte(e,t){return this.check(bQ(e,t))},max(e,t){return this.check(bQ(e,t))},int(e){return this.check(m1(e))},safe(e){return this.check(m1(e))},positive(e){return this.check(xQ(0,e))},nonnegative(e){return this.check(SQ(0,e))},negative(e){return this.check(yQ(0,e))},nonpositive(e){return this.check(bQ(0,e))},multipleOf(e,t){return this.check(CQ(e,t))},step(e,t){return this.check(CQ(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Z(e){return mQ(f1,e)}var p1=Y(`ZodNumberFormat`,(e,t)=>{XX.init(e,t),f1.init(e,t)});function m1(e){return hQ(p1,e)}var h1=Y(`ZodBoolean`,(e,t)=>{ZX.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>e$(e,t,n,r)});function g1(e){return gQ(h1,e)}var _1=Y(`ZodUnknown`,(e,t)=>{QX.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function v1(){return _Q(_1)}var y1=Y(`ZodNever`,(e,t)=>{$X.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>t$(e,t,n,r)});function b1(e){return vQ(y1,e)}var x1=Y(`ZodArray`,(e,t)=>{tZ.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>o$(e,t,n,r),e.element=t.element,H$(e,`ZodArray`,{min(e,t){return this.check(TQ(e,t))},nonempty(e){return this.check(TQ(1,e))},max(e,t){return this.check(wQ(e,t))},length(e,t){return this.check(EQ(e,t))},unwrap(){return this.element}})});function Q(e,t){return zQ(x1,e,t)}var S1=Y(`ZodObject`,(e,t)=>{oZ.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>s$(e,t,n,r),kJ(e,`shape`,()=>t.shape),H$(e,`ZodObject`,{keyof(){return I1(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:v1()})},loose(){return this.clone({...this._zod.def,catchall:v1()})},strict(){return this.clone({...this._zod.def,catchall:b1()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return qJ(this,e)},safeExtend(e){return JJ(this,e)},merge(e){return YJ(this,e)},pick(e){return GJ(this,e)},omit(e){return KJ(this,e)},partial(...e){return XJ(V1,this,e[0])},required(...e){return ZJ(Z1,this,e[0])}})});function $(e,t){return new S1({type:`object`,shape:e??{},...HJ(t)})}function C1(e,t){return new S1({type:`object`,shape:e,catchall:b1(),...HJ(t)})}function w1(e,t){return new S1({type:`object`,shape:e,catchall:v1(),...HJ(t)})}var T1=Y(`ZodUnion`,(e,t)=>{cZ.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>c$(e,t,n,r),e.options=t.options});function E1(e,t){return new T1({type:`union`,options:e,...HJ(t)})}var D1=Y(`ZodDiscriminatedUnion`,(e,t)=>{T1.init(e,t),lZ.init(e,t)});function O1(e,t,n){return new D1({type:`union`,options:t,discriminator:e,...HJ(n)})}var k1=Y(`ZodIntersection`,(e,t)=>{uZ.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>l$(e,t,n,r)});function A1(e,t){return new k1({type:`intersection`,left:e,right:t})}var j1=Y(`ZodTuple`,(e,t)=>{pZ.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>u$(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function M1(e,t,n){let r=t instanceof bX;return new j1({type:`tuple`,items:e,rest:r?t:null,...HJ(r?n:t)})}var N1=Y(`ZodRecord`,(e,t)=>{_Z.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>d$(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function P1(e,t,n){return!t||!t._zod?new N1({type:`record`,keyType:X(),valueType:e,...HJ(t)}):new N1({type:`record`,keyType:e,valueType:t,...HJ(n)})}var F1=Y(`ZodEnum`,(e,t)=>{vZ.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>n$(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new F1({...t,checks:[],...HJ(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new F1({...t,checks:[],...HJ(r),entries:i})}});function I1(e,t){return new F1({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...HJ(t)})}var L1=Y(`ZodLiteral`,(e,t)=>{yZ.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>r$(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function R1(e,t){return new L1({type:`literal`,values:Array.isArray(e)?e:[e],...HJ(t)})}var z1=Y(`ZodTransform`,(e,t)=>{bZ.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>a$(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new yJ(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(iY(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(iY(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function B1(e){return new z1({type:`transform`,transform:e})}var V1=Y(`ZodOptional`,(e,t)=>{SZ.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>y$(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function H1(e){return new V1({type:`optional`,innerType:e})}var U1=Y(`ZodExactOptional`,(e,t)=>{CZ.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>y$(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function W1(e){return new U1({type:`optional`,innerType:e})}var G1=Y(`ZodNullable`,(e,t)=>{wZ.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>f$(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function K1(e){return new G1({type:`nullable`,innerType:e})}var q1=Y(`ZodDefault`,(e,t)=>{TZ.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>m$(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function J1(e,t){return new q1({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():RJ(t)}})}var Y1=Y(`ZodPrefault`,(e,t)=>{DZ.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>h$(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function X1(e,t){return new Y1({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():RJ(t)}})}var Z1=Y(`ZodNonOptional`,(e,t)=>{OZ.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>p$(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Q1(e,t){return new Z1({type:`nonoptional`,innerType:e,...HJ(t)})}var $1=Y(`ZodCatch`,(e,t)=>{AZ.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>g$(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function e0(e,t){return new $1({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var t0=Y(`ZodPipe`,(e,t)=>{jZ.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_$(e,t,n,r),e.in=t.in,e.out=t.out});function n0(e,t){return new t0({type:`pipe`,in:e,out:t})}var r0=Y(`ZodReadonly`,(e,t)=>{NZ.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>v$(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function i0(e){return new r0({type:`readonly`,innerType:e})}var a0=Y(`ZodCustom`,(e,t)=>{FZ.init(e,t),U$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>i$(e,t,n,r)});function o0(e,t){return BQ(a0,e??(()=>!0),t)}function s0(e,t={}){return VQ(a0,e,t)}function c0(e,t){return HQ(e,t)}var l0=X().min(1),u0=l0.brand(),d0=l0.brand(),f0=l0.brand(),p0=l0.brand(),m0=l0.brand(),h0=X().regex(/^[a-z0-9][a-z0-9-]*$/,`pack names are lowercase kebab-case`).brand(),g0=l0.brand(),_0=e=>typeof e==`number`&&Number.isFinite(e),v0=e=>typeof e==`string`&&e.length>0,y0=o0(_0,{message:`angle must be a finite number of radians`}),b0=o0(v0,{message:`index must be a non-empty fractional-index string`}),x0=o0(_0,{message:`lineHeight is unitless — multiply by fontSize to get px`}),S0=o0(e=>Array.isArray(e)&&e.length===2&&e.every(_0),{message:`a point is [x, y]`}),C0=o0(v0,{message:`fileId must be a non-empty string`}),w0=I1([`hachure`,`cross-hatch`,`solid`,`zigzag`]),T0=I1([`solid`,`dashed`,`dotted`]),E0=I1([`left`,`center`,`right`]),D0=I1([`top`,`middle`,`bottom`]),O0=I1([`arrow`,`bar`,`dot`,`circle`,`circle_outline`,`triangle`,`triangle_outline`,`diamond`,`diamond_outline`,`crowfoot_one`,`crowfoot_many`,`crowfoot_one_or_many`]),k0={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},A0=$({type:E1([R1(1),R1(2),R1(3)]),value:Z().optional()}),j0={Virgil:1,Helvetica:2,Cascadia:3,Excalifont:5,Nunito:6,"Lilita One":7,"Comic Shanns":8,"Liberation Sans":9},M0=Z().int(),N0=$({id:d0,type:I1([`arrow`,`text`])}),P0=$({elementId:d0,focus:Z(),gap:Z()}),F0=I1([`human`,`claude`]),I0=w1({chalk:$({author:F0,kind:I1([`icon`,`note`,`embed`]).optional(),iconId:m0.optional(),anchorIds:Q(d0).optional()}).optional()}),L0={id:d0,x:Z(),y:Z(),width:Z(),height:Z(),angle:y0,strokeColor:X(),backgroundColor:X(),fillStyle:w0,strokeWidth:Z(),strokeStyle:T0,roughness:Z(),opacity:Z(),roundness:A0.nullable(),groupIds:Q(f0),frameId:p0.nullable(),boundElements:Q(N0).nullable().default(null),link:X().nullable(),locked:g1(),index:b0.nullable(),seed:Z(),version:Z(),versionNonce:Z(),updated:Z(),isDeleted:g1(),customData:I0.optional()},R0={...L0,points:Q(S0),lastCommittedPoint:S0.nullable(),startBinding:P0.nullable(),endBinding:P0.nullable(),startArrowhead:O0.nullable(),endArrowhead:O0.nullable()},z0=w1({...L0,type:R1(`rectangle`)}),B0=w1({...L0,type:R1(`diamond`)}),V0=w1({...L0,type:R1(`ellipse`)}),H0=w1({...L0,type:R1(`embeddable`)}),U0=O1(`type`,[z0,B0,V0,w1({...L0,type:R1(`text`),text:X(),originalText:X(),fontSize:Z(),fontFamily:M0,textAlign:E0,verticalAlign:D0,lineHeight:x0,autoResize:g1(),containerId:d0.nullable()}),w1({...R0,type:R1(`line`)}),w1({...R0,type:R1(`arrow`),elbowed:g1().default(!1)}),w1({...L0,type:R1(`freedraw`),points:Q(S0),pressures:Q(Z()),simulatePressure:g1(),lastCommittedPoint:S0.nullable()}),w1({...L0,type:R1(`image`),fileId:C0.nullable(),status:I1([`pending`,`saved`,`error`]),scale:M1([Z(),Z()]),crop:$({x:Z(),y:Z(),width:Z(),height:Z(),naturalWidth:Z(),naturalHeight:Z()}).nullable()}),w1({...L0,type:R1(`frame`),name:X().nullable()}),H0]),W0=I1([`rectangle`,`diamond`,`ellipse`,`text`,`line`,`arrow`,`freedraw`,`image`,`frame`,`embeddable`]),G0=[`seed`,`version`,`versionNonce`,`updated`,`isDeleted`,`index`],K0=[`boundElements`,`containerId`,`startBinding`,`endBinding`],q0=$({id:C0,mimeType:X(),dataURL:X(),created:Z(),lastRetrieved:Z().optional()}),J0=P1(X(),q0),Y0={width:Z().optional(),height:Z().optional(),angle:y0.optional(),strokeColor:X().optional(),backgroundColor:X().optional(),fillStyle:w0.optional(),strokeWidth:Z().optional(),strokeStyle:T0.optional(),roughness:Z().optional(),opacity:Z().optional(),roundness:A0.nullish(),groupIds:Q(f0).optional(),frameId:p0.nullish(),link:X().nullish(),locked:g1().optional(),customData:I0.optional()},X0=$({text:X(),fontSize:Z().optional(),fontFamily:M0.optional(),textAlign:E0.optional(),verticalAlign:D0.optional(),strokeColor:X().optional()}),Z0=E1([$({id:d0,type:I1([`rectangle`,`diamond`,`ellipse`]).optional()}),$({type:I1([`rectangle`,`diamond`,`ellipse`]),id:d0.optional()})]);E1([C1({...Y0,type:I1([`rectangle`,`diamond`,`ellipse`]),id:d0,x:Z(),y:Z(),label:X0.optional()}),C1({...Y0,type:I1([`arrow`,`line`]),id:d0,x:Z(),y:Z(),label:X0.optional(),start:Z0.optional(),end:Z0.optional(),points:Q(S0).optional(),startArrowhead:O0.nullish(),endArrowhead:O0.nullish(),elbowed:g1().optional()}),C1({...Y0,type:R1(`text`),id:d0,x:Z(),y:Z(),text:X(),fontSize:Z().optional(),fontFamily:M0.optional(),textAlign:E0.optional(),verticalAlign:D0.optional()}),C1({type:R1(`frame`),id:d0,children:Q(d0),name:X().optional(),x:Z().optional(),y:Z().optional(),width:Z().optional(),height:Z().optional(),customData:I0.optional()}),C1({...Y0,type:R1(`image`),id:d0,x:Z(),y:Z(),fileId:C0}),C1({...Y0,type:R1(`embeddable`),id:d0,x:Z(),y:Z(),link:X()})]);var Q0=I1([`compact`,`full`]),$0=I1([`selected`,`link`,`locked`]),e2=$({x:Z(),y:Z(),width:Z(),height:Z()}),t2=$({type:W0,iconId:m0.nullish()}),n2=$({id:p0,handle:X(),name:X().nullable(),bounds:e2}),r2=$({strokeColor:X(),backgroundColor:X(),strokeStyle:X(),fillStyle:X(),opacity:Z(),fontSize:Z().nullish(),fontFamily:Z().nullish()}),i2=$({id:d0,shortId:X(),kind:t2,label:X().nullable(),bounds:e2.nullable(),version:Z().int(),author:F0,frameHandle:X().nullable(),flags:Q($0),from:d0.nullish(),to:d0.nullish(),style:r2.nullish()}),a2=$({sceneId:u0,name:X(),sceneVersion:Z().int(),elementCount:Z().int(),updatedAgoMs:Z().int(),frames:Q(n2),elements:Q(i2),detail:Q0}),o2=$({id:d0,shortId:X(),from:d0,fromLabel:X().nullable(),to:d0,toLabel:X().nullable(),label:X().nullable()}),s2=$({sceneId:u0,elements:Q(i2),edgesInside:Q(o2),edgesCrossingBoundary:Q(o2),frames:Q(n2),selectedAgoMs:Z().int().nullable(),stale:g1()}),c2=I1([`bundled`,`npm`,`vendor`,`library`]),l2=$({id:m0,pack:h0,name:X(),tags:Q(X()),license:X()}),u2=O1(`kind`,[$({kind:R1(`svg`),svg:X().min(1),width:Z().positive(),height:Z().positive()}),$({kind:R1(`elements`),elements:Q(U0).min(1),width:Z().positive(),height:Z().positive()})]);l2.extend({art:u2});var d2=$({pack:h0,kind:c2,version:X(),source:X(),license:X(),iconCount:Z().int().nonnegative(),installedAt:Z().int()});$({name:h0,kind:c2.default(`vendor`),license:X(),source:X(),npmPackage:X().optional(),svgDir:X().default(``),include:Q(X()).default([]),instructions:Q(X()).default([]),tagRules:$({fromPathSegments:g1().default(!0),strip:Q(X()).default([])}).default({fromPathSegments:!0,strip:[]}),synonyms:P1(X(),Q(X())).default({})});var f2=$({pack:h0,kind:c2,expected:Z().int().nonnegative(),indexed:Z().int().nonnegative(),filesPresent:g1().nullable(),problems:Q(X())}),p2=w1({viewBackgroundColor:X().optional(),gridSize:Z().nullish(),gridModeEnabled:g1().optional(),theme:I1([`light`,`dark`]).optional(),name:X().nullish()}),m2=I1([`requested`,`browser`,`most-recent`]),h2=$({viewBackgroundColor:X().nullable(),gridSize:Z().nullable(),gridModeEnabled:g1().nullable(),theme:I1([`light`,`dark`]).nullable(),name:X().nullable()}),g2=C1({viewBackgroundColor:X().optional(),gridSize:Z().nullish(),gridModeEnabled:g1().optional(),theme:I1([`light`,`dark`]).optional(),name:X().optional()},{error:e=>e.code===`unrecognized_keys`?`${e.keys.join(`, `)} is not a scene setting — the viewport belongs to the user, and chalk_focus is how you draw their attention to something`:void 0});$({id:u0,name:X(),repoPath:X().nullable(),elements:Q(U0),appState:p2,files:J0,sceneVersion:Z().int().nonnegative(),updatedAt:Z().int(),diskMtime:Z().int().nullable(),writtenSceneVersion:Z().int().nullable()});var _2=$({id:u0,name:X(),repoPath:X().nullable(),elementCount:Z().int().nonnegative(),sceneVersion:Z().int().nonnegative(),updatedAt:Z().int()});$({sceneId:u0,elementIds:Q(d0),at:Z().int()}),$({service:R1(`chalkbridge`),version:X(),pid:Z().int(),repoRoot:X(),port:Z().int(),uiClients:Z().int().nonnegative(),sceneCount:Z().int().nonnegative(),uptimeMs:Z().int().nonnegative()}),$({sceneId:u0.optional(),x:Z().default(120),y:Z().default(140),label:X().default(`hello from the bridge`)}),$({sceneId:u0,sceneVersion:Z().int(),created:Q(d0),broadcastTo:Z().int().nonnegative()}),w1({type:R1(`excalidraw`),version:Z().int(),source:X(),elements:Q(U0),appState:p2.default({}),files:J0.default({})}),$({code:X(),message:X(),hint:X().optional(),tool:X().optional()});var v2=I1([`claude`,`restore`,`import`,`disk`]),y2=I1([`idle`,`reading`,`writing`]),b2=I1([`png`,`svg`]),x2=p2;O1(`t`,[$({t:R1(`hello`),protocolVersion:Z().int(),clientId:X().min(1),sceneId:u0.nullish()}),$({t:R1(`scene_delta`),sceneId:u0,elements:Q(U0),appState:x2.optional(),files:J0.optional(),at:Z().int()}),$({t:R1(`selection`),sceneId:u0,elementIds:Q(d0),at:Z().int()}),$({t:R1(`export_result`),requestId:X().min(1),ok:g1(),dataUrl:X().optional(),error:X().optional()})]);var S2=O1(`t`,[$({t:R1(`scene_patch`),sceneId:u0,origin:v2,sceneVersion:Z().int(),elements:Q(U0),removedIds:Q(d0).optional(),appState:x2.optional(),files:J0.optional()}),$({t:R1(`export_request`),requestId:X().min(1),sceneId:u0,format:b2,elementIds:Q(d0).optional(),scale:Z().optional(),background:g1().optional(),darkMode:g1().optional(),padding:Z().optional(),embedScene:g1().optional()}),$({t:R1(`presence`),activity:y2,lastReadAt:Z().int().nullish()}),$({t:R1(`focus`),sceneId:u0,elementIds:Q(d0),zoomToFit:g1()}),$({t:R1(`disk_conflict`),sceneId:u0,path:X(),diskMtime:Z().int(),message:X()})]);function C2(e){throw Error(`unhandled variant: ${JSON.stringify(e)}`)}var w2=[`compute`,`storage`,`edge`,`external`,`hotspot`],T2=I1(w2,{error:e=>`unknown role ${JSON.stringify(e.input)} — valid: ${w2.join(`, `)}`});j0.Excalifont,k0.ADAPTIVE_RADIUS;var E2=I1([`rectangle`,`diamond`,`ellipse`,`text`,`line`],{error:e=>e.input===`arrow`?`arrow rejected — use chalk_connect(fromId, toId), it handles the bindings`:`unknown element type ${JSON.stringify(e.input)} — valid: rectangle, diamond, ellipse, text, line, and chalk_connect for arrows`}),D2=e=>{let t=e.filter(e=>K0.includes(e)),n=e.filter(e=>G0.includes(e));return t.length>0?`${t.join(`, `)} is server-managed — pass label: { text } for a caption, and use chalk_connect for an arrow`:n.length>0?`${n.join(`, `)} is server-managed — Chalkbridge assigns it; use expectedVersion on chalk_update_elements to say what you read`:`${e.join(`, `)} is not an element property`},O2=C1({type:E2,id:d0.optional(),x:Z(),y:Z(),role:T2.optional(),label:X().optional(),width:Z().positive().optional(),height:Z().positive().optional(),text:X().optional(),strokeColor:X().optional(),backgroundColor:X().optional(),fillStyle:w0.optional(),strokeWidth:E1([R1(1),R1(2),R1(4)]).optional(),strokeStyle:T0.optional(),roughness:E1([R1(0),R1(1),R1(2)]).optional(),opacity:Z().min(0).max(100).optional(),roundness:A0.nullish(),angle:Z().optional(),fontSize:Z().positive().optional(),fontFamily:M0.optional(),textAlign:E0.optional(),verticalAlign:D0.optional(),link:X().nullish(),locked:g1().optional(),groupIds:Q(f0).optional(),frameId:p0.nullish()},{error:e=>e.code===`unrecognized_keys`?D2(e.keys):void 0}),k2=O2.partial().omit({type:!0,id:!0});[...G0,...K0];var A2=$({id:d0,expectedVersion:Z().int().nonnegative(),patch:k2}),j2=[`align-left`,`align-right`,`align-top`,`align-bottom`,`align-center-h`,`align-center-v`],M2=[`distribute-h`,`distribute-v`],N2=[`bring-to-front`,`send-to-back`,`bring-forward`,`send-backward`],P2=[`flip-horizontal`,`flip-vertical`],F2=I1([...j2,...M2,...N2,...P2,`grid`,`layout-layered`]),I2=$({elementIds:Q(d0).min(1),op:F2,spacing:Z().positive().optional(),columns:Z().int().positive().optional()}),L2=$({fromId:d0,toId:d0,label:X().optional(),startArrowhead:O0.nullish(),endArrowhead:O0.nullish(),strokeStyle:T0.optional(),arrowType:I1([`sharp`,`round`,`elbow`]).optional()}),R2=w1({id:d0});$({}),$({scenes:Q(_2)}),$({sceneId:u0.optional(),detail:Q0.default(`compact`)}),$({description:a2,resolvedVia:m2}),$({neighborDepth:Z().int().min(0).max(3).default(1),sceneId:u0.optional(),detail:Q0.default(`compact`)}),$({selection:s2,empty:g1(),note:X().nullable()}),$({ids:Q(d0).min(1),sceneId:u0.optional()}),$({sceneId:u0,elements:Q(R2),missing:Q(d0)}),$({sceneId:u0.optional(),patch:g2.optional()}),$({sceneId:u0,settings:h2,changed:g1(),sceneVersion:Z().int()});var z2=I1([`elements`,`styling`,`layout`,`arrows`,`icons`]);$({topics:Q(z2).min(1)}),$({guides:Q($({topic:z2,markdown:X()})),available:Q(z2),missing:Q(z2)});var B2={sceneId:u0,sceneVersion:Z().int(),broadcastTo:Z().int().nonnegative()},V2=$({id:d0,code:X(),message:X(),hint:X().nullable(),tool:X().nullable()});$({elements:Q(O2).min(1),sceneId:u0.optional()}),$({...B2,created:Q(d0),layoutHint:X().nullable()}),L2.extend({sceneId:u0.optional()}),$({...B2,arrowId:d0}),$({updates:Q(A2).min(1),sceneId:u0.optional()}),$({...B2,applied:Q(d0),rejected:Q(V2)}),$({deletions:Q($({id:d0,expectedVersion:Z().int().nonnegative().optional()})).min(1),sceneId:u0.optional()}),$({...B2,deleted:Q(d0),rejected:Q(V2)}),I2.extend({sceneId:u0.optional()}),$({...B2,moved:Q(d0)}),$({elementIds:Q(d0).min(2),sceneId:u0.optional()}),$({...B2,groupId:f0,grouped:Q(d0)}),$({groupId:f0,sceneId:u0.optional()}),$({...B2,ungrouped:Q(d0)}),$({op:I1([`create`,`add`,`remove`]),elementIds:Q(d0).default([]),name:X().optional(),frameId:p0.optional(),sceneId:u0.optional()}),$({...B2,frameId:p0,children:Q(d0)}),$({elementIds:Q(d0).min(1),text:X().min(1),sceneId:u0.optional()}),$({...B2,noteId:d0}),$({link:X().min(1),x:Z(),y:Z(),width:Z().positive().optional(),height:Z().positive().optional(),sceneId:u0.optional()}),$({...B2,elementId:d0}),$({elementIds:Q(d0).min(1),zoomToFit:g1().default(!1),sceneId:u0.optional()}),$({sceneId:u0,focused:Q(d0),broadcastTo:Z().int().nonnegative()}),$({elements:Q(w1({type:W0,x:Z(),y:Z(),id:d0.optional()})).min(1),sceneId:u0.optional()}),$({...B2,created:Q(d0),rejected:Q(V2)}),$({query:X().min(1),pack:h0.optional(),limit:Z().int().min(1).max(50).default(12),offset:Z().int().min(0).default(0)}),$({items:Q(l2),total:Z().int().nonnegative(),offset:Z().int().nonnegative(),limit:Z().int().positive(),nextOffset:Z().int().nonnegative().nullable(),packs:Q(h0),note:X().nullable()}),$({iconId:m0,x:Z(),y:Z(),size:Z().positive().optional(),label:X().optional(),sceneId:u0.optional()}),$({...B2,elementId:d0,labelId:d0.nullable(),iconId:m0}),$({pack:h0,from:X().optional()}),$({pack:h0,installed:g1(),kind:c2,iconCount:Z().int().nonnegative(),license:X(),source:X(),instructions:Q(X()),note:X().nullable()}),$({}),$({packs:Q(d2),available:Q($({pack:h0,kind:c2,license:X()})),catalogPath:X(),health:Q(f2)}),$({pack:h0}),$({pack:h0,removed:g1(),iconsDropped:Z().int().nonnegative()}),$({label:X().min(1).optional(),sceneId:u0.optional()});var H2=$({id:g0,sceneId:u0,label:X(),createdAt:Z().int(),elementCount:Z().int().nonnegative()});$({sceneId:u0,created:H2.nullable(),snapshots:Q(H2)}),$({snapshotId:g0,sceneId:u0.optional()}),$({...B2,snapshotId:g0,label:X(),restored:Z().int().nonnegative()}),$({path:X().optional(),sceneId:u0.optional()}),$({sceneId:u0,path:X(),repoPath:X(),bytes:Z().int().nonnegative(),sceneVersion:Z().int()}),$({path:X().optional(),sceneId:u0.optional()}),$({sceneId:u0,path:X(),sceneVersion:Z().int(),elementCount:Z().int().nonnegative(),broadcastTo:Z().int().nonnegative()});var U2={elementIds:Q(d0).optional(),background:g1().default(!0),padding:Z().min(0).max(200).default(16),sceneId:u0.optional()};$({...U2,format:b2.default(`png`),scale:Z().min(.5).max(4).default(2),darkMode:g1().default(!1),embedScene:g1().default(!1),path:X().optional()}),$({sceneId:u0,format:b2,path:X(),repoPath:X(),bytes:Z().int().nonnegative(),elementCount:Z().int().nonnegative()}),$({...U2,theme:I1([`light`,`dark`]).default(`light`),scale:Z().min(.5).max(2).default(1)}),$({sceneId:u0,bytes:Z().int().nonnegative(),elementCount:Z().int().nonnegative(),scope:I1([`scene`,`elements`])}).extend({base64:X(),mimeType:X()});var W2=e=>{let t=``,n=32768;for(let r=0;r<e.length;r+=n)t+=String.fromCharCode(...e.subarray(r,r+n));return btoa(t)},G2=async e=>W2(new Uint8Array(await e.arrayBuffer()));async function K2(e,t){let n=e=>({t:`export_result`,requestId:t.requestId,...e});try{let r=e.getSceneElements(),i=t.elementIds,a=i===void 0?r:(e=>r.filter(t=>e.has(t.id)))(new Set(i));if(a.length===0)return n({ok:!1,error:i===void 0?`the canvas is empty`:`none of those element ids are on the canvas`});let o={...e.getAppState(),exportBackground:t.background,exportWithDarkMode:t.darkMode??!1,exportScale:t.scale??1,exportEmbedScene:t.embedScene??!1},s=e.getFiles(),c=t.padding??0;if(t.format===`svg`){let e=await tT({elements:a,appState:o,files:s,exportPadding:c});return n({ok:!0,dataUrl:`data:image/svg+xml;base64,${W2(new TextEncoder().encode(e.outerHTML))}`})}return n({ok:!0,dataUrl:`data:image/png;base64,${await G2(await eT({elements:a,appState:o,files:s,mimeType:`image/png`,exportPadding:c}))}`})}catch(e){return n({ok:!1,error:e instanceof Error?e.message:String(e)})}}var q2=250,J2=500,Y2=600,X2=250,Z2=5e3,Q2=()=>`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}/ws/ui`;function $2(e,t,n){let r=new Map(e.map(e=>[e.id,e]));for(let e of n??[])r.delete(e);for(let e of t)r.set(e.id,e);return[...r.values()]}function e4(e,t){return{viewBackgroundColor:e?.viewBackgroundColor??t.viewBackgroundColor,gridModeEnabled:e?.gridModeEnabled??t.gridModeEnabled,theme:e?.theme??t.theme}}function t4(e){let[t,n]=(0,u.useState)(!1),[r,i]=(0,u.useState)(null),[a,o]=(0,u.useState)(`idle`),[s,c]=(0,u.useState)(()=>Date.now()),[l,d]=(0,u.useState)(null),[f,p]=(0,u.useState)(0),m=(0,u.useRef)(null),h=(0,u.useRef)(null),g=(0,u.useRef)(e);g.current=e;let _=(0,u.useRef)(-1),v=(0,u.useRef)(null),y=(0,u.useRef)(0),b=(0,u.useRef)(null),x=(0,u.useCallback)(e=>{let t=m.current;t?.readyState===WebSocket.OPEN&&t.send(JSON.stringify(e))},[]),S=(0,u.useCallback)((e,t)=>{let n=g.current;n!==null&&(n.updateScene({elements:e,appState:e4(t,n.getAppState()),captureUpdate:G.NEVER}),_.current=ZE(n.getSceneElementsIncludingDeleted()))},[]),C=(0,u.useCallback)((e,t)=>{let n=g.current;if(n===null||e.length===0)return;let r=new Set(e),i=n.getSceneElements().filter(e=>r.has(e.id));n.updateScene({appState:{elementsToHighlight:[...i]},captureUpdate:G.NEVER}),b.current!==null&&clearTimeout(b.current),!t&&(b.current=setTimeout(()=>{g.current?.updateScene({appState:{elementsToHighlight:null},captureUpdate:G.NEVER})},Y2))},[]),w=(0,u.useCallback)(async e=>{let t=g.current;if(t===null){x({t:`export_result`,requestId:e.requestId,ok:!1,error:`the canvas has not finished loading`});return}x(await K2(t,e))},[x]),T=(0,u.useCallback)(e=>{let t=S2.safeParse(e);if(!t.success)return;let n=t.data,r=g.current;switch(n.t){case`scene_patch`:{h.current=n.sceneId,i(n.sceneId);let e=r?.getSceneElementsIncludingDeleted()??[],t=n.origin===`restore`||n.origin===`import`?[...n.elements]:$2(e,n.elements,n.removedIds);S(t,n.appState),n.origin===`claude`&&C(n.elements.map(e=>e.id),!1);return}case`presence`:o(n.activity),c(Date.now()),d(n.lastReadAt??null);return;case`focus`:if(C(n.elementIds,!0),n.zoomToFit&&r!==null){let e=new Set(n.elementIds);r.scrollToContent(r.getSceneElements().filter(t=>e.has(t.id)),{fitToContent:!0,animate:!0})}return;case`disk_conflict`:console.warn(`[chalkbridge] ${n.message}`,n.path);return;case`export_request`:w(n);return;default:C2(n)}},[S,C,w]);return(0,u.useEffect)(()=>{let e=!1,t=X2,r=null,i=()=>{if(e)return;let a=new WebSocket(Q2());m.current=a,a.addEventListener(`open`,()=>{t=X2,n(!0),a.send(JSON.stringify({t:`hello`,protocolVersion:1,clientId:crypto.randomUUID(),sceneId:h.current}))}),a.addEventListener(`message`,e=>{try{T(JSON.parse(String(e.data)))}catch{}}),a.addEventListener(`close`,()=>{n(!1),!e&&(r=setTimeout(i,t),t=Math.min(t*2,Z2))}),a.addEventListener(`error`,()=>a.close())};return i(),()=>{e=!0,r!==null&&clearTimeout(r),m.current?.close()}},[T]),(0,u.useEffect)(()=>{if(e===null)return;let t=()=>{let t=h.current;if(t===null)return;let n=e.getSceneElementsIncludingDeleted();_.current=ZE(n),x({t:`scene_delta`,sceneId:t,elements:n,appState:{viewBackgroundColor:e.getAppState().viewBackgroundColor},at:Date.now()})},n=e.onChange((n,r)=>{let i=Object.keys(r.selectedElementIds);p(i.length);let a=Date.now();a-y.current>=J2&&h.current!==null&&(y.current=a,x({t:`selection`,sceneId:h.current,elementIds:i,at:a})),ZE(e.getSceneElementsIncludingDeleted())!==_.current&&(v.current!==null&&clearTimeout(v.current),v.current=setTimeout(t,q2))}),r=()=>{v.current!==null&&(clearTimeout(v.current),v.current=null,t())};return window.addEventListener(`pointerup`,r),()=>{n(),window.removeEventListener(`pointerup`,r),v.current!==null&&clearTimeout(v.current)}},[x,e]),{connected:t,sceneId:r,claude:a,claudeSince:s,claudeLastReadAt:l,selectionCount:f}}var n4=(e,t)=>{let n=Math.max(0,Math.round((t-e)/1e3));if(n<60)return`${n}s ago`;let r=Math.round(n/60);return r<60?`${r}m ago`:`${Math.round(r/60)}h ago`};function r4(e,t,n){return e===`idle`?`idle`:n-t<8e3?e:`idle`}function i4({connected:e,activity:t,activitySince:n,lastReadAt:r,now:i}){if(!e)return(0,k.jsxs)(`div`,{className:`chalk-presence chalk-presence--offline`,children:[(0,k.jsx)(`span`,{className:`chalk-dot`}),` bridge offline · reconnecting`]});let a=r4(t,n,i);return(0,k.jsxs)(`div`,{className:`chalk-presence chalk-presence--${a}`,children:[(0,k.jsx)(`span`,{className:`chalk-dot`}),`Claude · `,a,r===null?``:` · last read ${n4(r,i)}`]})}function a4({count:e,connected:t}){return e===0?null:(0,k.jsxs)(`div`,{className:`chalk-selection`,children:[e,` selected`,t?` · Claude can see this`:` · not synced — bridge offline`]})}function o4(){let[e,t]=(0,u.useState)(null),n=t4(e),[r,i]=(0,u.useState)(()=>Date.now());return(0,u.useEffect)(()=>{let e=setInterval(()=>i(Date.now()),5e3);return()=>clearInterval(e)},[]),(0,k.jsxs)(`div`,{className:`chalk-root`,children:[(0,k.jsx)(gJ,{excalidrawAPI:t}),(0,k.jsx)(i4,{connected:n.connected,activity:n.claude,activitySince:n.claudeSince,lastReadAt:n.claudeLastReadAt,now:r}),(0,k.jsx)(a4,{count:n.selectionCount,connected:n.connected})]})}function s4(){let e=window.location.origin,t=window.fetch.bind(window);window.fetch=async(n,r)=>{let i=typeof n==`string`?n:n instanceof URL?n.href:n instanceof Request?n.url:String(n);if(/^[a-z][a-z0-9+.-]*:/i.test(i)&&!i.startsWith(`data:`)&&!i.startsWith(`blob:`)){let t=new URL(i,e);if(t.origin!==e)throw console.warn(`[chalkbridge] blocked a request to ${t.origin} — everything this canvas needs is served from ${e} (CLAUDE.md invariant 8)`),TypeError(`chalkbridge: refusing to fetch ${t.origin}`)}return t(n,r)}}window.EXCALIDRAW_ASSET_PATH=`./`,s4();var c4=document.getElementById(`root`);if(!c4)throw Error(`#root missing from index.html`);(0,d.createRoot)(c4).render((0,k.jsx)(u.StrictMode,{children:(0,k.jsx)(o4,{})}));export{YD as A,LD as B,eO as C,GD as D,rO as E,iO as F,zD as H,nO as I,cO as L,KD as M,BD as N,XD as O,ZD as P,tO as R,aO as S,UD as T,A as U,RD as V,h as W,hO as _,xO as a,JD as b,lO as c,dO as d,vO as f,uO as g,oO as h,mO as i,VD as j,WD as k,fO as l,bO as m,SO as n,sO as o,pO as p,CO as r,gO as s,wO as t,_O as u,HD as v,QD as w,qD as x,$D as y,yO as z};
|