@powerhousedao/connect 1.0.0-sky.189 → 1.0.3-dev.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/README.md +1 -0
- package/dist/.env +10 -8
- package/dist/assets/app-BYkaiTES.js +79314 -0
- package/dist/assets/app-D9QJBr8i.css +5652 -0
- package/dist/assets/app-loader-Bkg_WUos.js +31437 -0
- package/dist/assets/app-loader-Bnp0H-wa.css +5497 -0
- package/dist/assets/ccip-Dn5Ob09y.js +170 -0
- package/dist/assets/connect-loader-CvOC68Ih.mp4 +0 -0
- package/dist/assets/content-DcF7YyCb.js +3937 -0
- package/dist/assets/home-bg-BEhF9NuW.png +0 -0
- package/dist/assets/index-B62Phyap.js +12 -0
- package/dist/assets/index-CBIcU4C0.js +46414 -0
- package/dist/assets/index-zVQzC6z2.js +2560 -0
- package/dist/assets/main.CgKmK6gL.js +105 -0
- package/dist/assets/powerhouse-rounded-CeKGGUG4.png +0 -0
- package/dist/assets/renown-short-hover-BiSLBV7L.png +0 -0
- package/dist/assets/rwa-report-Bb0W5-ac.png +0 -0
- package/dist/assets/style-D4JhTt_m.css +1663 -0
- package/dist/external-packages.js +5 -0
- package/dist/hmr.js +4 -0
- package/dist/icon.ico +0 -0
- package/dist/index.html +48 -11
- package/dist/modules/@powerhousedao/reactor-browser/chunk-2ESYSVXG.js +48 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-2X2M6BYG.js +2542 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-45DCPCA7.js +67 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-7OQWVUC5.js +43 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-A4GIWVYS.js +14031 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-DKDARAJS.js +0 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-F3RCGUF6.js +53 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-FQF4YAVC.js +11917 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-FW7N6EJH.js +786 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-G6LMXRY5.js +50 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-GDP7BUIH.js +45 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-IQTSFTNF.js +48 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-J5TYPY7U.js +36 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-LH2T6NLN.js +0 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-LRNZZ3SR.js +14 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-M2UUQ5LH.js +250 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-OVGOA2P5.js +11 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-P6NJ6IAQ.js +12 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-PQ4UODLR.js +113 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-QXHTR6KF.js +0 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-RGIB4DD4.js +162 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-U36SV333.js +0 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-UP4DC4D2.js +178 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-XBTEGV5M.js +17 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-XXFOSD4A.js +2513 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-Y7NTRTMT.js +25 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-YDERCA5J.js +82 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-YG67WAIS.js +0 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-YWKVPJNL.js +52 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-ZL5IPB6D.js +0 -0
- package/dist/modules/@powerhousedao/reactor-browser/context/index.js +16 -0
- package/dist/modules/@powerhousedao/reactor-browser/context/read-mode.js +15 -0
- package/dist/modules/@powerhousedao/reactor-browser/crypto/browser.js +7 -0
- package/dist/modules/@powerhousedao/reactor-browser/crypto/index.js +7 -0
- package/dist/modules/@powerhousedao/reactor-browser/document-model.js +10 -0
- package/dist/modules/@powerhousedao/reactor-browser/hooks/document-state.js +96 -0
- package/dist/modules/@powerhousedao/reactor-browser/hooks/index.js +98 -0
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useAddDebouncedOperations.js +11 -0
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useConnectCrypto.js +12 -0
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocument.js +7 -0
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentDispatch.js +7 -0
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentDrives.js +13 -0
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentEditor.js +20 -0
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDriveActions.js +9 -0
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDriveActionsWithUiNodes.js +14 -0
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDriveContext.js +9 -0
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useUiNodesContext.js +46 -0
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useUserPermissions.js +7 -0
- package/dist/modules/@powerhousedao/reactor-browser/index.js +125 -0
- package/dist/modules/@powerhousedao/reactor-browser/reactor.js +11 -0
- package/dist/modules/@powerhousedao/reactor-browser/renown/constants.js +53 -0
- package/dist/modules/@powerhousedao/reactor-browser/renown/types.js +1 -0
- package/dist/modules/@powerhousedao/reactor-browser/storage/index.js +1 -0
- package/dist/modules/@powerhousedao/reactor-browser/storage/types.js +1 -0
- package/dist/modules/@powerhousedao/reactor-browser/uiNodes/constants.js +37 -0
- package/dist/modules/@powerhousedao/reactor-browser/uiNodes/types.js +1 -0
- package/dist/modules/@powerhousedao/reactor-browser/utils/export-document.js +8 -0
- package/dist/modules/@powerhousedao/reactor-browser/utils/index.js +9 -0
- package/dist/modules/@powerhousedao/reactor-browser/utils/signature.js +10 -0
- package/dist/service-worker.js +46 -2
- package/dist/swEnv.js +9 -9
- package/dist/vite-envs.sh +56 -44
- package/nginx.conf +93 -0
- package/nginx.sh +10 -0
- package/package.json +119 -150
- package/dist/assets/ArrowFilledRight-blx8xu7X-D3d8PUWh.js +0 -2
- package/dist/assets/ArrowFilledRight-blx8xu7X-D3d8PUWh.js.map +0 -1
- package/dist/assets/ArrowLeft-7pYNK4eX-8ZR_YHAJ.js +0 -2
- package/dist/assets/ArrowLeft-7pYNK4eX-8ZR_YHAJ.js.map +0 -1
- package/dist/assets/ArrowUp-Bbr_dwo_-C5ppCQo4.js +0 -2
- package/dist/assets/ArrowUp-Bbr_dwo_-C5ppCQo4.js.map +0 -1
- package/dist/assets/BarChart-B0G05Nfd-CHDJ7OaJ.js +0 -2
- package/dist/assets/BarChart-B0G05Nfd-CHDJ7OaJ.js.map +0 -1
- package/dist/assets/BaseArrowLeft-DBzhFHMt-Dkbf2sWs.js +0 -2
- package/dist/assets/BaseArrowLeft-DBzhFHMt-Dkbf2sWs.js.map +0 -1
- package/dist/assets/BaseArrowRight-DYQTBWAs-CkkPllYm.js +0 -2
- package/dist/assets/BaseArrowRight-DYQTBWAs-CkkPllYm.js.map +0 -1
- package/dist/assets/Braces-N-sH2Zyc-3LcexUsR.js +0 -2
- package/dist/assets/Braces-N-sH2Zyc-3LcexUsR.js.map +0 -1
- package/dist/assets/Branch-CWdBw1_P-CmGdOXsI.js +0 -2
- package/dist/assets/Branch-CWdBw1_P-CmGdOXsI.js.map +0 -1
- package/dist/assets/BrickGlobe-67zaG6_H-DP0By6z_.js +0 -2
- package/dist/assets/BrickGlobe-67zaG6_H-DP0By6z_.js.map +0 -1
- package/dist/assets/Briefcase-CedW3KRR-DO5_k15F.js +0 -2
- package/dist/assets/Briefcase-CedW3KRR-DO5_k15F.js.map +0 -1
- package/dist/assets/Calendar-C-6HV96D-YetudWvP.js +0 -2
- package/dist/assets/Calendar-C-6HV96D-YetudWvP.js.map +0 -1
- package/dist/assets/Caret-Ep0j0fz2-By3ojfim.js +0 -2
- package/dist/assets/Caret-Ep0j0fz2-By3ojfim.js.map +0 -1
- package/dist/assets/CaretDown-3X7LFYBf-C43xdKg8.js +0 -2
- package/dist/assets/CaretDown-3X7LFYBf-C43xdKg8.js.map +0 -1
- package/dist/assets/CaretSort-BkGdLETT-DVOzEEqR.js +0 -2
- package/dist/assets/CaretSort-BkGdLETT-DVOzEEqR.js.map +0 -1
- package/dist/assets/Check-DV-U4AEq-B582NMZp.js +0 -2
- package/dist/assets/Check-DV-U4AEq-B582NMZp.js.map +0 -1
- package/dist/assets/CheckCircle-DI5fEgGd-CVF4LDhR.js +0 -2
- package/dist/assets/CheckCircle-DI5fEgGd-CVF4LDhR.js.map +0 -1
- package/dist/assets/CheckCircleFill-C-F0v5mB-BSW1YMqM.js +0 -2
- package/dist/assets/CheckCircleFill-C-F0v5mB-BSW1YMqM.js.map +0 -1
- package/dist/assets/Checkmark-BXnfChpo-CyQitGI2.js +0 -2
- package/dist/assets/Checkmark-BXnfChpo-CyQitGI2.js.map +0 -1
- package/dist/assets/ChevronDown-ouBxrU-k-eUsCPXcB.js +0 -2
- package/dist/assets/ChevronDown-ouBxrU-k-eUsCPXcB.js.map +0 -1
- package/dist/assets/Circle-n3-Wh4HS-8dOehHQf.js +0 -2
- package/dist/assets/Circle-n3-Wh4HS-8dOehHQf.js.map +0 -1
- package/dist/assets/CircleInfo-BhZY3C2Q-CZgYK1h2.js +0 -2
- package/dist/assets/CircleInfo-BhZY3C2Q-CZgYK1h2.js.map +0 -1
- package/dist/assets/ClockFill-Bd0t48q7-CcfHiJtH.js +0 -2
- package/dist/assets/ClockFill-Bd0t48q7-CcfHiJtH.js.map +0 -1
- package/dist/assets/CloudSlash-B-zJBjaD-CxVyp-Ac.js +0 -2
- package/dist/assets/CloudSlash-B-zJBjaD-CxVyp-Ac.js.map +0 -1
- package/dist/assets/Collapse-DRDB8Czs-CGcuZQgy.js +0 -2
- package/dist/assets/Collapse-DRDB8Czs-CGcuZQgy.js.map +0 -1
- package/dist/assets/Connect-Dme-qfKq-CgniLji8.js +0 -2
- package/dist/assets/Connect-Dme-qfKq-CgniLji8.js.map +0 -1
- package/dist/assets/Discord-CAS0Cj7s-CcsBWpnf.js +0 -2
- package/dist/assets/Discord-CAS0Cj7s-CcsBWpnf.js.map +0 -1
- package/dist/assets/Drive-GMcgBcIY-CzahDx9j.js +0 -2
- package/dist/assets/Drive-GMcgBcIY-CzahDx9j.js.map +0 -1
- package/dist/assets/Ellipsis-XK8AwMEC-BuVBeYhB.js +0 -2
- package/dist/assets/Ellipsis-XK8AwMEC-BuVBeYhB.js.map +0 -1
- package/dist/assets/Error-BmIZ2ZUy-CphzuMLn.js +0 -2
- package/dist/assets/Error-BmIZ2ZUy-CphzuMLn.js.map +0 -1
- package/dist/assets/Exclamation-CVsNS_QS-DLccamql.js +0 -2
- package/dist/assets/Exclamation-CVsNS_QS-DLccamql.js.map +0 -1
- package/dist/assets/FilesEarmark-CyrCQy8E-Bhut4E02.js +0 -2
- package/dist/assets/FilesEarmark-CyrCQy8E-Bhut4E02.js.map +0 -1
- package/dist/assets/FolderClose-DG_qHisc-CH6NoBuu.js +0 -2
- package/dist/assets/FolderClose-DG_qHisc-CH6NoBuu.js.map +0 -1
- package/dist/assets/FolderOpen-kDoWFkJO-Cciutkdg.js +0 -2
- package/dist/assets/FolderOpen-kDoWFkJO-Cciutkdg.js.map +0 -1
- package/dist/assets/FolderPlus-CSBSl9lZ-CifD0ek9.js +0 -2
- package/dist/assets/FolderPlus-CSBSl9lZ-CifD0ek9.js.map +0 -1
- package/dist/assets/Forum-DZ-CkLFh-BwabccAX.js +0 -2
- package/dist/assets/Forum-DZ-CkLFh-BwabccAX.js.map +0 -1
- package/dist/assets/Gear-cUlHJ4q6-B9R2l_9_.js +0 -2
- package/dist/assets/Gear-cUlHJ4q6-B9R2l_9_.js.map +0 -1
- package/dist/assets/Github-0PLiINY0-CjkZIHCO.js +0 -2
- package/dist/assets/Github-0PLiINY0-CjkZIHCO.js.map +0 -1
- package/dist/assets/Globe-CIYqVkpa-CL530H46.js +0 -2
- package/dist/assets/Globe-CIYqVkpa-CL530H46.js.map +0 -1
- package/dist/assets/GlobeWww-DN4yKujh-Ci7aa5CE.js +0 -2
- package/dist/assets/GlobeWww-DN4yKujh-Ci7aa5CE.js.map +0 -1
- package/dist/assets/Hdd-Dn_LdJIh-CJ6x9Bve.js +0 -2
- package/dist/assets/Hdd-Dn_LdJIh-CJ6x9Bve.js.map +0 -1
- package/dist/assets/History-BP4SmaS_-P4WBKyqX.js +0 -2
- package/dist/assets/History-BP4SmaS_-P4WBKyqX.js.map +0 -1
- package/dist/assets/InfoSquare-C98JaLiz-yPcGR71f.js +0 -2
- package/dist/assets/InfoSquare-C98JaLiz-yPcGR71f.js.map +0 -1
- package/dist/assets/Link-BF7aZjVu-CXIVQOz6.js +0 -2
- package/dist/assets/Link-BF7aZjVu-CXIVQOz6.js.map +0 -1
- package/dist/assets/Linkedin-DJwIkS6q-Dkb5Tp_Z.js +0 -2
- package/dist/assets/Linkedin-DJwIkS6q-Dkb5Tp_Z.js.map +0 -1
- package/dist/assets/Lock-PyaFHdNS-D_qxRTye.js +0 -2
- package/dist/assets/Lock-PyaFHdNS-D_qxRTye.js.map +0 -1
- package/dist/assets/M-DozhhPMY-DBQw97P_.js +0 -2
- package/dist/assets/M-DozhhPMY-DBQw97P_.js.map +0 -1
- package/dist/assets/Pencil-D7lvxXIP-D830iveq.js +0 -2
- package/dist/assets/Pencil-D7lvxXIP-D830iveq.js.map +0 -1
- package/dist/assets/People-CUB8LYKf-CyJmMqcw.js +0 -2
- package/dist/assets/People-CUB8LYKf-CyJmMqcw.js.map +0 -1
- package/dist/assets/Person-DuL4PQzm-ttQR0nPy.js +0 -2
- package/dist/assets/Person-DuL4PQzm-ttQR0nPy.js.map +0 -1
- package/dist/assets/Plus-DPFWGJM4-BztpK8li.js +0 -2
- package/dist/assets/Plus-DPFWGJM4-BztpK8li.js.map +0 -1
- package/dist/assets/PlusCircle-BEnWRjHa-w5zztKGx.js +0 -2
- package/dist/assets/PlusCircle-BEnWRjHa-w5zztKGx.js.map +0 -1
- package/dist/assets/PowerhouseLogoSmall-CmO95IAS-CDGLkst3.js +0 -2
- package/dist/assets/PowerhouseLogoSmall-CmO95IAS-CDGLkst3.js.map +0 -1
- package/dist/assets/Project-BlXuclr0-EsBam9d0.js +0 -2
- package/dist/assets/Project-BlXuclr0-EsBam9d0.js.map +0 -1
- package/dist/assets/RedoArrow-BJeEsiph-BbidqIFP.js +0 -2
- package/dist/assets/RedoArrow-BJeEsiph-BbidqIFP.js.map +0 -1
- package/dist/assets/Renown-6m7hx37h-CItksi2j.js +0 -2
- package/dist/assets/Renown-6m7hx37h-CItksi2j.js.map +0 -1
- package/dist/assets/RenownHover-CQ0TZHZv-cYQgnwQW.js +0 -2
- package/dist/assets/RenownHover-CQ0TZHZv-cYQgnwQW.js.map +0 -1
- package/dist/assets/Ring-DKv0gnwT-CDHLz87h.js +0 -2
- package/dist/assets/Ring-DKv0gnwT-CDHLz87h.js.map +0 -1
- package/dist/assets/Save-BBxj68pn-BkUvn89C.js +0 -2
- package/dist/assets/Save-BBxj68pn-BkUvn89C.js.map +0 -1
- package/dist/assets/Search-YUJuRBLe-CecGUkZA.js +0 -2
- package/dist/assets/Search-YUJuRBLe-CecGUkZA.js.map +0 -1
- package/dist/assets/Server-Bfkkjui1-lBan_3Dm.js +0 -2
- package/dist/assets/Server-Bfkkjui1-lBan_3Dm.js.map +0 -1
- package/dist/assets/Settings-mbbylBS5-Cca-sV-_.js +0 -2
- package/dist/assets/Settings-mbbylBS5-Cca-sV-_.js.map +0 -1
- package/dist/assets/Synced-DKJXzPiw-Cui8pDsS.js +0 -2
- package/dist/assets/Synced-DKJXzPiw-Cui8pDsS.js.map +0 -1
- package/dist/assets/Syncing-aT9WSMFf-2VhhyCcX.js +0 -2
- package/dist/assets/Syncing-aT9WSMFf-2VhhyCcX.js.map +0 -1
- package/dist/assets/Trash-CgSbHk-P-DIYkVMER.js +0 -2
- package/dist/assets/Trash-CgSbHk-P-DIYkVMER.js.map +0 -1
- package/dist/assets/TrashFill-DN50ercb-Oqx67xXN.js +0 -2
- package/dist/assets/TrashFill-DN50ercb-Oqx67xXN.js.map +0 -1
- package/dist/assets/VariantArrowLeft-CnuX59_e-6Zt_Q3tm.js +0 -2
- package/dist/assets/VariantArrowLeft-CnuX59_e-6Zt_Q3tm.js.map +0 -1
- package/dist/assets/VerticalDots-C8QYf7et-CCxZfvjq.js +0 -2
- package/dist/assets/VerticalDots-C8QYf7et-CCxZfvjq.js.map +0 -1
- package/dist/assets/WarningFill-WowAvi5P-D5XCckM6.js +0 -2
- package/dist/assets/WarningFill-WowAvi5P-D5XCckM6.js.map +0 -1
- package/dist/assets/XTwitter-k3Pt8itk-mvLk8TKx.js +0 -2
- package/dist/assets/XTwitter-k3Pt8itk-mvLk8TKx.js.map +0 -1
- package/dist/assets/Xmark-8qnJCs2Y-CZ3t0Fap.js +0 -2
- package/dist/assets/Xmark-8qnJCs2Y-CZ3t0Fap.js.map +0 -1
- package/dist/assets/XmarkLight-GHzDR5_F-CloMvuzt.js +0 -2
- package/dist/assets/XmarkLight-GHzDR5_F-CloMvuzt.js.map +0 -1
- package/dist/assets/Youtube-i8V0IXUU-Bkiwoayp.js +0 -2
- package/dist/assets/Youtube-i8V0IXUU-Bkiwoayp.js.map +0 -1
- package/dist/assets/app-CYieqxAC.js +0 -1207
- package/dist/assets/app-CYieqxAC.js.map +0 -1
- package/dist/assets/app-loader-B-uyrf_f.js +0 -3
- package/dist/assets/app-loader-B-uyrf_f.js.map +0 -1
- package/dist/assets/app-loader-DoI5W0wZ.css +0 -1
- package/dist/assets/browser-Dmr6AWWk.js +0 -2
- package/dist/assets/browser-Dmr6AWWk.js.map +0 -1
- package/dist/assets/browser-j9PCU6X2.js +0 -43
- package/dist/assets/browser-j9PCU6X2.js.map +0 -1
- package/dist/assets/ccip-C5sF4CPo.js +0 -2
- package/dist/assets/ccip-C5sF4CPo.js.map +0 -1
- package/dist/assets/content-oOo0Zcrz.js +0 -92
- package/dist/assets/content-oOo0Zcrz.js.map +0 -1
- package/dist/assets/editor-BehREuht.js +0 -2
- package/dist/assets/editor-BehREuht.js.map +0 -1
- package/dist/assets/editor-BiJUUdCl.js +0 -2
- package/dist/assets/editor-BiJUUdCl.js.map +0 -1
- package/dist/assets/editor-CKVy7XQ_.js +0 -2
- package/dist/assets/editor-CKVy7XQ_.js.map +0 -1
- package/dist/assets/editor-OCrWWNue.js +0 -2
- package/dist/assets/editor-OCrWWNue.js.map +0 -1
- package/dist/assets/editors-CXzpYxzV.js +0 -380
- package/dist/assets/editors-CXzpYxzV.js.map +0 -1
- package/dist/assets/index-BQercxn9.js +0 -16
- package/dist/assets/index-BQercxn9.js.map +0 -1
- package/dist/assets/index-DLIqrgw1.js +0 -3
- package/dist/assets/index-DLIqrgw1.js.map +0 -1
- package/dist/assets/index-T6Et30Eh-DxlgfU62.js +0 -12
- package/dist/assets/index-T6Et30Eh-DxlgfU62.js.map +0 -1
- package/dist/assets/main.DyaR6eIt.js +0 -2
- package/dist/assets/main.DyaR6eIt.js.map +0 -1
- package/dist/assets/root-gagZfA5U.js +0 -12
- package/dist/assets/root-gagZfA5U.js.map +0 -1
- package/dist/assets/router-Bg0sntVG.js +0 -12
- package/dist/assets/router-Bg0sntVG.js.map +0 -1
- package/dist/assets/useUiNodes-C_gncg9W.js +0 -107
- package/dist/assets/useUiNodes-C_gncg9W.js.map +0 -1
- package/dist/service-worker.js.map +0 -1
- package/dist/studio/cli.js +0 -5
- package/dist/studio/helpers.d.ts +0 -2
- package/dist/studio/index.d.ts +0 -15
- package/dist/studio/index.js +0 -559
- package/dist/studio/server.d.ts +0 -5
- package/dist/studio/vite-plugin.d.ts +0 -12
|
@@ -1,380 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/editor-CKVy7XQ_.js","assets/main.DyaR6eIt.js","assets/app-CYieqxAC.js","assets/app-loader-B-uyrf_f.js","assets/app-loader-DoI5W0wZ.css","assets/editor-BehREuht.js","assets/editor-OCrWWNue.js","assets/editor-BiJUUdCl.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as __vitePreload}from"./main.DyaR6eIt.js";import{jsx,jsxs,Fragment}from"react/jsx-runtime";import*as y$2 from"react";import y__default,{forwardRef,createContext,memo,useCallback,useState,useMemo,Suspense,useRef,useReducer,useEffect,useContext,lazy,useLayoutEffect,Fragment as Fragment$1,Component,useImperativeHandle,useId}from"react";import{a1 as py$1,a2 as JR,a3 as Ir$3,a4 as sr$2,a5 as $$4,x as index,a6 as Hr$3,a7 as K8,a8 as Ci$1,a9 as h$2,aa as actions,ab as xo$2}from"./app-CYieqxAC.js";import*as jl$1 from"react-dom";import jl__default,{createPortal}from"react-dom";var yo$1,Ri;function Cf(){if(Ri)return yo$1;Ri=1;var vo="Expected a function",Ai=NaN,bo="[object Symbol]",Ra=/^\s+|\s+$/g,hc=/^[-+]0x[0-9a-f]+$/i,pc=/^0b[01]+$/i,mc=/^0o[0-7]+$/i,uf=parseInt,df=typeof sr$2=="object"&&sr$2&&sr$2.Object===Object&&sr$2,ff=typeof self=="object"&&self&&self.Object===Object&&self,hf=df||ff||Function("return this")(),pf=Object.prototype,mf=pf.toString,gf=Math.max,yf=Math.min,vf=function(){return hf.Date.now()};function bf(If,l1,c1){var m1,k1,N1,R1,$1,D1,f1=0,T1=!1,A1=!1,L1=!0;if(typeof If!="function")throw new TypeError(vo);l1=s1(l1)||0,Sf(c1)&&(T1=!!c1.leading,A1="maxWait"in c1,N1=A1?gf(s1(c1.maxWait)||0,l1):N1,L1="trailing"in c1?!!c1.trailing:L1);function B1(W1){var J1=m1,eT=k1;return m1=k1=void 0,f1=W1,R1=If.apply(eT,J1),R1}function V1(W1){return f1=W1,$1=setTimeout(E1,l1),T1?B1(W1):R1}function Z1(W1){var J1=W1-D1,eT=W1-f1,nT=l1-J1;return A1?yf(nT,N1-eT):nT}function H1(W1){var J1=W1-D1,eT=W1-f1;return D1===void 0||J1>=l1||J1<0||A1&&eT>=N1}function E1(){var W1=vf();if(H1(W1))return F1(W1);$1=setTimeout(E1,Z1(W1))}function F1(W1){return $1=void 0,L1&&m1?B1(W1):(m1=k1=void 0,R1)}function M1(){$1!==void 0&&clearTimeout($1),f1=0,m1=D1=k1=$1=void 0}function q1(){return $1===void 0?R1:F1(vf())}function z1(){var W1=vf(),J1=H1(W1);if(m1=arguments,k1=this,D1=W1,J1){if($1===void 0)return V1(D1);if(A1)return $1=setTimeout(E1,l1),B1(D1)}return $1===void 0&&($1=setTimeout(E1,l1)),R1}return z1.cancel=M1,z1.flush=q1,z1}function Sf(If){var l1=typeof If;return!!If&&(l1=="object"||l1=="function")}function xf(If){return!!If&&typeof If=="object"}function wf(If){return typeof If=="symbol"||xf(If)&&mf.call(If)==bo}function s1(If){if(typeof If=="number")return If;if(wf(If))return Ai;if(Sf(If)){var l1=typeof If.valueOf=="function"?If.valueOf():If;If=Sf(l1)?l1+"":l1}if(typeof If!="string")return If===0?If:+If;If=If.replace(Ra,"");var c1=pc.test(If);return c1||mc.test(If)?uf(If.slice(2),c1?2:8):hc.test(If)?Ai:+If}return yo$1=bf,yo$1}Cf();var qn$1=vo=>vo.type==="checkbox",Gt$2=vo=>vo instanceof Date,Be$2=vo=>vo==null;const gc=vo=>typeof vo=="object";var Te$1=vo=>!Be$2(vo)&&!Array.isArray(vo)&&gc(vo)&&!Gt$2(vo),vc=vo=>Te$1(vo)&&vo.target?qn$1(vo.target)?vo.target.checked:vo.target.value:vo,Ef=vo=>vo.substring(0,vo.search(/\.\d+(\.|$)/))||vo,bc=(vo,Ai)=>vo.has(Ef(Ai)),Pf=vo=>{const Ai=vo.constructor&&vo.constructor.prototype;return Te$1(Ai)&&Ai.hasOwnProperty("isPrototypeOf")},_a$1=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function De$2(vo){let Ai;const bo=Array.isArray(vo),Ra=typeof FileList<"u"?vo instanceof FileList:!1;if(vo instanceof Date)Ai=new Date(vo);else if(vo instanceof Set)Ai=new Set(vo);else if(!(_a$1&&(vo instanceof Blob||Ra))&&(bo||Te$1(vo)))if(Ai=bo?[]:{},!bo&&!Pf(vo))Ai=vo;else for(const hc in vo)vo.hasOwnProperty(hc)&&(Ai[hc]=De$2(vo[hc]));else return vo;return Ai}var Xn$1=vo=>Array.isArray(vo)?vo.filter(Boolean):[],Se$1=vo=>vo===void 0,B$3=(vo,Ai,bo)=>{if(!Ai||!Te$1(vo))return bo;const Ra=Xn$1(Ai.split(/[,[\].]+?/)).reduce((hc,pc)=>Be$2(hc)?hc:hc[pc],vo);return Se$1(Ra)||Ra===vo?Se$1(vo[Ai])?bo:vo[Ai]:Ra},Qe$2=vo=>typeof vo=="boolean",ka=vo=>/^\w*$/.test(vo),yc=vo=>Xn$1(vo.replace(/["|']|\]/g,"").split(/\.|\[/)),ge$2=(vo,Ai,bo)=>{let Ra=-1;const hc=ka(Ai)?[Ai]:yc(Ai),pc=hc.length,mc=pc-1;for(;++Ra<pc;){const uf=hc[Ra];let df=bo;if(Ra!==mc){const ff=vo[uf];df=Te$1(ff)||Array.isArray(ff)?ff:isNaN(+hc[Ra+1])?{}:[]}if(uf==="__proto__"||uf==="constructor"||uf==="prototype")return;vo[uf]=df,vo=vo[uf]}return vo};const Er$2={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Je$1={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},wt$2={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},wc=y__default.createContext(null),Yr$2=()=>y__default.useContext(wc),p1=vo=>{const{children:Ai,...bo}=vo;return y__default.createElement(wc.Provider,{value:bo},Ai)};var xc=(vo,Ai,bo,Ra=!0)=>{const hc={defaultValues:Ai._defaultValues};for(const pc in vo)Object.defineProperty(hc,pc,{get:()=>{const mc=pc;return Ai._proxyFormState[mc]!==Je$1.all&&(Ai._proxyFormState[mc]=!Ra||Je$1.all),bo&&(bo[mc]=!0),vo[mc]}});return hc},We$2=vo=>Te$1(vo)&&!Object.keys(vo).length,Sc=(vo,Ai,bo,Ra)=>{bo(vo);const{name:hc,...pc}=vo;return We$2(pc)||Object.keys(pc).length>=Object.keys(Ai).length||Object.keys(pc).find(mc=>Ai[mc]===(!Ra||Je$1.all))},Ge$2=vo=>Array.isArray(vo)?vo:[vo],Cc=(vo,Ai,bo)=>!vo||!Ai||vo===Ai||Ge$2(vo).some(Ra=>Ra&&(bo?Ra===Ai:Ra.startsWith(Ai)||Ai.startsWith(Ra)));function Gr$2(vo){const Ai=y__default.useRef(vo);Ai.current=vo,y__default.useEffect(()=>{const bo=!vo.disabled&&Ai.current.subject&&Ai.current.subject.subscribe({next:Ai.current.next});return()=>{bo&&bo.unsubscribe()}},[vo.disabled])}function Tf(vo){const Ai=Yr$2(),{control:bo=Ai.control,disabled:Ra,name:hc,exact:pc}=vo,[mc,uf]=y__default.useState(bo._formState),df=y__default.useRef(!0),ff=y__default.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),hf=y__default.useRef(hc);return hf.current=hc,Gr$2({disabled:Ra,next:pf=>df.current&&Cc(hf.current,pf.name,pc)&&Sc(pf,ff.current,bo._updateFormState)&&uf({...bo._formState,...pf}),subject:bo._subjects.state}),y__default.useEffect(()=>(df.current=!0,ff.current.isValid&&bo._updateValid(!0),()=>{df.current=!1}),[bo]),y__default.useMemo(()=>xc(mc,bo,ff.current,!1),[mc,bo])}var ht$2=vo=>typeof vo=="string",Ic=(vo,Ai,bo,Ra,hc)=>ht$2(vo)?(Ra&&Ai.watch.add(vo),B$3(bo,vo,hc)):Array.isArray(vo)?vo.map(pc=>(Ra&&Ai.watch.add(pc),B$3(bo,pc))):(Ra&&(Ai.watchAll=!0),bo);function kt$2(vo){const Ai=Yr$2(),{control:bo=Ai.control,name:Ra,defaultValue:hc,disabled:pc,exact:mc}=vo||{},uf=y__default.useRef(Ra);uf.current=Ra,Gr$2({disabled:pc,subject:bo._subjects.values,next:hf=>{Cc(uf.current,hf.name,mc)&&ff(De$2(Ic(uf.current,bo._names,hf.values||bo._formValues,!1,hc)))}});const[df,ff]=y__default.useState(bo._getWatch(Ra,hc));return y__default.useEffect(()=>bo._removeUnmounted()),df}function Of(vo){const Ai=Yr$2(),{name:bo,disabled:Ra,control:hc=Ai.control,shouldUnregister:pc}=vo,mc=bc(hc._names.array,bo),uf=kt$2({control:hc,name:bo,defaultValue:B$3(hc._formValues,bo,B$3(hc._defaultValues,bo,vo.defaultValue)),exact:!0}),df=Tf({control:hc,name:bo,exact:!0}),ff=y__default.useRef(hc.register(bo,{...vo.rules,value:uf,...Qe$2(vo.disabled)?{disabled:vo.disabled}:{}})),hf=y__default.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!B$3(df.errors,bo)},isDirty:{enumerable:!0,get:()=>!!B$3(df.dirtyFields,bo)},isTouched:{enumerable:!0,get:()=>!!B$3(df.touchedFields,bo)},isValidating:{enumerable:!0,get:()=>!!B$3(df.validatingFields,bo)},error:{enumerable:!0,get:()=>B$3(df.errors,bo)}}),[df,bo]),pf=y__default.useMemo(()=>({name:bo,value:uf,...Qe$2(Ra)||df.disabled?{disabled:df.disabled||Ra}:{},onChange:mf=>ff.current.onChange({target:{value:vc(mf),name:bo},type:Er$2.CHANGE}),onBlur:()=>ff.current.onBlur({target:{value:B$3(hc._formValues,bo),name:bo},type:Er$2.BLUR}),ref:mf=>{const gf=B$3(hc._fields,bo);gf&&mf&&(gf._f.ref={focus:()=>mf.focus(),select:()=>mf.select(),setCustomValidity:yf=>mf.setCustomValidity(yf),reportValidity:()=>mf.reportValidity()})}}),[bo,hc._formValues,Ra,df.disabled,uf,hc._fields]);return y__default.useEffect(()=>{const mf=hc._options.shouldUnregister||pc,gf=(yf,vf)=>{const bf=B$3(hc._fields,yf);bf&&bf._f&&(bf._f.mount=vf)};if(gf(bo,!0),mf){const yf=De$2(B$3(hc._options.defaultValues,bo));ge$2(hc._defaultValues,bo,yf),Se$1(B$3(hc._formValues,bo))&&ge$2(hc._formValues,bo,yf)}return!mc&&hc.register(bo),()=>{(mc?mf&&!hc._state.action:mf)?hc.unregister(bo):gf(bo,!1)}},[bo,hc,mc,pc]),y__default.useEffect(()=>{hc._updateDisabledField({disabled:Ra,fields:hc._fields,name:bo})},[Ra,bo,hc]),y__default.useMemo(()=>({field:pf,formState:df,fieldState:hf}),[pf,df,hf])}const Ec=vo=>vo.render(Of(vo));var Mf=(vo,Ai,bo,Ra,hc)=>Ai?{...bo[vo],types:{...bo[vo]&&bo[vo].types?bo[vo].types:{},[Ra]:hc||!0}}:{},Tt$2=()=>{const vo=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,Ai=>{const bo=(Math.random()*16+vo)%16|0;return(Ai=="x"?bo:bo&3|8).toString(16)})},wo=(vo,Ai,bo={})=>bo.shouldFocus||Se$1(bo.shouldFocus)?bo.focusName||`${vo}.${Se$1(bo.focusIndex)?Ai:bo.focusIndex}.`:"",_n$2=vo=>({isOnSubmit:!vo||vo===Je$1.onSubmit,isOnBlur:vo===Je$1.onBlur,isOnChange:vo===Je$1.onChange,isOnAll:vo===Je$1.all,isOnTouch:vo===Je$1.onTouched}),ca$1=(vo,Ai,bo)=>!bo&&(Ai.watchAll||Ai.watch.has(vo)||[...Ai.watch].some(Ra=>vo.startsWith(Ra)&&/^\.\w+/.test(vo.slice(Ra.length))));const sn$1=(vo,Ai,bo,Ra)=>{for(const hc of bo||Object.keys(vo)){const pc=B$3(vo,hc);if(pc){const{_f:mc,...uf}=pc;if(mc){if(mc.refs&&mc.refs[0]&&Ai(mc.refs[0],hc)&&!Ra||mc.ref&&Ai(mc.ref,mc.name)&&!Ra)return!0;if(sn$1(uf,Ai))break}else if(Te$1(uf)&&sn$1(uf,Ai))break}}};var Pc=(vo,Ai,bo)=>{const Ra=Ge$2(B$3(vo,bo));return ge$2(Ra,"root",Ai[bo]),ge$2(vo,bo,Ra),vo},Fa=vo=>vo.type==="file",ft$2=vo=>typeof vo=="function",Pr$2=vo=>{if(!_a$1)return!1;const Ai=vo?vo.ownerDocument:0;return vo instanceof(Ai&&Ai.defaultView?Ai.defaultView.HTMLElement:HTMLElement)},vr$2=vo=>ht$2(vo),Va=vo=>vo.type==="radio",Tr$2=vo=>vo instanceof RegExp;const _i={value:!1,isValid:!1},ki$1={value:!0,isValid:!0};var Tc=vo=>{if(Array.isArray(vo)){if(vo.length>1){const Ai=vo.filter(bo=>bo&&bo.checked&&!bo.disabled).map(bo=>bo.value);return{value:Ai,isValid:!!Ai.length}}return vo[0].checked&&!vo[0].disabled?vo[0].attributes&&!Se$1(vo[0].attributes.value)?Se$1(vo[0].value)||vo[0].value===""?ki$1:{value:vo[0].value,isValid:!0}:ki$1:_i}return _i};const Fi$1={isValid:!1,value:null};var Oc=vo=>Array.isArray(vo)?vo.reduce((Ai,bo)=>bo&&bo.checked&&!bo.disabled?{isValid:!0,value:bo.value}:Ai,Fi$1):Fi$1;function Vi(vo,Ai,bo="validate"){if(vr$2(vo)||Array.isArray(vo)&&vo.every(vr$2)||Qe$2(vo)&&!vo)return{type:bo,message:vr$2(vo)?vo:"",ref:Ai}}var Jt$1=vo=>Te$1(vo)&&!Tr$2(vo)?vo:{value:vo,message:""},la$1=async(vo,Ai,bo,Ra,hc,pc)=>{const{ref:mc,refs:uf,required:df,maxLength:ff,minLength:hf,min:pf,max:mf,pattern:gf,validate:yf,name:vf,valueAsNumber:bf,mount:Sf}=vo._f,xf=B$3(bo,vf);if(!Sf||Ai.has(vf))return{};const wf=uf?uf[0]:mc,s1=$1=>{hc&&wf.reportValidity&&(wf.setCustomValidity(Qe$2($1)?"":$1||""),wf.reportValidity())},If={},l1=Va(mc),c1=qn$1(mc),m1=l1||c1,k1=(bf||Fa(mc))&&Se$1(mc.value)&&Se$1(xf)||Pr$2(mc)&&mc.value===""||xf===""||Array.isArray(xf)&&!xf.length,N1=Mf.bind(null,vf,Ra,If),R1=($1,D1,f1,T1=wt$2.maxLength,A1=wt$2.minLength)=>{const L1=$1?D1:f1;If[vf]={type:$1?T1:A1,message:L1,ref:mc,...N1($1?T1:A1,L1)}};if(pc?!Array.isArray(xf)||!xf.length:df&&(!m1&&(k1||Be$2(xf))||Qe$2(xf)&&!xf||c1&&!Tc(uf).isValid||l1&&!Oc(uf).isValid)){const{value:$1,message:D1}=vr$2(df)?{value:!!df,message:df}:Jt$1(df);if($1&&(If[vf]={type:wt$2.required,message:D1,ref:wf,...N1(wt$2.required,D1)},!Ra))return s1(D1),If}if(!k1&&(!Be$2(pf)||!Be$2(mf))){let $1,D1;const f1=Jt$1(mf),T1=Jt$1(pf);if(!Be$2(xf)&&!isNaN(xf)){const A1=mc.valueAsNumber||xf&&+xf;Be$2(f1.value)||($1=A1>f1.value),Be$2(T1.value)||(D1=A1<T1.value)}else{const A1=mc.valueAsDate||new Date(xf),L1=Z1=>new Date(new Date().toDateString()+" "+Z1),B1=mc.type=="time",V1=mc.type=="week";ht$2(f1.value)&&xf&&($1=B1?L1(xf)>L1(f1.value):V1?xf>f1.value:A1>new Date(f1.value)),ht$2(T1.value)&&xf&&(D1=B1?L1(xf)<L1(T1.value):V1?xf<T1.value:A1<new Date(T1.value))}if(($1||D1)&&(R1(!!$1,f1.message,T1.message,wt$2.max,wt$2.min),!Ra))return s1(If[vf].message),If}if((ff||hf)&&!k1&&(ht$2(xf)||pc&&Array.isArray(xf))){const $1=Jt$1(ff),D1=Jt$1(hf),f1=!Be$2($1.value)&&xf.length>+$1.value,T1=!Be$2(D1.value)&&xf.length<+D1.value;if((f1||T1)&&(R1(f1,$1.message,D1.message),!Ra))return s1(If[vf].message),If}if(gf&&!k1&&ht$2(xf)){const{value:$1,message:D1}=Jt$1(gf);if(Tr$2($1)&&!xf.match($1)&&(If[vf]={type:wt$2.pattern,message:D1,ref:mc,...N1(wt$2.pattern,D1)},!Ra))return s1(D1),If}if(yf){if(ft$2(yf)){const $1=await yf(xf,bo),D1=Vi($1,wf);if(D1&&(If[vf]={...D1,...N1(wt$2.validate,D1.message)},!Ra))return s1(D1.message),If}else if(Te$1(yf)){let $1={};for(const D1 in yf){if(!We$2($1)&&!Ra)break;const f1=Vi(await yf[D1](xf,bo),wf,D1);f1&&($1={...f1,...N1(D1,f1.message)},s1(f1.message),Ra&&(If[vf]=$1))}if(!We$2($1)&&(If[vf]={ref:wf,...$1},!Ra))return If}}return s1(!0),If},xo$1=(vo,Ai)=>[...vo,...Ge$2(Ai)],So=vo=>Array.isArray(vo)?vo.map(()=>{}):void 0;function Co(vo,Ai,bo){return[...vo.slice(0,Ai),...Ge$2(bo),...vo.slice(Ai)]}var Io=(vo,Ai,bo)=>Array.isArray(vo)?(Se$1(vo[bo])&&(vo[bo]=void 0),vo.splice(bo,0,vo.splice(Ai,1)[0]),vo):[],Eo=(vo,Ai)=>[...Ge$2(Ai),...Ge$2(vo)];function Nf(vo,Ai){let bo=0;const Ra=[...vo];for(const hc of Ai)Ra.splice(hc-bo,1),bo++;return Xn$1(Ra).length?Ra:[]}var Po=(vo,Ai)=>Se$1(Ai)?[]:Nf(vo,Ge$2(Ai).sort((bo,Ra)=>bo-Ra)),To$1=(vo,Ai,bo)=>{[vo[Ai],vo[bo]]=[vo[bo],vo[Ai]]};function Af(vo,Ai){const bo=Ai.slice(0,-1).length;let Ra=0;for(;Ra<bo;)vo=Se$1(vo)?Ra++:vo[Ai[Ra++]];return vo}function Df(vo){for(const Ai in vo)if(vo.hasOwnProperty(Ai)&&!Se$1(vo[Ai]))return!1;return!0}function Oe$2(vo,Ai){const bo=Array.isArray(Ai)?Ai:ka(Ai)?[Ai]:yc(Ai),Ra=bo.length===1?vo:Af(vo,bo),hc=bo.length-1,pc=bo[hc];return Ra&&delete Ra[pc],hc!==0&&(Te$1(Ra)&&We$2(Ra)||Array.isArray(Ra)&&Df(Ra))&&Oe$2(vo,bo.slice(0,-1)),vo}var Li=(vo,Ai,bo)=>(vo[Ai]=bo,vo);function Rf(vo){const Ai=Yr$2(),{control:bo=Ai.control,name:Ra,keyName:hc="id",shouldUnregister:pc,rules:mc}=vo,[uf,df]=y__default.useState(bo._getFieldArray(Ra)),ff=y__default.useRef(bo._getFieldArray(Ra).map(Tt$2)),hf=y__default.useRef(uf),pf=y__default.useRef(Ra),mf=y__default.useRef(!1);pf.current=Ra,hf.current=uf,bo._names.array.add(Ra),mc&&bo.register(Ra,mc),Gr$2({next:({values:l1,name:c1})=>{if(c1===pf.current||!c1){const m1=B$3(l1,pf.current);Array.isArray(m1)&&(df(m1),ff.current=m1.map(Tt$2))}},subject:bo._subjects.array});const gf=y__default.useCallback(l1=>{mf.current=!0,bo._updateFieldArray(Ra,l1)},[bo,Ra]),yf=(l1,c1)=>{const m1=Ge$2(De$2(l1)),k1=xo$1(bo._getFieldArray(Ra),m1);bo._names.focus=wo(Ra,k1.length-1,c1),ff.current=xo$1(ff.current,m1.map(Tt$2)),gf(k1),df(k1),bo._updateFieldArray(Ra,k1,xo$1,{argA:So(l1)})},vf=(l1,c1)=>{const m1=Ge$2(De$2(l1)),k1=Eo(bo._getFieldArray(Ra),m1);bo._names.focus=wo(Ra,0,c1),ff.current=Eo(ff.current,m1.map(Tt$2)),gf(k1),df(k1),bo._updateFieldArray(Ra,k1,Eo,{argA:So(l1)})},bf=l1=>{const c1=Po(bo._getFieldArray(Ra),l1);ff.current=Po(ff.current,l1),gf(c1),df(c1),!Array.isArray(B$3(bo._fields,Ra))&&ge$2(bo._fields,Ra,void 0),bo._updateFieldArray(Ra,c1,Po,{argA:l1})},Sf=(l1,c1,m1)=>{const k1=Ge$2(De$2(c1)),N1=Co(bo._getFieldArray(Ra),l1,k1);bo._names.focus=wo(Ra,l1,m1),ff.current=Co(ff.current,l1,k1.map(Tt$2)),gf(N1),df(N1),bo._updateFieldArray(Ra,N1,Co,{argA:l1,argB:So(c1)})},xf=(l1,c1)=>{const m1=bo._getFieldArray(Ra);To$1(m1,l1,c1),To$1(ff.current,l1,c1),gf(m1),df(m1),bo._updateFieldArray(Ra,m1,To$1,{argA:l1,argB:c1},!1)},wf=(l1,c1)=>{const m1=bo._getFieldArray(Ra);Io(m1,l1,c1),Io(ff.current,l1,c1),gf(m1),df(m1),bo._updateFieldArray(Ra,m1,Io,{argA:l1,argB:c1},!1)},s1=(l1,c1)=>{const m1=De$2(c1),k1=Li(bo._getFieldArray(Ra),l1,m1);ff.current=[...k1].map((N1,R1)=>!N1||R1===l1?Tt$2():ff.current[R1]),gf(k1),df([...k1]),bo._updateFieldArray(Ra,k1,Li,{argA:l1,argB:m1},!0,!1)},If=l1=>{const c1=Ge$2(De$2(l1));ff.current=c1.map(Tt$2),gf([...c1]),df([...c1]),bo._updateFieldArray(Ra,[...c1],m1=>m1,{},!0,!1)};return y__default.useEffect(()=>{if(bo._state.action=!1,ca$1(Ra,bo._names)&&bo._subjects.state.next({...bo._formState}),mf.current&&(!_n$2(bo._options.mode).isOnSubmit||bo._formState.isSubmitted))if(bo._options.resolver)bo._executeSchema([Ra]).then(l1=>{const c1=B$3(l1.errors,Ra),m1=B$3(bo._formState.errors,Ra);(m1?!c1&&m1.type||c1&&(m1.type!==c1.type||m1.message!==c1.message):c1&&c1.type)&&(c1?ge$2(bo._formState.errors,Ra,c1):Oe$2(bo._formState.errors,Ra),bo._subjects.state.next({errors:bo._formState.errors}))});else{const l1=B$3(bo._fields,Ra);l1&&l1._f&&!(_n$2(bo._options.reValidateMode).isOnSubmit&&_n$2(bo._options.mode).isOnSubmit)&&la$1(l1,bo._names.disabled,bo._formValues,bo._options.criteriaMode===Je$1.all,bo._options.shouldUseNativeValidation,!0).then(c1=>!We$2(c1)&&bo._subjects.state.next({errors:Pc(bo._formState.errors,c1,Ra)}))}bo._subjects.values.next({name:Ra,values:{...bo._formValues}}),bo._names.focus&&sn$1(bo._fields,(l1,c1)=>{if(bo._names.focus&&c1.startsWith(bo._names.focus)&&l1.focus)return l1.focus(),1}),bo._names.focus="",bo._updateValid(),mf.current=!1},[uf,Ra,bo]),y__default.useEffect(()=>(!B$3(bo._formValues,Ra)&&bo._updateFieldArray(Ra),()=>{(bo._options.shouldUnregister||pc)&&bo.unregister(Ra)}),[Ra,bo,hc,pc]),{swap:y__default.useCallback(xf,[gf,Ra,bo]),move:y__default.useCallback(wf,[gf,Ra,bo]),prepend:y__default.useCallback(vf,[gf,Ra,bo]),append:y__default.useCallback(yf,[gf,Ra,bo]),remove:y__default.useCallback(bf,[gf,Ra,bo]),insert:y__default.useCallback(Sf,[gf,Ra,bo]),update:y__default.useCallback(s1,[gf,Ra,bo]),replace:y__default.useCallback(If,[gf,Ra,bo]),fields:y__default.useMemo(()=>uf.map((l1,c1)=>({...l1,[hc]:ff.current[c1]||Tt$2()})),[uf,hc])}}var Oo=()=>{let vo=[];return{get observers(){return vo},next:Ai=>{for(const bo of vo)bo.next&&bo.next(Ai)},subscribe:Ai=>(vo.push(Ai),{unsubscribe:()=>{vo=vo.filter(bo=>bo!==Ai)}}),unsubscribe:()=>{vo=[]}}},ua$1=vo=>Be$2(vo)||!gc(vo);function Rt$2(vo,Ai){if(ua$1(vo)||ua$1(Ai))return vo===Ai;if(Gt$2(vo)&&Gt$2(Ai))return vo.getTime()===Ai.getTime();const bo=Object.keys(vo),Ra=Object.keys(Ai);if(bo.length!==Ra.length)return!1;for(const hc of bo){const pc=vo[hc];if(!Ra.includes(hc))return!1;if(hc!=="ref"){const mc=Ai[hc];if(Gt$2(pc)&&Gt$2(mc)||Te$1(pc)&&Te$1(mc)||Array.isArray(pc)&&Array.isArray(mc)?!Rt$2(pc,mc):pc!==mc)return!1}}return!0}var Mc=vo=>vo.type==="select-multiple",_f=vo=>Va(vo)||qn$1(vo),Mo$1=vo=>Pr$2(vo)&&vo.isConnected,Nc=vo=>{for(const Ai in vo)if(ft$2(vo[Ai]))return!0;return!1};function Or$1(vo,Ai={}){const bo=Array.isArray(vo);if(Te$1(vo)||bo)for(const Ra in vo)Array.isArray(vo[Ra])||Te$1(vo[Ra])&&!Nc(vo[Ra])?(Ai[Ra]=Array.isArray(vo[Ra])?[]:{},Or$1(vo[Ra],Ai[Ra])):Be$2(vo[Ra])||(Ai[Ra]=!0);return Ai}function Ac(vo,Ai,bo){const Ra=Array.isArray(vo);if(Te$1(vo)||Ra)for(const hc in vo)Array.isArray(vo[hc])||Te$1(vo[hc])&&!Nc(vo[hc])?Se$1(Ai)||ua$1(bo[hc])?bo[hc]=Array.isArray(vo[hc])?Or$1(vo[hc],[]):{...Or$1(vo[hc])}:Ac(vo[hc],Be$2(Ai)?{}:Ai[hc],bo[hc]):bo[hc]=!Rt$2(vo[hc],Ai[hc]);return bo}var Cn$2=(vo,Ai)=>Ac(vo,Ai,Or$1(Ai)),Dc=(vo,{valueAsNumber:Ai,valueAsDate:bo,setValueAs:Ra})=>Se$1(vo)?vo:Ai?vo===""?NaN:vo&&+vo:bo&&ht$2(vo)?new Date(vo):Ra?Ra(vo):vo;function No(vo){const Ai=vo.ref;return Fa(Ai)?Ai.files:Va(Ai)?Oc(vo.refs).value:Mc(Ai)?[...Ai.selectedOptions].map(({value:bo})=>bo):qn$1(Ai)?Tc(vo.refs).value:Dc(Se$1(Ai.value)?vo.ref.value:Ai.value,vo)}var kf=(vo,Ai,bo,Ra)=>{const hc={};for(const pc of vo){const mc=B$3(Ai,pc);mc&&ge$2(hc,pc,mc._f)}return{criteriaMode:bo,names:[...vo],fields:hc,shouldUseNativeValidation:Ra}},In$2=vo=>Se$1(vo)?vo:Tr$2(vo)?vo.source:Te$1(vo)?Tr$2(vo.value)?vo.value.source:vo.value:vo;const $i="AsyncFunction";var Ff=vo=>!!vo&&!!vo.validate&&!!(ft$2(vo.validate)&&vo.validate.constructor.name===$i||Te$1(vo.validate)&&Object.values(vo.validate).find(Ai=>Ai.constructor.name===$i)),Vf=vo=>vo.mount&&(vo.required||vo.min||vo.max||vo.maxLength||vo.minLength||vo.pattern||vo.validate);function Ui(vo,Ai,bo){const Ra=B$3(vo,bo);if(Ra||ka(bo))return{error:Ra,name:bo};const hc=bo.split(".");for(;hc.length;){const pc=hc.join("."),mc=B$3(Ai,pc),uf=B$3(vo,pc);if(mc&&!Array.isArray(mc)&&bo!==pc)return{name:bo};if(uf&&uf.type)return{name:pc,error:uf};hc.pop()}return{name:bo}}var Lf=(vo,Ai,bo,Ra,hc)=>hc.isOnAll?!1:!bo&&hc.isOnTouch?!(Ai||vo):(bo?Ra.isOnBlur:hc.isOnBlur)?!vo:(bo?Ra.isOnChange:hc.isOnChange)?vo:!0,$f=(vo,Ai)=>!Xn$1(B$3(vo,Ai)).length&&Oe$2(vo,Ai);const Uf={mode:Je$1.onSubmit,reValidateMode:Je$1.onChange,shouldFocusError:!0};function Hf(vo={}){let Ai={...Uf,...vo},bo={submitCount:0,isDirty:!1,isLoading:ft$2(Ai.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:Ai.errors||{},disabled:Ai.disabled||!1},Ra={},hc=Te$1(Ai.defaultValues)||Te$1(Ai.values)?De$2(Ai.defaultValues||Ai.values)||{}:{},pc=Ai.shouldUnregister?{}:De$2(hc),mc={action:!1,mount:!1,watch:!1},uf={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},df,ff=0;const hf={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},pf={values:Oo(),array:Oo(),state:Oo()},mf=_n$2(Ai.mode),gf=_n$2(Ai.reValidateMode),yf=Ai.criteriaMode===Je$1.all,vf=_1=>j1=>{clearTimeout(ff),ff=setTimeout(_1,j1)},bf=async _1=>{if(!Ai.disabled&&(hf.isValid||_1)){const j1=Ai.resolver?We$2((await m1()).errors):await N1(Ra,!0);j1!==bo.isValid&&pf.state.next({isValid:j1})}},Sf=(_1,j1)=>{!Ai.disabled&&(hf.isValidating||hf.validatingFields)&&((_1||Array.from(uf.mount)).forEach(P1=>{P1&&(j1?ge$2(bo.validatingFields,P1,j1):Oe$2(bo.validatingFields,P1))}),pf.state.next({validatingFields:bo.validatingFields,isValidating:!We$2(bo.validatingFields)}))},xf=(_1,j1=[],P1,u1,d1=!0,O1=!0)=>{if(u1&&P1&&!Ai.disabled){if(mc.action=!0,O1&&Array.isArray(B$3(Ra,_1))){const U1=P1(B$3(Ra,_1),u1.argA,u1.argB);d1&&ge$2(Ra,_1,U1)}if(O1&&Array.isArray(B$3(bo.errors,_1))){const U1=P1(B$3(bo.errors,_1),u1.argA,u1.argB);d1&&ge$2(bo.errors,_1,U1),$f(bo.errors,_1)}if(hf.touchedFields&&O1&&Array.isArray(B$3(bo.touchedFields,_1))){const U1=P1(B$3(bo.touchedFields,_1),u1.argA,u1.argB);d1&&ge$2(bo.touchedFields,_1,U1)}hf.dirtyFields&&(bo.dirtyFields=Cn$2(hc,pc)),pf.state.next({name:_1,isDirty:$1(_1,j1),dirtyFields:bo.dirtyFields,errors:bo.errors,isValid:bo.isValid})}else ge$2(pc,_1,j1)},wf=(_1,j1)=>{ge$2(bo.errors,_1,j1),pf.state.next({errors:bo.errors})},s1=_1=>{bo.errors=_1,pf.state.next({errors:bo.errors,isValid:!1})},If=(_1,j1,P1,u1)=>{const d1=B$3(Ra,_1);if(d1){const O1=B$3(pc,_1,Se$1(P1)?B$3(hc,_1):P1);Se$1(O1)||u1&&u1.defaultChecked||j1?ge$2(pc,_1,j1?O1:No(d1._f)):T1(_1,O1),mc.mount&&bf()}},l1=(_1,j1,P1,u1,d1)=>{let O1=!1,U1=!1;const Q1={name:_1};if(!Ai.disabled){const G1=!!(B$3(Ra,_1)&&B$3(Ra,_1)._f&&B$3(Ra,_1)._f.disabled);if(!P1||u1){hf.isDirty&&(U1=bo.isDirty,bo.isDirty=Q1.isDirty=$1(),O1=U1!==Q1.isDirty);const X1=G1||Rt$2(B$3(hc,_1),j1);U1=!!(!G1&&B$3(bo.dirtyFields,_1)),X1||G1?Oe$2(bo.dirtyFields,_1):ge$2(bo.dirtyFields,_1,!0),Q1.dirtyFields=bo.dirtyFields,O1=O1||hf.dirtyFields&&U1!==!X1}if(P1){const X1=B$3(bo.touchedFields,_1);X1||(ge$2(bo.touchedFields,_1,P1),Q1.touchedFields=bo.touchedFields,O1=O1||hf.touchedFields&&X1!==P1)}O1&&d1&&pf.state.next(Q1)}return O1?Q1:{}},c1=(_1,j1,P1,u1)=>{const d1=B$3(bo.errors,_1),O1=hf.isValid&&Qe$2(j1)&&bo.isValid!==j1;if(Ai.delayError&&P1?(df=vf(()=>wf(_1,P1)),df(Ai.delayError)):(clearTimeout(ff),df=null,P1?ge$2(bo.errors,_1,P1):Oe$2(bo.errors,_1)),(P1?!Rt$2(d1,P1):d1)||!We$2(u1)||O1){const U1={...u1,...O1&&Qe$2(j1)?{isValid:j1}:{},errors:bo.errors,name:_1};bo={...bo,...U1},pf.state.next(U1)}},m1=async _1=>{Sf(_1,!0);const j1=await Ai.resolver(pc,Ai.context,kf(_1||uf.mount,Ra,Ai.criteriaMode,Ai.shouldUseNativeValidation));return Sf(_1),j1},k1=async _1=>{const{errors:j1}=await m1(_1);if(_1)for(const P1 of _1){const u1=B$3(j1,P1);u1?ge$2(bo.errors,P1,u1):Oe$2(bo.errors,P1)}else bo.errors=j1;return j1},N1=async(_1,j1,P1={valid:!0})=>{for(const u1 in _1){const d1=_1[u1];if(d1){const{_f:O1,...U1}=d1;if(O1){const Q1=uf.array.has(O1.name),G1=d1._f&&Ff(d1._f);G1&&hf.validatingFields&&Sf([u1],!0);const X1=await la$1(d1,uf.disabled,pc,yf,Ai.shouldUseNativeValidation&&!j1,Q1);if(G1&&hf.validatingFields&&Sf([u1]),X1[O1.name]&&(P1.valid=!1,j1))break;!j1&&(B$3(X1,O1.name)?Q1?Pc(bo.errors,X1,O1.name):ge$2(bo.errors,O1.name,X1[O1.name]):Oe$2(bo.errors,O1.name))}!We$2(U1)&&await N1(U1,j1,P1)}}return P1.valid},R1=()=>{for(const _1 of uf.unMount){const j1=B$3(Ra,_1);j1&&(j1._f.refs?j1._f.refs.every(P1=>!Mo$1(P1)):!Mo$1(j1._f.ref))&&z1(_1)}uf.unMount=new Set},$1=(_1,j1)=>!Ai.disabled&&(_1&&j1&&ge$2(pc,_1,j1),!Rt$2(H1(),hc)),D1=(_1,j1,P1)=>Ic(_1,uf,{...mc.mount?pc:Se$1(j1)?hc:ht$2(_1)?{[_1]:j1}:j1},P1,j1),f1=_1=>Xn$1(B$3(mc.mount?pc:hc,_1,Ai.shouldUnregister?B$3(hc,_1,[]):[])),T1=(_1,j1,P1={})=>{const u1=B$3(Ra,_1);let d1=j1;if(u1){const O1=u1._f;O1&&(!O1.disabled&&ge$2(pc,_1,Dc(j1,O1)),d1=Pr$2(O1.ref)&&Be$2(j1)?"":j1,Mc(O1.ref)?[...O1.ref.options].forEach(U1=>U1.selected=d1.includes(U1.value)):O1.refs?qn$1(O1.ref)?O1.refs.length>1?O1.refs.forEach(U1=>(!U1.defaultChecked||!U1.disabled)&&(U1.checked=Array.isArray(d1)?!!d1.find(Q1=>Q1===U1.value):d1===U1.value)):O1.refs[0]&&(O1.refs[0].checked=!!d1):O1.refs.forEach(U1=>U1.checked=U1.value===d1):Fa(O1.ref)?O1.ref.value="":(O1.ref.value=d1,O1.ref.type||pf.values.next({name:_1,values:{...pc}})))}(P1.shouldDirty||P1.shouldTouch)&&l1(_1,d1,P1.shouldTouch,P1.shouldDirty,!0),P1.shouldValidate&&Z1(_1)},A1=(_1,j1,P1)=>{for(const u1 in j1){const d1=j1[u1],O1=`${_1}.${u1}`,U1=B$3(Ra,O1);(uf.array.has(_1)||Te$1(d1)||U1&&!U1._f)&&!Gt$2(d1)?A1(O1,d1,P1):T1(O1,d1,P1)}},L1=(_1,j1,P1={})=>{const u1=B$3(Ra,_1),d1=uf.array.has(_1),O1=De$2(j1);ge$2(pc,_1,O1),d1?(pf.array.next({name:_1,values:{...pc}}),(hf.isDirty||hf.dirtyFields)&&P1.shouldDirty&&pf.state.next({name:_1,dirtyFields:Cn$2(hc,pc),isDirty:$1(_1,O1)})):u1&&!u1._f&&!Be$2(O1)?A1(_1,O1,P1):T1(_1,O1,P1),ca$1(_1,uf)&&pf.state.next({...bo}),pf.values.next({name:mc.mount?_1:void 0,values:{...pc}})},B1=async _1=>{mc.mount=!0;const j1=_1.target;let P1=j1.name,u1=!0;const d1=B$3(Ra,P1),O1=()=>j1.type?No(d1._f):vc(_1),U1=Q1=>{u1=Number.isNaN(Q1)||Gt$2(Q1)&&isNaN(Q1.getTime())||Rt$2(Q1,B$3(pc,P1,Q1))};if(d1){let Q1,G1;const X1=O1(),K1=_1.type===Er$2.BLUR||_1.type===Er$2.FOCUS_OUT,tT=!Vf(d1._f)&&!Ai.resolver&&!B$3(bo.errors,P1)&&!d1._f.deps||Lf(K1,B$3(bo.touchedFields,P1),bo.isSubmitted,gf,mf),oT=ca$1(P1,uf,K1);ge$2(pc,P1,X1),K1?(d1._f.onBlur&&d1._f.onBlur(_1),df&&df(0)):d1._f.onChange&&d1._f.onChange(_1);const uT=l1(P1,X1,K1,!1),dT=!We$2(uT)||oT;if(!K1&&pf.values.next({name:P1,type:_1.type,values:{...pc}}),tT)return hf.isValid&&(Ai.mode==="onBlur"&&K1?bf():K1||bf()),dT&&pf.state.next({name:P1,...oT?{}:uT});if(!K1&&oT&&pf.state.next({...bo}),Ai.resolver){const{errors:cT}=await m1([P1]);if(U1(X1),u1){const pT=Ui(bo.errors,Ra,P1),hT=Ui(cT,Ra,pT.name||P1);Q1=hT.error,P1=hT.name,G1=We$2(cT)}}else Sf([P1],!0),Q1=(await la$1(d1,uf.disabled,pc,yf,Ai.shouldUseNativeValidation))[P1],Sf([P1]),U1(X1),u1&&(Q1?G1=!1:hf.isValid&&(G1=await N1(Ra,!0)));u1&&(d1._f.deps&&Z1(d1._f.deps),c1(P1,G1,Q1,uT))}},V1=(_1,j1)=>{if(B$3(bo.errors,j1)&&_1.focus)return _1.focus(),1},Z1=async(_1,j1={})=>{let P1,u1;const d1=Ge$2(_1);if(Ai.resolver){const O1=await k1(Se$1(_1)?_1:d1);P1=We$2(O1),u1=_1?!d1.some(U1=>B$3(O1,U1)):P1}else _1?(u1=(await Promise.all(d1.map(async O1=>{const U1=B$3(Ra,O1);return await N1(U1&&U1._f?{[O1]:U1}:U1)}))).every(Boolean),!(!u1&&!bo.isValid)&&bf()):u1=P1=await N1(Ra);return pf.state.next({...!ht$2(_1)||hf.isValid&&P1!==bo.isValid?{}:{name:_1},...Ai.resolver||!_1?{isValid:P1}:{},errors:bo.errors}),j1.shouldFocus&&!u1&&sn$1(Ra,V1,_1?d1:uf.mount),u1},H1=_1=>{const j1={...mc.mount?pc:hc};return Se$1(_1)?j1:ht$2(_1)?B$3(j1,_1):_1.map(P1=>B$3(j1,P1))},E1=(_1,j1)=>({invalid:!!B$3((j1||bo).errors,_1),isDirty:!!B$3((j1||bo).dirtyFields,_1),error:B$3((j1||bo).errors,_1),isValidating:!!B$3(bo.validatingFields,_1),isTouched:!!B$3((j1||bo).touchedFields,_1)}),F1=_1=>{_1&&Ge$2(_1).forEach(j1=>Oe$2(bo.errors,j1)),pf.state.next({errors:_1?bo.errors:{}})},M1=(_1,j1,P1)=>{const u1=(B$3(Ra,_1,{_f:{}})._f||{}).ref,d1=B$3(bo.errors,_1)||{},{ref:O1,message:U1,type:Q1,...G1}=d1;ge$2(bo.errors,_1,{...G1,...j1,ref:u1}),pf.state.next({name:_1,errors:bo.errors,isValid:!1}),P1&&P1.shouldFocus&&u1&&u1.focus&&u1.focus()},q1=(_1,j1)=>ft$2(_1)?pf.values.subscribe({next:P1=>_1(D1(void 0,j1),P1)}):D1(_1,j1,!0),z1=(_1,j1={})=>{for(const P1 of _1?Ge$2(_1):uf.mount)uf.mount.delete(P1),uf.array.delete(P1),j1.keepValue||(Oe$2(Ra,P1),Oe$2(pc,P1)),!j1.keepError&&Oe$2(bo.errors,P1),!j1.keepDirty&&Oe$2(bo.dirtyFields,P1),!j1.keepTouched&&Oe$2(bo.touchedFields,P1),!j1.keepIsValidating&&Oe$2(bo.validatingFields,P1),!Ai.shouldUnregister&&!j1.keepDefaultValue&&Oe$2(hc,P1);pf.values.next({values:{...pc}}),pf.state.next({...bo,...j1.keepDirty?{isDirty:$1()}:{}}),!j1.keepIsValid&&bf()},W1=({disabled:_1,name:j1,field:P1,fields:u1})=>{(Qe$2(_1)&&mc.mount||_1||uf.disabled.has(j1))&&(_1?uf.disabled.add(j1):uf.disabled.delete(j1),l1(j1,No(P1?P1._f:B$3(u1,j1)._f),!1,!1,!0))},J1=(_1,j1={})=>{let P1=B$3(Ra,_1);const u1=Qe$2(j1.disabled)||Qe$2(Ai.disabled);return ge$2(Ra,_1,{...P1||{},_f:{...P1&&P1._f?P1._f:{ref:{name:_1}},name:_1,mount:!0,...j1}}),uf.mount.add(_1),P1?W1({field:P1,disabled:Qe$2(j1.disabled)?j1.disabled:Ai.disabled,name:_1}):If(_1,!0,j1.value),{...u1?{disabled:j1.disabled||Ai.disabled}:{},...Ai.progressive?{required:!!j1.required,min:In$2(j1.min),max:In$2(j1.max),minLength:In$2(j1.minLength),maxLength:In$2(j1.maxLength),pattern:In$2(j1.pattern)}:{},name:_1,onChange:B1,onBlur:B1,ref:d1=>{if(d1){J1(_1,j1),P1=B$3(Ra,_1);const O1=Se$1(d1.value)&&d1.querySelectorAll&&d1.querySelectorAll("input,select,textarea")[0]||d1,U1=_f(O1),Q1=P1._f.refs||[];if(U1?Q1.find(G1=>G1===O1):O1===P1._f.ref)return;ge$2(Ra,_1,{_f:{...P1._f,...U1?{refs:[...Q1.filter(Mo$1),O1,...Array.isArray(B$3(hc,_1))?[{}]:[]],ref:{type:O1.type,name:_1}}:{ref:O1}}}),If(_1,!1,void 0,O1)}else P1=B$3(Ra,_1,{}),P1._f&&(P1._f.mount=!1),(Ai.shouldUnregister||j1.shouldUnregister)&&!(bc(uf.array,_1)&&mc.action)&&uf.unMount.add(_1)}}},eT=()=>Ai.shouldFocusError&&sn$1(Ra,V1,uf.mount),nT=_1=>{Qe$2(_1)&&(pf.state.next({disabled:_1}),sn$1(Ra,(j1,P1)=>{const u1=B$3(Ra,P1);u1&&(j1.disabled=u1._f.disabled||_1,Array.isArray(u1._f.refs)&&u1._f.refs.forEach(d1=>{d1.disabled=u1._f.disabled||_1}))},0,!1))},sT=(_1,j1)=>async P1=>{let u1;P1&&(P1.preventDefault&&P1.preventDefault(),P1.persist&&P1.persist());let d1=De$2(pc);if(uf.disabled.size)for(const O1 of uf.disabled)ge$2(d1,O1,void 0);if(pf.state.next({isSubmitting:!0}),Ai.resolver){const{errors:O1,values:U1}=await m1();bo.errors=O1,d1=U1}else await N1(Ra);if(Oe$2(bo.errors,"root"),We$2(bo.errors)){pf.state.next({errors:{}});try{await _1(d1,P1)}catch(O1){u1=O1}}else j1&&await j1({...bo.errors},P1),eT(),setTimeout(eT);if(pf.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:We$2(bo.errors)&&!u1,submitCount:bo.submitCount+1,errors:bo.errors}),u1)throw u1},iT=(_1,j1={})=>{B$3(Ra,_1)&&(Se$1(j1.defaultValue)?L1(_1,De$2(B$3(hc,_1))):(L1(_1,j1.defaultValue),ge$2(hc,_1,De$2(j1.defaultValue))),j1.keepTouched||Oe$2(bo.touchedFields,_1),j1.keepDirty||(Oe$2(bo.dirtyFields,_1),bo.isDirty=j1.defaultValue?$1(_1,De$2(B$3(hc,_1))):$1()),j1.keepError||(Oe$2(bo.errors,_1),hf.isValid&&bf()),pf.state.next({...bo}))},rT=(_1,j1={})=>{const P1=_1?De$2(_1):hc,u1=De$2(P1),d1=We$2(_1),O1=d1?hc:u1;if(j1.keepDefaultValues||(hc=P1),!j1.keepValues){if(j1.keepDirtyValues){const U1=new Set([...uf.mount,...Object.keys(Cn$2(hc,pc))]);for(const Q1 of Array.from(U1))B$3(bo.dirtyFields,Q1)?ge$2(O1,Q1,B$3(pc,Q1)):L1(Q1,B$3(O1,Q1))}else{if(_a$1&&Se$1(_1))for(const U1 of uf.mount){const Q1=B$3(Ra,U1);if(Q1&&Q1._f){const G1=Array.isArray(Q1._f.refs)?Q1._f.refs[0]:Q1._f.ref;if(Pr$2(G1)){const X1=G1.closest("form");if(X1){X1.reset();break}}}}Ra={}}pc=Ai.shouldUnregister?j1.keepDefaultValues?De$2(hc):{}:De$2(O1),pf.array.next({values:{...O1}}),pf.values.next({values:{...O1}})}uf={mount:j1.keepDirtyValues?uf.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},mc.mount=!hf.isValid||!!j1.keepIsValid||!!j1.keepDirtyValues,mc.watch=!!Ai.shouldUnregister,pf.state.next({submitCount:j1.keepSubmitCount?bo.submitCount:0,isDirty:d1?!1:j1.keepDirty?bo.isDirty:!!(j1.keepDefaultValues&&!Rt$2(_1,hc)),isSubmitted:j1.keepIsSubmitted?bo.isSubmitted:!1,dirtyFields:d1?{}:j1.keepDirtyValues?j1.keepDefaultValues&&pc?Cn$2(hc,pc):bo.dirtyFields:j1.keepDefaultValues&&_1?Cn$2(hc,_1):j1.keepDirty?bo.dirtyFields:{},touchedFields:j1.keepTouched?bo.touchedFields:{},errors:j1.keepErrors?bo.errors:{},isSubmitSuccessful:j1.keepIsSubmitSuccessful?bo.isSubmitSuccessful:!1,isSubmitting:!1})},lT=(_1,j1)=>rT(ft$2(_1)?_1(pc):_1,j1);return{control:{register:J1,unregister:z1,getFieldState:E1,handleSubmit:sT,setError:M1,_executeSchema:m1,_getWatch:D1,_getDirty:$1,_updateValid:bf,_removeUnmounted:R1,_updateFieldArray:xf,_updateDisabledField:W1,_getFieldArray:f1,_reset:rT,_resetDefaultValues:()=>ft$2(Ai.defaultValues)&&Ai.defaultValues().then(_1=>{lT(_1,Ai.resetOptions),pf.state.next({isLoading:!1})}),_updateFormState:_1=>{bo={...bo,..._1}},_disableForm:nT,_subjects:pf,_proxyFormState:hf,_setErrors:s1,get _fields(){return Ra},get _formValues(){return pc},get _state(){return mc},set _state(_1){mc=_1},get _defaultValues(){return hc},get _names(){return uf},set _names(_1){uf=_1},get _formState(){return bo},set _formState(_1){bo=_1},get _options(){return Ai},set _options(_1){Ai={...Ai,..._1}}},trigger:Z1,register:J1,handleSubmit:sT,watch:q1,setValue:L1,getValues:H1,reset:lT,resetField:iT,clearErrors:F1,unregister:z1,setError:M1,setFocus:(_1,j1={})=>{const P1=B$3(Ra,_1),u1=P1&&P1._f;if(u1){const d1=u1.refs?u1.refs[0]:u1.ref;d1.focus&&(d1.focus(),j1.shouldSelect&&ft$2(d1.select)&&d1.select())}},getFieldState:E1}}function Wf(vo={}){const Ai=y__default.useRef(void 0),bo=y__default.useRef(void 0),[Ra,hc]=y__default.useState({isDirty:!1,isValidating:!1,isLoading:ft$2(vo.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:vo.errors||{},disabled:vo.disabled||!1,defaultValues:ft$2(vo.defaultValues)?void 0:vo.defaultValues});Ai.current||(Ai.current={...Hf(vo),formState:Ra});const pc=Ai.current.control;return pc._options=vo,Gr$2({subject:pc._subjects.state,next:mc=>{Sc(mc,pc._proxyFormState,pc._updateFormState,!0)&&hc({...pc._formState})}}),y__default.useEffect(()=>pc._disableForm(vo.disabled),[pc,vo.disabled]),y__default.useEffect(()=>{if(pc._proxyFormState.isDirty){const mc=pc._getDirty();mc!==Ra.isDirty&&pc._subjects.state.next({isDirty:mc})}},[pc,Ra.isDirty]),y__default.useEffect(()=>{vo.values&&!Rt$2(vo.values,bo.current)?(pc._reset(vo.values,pc._options.resetOptions),bo.current=vo.values,hc(mc=>({...mc}))):pc._resetDefaultValues()},[vo.values,pc]),y__default.useEffect(()=>{vo.errors&&pc._setErrors(vo.errors)},[vo.errors,pc]),y__default.useEffect(()=>{pc._state.mount||(pc._updateValid(),pc._state.mount=!0),pc._state.watch&&(pc._state.watch=!1,pc._subjects.state.next({...pc._formState})),pc._removeUnmounted()}),y__default.useEffect(()=>{vo.shouldUnregister&&pc._subjects.values.next({values:pc._getWatch()})},[vo.shouldUnregister,pc]),Ai.current.formState=xc(Ra,pc),Ai.current}function Hi(vo,Ai){if(typeof vo=="function")return vo(Ai);vo!=null&&(vo.current=Ai)}function qr$2(...vo){return Ai=>{let bo=!1;const Ra=vo.map(hc=>{const pc=Hi(hc,Ai);return!bo&&typeof pc=="function"&&(bo=!0),pc});if(bo)return()=>{for(let hc=0;hc<Ra.length;hc++){const pc=Ra[hc];typeof pc=="function"?pc():Hi(vo[hc],null)}}}}function Fe$2(...vo){return y$2.useCallback(qr$2(...vo),vo)}var mn$1=y$2.forwardRef((vo,Ai)=>{const{children:bo,...Ra}=vo,hc=y$2.Children.toArray(bo),pc=hc.find(Bf);if(pc){const mc=pc.props.children,uf=hc.map(df=>df===pc?y$2.Children.count(mc)>1?y$2.Children.only(null):y$2.isValidElement(mc)?mc.props.children:null:df);return jsx(da$1,{...Ra,ref:Ai,children:y$2.isValidElement(mc)?y$2.cloneElement(mc,void 0,uf):null})}return jsx(da$1,{...Ra,ref:Ai,children:bo})});mn$1.displayName="Slot";var da$1=y$2.forwardRef((vo,Ai)=>{const{children:bo,...Ra}=vo;if(y$2.isValidElement(bo)){const hc=jf(bo);return y$2.cloneElement(bo,{...zf(Ra,bo.props),ref:Ai?qr$2(Ai,hc):hc})}return y$2.Children.count(bo)>1?y$2.Children.only(null):null});da$1.displayName="SlotClone";var Rc=({children:vo})=>jsx(Fragment,{children:vo});function Bf(vo){return y$2.isValidElement(vo)&&vo.type===Rc}function zf(vo,Ai){const bo={...Ai};for(const Ra in Ai){const hc=vo[Ra],pc=Ai[Ra];/^on[A-Z]/.test(Ra)?hc&&pc?bo[Ra]=(...mc)=>{pc(...mc),hc(...mc)}:hc&&(bo[Ra]=hc):Ra==="style"?bo[Ra]={...hc,...pc}:Ra==="className"&&(bo[Ra]=[hc,pc].filter(Boolean).join(" "))}return{...vo,...bo}}function jf(vo){var Ai,bo;let Ra=(Ai=Object.getOwnPropertyDescriptor(vo.props,"ref"))==null?void 0:Ai.get,hc=Ra&&"isReactWarning"in Ra&&Ra.isReactWarning;return hc?vo.ref:(Ra=(bo=Object.getOwnPropertyDescriptor(vo,"ref"))==null?void 0:bo.get,hc=Ra&&"isReactWarning"in Ra&&Ra.isReactWarning,hc?vo.props.ref:vo.props.ref||vo.ref)}var Yf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],we$1=Yf.reduce((vo,Ai)=>{const bo=y$2.forwardRef((Ra,hc)=>{const{asChild:pc,...mc}=Ra,uf=pc?mn$1:Ai;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsx(uf,{...mc,ref:hc})});return bo.displayName=`Primitive.${Ai}`,{...vo,[Ai]:bo}},{});function _c(vo,Ai){vo&&jl$1.flushSync(()=>vo.dispatchEvent(Ai))}function kc(vo){var Ai,bo,Ra="";if(typeof vo=="string"||typeof vo=="number")Ra+=vo;else if(typeof vo=="object")if(Array.isArray(vo)){var hc=vo.length;for(Ai=0;Ai<hc;Ai++)vo[Ai]&&(bo=kc(vo[Ai]))&&(Ra&&(Ra+=" "),Ra+=bo)}else for(bo in vo)vo[bo]&&(Ra&&(Ra+=" "),Ra+=bo);return Ra}function h1(){for(var vo,Ai,bo=0,Ra="",hc=arguments.length;bo<hc;bo++)(vo=arguments[bo])&&(Ai=kc(vo))&&(Ra&&(Ra+=" "),Ra+=Ai);return Ra}const La="-",Gf=vo=>{const Ai=Xf(vo),{conflictingClassGroups:bo,conflictingClassGroupModifiers:Ra}=vo;return{getClassGroupId:hc=>{const pc=hc.split(La);return pc[0]===""&&pc.length!==1&&pc.shift(),Fc(pc,Ai)||qf(hc)},getConflictingClassGroupIds:(hc,pc)=>{const mc=bo[hc]||[];return pc&&Ra[hc]?[...mc,...Ra[hc]]:mc}}},Fc=(vo,Ai)=>{var bo;if(vo.length===0)return Ai.classGroupId;const Ra=vo[0],hc=Ai.nextPart.get(Ra),pc=hc?Fc(vo.slice(1),hc):void 0;if(pc)return pc;if(Ai.validators.length===0)return;const mc=vo.join(La);return(bo=Ai.validators.find(({validator:uf})=>uf(mc)))==null?void 0:bo.classGroupId},Wi=/^\[(.+)\]$/,qf=vo=>{if(Wi.test(vo)){const Ai=Wi.exec(vo)[1],bo=Ai==null?void 0:Ai.substring(0,Ai.indexOf(":"));if(bo)return"arbitrary.."+bo}},Xf=vo=>{const{theme:Ai,prefix:bo}=vo,Ra={nextPart:new Map,validators:[]};return Zf(Object.entries(vo.classGroups),bo).forEach(([hc,pc])=>{fa(pc,Ra,hc,Ai)}),Ra},fa=(vo,Ai,bo,Ra)=>{vo.forEach(hc=>{if(typeof hc=="string"){const pc=hc===""?Ai:Bi(Ai,hc);pc.classGroupId=bo;return}if(typeof hc=="function"){if(Kf(hc)){fa(hc(Ra),Ai,bo,Ra);return}Ai.validators.push({validator:hc,classGroupId:bo});return}Object.entries(hc).forEach(([pc,mc])=>{fa(mc,Bi(Ai,pc),bo,Ra)})})},Bi=(vo,Ai)=>{let bo=vo;return Ai.split(La).forEach(Ra=>{bo.nextPart.has(Ra)||bo.nextPart.set(Ra,{nextPart:new Map,validators:[]}),bo=bo.nextPart.get(Ra)}),bo},Kf=vo=>vo.isThemeGetter,Zf=(vo,Ai)=>Ai?vo.map(([bo,Ra])=>{const hc=Ra.map(pc=>typeof pc=="string"?Ai+pc:typeof pc=="object"?Object.fromEntries(Object.entries(pc).map(([mc,uf])=>[Ai+mc,uf])):pc);return[bo,hc]}):vo,Qf=vo=>{if(vo<1)return{get:()=>{},set:()=>{}};let Ai=0,bo=new Map,Ra=new Map;const hc=(pc,mc)=>{bo.set(pc,mc),Ai++,Ai>vo&&(Ai=0,Ra=bo,bo=new Map)};return{get(pc){let mc=bo.get(pc);if(mc!==void 0)return mc;if((mc=Ra.get(pc))!==void 0)return hc(pc,mc),mc},set(pc,mc){bo.has(pc)?bo.set(pc,mc):hc(pc,mc)}}},Vc="!",Jf=vo=>{const{separator:Ai,experimentalParseClassName:bo}=vo,Ra=Ai.length===1,hc=Ai[0],pc=Ai.length,mc=uf=>{const df=[];let ff=0,hf=0,pf;for(let bf=0;bf<uf.length;bf++){let Sf=uf[bf];if(ff===0){if(Sf===hc&&(Ra||uf.slice(bf,bf+pc)===Ai)){df.push(uf.slice(hf,bf)),hf=bf+pc;continue}if(Sf==="/"){pf=bf;continue}}Sf==="["?ff++:Sf==="]"&&ff--}const mf=df.length===0?uf:uf.substring(hf),gf=mf.startsWith(Vc),yf=gf?mf.substring(1):mf,vf=pf&&pf>hf?pf-hf:void 0;return{modifiers:df,hasImportantModifier:gf,baseClassName:yf,maybePostfixModifierPosition:vf}};return bo?uf=>bo({className:uf,parseClassName:mc}):mc},em=vo=>{if(vo.length<=1)return vo;const Ai=[];let bo=[];return vo.forEach(Ra=>{Ra[0]==="["?(Ai.push(...bo.sort(),Ra),bo=[]):bo.push(Ra)}),Ai.push(...bo.sort()),Ai},tm=vo=>({cache:Qf(vo.cacheSize),parseClassName:Jf(vo),...Gf(vo)}),nm=/\s+/,rm$2=(vo,Ai)=>{const{parseClassName:bo,getClassGroupId:Ra,getConflictingClassGroupIds:hc}=Ai,pc=[],mc=vo.trim().split(nm);let uf="";for(let df=mc.length-1;df>=0;df-=1){const ff=mc[df],{modifiers:hf,hasImportantModifier:pf,baseClassName:mf,maybePostfixModifierPosition:gf}=bo(ff);let yf=!!gf,vf=Ra(yf?mf.substring(0,gf):mf);if(!vf){if(!yf){uf=ff+(uf.length>0?" "+uf:uf);continue}if(vf=Ra(mf),!vf){uf=ff+(uf.length>0?" "+uf:uf);continue}yf=!1}const bf=em(hf).join(":"),Sf=pf?bf+Vc:bf,xf=Sf+vf;if(pc.includes(xf))continue;pc.push(xf);const wf=hc(vf,yf);for(let s1=0;s1<wf.length;++s1){const If=wf[s1];pc.push(Sf+If)}uf=ff+(uf.length>0?" "+uf:uf)}return uf};function Xr$1(){let vo=0,Ai,bo,Ra="";for(;vo<arguments.length;)(Ai=arguments[vo++])&&(bo=Lc(Ai))&&(Ra&&(Ra+=" "),Ra+=bo);return Ra}const Lc=vo=>{if(typeof vo=="string")return vo;let Ai,bo="";for(let Ra=0;Ra<vo.length;Ra++)vo[Ra]&&(Ai=Lc(vo[Ra]))&&(bo&&(bo+=" "),bo+=Ai);return bo};function om(vo,...Ai){let bo,Ra,hc,pc=mc;function mc(df){const ff=Ai.reduce((hf,pf)=>pf(hf),vo());return bo=tm(ff),Ra=bo.cache.get,hc=bo.cache.set,pc=uf,uf(df)}function uf(df){const ff=Ra(df);if(ff)return ff;const hf=rm$2(df,bo);return hc(df,hf),hf}return function(){return pc(Xr$1.apply(null,arguments))}}const xe$1=vo=>{const Ai=bo=>bo[vo]||[];return Ai.isThemeGetter=!0,Ai},$c=/^\[(?:([a-z-]+):)?(.+)\]$/i,am=/^\d+\/\d+$/,im=new Set(["px","full","screen"]),sm=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cm=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,lm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,um=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dm=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xt$2=vo=>cn$2(vo)||im.has(vo)||am.test(vo),Ot$1=vo=>vn$2(vo,"length",ym),cn$2=vo=>!!vo&&!Number.isNaN(Number(vo)),Ao=vo=>vn$2(vo,"number",cn$2),En$2=vo=>!!vo&&Number.isInteger(Number(vo)),fm=vo=>vo.endsWith("%")&&cn$2(vo.slice(0,-1)),ie$3=vo=>$c.test(vo),Mt$2=vo=>sm.test(vo),mm=new Set(["length","size","percentage"]),pm=vo=>vn$2(vo,mm,Uc),hm=vo=>vn$2(vo,"position",Uc),gm=new Set(["image","url"]),vm=vo=>vn$2(vo,gm,xm),bm=vo=>vn$2(vo,"",wm),Pn$2=()=>!0,vn$2=(vo,Ai,bo)=>{const Ra=$c.exec(vo);return Ra?Ra[1]?typeof Ai=="string"?Ra[1]===Ai:Ai.has(Ra[1]):bo(Ra[2]):!1},ym=vo=>cm.test(vo)&&!lm.test(vo),Uc=()=>!1,wm=vo=>um.test(vo),xm=vo=>dm.test(vo),Sm=()=>{const vo=xe$1("colors"),Ai=xe$1("spacing"),bo=xe$1("blur"),Ra=xe$1("brightness"),hc=xe$1("borderColor"),pc=xe$1("borderRadius"),mc=xe$1("borderSpacing"),uf=xe$1("borderWidth"),df=xe$1("contrast"),ff=xe$1("grayscale"),hf=xe$1("hueRotate"),pf=xe$1("invert"),mf=xe$1("gap"),gf=xe$1("gradientColorStops"),yf=xe$1("gradientColorStopPositions"),vf=xe$1("inset"),bf=xe$1("margin"),Sf=xe$1("opacity"),xf=xe$1("padding"),wf=xe$1("saturate"),s1=xe$1("scale"),If=xe$1("sepia"),l1=xe$1("skew"),c1=xe$1("space"),m1=xe$1("translate"),k1=()=>["auto","contain","none"],N1=()=>["auto","hidden","clip","visible","scroll"],R1=()=>["auto",ie$3,Ai],$1=()=>[ie$3,Ai],D1=()=>["",xt$2,Ot$1],f1=()=>["auto",cn$2,ie$3],T1=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],A1=()=>["solid","dashed","dotted","double","none"],L1=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B1=()=>["start","end","center","between","around","evenly","stretch"],V1=()=>["","0",ie$3],Z1=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H1=()=>[cn$2,ie$3];return{cacheSize:500,separator:":",theme:{colors:[Pn$2],spacing:[xt$2,Ot$1],blur:["none","",Mt$2,ie$3],brightness:H1(),borderColor:[vo],borderRadius:["none","","full",Mt$2,ie$3],borderSpacing:$1(),borderWidth:D1(),contrast:H1(),grayscale:V1(),hueRotate:H1(),invert:V1(),gap:$1(),gradientColorStops:[vo],gradientColorStopPositions:[fm,Ot$1],inset:R1(),margin:R1(),opacity:H1(),padding:$1(),saturate:H1(),scale:H1(),sepia:V1(),skew:H1(),space:$1(),translate:$1()},classGroups:{aspect:[{aspect:["auto","square","video",ie$3]}],container:["container"],columns:[{columns:[Mt$2]}],"break-after":[{"break-after":Z1()}],"break-before":[{"break-before":Z1()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...T1(),ie$3]}],overflow:[{overflow:N1()}],"overflow-x":[{"overflow-x":N1()}],"overflow-y":[{"overflow-y":N1()}],overscroll:[{overscroll:k1()}],"overscroll-x":[{"overscroll-x":k1()}],"overscroll-y":[{"overscroll-y":k1()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[vf]}],"inset-x":[{"inset-x":[vf]}],"inset-y":[{"inset-y":[vf]}],start:[{start:[vf]}],end:[{end:[vf]}],top:[{top:[vf]}],right:[{right:[vf]}],bottom:[{bottom:[vf]}],left:[{left:[vf]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",En$2,ie$3]}],basis:[{basis:R1()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ie$3]}],grow:[{grow:V1()}],shrink:[{shrink:V1()}],order:[{order:["first","last","none",En$2,ie$3]}],"grid-cols":[{"grid-cols":[Pn$2]}],"col-start-end":[{col:["auto",{span:["full",En$2,ie$3]},ie$3]}],"col-start":[{"col-start":f1()}],"col-end":[{"col-end":f1()}],"grid-rows":[{"grid-rows":[Pn$2]}],"row-start-end":[{row:["auto",{span:[En$2,ie$3]},ie$3]}],"row-start":[{"row-start":f1()}],"row-end":[{"row-end":f1()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ie$3]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ie$3]}],gap:[{gap:[mf]}],"gap-x":[{"gap-x":[mf]}],"gap-y":[{"gap-y":[mf]}],"justify-content":[{justify:["normal",...B1()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...B1(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...B1(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[xf]}],px:[{px:[xf]}],py:[{py:[xf]}],ps:[{ps:[xf]}],pe:[{pe:[xf]}],pt:[{pt:[xf]}],pr:[{pr:[xf]}],pb:[{pb:[xf]}],pl:[{pl:[xf]}],m:[{m:[bf]}],mx:[{mx:[bf]}],my:[{my:[bf]}],ms:[{ms:[bf]}],me:[{me:[bf]}],mt:[{mt:[bf]}],mr:[{mr:[bf]}],mb:[{mb:[bf]}],ml:[{ml:[bf]}],"space-x":[{"space-x":[c1]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[c1]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ie$3,Ai]}],"min-w":[{"min-w":[ie$3,Ai,"min","max","fit"]}],"max-w":[{"max-w":[ie$3,Ai,"none","full","min","max","fit","prose",{screen:[Mt$2]},Mt$2]}],h:[{h:[ie$3,Ai,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ie$3,Ai,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ie$3,Ai,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ie$3,Ai,"auto","min","max","fit"]}],"font-size":[{text:["base",Mt$2,Ot$1]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ao]}],"font-family":[{font:[Pn$2]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ie$3]}],"line-clamp":[{"line-clamp":["none",cn$2,Ao]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",xt$2,ie$3]}],"list-image":[{"list-image":["none",ie$3]}],"list-style-type":[{list:["none","disc","decimal",ie$3]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[vo]}],"placeholder-opacity":[{"placeholder-opacity":[Sf]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[vo]}],"text-opacity":[{"text-opacity":[Sf]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...A1(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",xt$2,Ot$1]}],"underline-offset":[{"underline-offset":["auto",xt$2,ie$3]}],"text-decoration-color":[{decoration:[vo]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$1()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ie$3]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ie$3]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[Sf]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...T1(),hm]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",pm]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},vm]}],"bg-color":[{bg:[vo]}],"gradient-from-pos":[{from:[yf]}],"gradient-via-pos":[{via:[yf]}],"gradient-to-pos":[{to:[yf]}],"gradient-from":[{from:[gf]}],"gradient-via":[{via:[gf]}],"gradient-to":[{to:[gf]}],rounded:[{rounded:[pc]}],"rounded-s":[{"rounded-s":[pc]}],"rounded-e":[{"rounded-e":[pc]}],"rounded-t":[{"rounded-t":[pc]}],"rounded-r":[{"rounded-r":[pc]}],"rounded-b":[{"rounded-b":[pc]}],"rounded-l":[{"rounded-l":[pc]}],"rounded-ss":[{"rounded-ss":[pc]}],"rounded-se":[{"rounded-se":[pc]}],"rounded-ee":[{"rounded-ee":[pc]}],"rounded-es":[{"rounded-es":[pc]}],"rounded-tl":[{"rounded-tl":[pc]}],"rounded-tr":[{"rounded-tr":[pc]}],"rounded-br":[{"rounded-br":[pc]}],"rounded-bl":[{"rounded-bl":[pc]}],"border-w":[{border:[uf]}],"border-w-x":[{"border-x":[uf]}],"border-w-y":[{"border-y":[uf]}],"border-w-s":[{"border-s":[uf]}],"border-w-e":[{"border-e":[uf]}],"border-w-t":[{"border-t":[uf]}],"border-w-r":[{"border-r":[uf]}],"border-w-b":[{"border-b":[uf]}],"border-w-l":[{"border-l":[uf]}],"border-opacity":[{"border-opacity":[Sf]}],"border-style":[{border:[...A1(),"hidden"]}],"divide-x":[{"divide-x":[uf]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[uf]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[Sf]}],"divide-style":[{divide:A1()}],"border-color":[{border:[hc]}],"border-color-x":[{"border-x":[hc]}],"border-color-y":[{"border-y":[hc]}],"border-color-s":[{"border-s":[hc]}],"border-color-e":[{"border-e":[hc]}],"border-color-t":[{"border-t":[hc]}],"border-color-r":[{"border-r":[hc]}],"border-color-b":[{"border-b":[hc]}],"border-color-l":[{"border-l":[hc]}],"divide-color":[{divide:[hc]}],"outline-style":[{outline:["",...A1()]}],"outline-offset":[{"outline-offset":[xt$2,ie$3]}],"outline-w":[{outline:[xt$2,Ot$1]}],"outline-color":[{outline:[vo]}],"ring-w":[{ring:D1()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[vo]}],"ring-opacity":[{"ring-opacity":[Sf]}],"ring-offset-w":[{"ring-offset":[xt$2,Ot$1]}],"ring-offset-color":[{"ring-offset":[vo]}],shadow:[{shadow:["","inner","none",Mt$2,bm]}],"shadow-color":[{shadow:[Pn$2]}],opacity:[{opacity:[Sf]}],"mix-blend":[{"mix-blend":[...L1(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":L1()}],filter:[{filter:["","none"]}],blur:[{blur:[bo]}],brightness:[{brightness:[Ra]}],contrast:[{contrast:[df]}],"drop-shadow":[{"drop-shadow":["","none",Mt$2,ie$3]}],grayscale:[{grayscale:[ff]}],"hue-rotate":[{"hue-rotate":[hf]}],invert:[{invert:[pf]}],saturate:[{saturate:[wf]}],sepia:[{sepia:[If]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[bo]}],"backdrop-brightness":[{"backdrop-brightness":[Ra]}],"backdrop-contrast":[{"backdrop-contrast":[df]}],"backdrop-grayscale":[{"backdrop-grayscale":[ff]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[hf]}],"backdrop-invert":[{"backdrop-invert":[pf]}],"backdrop-opacity":[{"backdrop-opacity":[Sf]}],"backdrop-saturate":[{"backdrop-saturate":[wf]}],"backdrop-sepia":[{"backdrop-sepia":[If]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[mc]}],"border-spacing-x":[{"border-spacing-x":[mc]}],"border-spacing-y":[{"border-spacing-y":[mc]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ie$3]}],duration:[{duration:H1()}],ease:[{ease:["linear","in","out","in-out",ie$3]}],delay:[{delay:H1()}],animate:[{animate:["none","spin","ping","pulse","bounce",ie$3]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[s1]}],"scale-x":[{"scale-x":[s1]}],"scale-y":[{"scale-y":[s1]}],rotate:[{rotate:[En$2,ie$3]}],"translate-x":[{"translate-x":[m1]}],"translate-y":[{"translate-y":[m1]}],"skew-x":[{"skew-x":[l1]}],"skew-y":[{"skew-y":[l1]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ie$3]}],accent:[{accent:["auto",vo]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ie$3]}],"caret-color":[{caret:[vo]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$1()}],"scroll-mx":[{"scroll-mx":$1()}],"scroll-my":[{"scroll-my":$1()}],"scroll-ms":[{"scroll-ms":$1()}],"scroll-me":[{"scroll-me":$1()}],"scroll-mt":[{"scroll-mt":$1()}],"scroll-mr":[{"scroll-mr":$1()}],"scroll-mb":[{"scroll-mb":$1()}],"scroll-ml":[{"scroll-ml":$1()}],"scroll-p":[{"scroll-p":$1()}],"scroll-px":[{"scroll-px":$1()}],"scroll-py":[{"scroll-py":$1()}],"scroll-ps":[{"scroll-ps":$1()}],"scroll-pe":[{"scroll-pe":$1()}],"scroll-pt":[{"scroll-pt":$1()}],"scroll-pr":[{"scroll-pr":$1()}],"scroll-pb":[{"scroll-pb":$1()}],"scroll-pl":[{"scroll-pl":$1()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ie$3]}],fill:[{fill:[vo,"none"]}],"stroke-w":[{stroke:[xt$2,Ot$1,Ao]}],stroke:[{stroke:[vo,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Ne$1=om(Sm),zi=["😀","😂","🤣","😍","😎","😊","🙃","😇","🤔","🥳","🤯","🤗","😱","👻","🎃","🐱","🐶","🐹","🦊","🐻","🐼","🐨","🐯","🦁","🐸","🐵","🐔","🐧","🐦","🐤","🐝","🐞","🐟","🐬","🐳","🦋","🌺","🌸","🌼","🍀"];function Cm(vo){function Ai(Ra){let hc=0;for(let pc=0;pc<Ra.length;pc++){const mc=Ra.charCodeAt(pc);hc=(hc<<5)-hc+mc,hc|=0}return Math.abs(hc)}const bo=Ai(vo);return zi[bo%zi.length]}const Im=vo=>{switch(vo){case"HEART":return"❤️";case"THUMBS_UP":return"👍";case"THUMBS_DOWN":return"👎";case"LAUGH":return"😂";case"CRY":return"😢";default:return"❤️"}},Em=vo=>{switch(vo){case"HEART":return"heart";case"THUMBS_UP":return"thumbsUp";case"THUMBS_DOWN":return"thumbsDown";case"LAUGH":return"laughing";case"CRY":return"cry";default:return"heart"}},Pm=vo=>{switch(vo){case"heart":return"HEART";case"thumbsUp":return"THUMBS_UP";case"thumbsDown":return"THUMBS_DOWN";case"laughing":return"LAUGH";case"cry":return"CRY";default:return"HEART"}},Tm=vo=>(vo||[]).map(Ai=>({emoji:Im(Ai.type),reactedBy:Ai.reactedBy,type:Em(Ai.type)})).filter(Ai=>Ai.reactedBy.length>0),Om=vo=>{const{imgUrl:Ai,userName:bo}=vo;return jsx("div",{style:{width:"40px",height:"40px",borderRadius:"10px",overflow:"hidden",backgroundColor:"#f0f0f0",display:"flex",justifyContent:"center",alignItems:"center"},children:Ai?jsx("img",{alt:"avatar",src:Ai}):jsx("span",{style:{fontSize:"24px"},children:Cm(bo)})})},Mm=vo=>{const{bgColor:Ai,reaction:bo,textColor:Ra,onClick:hc,disabled:pc=!1}=vo;return jsxs("div",{style:{display:"flex",alignItems:"center",userSelect:"none"},children:[jsx("div",{onClick:()=>{!pc&&hc&&hc()},style:{width:"20px",height:"20px",fontSize:"12px",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:Ai,borderRadius:"50%",marginRight:"4px",textAlign:"center",cursor:pc?"default":"pointer"},children:bo.emoji}),jsx("div",{style:{display:"flex",alignItems:"center",fontSize:"12px",color:Ra,fontWeight:"bold"},children:bo.reactedBy.length})]})},Nm=vo=>{const{message:Ai,userName:bo,timestamp:Ra,reactions:hc,isCurrentUser:pc,onClickReaction:mc,disabled:uf=!1}=vo,df=new Date(Ra).toLocaleTimeString(),ff=pc?"#7678ed":"#eeeef8",hf=pc?"#eeeef8":"#cfcff6",pf=pc?"white":"black";return jsxs("div",{style:{display:"flex"},children:[!pc&&jsx("div",{style:{width:"12px",height:"20px",backgroundColor:"#eeeef8",alignSelf:"flex-end"},children:jsx("div",{style:{width:"12px",height:"20px",backgroundColor:"white",borderBottomRightRadius:"40px"}})}),jsxs("div",{style:{backgroundColor:ff,color:pc?"white":"black",display:"flex",flexDirection:"column",padding:"8px",fontSize:"14px",borderRadius:"8px",maxWidth:"600px",borderBottomRightRadius:pc?"0px":"8px",borderBottomLeftRadius:pc?"8px":"0px"},children:[!pc&&jsxs("div",{style:{color:"#36377c",fontSize:"12px",marginBottom:"4px",fontWeight:"bold"},children:[bo,":"]}),jsx("div",{children:Ai}),jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"10px",marginTop:"8px",alignItems:"flex-end",gap:"30px"},children:[jsx("div",{style:{display:"flex",gap:"10px"},children:(hc||[]).map(mf=>jsx(Mm,{bgColor:hf,disabled:uf,onClick:()=>mc&&mc({messageId:vo.id,...mf}),reaction:mf,textColor:pf},mf.type))}),jsx("div",{children:df})]})]}),pc?jsx("div",{style:{width:"12px",height:"20px",backgroundColor:"#7678ed",alignSelf:"flex-end"},children:jsx("div",{style:{width:"12px",height:"20px",backgroundColor:"white",borderBottomLeftRadius:"40px"}})}):null]})};function Am(vo){return vo?typeof vo=="number"?{width:vo.toString()+"px",height:vo.toString()+"px"}:{width:vo,height:vo}:{}}const Dm=(vo,Ai,bo)=>{const Ra=vo[Ai];return Ra?typeof Ra=="function"?Ra():Promise.resolve(Ra):new Promise((hc,pc)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(pc.bind(null,new Error("Unknown variable dynamic import: "+Ai+(Ai.split("/").length!==bo?". Note that variables only represent file names one level deep.":""))))})};function Rm(vo){return jsx("div",{style:{width:vo.width,height:vo.height}})}function _m(vo){try{return lazy(()=>Dm(Object.assign({"../../../assets/icon-components/ArrowFilledRight.tsx":()=>__vitePreload(()=>import("./ArrowFilledRight-blx8xu7X-D3d8PUWh.js"),[]),"../../../assets/icon-components/ArrowLeft.tsx":()=>__vitePreload(()=>import("./ArrowLeft-7pYNK4eX-8ZR_YHAJ.js"),[]),"../../../assets/icon-components/ArrowUp.tsx":()=>__vitePreload(()=>import("./ArrowUp-Bbr_dwo_-C5ppCQo4.js"),[]),"../../../assets/icon-components/BarChart.tsx":()=>__vitePreload(()=>import("./BarChart-B0G05Nfd-CHDJ7OaJ.js"),[]),"../../../assets/icon-components/BaseArrowLeft.tsx":()=>__vitePreload(()=>import("./BaseArrowLeft-DBzhFHMt-Dkbf2sWs.js"),[]),"../../../assets/icon-components/BaseArrowRight.tsx":()=>__vitePreload(()=>import("./BaseArrowRight-DYQTBWAs-CkkPllYm.js"),[]),"../../../assets/icon-components/Braces.tsx":()=>__vitePreload(()=>import("./Braces-N-sH2Zyc-3LcexUsR.js"),[]),"../../../assets/icon-components/Branch.tsx":()=>__vitePreload(()=>import("./Branch-CWdBw1_P-CmGdOXsI.js"),[]),"../../../assets/icon-components/BrickGlobe.tsx":()=>__vitePreload(()=>import("./BrickGlobe-67zaG6_H-DP0By6z_.js"),[]),"../../../assets/icon-components/Briefcase.tsx":()=>__vitePreload(()=>import("./Briefcase-CedW3KRR-DO5_k15F.js"),[]),"../../../assets/icon-components/Calendar.tsx":()=>__vitePreload(()=>import("./Calendar-C-6HV96D-YetudWvP.js"),[]),"../../../assets/icon-components/Caret.tsx":()=>__vitePreload(()=>import("./Caret-Ep0j0fz2-By3ojfim.js"),[]),"../../../assets/icon-components/CaretDown.tsx":()=>__vitePreload(()=>import("./CaretDown-3X7LFYBf-C43xdKg8.js"),[]),"../../../assets/icon-components/CaretSort.tsx":()=>__vitePreload(()=>import("./CaretSort-BkGdLETT-DVOzEEqR.js"),[]),"../../../assets/icon-components/Check.tsx":()=>__vitePreload(()=>import("./Check-DV-U4AEq-B582NMZp.js"),[]),"../../../assets/icon-components/CheckCircle.tsx":()=>__vitePreload(()=>import("./CheckCircle-DI5fEgGd-CVF4LDhR.js"),[]),"../../../assets/icon-components/CheckCircleFill.tsx":()=>__vitePreload(()=>import("./CheckCircleFill-C-F0v5mB-BSW1YMqM.js"),[]),"../../../assets/icon-components/Checkmark.tsx":()=>__vitePreload(()=>import("./Checkmark-BXnfChpo-CyQitGI2.js"),[]),"../../../assets/icon-components/ChevronDown.tsx":()=>__vitePreload(()=>import("./ChevronDown-ouBxrU-k-eUsCPXcB.js"),[]),"../../../assets/icon-components/Circle.tsx":()=>__vitePreload(()=>import("./Circle-n3-Wh4HS-8dOehHQf.js"),[]),"../../../assets/icon-components/CircleInfo.tsx":()=>__vitePreload(()=>import("./CircleInfo-BhZY3C2Q-CZgYK1h2.js"),[]),"../../../assets/icon-components/ClockFill.tsx":()=>__vitePreload(()=>import("./ClockFill-Bd0t48q7-CcfHiJtH.js"),[]),"../../../assets/icon-components/CloudSlash.tsx":()=>__vitePreload(()=>import("./CloudSlash-B-zJBjaD-CxVyp-Ac.js"),[]),"../../../assets/icon-components/Collapse.tsx":()=>__vitePreload(()=>import("./Collapse-DRDB8Czs-CGcuZQgy.js"),[]),"../../../assets/icon-components/Connect.tsx":()=>__vitePreload(()=>import("./Connect-Dme-qfKq-CgniLji8.js"),[]),"../../../assets/icon-components/Discord.tsx":()=>__vitePreload(()=>import("./Discord-CAS0Cj7s-CcsBWpnf.js"),[]),"../../../assets/icon-components/Drive.tsx":()=>__vitePreload(()=>import("./Drive-GMcgBcIY-CzahDx9j.js"),[]),"../../../assets/icon-components/Ellipsis.tsx":()=>__vitePreload(()=>import("./Ellipsis-XK8AwMEC-BuVBeYhB.js"),[]),"../../../assets/icon-components/Error.tsx":()=>__vitePreload(()=>import("./Error-BmIZ2ZUy-CphzuMLn.js"),[]),"../../../assets/icon-components/Exclamation.tsx":()=>__vitePreload(()=>import("./Exclamation-CVsNS_QS-DLccamql.js"),[]),"../../../assets/icon-components/FilesEarmark.tsx":()=>__vitePreload(()=>import("./FilesEarmark-CyrCQy8E-Bhut4E02.js"),[]),"../../../assets/icon-components/FolderClose.tsx":()=>__vitePreload(()=>import("./FolderClose-DG_qHisc-CH6NoBuu.js"),[]),"../../../assets/icon-components/FolderOpen.tsx":()=>__vitePreload(()=>import("./FolderOpen-kDoWFkJO-Cciutkdg.js"),[]),"../../../assets/icon-components/FolderPlus.tsx":()=>__vitePreload(()=>import("./FolderPlus-CSBSl9lZ-CifD0ek9.js"),[]),"../../../assets/icon-components/Forum.tsx":()=>__vitePreload(()=>import("./Forum-DZ-CkLFh-BwabccAX.js"),[]),"../../../assets/icon-components/Gear.tsx":()=>__vitePreload(()=>import("./Gear-cUlHJ4q6-B9R2l_9_.js"),[]),"../../../assets/icon-components/Github.tsx":()=>__vitePreload(()=>import("./Github-0PLiINY0-CjkZIHCO.js"),[]),"../../../assets/icon-components/Globe.tsx":()=>__vitePreload(()=>import("./Globe-CIYqVkpa-CL530H46.js"),[]),"../../../assets/icon-components/GlobeWww.tsx":()=>__vitePreload(()=>import("./GlobeWww-DN4yKujh-Ci7aa5CE.js"),[]),"../../../assets/icon-components/Hdd.tsx":()=>__vitePreload(()=>import("./Hdd-Dn_LdJIh-CJ6x9Bve.js"),[]),"../../../assets/icon-components/History.tsx":()=>__vitePreload(()=>import("./History-BP4SmaS_-P4WBKyqX.js"),[]),"../../../assets/icon-components/InfoSquare.tsx":()=>__vitePreload(()=>import("./InfoSquare-C98JaLiz-yPcGR71f.js"),[]),"../../../assets/icon-components/Link.tsx":()=>__vitePreload(()=>import("./Link-BF7aZjVu-CXIVQOz6.js"),[]),"../../../assets/icon-components/Linkedin.tsx":()=>__vitePreload(()=>import("./Linkedin-DJwIkS6q-Dkb5Tp_Z.js"),[]),"../../../assets/icon-components/Lock.tsx":()=>__vitePreload(()=>import("./Lock-PyaFHdNS-D_qxRTye.js"),[]),"../../../assets/icon-components/M.tsx":()=>__vitePreload(()=>import("./M-DozhhPMY-DBQw97P_.js"),[]),"../../../assets/icon-components/Pencil.tsx":()=>__vitePreload(()=>import("./Pencil-D7lvxXIP-D830iveq.js"),[]),"../../../assets/icon-components/People.tsx":()=>__vitePreload(()=>import("./People-CUB8LYKf-CyJmMqcw.js"),[]),"../../../assets/icon-components/Person.tsx":()=>__vitePreload(()=>import("./Person-DuL4PQzm-ttQR0nPy.js"),[]),"../../../assets/icon-components/Plus.tsx":()=>__vitePreload(()=>import("./Plus-DPFWGJM4-BztpK8li.js"),[]),"../../../assets/icon-components/PlusCircle.tsx":()=>__vitePreload(()=>import("./PlusCircle-BEnWRjHa-w5zztKGx.js"),[]),"../../../assets/icon-components/PowerhouseLogoSmall.tsx":()=>__vitePreload(()=>import("./PowerhouseLogoSmall-CmO95IAS-CDGLkst3.js"),[]),"../../../assets/icon-components/Project.tsx":()=>__vitePreload(()=>import("./Project-BlXuclr0-EsBam9d0.js"),[]),"../../../assets/icon-components/RedoArrow.tsx":()=>__vitePreload(()=>import("./RedoArrow-BJeEsiph-BbidqIFP.js"),[]),"../../../assets/icon-components/Renown.tsx":()=>__vitePreload(()=>import("./Renown-6m7hx37h-CItksi2j.js"),[]),"../../../assets/icon-components/RenownHover.tsx":()=>__vitePreload(()=>import("./RenownHover-CQ0TZHZv-cYQgnwQW.js"),[]),"../../../assets/icon-components/Ring.tsx":()=>__vitePreload(()=>import("./Ring-DKv0gnwT-CDHLz87h.js"),[]),"../../../assets/icon-components/Save.tsx":()=>__vitePreload(()=>import("./Save-BBxj68pn-BkUvn89C.js"),[]),"../../../assets/icon-components/Search.tsx":()=>__vitePreload(()=>import("./Search-YUJuRBLe-CecGUkZA.js"),[]),"../../../assets/icon-components/Server.tsx":()=>__vitePreload(()=>import("./Server-Bfkkjui1-lBan_3Dm.js"),[]),"../../../assets/icon-components/Settings.tsx":()=>__vitePreload(()=>import("./Settings-mbbylBS5-Cca-sV-_.js"),[]),"../../../assets/icon-components/Synced.tsx":()=>__vitePreload(()=>import("./Synced-DKJXzPiw-Cui8pDsS.js"),[]),"../../../assets/icon-components/Syncing.tsx":()=>__vitePreload(()=>import("./Syncing-aT9WSMFf-2VhhyCcX.js"),[]),"../../../assets/icon-components/Trash.tsx":()=>__vitePreload(()=>import("./Trash-CgSbHk-P-DIYkVMER.js"),[]),"../../../assets/icon-components/TrashFill.tsx":()=>__vitePreload(()=>import("./TrashFill-DN50ercb-Oqx67xXN.js"),[]),"../../../assets/icon-components/VariantArrowLeft.tsx":()=>__vitePreload(()=>import("./VariantArrowLeft-CnuX59_e-6Zt_Q3tm.js"),[]),"../../../assets/icon-components/VerticalDots.tsx":()=>__vitePreload(()=>import("./VerticalDots-C8QYf7et-CCxZfvjq.js"),[]),"../../../assets/icon-components/WarningFill.tsx":()=>__vitePreload(()=>import("./WarningFill-WowAvi5P-D5XCckM6.js"),[]),"../../../assets/icon-components/XTwitter.tsx":()=>__vitePreload(()=>import("./XTwitter-k3Pt8itk-mvLk8TKx.js"),[]),"../../../assets/icon-components/Xmark.tsx":()=>__vitePreload(()=>import("./Xmark-8qnJCs2Y-CZ3t0Fap.js"),[]),"../../../assets/icon-components/XmarkLight.tsx":()=>__vitePreload(()=>import("./XmarkLight-GHzDR5_F-CloMvuzt.js"),[]),"../../../assets/icon-components/Youtube.tsx":()=>__vitePreload(()=>import("./Youtube-i8V0IXUU-Bkiwoayp.js"),[])}),`../../../assets/icon-components/${vo}.tsx`,6))}catch(Ai){return console.error(Ai),Rm}}function _e$1({name:vo,size:Ai=24,color:bo,style:Ra,...hc}){const pc=Am(Ai),mc={color:bo,...pc,style:Ra},uf=useMemo(()=>_m(vo),[vo]);return jsx(Suspense,{fallback:jsx("div",{"data-testid":"icon-fallback",style:pc}),name:"icon-component",children:jsx(uf,{...hc,style:mc})})}function ji$1(vo,Ai){var bo=Object.keys(vo);if(Object.getOwnPropertySymbols){var Ra=Object.getOwnPropertySymbols(vo);Ai&&(Ra=Ra.filter(function(hc){return Object.getOwnPropertyDescriptor(vo,hc).enumerable})),bo.push.apply(bo,Ra)}return bo}function te$2(vo){for(var Ai=1;Ai<arguments.length;Ai++){var bo=arguments[Ai]!=null?arguments[Ai]:{};Ai%2?ji$1(Object(bo),!0).forEach(function(Ra){Ir$3(vo,Ra,bo[Ra])}):Object.getOwnPropertyDescriptors?Object.defineProperties(vo,Object.getOwnPropertyDescriptors(bo)):ji$1(Object(bo)).forEach(function(Ra){Object.defineProperty(vo,Ra,Object.getOwnPropertyDescriptor(bo,Ra))})}return vo}function km(vo){if(Array.isArray(vo))return vo}function Fm(vo,Ai){var bo=vo==null?null:typeof Symbol<"u"&&vo[Symbol.iterator]||vo["@@iterator"];if(bo!=null){var Ra,hc,pc,mc,uf=[],df=!0,ff=!1;try{if(pc=(bo=bo.call(vo)).next,Ai===0){if(Object(bo)!==bo)return;df=!1}else for(;!(df=(Ra=pc.call(bo)).done)&&(uf.push(Ra.value),uf.length!==Ai);df=!0);}catch(hf){ff=!0,hc=hf}finally{try{if(!df&&bo.return!=null&&(mc=bo.return(),Object(mc)!==mc))return}finally{if(ff)throw hc}}return uf}}function ma(vo,Ai){(Ai==null||Ai>vo.length)&&(Ai=vo.length);for(var bo=0,Ra=Array(Ai);bo<Ai;bo++)Ra[bo]=vo[bo];return Ra}function Hc(vo,Ai){if(vo){if(typeof vo=="string")return ma(vo,Ai);var bo={}.toString.call(vo).slice(8,-1);return bo==="Object"&&vo.constructor&&(bo=vo.constructor.name),bo==="Map"||bo==="Set"?Array.from(vo):bo==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(bo)?ma(vo,Ai):void 0}}function Vm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function St$1(vo,Ai){return km(vo)||Fm(vo,Ai)||Hc(vo,Ai)||Vm()}function Lm(vo,Ai){if(vo==null)return{};var bo={};for(var Ra in vo)if({}.hasOwnProperty.call(vo,Ra)){if(Ai.includes(Ra))continue;bo[Ra]=vo[Ra]}return bo}function Et$2(vo,Ai){if(vo==null)return{};var bo,Ra,hc=Lm(vo,Ai);if(Object.getOwnPropertySymbols){var pc=Object.getOwnPropertySymbols(vo);for(Ra=0;Ra<pc.length;Ra++)bo=pc[Ra],Ai.includes(bo)||{}.propertyIsEnumerable.call(vo,bo)&&(hc[bo]=vo[bo])}return hc}var $m=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Um(vo){var Ai=vo.defaultInputValue,bo=Ai===void 0?"":Ai,Ra=vo.defaultMenuIsOpen,hc=Ra===void 0?!1:Ra,pc=vo.defaultValue,mc=pc===void 0?null:pc,uf=vo.inputValue,df=vo.menuIsOpen,ff=vo.onChange,hf=vo.onInputChange,pf=vo.onMenuClose,mf=vo.onMenuOpen,gf=vo.value,yf=Et$2(vo,$m),vf=useState(uf!==void 0?uf:bo),bf=St$1(vf,2),Sf=bf[0],xf=bf[1],wf=useState(df!==void 0?df:hc),s1=St$1(wf,2),If=s1[0],l1=s1[1],c1=useState(gf!==void 0?gf:mc),m1=St$1(c1,2),k1=m1[0],N1=m1[1],R1=useCallback(function(B1,V1){typeof ff=="function"&&ff(B1,V1),N1(B1)},[ff]),$1=useCallback(function(B1,V1){var Z1;typeof hf=="function"&&(Z1=hf(B1,V1)),xf(Z1!==void 0?Z1:B1)},[hf]),D1=useCallback(function(){typeof mf=="function"&&mf(),l1(!0)},[mf]),f1=useCallback(function(){typeof pf=="function"&&pf(),l1(!1)},[pf]),T1=uf!==void 0?uf:Sf,A1=df!==void 0?df:If,L1=gf!==void 0?gf:k1;return te$2(te$2({},yf),{},{inputValue:T1,menuIsOpen:A1,onChange:R1,onInputChange:$1,onMenuClose:f1,onMenuOpen:D1,value:L1})}function Hm(vo,Ai){if(!(vo instanceof Ai))throw new TypeError("Cannot call a class as a function")}function Yi(vo,Ai){for(var bo=0;bo<Ai.length;bo++){var Ra=Ai[bo];Ra.enumerable=Ra.enumerable||!1,Ra.configurable=!0,"value"in Ra&&(Ra.writable=!0),Object.defineProperty(vo,K8(Ra.key),Ra)}}function Wm(vo,Ai,bo){return Yi(vo.prototype,Ai),Yi(vo,bo),Object.defineProperty(vo,"prototype",{writable:!1}),vo}function pa$1(vo,Ai){return pa$1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(bo,Ra){return bo.__proto__=Ra,bo},pa$1(vo,Ai)}function Bm(vo,Ai){if(typeof Ai!="function"&&Ai!==null)throw new TypeError("Super expression must either be null or a function");vo.prototype=Object.create(Ai&&Ai.prototype,{constructor:{value:vo,writable:!0,configurable:!0}}),Object.defineProperty(vo,"prototype",{writable:!1}),Ai&&pa$1(vo,Ai)}function Mr$2(vo){return Mr$2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Ai){return Ai.__proto__||Object.getPrototypeOf(Ai)},Mr$2(vo)}function Wc(){try{var vo=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Wc=function(){return!!vo})()}function zm(vo){if(vo===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return vo}function jm(vo,Ai){if(Ai&&(Ci$1(Ai)=="object"||typeof Ai=="function"))return Ai;if(Ai!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zm(vo)}function Ym(vo){var Ai=Wc();return function(){var bo,Ra=Mr$2(vo);if(Ai){var hc=Mr$2(this).constructor;bo=Reflect.construct(Ra,arguments,hc)}else bo=Ra.apply(this,arguments);return jm(this,bo)}}function Gm(vo){if(Array.isArray(vo))return ma(vo)}function qm(vo){if(typeof Symbol<"u"&&vo[Symbol.iterator]!=null||vo["@@iterator"]!=null)return Array.from(vo)}function Xm(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $a(vo){return Gm(vo)||qm(vo)||Hc(vo)||Xm()}var Km=!1;function Zm(vo){if(vo.sheet)return vo.sheet;for(var Ai=0;Ai<document.styleSheets.length;Ai++)if(document.styleSheets[Ai].ownerNode===vo)return document.styleSheets[Ai]}function Qm(vo){var Ai=document.createElement("style");return Ai.setAttribute("data-emotion",vo.key),vo.nonce!==void 0&&Ai.setAttribute("nonce",vo.nonce),Ai.appendChild(document.createTextNode("")),Ai.setAttribute("data-s",""),Ai}var Jm=function(){function vo(bo){var Ra=this;this._insertTag=function(hc){var pc;Ra.tags.length===0?Ra.insertionPoint?pc=Ra.insertionPoint.nextSibling:Ra.prepend?pc=Ra.container.firstChild:pc=Ra.before:pc=Ra.tags[Ra.tags.length-1].nextSibling,Ra.container.insertBefore(hc,pc),Ra.tags.push(hc)},this.isSpeedy=bo.speedy===void 0?!Km:bo.speedy,this.tags=[],this.ctr=0,this.nonce=bo.nonce,this.key=bo.key,this.container=bo.container,this.prepend=bo.prepend,this.insertionPoint=bo.insertionPoint,this.before=null}var Ai=vo.prototype;return Ai.hydrate=function(bo){bo.forEach(this._insertTag)},Ai.insert=function(bo){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Qm(this));var Ra=this.tags[this.tags.length-1];if(this.isSpeedy){var hc=Zm(Ra);try{hc.insertRule(bo,hc.cssRules.length)}catch{}}else Ra.appendChild(document.createTextNode(bo));this.ctr++},Ai.flush=function(){this.tags.forEach(function(bo){var Ra;return(Ra=bo.parentNode)==null?void 0:Ra.removeChild(bo)}),this.tags=[],this.ctr=0},vo}(),Ue$2="-ms-",Nr$2="-moz-",me$2="-webkit-",Bc="comm",Ua="rule",Ha="decl",ep="@import",zc="@keyframes",tp="@layer",np=Math.abs,Kr$2=String.fromCharCode,rp=Object.assign;function op(vo,Ai){return $e$2(vo,0)^45?(((Ai<<2^$e$2(vo,0))<<2^$e$2(vo,1))<<2^$e$2(vo,2))<<2^$e$2(vo,3):0}function jc(vo){return vo.trim()}function ap(vo,Ai){return(vo=Ai.exec(vo))?vo[0]:vo}function pe$2(vo,Ai,bo){return vo.replace(Ai,bo)}function ha(vo,Ai){return vo.indexOf(Ai)}function $e$2(vo,Ai){return vo.charCodeAt(Ai)|0}function Vn$2(vo,Ai,bo){return vo.slice(Ai,bo)}function ut$1(vo){return vo.length}function Wa(vo){return vo.length}function ar$1(vo,Ai){return Ai.push(vo),vo}function ip(vo,Ai){return vo.map(Ai).join("")}var Zr$1=1,pn$2=1,Yc=0,qe$2=0,Me$2=0,bn$1="";function Qr$2(vo,Ai,bo,Ra,hc,pc,mc){return{value:vo,root:Ai,parent:bo,type:Ra,props:hc,children:pc,line:Zr$1,column:pn$2,length:mc,return:""}}function Tn$1(vo,Ai){return rp(Qr$2("",null,null,"",null,null,0),vo,{length:-vo.length},Ai)}function sp(){return Me$2}function cp(){return Me$2=qe$2>0?$e$2(bn$1,--qe$2):0,pn$2--,Me$2===10&&(pn$2=1,Zr$1--),Me$2}function Ke$2(){return Me$2=qe$2<Yc?$e$2(bn$1,qe$2++):0,pn$2++,Me$2===10&&(pn$2=1,Zr$1++),Me$2}function gt$2(){return $e$2(bn$1,qe$2)}function br$2(){return qe$2}function Kn$2(vo,Ai){return Vn$2(bn$1,vo,Ai)}function Ln$1(vo){switch(vo){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Gc(vo){return Zr$1=pn$2=1,Yc=ut$1(bn$1=vo),qe$2=0,[]}function qc(vo){return bn$1="",vo}function yr$2(vo){return jc(Kn$2(qe$2-1,ga(vo===91?vo+2:vo===40?vo+1:vo)))}function lp(vo){for(;(Me$2=gt$2())&&Me$2<33;)Ke$2();return Ln$1(vo)>2||Ln$1(Me$2)>3?"":" "}function up(vo,Ai){for(;--Ai&&Ke$2()&&!(Me$2<48||Me$2>102||Me$2>57&&Me$2<65||Me$2>70&&Me$2<97););return Kn$2(vo,br$2()+(Ai<6&>$2()==32&&Ke$2()==32))}function ga(vo){for(;Ke$2();)switch(Me$2){case vo:return qe$2;case 34:case 39:vo!==34&&vo!==39&&ga(Me$2);break;case 40:vo===41&&ga(vo);break;case 92:Ke$2();break}return qe$2}function dp(vo,Ai){for(;Ke$2()&&vo+Me$2!==57&&!(vo+Me$2===84&>$2()===47););return"/*"+Kn$2(Ai,qe$2-1)+"*"+Kr$2(vo===47?vo:Ke$2())}function fp(vo){for(;!Ln$1(gt$2());)Ke$2();return Kn$2(vo,qe$2)}function mp(vo){return qc(wr$2("",null,null,null,[""],vo=Gc(vo),0,[0],vo))}function wr$2(vo,Ai,bo,Ra,hc,pc,mc,uf,df){for(var ff=0,hf=0,pf=mc,mf=0,gf=0,yf=0,vf=1,bf=1,Sf=1,xf=0,wf="",s1=hc,If=pc,l1=Ra,c1=wf;bf;)switch(yf=xf,xf=Ke$2()){case 40:if(yf!=108&&$e$2(c1,pf-1)==58){ha(c1+=pe$2(yr$2(xf),"&","&\f"),"&\f")!=-1&&(Sf=-1);break}case 34:case 39:case 91:c1+=yr$2(xf);break;case 9:case 10:case 13:case 32:c1+=lp(yf);break;case 92:c1+=up(br$2()-1,7);continue;case 47:switch(gt$2()){case 42:case 47:ar$1(pp(dp(Ke$2(),br$2()),Ai,bo),df);break;default:c1+="/"}break;case 123*vf:uf[ff++]=ut$1(c1)*Sf;case 125*vf:case 59:case 0:switch(xf){case 0:case 125:bf=0;case 59+hf:Sf==-1&&(c1=pe$2(c1,/\f/g,"")),gf>0&&ut$1(c1)-pf&&ar$1(gf>32?qi(c1+";",Ra,bo,pf-1):qi(pe$2(c1," ","")+";",Ra,bo,pf-2),df);break;case 59:c1+=";";default:if(ar$1(l1=Gi(c1,Ai,bo,ff,hf,hc,uf,wf,s1=[],If=[],pf),pc),xf===123)if(hf===0)wr$2(c1,Ai,l1,l1,s1,pc,pf,uf,If);else switch(mf===99&&$e$2(c1,3)===110?100:mf){case 100:case 108:case 109:case 115:wr$2(vo,l1,l1,Ra&&ar$1(Gi(vo,l1,l1,0,0,hc,uf,wf,hc,s1=[],pf),If),hc,If,pf,uf,Ra?s1:If);break;default:wr$2(c1,l1,l1,l1,[""],If,0,uf,If)}}ff=hf=gf=0,vf=Sf=1,wf=c1="",pf=mc;break;case 58:pf=1+ut$1(c1),gf=yf;default:if(vf<1){if(xf==123)--vf;else if(xf==125&&vf++==0&&cp()==125)continue}switch(c1+=Kr$2(xf),xf*vf){case 38:Sf=hf>0?1:(c1+="\f",-1);break;case 44:uf[ff++]=(ut$1(c1)-1)*Sf,Sf=1;break;case 64:gt$2()===45&&(c1+=yr$2(Ke$2())),mf=gt$2(),hf=pf=ut$1(wf=c1+=fp(br$2())),xf++;break;case 45:yf===45&&ut$1(c1)==2&&(vf=0)}}return pc}function Gi(vo,Ai,bo,Ra,hc,pc,mc,uf,df,ff,hf){for(var pf=hc-1,mf=hc===0?pc:[""],gf=Wa(mf),yf=0,vf=0,bf=0;yf<Ra;++yf)for(var Sf=0,xf=Vn$2(vo,pf+1,pf=np(vf=mc[yf])),wf=vo;Sf<gf;++Sf)(wf=jc(vf>0?mf[Sf]+" "+xf:pe$2(xf,/&\f/g,mf[Sf])))&&(df[bf++]=wf);return Qr$2(vo,Ai,bo,hc===0?Ua:uf,df,ff,hf)}function pp(vo,Ai,bo){return Qr$2(vo,Ai,bo,Bc,Kr$2(sp()),Vn$2(vo,2,-2),0)}function qi(vo,Ai,bo,Ra){return Qr$2(vo,Ai,bo,Ha,Vn$2(vo,0,Ra),Vn$2(vo,Ra+1,-1),Ra)}function ln$1(vo,Ai){for(var bo="",Ra=Wa(vo),hc=0;hc<Ra;hc++)bo+=Ai(vo[hc],hc,vo,Ai)||"";return bo}function hp(vo,Ai,bo,Ra){switch(vo.type){case tp:if(vo.children.length)break;case ep:case Ha:return vo.return=vo.return||vo.value;case Bc:return"";case zc:return vo.return=vo.value+"{"+ln$1(vo.children,Ra)+"}";case Ua:vo.value=vo.props.join(",")}return ut$1(bo=ln$1(vo.children,Ra))?vo.return=vo.value+"{"+bo+"}":""}function gp(vo){var Ai=Wa(vo);return function(bo,Ra,hc,pc){for(var mc="",uf=0;uf<Ai;uf++)mc+=vo[uf](bo,Ra,hc,pc)||"";return mc}}function vp(vo){return function(Ai){Ai.root||(Ai=Ai.return)&&vo(Ai)}}function bp(vo){var Ai=Object.create(null);return function(bo){return Ai[bo]===void 0&&(Ai[bo]=vo(bo)),Ai[bo]}}var yp=function(vo,Ai,bo){for(var Ra=0,hc=0;Ra=hc,hc=gt$2(),Ra===38&&hc===12&&(Ai[bo]=1),!Ln$1(hc);)Ke$2();return Kn$2(vo,qe$2)},wp=function(vo,Ai){var bo=-1,Ra=44;do switch(Ln$1(Ra)){case 0:Ra===38&>$2()===12&&(Ai[bo]=1),vo[bo]+=yp(qe$2-1,Ai,bo);break;case 2:vo[bo]+=yr$2(Ra);break;case 4:if(Ra===44){vo[++bo]=gt$2()===58?"&\f":"",Ai[bo]=vo[bo].length;break}default:vo[bo]+=Kr$2(Ra)}while(Ra=Ke$2());return vo},xp=function(vo,Ai){return qc(wp(Gc(vo),Ai))},Xi=new WeakMap,Sp=function(vo){if(!(vo.type!=="rule"||!vo.parent||vo.length<1)){for(var Ai=vo.value,bo=vo.parent,Ra=vo.column===bo.column&&vo.line===bo.line;bo.type!=="rule";)if(bo=bo.parent,!bo)return;if(!(vo.props.length===1&&Ai.charCodeAt(0)!==58&&!Xi.get(bo))&&!Ra){Xi.set(vo,!0);for(var hc=[],pc=xp(Ai,hc),mc=bo.props,uf=0,df=0;uf<pc.length;uf++)for(var ff=0;ff<mc.length;ff++,df++)vo.props[df]=hc[uf]?pc[uf].replace(/&\f/g,mc[ff]):mc[ff]+" "+pc[uf]}}},Cp=function(vo){if(vo.type==="decl"){var Ai=vo.value;Ai.charCodeAt(0)===108&&Ai.charCodeAt(2)===98&&(vo.return="",vo.value="")}};function Xc(vo,Ai){switch(op(vo,Ai)){case 5103:return me$2+"print-"+vo+vo;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return me$2+vo+vo;case 5349:case 4246:case 4810:case 6968:case 2756:return me$2+vo+Nr$2+vo+Ue$2+vo+vo;case 6828:case 4268:return me$2+vo+Ue$2+vo+vo;case 6165:return me$2+vo+Ue$2+"flex-"+vo+vo;case 5187:return me$2+vo+pe$2(vo,/(\w+).+(:[^]+)/,me$2+"box-$1$2"+Ue$2+"flex-$1$2")+vo;case 5443:return me$2+vo+Ue$2+"flex-item-"+pe$2(vo,/flex-|-self/,"")+vo;case 4675:return me$2+vo+Ue$2+"flex-line-pack"+pe$2(vo,/align-content|flex-|-self/,"")+vo;case 5548:return me$2+vo+Ue$2+pe$2(vo,"shrink","negative")+vo;case 5292:return me$2+vo+Ue$2+pe$2(vo,"basis","preferred-size")+vo;case 6060:return me$2+"box-"+pe$2(vo,"-grow","")+me$2+vo+Ue$2+pe$2(vo,"grow","positive")+vo;case 4554:return me$2+pe$2(vo,/([^-])(transform)/g,"$1"+me$2+"$2")+vo;case 6187:return pe$2(pe$2(pe$2(vo,/(zoom-|grab)/,me$2+"$1"),/(image-set)/,me$2+"$1"),vo,"")+vo;case 5495:case 3959:return pe$2(vo,/(image-set\([^]*)/,me$2+"$1$`$1");case 4968:return pe$2(pe$2(vo,/(.+:)(flex-)?(.*)/,me$2+"box-pack:$3"+Ue$2+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+me$2+vo+vo;case 4095:case 3583:case 4068:case 2532:return pe$2(vo,/(.+)-inline(.+)/,me$2+"$1$2")+vo;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ut$1(vo)-1-Ai>6)switch($e$2(vo,Ai+1)){case 109:if($e$2(vo,Ai+4)!==45)break;case 102:return pe$2(vo,/(.+:)(.+)-([^]+)/,"$1"+me$2+"$2-$3$1"+Nr$2+($e$2(vo,Ai+3)==108?"$3":"$2-$3"))+vo;case 115:return~ha(vo,"stretch")?Xc(pe$2(vo,"stretch","fill-available"),Ai)+vo:vo}break;case 4949:if($e$2(vo,Ai+1)!==115)break;case 6444:switch($e$2(vo,ut$1(vo)-3-(~ha(vo,"!important")&&10))){case 107:return pe$2(vo,":",":"+me$2)+vo;case 101:return pe$2(vo,/(.+:)([^;!]+)(;|!.+)?/,"$1"+me$2+($e$2(vo,14)===45?"inline-":"")+"box$3$1"+me$2+"$2$3$1"+Ue$2+"$2box$3")+vo}break;case 5936:switch($e$2(vo,Ai+11)){case 114:return me$2+vo+Ue$2+pe$2(vo,/[svh]\w+-[tblr]{2}/,"tb")+vo;case 108:return me$2+vo+Ue$2+pe$2(vo,/[svh]\w+-[tblr]{2}/,"tb-rl")+vo;case 45:return me$2+vo+Ue$2+pe$2(vo,/[svh]\w+-[tblr]{2}/,"lr")+vo}return me$2+vo+Ue$2+vo+vo}return vo}var Ip=function(vo,Ai,bo,Ra){if(vo.length>-1&&!vo.return)switch(vo.type){case Ha:vo.return=Xc(vo.value,vo.length);break;case zc:return ln$1([Tn$1(vo,{value:pe$2(vo.value,"@","@"+me$2)})],Ra);case Ua:if(vo.length)return ip(vo.props,function(hc){switch(ap(hc,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ln$1([Tn$1(vo,{props:[pe$2(hc,/:(read-\w+)/,":"+Nr$2+"$1")]})],Ra);case"::placeholder":return ln$1([Tn$1(vo,{props:[pe$2(hc,/:(plac\w+)/,":"+me$2+"input-$1")]}),Tn$1(vo,{props:[pe$2(hc,/:(plac\w+)/,":"+Nr$2+"$1")]}),Tn$1(vo,{props:[pe$2(hc,/:(plac\w+)/,Ue$2+"input-$1")]})],Ra)}return""})}},Ep=[Ip],Pp=function(vo){var Ai=vo.key;if(Ai==="css"){var bo=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(bo,function(yf){var vf=yf.getAttribute("data-emotion");vf.indexOf(" ")!==-1&&(document.head.appendChild(yf),yf.setAttribute("data-s",""))})}var Ra=vo.stylisPlugins||Ep,hc={},pc,mc=[];pc=vo.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+Ai+' "]'),function(yf){for(var vf=yf.getAttribute("data-emotion").split(" "),bf=1;bf<vf.length;bf++)hc[vf[bf]]=!0;mc.push(yf)});var uf,df=[Sp,Cp];{var ff,hf=[hp,vp(function(yf){ff.insert(yf)})],pf=gp(df.concat(Ra,hf)),mf=function(yf){return ln$1(mp(yf),pf)};uf=function(yf,vf,bf,Sf){ff=bf,mf(yf?yf+"{"+vf.styles+"}":vf.styles),Sf&&(gf.inserted[vf.name]=!0)}}var gf={key:Ai,sheet:new Jm({key:Ai,container:pc,nonce:vo.nonce,speedy:vo.speedy,prepend:vo.prepend,insertionPoint:vo.insertionPoint}),nonce:vo.nonce,inserted:hc,registered:{},insert:uf};return gf.sheet.hydrate(mc),gf},Do={exports:{}},he$2={};/** @license React v16.13.1
|
|
5
|
-
* react-is.production.min.js
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the MIT license found in the
|
|
10
|
-
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/var Ki;function Tp(){if(Ki)return he$2;Ki=1;var vo=typeof Symbol=="function"&&Symbol.for,Ai=vo?Symbol.for("react.element"):60103,bo=vo?Symbol.for("react.portal"):60106,Ra=vo?Symbol.for("react.fragment"):60107,hc=vo?Symbol.for("react.strict_mode"):60108,pc=vo?Symbol.for("react.profiler"):60114,mc=vo?Symbol.for("react.provider"):60109,uf=vo?Symbol.for("react.context"):60110,df=vo?Symbol.for("react.async_mode"):60111,ff=vo?Symbol.for("react.concurrent_mode"):60111,hf=vo?Symbol.for("react.forward_ref"):60112,pf=vo?Symbol.for("react.suspense"):60113,mf=vo?Symbol.for("react.suspense_list"):60120,gf=vo?Symbol.for("react.memo"):60115,yf=vo?Symbol.for("react.lazy"):60116,vf=vo?Symbol.for("react.block"):60121,bf=vo?Symbol.for("react.fundamental"):60117,Sf=vo?Symbol.for("react.responder"):60118,xf=vo?Symbol.for("react.scope"):60119;function wf(If){if(typeof If=="object"&&If!==null){var l1=If.$$typeof;switch(l1){case Ai:switch(If=If.type,If){case df:case ff:case Ra:case pc:case hc:case pf:return If;default:switch(If=If&&If.$$typeof,If){case uf:case hf:case yf:case gf:case mc:return If;default:return l1}}case bo:return l1}}}function s1(If){return wf(If)===ff}return he$2.AsyncMode=df,he$2.ConcurrentMode=ff,he$2.ContextConsumer=uf,he$2.ContextProvider=mc,he$2.Element=Ai,he$2.ForwardRef=hf,he$2.Fragment=Ra,he$2.Lazy=yf,he$2.Memo=gf,he$2.Portal=bo,he$2.Profiler=pc,he$2.StrictMode=hc,he$2.Suspense=pf,he$2.isAsyncMode=function(If){return s1(If)||wf(If)===df},he$2.isConcurrentMode=s1,he$2.isContextConsumer=function(If){return wf(If)===uf},he$2.isContextProvider=function(If){return wf(If)===mc},he$2.isElement=function(If){return typeof If=="object"&&If!==null&&If.$$typeof===Ai},he$2.isForwardRef=function(If){return wf(If)===hf},he$2.isFragment=function(If){return wf(If)===Ra},he$2.isLazy=function(If){return wf(If)===yf},he$2.isMemo=function(If){return wf(If)===gf},he$2.isPortal=function(If){return wf(If)===bo},he$2.isProfiler=function(If){return wf(If)===pc},he$2.isStrictMode=function(If){return wf(If)===hc},he$2.isSuspense=function(If){return wf(If)===pf},he$2.isValidElementType=function(If){return typeof If=="string"||typeof If=="function"||If===Ra||If===ff||If===pc||If===hc||If===pf||If===mf||typeof If=="object"&&If!==null&&(If.$$typeof===yf||If.$$typeof===gf||If.$$typeof===mc||If.$$typeof===uf||If.$$typeof===hf||If.$$typeof===bf||If.$$typeof===Sf||If.$$typeof===xf||If.$$typeof===vf)},he$2.typeOf=wf,he$2}var Zi;function Op(){return Zi||(Zi=1,Do.exports=Tp()),Do.exports}var Ro,Qi;function Mp(){if(Qi)return Ro;Qi=1;var vo=Op(),Ai={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},bo={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Ra={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},hc={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},pc={};pc[vo.ForwardRef]=Ra,pc[vo.Memo]=hc;function mc(yf){return vo.isMemo(yf)?hc:pc[yf.$$typeof]||Ai}var uf=Object.defineProperty,df=Object.getOwnPropertyNames,ff=Object.getOwnPropertySymbols,hf=Object.getOwnPropertyDescriptor,pf=Object.getPrototypeOf,mf=Object.prototype;function gf(yf,vf,bf){if(typeof vf!="string"){if(mf){var Sf=pf(vf);Sf&&Sf!==mf&&gf(yf,Sf,bf)}var xf=df(vf);ff&&(xf=xf.concat(ff(vf)));for(var wf=mc(yf),s1=mc(vf),If=0;If<xf.length;++If){var l1=xf[If];if(!bo[l1]&&!(bf&&bf[l1])&&!(s1&&s1[l1])&&!(wf&&wf[l1])){var c1=hf(vf,l1);try{uf(yf,l1,c1)}catch{}}}}return yf}return Ro=gf,Ro}Mp();var Np=!0;function Ap(vo,Ai,bo){var Ra="";return bo.split(" ").forEach(function(hc){vo[hc]!==void 0?Ai.push(vo[hc]+";"):hc&&(Ra+=hc+" ")}),Ra}var Kc=function(vo,Ai,bo){var Ra=vo.key+"-"+Ai.name;(bo===!1||Np===!1)&&vo.registered[Ra]===void 0&&(vo.registered[Ra]=Ai.styles)},Dp=function(vo,Ai,bo){Kc(vo,Ai,bo);var Ra=vo.key+"-"+Ai.name;if(vo.inserted[Ai.name]===void 0){var hc=Ai;do vo.insert(Ai===hc?"."+Ra:"",hc,vo.sheet,!0),hc=hc.next;while(hc!==void 0)}};function Rp(vo){for(var Ai=0,bo,Ra=0,hc=vo.length;hc>=4;++Ra,hc-=4)bo=vo.charCodeAt(Ra)&255|(vo.charCodeAt(++Ra)&255)<<8|(vo.charCodeAt(++Ra)&255)<<16|(vo.charCodeAt(++Ra)&255)<<24,bo=(bo&65535)*1540483477+((bo>>>16)*59797<<16),bo^=bo>>>24,Ai=(bo&65535)*1540483477+((bo>>>16)*59797<<16)^(Ai&65535)*1540483477+((Ai>>>16)*59797<<16);switch(hc){case 3:Ai^=(vo.charCodeAt(Ra+2)&255)<<16;case 2:Ai^=(vo.charCodeAt(Ra+1)&255)<<8;case 1:Ai^=vo.charCodeAt(Ra)&255,Ai=(Ai&65535)*1540483477+((Ai>>>16)*59797<<16)}return Ai^=Ai>>>13,Ai=(Ai&65535)*1540483477+((Ai>>>16)*59797<<16),((Ai^Ai>>>15)>>>0).toString(36)}var _p={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},kp=/[A-Z]|^ms/g,Fp=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Zc=function(vo){return vo.charCodeAt(1)===45},Ji=function(vo){return vo!=null&&typeof vo!="boolean"},_o=bp(function(vo){return Zc(vo)?vo:vo.replace(kp,"-$&").toLowerCase()}),es$1=function(vo,Ai){switch(vo){case"animation":case"animationName":if(typeof Ai=="string")return Ai.replace(Fp,function(bo,Ra,hc){return dt$1={name:Ra,styles:hc,next:dt$1},Ra})}return _p[vo]!==1&&!Zc(vo)&&typeof Ai=="number"&&Ai!==0?Ai+"px":Ai};function $n$2(vo,Ai,bo){if(bo==null)return"";var Ra=bo;if(Ra.__emotion_styles!==void 0)return Ra;switch(typeof bo){case"boolean":return"";case"object":{var hc=bo;if(hc.anim===1)return dt$1={name:hc.name,styles:hc.styles,next:dt$1},hc.name;var pc=bo;if(pc.styles!==void 0){var mc=pc.next;if(mc!==void 0)for(;mc!==void 0;)dt$1={name:mc.name,styles:mc.styles,next:dt$1},mc=mc.next;var uf=pc.styles+";";return uf}return Vp(vo,Ai,bo)}case"function":{if(vo!==void 0){var df=dt$1,ff=bo(vo);return dt$1=df,$n$2(vo,Ai,ff)}break}}var hf=bo;return hf}function Vp(vo,Ai,bo){var Ra="";if(Array.isArray(bo))for(var hc=0;hc<bo.length;hc++)Ra+=$n$2(vo,Ai,bo[hc])+";";else for(var pc in bo){var mc=bo[pc];if(typeof mc!="object"){var uf=mc;Ji(uf)&&(Ra+=_o(pc)+":"+es$1(pc,uf)+";")}else if(Array.isArray(mc)&&typeof mc[0]=="string"&&Ai==null)for(var df=0;df<mc.length;df++)Ji(mc[df])&&(Ra+=_o(pc)+":"+es$1(pc,mc[df])+";");else{var ff=$n$2(vo,Ai,mc);switch(pc){case"animation":case"animationName":{Ra+=_o(pc)+":"+ff+";";break}default:Ra+=pc+"{"+ff+"}"}}}return Ra}var ts$1=/label:\s*([^\s;{]+)\s*(;|$)/g,dt$1;function Qc(vo,Ai,bo){if(vo.length===1&&typeof vo[0]=="object"&&vo[0]!==null&&vo[0].styles!==void 0)return vo[0];var Ra=!0,hc="";dt$1=void 0;var pc=vo[0];if(pc==null||pc.raw===void 0)Ra=!1,hc+=$n$2(bo,Ai,pc);else{var mc=pc;hc+=mc[0]}for(var uf=1;uf<vo.length;uf++)if(hc+=$n$2(bo,Ai,vo[uf]),Ra){var df=pc;hc+=df[uf]}ts$1.lastIndex=0;for(var ff="",hf;(hf=ts$1.exec(hc))!==null;)ff+="-"+hf[1];var pf=Rp(hc)+ff;return{name:pf,styles:hc,next:dt$1}}var Lp=function(vo){return vo()},$p=y$2.useInsertionEffect?y$2.useInsertionEffect:!1,Up=$p||Lp,Hp=!1,Jc=y$2.createContext(typeof HTMLElement<"u"?Pp({key:"css"}):null);Jc.Provider;var Wp=function(vo){return forwardRef(function(Ai,bo){var Ra=useContext(Jc);return vo(Ai,Ra,bo)})},Bp=y$2.createContext({}),Ba={}.hasOwnProperty,va="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",zp=function(vo,Ai){var bo={};for(var Ra in Ai)Ba.call(Ai,Ra)&&(bo[Ra]=Ai[Ra]);return bo[va]=vo,bo},jp=function(vo){var Ai=vo.cache,bo=vo.serialized,Ra=vo.isStringTag;return Kc(Ai,bo,Ra),Up(function(){return Dp(Ai,bo,Ra)}),null},Yp=Wp(function(vo,Ai,bo){var Ra=vo.css;typeof Ra=="string"&&Ai.registered[Ra]!==void 0&&(Ra=Ai.registered[Ra]);var hc=vo[va],pc=[Ra],mc="";typeof vo.className=="string"?mc=Ap(Ai.registered,pc,vo.className):vo.className!=null&&(mc=vo.className+" ");var uf=Qc(pc,void 0,y$2.useContext(Bp));mc+=Ai.key+"-"+uf.name;var df={};for(var ff in vo)Ba.call(vo,ff)&&ff!=="css"&&ff!==va&&!Hp&&(df[ff]=vo[ff]);return df.className=mc,bo&&(df.ref=bo),y$2.createElement(y$2.Fragment,null,y$2.createElement(jp,{cache:Ai,serialized:uf,isStringTag:typeof hc=="string"}),y$2.createElement(hc,df))}),Gp=Yp,Q$1=function(vo,Ai){var bo=arguments;if(Ai==null||!Ba.call(Ai,"css"))return y$2.createElement.apply(void 0,bo);var Ra=bo.length,hc=new Array(Ra);hc[0]=Gp,hc[1]=zp(vo,Ai);for(var pc=2;pc<Ra;pc++)hc[pc]=bo[pc];return y$2.createElement.apply(null,hc)};(function(vo){var Ai;Ai||(Ai=vo.JSX||(vo.JSX={}))})(Q$1);function za(){for(var vo=arguments.length,Ai=new Array(vo),bo=0;bo<vo;bo++)Ai[bo]=arguments[bo];return Qc(Ai)}function qp(){var vo=za.apply(void 0,arguments),Ai="animation-"+vo.name;return{name:Ai,styles:"@keyframes "+Ai+"{"+vo.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function Xp(vo,Ai){return Ai||(Ai=vo.slice(0)),Object.freeze(Object.defineProperties(vo,{raw:{value:Object.freeze(Ai)}}))}const Kp=["top","right","bottom","left"],Vt$1=Math.min,Xe$2=Math.max,Ar$2=Math.round,ir$1=Math.floor,vt$2=vo=>({x:vo,y:vo}),Zp={left:"right",right:"left",bottom:"top",top:"bottom"},Qp={start:"end",end:"start"};function ba(vo,Ai,bo){return Xe$2(vo,Vt$1(Ai,bo))}function Ct$2(vo,Ai){return typeof vo=="function"?vo(Ai):vo}function It$2(vo){return vo.split("-")[0]}function yn$1(vo){return vo.split("-")[1]}function ja(vo){return vo==="x"?"y":"x"}function Ya$1(vo){return vo==="y"?"height":"width"}function Lt$2(vo){return["top","bottom"].includes(It$2(vo))?"y":"x"}function Ga(vo){return ja(Lt$2(vo))}function Jp(vo,Ai,bo){bo===void 0&&(bo=!1);const Ra=yn$1(vo),hc=Ga(vo),pc=Ya$1(hc);let mc=hc==="x"?Ra===(bo?"end":"start")?"right":"left":Ra==="start"?"bottom":"top";return Ai.reference[pc]>Ai.floating[pc]&&(mc=Dr$2(mc)),[mc,Dr$2(mc)]}function eh(vo){const Ai=Dr$2(vo);return[ya(vo),Ai,ya(Ai)]}function ya(vo){return vo.replace(/start|end/g,Ai=>Qp[Ai])}function th(vo,Ai,bo){const Ra=["left","right"],hc=["right","left"],pc=["top","bottom"],mc=["bottom","top"];switch(vo){case"top":case"bottom":return bo?Ai?hc:Ra:Ai?Ra:hc;case"left":case"right":return Ai?pc:mc;default:return[]}}function nh(vo,Ai,bo,Ra){const hc=yn$1(vo);let pc=th(It$2(vo),bo==="start",Ra);return hc&&(pc=pc.map(mc=>mc+"-"+hc),Ai&&(pc=pc.concat(pc.map(ya)))),pc}function Dr$2(vo){return vo.replace(/left|right|bottom|top/g,Ai=>Zp[Ai])}function rh(vo){return{top:0,right:0,bottom:0,left:0,...vo}}function el(vo){return typeof vo!="number"?rh(vo):{top:vo,right:vo,bottom:vo,left:vo}}function Rr$2(vo){const{x:Ai,y:bo,width:Ra,height:hc}=vo;return{width:Ra,height:hc,top:bo,left:Ai,right:Ai+Ra,bottom:bo+hc,x:Ai,y:bo}}function ns(vo,Ai,bo){let{reference:Ra,floating:hc}=vo;const pc=Lt$2(Ai),mc=Ga(Ai),uf=Ya$1(mc),df=It$2(Ai),ff=pc==="y",hf=Ra.x+Ra.width/2-hc.width/2,pf=Ra.y+Ra.height/2-hc.height/2,mf=Ra[uf]/2-hc[uf]/2;let gf;switch(df){case"top":gf={x:hf,y:Ra.y-hc.height};break;case"bottom":gf={x:hf,y:Ra.y+Ra.height};break;case"right":gf={x:Ra.x+Ra.width,y:pf};break;case"left":gf={x:Ra.x-hc.width,y:pf};break;default:gf={x:Ra.x,y:Ra.y}}switch(yn$1(Ai)){case"start":gf[mc]-=mf*(bo&&ff?-1:1);break;case"end":gf[mc]+=mf*(bo&&ff?-1:1);break}return gf}const oh=async(vo,Ai,bo)=>{const{placement:Ra="bottom",strategy:hc="absolute",middleware:pc=[],platform:mc}=bo,uf=pc.filter(Boolean),df=await(mc.isRTL==null?void 0:mc.isRTL(Ai));let ff=await mc.getElementRects({reference:vo,floating:Ai,strategy:hc}),{x:hf,y:pf}=ns(ff,Ra,df),mf=Ra,gf={},yf=0;for(let vf=0;vf<uf.length;vf++){const{name:bf,fn:Sf}=uf[vf],{x:xf,y:wf,data:s1,reset:If}=await Sf({x:hf,y:pf,initialPlacement:Ra,placement:mf,strategy:hc,middlewareData:gf,rects:ff,platform:mc,elements:{reference:vo,floating:Ai}});hf=xf??hf,pf=wf??pf,gf={...gf,[bf]:{...gf[bf],...s1}},If&&yf<=50&&(yf++,typeof If=="object"&&(If.placement&&(mf=If.placement),If.rects&&(ff=If.rects===!0?await mc.getElementRects({reference:vo,floating:Ai,strategy:hc}):If.rects),{x:hf,y:pf}=ns(ff,mf,df)),vf=-1)}return{x:hf,y:pf,placement:mf,strategy:hc,middlewareData:gf}};async function Un$2(vo,Ai){var bo;Ai===void 0&&(Ai={});const{x:Ra,y:hc,platform:pc,rects:mc,elements:uf,strategy:df}=vo,{boundary:ff="clippingAncestors",rootBoundary:hf="viewport",elementContext:pf="floating",altBoundary:mf=!1,padding:gf=0}=Ct$2(Ai,vo),yf=el(gf),vf=uf[mf?pf==="floating"?"reference":"floating":pf],bf=Rr$2(await pc.getClippingRect({element:(bo=await(pc.isElement==null?void 0:pc.isElement(vf)))==null||bo?vf:vf.contextElement||await(pc.getDocumentElement==null?void 0:pc.getDocumentElement(uf.floating)),boundary:ff,rootBoundary:hf,strategy:df})),Sf=pf==="floating"?{x:Ra,y:hc,width:mc.floating.width,height:mc.floating.height}:mc.reference,xf=await(pc.getOffsetParent==null?void 0:pc.getOffsetParent(uf.floating)),wf=await(pc.isElement==null?void 0:pc.isElement(xf))?await(pc.getScale==null?void 0:pc.getScale(xf))||{x:1,y:1}:{x:1,y:1},s1=Rr$2(pc.convertOffsetParentRelativeRectToViewportRelativeRect?await pc.convertOffsetParentRelativeRectToViewportRelativeRect({elements:uf,rect:Sf,offsetParent:xf,strategy:df}):Sf);return{top:(bf.top-s1.top+yf.top)/wf.y,bottom:(s1.bottom-bf.bottom+yf.bottom)/wf.y,left:(bf.left-s1.left+yf.left)/wf.x,right:(s1.right-bf.right+yf.right)/wf.x}}const ah=vo=>({name:"arrow",options:vo,async fn(Ai){const{x:bo,y:Ra,placement:hc,rects:pc,platform:mc,elements:uf,middlewareData:df}=Ai,{element:ff,padding:hf=0}=Ct$2(vo,Ai)||{};if(ff==null)return{};const pf=el(hf),mf={x:bo,y:Ra},gf=Ga(hc),yf=Ya$1(gf),vf=await mc.getDimensions(ff),bf=gf==="y",Sf=bf?"top":"left",xf=bf?"bottom":"right",wf=bf?"clientHeight":"clientWidth",s1=pc.reference[yf]+pc.reference[gf]-mf[gf]-pc.floating[yf],If=mf[gf]-pc.reference[gf],l1=await(mc.getOffsetParent==null?void 0:mc.getOffsetParent(ff));let c1=l1?l1[wf]:0;(!c1||!await(mc.isElement==null?void 0:mc.isElement(l1)))&&(c1=uf.floating[wf]||pc.floating[yf]);const m1=s1/2-If/2,k1=c1/2-vf[yf]/2-1,N1=Vt$1(pf[Sf],k1),R1=Vt$1(pf[xf],k1),$1=N1,D1=c1-vf[yf]-R1,f1=c1/2-vf[yf]/2+m1,T1=ba($1,f1,D1),A1=!df.arrow&&yn$1(hc)!=null&&f1!==T1&&pc.reference[yf]/2-(f1<$1?N1:R1)-vf[yf]/2<0,L1=A1?f1<$1?f1-$1:f1-D1:0;return{[gf]:mf[gf]+L1,data:{[gf]:T1,centerOffset:f1-T1-L1,...A1&&{alignmentOffset:L1}},reset:A1}}}),ih=function(vo){return vo===void 0&&(vo={}),{name:"flip",options:vo,async fn(Ai){var bo,Ra;const{placement:hc,middlewareData:pc,rects:mc,initialPlacement:uf,platform:df,elements:ff}=Ai,{mainAxis:hf=!0,crossAxis:pf=!0,fallbackPlacements:mf,fallbackStrategy:gf="bestFit",fallbackAxisSideDirection:yf="none",flipAlignment:vf=!0,...bf}=Ct$2(vo,Ai);if((bo=pc.arrow)!=null&&bo.alignmentOffset)return{};const Sf=It$2(hc),xf=Lt$2(uf),wf=It$2(uf)===uf,s1=await(df.isRTL==null?void 0:df.isRTL(ff.floating)),If=mf||(wf||!vf?[Dr$2(uf)]:eh(uf)),l1=yf!=="none";!mf&&l1&&If.push(...nh(uf,vf,yf,s1));const c1=[uf,...If],m1=await Un$2(Ai,bf),k1=[];let N1=((Ra=pc.flip)==null?void 0:Ra.overflows)||[];if(hf&&k1.push(m1[Sf]),pf){const f1=Jp(hc,mc,s1);k1.push(m1[f1[0]],m1[f1[1]])}if(N1=[...N1,{placement:hc,overflows:k1}],!k1.every(f1=>f1<=0)){var R1,$1;const f1=(((R1=pc.flip)==null?void 0:R1.index)||0)+1,T1=c1[f1];if(T1)return{data:{index:f1,overflows:N1},reset:{placement:T1}};let A1=($1=N1.filter(L1=>L1.overflows[0]<=0).sort((L1,B1)=>L1.overflows[1]-B1.overflows[1])[0])==null?void 0:$1.placement;if(!A1)switch(gf){case"bestFit":{var D1;const L1=(D1=N1.filter(B1=>{if(l1){const V1=Lt$2(B1.placement);return V1===xf||V1==="y"}return!0}).map(B1=>[B1.placement,B1.overflows.filter(V1=>V1>0).reduce((V1,Z1)=>V1+Z1,0)]).sort((B1,V1)=>B1[1]-V1[1])[0])==null?void 0:D1[0];L1&&(A1=L1);break}case"initialPlacement":A1=uf;break}if(hc!==A1)return{reset:{placement:A1}}}return{}}}};function rs(vo,Ai){return{top:vo.top-Ai.height,right:vo.right-Ai.width,bottom:vo.bottom-Ai.height,left:vo.left-Ai.width}}function os(vo){return Kp.some(Ai=>vo[Ai]>=0)}const sh=function(vo){return vo===void 0&&(vo={}),{name:"hide",options:vo,async fn(Ai){const{rects:bo}=Ai,{strategy:Ra="referenceHidden",...hc}=Ct$2(vo,Ai);switch(Ra){case"referenceHidden":{const pc=await Un$2(Ai,{...hc,elementContext:"reference"}),mc=rs(pc,bo.reference);return{data:{referenceHiddenOffsets:mc,referenceHidden:os(mc)}}}case"escaped":{const pc=await Un$2(Ai,{...hc,altBoundary:!0}),mc=rs(pc,bo.floating);return{data:{escapedOffsets:mc,escaped:os(mc)}}}default:return{}}}}};async function ch(vo,Ai){const{placement:bo,platform:Ra,elements:hc}=vo,pc=await(Ra.isRTL==null?void 0:Ra.isRTL(hc.floating)),mc=It$2(bo),uf=yn$1(bo),df=Lt$2(bo)==="y",ff=["left","top"].includes(mc)?-1:1,hf=pc&&df?-1:1,pf=Ct$2(Ai,vo);let{mainAxis:mf,crossAxis:gf,alignmentAxis:yf}=typeof pf=="number"?{mainAxis:pf,crossAxis:0,alignmentAxis:null}:{mainAxis:pf.mainAxis||0,crossAxis:pf.crossAxis||0,alignmentAxis:pf.alignmentAxis};return uf&&typeof yf=="number"&&(gf=uf==="end"?yf*-1:yf),df?{x:gf*hf,y:mf*ff}:{x:mf*ff,y:gf*hf}}const lh=function(vo){return vo===void 0&&(vo=0),{name:"offset",options:vo,async fn(Ai){var bo,Ra;const{x:hc,y:pc,placement:mc,middlewareData:uf}=Ai,df=await ch(Ai,vo);return mc===((bo=uf.offset)==null?void 0:bo.placement)&&(Ra=uf.arrow)!=null&&Ra.alignmentOffset?{}:{x:hc+df.x,y:pc+df.y,data:{...df,placement:mc}}}}},uh=function(vo){return vo===void 0&&(vo={}),{name:"shift",options:vo,async fn(Ai){const{x:bo,y:Ra,placement:hc}=Ai,{mainAxis:pc=!0,crossAxis:mc=!1,limiter:uf={fn:bf=>{let{x:Sf,y:xf}=bf;return{x:Sf,y:xf}}},...df}=Ct$2(vo,Ai),ff={x:bo,y:Ra},hf=await Un$2(Ai,df),pf=Lt$2(It$2(hc)),mf=ja(pf);let gf=ff[mf],yf=ff[pf];if(pc){const bf=mf==="y"?"top":"left",Sf=mf==="y"?"bottom":"right",xf=gf+hf[bf],wf=gf-hf[Sf];gf=ba(xf,gf,wf)}if(mc){const bf=pf==="y"?"top":"left",Sf=pf==="y"?"bottom":"right",xf=yf+hf[bf],wf=yf-hf[Sf];yf=ba(xf,yf,wf)}const vf=uf.fn({...Ai,[mf]:gf,[pf]:yf});return{...vf,data:{x:vf.x-bo,y:vf.y-Ra,enabled:{[mf]:pc,[pf]:mc}}}}}},dh=function(vo){return vo===void 0&&(vo={}),{options:vo,fn(Ai){const{x:bo,y:Ra,placement:hc,rects:pc,middlewareData:mc}=Ai,{offset:uf=0,mainAxis:df=!0,crossAxis:ff=!0}=Ct$2(vo,Ai),hf={x:bo,y:Ra},pf=Lt$2(hc),mf=ja(pf);let gf=hf[mf],yf=hf[pf];const vf=Ct$2(uf,Ai),bf=typeof vf=="number"?{mainAxis:vf,crossAxis:0}:{mainAxis:0,crossAxis:0,...vf};if(df){const wf=mf==="y"?"height":"width",s1=pc.reference[mf]-pc.floating[wf]+bf.mainAxis,If=pc.reference[mf]+pc.reference[wf]-bf.mainAxis;gf<s1?gf=s1:gf>If&&(gf=If)}if(ff){var Sf,xf;const wf=mf==="y"?"width":"height",s1=["top","left"].includes(It$2(hc)),If=pc.reference[pf]-pc.floating[wf]+(s1&&((Sf=mc.offset)==null?void 0:Sf[pf])||0)+(s1?0:bf.crossAxis),l1=pc.reference[pf]+pc.reference[wf]+(s1?0:((xf=mc.offset)==null?void 0:xf[pf])||0)-(s1?bf.crossAxis:0);yf<If?yf=If:yf>l1&&(yf=l1)}return{[mf]:gf,[pf]:yf}}}},fh=function(vo){return vo===void 0&&(vo={}),{name:"size",options:vo,async fn(Ai){var bo,Ra;const{placement:hc,rects:pc,platform:mc,elements:uf}=Ai,{apply:df=()=>{},...ff}=Ct$2(vo,Ai),hf=await Un$2(Ai,ff),pf=It$2(hc),mf=yn$1(hc),gf=Lt$2(hc)==="y",{width:yf,height:vf}=pc.floating;let bf,Sf;pf==="top"||pf==="bottom"?(bf=pf,Sf=mf===(await(mc.isRTL==null?void 0:mc.isRTL(uf.floating))?"start":"end")?"left":"right"):(Sf=pf,bf=mf==="end"?"top":"bottom");const xf=vf-hf.top-hf.bottom,wf=yf-hf.left-hf.right,s1=Vt$1(vf-hf[bf],xf),If=Vt$1(yf-hf[Sf],wf),l1=!Ai.middlewareData.shift;let c1=s1,m1=If;if((bo=Ai.middlewareData.shift)!=null&&bo.enabled.x&&(m1=wf),(Ra=Ai.middlewareData.shift)!=null&&Ra.enabled.y&&(c1=xf),l1&&!mf){const N1=Xe$2(hf.left,0),R1=Xe$2(hf.right,0),$1=Xe$2(hf.top,0),D1=Xe$2(hf.bottom,0);gf?m1=yf-2*(N1!==0||R1!==0?N1+R1:Xe$2(hf.left,hf.right)):c1=vf-2*($1!==0||D1!==0?$1+D1:Xe$2(hf.top,hf.bottom))}await df({...Ai,availableWidth:m1,availableHeight:c1});const k1=await mc.getDimensions(uf.floating);return yf!==k1.width||vf!==k1.height?{reset:{rects:!0}}:{}}}};function Jr$2(){return typeof window<"u"}function wn$2(vo){return tl(vo)?(vo.nodeName||"").toLowerCase():"#document"}function Ze$1(vo){var Ai;return(vo==null||(Ai=vo.ownerDocument)==null?void 0:Ai.defaultView)||window}function yt$2(vo){var Ai;return(Ai=(tl(vo)?vo.ownerDocument:vo.document)||window.document)==null?void 0:Ai.documentElement}function tl(vo){return Jr$2()?vo instanceof Node||vo instanceof Ze$1(vo).Node:!1}function rt$1(vo){return Jr$2()?vo instanceof Element||vo instanceof Ze$1(vo).Element:!1}function bt$1(vo){return Jr$2()?vo instanceof HTMLElement||vo instanceof Ze$1(vo).HTMLElement:!1}function as$1(vo){return!Jr$2()||typeof ShadowRoot>"u"?!1:vo instanceof ShadowRoot||vo instanceof Ze$1(vo).ShadowRoot}function Zn$1(vo){const{overflow:Ai,overflowX:bo,overflowY:Ra,display:hc}=ot$1(vo);return/auto|scroll|overlay|hidden|clip/.test(Ai+Ra+bo)&&!["inline","contents"].includes(hc)}function mh(vo){return["table","td","th"].includes(wn$2(vo))}function eo$2(vo){return[":popover-open",":modal"].some(Ai=>{try{return vo.matches(Ai)}catch{return!1}})}function qa(vo){const Ai=Xa$1(),bo=rt$1(vo)?ot$1(vo):vo;return bo.transform!=="none"||bo.perspective!=="none"||(bo.containerType?bo.containerType!=="normal":!1)||!Ai&&(bo.backdropFilter?bo.backdropFilter!=="none":!1)||!Ai&&(bo.filter?bo.filter!=="none":!1)||["transform","perspective","filter"].some(Ra=>(bo.willChange||"").includes(Ra))||["paint","layout","strict","content"].some(Ra=>(bo.contain||"").includes(Ra))}function ph(vo){let Ai=$t$2(vo);for(;bt$1(Ai)&&!hn$1(Ai);){if(qa(Ai))return Ai;if(eo$2(Ai))return null;Ai=$t$2(Ai)}return null}function Xa$1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function hn$1(vo){return["html","body","#document"].includes(wn$2(vo))}function ot$1(vo){return Ze$1(vo).getComputedStyle(vo)}function to$2(vo){return rt$1(vo)?{scrollLeft:vo.scrollLeft,scrollTop:vo.scrollTop}:{scrollLeft:vo.scrollX,scrollTop:vo.scrollY}}function $t$2(vo){if(wn$2(vo)==="html")return vo;const Ai=vo.assignedSlot||vo.parentNode||as$1(vo)&&vo.host||yt$2(vo);return as$1(Ai)?Ai.host:Ai}function nl(vo){const Ai=$t$2(vo);return hn$1(Ai)?vo.ownerDocument?vo.ownerDocument.body:vo.body:bt$1(Ai)&&Zn$1(Ai)?Ai:nl(Ai)}function Hn$2(vo,Ai,bo){var Ra;Ai===void 0&&(Ai=[]),bo===void 0&&(bo=!0);const hc=nl(vo),pc=hc===((Ra=vo.ownerDocument)==null?void 0:Ra.body),mc=Ze$1(hc);if(pc){const uf=wa(mc);return Ai.concat(mc,mc.visualViewport||[],Zn$1(hc)?hc:[],uf&&bo?Hn$2(uf):[])}return Ai.concat(hc,Hn$2(hc,[],bo))}function wa(vo){return vo.parent&&Object.getPrototypeOf(vo.parent)?vo.frameElement:null}function rl(vo){const Ai=ot$1(vo);let bo=parseFloat(Ai.width)||0,Ra=parseFloat(Ai.height)||0;const hc=bt$1(vo),pc=hc?vo.offsetWidth:bo,mc=hc?vo.offsetHeight:Ra,uf=Ar$2(bo)!==pc||Ar$2(Ra)!==mc;return uf&&(bo=pc,Ra=mc),{width:bo,height:Ra,$:uf}}function Ka$1(vo){return rt$1(vo)?vo:vo.contextElement}function un$1(vo){const Ai=Ka$1(vo);if(!bt$1(Ai))return vt$2(1);const bo=Ai.getBoundingClientRect(),{width:Ra,height:hc,$:pc}=rl(Ai);let mc=(pc?Ar$2(bo.width):bo.width)/Ra,uf=(pc?Ar$2(bo.height):bo.height)/hc;return(!mc||!Number.isFinite(mc))&&(mc=1),(!uf||!Number.isFinite(uf))&&(uf=1),{x:mc,y:uf}}const hh=vt$2(0);function ol(vo){const Ai=Ze$1(vo);return!Xa$1()||!Ai.visualViewport?hh:{x:Ai.visualViewport.offsetLeft,y:Ai.visualViewport.offsetTop}}function gh(vo,Ai,bo){return Ai===void 0&&(Ai=!1),!bo||Ai&&bo!==Ze$1(vo)?!1:Ai}function qt$1(vo,Ai,bo,Ra){Ai===void 0&&(Ai=!1),bo===void 0&&(bo=!1);const hc=vo.getBoundingClientRect(),pc=Ka$1(vo);let mc=vt$2(1);Ai&&(Ra?rt$1(Ra)&&(mc=un$1(Ra)):mc=un$1(vo));const uf=gh(pc,bo,Ra)?ol(pc):vt$2(0);let df=(hc.left+uf.x)/mc.x,ff=(hc.top+uf.y)/mc.y,hf=hc.width/mc.x,pf=hc.height/mc.y;if(pc){const mf=Ze$1(pc),gf=Ra&&rt$1(Ra)?Ze$1(Ra):Ra;let yf=mf,vf=wa(yf);for(;vf&&Ra&&gf!==yf;){const bf=un$1(vf),Sf=vf.getBoundingClientRect(),xf=ot$1(vf),wf=Sf.left+(vf.clientLeft+parseFloat(xf.paddingLeft))*bf.x,s1=Sf.top+(vf.clientTop+parseFloat(xf.paddingTop))*bf.y;df*=bf.x,ff*=bf.y,hf*=bf.x,pf*=bf.y,df+=wf,ff+=s1,yf=Ze$1(vf),vf=wa(yf)}}return Rr$2({width:hf,height:pf,x:df,y:ff})}function Za(vo,Ai){const bo=to$2(vo).scrollLeft;return Ai?Ai.left+bo:qt$1(yt$2(vo)).left+bo}function al(vo,Ai,bo){bo===void 0&&(bo=!1);const Ra=vo.getBoundingClientRect(),hc=Ra.left+Ai.scrollLeft-(bo?0:Za(vo,Ra)),pc=Ra.top+Ai.scrollTop;return{x:hc,y:pc}}function vh(vo){let{elements:Ai,rect:bo,offsetParent:Ra,strategy:hc}=vo;const pc=hc==="fixed",mc=yt$2(Ra),uf=Ai?eo$2(Ai.floating):!1;if(Ra===mc||uf&&pc)return bo;let df={scrollLeft:0,scrollTop:0},ff=vt$2(1);const hf=vt$2(0),pf=bt$1(Ra);if((pf||!pf&&!pc)&&((wn$2(Ra)!=="body"||Zn$1(mc))&&(df=to$2(Ra)),bt$1(Ra))){const gf=qt$1(Ra);ff=un$1(Ra),hf.x=gf.x+Ra.clientLeft,hf.y=gf.y+Ra.clientTop}const mf=mc&&!pf&&!pc?al(mc,df,!0):vt$2(0);return{width:bo.width*ff.x,height:bo.height*ff.y,x:bo.x*ff.x-df.scrollLeft*ff.x+hf.x+mf.x,y:bo.y*ff.y-df.scrollTop*ff.y+hf.y+mf.y}}function bh(vo){return Array.from(vo.getClientRects())}function yh(vo){const Ai=yt$2(vo),bo=to$2(vo),Ra=vo.ownerDocument.body,hc=Xe$2(Ai.scrollWidth,Ai.clientWidth,Ra.scrollWidth,Ra.clientWidth),pc=Xe$2(Ai.scrollHeight,Ai.clientHeight,Ra.scrollHeight,Ra.clientHeight);let mc=-bo.scrollLeft+Za(vo);const uf=-bo.scrollTop;return ot$1(Ra).direction==="rtl"&&(mc+=Xe$2(Ai.clientWidth,Ra.clientWidth)-hc),{width:hc,height:pc,x:mc,y:uf}}function wh(vo,Ai){const bo=Ze$1(vo),Ra=yt$2(vo),hc=bo.visualViewport;let pc=Ra.clientWidth,mc=Ra.clientHeight,uf=0,df=0;if(hc){pc=hc.width,mc=hc.height;const ff=Xa$1();(!ff||ff&&Ai==="fixed")&&(uf=hc.offsetLeft,df=hc.offsetTop)}return{width:pc,height:mc,x:uf,y:df}}function xh(vo,Ai){const bo=qt$1(vo,!0,Ai==="fixed"),Ra=bo.top+vo.clientTop,hc=bo.left+vo.clientLeft,pc=bt$1(vo)?un$1(vo):vt$2(1),mc=vo.clientWidth*pc.x,uf=vo.clientHeight*pc.y,df=hc*pc.x,ff=Ra*pc.y;return{width:mc,height:uf,x:df,y:ff}}function is$1(vo,Ai,bo){let Ra;if(Ai==="viewport")Ra=wh(vo,bo);else if(Ai==="document")Ra=yh(yt$2(vo));else if(rt$1(Ai))Ra=xh(Ai,bo);else{const hc=ol(vo);Ra={x:Ai.x-hc.x,y:Ai.y-hc.y,width:Ai.width,height:Ai.height}}return Rr$2(Ra)}function il(vo,Ai){const bo=$t$2(vo);return bo===Ai||!rt$1(bo)||hn$1(bo)?!1:ot$1(bo).position==="fixed"||il(bo,Ai)}function Sh(vo,Ai){const bo=Ai.get(vo);if(bo)return bo;let Ra=Hn$2(vo,[],!1).filter(uf=>rt$1(uf)&&wn$2(uf)!=="body"),hc=null;const pc=ot$1(vo).position==="fixed";let mc=pc?$t$2(vo):vo;for(;rt$1(mc)&&!hn$1(mc);){const uf=ot$1(mc),df=qa(mc);!df&&uf.position==="fixed"&&(hc=null),(pc?!df&&!hc:!df&&uf.position==="static"&&hc&&["absolute","fixed"].includes(hc.position)||Zn$1(mc)&&!df&&il(vo,mc))?Ra=Ra.filter(ff=>ff!==mc):hc=uf,mc=$t$2(mc)}return Ai.set(vo,Ra),Ra}function Ch(vo){let{element:Ai,boundary:bo,rootBoundary:Ra,strategy:hc}=vo;const pc=[...bo==="clippingAncestors"?eo$2(Ai)?[]:Sh(Ai,this._c):[].concat(bo),Ra],mc=pc[0],uf=pc.reduce((df,ff)=>{const hf=is$1(Ai,ff,hc);return df.top=Xe$2(hf.top,df.top),df.right=Vt$1(hf.right,df.right),df.bottom=Vt$1(hf.bottom,df.bottom),df.left=Xe$2(hf.left,df.left),df},is$1(Ai,mc,hc));return{width:uf.right-uf.left,height:uf.bottom-uf.top,x:uf.left,y:uf.top}}function Ih(vo){const{width:Ai,height:bo}=rl(vo);return{width:Ai,height:bo}}function Eh(vo,Ai,bo){const Ra=bt$1(Ai),hc=yt$2(Ai),pc=bo==="fixed",mc=qt$1(vo,!0,pc,Ai);let uf={scrollLeft:0,scrollTop:0};const df=vt$2(0);if(Ra||!Ra&&!pc)if((wn$2(Ai)!=="body"||Zn$1(hc))&&(uf=to$2(Ai)),Ra){const mf=qt$1(Ai,!0,pc,Ai);df.x=mf.x+Ai.clientLeft,df.y=mf.y+Ai.clientTop}else hc&&(df.x=Za(hc));const ff=hc&&!Ra&&!pc?al(hc,uf):vt$2(0),hf=mc.left+uf.scrollLeft-df.x-ff.x,pf=mc.top+uf.scrollTop-df.y-ff.y;return{x:hf,y:pf,width:mc.width,height:mc.height}}function ko(vo){return ot$1(vo).position==="static"}function ss$1(vo,Ai){if(!bt$1(vo)||ot$1(vo).position==="fixed")return null;if(Ai)return Ai(vo);let bo=vo.offsetParent;return yt$2(vo)===bo&&(bo=bo.ownerDocument.body),bo}function sl(vo,Ai){const bo=Ze$1(vo);if(eo$2(vo))return bo;if(!bt$1(vo)){let hc=$t$2(vo);for(;hc&&!hn$1(hc);){if(rt$1(hc)&&!ko(hc))return hc;hc=$t$2(hc)}return bo}let Ra=ss$1(vo,Ai);for(;Ra&&mh(Ra)&&ko(Ra);)Ra=ss$1(Ra,Ai);return Ra&&hn$1(Ra)&&ko(Ra)&&!qa(Ra)?bo:Ra||ph(vo)||bo}const Ph=async function(vo){const Ai=this.getOffsetParent||sl,bo=this.getDimensions,Ra=await bo(vo.floating);return{reference:Eh(vo.reference,await Ai(vo.floating),vo.strategy),floating:{x:0,y:0,width:Ra.width,height:Ra.height}}};function Th(vo){return ot$1(vo).direction==="rtl"}const Oh={convertOffsetParentRelativeRectToViewportRelativeRect:vh,getDocumentElement:yt$2,getClippingRect:Ch,getOffsetParent:sl,getElementRects:Ph,getClientRects:bh,getDimensions:Ih,getScale:un$1,isElement:rt$1,isRTL:Th};function Mh(vo,Ai){let bo=null,Ra;const hc=yt$2(vo);function pc(){var uf;clearTimeout(Ra),(uf=bo)==null||uf.disconnect(),bo=null}function mc(uf,df){uf===void 0&&(uf=!1),df===void 0&&(df=1),pc();const{left:ff,top:hf,width:pf,height:mf}=vo.getBoundingClientRect();if(uf||Ai(),!pf||!mf)return;const gf=ir$1(hf),yf=ir$1(hc.clientWidth-(ff+pf)),vf=ir$1(hc.clientHeight-(hf+mf)),bf=ir$1(ff),Sf={rootMargin:-gf+"px "+-yf+"px "+-vf+"px "+-bf+"px",threshold:Xe$2(0,Vt$1(1,df))||1};let xf=!0;function wf(s1){const If=s1[0].intersectionRatio;if(If!==df){if(!xf)return mc();If?mc(!1,If):Ra=setTimeout(()=>{mc(!1,1e-7)},1e3)}xf=!1}try{bo=new IntersectionObserver(wf,{...Sf,root:hc.ownerDocument})}catch{bo=new IntersectionObserver(wf,Sf)}bo.observe(vo)}return mc(!0),pc}function cl(vo,Ai,bo,Ra){Ra===void 0&&(Ra={});const{ancestorScroll:hc=!0,ancestorResize:pc=!0,elementResize:mc=typeof ResizeObserver=="function",layoutShift:uf=typeof IntersectionObserver=="function",animationFrame:df=!1}=Ra,ff=Ka$1(vo),hf=hc||pc?[...ff?Hn$2(ff):[],...Hn$2(Ai)]:[];hf.forEach(Sf=>{hc&&Sf.addEventListener("scroll",bo,{passive:!0}),pc&&Sf.addEventListener("resize",bo)});const pf=ff&&uf?Mh(ff,bo):null;let mf=-1,gf=null;mc&&(gf=new ResizeObserver(Sf=>{let[xf]=Sf;xf&&xf.target===ff&&gf&&(gf.unobserve(Ai),cancelAnimationFrame(mf),mf=requestAnimationFrame(()=>{var wf;(wf=gf)==null||wf.observe(Ai)})),bo()}),ff&&!df&&gf.observe(ff),gf.observe(Ai));let yf,vf=df?qt$1(vo):null;df&&bf();function bf(){const Sf=qt$1(vo);vf&&(Sf.x!==vf.x||Sf.y!==vf.y||Sf.width!==vf.width||Sf.height!==vf.height)&&bo(),vf=Sf,yf=requestAnimationFrame(bf)}return bo(),()=>{var Sf;hf.forEach(xf=>{hc&&xf.removeEventListener("scroll",bo),pc&&xf.removeEventListener("resize",bo)}),pf==null||pf(),(Sf=gf)==null||Sf.disconnect(),gf=null,df&&cancelAnimationFrame(yf)}}const Nh=lh,Ah=uh,Dh=ih,Rh=fh,_h=sh,cs=ah,kh=dh,Fh=(vo,Ai,bo)=>{const Ra=new Map,hc={platform:Oh,...bo},pc={...hc.platform,_c:Ra};return oh(vo,Ai,{...hc,platform:pc})};var xa=useLayoutEffect,Vh=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],_r$2=function(){};function Lh(vo,Ai){return Ai?Ai[0]==="-"?vo+Ai:vo+"__"+Ai:vo}function $h(vo,Ai){for(var bo=arguments.length,Ra=new Array(bo>2?bo-2:0),hc=2;hc<bo;hc++)Ra[hc-2]=arguments[hc];var pc=[].concat(Ra);if(Ai&&vo)for(var mc in Ai)Ai.hasOwnProperty(mc)&&Ai[mc]&&pc.push("".concat(Lh(vo,mc)));return pc.filter(function(uf){return uf}).map(function(uf){return String(uf).trim()}).join(" ")}var ls$1=function(vo){return qh(vo)?vo.filter(Boolean):Ci$1(vo)==="object"&&vo!==null?[vo]:[]},ll=function(vo){vo.className,vo.clearValue,vo.cx,vo.getStyles,vo.getClassNames,vo.getValue,vo.hasValue,vo.isMulti,vo.isRtl,vo.options,vo.selectOption,vo.selectProps,vo.setValue,vo.theme;var Ai=Et$2(vo,Vh);return te$2({},Ai)},Ee$2=function(vo,Ai,bo){var Ra=vo.cx,hc=vo.getStyles,pc=vo.getClassNames,mc=vo.className;return{css:hc(Ai,vo),className:Ra(bo??{},pc(Ai,vo),mc)}};function no$1(vo){return[document.documentElement,document.body,window].indexOf(vo)>-1}function Uh(vo){return no$1(vo)?window.innerHeight:vo.clientHeight}function ul(vo){return no$1(vo)?window.pageYOffset:vo.scrollTop}function kr$2(vo,Ai){if(no$1(vo)){window.scrollTo(0,Ai);return}vo.scrollTop=Ai}function Hh(vo){var Ai=getComputedStyle(vo),bo=Ai.position==="absolute",Ra=/(auto|scroll)/;if(Ai.position==="fixed")return document.documentElement;for(var hc=vo;hc=hc.parentElement;)if(Ai=getComputedStyle(hc),!(bo&&Ai.position==="static")&&Ra.test(Ai.overflow+Ai.overflowY+Ai.overflowX))return hc;return document.documentElement}function Wh(vo,Ai,bo,Ra){return bo*((vo=vo/Ra-1)*vo*vo+1)+Ai}function sr$1(vo,Ai){var bo=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,Ra=arguments.length>3&&arguments[3]!==void 0?arguments[3]:_r$2,hc=ul(vo),pc=Ai-hc,mc=10,uf=0;function df(){uf+=mc;var ff=Wh(uf,hc,pc,bo);kr$2(vo,ff),uf<bo?window.requestAnimationFrame(df):Ra(vo)}df()}function us(vo,Ai){var bo=vo.getBoundingClientRect(),Ra=Ai.getBoundingClientRect(),hc=Ai.offsetHeight/3;Ra.bottom+hc>bo.bottom?kr$2(vo,Math.min(Ai.offsetTop+Ai.clientHeight-vo.offsetHeight+hc,vo.scrollHeight)):Ra.top-hc<bo.top&&kr$2(vo,Math.max(Ai.offsetTop-hc,0))}function Bh(vo){var Ai=vo.getBoundingClientRect();return{bottom:Ai.bottom,height:Ai.height,left:Ai.left,right:Ai.right,top:Ai.top,width:Ai.width}}function ds(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function zh(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var dl=!1,jh={get passive(){return dl=!0}},cr$1=typeof window<"u"?window:{};cr$1.addEventListener&&cr$1.removeEventListener&&(cr$1.addEventListener("p",_r$2,jh),cr$1.removeEventListener("p",_r$2,!1));var Yh=dl;function Gh(vo){return vo!=null}function qh(vo){return Array.isArray(vo)}function lr$1(vo,Ai,bo){return vo?Ai:bo}var Xh=function(vo){for(var Ai=arguments.length,bo=new Array(Ai>1?Ai-1:0),Ra=1;Ra<Ai;Ra++)bo[Ra-1]=arguments[Ra];var hc=Object.entries(vo).filter(function(pc){var mc=St$1(pc,1),uf=mc[0];return!bo.includes(uf)});return hc.reduce(function(pc,mc){var uf=St$1(mc,2),df=uf[0],ff=uf[1];return pc[df]=ff,pc},{})},Kh=["children","innerProps"],Zh=["children","innerProps"];function Qh(vo){var Ai=vo.maxHeight,bo=vo.menuEl,Ra=vo.minHeight,hc=vo.placement,pc=vo.shouldScroll,mc=vo.isFixedPosition,uf=vo.controlHeight,df=Hh(bo),ff={placement:"bottom",maxHeight:Ai};if(!bo||!bo.offsetParent)return ff;var hf=df.getBoundingClientRect(),pf=hf.height,mf=bo.getBoundingClientRect(),gf=mf.bottom,yf=mf.height,vf=mf.top,bf=bo.offsetParent.getBoundingClientRect(),Sf=bf.top,xf=mc?window.innerHeight:Uh(df),wf=ul(df),s1=parseInt(getComputedStyle(bo).marginBottom,10),If=parseInt(getComputedStyle(bo).marginTop,10),l1=Sf-If,c1=xf-vf,m1=l1+wf,k1=pf-wf-vf,N1=gf-xf+wf+s1,R1=wf+vf-If,$1=160;switch(hc){case"auto":case"bottom":if(c1>=yf)return{placement:"bottom",maxHeight:Ai};if(k1>=yf&&!mc)return pc&&sr$1(df,N1,$1),{placement:"bottom",maxHeight:Ai};if(!mc&&k1>=Ra||mc&&c1>=Ra){pc&&sr$1(df,N1,$1);var D1=mc?c1-s1:k1-s1;return{placement:"bottom",maxHeight:D1}}if(hc==="auto"||mc){var f1=Ai,T1=mc?l1:m1;return T1>=Ra&&(f1=Math.min(T1-s1-uf,Ai)),{placement:"top",maxHeight:f1}}if(hc==="bottom")return pc&&kr$2(df,N1),{placement:"bottom",maxHeight:Ai};break;case"top":if(l1>=yf)return{placement:"top",maxHeight:Ai};if(m1>=yf&&!mc)return pc&&sr$1(df,R1,$1),{placement:"top",maxHeight:Ai};if(!mc&&m1>=Ra||mc&&l1>=Ra){var A1=Ai;return(!mc&&m1>=Ra||mc&&l1>=Ra)&&(A1=mc?l1-If:m1-If),pc&&sr$1(df,R1,$1),{placement:"top",maxHeight:A1}}return{placement:"bottom",maxHeight:Ai};default:throw new Error('Invalid placement provided "'.concat(hc,'".'))}return ff}function Jh(vo){var Ai={bottom:"top",top:"bottom"};return vo?Ai[vo]:"bottom"}var fl=function(vo){return vo==="auto"?"bottom":vo},eg=function(vo,Ai){var bo,Ra=vo.placement,hc=vo.theme,pc=hc.borderRadius,mc=hc.spacing,uf=hc.colors;return te$2((bo={label:"menu"},Ir$3(bo,Jh(Ra),"100%"),Ir$3(bo,"position","absolute"),Ir$3(bo,"width","100%"),Ir$3(bo,"zIndex",1),bo),Ai?{}:{backgroundColor:uf.neutral0,borderRadius:pc,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:mc.menuGutter,marginTop:mc.menuGutter})},ml=createContext(null),tg=function(vo){var Ai=vo.children,bo=vo.minMenuHeight,Ra=vo.maxMenuHeight,hc=vo.menuPlacement,pc=vo.menuPosition,mc=vo.menuShouldScrollIntoView,uf=vo.theme,df=useContext(ml)||{},ff=df.setPortalPlacement,hf=useRef(null),pf=useState(Ra),mf=St$1(pf,2),gf=mf[0],yf=mf[1],vf=useState(null),bf=St$1(vf,2),Sf=bf[0],xf=bf[1],wf=uf.spacing.controlHeight;return xa(function(){var s1=hf.current;if(s1){var If=pc==="fixed",l1=mc&&!If,c1=Qh({maxHeight:Ra,menuEl:s1,minHeight:bo,placement:hc,shouldScroll:l1,isFixedPosition:If,controlHeight:wf});yf(c1.maxHeight),xf(c1.placement),ff==null||ff(c1.placement)}},[Ra,hc,pc,mc,bo,ff,wf]),Ai({ref:hf,placerProps:te$2(te$2({},vo),{},{placement:Sf||fl(hc),maxHeight:gf})})},ng=function(vo){var Ai=vo.children,bo=vo.innerRef,Ra=vo.innerProps;return Q$1("div",Hr$3({},Ee$2(vo,"menu",{menu:!0}),{ref:bo},Ra),Ai)},rg=ng,og=function(vo,Ai){var bo=vo.maxHeight,Ra=vo.theme.spacing.baseUnit;return te$2({maxHeight:bo,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},Ai?{}:{paddingBottom:Ra,paddingTop:Ra})},ag=function(vo){var Ai=vo.children,bo=vo.innerProps,Ra=vo.innerRef,hc=vo.isMulti;return Q$1("div",Hr$3({},Ee$2(vo,"menuList",{"menu-list":!0,"menu-list--is-multi":hc}),{ref:Ra},bo),Ai)},pl=function(vo,Ai){var bo=vo.theme,Ra=bo.spacing.baseUnit,hc=bo.colors;return te$2({textAlign:"center"},Ai?{}:{color:hc.neutral40,padding:"".concat(Ra*2,"px ").concat(Ra*3,"px")})},ig=pl,sg=pl,cg=function(vo){var Ai=vo.children,bo=Ai===void 0?"No options":Ai,Ra=vo.innerProps,hc=Et$2(vo,Kh);return Q$1("div",Hr$3({},Ee$2(te$2(te$2({},hc),{},{children:bo,innerProps:Ra}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),Ra),bo)},lg=function(vo){var Ai=vo.children,bo=Ai===void 0?"Loading...":Ai,Ra=vo.innerProps,hc=Et$2(vo,Zh);return Q$1("div",Hr$3({},Ee$2(te$2(te$2({},hc),{},{children:bo,innerProps:Ra}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),Ra),bo)},ug=function(vo){var Ai=vo.rect,bo=vo.offset,Ra=vo.position;return{left:Ai.left,position:Ra,top:bo,width:Ai.width,zIndex:1}},dg=function(vo){var Ai=vo.appendTo,bo=vo.children,Ra=vo.controlElement,hc=vo.innerProps,pc=vo.menuPlacement,mc=vo.menuPosition,uf=useRef(null),df=useRef(null),ff=useState(fl(pc)),hf=St$1(ff,2),pf=hf[0],mf=hf[1],gf=useMemo(function(){return{setPortalPlacement:mf}},[]),yf=useState(null),vf=St$1(yf,2),bf=vf[0],Sf=vf[1],xf=useCallback(function(){if(Ra){var l1=Bh(Ra),c1=mc==="fixed"?0:window.pageYOffset,m1=l1[pf]+c1;(m1!==(bf==null?void 0:bf.offset)||l1.left!==(bf==null?void 0:bf.rect.left)||l1.width!==(bf==null?void 0:bf.rect.width))&&Sf({offset:m1,rect:l1})}},[Ra,mc,pf,bf==null?void 0:bf.offset,bf==null?void 0:bf.rect.left,bf==null?void 0:bf.rect.width]);xa(function(){xf()},[xf]);var wf=useCallback(function(){typeof df.current=="function"&&(df.current(),df.current=null),Ra&&uf.current&&(df.current=cl(Ra,uf.current,xf,{elementResize:"ResizeObserver"in window}))},[Ra,xf]);xa(function(){wf()},[wf]);var s1=useCallback(function(l1){uf.current=l1,wf()},[wf]);if(!Ai&&mc!=="fixed"||!bf)return null;var If=Q$1("div",Hr$3({ref:s1},Ee$2(te$2(te$2({},vo),{},{offset:bf.offset,position:mc,rect:bf.rect}),"menuPortal",{"menu-portal":!0}),hc),bo);return Q$1(ml.Provider,{value:gf},Ai?createPortal(If,Ai):If)},fg=function(vo){var Ai=vo.isDisabled,bo=vo.isRtl;return{label:"container",direction:bo?"rtl":void 0,pointerEvents:Ai?"none":void 0,position:"relative"}},mg=function(vo){var Ai=vo.children,bo=vo.innerProps,Ra=vo.isDisabled,hc=vo.isRtl;return Q$1("div",Hr$3({},Ee$2(vo,"container",{"--is-disabled":Ra,"--is-rtl":hc}),bo),Ai)},pg=function(vo,Ai){var bo=vo.theme.spacing,Ra=vo.isMulti,hc=vo.hasValue,pc=vo.selectProps.controlShouldRenderValue;return te$2({alignItems:"center",display:Ra&&hc&&pc?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},Ai?{}:{padding:"".concat(bo.baseUnit/2,"px ").concat(bo.baseUnit*2,"px")})},hg=function(vo){var Ai=vo.children,bo=vo.innerProps,Ra=vo.isMulti,hc=vo.hasValue;return Q$1("div",Hr$3({},Ee$2(vo,"valueContainer",{"value-container":!0,"value-container--is-multi":Ra,"value-container--has-value":hc}),bo),Ai)},gg=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},vg=function(vo){var Ai=vo.children,bo=vo.innerProps;return Q$1("div",Hr$3({},Ee$2(vo,"indicatorsContainer",{indicators:!0}),bo),Ai)},fs$1,bg=["size"],yg=["innerProps","isRtl","size"],wg={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},hl=function(vo){var Ai=vo.size,bo=Et$2(vo,bg);return Q$1("svg",Hr$3({height:Ai,width:Ai,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:wg},bo))},Qa=function(vo){return Q$1(hl,Hr$3({size:20},vo),Q$1("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},gl=function(vo){return Q$1(hl,Hr$3({size:20},vo),Q$1("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},vl=function(vo,Ai){var bo=vo.isFocused,Ra=vo.theme,hc=Ra.spacing.baseUnit,pc=Ra.colors;return te$2({label:"indicatorContainer",display:"flex",transition:"color 150ms"},Ai?{}:{color:bo?pc.neutral60:pc.neutral20,padding:hc*2,":hover":{color:bo?pc.neutral80:pc.neutral40}})},xg=vl,Sg=function(vo){var Ai=vo.children,bo=vo.innerProps;return Q$1("div",Hr$3({},Ee$2(vo,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),bo),Ai||Q$1(gl,null))},Cg=vl,Ig=function(vo){var Ai=vo.children,bo=vo.innerProps;return Q$1("div",Hr$3({},Ee$2(vo,"clearIndicator",{indicator:!0,"clear-indicator":!0}),bo),Ai||Q$1(Qa,null))},Eg=function(vo,Ai){var bo=vo.isDisabled,Ra=vo.theme,hc=Ra.spacing.baseUnit,pc=Ra.colors;return te$2({label:"indicatorSeparator",alignSelf:"stretch",width:1},Ai?{}:{backgroundColor:bo?pc.neutral10:pc.neutral20,marginBottom:hc*2,marginTop:hc*2})},Pg=function(vo){var Ai=vo.innerProps;return Q$1("span",Hr$3({},Ai,Ee$2(vo,"indicatorSeparator",{"indicator-separator":!0})))},Tg=qp(fs$1||(fs$1=Xp([`
|
|
12
|
-
0%, 80%, 100% { opacity: 0; }
|
|
13
|
-
40% { opacity: 1; }
|
|
14
|
-
`]))),Og=function(vo,Ai){var bo=vo.isFocused,Ra=vo.size,hc=vo.theme,pc=hc.colors,mc=hc.spacing.baseUnit;return te$2({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:Ra,lineHeight:1,marginRight:Ra,textAlign:"center",verticalAlign:"middle"},Ai?{}:{color:bo?pc.neutral60:pc.neutral20,padding:mc*2})},Fo$1=function(vo){var Ai=vo.delay,bo=vo.offset;return Q$1("span",{css:za({animation:"".concat(Tg," 1s ease-in-out ").concat(Ai,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:bo?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Mg=function(vo){var Ai=vo.innerProps,bo=vo.isRtl,Ra=vo.size,hc=Ra===void 0?4:Ra,pc=Et$2(vo,yg);return Q$1("div",Hr$3({},Ee$2(te$2(te$2({},pc),{},{innerProps:Ai,isRtl:bo,size:hc}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),Ai),Q$1(Fo$1,{delay:0,offset:bo}),Q$1(Fo$1,{delay:160,offset:!0}),Q$1(Fo$1,{delay:320,offset:!bo}))},Ng=function(vo,Ai){var bo=vo.isDisabled,Ra=vo.isFocused,hc=vo.theme,pc=hc.colors,mc=hc.borderRadius,uf=hc.spacing;return te$2({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:uf.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},Ai?{}:{backgroundColor:bo?pc.neutral5:pc.neutral0,borderColor:bo?pc.neutral10:Ra?pc.primary:pc.neutral20,borderRadius:mc,borderStyle:"solid",borderWidth:1,boxShadow:Ra?"0 0 0 1px ".concat(pc.primary):void 0,"&:hover":{borderColor:Ra?pc.primary:pc.neutral30}})},Ag=function(vo){var Ai=vo.children,bo=vo.isDisabled,Ra=vo.isFocused,hc=vo.innerRef,pc=vo.innerProps,mc=vo.menuIsOpen;return Q$1("div",Hr$3({ref:hc},Ee$2(vo,"control",{control:!0,"control--is-disabled":bo,"control--is-focused":Ra,"control--menu-is-open":mc}),pc,{"aria-disabled":bo||void 0}),Ai)},Dg=Ag,Rg=["data"],_g=function(vo,Ai){var bo=vo.theme.spacing;return Ai?{}:{paddingBottom:bo.baseUnit*2,paddingTop:bo.baseUnit*2}},kg=function(vo){var Ai=vo.children,bo=vo.cx,Ra=vo.getStyles,hc=vo.getClassNames,pc=vo.Heading,mc=vo.headingProps,uf=vo.innerProps,df=vo.label,ff=vo.theme,hf=vo.selectProps;return Q$1("div",Hr$3({},Ee$2(vo,"group",{group:!0}),uf),Q$1(pc,Hr$3({},mc,{selectProps:hf,theme:ff,getStyles:Ra,getClassNames:hc,cx:bo}),df),Q$1("div",null,Ai))},Fg=function(vo,Ai){var bo=vo.theme,Ra=bo.colors,hc=bo.spacing;return te$2({label:"group",cursor:"default",display:"block"},Ai?{}:{color:Ra.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:hc.baseUnit*3,paddingRight:hc.baseUnit*3,textTransform:"uppercase"})},Vg=function(vo){var Ai=ll(vo);Ai.data;var bo=Et$2(Ai,Rg);return Q$1("div",Hr$3({},Ee$2(vo,"groupHeading",{"group-heading":!0}),bo))},Lg=kg,$g=["innerRef","isDisabled","isHidden","inputClassName"],Ug=function(vo,Ai){var bo=vo.isDisabled,Ra=vo.value,hc=vo.theme,pc=hc.spacing,mc=hc.colors;return te$2(te$2({visibility:bo?"hidden":"visible",transform:Ra?"translateZ(0)":""},Hg),Ai?{}:{margin:pc.baseUnit/2,paddingBottom:pc.baseUnit/2,paddingTop:pc.baseUnit/2,color:mc.neutral80})},bl={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Hg={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":te$2({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},bl)},Wg=function(vo){return te$2({label:"input",color:"inherit",background:0,opacity:vo?0:1,width:"100%"},bl)},Bg=function(vo){var Ai=vo.cx,bo=vo.value,Ra=ll(vo),hc=Ra.innerRef,pc=Ra.isDisabled,mc=Ra.isHidden,uf=Ra.inputClassName,df=Et$2(Ra,$g);return Q$1("div",Hr$3({},Ee$2(vo,"input",{"input-container":!0}),{"data-value":bo||""}),Q$1("input",Hr$3({className:Ai({input:!0},uf),ref:hc,style:Wg(mc),disabled:pc},df)))},zg=Bg,jg=function(vo,Ai){var bo=vo.theme,Ra=bo.spacing,hc=bo.borderRadius,pc=bo.colors;return te$2({label:"multiValue",display:"flex",minWidth:0},Ai?{}:{backgroundColor:pc.neutral10,borderRadius:hc/2,margin:Ra.baseUnit/2})},Yg=function(vo,Ai){var bo=vo.theme,Ra=bo.borderRadius,hc=bo.colors,pc=vo.cropWithEllipsis;return te$2({overflow:"hidden",textOverflow:pc||pc===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},Ai?{}:{borderRadius:Ra/2,color:hc.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},Gg=function(vo,Ai){var bo=vo.theme,Ra=bo.spacing,hc=bo.borderRadius,pc=bo.colors,mc=vo.isFocused;return te$2({alignItems:"center",display:"flex"},Ai?{}:{borderRadius:hc/2,backgroundColor:mc?pc.dangerLight:void 0,paddingLeft:Ra.baseUnit,paddingRight:Ra.baseUnit,":hover":{backgroundColor:pc.dangerLight,color:pc.danger}})},yl=function(vo){var Ai=vo.children,bo=vo.innerProps;return Q$1("div",bo,Ai)},qg=yl,Xg=yl;function Kg(vo){var Ai=vo.children,bo=vo.innerProps;return Q$1("div",Hr$3({role:"button"},bo),Ai||Q$1(Qa,{size:14}))}var Zg=function(vo){var Ai=vo.children,bo=vo.components,Ra=vo.data,hc=vo.innerProps,pc=vo.isDisabled,mc=vo.removeProps,uf=vo.selectProps,df=bo.Container,ff=bo.Label,hf=bo.Remove;return Q$1(df,{data:Ra,innerProps:te$2(te$2({},Ee$2(vo,"multiValue",{"multi-value":!0,"multi-value--is-disabled":pc})),hc),selectProps:uf},Q$1(ff,{data:Ra,innerProps:te$2({},Ee$2(vo,"multiValueLabel",{"multi-value__label":!0})),selectProps:uf},Ai),Q$1(hf,{data:Ra,innerProps:te$2(te$2({},Ee$2(vo,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(Ai||"option")},mc),selectProps:uf}))},Qg=Zg,Jg=function(vo,Ai){var bo=vo.isDisabled,Ra=vo.isFocused,hc=vo.isSelected,pc=vo.theme,mc=pc.spacing,uf=pc.colors;return te$2({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},Ai?{}:{backgroundColor:hc?uf.primary:Ra?uf.primary25:"transparent",color:bo?uf.neutral20:hc?uf.neutral0:"inherit",padding:"".concat(mc.baseUnit*2,"px ").concat(mc.baseUnit*3,"px"),":active":{backgroundColor:bo?void 0:hc?uf.primary:uf.primary50}})},ev=function(vo){var Ai=vo.children,bo=vo.isDisabled,Ra=vo.isFocused,hc=vo.isSelected,pc=vo.innerRef,mc=vo.innerProps;return Q$1("div",Hr$3({},Ee$2(vo,"option",{option:!0,"option--is-disabled":bo,"option--is-focused":Ra,"option--is-selected":hc}),{ref:pc,"aria-disabled":bo},mc),Ai)},tv=ev,nv=function(vo,Ai){var bo=vo.theme,Ra=bo.spacing,hc=bo.colors;return te$2({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},Ai?{}:{color:hc.neutral50,marginLeft:Ra.baseUnit/2,marginRight:Ra.baseUnit/2})},rv=function(vo){var Ai=vo.children,bo=vo.innerProps;return Q$1("div",Hr$3({},Ee$2(vo,"placeholder",{placeholder:!0}),bo),Ai)},ov=rv,av=function(vo,Ai){var bo=vo.isDisabled,Ra=vo.theme,hc=Ra.spacing,pc=Ra.colors;return te$2({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Ai?{}:{color:bo?pc.neutral40:pc.neutral80,marginLeft:hc.baseUnit/2,marginRight:hc.baseUnit/2})},iv=function(vo){var Ai=vo.children,bo=vo.isDisabled,Ra=vo.innerProps;return Q$1("div",Hr$3({},Ee$2(vo,"singleValue",{"single-value":!0,"single-value--is-disabled":bo}),Ra),Ai)},sv=iv,ro$1={ClearIndicator:Ig,Control:Dg,DropdownIndicator:Sg,DownChevron:gl,CrossIcon:Qa,Group:Lg,GroupHeading:Vg,IndicatorsContainer:vg,IndicatorSeparator:Pg,Input:zg,LoadingIndicator:Mg,Menu:rg,MenuList:ag,MenuPortal:dg,LoadingMessage:lg,NoOptionsMessage:cg,MultiValue:Qg,MultiValueContainer:qg,MultiValueLabel:Xg,MultiValueRemove:Kg,Option:tv,Placeholder:ov,SelectContainer:mg,SingleValue:sv,ValueContainer:hg},cv=function(vo){return te$2(te$2({},ro$1),vo.components)},ms=Number.isNaN||function(vo){return typeof vo=="number"&&vo!==vo};function lv(vo,Ai){return!!(vo===Ai||ms(vo)&&ms(Ai))}function uv(vo,Ai){if(vo.length!==Ai.length)return!1;for(var bo=0;bo<vo.length;bo++)if(!lv(vo[bo],Ai[bo]))return!1;return!0}function dv(vo,Ai){Ai===void 0&&(Ai=uv);var bo=null;function Ra(){for(var hc=[],pc=0;pc<arguments.length;pc++)hc[pc]=arguments[pc];if(bo&&bo.lastThis===this&&Ai(hc,bo.lastArgs))return bo.lastResult;var mc=vo.apply(this,hc);return bo={lastResult:mc,lastArgs:hc,lastThis:this},mc}return Ra.clear=function(){bo=null},Ra}var fv={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},mv=function(vo){return Q$1("span",Hr$3({css:fv},vo))},ps=mv,pv={guidance:function(vo){var Ai=vo.isSearchable,bo=vo.isMulti,Ra=vo.tabSelectsValue,hc=vo.context,pc=vo.isInitialFocus;switch(hc){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(Ra?", press Tab to select the option and exit the menu":"",".");case"input":return pc?"".concat(vo["aria-label"]||"Select"," is focused ").concat(Ai?",type to refine list":"",", press Down to open the menu, ").concat(bo?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(vo){var Ai=vo.action,bo=vo.label,Ra=bo===void 0?"":bo,hc=vo.labels,pc=vo.isDisabled;switch(Ai){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(Ra,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(hc.length>1?"s":""," ").concat(hc.join(","),", selected.");case"select-option":return pc?"option ".concat(Ra," is disabled. Select another option."):"option ".concat(Ra,", selected.");default:return""}},onFocus:function(vo){var Ai=vo.context,bo=vo.focused,Ra=vo.options,hc=vo.label,pc=hc===void 0?"":hc,mc=vo.selectValue,uf=vo.isDisabled,df=vo.isSelected,ff=vo.isAppleDevice,hf=function(gf,yf){return gf&&gf.length?"".concat(gf.indexOf(yf)+1," of ").concat(gf.length):""};if(Ai==="value"&&mc)return"value ".concat(pc," focused, ").concat(hf(mc,bo),".");if(Ai==="menu"&&ff){var pf=uf?" disabled":"",mf="".concat(df?" selected":"").concat(pf);return"".concat(pc).concat(mf,", ").concat(hf(Ra,bo),".")}return""},onFilter:function(vo){var Ai=vo.inputValue,bo=vo.resultsMessage;return"".concat(bo).concat(Ai?" for search term "+Ai:"",".")}},hv=function(vo){var Ai=vo.ariaSelection,bo=vo.focusedOption,Ra=vo.focusedValue,hc=vo.focusableOptions,pc=vo.isFocused,mc=vo.selectValue,uf=vo.selectProps,df=vo.id,ff=vo.isAppleDevice,hf=uf.ariaLiveMessages,pf=uf.getOptionLabel,mf=uf.inputValue,gf=uf.isMulti,yf=uf.isOptionDisabled,vf=uf.isSearchable,bf=uf.menuIsOpen,Sf=uf.options,xf=uf.screenReaderStatus,wf=uf.tabSelectsValue,s1=uf.isLoading,If=uf["aria-label"],l1=uf["aria-live"],c1=useMemo(function(){return te$2(te$2({},pv),hf||{})},[hf]),m1=useMemo(function(){var f1="";if(Ai&&c1.onChange){var T1=Ai.option,A1=Ai.options,L1=Ai.removedValue,B1=Ai.removedValues,V1=Ai.value,Z1=function(z1){return Array.isArray(z1)?null:z1},H1=L1||T1||Z1(V1),E1=H1?pf(H1):"",F1=A1||B1||void 0,M1=F1?F1.map(pf):[],q1=te$2({isDisabled:H1&&yf(H1,mc),label:E1,labels:M1},Ai);f1=c1.onChange(q1)}return f1},[Ai,c1,yf,mc,pf]),k1=useMemo(function(){var f1="",T1=bo||Ra,A1=!!(bo&&mc&&mc.includes(bo));if(T1&&c1.onFocus){var L1={focused:T1,label:pf(T1),isDisabled:yf(T1,mc),isSelected:A1,options:hc,context:T1===bo?"menu":"value",selectValue:mc,isAppleDevice:ff};f1=c1.onFocus(L1)}return f1},[bo,Ra,pf,yf,c1,hc,mc,ff]),N1=useMemo(function(){var f1="";if(bf&&Sf.length&&!s1&&c1.onFilter){var T1=xf({count:hc.length});f1=c1.onFilter({inputValue:mf,resultsMessage:T1})}return f1},[hc,mf,bf,c1,Sf,xf,s1]),R1=(Ai==null?void 0:Ai.action)==="initial-input-focus",$1=useMemo(function(){var f1="";if(c1.guidance){var T1=Ra?"value":bf?"menu":"input";f1=c1.guidance({"aria-label":If,context:T1,isDisabled:bo&&yf(bo,mc),isMulti:gf,isSearchable:vf,tabSelectsValue:wf,isInitialFocus:R1})}return f1},[If,bo,Ra,gf,yf,vf,bf,c1,mc,wf,R1]),D1=Q$1(Fragment$1,null,Q$1("span",{id:"aria-selection"},m1),Q$1("span",{id:"aria-focused"},k1),Q$1("span",{id:"aria-results"},N1),Q$1("span",{id:"aria-guidance"},$1));return Q$1(Fragment$1,null,Q$1(ps,{id:df},R1&&D1),Q$1(ps,{"aria-live":l1,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},pc&&!R1&&D1))},gv=hv,Sa=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],vv=new RegExp("["+Sa.map(function(vo){return vo.letters}).join("")+"]","g"),wl={};for(var Vo$1=0;Vo$1<Sa.length;Vo$1++)for(var Lo=Sa[Vo$1],$o$2=0;$o$2<Lo.letters.length;$o$2++)wl[Lo.letters[$o$2]]=Lo.base;var xl=function(vo){return vo.replace(vv,function(Ai){return wl[Ai]})},bv=dv(xl),hs$1=function(vo){return vo.replace(/^\s+|\s+$/g,"")},yv=function(vo){return"".concat(vo.label," ").concat(vo.value)},wv=function(vo){return function(Ai,bo){if(Ai.data.__isNew__)return!0;var Ra=te$2({ignoreCase:!0,ignoreAccents:!0,stringify:yv,trim:!0,matchFrom:"any"},vo),hc=Ra.ignoreCase,pc=Ra.ignoreAccents,mc=Ra.stringify,uf=Ra.trim,df=Ra.matchFrom,ff=uf?hs$1(bo):bo,hf=uf?hs$1(mc(Ai)):mc(Ai);return hc&&(ff=ff.toLowerCase(),hf=hf.toLowerCase()),pc&&(ff=bv(ff),hf=xl(hf)),df==="start"?hf.substr(0,ff.length)===ff:hf.indexOf(ff)>-1}},xv=["innerRef"];function Sv(vo){var Ai=vo.innerRef,bo=Et$2(vo,xv),Ra=Xh(bo,"onExited","in","enter","exit","appear");return Q$1("input",Hr$3({ref:Ai},Ra,{css:za({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var Cv=function(vo){vo.cancelable&&vo.preventDefault(),vo.stopPropagation()};function Iv(vo){var Ai=vo.isEnabled,bo=vo.onBottomArrive,Ra=vo.onBottomLeave,hc=vo.onTopArrive,pc=vo.onTopLeave,mc=useRef(!1),uf=useRef(!1),df=useRef(0),ff=useRef(null),hf=useCallback(function(bf,Sf){if(ff.current!==null){var xf=ff.current,wf=xf.scrollTop,s1=xf.scrollHeight,If=xf.clientHeight,l1=ff.current,c1=Sf>0,m1=s1-If-wf,k1=!1;m1>Sf&&mc.current&&(Ra&&Ra(bf),mc.current=!1),c1&&uf.current&&(pc&&pc(bf),uf.current=!1),c1&&Sf>m1?(bo&&!mc.current&&bo(bf),l1.scrollTop=s1,k1=!0,mc.current=!0):!c1&&-Sf>wf&&(hc&&!uf.current&&hc(bf),l1.scrollTop=0,k1=!0,uf.current=!0),k1&&Cv(bf)}},[bo,Ra,hc,pc]),pf=useCallback(function(bf){hf(bf,bf.deltaY)},[hf]),mf=useCallback(function(bf){df.current=bf.changedTouches[0].clientY},[]),gf=useCallback(function(bf){var Sf=df.current-bf.changedTouches[0].clientY;hf(bf,Sf)},[hf]),yf=useCallback(function(bf){if(bf){var Sf=Yh?{passive:!1}:!1;bf.addEventListener("wheel",pf,Sf),bf.addEventListener("touchstart",mf,Sf),bf.addEventListener("touchmove",gf,Sf)}},[gf,mf,pf]),vf=useCallback(function(bf){bf&&(bf.removeEventListener("wheel",pf,!1),bf.removeEventListener("touchstart",mf,!1),bf.removeEventListener("touchmove",gf,!1))},[gf,mf,pf]);return useEffect(function(){if(Ai){var bf=ff.current;return yf(bf),function(){vf(bf)}}},[Ai,yf,vf]),function(bf){ff.current=bf}}var gs$1=["boxSizing","height","overflow","paddingRight","position"],vs={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function bs$1(vo){vo.cancelable&&vo.preventDefault()}function ys(vo){vo.stopPropagation()}function ws(){var vo=this.scrollTop,Ai=this.scrollHeight,bo=vo+this.offsetHeight;vo===0?this.scrollTop=1:bo===Ai&&(this.scrollTop=vo-1)}function xs(){return"ontouchstart"in window||navigator.maxTouchPoints}var Ss=!!(typeof window<"u"&&window.document&&window.document.createElement),On$2=0,en$1={capture:!1,passive:!1};function Ev(vo){var Ai=vo.isEnabled,bo=vo.accountForScrollbars,Ra=bo===void 0?!0:bo,hc=useRef({}),pc=useRef(null),mc=useCallback(function(df){if(Ss){var ff=document.body,hf=ff&&ff.style;if(Ra&&gs$1.forEach(function(yf){var vf=hf&&hf[yf];hc.current[yf]=vf}),Ra&&On$2<1){var pf=parseInt(hc.current.paddingRight,10)||0,mf=document.body?document.body.clientWidth:0,gf=window.innerWidth-mf+pf||0;Object.keys(vs).forEach(function(yf){var vf=vs[yf];hf&&(hf[yf]=vf)}),hf&&(hf.paddingRight="".concat(gf,"px"))}ff&&xs()&&(ff.addEventListener("touchmove",bs$1,en$1),df&&(df.addEventListener("touchstart",ws,en$1),df.addEventListener("touchmove",ys,en$1))),On$2+=1}},[Ra]),uf=useCallback(function(df){if(Ss){var ff=document.body,hf=ff&&ff.style;On$2=Math.max(On$2-1,0),Ra&&On$2<1&&gs$1.forEach(function(pf){var mf=hc.current[pf];hf&&(hf[pf]=mf)}),ff&&xs()&&(ff.removeEventListener("touchmove",bs$1,en$1),df&&(df.removeEventListener("touchstart",ws,en$1),df.removeEventListener("touchmove",ys,en$1)))}},[Ra]);return useEffect(function(){if(Ai){var df=pc.current;return mc(df),function(){uf(df)}}},[Ai,mc,uf]),function(df){pc.current=df}}var Pv=function(vo){var Ai=vo.target;return Ai.ownerDocument.activeElement&&Ai.ownerDocument.activeElement.blur()},Tv={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Ov(vo){var Ai=vo.children,bo=vo.lockEnabled,Ra=vo.captureEnabled,hc=Ra===void 0?!0:Ra,pc=vo.onBottomArrive,mc=vo.onBottomLeave,uf=vo.onTopArrive,df=vo.onTopLeave,ff=Iv({isEnabled:hc,onBottomArrive:pc,onBottomLeave:mc,onTopArrive:uf,onTopLeave:df}),hf=Ev({isEnabled:bo}),pf=function(mf){ff(mf),hf(mf)};return Q$1(Fragment$1,null,bo&&Q$1("div",{onClick:Pv,css:Tv}),Ai(pf))}var Mv={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Nv=function(vo){var Ai=vo.name,bo=vo.onFocus;return Q$1("input",{required:!0,name:Ai,tabIndex:-1,"aria-hidden":"true",onFocus:bo,css:Mv,value:"",onChange:function(){}})},Av=Nv;function Ja(vo){var Ai;return typeof window<"u"&&window.navigator!=null?vo.test(((Ai=window.navigator.userAgentData)===null||Ai===void 0?void 0:Ai.platform)||window.navigator.platform):!1}function Dv(){return Ja(/^iPhone/i)}function Sl(){return Ja(/^Mac/i)}function Rv(){return Ja(/^iPad/i)||Sl()&&navigator.maxTouchPoints>1}function _v(){return Dv()||Rv()}function kv(){return Sl()||_v()}var Fv=function(vo){return vo.label},Vv=function(vo){return vo.label},Lv=function(vo){return vo.value},$v=function(vo){return!!vo.isDisabled},Uv={clearIndicator:Cg,container:fg,control:Ng,dropdownIndicator:xg,group:_g,groupHeading:Fg,indicatorsContainer:gg,indicatorSeparator:Eg,input:Ug,loadingIndicator:Og,loadingMessage:sg,menu:eg,menuList:og,menuPortal:ug,multiValue:jg,multiValueLabel:Yg,multiValueRemove:Gg,noOptionsMessage:ig,option:Jg,placeholder:nv,singleValue:av,valueContainer:pg},Hv={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},Wv=4,Cl=4,Bv=38,zv=Cl*2,jv={baseUnit:Cl,controlHeight:Bv,menuGutter:zv},Uo$1={borderRadius:Wv,colors:Hv,spacing:jv},Yv={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:ds(),captureMenuScroll:!ds(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:wv(),formatGroupLabel:Fv,getOptionLabel:Vv,getOptionValue:Lv,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:$v,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!zh(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(vo){var Ai=vo.count;return"".concat(Ai," result").concat(Ai!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Cs(vo,Ai,bo,Ra){var hc=Pl(vo,Ai,bo),pc=Tl(vo,Ai,bo),mc=El(vo,Ai),uf=Fr$1(vo,Ai);return{type:"option",data:Ai,isDisabled:hc,isSelected:pc,label:mc,value:uf,index:Ra}}function xr$2(vo,Ai){return vo.options.map(function(bo,Ra){if("options"in bo){var hc=bo.options.map(function(mc,uf){return Cs(vo,mc,Ai,uf)}).filter(function(mc){return Es$1(vo,mc)});return hc.length>0?{type:"group",data:bo,options:hc,index:Ra}:void 0}var pc=Cs(vo,bo,Ai,Ra);return Es$1(vo,pc)?pc:void 0}).filter(Gh)}function Il(vo){return vo.reduce(function(Ai,bo){return bo.type==="group"?Ai.push.apply(Ai,$a(bo.options.map(function(Ra){return Ra.data}))):Ai.push(bo.data),Ai},[])}function Is$2(vo,Ai){return vo.reduce(function(bo,Ra){return Ra.type==="group"?bo.push.apply(bo,$a(Ra.options.map(function(hc){return{data:hc.data,id:"".concat(Ai,"-").concat(Ra.index,"-").concat(hc.index)}}))):bo.push({data:Ra.data,id:"".concat(Ai,"-").concat(Ra.index)}),bo},[])}function Gv(vo,Ai){return Il(xr$2(vo,Ai))}function Es$1(vo,Ai){var bo=vo.inputValue,Ra=bo===void 0?"":bo,hc=Ai.data,pc=Ai.isSelected,mc=Ai.label,uf=Ai.value;return(!Ml(vo)||!pc)&&Ol(vo,{label:mc,value:uf,data:hc},Ra)}function qv(vo,Ai){var bo=vo.focusedValue,Ra=vo.selectValue,hc=Ra.indexOf(bo);if(hc>-1){var pc=Ai.indexOf(bo);if(pc>-1)return bo;if(hc<Ai.length)return Ai[hc]}return null}function Xv(vo,Ai){var bo=vo.focusedOption;return bo&&Ai.indexOf(bo)>-1?bo:Ai[0]}var Ho$1=function(vo,Ai){var bo,Ra=(bo=vo.find(function(hc){return hc.data===Ai}))===null||bo===void 0?void 0:bo.id;return Ra||null},El=function(vo,Ai){return vo.getOptionLabel(Ai)},Fr$1=function(vo,Ai){return vo.getOptionValue(Ai)};function Pl(vo,Ai,bo){return typeof vo.isOptionDisabled=="function"?vo.isOptionDisabled(Ai,bo):!1}function Tl(vo,Ai,bo){if(bo.indexOf(Ai)>-1)return!0;if(typeof vo.isOptionSelected=="function")return vo.isOptionSelected(Ai,bo);var Ra=Fr$1(vo,Ai);return bo.some(function(hc){return Fr$1(vo,hc)===Ra})}function Ol(vo,Ai,bo){return vo.filterOption?vo.filterOption(Ai,bo):!0}var Ml=function(vo){var Ai=vo.hideSelectedOptions,bo=vo.isMulti;return Ai===void 0?bo:Ai},Kv=1,Nl=function(vo){Bm(bo,vo);var Ai=Ym(bo);function bo(Ra){var hc;if(Hm(this,bo),hc=Ai.call(this,Ra),hc.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},hc.blockOptionHover=!1,hc.isComposing=!1,hc.commonProps=void 0,hc.initialTouchX=0,hc.initialTouchY=0,hc.openAfterFocus=!1,hc.scrollToFocusedOptionOnUpdate=!1,hc.userIsDragging=void 0,hc.isAppleDevice=kv(),hc.controlRef=null,hc.getControlRef=function(df){hc.controlRef=df},hc.focusedOptionRef=null,hc.getFocusedOptionRef=function(df){hc.focusedOptionRef=df},hc.menuListRef=null,hc.getMenuListRef=function(df){hc.menuListRef=df},hc.inputRef=null,hc.getInputRef=function(df){hc.inputRef=df},hc.focus=hc.focusInput,hc.blur=hc.blurInput,hc.onChange=function(df,ff){var hf=hc.props,pf=hf.onChange,mf=hf.name;ff.name=mf,hc.ariaOnChange(df,ff),pf(df,ff)},hc.setValue=function(df,ff,hf){var pf=hc.props,mf=pf.closeMenuOnSelect,gf=pf.isMulti,yf=pf.inputValue;hc.onInputChange("",{action:"set-value",prevInputValue:yf}),mf&&(hc.setState({inputIsHiddenAfterUpdate:!gf}),hc.onMenuClose()),hc.setState({clearFocusValueOnUpdate:!0}),hc.onChange(df,{action:ff,option:hf})},hc.selectOption=function(df){var ff=hc.props,hf=ff.blurInputOnSelect,pf=ff.isMulti,mf=ff.name,gf=hc.state.selectValue,yf=pf&&hc.isOptionSelected(df,gf),vf=hc.isOptionDisabled(df,gf);if(yf){var bf=hc.getOptionValue(df);hc.setValue(gf.filter(function(Sf){return hc.getOptionValue(Sf)!==bf}),"deselect-option",df)}else if(!vf)pf?hc.setValue([].concat($a(gf),[df]),"select-option",df):hc.setValue(df,"select-option");else{hc.ariaOnChange(df,{action:"select-option",option:df,name:mf});return}hf&&hc.blurInput()},hc.removeValue=function(df){var ff=hc.props.isMulti,hf=hc.state.selectValue,pf=hc.getOptionValue(df),mf=hf.filter(function(yf){return hc.getOptionValue(yf)!==pf}),gf=lr$1(ff,mf,mf[0]||null);hc.onChange(gf,{action:"remove-value",removedValue:df}),hc.focusInput()},hc.clearValue=function(){var df=hc.state.selectValue;hc.onChange(lr$1(hc.props.isMulti,[],null),{action:"clear",removedValues:df})},hc.popValue=function(){var df=hc.props.isMulti,ff=hc.state.selectValue,hf=ff[ff.length-1],pf=ff.slice(0,ff.length-1),mf=lr$1(df,pf,pf[0]||null);hf&&hc.onChange(mf,{action:"pop-value",removedValue:hf})},hc.getFocusedOptionId=function(df){return Ho$1(hc.state.focusableOptionsWithIds,df)},hc.getFocusableOptionsWithIds=function(){return Is$2(xr$2(hc.props,hc.state.selectValue),hc.getElementId("option"))},hc.getValue=function(){return hc.state.selectValue},hc.cx=function(){for(var df=arguments.length,ff=new Array(df),hf=0;hf<df;hf++)ff[hf]=arguments[hf];return $h.apply(void 0,[hc.props.classNamePrefix].concat(ff))},hc.getOptionLabel=function(df){return El(hc.props,df)},hc.getOptionValue=function(df){return Fr$1(hc.props,df)},hc.getStyles=function(df,ff){var hf=hc.props.unstyled,pf=Uv[df](ff,hf);pf.boxSizing="border-box";var mf=hc.props.styles[df];return mf?mf(pf,ff):pf},hc.getClassNames=function(df,ff){var hf,pf;return(hf=(pf=hc.props.classNames)[df])===null||hf===void 0?void 0:hf.call(pf,ff)},hc.getElementId=function(df){return"".concat(hc.state.instancePrefix,"-").concat(df)},hc.getComponents=function(){return cv(hc.props)},hc.buildCategorizedOptions=function(){return xr$2(hc.props,hc.state.selectValue)},hc.getCategorizedOptions=function(){return hc.props.menuIsOpen?hc.buildCategorizedOptions():[]},hc.buildFocusableOptions=function(){return Il(hc.buildCategorizedOptions())},hc.getFocusableOptions=function(){return hc.props.menuIsOpen?hc.buildFocusableOptions():[]},hc.ariaOnChange=function(df,ff){hc.setState({ariaSelection:te$2({value:df},ff)})},hc.onMenuMouseDown=function(df){df.button===0&&(df.stopPropagation(),df.preventDefault(),hc.focusInput())},hc.onMenuMouseMove=function(df){hc.blockOptionHover=!1},hc.onControlMouseDown=function(df){if(!df.defaultPrevented){var ff=hc.props.openMenuOnClick;hc.state.isFocused?hc.props.menuIsOpen?df.target.tagName!=="INPUT"&&df.target.tagName!=="TEXTAREA"&&hc.onMenuClose():ff&&hc.openMenu("first"):(ff&&(hc.openAfterFocus=!0),hc.focusInput()),df.target.tagName!=="INPUT"&&df.target.tagName!=="TEXTAREA"&&df.preventDefault()}},hc.onDropdownIndicatorMouseDown=function(df){if(!(df&&df.type==="mousedown"&&df.button!==0)&&!hc.props.isDisabled){var ff=hc.props,hf=ff.isMulti,pf=ff.menuIsOpen;hc.focusInput(),pf?(hc.setState({inputIsHiddenAfterUpdate:!hf}),hc.onMenuClose()):hc.openMenu("first"),df.preventDefault()}},hc.onClearIndicatorMouseDown=function(df){df&&df.type==="mousedown"&&df.button!==0||(hc.clearValue(),df.preventDefault(),hc.openAfterFocus=!1,df.type==="touchend"?hc.focusInput():setTimeout(function(){return hc.focusInput()}))},hc.onScroll=function(df){typeof hc.props.closeMenuOnScroll=="boolean"?df.target instanceof HTMLElement&&no$1(df.target)&&hc.props.onMenuClose():typeof hc.props.closeMenuOnScroll=="function"&&hc.props.closeMenuOnScroll(df)&&hc.props.onMenuClose()},hc.onCompositionStart=function(){hc.isComposing=!0},hc.onCompositionEnd=function(){hc.isComposing=!1},hc.onTouchStart=function(df){var ff=df.touches,hf=ff&&ff.item(0);hf&&(hc.initialTouchX=hf.clientX,hc.initialTouchY=hf.clientY,hc.userIsDragging=!1)},hc.onTouchMove=function(df){var ff=df.touches,hf=ff&&ff.item(0);if(hf){var pf=Math.abs(hf.clientX-hc.initialTouchX),mf=Math.abs(hf.clientY-hc.initialTouchY),gf=5;hc.userIsDragging=pf>gf||mf>gf}},hc.onTouchEnd=function(df){hc.userIsDragging||(hc.controlRef&&!hc.controlRef.contains(df.target)&&hc.menuListRef&&!hc.menuListRef.contains(df.target)&&hc.blurInput(),hc.initialTouchX=0,hc.initialTouchY=0)},hc.onControlTouchEnd=function(df){hc.userIsDragging||hc.onControlMouseDown(df)},hc.onClearIndicatorTouchEnd=function(df){hc.userIsDragging||hc.onClearIndicatorMouseDown(df)},hc.onDropdownIndicatorTouchEnd=function(df){hc.userIsDragging||hc.onDropdownIndicatorMouseDown(df)},hc.handleInputChange=function(df){var ff=hc.props.inputValue,hf=df.currentTarget.value;hc.setState({inputIsHiddenAfterUpdate:!1}),hc.onInputChange(hf,{action:"input-change",prevInputValue:ff}),hc.props.menuIsOpen||hc.onMenuOpen()},hc.onInputFocus=function(df){hc.props.onFocus&&hc.props.onFocus(df),hc.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(hc.openAfterFocus||hc.props.openMenuOnFocus)&&hc.openMenu("first"),hc.openAfterFocus=!1},hc.onInputBlur=function(df){var ff=hc.props.inputValue;if(hc.menuListRef&&hc.menuListRef.contains(document.activeElement)){hc.inputRef.focus();return}hc.props.onBlur&&hc.props.onBlur(df),hc.onInputChange("",{action:"input-blur",prevInputValue:ff}),hc.onMenuClose(),hc.setState({focusedValue:null,isFocused:!1})},hc.onOptionHover=function(df){if(!(hc.blockOptionHover||hc.state.focusedOption===df)){var ff=hc.getFocusableOptions(),hf=ff.indexOf(df);hc.setState({focusedOption:df,focusedOptionId:hf>-1?hc.getFocusedOptionId(df):null})}},hc.shouldHideSelectedOptions=function(){return Ml(hc.props)},hc.onValueInputFocus=function(df){df.preventDefault(),df.stopPropagation(),hc.focus()},hc.onKeyDown=function(df){var ff=hc.props,hf=ff.isMulti,pf=ff.backspaceRemovesValue,mf=ff.escapeClearsValue,gf=ff.inputValue,yf=ff.isClearable,vf=ff.isDisabled,bf=ff.menuIsOpen,Sf=ff.onKeyDown,xf=ff.tabSelectsValue,wf=ff.openMenuOnFocus,s1=hc.state,If=s1.focusedOption,l1=s1.focusedValue,c1=s1.selectValue;if(!vf&&!(typeof Sf=="function"&&(Sf(df),df.defaultPrevented))){switch(hc.blockOptionHover=!0,df.key){case"ArrowLeft":if(!hf||gf)return;hc.focusValue("previous");break;case"ArrowRight":if(!hf||gf)return;hc.focusValue("next");break;case"Delete":case"Backspace":if(gf)return;if(l1)hc.removeValue(l1);else{if(!pf)return;hf?hc.popValue():yf&&hc.clearValue()}break;case"Tab":if(hc.isComposing||df.shiftKey||!bf||!xf||!If||wf&&hc.isOptionSelected(If,c1))return;hc.selectOption(If);break;case"Enter":if(df.keyCode===229)break;if(bf){if(!If||hc.isComposing)return;hc.selectOption(If);break}return;case"Escape":bf?(hc.setState({inputIsHiddenAfterUpdate:!1}),hc.onInputChange("",{action:"menu-close",prevInputValue:gf}),hc.onMenuClose()):yf&&mf&&hc.clearValue();break;case" ":if(gf)return;if(!bf){hc.openMenu("first");break}if(!If)return;hc.selectOption(If);break;case"ArrowUp":bf?hc.focusOption("up"):hc.openMenu("last");break;case"ArrowDown":bf?hc.focusOption("down"):hc.openMenu("first");break;case"PageUp":if(!bf)return;hc.focusOption("pageup");break;case"PageDown":if(!bf)return;hc.focusOption("pagedown");break;case"Home":if(!bf)return;hc.focusOption("first");break;case"End":if(!bf)return;hc.focusOption("last");break;default:return}df.preventDefault()}},hc.state.instancePrefix="react-select-"+(hc.props.instanceId||++Kv),hc.state.selectValue=ls$1(Ra.value),Ra.menuIsOpen&&hc.state.selectValue.length){var pc=hc.getFocusableOptionsWithIds(),mc=hc.buildFocusableOptions(),uf=mc.indexOf(hc.state.selectValue[0]);hc.state.focusableOptionsWithIds=pc,hc.state.focusedOption=mc[uf],hc.state.focusedOptionId=Ho$1(pc,mc[uf])}return hc}return Wm(bo,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&us(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(Ra){var hc=this.props,pc=hc.isDisabled,mc=hc.menuIsOpen,uf=this.state.isFocused;(uf&&!pc&&Ra.isDisabled||uf&&mc&&!Ra.menuIsOpen)&&this.focusInput(),uf&&pc&&!Ra.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!uf&&!pc&&Ra.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(us(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(Ra,hc){this.props.onInputChange(Ra,hc)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(Ra){var hc=this,pc=this.state,mc=pc.selectValue,uf=pc.isFocused,df=this.buildFocusableOptions(),ff=Ra==="first"?0:df.length-1;if(!this.props.isMulti){var hf=df.indexOf(mc[0]);hf>-1&&(ff=hf)}this.scrollToFocusedOptionOnUpdate=!(uf&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:df[ff],focusedOptionId:this.getFocusedOptionId(df[ff])},function(){return hc.onMenuOpen()})}},{key:"focusValue",value:function(Ra){var hc=this.state,pc=hc.selectValue,mc=hc.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var uf=pc.indexOf(mc);mc||(uf=-1);var df=pc.length-1,ff=-1;if(pc.length){switch(Ra){case"previous":uf===0?ff=0:uf===-1?ff=df:ff=uf-1;break;case"next":uf>-1&&uf<df&&(ff=uf+1);break}this.setState({inputIsHidden:ff!==-1,focusedValue:pc[ff]})}}}},{key:"focusOption",value:function(){var Ra=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",hc=this.props.pageSize,pc=this.state.focusedOption,mc=this.getFocusableOptions();if(mc.length){var uf=0,df=mc.indexOf(pc);pc||(df=-1),Ra==="up"?uf=df>0?df-1:mc.length-1:Ra==="down"?uf=(df+1)%mc.length:Ra==="pageup"?(uf=df-hc,uf<0&&(uf=0)):Ra==="pagedown"?(uf=df+hc,uf>mc.length-1&&(uf=mc.length-1)):Ra==="last"&&(uf=mc.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:mc[uf],focusedValue:null,focusedOptionId:this.getFocusedOptionId(mc[uf])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Uo$1):te$2(te$2({},Uo$1),this.props.theme):Uo$1}},{key:"getCommonProps",value:function(){var Ra=this.clearValue,hc=this.cx,pc=this.getStyles,mc=this.getClassNames,uf=this.getValue,df=this.selectOption,ff=this.setValue,hf=this.props,pf=hf.isMulti,mf=hf.isRtl,gf=hf.options,yf=this.hasValue();return{clearValue:Ra,cx:hc,getStyles:pc,getClassNames:mc,getValue:uf,hasValue:yf,isMulti:pf,isRtl:mf,options:gf,selectOption:df,selectProps:hf,setValue:ff,theme:this.getTheme()}}},{key:"hasValue",value:function(){var Ra=this.state.selectValue;return Ra.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var Ra=this.props,hc=Ra.isClearable,pc=Ra.isMulti;return hc===void 0?pc:hc}},{key:"isOptionDisabled",value:function(Ra,hc){return Pl(this.props,Ra,hc)}},{key:"isOptionSelected",value:function(Ra,hc){return Tl(this.props,Ra,hc)}},{key:"filterOption",value:function(Ra,hc){return Ol(this.props,Ra,hc)}},{key:"formatOptionLabel",value:function(Ra,hc){if(typeof this.props.formatOptionLabel=="function"){var pc=this.props.inputValue,mc=this.state.selectValue;return this.props.formatOptionLabel(Ra,{context:hc,inputValue:pc,selectValue:mc})}else return this.getOptionLabel(Ra)}},{key:"formatGroupLabel",value:function(Ra){return this.props.formatGroupLabel(Ra)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var Ra=this.props,hc=Ra.isDisabled,pc=Ra.isSearchable,mc=Ra.inputId,uf=Ra.inputValue,df=Ra.tabIndex,ff=Ra.form,hf=Ra.menuIsOpen,pf=Ra.required,mf=this.getComponents(),gf=mf.Input,yf=this.state,vf=yf.inputIsHidden,bf=yf.ariaSelection,Sf=this.commonProps,xf=mc||this.getElementId("input"),wf=te$2(te$2(te$2({"aria-autocomplete":"list","aria-expanded":hf,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":pf,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},hf&&{"aria-controls":this.getElementId("listbox")}),!pc&&{"aria-readonly":!0}),this.hasValue()?(bf==null?void 0:bf.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return pc?y$2.createElement(gf,Hr$3({},Sf,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:xf,innerRef:this.getInputRef,isDisabled:hc,isHidden:vf,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:df,form:ff,type:"text",value:uf},wf)):y$2.createElement(Sv,Hr$3({id:xf,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:_r$2,onFocus:this.onInputFocus,disabled:hc,tabIndex:df,inputMode:"none",form:ff,value:""},wf))}},{key:"renderPlaceholderOrValue",value:function(){var Ra=this,hc=this.getComponents(),pc=hc.MultiValue,mc=hc.MultiValueContainer,uf=hc.MultiValueLabel,df=hc.MultiValueRemove,ff=hc.SingleValue,hf=hc.Placeholder,pf=this.commonProps,mf=this.props,gf=mf.controlShouldRenderValue,yf=mf.isDisabled,vf=mf.isMulti,bf=mf.inputValue,Sf=mf.placeholder,xf=this.state,wf=xf.selectValue,s1=xf.focusedValue,If=xf.isFocused;if(!this.hasValue()||!gf)return bf?null:y$2.createElement(hf,Hr$3({},pf,{key:"placeholder",isDisabled:yf,isFocused:If,innerProps:{id:this.getElementId("placeholder")}}),Sf);if(vf)return wf.map(function(c1,m1){var k1=c1===s1,N1="".concat(Ra.getOptionLabel(c1),"-").concat(Ra.getOptionValue(c1));return y$2.createElement(pc,Hr$3({},pf,{components:{Container:mc,Label:uf,Remove:df},isFocused:k1,isDisabled:yf,key:N1,index:m1,removeProps:{onClick:function(){return Ra.removeValue(c1)},onTouchEnd:function(){return Ra.removeValue(c1)},onMouseDown:function(R1){R1.preventDefault()}},data:c1}),Ra.formatOptionLabel(c1,"value"))});if(bf)return null;var l1=wf[0];return y$2.createElement(ff,Hr$3({},pf,{data:l1,isDisabled:yf}),this.formatOptionLabel(l1,"value"))}},{key:"renderClearIndicator",value:function(){var Ra=this.getComponents(),hc=Ra.ClearIndicator,pc=this.commonProps,mc=this.props,uf=mc.isDisabled,df=mc.isLoading,ff=this.state.isFocused;if(!this.isClearable()||!hc||uf||!this.hasValue()||df)return null;var hf={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return y$2.createElement(hc,Hr$3({},pc,{innerProps:hf,isFocused:ff}))}},{key:"renderLoadingIndicator",value:function(){var Ra=this.getComponents(),hc=Ra.LoadingIndicator,pc=this.commonProps,mc=this.props,uf=mc.isDisabled,df=mc.isLoading,ff=this.state.isFocused;if(!hc||!df)return null;var hf={"aria-hidden":"true"};return y$2.createElement(hc,Hr$3({},pc,{innerProps:hf,isDisabled:uf,isFocused:ff}))}},{key:"renderIndicatorSeparator",value:function(){var Ra=this.getComponents(),hc=Ra.DropdownIndicator,pc=Ra.IndicatorSeparator;if(!hc||!pc)return null;var mc=this.commonProps,uf=this.props.isDisabled,df=this.state.isFocused;return y$2.createElement(pc,Hr$3({},mc,{isDisabled:uf,isFocused:df}))}},{key:"renderDropdownIndicator",value:function(){var Ra=this.getComponents(),hc=Ra.DropdownIndicator;if(!hc)return null;var pc=this.commonProps,mc=this.props.isDisabled,uf=this.state.isFocused,df={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return y$2.createElement(hc,Hr$3({},pc,{innerProps:df,isDisabled:mc,isFocused:uf}))}},{key:"renderMenu",value:function(){var Ra=this,hc=this.getComponents(),pc=hc.Group,mc=hc.GroupHeading,uf=hc.Menu,df=hc.MenuList,ff=hc.MenuPortal,hf=hc.LoadingMessage,pf=hc.NoOptionsMessage,mf=hc.Option,gf=this.commonProps,yf=this.state.focusedOption,vf=this.props,bf=vf.captureMenuScroll,Sf=vf.inputValue,xf=vf.isLoading,wf=vf.loadingMessage,s1=vf.minMenuHeight,If=vf.maxMenuHeight,l1=vf.menuIsOpen,c1=vf.menuPlacement,m1=vf.menuPosition,k1=vf.menuPortalTarget,N1=vf.menuShouldBlockScroll,R1=vf.menuShouldScrollIntoView,$1=vf.noOptionsMessage,D1=vf.onMenuScrollToTop,f1=vf.onMenuScrollToBottom;if(!l1)return null;var T1=function(H1,E1){var F1=H1.type,M1=H1.data,q1=H1.isDisabled,z1=H1.isSelected,W1=H1.label,J1=H1.value,eT=yf===M1,nT=q1?void 0:function(){return Ra.onOptionHover(M1)},sT=q1?void 0:function(){return Ra.selectOption(M1)},iT="".concat(Ra.getElementId("option"),"-").concat(E1),rT={id:iT,onClick:sT,onMouseMove:nT,onMouseOver:nT,tabIndex:-1,role:"option","aria-selected":Ra.isAppleDevice?void 0:z1};return y$2.createElement(mf,Hr$3({},gf,{innerProps:rT,data:M1,isDisabled:q1,isSelected:z1,key:iT,label:W1,type:F1,value:J1,isFocused:eT,innerRef:eT?Ra.getFocusedOptionRef:void 0}),Ra.formatOptionLabel(H1.data,"menu"))},A1;if(this.hasOptions())A1=this.getCategorizedOptions().map(function(H1){if(H1.type==="group"){var E1=H1.data,F1=H1.options,M1=H1.index,q1="".concat(Ra.getElementId("group"),"-").concat(M1),z1="".concat(q1,"-heading");return y$2.createElement(pc,Hr$3({},gf,{key:q1,data:E1,options:F1,Heading:mc,headingProps:{id:z1,data:H1.data},label:Ra.formatGroupLabel(H1.data)}),H1.options.map(function(W1){return T1(W1,"".concat(M1,"-").concat(W1.index))}))}else if(H1.type==="option")return T1(H1,"".concat(H1.index))});else if(xf){var L1=wf({inputValue:Sf});if(L1===null)return null;A1=y$2.createElement(hf,gf,L1)}else{var B1=$1({inputValue:Sf});if(B1===null)return null;A1=y$2.createElement(pf,gf,B1)}var V1={minMenuHeight:s1,maxMenuHeight:If,menuPlacement:c1,menuPosition:m1,menuShouldScrollIntoView:R1},Z1=y$2.createElement(tg,Hr$3({},gf,V1),function(H1){var E1=H1.ref,F1=H1.placerProps,M1=F1.placement,q1=F1.maxHeight;return y$2.createElement(uf,Hr$3({},gf,V1,{innerRef:E1,innerProps:{onMouseDown:Ra.onMenuMouseDown,onMouseMove:Ra.onMenuMouseMove},isLoading:xf,placement:M1}),y$2.createElement(Ov,{captureEnabled:bf,onTopArrive:D1,onBottomArrive:f1,lockEnabled:N1},function(z1){return y$2.createElement(df,Hr$3({},gf,{innerRef:function(W1){Ra.getMenuListRef(W1),z1(W1)},innerProps:{role:"listbox","aria-multiselectable":gf.isMulti,id:Ra.getElementId("listbox")},isLoading:xf,maxHeight:q1,focusedOption:yf}),A1)}))});return k1||m1==="fixed"?y$2.createElement(ff,Hr$3({},gf,{appendTo:k1,controlElement:this.controlRef,menuPlacement:c1,menuPosition:m1}),Z1):Z1}},{key:"renderFormField",value:function(){var Ra=this,hc=this.props,pc=hc.delimiter,mc=hc.isDisabled,uf=hc.isMulti,df=hc.name,ff=hc.required,hf=this.state.selectValue;if(ff&&!this.hasValue()&&!mc)return y$2.createElement(Av,{name:df,onFocus:this.onValueInputFocus});if(!(!df||mc))if(uf)if(pc){var pf=hf.map(function(yf){return Ra.getOptionValue(yf)}).join(pc);return y$2.createElement("input",{name:df,type:"hidden",value:pf})}else{var mf=hf.length>0?hf.map(function(yf,vf){return y$2.createElement("input",{key:"i-".concat(vf),name:df,type:"hidden",value:Ra.getOptionValue(yf)})}):y$2.createElement("input",{name:df,type:"hidden",value:""});return y$2.createElement("div",null,mf)}else{var gf=hf[0]?this.getOptionValue(hf[0]):"";return y$2.createElement("input",{name:df,type:"hidden",value:gf})}}},{key:"renderLiveRegion",value:function(){var Ra=this.commonProps,hc=this.state,pc=hc.ariaSelection,mc=hc.focusedOption,uf=hc.focusedValue,df=hc.isFocused,ff=hc.selectValue,hf=this.getFocusableOptions();return y$2.createElement(gv,Hr$3({},Ra,{id:this.getElementId("live-region"),ariaSelection:pc,focusedOption:mc,focusedValue:uf,isFocused:df,selectValue:ff,focusableOptions:hf,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var Ra=this.getComponents(),hc=Ra.Control,pc=Ra.IndicatorsContainer,mc=Ra.SelectContainer,uf=Ra.ValueContainer,df=this.props,ff=df.className,hf=df.id,pf=df.isDisabled,mf=df.menuIsOpen,gf=this.state.isFocused,yf=this.commonProps=this.getCommonProps();return y$2.createElement(mc,Hr$3({},yf,{className:ff,innerProps:{id:hf,onKeyDown:this.onKeyDown},isDisabled:pf,isFocused:gf}),this.renderLiveRegion(),y$2.createElement(hc,Hr$3({},yf,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:pf,isFocused:gf,menuIsOpen:mf}),y$2.createElement(uf,Hr$3({},yf,{isDisabled:pf}),this.renderPlaceholderOrValue(),this.renderInput()),y$2.createElement(pc,Hr$3({},yf,{isDisabled:pf}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(Ra,hc){var pc=hc.prevProps,mc=hc.clearFocusValueOnUpdate,uf=hc.inputIsHiddenAfterUpdate,df=hc.ariaSelection,ff=hc.isFocused,hf=hc.prevWasFocused,pf=hc.instancePrefix,mf=Ra.options,gf=Ra.value,yf=Ra.menuIsOpen,vf=Ra.inputValue,bf=Ra.isMulti,Sf=ls$1(gf),xf={};if(pc&&(gf!==pc.value||mf!==pc.options||yf!==pc.menuIsOpen||vf!==pc.inputValue)){var wf=yf?Gv(Ra,Sf):[],s1=yf?Is$2(xr$2(Ra,Sf),"".concat(pf,"-option")):[],If=mc?qv(hc,Sf):null,l1=Xv(hc,wf),c1=Ho$1(s1,l1);xf={selectValue:Sf,focusedOption:l1,focusedOptionId:c1,focusableOptionsWithIds:s1,focusedValue:If,clearFocusValueOnUpdate:!1}}var m1=uf!=null&&Ra!==pc?{inputIsHidden:uf,inputIsHiddenAfterUpdate:void 0}:{},k1=df,N1=ff&&hf;return ff&&!N1&&(k1={value:lr$1(bf,Sf,Sf[0]||null),options:Sf,action:"initial-input-focus"},N1=!hf),(df==null?void 0:df.action)==="initial-input-focus"&&(k1=null),te$2(te$2(te$2({},xf),m1),{},{prevProps:Ra,ariaSelection:k1,prevWasFocused:N1})}}]),bo}(Component);Nl.defaultProps=Yv;var Zv=forwardRef(function(vo,Ai){var bo=Um(vo);return y$2.createElement(Nl,Hr$3({ref:Ai},bo))}),Qv=Zv;function Jv(vo){return jsx(ro$1.DropdownIndicator,{...vo,children:jsx(_e$1,{name:"ChevronDown",size:16})})}function eb(vo){return jsx(ro$1.ClearIndicator,{...vo,children:jsx(_e$1,{name:"Xmark",size:16})})}function tb(vo){const{label:Ai,onClick:bo,...Ra}=vo,hc=!!Ai&&!!bo;return jsxs(ro$1.MenuList,{...Ra,children:[vo.children,hc?jsx("button",{className:"w-full px-2 py-3 hover:bg-slate-50",onClick:bo,children:Ai}):null]})}function Ca(vo){const Ai=vo["aria-invalid"]==="true",{addItemButtonProps:bo,...Ra}=vo;return jsx(Qv,{...Ra,components:{DropdownIndicator:Jv,ClearIndicator:eb,MenuList:hc=>tb({...hc,...bo})},styles:{dropdownIndicator:()=>({label:"indicatorContainer",display:"flex",transition:"color 150ms",color:"var(--gray-900)",padding:8,boxSizing:"border-box"}),clearIndicator:hc=>({...hc,color:"var(--gray-900)"}),container:hc=>({...hc,borderColor:"var(--gray-200)",fontSize:12}),placeholder:hc=>({...hc,color:Ai?"var(--red-800)":"var(--gray-500)"}),control:()=>({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:32,outline:"0 !important",position:"relative",transition:"all 100ms",backgroundColor:"var(--white)",borderColor:Ai?"var(--red-900)":"var(--gray-200)",borderStyle:"solid",borderWidth:1,borderRadius:"6px",boxSizing:"border-box"}),option:(hc,pc)=>({...hc,backgroundColor:pc.isSelected?"var(--slate-50)":"var(--white)",color:"var(--gray-800)",":hover":{backgroundColor:"var(--slate-50)"}}),menuList:hc=>({...hc,padding:0,borderRadius:"6px"})},theme:hc=>({...hc,colors:{...hc.colors,primary:"var(--slate-100)",primary25:"var(--slate-50)",primary50:"var(--slate-100)",primary75:"var(--slate-100)",danger:"var(--red-900)",dangerLight:"var(--red-100)",neutral0:"var(--white)",neutral5:"var(--gray-50)",neutral10:"var(--gray-100)",neutral20:"var(--gray-200)",neutral30:"var(--gray-300)",neutral40:"var(--gray-400)",neutral50:"var(--gray-500)",neutral60:"var(--gray-600)",neutral70:"var(--gray-700)",neutral80:"var(--gray-800)",neutral90:"var(--gray-900)"}})})}function Al(vo,Ai){const{className:bo,...Ra}=vo;return{className:Ne$1(Ai,typeof bo=="string"&&bo),...Ra}}const Dl=forwardRef(function(vo,Ai){const{color:bo="dark",size:Ra="medium",className:hc="",children:pc,icon:mc,iconPosition:uf="left",...df}=vo,ff={small:"px-2 py-1.5 text-xs rounded-md font-medium",medium:"px-6 py-3 text-base rounded-xl font-semibold tracking-wide"},hf=Xr$1({light:"bg-gray-200 text-gray-600 hover:text-gray-700 hover:border-gray-300 active:border-slate-100 active:text-gray-600 disabled:text-gray-400",dark:"bg-gray-800 text-slate-50 hover:bg-slate-800 active:border-slate-700 disabled:bg-gray-300 disabled:text-slate-100",red:"bg-red-900 text-slate-50 hover:opacity-80 active:border-red-800 disabled:text-red-400 disabled:opacity-100",blue:"bg-blue-900 text-slate-50 hover:opacity-80 active:border-blue-800 disabled:text-blue-400 disabled:opacity-100"}[bo],ff[Ra]),pf=Ne$1("flex items-center justify-center gap-2 border border-none outline-none transition disabled:cursor-not-allowed",hf,hc);return jsxs("button",{className:pf,ref:Ai,...df,children:[uf==="left"&&mc,pc,uf==="right"&&mc]})});function re$2(vo,Ai,{checkForDefaultPrevented:bo=!0}={}){return function(Ra){if(vo==null||vo(Ra),bo===!1||!Ra.defaultPrevented)return Ai==null?void 0:Ai(Ra)}}function nb(vo,Ai){const bo=y$2.createContext(Ai),Ra=pc=>{const{children:mc,...uf}=pc,df=y$2.useMemo(()=>uf,Object.values(uf));return jsx(bo.Provider,{value:df,children:mc})};Ra.displayName=vo+"Provider";function hc(pc){const mc=y$2.useContext(bo);if(mc)return mc;if(Ai!==void 0)return Ai;throw new Error(`\`${pc}\` must be used within \`${vo}\``)}return[Ra,hc]}function Wt$2(vo,Ai=[]){let bo=[];function Ra(pc,mc){const uf=y$2.createContext(mc),df=bo.length;bo=[...bo,mc];const ff=pf=>{var mf;const{scope:gf,children:yf,...vf}=pf,bf=((mf=gf==null?void 0:gf[vo])==null?void 0:mf[df])||uf,Sf=y$2.useMemo(()=>vf,Object.values(vf));return jsx(bf.Provider,{value:Sf,children:yf})};ff.displayName=pc+"Provider";function hf(pf,mf){var gf;const yf=((gf=mf==null?void 0:mf[vo])==null?void 0:gf[df])||uf,vf=y$2.useContext(yf);if(vf)return vf;if(mc!==void 0)return mc;throw new Error(`\`${pf}\` must be used within \`${pc}\``)}return[ff,hf]}const hc=()=>{const pc=bo.map(mc=>y$2.createContext(mc));return function(mc){const uf=(mc==null?void 0:mc[vo])||pc;return y$2.useMemo(()=>({[`__scope${vo}`]:{...mc,[vo]:uf}}),[mc,uf])}};return hc.scopeName=vo,[Ra,rb(hc,...Ai)]}function rb(...vo){const Ai=vo[0];if(vo.length===1)return Ai;const bo=()=>{const Ra=vo.map(hc=>({useScope:hc(),scopeName:hc.scopeName}));return function(hc){const pc=Ra.reduce((mc,{useScope:uf,scopeName:df})=>{const ff=uf(hc)[`__scope${df}`];return{...mc,...ff}},{});return y$2.useMemo(()=>({[`__scope${Ai.scopeName}`]:pc}),[pc])}};return bo.scopeName=Ai.scopeName,bo}function at$2(vo){const Ai=y$2.useRef(vo);return y$2.useEffect(()=>{Ai.current=vo}),y$2.useMemo(()=>(...bo)=>{var Ra;return(Ra=Ai.current)==null?void 0:Ra.call(Ai,...bo)},[])}function Qn$2({prop:vo,defaultProp:Ai,onChange:bo=()=>{}}){const[Ra,hc]=ob({defaultProp:Ai,onChange:bo}),pc=vo!==void 0,mc=pc?vo:Ra,uf=at$2(bo),df=y$2.useCallback(ff=>{if(pc){const hf=typeof ff=="function"?ff(vo):ff;hf!==vo&&uf(hf)}else hc(ff)},[pc,vo,hc,uf]);return[mc,df]}function ob({defaultProp:vo,onChange:Ai}){const bo=y$2.useState(vo),[Ra]=bo,hc=y$2.useRef(Ra),pc=at$2(Ai);return y$2.useEffect(()=>{hc.current!==Ra&&(pc(Ra),hc.current=Ra)},[Ra,hc,pc]),bo}function Rl(vo){const Ai=vo+"CollectionProvider",[bo,Ra]=Wt$2(Ai),[hc,pc]=bo(Ai,{collectionRef:{current:null},itemMap:new Map}),mc=gf=>{const{scope:yf,children:vf}=gf,bf=y__default.useRef(null),Sf=y__default.useRef(new Map).current;return jsx(hc,{scope:yf,itemMap:Sf,collectionRef:bf,children:vf})};mc.displayName=Ai;const uf=vo+"CollectionSlot",df=y__default.forwardRef((gf,yf)=>{const{scope:vf,children:bf}=gf,Sf=pc(uf,vf),xf=Fe$2(yf,Sf.collectionRef);return jsx(mn$1,{ref:xf,children:bf})});df.displayName=uf;const ff=vo+"CollectionItemSlot",hf="data-radix-collection-item",pf=y__default.forwardRef((gf,yf)=>{const{scope:vf,children:bf,...Sf}=gf,xf=y__default.useRef(null),wf=Fe$2(yf,xf),s1=pc(ff,vf);return y__default.useEffect(()=>(s1.itemMap.set(xf,{ref:xf,...Sf}),()=>void s1.itemMap.delete(xf))),jsx(mn$1,{[hf]:"",ref:wf,children:bf})});pf.displayName=ff;function mf(gf){const yf=pc(vo+"CollectionConsumer",gf);return y__default.useCallback(()=>{const vf=yf.collectionRef.current;if(!vf)return[];const bf=Array.from(vf.querySelectorAll(`[${hf}]`));return Array.from(yf.itemMap.values()).sort((Sf,xf)=>bf.indexOf(Sf.ref.current)-bf.indexOf(xf.ref.current))},[yf.collectionRef,yf.itemMap])}return[{Provider:mc,Slot:df,ItemSlot:pf},mf,Ra]}var ab=y$2.createContext(void 0);function ei(vo){const Ai=y$2.useContext(ab);return vo||Ai||"ltr"}function ib(vo,Ai=globalThis==null?void 0:globalThis.document){const bo=at$2(vo);y$2.useEffect(()=>{const Ra=hc=>{hc.key==="Escape"&&bo(hc)};return Ai.addEventListener("keydown",Ra,{capture:!0}),()=>Ai.removeEventListener("keydown",Ra,{capture:!0})},[bo,Ai])}var sb="DismissableLayer",Ia="dismissableLayer.update",cb="dismissableLayer.pointerDownOutside",lb="dismissableLayer.focusOutside",Ps$1,_l=y$2.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),oo$1=y$2.forwardRef((vo,Ai)=>{const{disableOutsidePointerEvents:bo=!1,onEscapeKeyDown:Ra,onPointerDownOutside:hc,onFocusOutside:pc,onInteractOutside:mc,onDismiss:uf,...df}=vo,ff=y$2.useContext(_l),[hf,pf]=y$2.useState(null),mf=(hf==null?void 0:hf.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,gf]=y$2.useState({}),yf=Fe$2(Ai,c1=>pf(c1)),vf=Array.from(ff.layers),[bf]=[...ff.layersWithOutsidePointerEventsDisabled].slice(-1),Sf=vf.indexOf(bf),xf=hf?vf.indexOf(hf):-1,wf=ff.layersWithOutsidePointerEventsDisabled.size>0,s1=xf>=Sf,If=fb(c1=>{const m1=c1.target,k1=[...ff.branches].some(N1=>N1.contains(m1));!s1||k1||(hc==null||hc(c1),mc==null||mc(c1),c1.defaultPrevented||uf==null||uf())},mf),l1=mb(c1=>{const m1=c1.target;[...ff.branches].some(k1=>k1.contains(m1))||(pc==null||pc(c1),mc==null||mc(c1),c1.defaultPrevented||uf==null||uf())},mf);return ib(c1=>{xf===ff.layers.size-1&&(Ra==null||Ra(c1),!c1.defaultPrevented&&uf&&(c1.preventDefault(),uf()))},mf),y$2.useEffect(()=>{if(hf)return bo&&(ff.layersWithOutsidePointerEventsDisabled.size===0&&(Ps$1=mf.body.style.pointerEvents,mf.body.style.pointerEvents="none"),ff.layersWithOutsidePointerEventsDisabled.add(hf)),ff.layers.add(hf),Ts(),()=>{bo&&ff.layersWithOutsidePointerEventsDisabled.size===1&&(mf.body.style.pointerEvents=Ps$1)}},[hf,mf,bo,ff]),y$2.useEffect(()=>()=>{hf&&(ff.layers.delete(hf),ff.layersWithOutsidePointerEventsDisabled.delete(hf),Ts())},[hf,ff]),y$2.useEffect(()=>{const c1=()=>gf({});return document.addEventListener(Ia,c1),()=>document.removeEventListener(Ia,c1)},[]),jsx(we$1.div,{...df,ref:yf,style:{pointerEvents:wf?s1?"auto":"none":void 0,...vo.style},onFocusCapture:re$2(vo.onFocusCapture,l1.onFocusCapture),onBlurCapture:re$2(vo.onBlurCapture,l1.onBlurCapture),onPointerDownCapture:re$2(vo.onPointerDownCapture,If.onPointerDownCapture)})});oo$1.displayName=sb;var ub="DismissableLayerBranch",db=y$2.forwardRef((vo,Ai)=>{const bo=y$2.useContext(_l),Ra=y$2.useRef(null),hc=Fe$2(Ai,Ra);return y$2.useEffect(()=>{const pc=Ra.current;if(pc)return bo.branches.add(pc),()=>{bo.branches.delete(pc)}},[bo.branches]),jsx(we$1.div,{...vo,ref:hc})});db.displayName=ub;function fb(vo,Ai=globalThis==null?void 0:globalThis.document){const bo=at$2(vo),Ra=y$2.useRef(!1),hc=y$2.useRef(()=>{});return y$2.useEffect(()=>{const pc=uf=>{if(uf.target&&!Ra.current){let df=function(){kl(cb,bo,ff,{discrete:!0})};const ff={originalEvent:uf};uf.pointerType==="touch"?(Ai.removeEventListener("click",hc.current),hc.current=df,Ai.addEventListener("click",hc.current,{once:!0})):df()}else Ai.removeEventListener("click",hc.current);Ra.current=!1},mc=window.setTimeout(()=>{Ai.addEventListener("pointerdown",pc)},0);return()=>{window.clearTimeout(mc),Ai.removeEventListener("pointerdown",pc),Ai.removeEventListener("click",hc.current)}},[Ai,bo]),{onPointerDownCapture:()=>Ra.current=!0}}function mb(vo,Ai=globalThis==null?void 0:globalThis.document){const bo=at$2(vo),Ra=y$2.useRef(!1);return y$2.useEffect(()=>{const hc=pc=>{pc.target&&!Ra.current&&kl(lb,bo,{originalEvent:pc},{discrete:!1})};return Ai.addEventListener("focusin",hc),()=>Ai.removeEventListener("focusin",hc)},[Ai,bo]),{onFocusCapture:()=>Ra.current=!0,onBlurCapture:()=>Ra.current=!1}}function Ts(){const vo=new CustomEvent(Ia);document.dispatchEvent(vo)}function kl(vo,Ai,bo,{discrete:Ra}){const hc=bo.originalEvent.target,pc=new CustomEvent(vo,{bubbles:!1,cancelable:!0,detail:bo});Ai&&hc.addEventListener(vo,Ai,{once:!0}),Ra?_c(hc,pc):hc.dispatchEvent(pc)}var Wo$1=0;function Fl(){y$2.useEffect(()=>{const vo=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",vo[0]??Os$1()),document.body.insertAdjacentElement("beforeend",vo[1]??Os$1()),Wo$1++,()=>{Wo$1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(Ai=>Ai.remove()),Wo$1--}},[])}function Os$1(){const vo=document.createElement("span");return vo.setAttribute("data-radix-focus-guard",""),vo.tabIndex=0,vo.style.outline="none",vo.style.opacity="0",vo.style.position="fixed",vo.style.pointerEvents="none",vo}var Bo$1="focusScope.autoFocusOnMount",zo$1="focusScope.autoFocusOnUnmount",Ms$1={bubbles:!1,cancelable:!0},pb="FocusScope",ti=y$2.forwardRef((vo,Ai)=>{const{loop:bo=!1,trapped:Ra=!1,onMountAutoFocus:hc,onUnmountAutoFocus:pc,...mc}=vo,[uf,df]=y$2.useState(null),ff=at$2(hc),hf=at$2(pc),pf=y$2.useRef(null),mf=Fe$2(Ai,vf=>df(vf)),gf=y$2.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y$2.useEffect(()=>{if(Ra){let vf=function(wf){if(gf.paused||!uf)return;const s1=wf.target;uf.contains(s1)?pf.current=s1:At$2(pf.current,{select:!0})},bf=function(wf){if(gf.paused||!uf)return;const s1=wf.relatedTarget;s1!==null&&(uf.contains(s1)||At$2(pf.current,{select:!0}))},Sf=function(wf){if(document.activeElement===document.body)for(const s1 of wf)s1.removedNodes.length>0&&At$2(uf)};document.addEventListener("focusin",vf),document.addEventListener("focusout",bf);const xf=new MutationObserver(Sf);return uf&&xf.observe(uf,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",vf),document.removeEventListener("focusout",bf),xf.disconnect()}}},[Ra,uf,gf.paused]),y$2.useEffect(()=>{if(uf){As.add(gf);const vf=document.activeElement;if(!uf.contains(vf)){const bf=new CustomEvent(Bo$1,Ms$1);uf.addEventListener(Bo$1,ff),uf.dispatchEvent(bf),bf.defaultPrevented||(hb(wb(Vl(uf)),{select:!0}),document.activeElement===vf&&At$2(uf))}return()=>{uf.removeEventListener(Bo$1,ff),setTimeout(()=>{const bf=new CustomEvent(zo$1,Ms$1);uf.addEventListener(zo$1,hf),uf.dispatchEvent(bf),bf.defaultPrevented||At$2(vf??document.body,{select:!0}),uf.removeEventListener(zo$1,hf),As.remove(gf)},0)}}},[uf,ff,hf,gf]);const yf=y$2.useCallback(vf=>{if(!bo&&!Ra||gf.paused)return;const bf=vf.key==="Tab"&&!vf.altKey&&!vf.ctrlKey&&!vf.metaKey,Sf=document.activeElement;if(bf&&Sf){const xf=vf.currentTarget,[wf,s1]=gb(xf);wf&&s1?!vf.shiftKey&&Sf===s1?(vf.preventDefault(),bo&&At$2(wf,{select:!0})):vf.shiftKey&&Sf===wf&&(vf.preventDefault(),bo&&At$2(s1,{select:!0})):Sf===xf&&vf.preventDefault()}},[bo,Ra,gf.paused]);return jsx(we$1.div,{tabIndex:-1,...mc,ref:mf,onKeyDown:yf})});ti.displayName=pb;function hb(vo,{select:Ai=!1}={}){const bo=document.activeElement;for(const Ra of vo)if(At$2(Ra,{select:Ai}),document.activeElement!==bo)return}function gb(vo){const Ai=Vl(vo),bo=Ns(Ai,vo),Ra=Ns(Ai.reverse(),vo);return[bo,Ra]}function Vl(vo){const Ai=[],bo=document.createTreeWalker(vo,NodeFilter.SHOW_ELEMENT,{acceptNode:Ra=>{const hc=Ra.tagName==="INPUT"&&Ra.type==="hidden";return Ra.disabled||Ra.hidden||hc?NodeFilter.FILTER_SKIP:Ra.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;bo.nextNode();)Ai.push(bo.currentNode);return Ai}function Ns(vo,Ai){for(const bo of vo)if(!vb(bo,{upTo:Ai}))return bo}function vb(vo,{upTo:Ai}){if(getComputedStyle(vo).visibility==="hidden")return!0;for(;vo;){if(Ai!==void 0&&vo===Ai)return!1;if(getComputedStyle(vo).display==="none")return!0;vo=vo.parentElement}return!1}function bb(vo){return vo instanceof HTMLInputElement&&"select"in vo}function At$2(vo,{select:Ai=!1}={}){if(vo&&vo.focus){const bo=document.activeElement;vo.focus({preventScroll:!0}),vo!==bo&&bb(vo)&&Ai&&vo.select()}}var As=yb();function yb(){let vo=[];return{add(Ai){const bo=vo[0];Ai!==bo&&(bo==null||bo.pause()),vo=Ds$1(vo,Ai),vo.unshift(Ai)},remove(Ai){var bo;vo=Ds$1(vo,Ai),(bo=vo[0])==null||bo.resume()}}}function Ds$1(vo,Ai){const bo=[...vo],Ra=bo.indexOf(Ai);return Ra!==-1&&bo.splice(Ra,1),bo}function wb(vo){return vo.filter(Ai=>Ai.tagName!=="A")}var Xt$1=globalThis!=null&&globalThis.document?y$2.useLayoutEffect:()=>{},xb=y$2.useId||(()=>{}),Sb=0;function Ft$2(vo){const[Ai,bo]=y$2.useState(xb());return Xt$1(()=>{bo(Ra=>Ra??String(Sb++))},[vo]),Ai?`radix-${Ai}`:""}var Sr$2=typeof document<"u"?useLayoutEffect:useEffect;function Vr$2(vo,Ai){if(vo===Ai)return!0;if(typeof vo!=typeof Ai)return!1;if(typeof vo=="function"&&vo.toString()===Ai.toString())return!0;let bo,Ra,hc;if(vo&&Ai&&typeof vo=="object"){if(Array.isArray(vo)){if(bo=vo.length,bo!==Ai.length)return!1;for(Ra=bo;Ra--!==0;)if(!Vr$2(vo[Ra],Ai[Ra]))return!1;return!0}if(hc=Object.keys(vo),bo=hc.length,bo!==Object.keys(Ai).length)return!1;for(Ra=bo;Ra--!==0;)if(!{}.hasOwnProperty.call(Ai,hc[Ra]))return!1;for(Ra=bo;Ra--!==0;){const pc=hc[Ra];if(!(pc==="_owner"&&vo.$$typeof)&&!Vr$2(vo[pc],Ai[pc]))return!1}return!0}return vo!==vo&&Ai!==Ai}function Ll(vo){return typeof window>"u"?1:(vo.ownerDocument.defaultView||window).devicePixelRatio||1}function Rs(vo,Ai){const bo=Ll(vo);return Math.round(Ai*bo)/bo}function jo(vo){const Ai=y$2.useRef(vo);return Sr$2(()=>{Ai.current=vo}),Ai}function Cb(vo){vo===void 0&&(vo={});const{placement:Ai="bottom",strategy:bo="absolute",middleware:Ra=[],platform:hc,elements:{reference:pc,floating:mc}={},transform:uf=!0,whileElementsMounted:df,open:ff}=vo,[hf,pf]=y$2.useState({x:0,y:0,strategy:bo,placement:Ai,middlewareData:{},isPositioned:!1}),[mf,gf]=y$2.useState(Ra);Vr$2(mf,Ra)||gf(Ra);const[yf,vf]=y$2.useState(null),[bf,Sf]=y$2.useState(null),xf=y$2.useCallback(B1=>{B1!==l1.current&&(l1.current=B1,vf(B1))},[]),wf=y$2.useCallback(B1=>{B1!==c1.current&&(c1.current=B1,Sf(B1))},[]),s1=pc||yf,If=mc||bf,l1=y$2.useRef(null),c1=y$2.useRef(null),m1=y$2.useRef(hf),k1=df!=null,N1=jo(df),R1=jo(hc),$1=jo(ff),D1=y$2.useCallback(()=>{if(!l1.current||!c1.current)return;const B1={placement:Ai,strategy:bo,middleware:mf};R1.current&&(B1.platform=R1.current),Fh(l1.current,c1.current,B1).then(V1=>{const Z1={...V1,isPositioned:$1.current!==!1};f1.current&&!Vr$2(m1.current,Z1)&&(m1.current=Z1,jl$1.flushSync(()=>{pf(Z1)}))})},[mf,Ai,bo,R1,$1]);Sr$2(()=>{ff===!1&&m1.current.isPositioned&&(m1.current.isPositioned=!1,pf(B1=>({...B1,isPositioned:!1})))},[ff]);const f1=y$2.useRef(!1);Sr$2(()=>(f1.current=!0,()=>{f1.current=!1}),[]),Sr$2(()=>{if(s1&&(l1.current=s1),If&&(c1.current=If),s1&&If){if(N1.current)return N1.current(s1,If,D1);D1()}},[s1,If,D1,N1,k1]);const T1=y$2.useMemo(()=>({reference:l1,floating:c1,setReference:xf,setFloating:wf}),[xf,wf]),A1=y$2.useMemo(()=>({reference:s1,floating:If}),[s1,If]),L1=y$2.useMemo(()=>{const B1={position:bo,left:0,top:0};if(!A1.floating)return B1;const V1=Rs(A1.floating,hf.x),Z1=Rs(A1.floating,hf.y);return uf?{...B1,transform:"translate("+V1+"px, "+Z1+"px)",...Ll(A1.floating)>=1.5&&{willChange:"transform"}}:{position:bo,left:V1,top:Z1}},[bo,uf,A1.floating,hf.x,hf.y]);return y$2.useMemo(()=>({...hf,update:D1,refs:T1,elements:A1,floatingStyles:L1}),[hf,D1,T1,A1,L1])}const Ib=vo=>{function Ai(bo){return{}.hasOwnProperty.call(bo,"current")}return{name:"arrow",options:vo,fn(bo){const{element:Ra,padding:hc}=typeof vo=="function"?vo(bo):vo;return Ra&&Ai(Ra)?Ra.current!=null?cs({element:Ra.current,padding:hc}).fn(bo):{}:Ra?cs({element:Ra,padding:hc}).fn(bo):{}}}},Eb=(vo,Ai)=>({...Nh(vo),options:[vo,Ai]}),Pb=(vo,Ai)=>({...Ah(vo),options:[vo,Ai]}),Tb=(vo,Ai)=>({...kh(vo),options:[vo,Ai]}),Ob=(vo,Ai)=>({...Dh(vo),options:[vo,Ai]}),Mb=(vo,Ai)=>({...Rh(vo),options:[vo,Ai]}),Nb=(vo,Ai)=>({..._h(vo),options:[vo,Ai]}),Ab=(vo,Ai)=>({...Ib(vo),options:[vo,Ai]});var Db="Arrow",$l=y$2.forwardRef((vo,Ai)=>{const{children:bo,width:Ra=10,height:hc=5,...pc}=vo;return jsx(we$1.svg,{...pc,ref:Ai,width:Ra,height:hc,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:vo.asChild?bo:jsx("polygon",{points:"0,0 30,0 15,10"})})});$l.displayName=Db;var Rb=$l;function _b(vo){const[Ai,bo]=y$2.useState(void 0);return Xt$1(()=>{if(vo){bo({width:vo.offsetWidth,height:vo.offsetHeight});const Ra=new ResizeObserver(hc=>{if(!Array.isArray(hc)||!hc.length)return;const pc=hc[0];let mc,uf;if("borderBoxSize"in pc){const df=pc.borderBoxSize,ff=Array.isArray(df)?df[0]:df;mc=ff.inlineSize,uf=ff.blockSize}else mc=vo.offsetWidth,uf=vo.offsetHeight;bo({width:mc,height:uf})});return Ra.observe(vo,{box:"border-box"}),()=>Ra.unobserve(vo)}else bo(void 0)},[vo]),Ai}var ni="Popper",[Ul,ao$1]=Wt$2(ni),[kb,Hl]=Ul(ni),Wl=vo=>{const{__scopePopper:Ai,children:bo}=vo,[Ra,hc]=y$2.useState(null);return jsx(kb,{scope:Ai,anchor:Ra,onAnchorChange:hc,children:bo})};Wl.displayName=ni;var Bl="PopperAnchor",zl=y$2.forwardRef((vo,Ai)=>{const{__scopePopper:bo,virtualRef:Ra,...hc}=vo,pc=Hl(Bl,bo),mc=y$2.useRef(null),uf=Fe$2(Ai,mc);return y$2.useEffect(()=>{pc.onAnchorChange((Ra==null?void 0:Ra.current)||mc.current)}),Ra?null:jsx(we$1.div,{...hc,ref:uf})});zl.displayName=Bl;var ri="PopperContent",[Fb,Vb]=Ul(ri),jl=y$2.forwardRef((vo,Ai)=>{var bo,Ra,hc,pc,mc,uf;const{__scopePopper:df,side:ff="bottom",sideOffset:hf=0,align:pf="center",alignOffset:mf=0,arrowPadding:gf=0,avoidCollisions:yf=!0,collisionBoundary:vf=[],collisionPadding:bf=0,sticky:Sf="partial",hideWhenDetached:xf=!1,updatePositionStrategy:wf="optimized",onPlaced:s1,...If}=vo,l1=Hl(ri,df),[c1,m1]=y$2.useState(null),k1=Fe$2(Ai,rT=>m1(rT)),[N1,R1]=y$2.useState(null),$1=_b(N1),D1=($1==null?void 0:$1.width)??0,f1=($1==null?void 0:$1.height)??0,T1=ff+(pf!=="center"?"-"+pf:""),A1=typeof bf=="number"?bf:{top:0,right:0,bottom:0,left:0,...bf},L1=Array.isArray(vf)?vf:[vf],B1=L1.length>0,V1={padding:A1,boundary:L1.filter($b),altBoundary:B1},{refs:Z1,floatingStyles:H1,placement:E1,isPositioned:F1,middlewareData:M1}=Cb({strategy:"fixed",placement:T1,whileElementsMounted:(...rT)=>cl(...rT,{animationFrame:wf==="always"}),elements:{reference:l1.anchor},middleware:[Eb({mainAxis:hf+f1,alignmentAxis:mf}),yf&&Pb({mainAxis:!0,crossAxis:!1,limiter:Sf==="partial"?Tb():void 0,...V1}),yf&&Ob({...V1}),Mb({...V1,apply:({elements:rT,rects:lT,availableWidth:_1,availableHeight:j1})=>{const{width:P1,height:u1}=lT.reference,d1=rT.floating.style;d1.setProperty("--radix-popper-available-width",`${_1}px`),d1.setProperty("--radix-popper-available-height",`${j1}px`),d1.setProperty("--radix-popper-anchor-width",`${P1}px`),d1.setProperty("--radix-popper-anchor-height",`${u1}px`)}}),N1&&Ab({element:N1,padding:gf}),Ub({arrowWidth:D1,arrowHeight:f1}),xf&&Nb({strategy:"referenceHidden",...V1})]}),[q1,z1]=ql(E1),W1=at$2(s1);Xt$1(()=>{F1&&(W1==null||W1())},[F1,W1]);const J1=(bo=M1.arrow)==null?void 0:bo.x,eT=(Ra=M1.arrow)==null?void 0:Ra.y,nT=((hc=M1.arrow)==null?void 0:hc.centerOffset)!==0,[sT,iT]=y$2.useState();return Xt$1(()=>{c1&&iT(window.getComputedStyle(c1).zIndex)},[c1]),jsx("div",{ref:Z1.setFloating,"data-radix-popper-content-wrapper":"",style:{...H1,transform:F1?H1.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:sT,"--radix-popper-transform-origin":[(pc=M1.transformOrigin)==null?void 0:pc.x,(mc=M1.transformOrigin)==null?void 0:mc.y].join(" "),...((uf=M1.hide)==null?void 0:uf.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:vo.dir,children:jsx(Fb,{scope:df,placedSide:q1,onArrowChange:R1,arrowX:J1,arrowY:eT,shouldHideArrow:nT,children:jsx(we$1.div,{"data-side":q1,"data-align":z1,...If,ref:k1,style:{...If.style,animation:F1?void 0:"none"}})})})});jl.displayName=ri;var Yl="PopperArrow",Lb={top:"bottom",right:"left",bottom:"top",left:"right"},Gl=y$2.forwardRef(function(vo,Ai){const{__scopePopper:bo,...Ra}=vo,hc=Vb(Yl,bo),pc=Lb[hc.placedSide];return jsx("span",{ref:hc.onArrowChange,style:{position:"absolute",left:hc.arrowX,top:hc.arrowY,[pc]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[hc.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[hc.placedSide],visibility:hc.shouldHideArrow?"hidden":void 0},children:jsx(Rb,{...Ra,ref:Ai,style:{...Ra.style,display:"block"}})})});Gl.displayName=Yl;function $b(vo){return vo!==null}var Ub=vo=>({name:"transformOrigin",options:vo,fn(Ai){var bo,Ra,hc;const{placement:pc,rects:mc,middlewareData:uf}=Ai,df=((bo=uf.arrow)==null?void 0:bo.centerOffset)!==0,ff=df?0:vo.arrowWidth,hf=df?0:vo.arrowHeight,[pf,mf]=ql(pc),gf={start:"0%",center:"50%",end:"100%"}[mf],yf=(((Ra=uf.arrow)==null?void 0:Ra.x)??0)+ff/2,vf=(((hc=uf.arrow)==null?void 0:hc.y)??0)+hf/2;let bf="",Sf="";return pf==="bottom"?(bf=df?gf:`${yf}px`,Sf=`${-hf}px`):pf==="top"?(bf=df?gf:`${yf}px`,Sf=`${mc.floating.height+hf}px`):pf==="right"?(bf=`${-hf}px`,Sf=df?gf:`${vf}px`):pf==="left"&&(bf=`${mc.floating.width+hf}px`,Sf=df?gf:`${vf}px`),{data:{x:bf,y:Sf}}}});function ql(vo){const[Ai,bo="center"]=vo.split("-");return[Ai,bo]}var Xl=Wl,Kl=zl,Zl=jl,Ql=Gl,Hb="Portal",io$1=y$2.forwardRef((vo,Ai)=>{var bo;const{container:Ra,...hc}=vo,[pc,mc]=y$2.useState(!1);Xt$1(()=>mc(!0),[]);const uf=Ra||pc&&((bo=globalThis==null?void 0:globalThis.document)==null?void 0:bo.body);return uf?jl__default.createPortal(jsx(we$1.div,{...hc,ref:Ai}),uf):null});io$1.displayName=Hb;function Wb(vo,Ai){return y$2.useReducer((bo,Ra)=>Ai[bo][Ra]??bo,vo)}var it$1=vo=>{const{present:Ai,children:bo}=vo,Ra=Bb(Ai),hc=typeof bo=="function"?bo({present:Ra.isPresent}):y$2.Children.only(bo),pc=Fe$2(Ra.ref,zb(hc));return typeof bo=="function"||Ra.isPresent?y$2.cloneElement(hc,{ref:pc}):null};it$1.displayName="Presence";function Bb(vo){const[Ai,bo]=y$2.useState(),Ra=y$2.useRef({}),hc=y$2.useRef(vo),pc=y$2.useRef("none"),mc=vo?"mounted":"unmounted",[uf,df]=Wb(mc,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y$2.useEffect(()=>{const ff=ur$2(Ra.current);pc.current=uf==="mounted"?ff:"none"},[uf]),Xt$1(()=>{const ff=Ra.current,hf=hc.current;if(hf!==vo){const pf=pc.current,mf=ur$2(ff);vo?df("MOUNT"):mf==="none"||(ff==null?void 0:ff.display)==="none"?df("UNMOUNT"):df(hf&&pf!==mf?"ANIMATION_OUT":"UNMOUNT"),hc.current=vo}},[vo,df]),Xt$1(()=>{if(Ai){let ff;const hf=Ai.ownerDocument.defaultView??window,pf=gf=>{const yf=ur$2(Ra.current).includes(gf.animationName);if(gf.target===Ai&&yf&&(df("ANIMATION_END"),!hc.current)){const vf=Ai.style.animationFillMode;Ai.style.animationFillMode="forwards",ff=hf.setTimeout(()=>{Ai.style.animationFillMode==="forwards"&&(Ai.style.animationFillMode=vf)})}},mf=gf=>{gf.target===Ai&&(pc.current=ur$2(Ra.current))};return Ai.addEventListener("animationstart",mf),Ai.addEventListener("animationcancel",pf),Ai.addEventListener("animationend",pf),()=>{hf.clearTimeout(ff),Ai.removeEventListener("animationstart",mf),Ai.removeEventListener("animationcancel",pf),Ai.removeEventListener("animationend",pf)}}else df("ANIMATION_END")},[Ai,df]),{isPresent:["mounted","unmountSuspended"].includes(uf),ref:y$2.useCallback(ff=>{ff&&(Ra.current=getComputedStyle(ff)),bo(ff)},[])}}function ur$2(vo){return(vo==null?void 0:vo.animationName)||"none"}function zb(vo){var Ai,bo;let Ra=(Ai=Object.getOwnPropertyDescriptor(vo.props,"ref"))==null?void 0:Ai.get,hc=Ra&&"isReactWarning"in Ra&&Ra.isReactWarning;return hc?vo.ref:(Ra=(bo=Object.getOwnPropertyDescriptor(vo,"ref"))==null?void 0:bo.get,hc=Ra&&"isReactWarning"in Ra&&Ra.isReactWarning,hc?vo.props.ref:vo.props.ref||vo.ref)}var Yo$1="rovingFocusGroup.onEntryFocus",jb={bubbles:!1,cancelable:!0},so$1="RovingFocusGroup",[Ea,Jl,Yb]=Rl(so$1),[Gb,co$1]=Wt$2(so$1,[Yb]),[qb,Xb]=Gb(so$1),eu=y$2.forwardRef((vo,Ai)=>jsx(Ea.Provider,{scope:vo.__scopeRovingFocusGroup,children:jsx(Ea.Slot,{scope:vo.__scopeRovingFocusGroup,children:jsx(Kb,{...vo,ref:Ai})})}));eu.displayName=so$1;var Kb=y$2.forwardRef((vo,Ai)=>{const{__scopeRovingFocusGroup:bo,orientation:Ra,loop:hc=!1,dir:pc,currentTabStopId:mc,defaultCurrentTabStopId:uf,onCurrentTabStopIdChange:df,onEntryFocus:ff,preventScrollOnEntryFocus:hf=!1,...pf}=vo,mf=y$2.useRef(null),gf=Fe$2(Ai,mf),yf=ei(pc),[vf=null,bf]=Qn$2({prop:mc,defaultProp:uf,onChange:df}),[Sf,xf]=y$2.useState(!1),wf=at$2(ff),s1=Jl(bo),If=y$2.useRef(!1),[l1,c1]=y$2.useState(0);return y$2.useEffect(()=>{const m1=mf.current;if(m1)return m1.addEventListener(Yo$1,wf),()=>m1.removeEventListener(Yo$1,wf)},[wf]),jsx(qb,{scope:bo,orientation:Ra,dir:yf,loop:hc,currentTabStopId:vf,onItemFocus:y$2.useCallback(m1=>bf(m1),[bf]),onItemShiftTab:y$2.useCallback(()=>xf(!0),[]),onFocusableItemAdd:y$2.useCallback(()=>c1(m1=>m1+1),[]),onFocusableItemRemove:y$2.useCallback(()=>c1(m1=>m1-1),[]),children:jsx(we$1.div,{tabIndex:Sf||l1===0?-1:0,"data-orientation":Ra,...pf,ref:gf,style:{outline:"none",...vo.style},onMouseDown:re$2(vo.onMouseDown,()=>{If.current=!0}),onFocus:re$2(vo.onFocus,m1=>{const k1=!If.current;if(m1.target===m1.currentTarget&&k1&&!Sf){const N1=new CustomEvent(Yo$1,jb);if(m1.currentTarget.dispatchEvent(N1),!N1.defaultPrevented){const R1=s1().filter(T1=>T1.focusable),$1=R1.find(T1=>T1.active),D1=R1.find(T1=>T1.id===vf),f1=[$1,D1,...R1].filter(Boolean).map(T1=>T1.ref.current);ru(f1,hf)}}If.current=!1}),onBlur:re$2(vo.onBlur,()=>xf(!1))})})}),tu="RovingFocusGroupItem",nu=y$2.forwardRef((vo,Ai)=>{const{__scopeRovingFocusGroup:bo,focusable:Ra=!0,active:hc=!1,tabStopId:pc,...mc}=vo,uf=Ft$2(),df=pc||uf,ff=Xb(tu,bo),hf=ff.currentTabStopId===df,pf=Jl(bo),{onFocusableItemAdd:mf,onFocusableItemRemove:gf}=ff;return y$2.useEffect(()=>{if(Ra)return mf(),()=>gf()},[Ra,mf,gf]),jsx(Ea.ItemSlot,{scope:bo,id:df,focusable:Ra,active:hc,children:jsx(we$1.span,{tabIndex:hf?0:-1,"data-orientation":ff.orientation,...mc,ref:Ai,onMouseDown:re$2(vo.onMouseDown,yf=>{Ra?ff.onItemFocus(df):yf.preventDefault()}),onFocus:re$2(vo.onFocus,()=>ff.onItemFocus(df)),onKeyDown:re$2(vo.onKeyDown,yf=>{if(yf.key==="Tab"&&yf.shiftKey){ff.onItemShiftTab();return}if(yf.target!==yf.currentTarget)return;const vf=Jb(yf,ff.orientation,ff.dir);if(vf!==void 0){if(yf.metaKey||yf.ctrlKey||yf.altKey||yf.shiftKey)return;yf.preventDefault();let bf=pf().filter(Sf=>Sf.focusable).map(Sf=>Sf.ref.current);if(vf==="last")bf.reverse();else if(vf==="prev"||vf==="next"){vf==="prev"&&bf.reverse();const Sf=bf.indexOf(yf.currentTarget);bf=ff.loop?ey(bf,Sf+1):bf.slice(Sf+1)}setTimeout(()=>ru(bf))}})})})});nu.displayName=tu;var Zb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Qb(vo,Ai){return Ai!=="rtl"?vo:vo==="ArrowLeft"?"ArrowRight":vo==="ArrowRight"?"ArrowLeft":vo}function Jb(vo,Ai,bo){const Ra=Qb(vo.key,bo);if(!(Ai==="vertical"&&["ArrowLeft","ArrowRight"].includes(Ra))&&!(Ai==="horizontal"&&["ArrowUp","ArrowDown"].includes(Ra)))return Zb[Ra]}function ru(vo,Ai=!1){const bo=document.activeElement;for(const Ra of vo)if(Ra===bo||(Ra.focus({preventScroll:Ai}),document.activeElement!==bo))return}function ey(vo,Ai){return vo.map((bo,Ra)=>vo[(Ai+Ra)%vo.length])}var ou=eu,au=nu,ty=function(vo){if(typeof document>"u")return null;var Ai=Array.isArray(vo)?vo[0]:vo;return Ai.ownerDocument.body},tn$1=new WeakMap,dr$1=new WeakMap,fr$2={},Go$1=0,iu=function(vo){return vo&&(vo.host||iu(vo.parentNode))},ny=function(vo,Ai){return Ai.map(function(bo){if(vo.contains(bo))return bo;var Ra=iu(bo);return Ra&&vo.contains(Ra)?Ra:(console.error("aria-hidden",bo,"in not contained inside",vo,". Doing nothing"),null)}).filter(function(bo){return!!bo})},ry=function(vo,Ai,bo,Ra){var hc=ny(Ai,Array.isArray(vo)?vo:[vo]);fr$2[bo]||(fr$2[bo]=new WeakMap);var pc=fr$2[bo],mc=[],uf=new Set,df=new Set(hc),ff=function(pf){!pf||uf.has(pf)||(uf.add(pf),ff(pf.parentNode))};hc.forEach(ff);var hf=function(pf){!pf||df.has(pf)||Array.prototype.forEach.call(pf.children,function(mf){if(uf.has(mf))hf(mf);else try{var gf=mf.getAttribute(Ra),yf=gf!==null&&gf!=="false",vf=(tn$1.get(mf)||0)+1,bf=(pc.get(mf)||0)+1;tn$1.set(mf,vf),pc.set(mf,bf),mc.push(mf),vf===1&&yf&&dr$1.set(mf,!0),bf===1&&mf.setAttribute(bo,"true"),yf||mf.setAttribute(Ra,"true")}catch(Sf){console.error("aria-hidden: cannot operate on ",mf,Sf)}})};return hf(Ai),uf.clear(),Go$1++,function(){mc.forEach(function(pf){var mf=tn$1.get(pf)-1,gf=pc.get(pf)-1;tn$1.set(pf,mf),pc.set(pf,gf),mf||(dr$1.has(pf)||pf.removeAttribute(Ra),dr$1.delete(pf)),gf||pf.removeAttribute(bo)}),Go$1--,Go$1||(tn$1=new WeakMap,tn$1=new WeakMap,dr$1=new WeakMap,fr$2={})}},su=function(vo,Ai,bo){bo===void 0&&(bo="data-aria-hidden");var Ra=Array.from(Array.isArray(vo)?vo:[vo]),hc=ty(vo);return hc?(Ra.push.apply(Ra,Array.from(hc.querySelectorAll("[aria-live]"))),ry(Ra,hc,bo,"aria-hidden")):function(){return null}},mt$2=function(){return mt$2=Object.assign||function(vo){for(var Ai,bo=1,Ra=arguments.length;bo<Ra;bo++){Ai=arguments[bo];for(var hc in Ai)Object.prototype.hasOwnProperty.call(Ai,hc)&&(vo[hc]=Ai[hc])}return vo},mt$2.apply(this,arguments)};function cu(vo,Ai){var bo={};for(var Ra in vo)Object.prototype.hasOwnProperty.call(vo,Ra)&&Ai.indexOf(Ra)<0&&(bo[Ra]=vo[Ra]);if(vo!=null&&typeof Object.getOwnPropertySymbols=="function")for(var hc=0,Ra=Object.getOwnPropertySymbols(vo);hc<Ra.length;hc++)Ai.indexOf(Ra[hc])<0&&Object.prototype.propertyIsEnumerable.call(vo,Ra[hc])&&(bo[Ra[hc]]=vo[Ra[hc]]);return bo}function oy(vo,Ai,bo){for(var Ra=0,hc=Ai.length,pc;Ra<hc;Ra++)(pc||!(Ra in Ai))&&(pc||(pc=Array.prototype.slice.call(Ai,0,Ra)),pc[Ra]=Ai[Ra]);return vo.concat(pc||Array.prototype.slice.call(Ai))}var Cr$2="right-scroll-bar-position",Ir$2="width-before-scroll-bar",ay="with-scroll-bars-hidden",iy="--removed-body-scroll-bar-size";function qo$1(vo,Ai){return typeof vo=="function"?vo(Ai):vo&&(vo.current=Ai),vo}function sy(vo,Ai){var bo=useState(function(){return{value:vo,callback:Ai,facade:{get current(){return bo.value},set current(Ra){var hc=bo.value;hc!==Ra&&(bo.value=Ra,bo.callback(Ra,hc))}}}})[0];return bo.callback=Ai,bo.facade}var cy=typeof window<"u"?y$2.useLayoutEffect:y$2.useEffect,_s$1=new WeakMap;function ly(vo,Ai){var bo=sy(null,function(Ra){return vo.forEach(function(hc){return qo$1(hc,Ra)})});return cy(function(){var Ra=_s$1.get(bo);if(Ra){var hc=new Set(Ra),pc=new Set(vo),mc=bo.current;hc.forEach(function(uf){pc.has(uf)||qo$1(uf,null)}),pc.forEach(function(uf){hc.has(uf)||qo$1(uf,mc)})}_s$1.set(bo,vo)},[vo]),bo}function uy(vo){return vo}function dy(vo,Ai){Ai===void 0&&(Ai=uy);var bo=[],Ra=!1,hc={read:function(){if(Ra)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return bo.length?bo[bo.length-1]:vo},useMedium:function(pc){var mc=Ai(pc,Ra);return bo.push(mc),function(){bo=bo.filter(function(uf){return uf!==mc})}},assignSyncMedium:function(pc){for(Ra=!0;bo.length;){var mc=bo;bo=[],mc.forEach(pc)}bo={push:function(uf){return pc(uf)},filter:function(){return bo}}},assignMedium:function(pc){Ra=!0;var mc=[];if(bo.length){var uf=bo;bo=[],uf.forEach(pc),mc=bo}var df=function(){var hf=mc;mc=[],hf.forEach(pc)},ff=function(){return Promise.resolve().then(df)};ff(),bo={push:function(hf){mc.push(hf),ff()},filter:function(hf){return mc=mc.filter(hf),bo}}}};return hc}function fy(vo){vo===void 0&&(vo={});var Ai=dy(null);return Ai.options=mt$2({async:!0,ssr:!1},vo),Ai}var lu=function(vo){var Ai=vo.sideCar,bo=cu(vo,["sideCar"]);if(!Ai)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var Ra=Ai.read();if(!Ra)throw new Error("Sidecar medium not found");return y$2.createElement(Ra,mt$2({},bo))};lu.isSideCarExport=!0;function my(vo,Ai){return vo.useMedium(Ai),lu}var uu=fy(),Xo$1=function(){},lo$1=y$2.forwardRef(function(vo,Ai){var bo=y$2.useRef(null),Ra=y$2.useState({onScrollCapture:Xo$1,onWheelCapture:Xo$1,onTouchMoveCapture:Xo$1}),hc=Ra[0],pc=Ra[1],mc=vo.forwardProps,uf=vo.children,df=vo.className,ff=vo.removeScrollBar,hf=vo.enabled,pf=vo.shards,mf=vo.sideCar,gf=vo.noIsolation,yf=vo.inert,vf=vo.allowPinchZoom,bf=vo.as,Sf=bf===void 0?"div":bf,xf=vo.gapMode,wf=cu(vo,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),s1=mf,If=ly([bo,Ai]),l1=mt$2(mt$2({},wf),hc);return y$2.createElement(y$2.Fragment,null,hf&&y$2.createElement(s1,{sideCar:uu,removeScrollBar:ff,shards:pf,noIsolation:gf,inert:yf,setCallbacks:pc,allowPinchZoom:!!vf,lockRef:bo,gapMode:xf}),mc?y$2.cloneElement(y$2.Children.only(uf),mt$2(mt$2({},l1),{ref:If})):y$2.createElement(Sf,mt$2({},l1,{className:df,ref:If}),uf))});lo$1.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};lo$1.classNames={fullWidth:Ir$2,zeroRight:Cr$2};var py=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function hy(){if(!document)return null;var vo=document.createElement("style");vo.type="text/css";var Ai=py();return Ai&&vo.setAttribute("nonce",Ai),vo}function gy(vo,Ai){vo.styleSheet?vo.styleSheet.cssText=Ai:vo.appendChild(document.createTextNode(Ai))}function vy(vo){var Ai=document.head||document.getElementsByTagName("head")[0];Ai.appendChild(vo)}var by=function(){var vo=0,Ai=null;return{add:function(bo){vo==0&&(Ai=hy())&&(gy(Ai,bo),vy(Ai)),vo++},remove:function(){vo--,!vo&&Ai&&(Ai.parentNode&&Ai.parentNode.removeChild(Ai),Ai=null)}}},yy=function(){var vo=by();return function(Ai,bo){y$2.useEffect(function(){return vo.add(Ai),function(){vo.remove()}},[Ai&&bo])}},du=function(){var vo=yy(),Ai=function(bo){var Ra=bo.styles,hc=bo.dynamic;return vo(Ra,hc),null};return Ai},wy={left:0,top:0,right:0,gap:0},Ko=function(vo){return parseInt(vo||"",10)||0},xy=function(vo){var Ai=window.getComputedStyle(document.body),bo=Ai[vo==="padding"?"paddingLeft":"marginLeft"],Ra=Ai[vo==="padding"?"paddingTop":"marginTop"],hc=Ai[vo==="padding"?"paddingRight":"marginRight"];return[Ko(bo),Ko(Ra),Ko(hc)]},Sy=function(vo){if(vo===void 0&&(vo="margin"),typeof window>"u")return wy;var Ai=xy(vo),bo=document.documentElement.clientWidth,Ra=window.innerWidth;return{left:Ai[0],top:Ai[1],right:Ai[2],gap:Math.max(0,Ra-bo+Ai[2]-Ai[0])}},Cy=du(),dn$1="data-scroll-locked",Iy=function(vo,Ai,bo,Ra){var hc=vo.left,pc=vo.top,mc=vo.right,uf=vo.gap;return bo===void 0&&(bo="margin"),`
|
|
15
|
-
.`.concat(ay,` {
|
|
16
|
-
overflow: hidden `).concat(Ra,`;
|
|
17
|
-
padding-right: `).concat(uf,"px ").concat(Ra,`;
|
|
18
|
-
}
|
|
19
|
-
body[`).concat(dn$1,`] {
|
|
20
|
-
overflow: hidden `).concat(Ra,`;
|
|
21
|
-
overscroll-behavior: contain;
|
|
22
|
-
`).concat([Ai&&"position: relative ".concat(Ra,";"),bo==="margin"&&`
|
|
23
|
-
padding-left: `.concat(hc,`px;
|
|
24
|
-
padding-top: `).concat(pc,`px;
|
|
25
|
-
padding-right: `).concat(mc,`px;
|
|
26
|
-
margin-left:0;
|
|
27
|
-
margin-top:0;
|
|
28
|
-
margin-right: `).concat(uf,"px ").concat(Ra,`;
|
|
29
|
-
`),bo==="padding"&&"padding-right: ".concat(uf,"px ").concat(Ra,";")].filter(Boolean).join(""),`
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.`).concat(Cr$2,` {
|
|
33
|
-
right: `).concat(uf,"px ").concat(Ra,`;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.`).concat(Ir$2,` {
|
|
37
|
-
margin-right: `).concat(uf,"px ").concat(Ra,`;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.`).concat(Cr$2," .").concat(Cr$2,` {
|
|
41
|
-
right: 0 `).concat(Ra,`;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.`).concat(Ir$2," .").concat(Ir$2,` {
|
|
45
|
-
margin-right: 0 `).concat(Ra,`;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
body[`).concat(dn$1,`] {
|
|
49
|
-
`).concat(iy,": ").concat(uf,`px;
|
|
50
|
-
}
|
|
51
|
-
`)},ks$1=function(){var vo=parseInt(document.body.getAttribute(dn$1)||"0",10);return isFinite(vo)?vo:0},Ey=function(){y$2.useEffect(function(){return document.body.setAttribute(dn$1,(ks$1()+1).toString()),function(){var vo=ks$1()-1;vo<=0?document.body.removeAttribute(dn$1):document.body.setAttribute(dn$1,vo.toString())}},[])},Py=function(vo){var Ai=vo.noRelative,bo=vo.noImportant,Ra=vo.gapMode,hc=Ra===void 0?"margin":Ra;Ey();var pc=y$2.useMemo(function(){return Sy(hc)},[hc]);return y$2.createElement(Cy,{styles:Iy(pc,!Ai,hc,bo?"":"!important")})},Pa=!1;if(typeof window<"u")try{var mr$2=Object.defineProperty({},"passive",{get:function(){return Pa=!0,!0}});window.addEventListener("test",mr$2,mr$2),window.removeEventListener("test",mr$2,mr$2)}catch{Pa=!1}var nn$1=Pa?{passive:!1}:!1,Ty=function(vo){return vo.tagName==="TEXTAREA"},fu=function(vo,Ai){if(!(vo instanceof Element))return!1;var bo=window.getComputedStyle(vo);return bo[Ai]!=="hidden"&&!(bo.overflowY===bo.overflowX&&!Ty(vo)&&bo[Ai]==="visible")},Oy=function(vo){return fu(vo,"overflowY")},My=function(vo){return fu(vo,"overflowX")},Fs$1=function(vo,Ai){var bo=Ai.ownerDocument,Ra=Ai;do{typeof ShadowRoot<"u"&&Ra instanceof ShadowRoot&&(Ra=Ra.host);var hc=mu(vo,Ra);if(hc){var pc=pu(vo,Ra),mc=pc[1],uf=pc[2];if(mc>uf)return!0}Ra=Ra.parentNode}while(Ra&&Ra!==bo.body);return!1},Ny=function(vo){var Ai=vo.scrollTop,bo=vo.scrollHeight,Ra=vo.clientHeight;return[Ai,bo,Ra]},Ay=function(vo){var Ai=vo.scrollLeft,bo=vo.scrollWidth,Ra=vo.clientWidth;return[Ai,bo,Ra]},mu=function(vo,Ai){return vo==="v"?Oy(Ai):My(Ai)},pu=function(vo,Ai){return vo==="v"?Ny(Ai):Ay(Ai)},Dy=function(vo,Ai){return vo==="h"&&Ai==="rtl"?-1:1},Ry=function(vo,Ai,bo,Ra,hc){var pc=Dy(vo,window.getComputedStyle(Ai).direction),mc=pc*Ra,uf=bo.target,df=Ai.contains(uf),ff=!1,hf=mc>0,pf=0,mf=0;do{var gf=pu(vo,uf),yf=gf[0],vf=gf[1],bf=gf[2],Sf=vf-bf-pc*yf;(yf||Sf)&&mu(vo,uf)&&(pf+=Sf,mf+=yf),uf instanceof ShadowRoot?uf=uf.host:uf=uf.parentNode}while(!df&&uf!==document.body||df&&(Ai.contains(uf)||Ai===uf));return(hf&&(Math.abs(pf)<1||!hc)||!hf&&(Math.abs(mf)<1||!hc))&&(ff=!0),ff},pr$2=function(vo){return"changedTouches"in vo?[vo.changedTouches[0].clientX,vo.changedTouches[0].clientY]:[0,0]},Vs=function(vo){return[vo.deltaX,vo.deltaY]},Ls=function(vo){return vo&&"current"in vo?vo.current:vo},_y=function(vo,Ai){return vo[0]===Ai[0]&&vo[1]===Ai[1]},ky=function(vo){return`
|
|
52
|
-
.block-interactivity-`.concat(vo,` {pointer-events: none;}
|
|
53
|
-
.allow-interactivity-`).concat(vo,` {pointer-events: all;}
|
|
54
|
-
`)},Fy=0,rn$1=[];function Vy(vo){var Ai=y$2.useRef([]),bo=y$2.useRef([0,0]),Ra=y$2.useRef(),hc=y$2.useState(Fy++)[0],pc=y$2.useState(du)[0],mc=y$2.useRef(vo);y$2.useEffect(function(){mc.current=vo},[vo]),y$2.useEffect(function(){if(vo.inert){document.body.classList.add("block-interactivity-".concat(hc));var vf=oy([vo.lockRef.current],(vo.shards||[]).map(Ls)).filter(Boolean);return vf.forEach(function(bf){return bf.classList.add("allow-interactivity-".concat(hc))}),function(){document.body.classList.remove("block-interactivity-".concat(hc)),vf.forEach(function(bf){return bf.classList.remove("allow-interactivity-".concat(hc))})}}},[vo.inert,vo.lockRef.current,vo.shards]);var uf=y$2.useCallback(function(vf,bf){if("touches"in vf&&vf.touches.length===2||vf.type==="wheel"&&vf.ctrlKey)return!mc.current.allowPinchZoom;var Sf=pr$2(vf),xf=bo.current,wf="deltaX"in vf?vf.deltaX:xf[0]-Sf[0],s1="deltaY"in vf?vf.deltaY:xf[1]-Sf[1],If,l1=vf.target,c1=Math.abs(wf)>Math.abs(s1)?"h":"v";if("touches"in vf&&c1==="h"&&l1.type==="range")return!1;var m1=Fs$1(c1,l1);if(!m1)return!0;if(m1?If=c1:(If=c1==="v"?"h":"v",m1=Fs$1(c1,l1)),!m1)return!1;if(!Ra.current&&"changedTouches"in vf&&(wf||s1)&&(Ra.current=If),!If)return!0;var k1=Ra.current||If;return Ry(k1,bf,vf,k1==="h"?wf:s1,!0)},[]),df=y$2.useCallback(function(vf){var bf=vf;if(!(!rn$1.length||rn$1[rn$1.length-1]!==pc)){var Sf="deltaY"in bf?Vs(bf):pr$2(bf),xf=Ai.current.filter(function(If){return If.name===bf.type&&(If.target===bf.target||bf.target===If.shadowParent)&&_y(If.delta,Sf)})[0];if(xf&&xf.should){bf.cancelable&&bf.preventDefault();return}if(!xf){var wf=(mc.current.shards||[]).map(Ls).filter(Boolean).filter(function(If){return If.contains(bf.target)}),s1=wf.length>0?uf(bf,wf[0]):!mc.current.noIsolation;s1&&bf.cancelable&&bf.preventDefault()}}},[]),ff=y$2.useCallback(function(vf,bf,Sf,xf){var wf={name:vf,delta:bf,target:Sf,should:xf,shadowParent:Ly(Sf)};Ai.current.push(wf),setTimeout(function(){Ai.current=Ai.current.filter(function(s1){return s1!==wf})},1)},[]),hf=y$2.useCallback(function(vf){bo.current=pr$2(vf),Ra.current=void 0},[]),pf=y$2.useCallback(function(vf){ff(vf.type,Vs(vf),vf.target,uf(vf,vo.lockRef.current))},[]),mf=y$2.useCallback(function(vf){ff(vf.type,pr$2(vf),vf.target,uf(vf,vo.lockRef.current))},[]);y$2.useEffect(function(){return rn$1.push(pc),vo.setCallbacks({onScrollCapture:pf,onWheelCapture:pf,onTouchMoveCapture:mf}),document.addEventListener("wheel",df,nn$1),document.addEventListener("touchmove",df,nn$1),document.addEventListener("touchstart",hf,nn$1),function(){rn$1=rn$1.filter(function(vf){return vf!==pc}),document.removeEventListener("wheel",df,nn$1),document.removeEventListener("touchmove",df,nn$1),document.removeEventListener("touchstart",hf,nn$1)}},[]);var gf=vo.removeScrollBar,yf=vo.inert;return y$2.createElement(y$2.Fragment,null,yf?y$2.createElement(pc,{styles:ky(hc)}):null,gf?y$2.createElement(Py,{gapMode:vo.gapMode}):null)}function Ly(vo){for(var Ai=null;vo!==null;)vo instanceof ShadowRoot&&(Ai=vo.host,vo=vo.host),vo=vo.parentNode;return Ai}const $y=my(uu,Vy);var oi=y$2.forwardRef(function(vo,Ai){return y$2.createElement(lo$1,mt$2({},vo,{ref:Ai,sideCar:$y}))});oi.classNames=lo$1.classNames;var Ta=["Enter"," "],Uy=["ArrowDown","PageUp","Home"],hu=["ArrowUp","PageDown","End"],Hy=[...Uy,...hu],Wy={ltr:[...Ta,"ArrowRight"],rtl:[...Ta,"ArrowLeft"]},By={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Jn$2="Menu",[Wn$2,zy,jy]=Rl(Jn$2),[Zt$1,gu]=Wt$2(Jn$2,[jy,ao$1,co$1]),uo=ao$1(),vu=co$1(),[Yy,Qt$2]=Zt$1(Jn$2),[Gy,er$1]=Zt$1(Jn$2),bu=vo=>{const{__scopeMenu:Ai,open:bo=!1,children:Ra,dir:hc,onOpenChange:pc,modal:mc=!0}=vo,uf=uo(Ai),[df,ff]=y$2.useState(null),hf=y$2.useRef(!1),pf=at$2(pc),mf=ei(hc);return y$2.useEffect(()=>{const gf=()=>{hf.current=!0,document.addEventListener("pointerdown",yf,{capture:!0,once:!0}),document.addEventListener("pointermove",yf,{capture:!0,once:!0})},yf=()=>hf.current=!1;return document.addEventListener("keydown",gf,{capture:!0}),()=>{document.removeEventListener("keydown",gf,{capture:!0}),document.removeEventListener("pointerdown",yf,{capture:!0}),document.removeEventListener("pointermove",yf,{capture:!0})}},[]),jsx(Xl,{...uf,children:jsx(Yy,{scope:Ai,open:bo,onOpenChange:pf,content:df,onContentChange:ff,children:jsx(Gy,{scope:Ai,onClose:y$2.useCallback(()=>pf(!1),[pf]),isUsingKeyboardRef:hf,dir:mf,modal:mc,children:Ra})})})};bu.displayName=Jn$2;var qy="MenuAnchor",ai=y$2.forwardRef((vo,Ai)=>{const{__scopeMenu:bo,...Ra}=vo,hc=uo(bo);return jsx(Kl,{...hc,...Ra,ref:Ai})});ai.displayName=qy;var ii="MenuPortal",[Xy,yu]=Zt$1(ii,{forceMount:void 0}),wu=vo=>{const{__scopeMenu:Ai,forceMount:bo,children:Ra,container:hc}=vo,pc=Qt$2(ii,Ai);return jsx(Xy,{scope:Ai,forceMount:bo,children:jsx(it$1,{present:bo||pc.open,children:jsx(io$1,{asChild:!0,container:hc,children:Ra})})})};wu.displayName=ii;var et$2="MenuContent",[Ky,si]=Zt$1(et$2),xu=y$2.forwardRef((vo,Ai)=>{const bo=yu(et$2,vo.__scopeMenu),{forceMount:Ra=bo.forceMount,...hc}=vo,pc=Qt$2(et$2,vo.__scopeMenu),mc=er$1(et$2,vo.__scopeMenu);return jsx(Wn$2.Provider,{scope:vo.__scopeMenu,children:jsx(it$1,{present:Ra||pc.open,children:jsx(Wn$2.Slot,{scope:vo.__scopeMenu,children:mc.modal?jsx(Zy,{...hc,ref:Ai}):jsx(Qy,{...hc,ref:Ai})})})})}),Zy=y$2.forwardRef((vo,Ai)=>{const bo=Qt$2(et$2,vo.__scopeMenu),Ra=y$2.useRef(null),hc=Fe$2(Ai,Ra);return y$2.useEffect(()=>{const pc=Ra.current;if(pc)return su(pc)},[]),jsx(ci,{...vo,ref:hc,trapFocus:bo.open,disableOutsidePointerEvents:bo.open,disableOutsideScroll:!0,onFocusOutside:re$2(vo.onFocusOutside,pc=>pc.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>bo.onOpenChange(!1)})}),Qy=y$2.forwardRef((vo,Ai)=>{const bo=Qt$2(et$2,vo.__scopeMenu);return jsx(ci,{...vo,ref:Ai,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>bo.onOpenChange(!1)})}),ci=y$2.forwardRef((vo,Ai)=>{const{__scopeMenu:bo,loop:Ra=!1,trapFocus:hc,onOpenAutoFocus:pc,onCloseAutoFocus:mc,disableOutsidePointerEvents:uf,onEntryFocus:df,onEscapeKeyDown:ff,onPointerDownOutside:hf,onFocusOutside:pf,onInteractOutside:mf,onDismiss:gf,disableOutsideScroll:yf,...vf}=vo,bf=Qt$2(et$2,bo),Sf=er$1(et$2,bo),xf=uo(bo),wf=vu(bo),s1=zy(bo),[If,l1]=y$2.useState(null),c1=y$2.useRef(null),m1=Fe$2(Ai,c1,bf.onContentChange),k1=y$2.useRef(0),N1=y$2.useRef(""),R1=y$2.useRef(0),$1=y$2.useRef(null),D1=y$2.useRef("right"),f1=y$2.useRef(0),T1=yf?oi:y$2.Fragment,A1=yf?{as:mn$1,allowPinchZoom:!0}:void 0,L1=V1=>{var Z1,H1;const E1=N1.current+V1,F1=s1().filter(eT=>!eT.disabled),M1=document.activeElement,q1=(Z1=F1.find(eT=>eT.ref.current===M1))==null?void 0:Z1.textValue,z1=F1.map(eT=>eT.textValue),W1=u0(z1,E1,q1),J1=(H1=F1.find(eT=>eT.textValue===W1))==null?void 0:H1.ref.current;(function eT(nT){N1.current=nT,window.clearTimeout(k1.current),nT!==""&&(k1.current=window.setTimeout(()=>eT(""),1e3))})(E1),J1&&setTimeout(()=>J1.focus())};y$2.useEffect(()=>()=>window.clearTimeout(k1.current),[]),Fl();const B1=y$2.useCallback(V1=>{var Z1,H1;return D1.current===((Z1=$1.current)==null?void 0:Z1.side)&&f0(V1,(H1=$1.current)==null?void 0:H1.area)},[]);return jsx(Ky,{scope:bo,searchRef:N1,onItemEnter:y$2.useCallback(V1=>{B1(V1)&&V1.preventDefault()},[B1]),onItemLeave:y$2.useCallback(V1=>{var Z1;B1(V1)||((Z1=c1.current)==null||Z1.focus(),l1(null))},[B1]),onTriggerLeave:y$2.useCallback(V1=>{B1(V1)&&V1.preventDefault()},[B1]),pointerGraceTimerRef:R1,onPointerGraceIntentChange:y$2.useCallback(V1=>{$1.current=V1},[]),children:jsx(T1,{...A1,children:jsx(ti,{asChild:!0,trapped:hc,onMountAutoFocus:re$2(pc,V1=>{var Z1;V1.preventDefault(),(Z1=c1.current)==null||Z1.focus({preventScroll:!0})}),onUnmountAutoFocus:mc,children:jsx(oo$1,{asChild:!0,disableOutsidePointerEvents:uf,onEscapeKeyDown:ff,onPointerDownOutside:hf,onFocusOutside:pf,onInteractOutside:mf,onDismiss:gf,children:jsx(ou,{asChild:!0,...wf,dir:Sf.dir,orientation:"vertical",loop:Ra,currentTabStopId:If,onCurrentTabStopIdChange:l1,onEntryFocus:re$2(df,V1=>{Sf.isUsingKeyboardRef.current||V1.preventDefault()}),preventScrollOnEntryFocus:!0,children:jsx(Zl,{role:"menu","aria-orientation":"vertical","data-state":Vu(bf.open),"data-radix-menu-content":"",dir:Sf.dir,...xf,...vf,ref:m1,style:{outline:"none",...vf.style},onKeyDown:re$2(vf.onKeyDown,V1=>{const Z1=V1.target.closest("[data-radix-menu-content]")===V1.currentTarget,H1=V1.ctrlKey||V1.altKey||V1.metaKey,E1=V1.key.length===1;Z1&&(V1.key==="Tab"&&V1.preventDefault(),!H1&&E1&&L1(V1.key));const F1=c1.current;if(V1.target!==F1||!Hy.includes(V1.key))return;V1.preventDefault();const M1=s1().filter(q1=>!q1.disabled).map(q1=>q1.ref.current);hu.includes(V1.key)&&M1.reverse(),c0(M1)}),onBlur:re$2(vo.onBlur,V1=>{V1.currentTarget.contains(V1.target)||(window.clearTimeout(k1.current),N1.current="")}),onPointerMove:re$2(vo.onPointerMove,Bn$1(V1=>{const Z1=V1.target,H1=f1.current!==V1.clientX;if(V1.currentTarget.contains(Z1)&&H1){const E1=V1.clientX>f1.current?"right":"left";D1.current=E1,f1.current=V1.clientX}}))})})})})})})});xu.displayName=et$2;var Jy="MenuGroup",li=y$2.forwardRef((vo,Ai)=>{const{__scopeMenu:bo,...Ra}=vo;return jsx(we$1.div,{role:"group",...Ra,ref:Ai})});li.displayName=Jy;var e0="MenuLabel",Su=y$2.forwardRef((vo,Ai)=>{const{__scopeMenu:bo,...Ra}=vo;return jsx(we$1.div,{...Ra,ref:Ai})});Su.displayName=e0;var Lr$2="MenuItem",$s="menu.itemSelect",fo$1=y$2.forwardRef((vo,Ai)=>{const{disabled:bo=!1,onSelect:Ra,...hc}=vo,pc=y$2.useRef(null),mc=er$1(Lr$2,vo.__scopeMenu),uf=si(Lr$2,vo.__scopeMenu),df=Fe$2(Ai,pc),ff=y$2.useRef(!1),hf=()=>{const pf=pc.current;if(!bo&&pf){const mf=new CustomEvent($s,{bubbles:!0,cancelable:!0});pf.addEventListener($s,gf=>Ra==null?void 0:Ra(gf),{once:!0}),_c(pf,mf),mf.defaultPrevented?ff.current=!1:mc.onClose()}};return jsx(Cu,{...hc,ref:df,disabled:bo,onClick:re$2(vo.onClick,hf),onPointerDown:pf=>{var mf;(mf=vo.onPointerDown)==null||mf.call(vo,pf),ff.current=!0},onPointerUp:re$2(vo.onPointerUp,pf=>{var mf;ff.current||(mf=pf.currentTarget)==null||mf.click()}),onKeyDown:re$2(vo.onKeyDown,pf=>{const mf=uf.searchRef.current!=="";bo||mf&&pf.key===" "||Ta.includes(pf.key)&&(pf.currentTarget.click(),pf.preventDefault())})})});fo$1.displayName=Lr$2;var Cu=y$2.forwardRef((vo,Ai)=>{const{__scopeMenu:bo,disabled:Ra=!1,textValue:hc,...pc}=vo,mc=si(Lr$2,bo),uf=vu(bo),df=y$2.useRef(null),ff=Fe$2(Ai,df),[hf,pf]=y$2.useState(!1),[mf,gf]=y$2.useState("");return y$2.useEffect(()=>{const yf=df.current;yf&&gf((yf.textContent??"").trim())},[pc.children]),jsx(Wn$2.ItemSlot,{scope:bo,disabled:Ra,textValue:hc??mf,children:jsx(au,{asChild:!0,...uf,focusable:!Ra,children:jsx(we$1.div,{role:"menuitem","data-highlighted":hf?"":void 0,"aria-disabled":Ra||void 0,"data-disabled":Ra?"":void 0,...pc,ref:ff,onPointerMove:re$2(vo.onPointerMove,Bn$1(yf=>{Ra?mc.onItemLeave(yf):(mc.onItemEnter(yf),yf.defaultPrevented||yf.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:re$2(vo.onPointerLeave,Bn$1(yf=>mc.onItemLeave(yf))),onFocus:re$2(vo.onFocus,()=>pf(!0)),onBlur:re$2(vo.onBlur,()=>pf(!1))})})})}),t0="MenuCheckboxItem",Iu=y$2.forwardRef((vo,Ai)=>{const{checked:bo=!1,onCheckedChange:Ra,...hc}=vo;return jsx(Mu,{scope:vo.__scopeMenu,checked:bo,children:jsx(fo$1,{role:"menuitemcheckbox","aria-checked":$r$2(bo)?"mixed":bo,...hc,ref:Ai,"data-state":di$1(bo),onSelect:re$2(hc.onSelect,()=>Ra==null?void 0:Ra($r$2(bo)?!0:!bo),{checkForDefaultPrevented:!1})})})});Iu.displayName=t0;var Eu="MenuRadioGroup",[n0,r0]=Zt$1(Eu,{value:void 0,onValueChange:()=>{}}),Pu=y$2.forwardRef((vo,Ai)=>{const{value:bo,onValueChange:Ra,...hc}=vo,pc=at$2(Ra);return jsx(n0,{scope:vo.__scopeMenu,value:bo,onValueChange:pc,children:jsx(li,{...hc,ref:Ai})})});Pu.displayName=Eu;var Tu="MenuRadioItem",Ou=y$2.forwardRef((vo,Ai)=>{const{value:bo,...Ra}=vo,hc=r0(Tu,vo.__scopeMenu),pc=bo===hc.value;return jsx(Mu,{scope:vo.__scopeMenu,checked:pc,children:jsx(fo$1,{role:"menuitemradio","aria-checked":pc,...Ra,ref:Ai,"data-state":di$1(pc),onSelect:re$2(Ra.onSelect,()=>{var mc;return(mc=hc.onValueChange)==null?void 0:mc.call(hc,bo)},{checkForDefaultPrevented:!1})})})});Ou.displayName=Tu;var ui="MenuItemIndicator",[Mu,o0]=Zt$1(ui,{checked:!1}),Nu=y$2.forwardRef((vo,Ai)=>{const{__scopeMenu:bo,forceMount:Ra,...hc}=vo,pc=o0(ui,bo);return jsx(it$1,{present:Ra||$r$2(pc.checked)||pc.checked===!0,children:jsx(we$1.span,{...hc,ref:Ai,"data-state":di$1(pc.checked)})})});Nu.displayName=ui;var a0="MenuSeparator",Au=y$2.forwardRef((vo,Ai)=>{const{__scopeMenu:bo,...Ra}=vo;return jsx(we$1.div,{role:"separator","aria-orientation":"horizontal",...Ra,ref:Ai})});Au.displayName=a0;var i0="MenuArrow",Du=y$2.forwardRef((vo,Ai)=>{const{__scopeMenu:bo,...Ra}=vo,hc=uo(bo);return jsx(Ql,{...hc,...Ra,ref:Ai})});Du.displayName=i0;var s0="MenuSub",[g1,Ru]=Zt$1(s0),Rn$2="MenuSubTrigger",_u=y$2.forwardRef((vo,Ai)=>{const bo=Qt$2(Rn$2,vo.__scopeMenu),Ra=er$1(Rn$2,vo.__scopeMenu),hc=Ru(Rn$2,vo.__scopeMenu),pc=si(Rn$2,vo.__scopeMenu),mc=y$2.useRef(null),{pointerGraceTimerRef:uf,onPointerGraceIntentChange:df}=pc,ff={__scopeMenu:vo.__scopeMenu},hf=y$2.useCallback(()=>{mc.current&&window.clearTimeout(mc.current),mc.current=null},[]);return y$2.useEffect(()=>hf,[hf]),y$2.useEffect(()=>{const pf=uf.current;return()=>{window.clearTimeout(pf),df(null)}},[uf,df]),jsx(ai,{asChild:!0,...ff,children:jsx(Cu,{id:hc.triggerId,"aria-haspopup":"menu","aria-expanded":bo.open,"aria-controls":hc.contentId,"data-state":Vu(bo.open),...vo,ref:qr$2(Ai,hc.onTriggerChange),onClick:pf=>{var mf;(mf=vo.onClick)==null||mf.call(vo,pf),!(vo.disabled||pf.defaultPrevented)&&(pf.currentTarget.focus(),bo.open||bo.onOpenChange(!0))},onPointerMove:re$2(vo.onPointerMove,Bn$1(pf=>{pc.onItemEnter(pf),!pf.defaultPrevented&&!vo.disabled&&!bo.open&&!mc.current&&(pc.onPointerGraceIntentChange(null),mc.current=window.setTimeout(()=>{bo.onOpenChange(!0),hf()},100))})),onPointerLeave:re$2(vo.onPointerLeave,Bn$1(pf=>{var mf,gf;hf();const yf=(mf=bo.content)==null?void 0:mf.getBoundingClientRect();if(yf){const vf=(gf=bo.content)==null?void 0:gf.dataset.side,bf=vf==="right",Sf=bf?-5:5,xf=yf[bf?"left":"right"],wf=yf[bf?"right":"left"];pc.onPointerGraceIntentChange({area:[{x:pf.clientX+Sf,y:pf.clientY},{x:xf,y:yf.top},{x:wf,y:yf.top},{x:wf,y:yf.bottom},{x:xf,y:yf.bottom}],side:vf}),window.clearTimeout(uf.current),uf.current=window.setTimeout(()=>pc.onPointerGraceIntentChange(null),300)}else{if(pc.onTriggerLeave(pf),pf.defaultPrevented)return;pc.onPointerGraceIntentChange(null)}})),onKeyDown:re$2(vo.onKeyDown,pf=>{var mf;const gf=pc.searchRef.current!=="";vo.disabled||gf&&pf.key===" "||Wy[Ra.dir].includes(pf.key)&&(bo.onOpenChange(!0),(mf=bo.content)==null||mf.focus(),pf.preventDefault())})})})});_u.displayName=Rn$2;var ku="MenuSubContent",Fu=y$2.forwardRef((vo,Ai)=>{const bo=yu(et$2,vo.__scopeMenu),{forceMount:Ra=bo.forceMount,...hc}=vo,pc=Qt$2(et$2,vo.__scopeMenu),mc=er$1(et$2,vo.__scopeMenu),uf=Ru(ku,vo.__scopeMenu),df=y$2.useRef(null),ff=Fe$2(Ai,df);return jsx(Wn$2.Provider,{scope:vo.__scopeMenu,children:jsx(it$1,{present:Ra||pc.open,children:jsx(Wn$2.Slot,{scope:vo.__scopeMenu,children:jsx(ci,{id:uf.contentId,"aria-labelledby":uf.triggerId,...hc,ref:ff,align:"start",side:mc.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:hf=>{var pf;mc.isUsingKeyboardRef.current&&((pf=df.current)==null||pf.focus()),hf.preventDefault()},onCloseAutoFocus:hf=>hf.preventDefault(),onFocusOutside:re$2(vo.onFocusOutside,hf=>{hf.target!==uf.trigger&&pc.onOpenChange(!1)}),onEscapeKeyDown:re$2(vo.onEscapeKeyDown,hf=>{mc.onClose(),hf.preventDefault()}),onKeyDown:re$2(vo.onKeyDown,hf=>{var pf;const mf=hf.currentTarget.contains(hf.target),gf=By[mc.dir].includes(hf.key);mf&&gf&&(pc.onOpenChange(!1),(pf=uf.trigger)==null||pf.focus(),hf.preventDefault())})})})})})});Fu.displayName=ku;function Vu(vo){return vo?"open":"closed"}function $r$2(vo){return vo==="indeterminate"}function di$1(vo){return $r$2(vo)?"indeterminate":vo?"checked":"unchecked"}function c0(vo){const Ai=document.activeElement;for(const bo of vo)if(bo===Ai||(bo.focus(),document.activeElement!==Ai))return}function l0(vo,Ai){return vo.map((bo,Ra)=>vo[(Ai+Ra)%vo.length])}function u0(vo,Ai,bo){const Ra=Ai.length>1&&Array.from(Ai).every(uf=>uf===Ai[0])?Ai[0]:Ai,hc=bo?vo.indexOf(bo):-1;let pc=l0(vo,Math.max(hc,0));Ra.length===1&&(pc=pc.filter(uf=>uf!==bo));const mc=pc.find(uf=>uf.toLowerCase().startsWith(Ra.toLowerCase()));return mc!==bo?mc:void 0}function d0(vo,Ai){const{x:bo,y:Ra}=vo;let hc=!1;for(let pc=0,mc=Ai.length-1;pc<Ai.length;mc=pc++){const uf=Ai[pc].x,df=Ai[pc].y,ff=Ai[mc].x,hf=Ai[mc].y;df>Ra!=hf>Ra&&bo<(ff-uf)*(Ra-df)/(hf-df)+uf&&(hc=!hc)}return hc}function f0(vo,Ai){if(!Ai)return!1;const bo={x:vo.clientX,y:vo.clientY};return d0(bo,Ai)}function Bn$1(vo){return Ai=>Ai.pointerType==="mouse"?vo(Ai):void 0}var m0=bu,p0=ai,h0=wu,g0=xu,v0=li,b0=Su,y0=fo$1,w0=Iu,x0=Pu,S0=Ou,C0=Nu,I0=Au,E0=Du,P0=_u,T0=Fu,fi="DropdownMenu",[O0,v1]=Wt$2(fi,[gu]),je$2=gu(),[M0,Lu]=O0(fi),$u=vo=>{const{__scopeDropdownMenu:Ai,children:bo,dir:Ra,open:hc,defaultOpen:pc,onOpenChange:mc,modal:uf=!0}=vo,df=je$2(Ai),ff=y$2.useRef(null),[hf=!1,pf]=Qn$2({prop:hc,defaultProp:pc,onChange:mc});return jsx(M0,{scope:Ai,triggerId:Ft$2(),triggerRef:ff,contentId:Ft$2(),open:hf,onOpenChange:pf,onOpenToggle:y$2.useCallback(()=>pf(mf=>!mf),[pf]),modal:uf,children:jsx(m0,{...df,open:hf,onOpenChange:pf,dir:Ra,modal:uf,children:bo})})};$u.displayName=fi;var Uu="DropdownMenuTrigger",Hu=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,disabled:Ra=!1,...hc}=vo,pc=Lu(Uu,bo),mc=je$2(bo);return jsx(p0,{asChild:!0,...mc,children:jsx(we$1.button,{type:"button",id:pc.triggerId,"aria-haspopup":"menu","aria-expanded":pc.open,"aria-controls":pc.open?pc.contentId:void 0,"data-state":pc.open?"open":"closed","data-disabled":Ra?"":void 0,disabled:Ra,...hc,ref:qr$2(Ai,pc.triggerRef),onPointerDown:re$2(vo.onPointerDown,uf=>{!Ra&&uf.button===0&&uf.ctrlKey===!1&&(pc.onOpenToggle(),pc.open||uf.preventDefault())}),onKeyDown:re$2(vo.onKeyDown,uf=>{Ra||(["Enter"," "].includes(uf.key)&&pc.onOpenToggle(),uf.key==="ArrowDown"&&pc.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(uf.key)&&uf.preventDefault())})})})});Hu.displayName=Uu;var N0="DropdownMenuPortal",Wu=vo=>{const{__scopeDropdownMenu:Ai,...bo}=vo,Ra=je$2(Ai);return jsx(h0,{...Ra,...bo})};Wu.displayName=N0;var Bu="DropdownMenuContent",zu=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,hc=Lu(Bu,bo),pc=je$2(bo),mc=y$2.useRef(!1);return jsx(g0,{id:hc.contentId,"aria-labelledby":hc.triggerId,...pc,...Ra,ref:Ai,onCloseAutoFocus:re$2(vo.onCloseAutoFocus,uf=>{var df;mc.current||(df=hc.triggerRef.current)==null||df.focus(),mc.current=!1,uf.preventDefault()}),onInteractOutside:re$2(vo.onInteractOutside,uf=>{const df=uf.detail.originalEvent,ff=df.button===0&&df.ctrlKey===!0,hf=df.button===2||ff;(!hc.modal||hf)&&(mc.current=!0)}),style:{...vo.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});zu.displayName=Bu;var A0="DropdownMenuGroup",D0=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,hc=je$2(bo);return jsx(v0,{...hc,...Ra,ref:Ai})});D0.displayName=A0;var R0="DropdownMenuLabel",_0=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,hc=je$2(bo);return jsx(b0,{...hc,...Ra,ref:Ai})});_0.displayName=R0;var k0="DropdownMenuItem",ju=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,hc=je$2(bo);return jsx(y0,{...hc,...Ra,ref:Ai})});ju.displayName=k0;var F0="DropdownMenuCheckboxItem",V0=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,hc=je$2(bo);return jsx(w0,{...hc,...Ra,ref:Ai})});V0.displayName=F0;var L0="DropdownMenuRadioGroup",$0=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,hc=je$2(bo);return jsx(x0,{...hc,...Ra,ref:Ai})});$0.displayName=L0;var U0="DropdownMenuRadioItem",H0=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,hc=je$2(bo);return jsx(S0,{...hc,...Ra,ref:Ai})});H0.displayName=U0;var W0="DropdownMenuItemIndicator",B0=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,hc=je$2(bo);return jsx(C0,{...hc,...Ra,ref:Ai})});B0.displayName=W0;var z0="DropdownMenuSeparator",j0=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,hc=je$2(bo);return jsx(I0,{...hc,...Ra,ref:Ai})});j0.displayName=z0;var Y0="DropdownMenuArrow",G0=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,hc=je$2(bo);return jsx(E0,{...hc,...Ra,ref:Ai})});G0.displayName=Y0;var q0="DropdownMenuSubTrigger",X0=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,hc=je$2(bo);return jsx(P0,{...hc,...Ra,ref:Ai})});X0.displayName=q0;var K0="DropdownMenuSubContent",Z0=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,hc=je$2(bo);return jsx(T0,{...hc,...Ra,ref:Ai,style:{...vo.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Z0.displayName=K0;var Q0=$u,J0=Hu,ew=Wu,tw=zu,nw=ju;const rw=Q0,ow=J0,aw=forwardRef(function({children:vo,...Ai},bo){return jsx(ew,{children:jsx(tw,{...Ai,ref:bo,children:vo})})}),iw=nw;function sw(vo){const{onSwitchboardLinkClick:Ai,onExport:bo,onClose:Ra,onShowRevisionHistory:hc}=vo;return jsxs("div",{className:"flex gap-x-2",children:[Ai?jsx("button",{className:"flex h-8 items-center gap-x-2 rounded border border-gray-200 px-3 text-sm font-semibold text-gray-900 active:opacity-50",onClick:Ai,children:jsx(_e$1,{name:"Drive",size:16})}):null,jsxs("button",{className:"flex h-8 items-center gap-x-2 rounded border border-gray-200 px-3 text-sm font-semibold text-gray-900 active:opacity-50",onClick:bo,children:["Export ",jsx(_e$1,{name:"Save",size:16})]}),jsxs("button",{className:"flex h-8 items-center gap-x-2 whitespace-nowrap rounded border border-gray-200 px-3 text-sm font-semibold text-gray-900 active:opacity-50",onClick:hc,children:["Revision history ",jsx(_e$1,{name:"History",size:16})]}),jsx("button",{className:"grid size-8 place-items-center rounded border border-gray-200 active:opacity-50",onClick:Ra,children:jsx(_e$1,{name:"Xmark"})})]})}var mi="Dialog",[Yu,b1]=Wt$2(mi),[cw,st$2]=Yu(mi),Gu=vo=>{const{__scopeDialog:Ai,children:bo,open:Ra,defaultOpen:hc,onOpenChange:pc,modal:mc=!0}=vo,uf=y$2.useRef(null),df=y$2.useRef(null),[ff=!1,hf]=Qn$2({prop:Ra,defaultProp:hc,onChange:pc});return jsx(cw,{scope:Ai,triggerRef:uf,contentRef:df,contentId:Ft$2(),titleId:Ft$2(),descriptionId:Ft$2(),open:ff,onOpenChange:hf,onOpenToggle:y$2.useCallback(()=>hf(pf=>!pf),[hf]),modal:mc,children:bo})};Gu.displayName=mi;var qu="DialogTrigger",lw=y$2.forwardRef((vo,Ai)=>{const{__scopeDialog:bo,...Ra}=vo,hc=st$2(qu,bo),pc=Fe$2(Ai,hc.triggerRef);return jsx(we$1.button,{type:"button","aria-haspopup":"dialog","aria-expanded":hc.open,"aria-controls":hc.contentId,"data-state":gi(hc.open),...Ra,ref:pc,onClick:re$2(vo.onClick,hc.onOpenToggle)})});lw.displayName=qu;var pi$1="DialogPortal",[uw,Xu]=Yu(pi$1,{forceMount:void 0}),Ku=vo=>{const{__scopeDialog:Ai,forceMount:bo,children:Ra,container:hc}=vo,pc=st$2(pi$1,Ai);return jsx(uw,{scope:Ai,forceMount:bo,children:y$2.Children.map(Ra,mc=>jsx(it$1,{present:bo||pc.open,children:jsx(io$1,{asChild:!0,container:hc,children:mc})}))})};Ku.displayName=pi$1;var Ur$2="DialogOverlay",Zu=y$2.forwardRef((vo,Ai)=>{const bo=Xu(Ur$2,vo.__scopeDialog),{forceMount:Ra=bo.forceMount,...hc}=vo,pc=st$2(Ur$2,vo.__scopeDialog);return pc.modal?jsx(it$1,{present:Ra||pc.open,children:jsx(dw,{...hc,ref:Ai})}):null});Zu.displayName=Ur$2;var dw=y$2.forwardRef((vo,Ai)=>{const{__scopeDialog:bo,...Ra}=vo,hc=st$2(Ur$2,bo);return jsx(oi,{as:mn$1,allowPinchZoom:!0,shards:[hc.contentRef],children:jsx(we$1.div,{"data-state":gi(hc.open),...Ra,ref:Ai,style:{pointerEvents:"auto",...Ra.style}})})}),Kt="DialogContent",Qu=y$2.forwardRef((vo,Ai)=>{const bo=Xu(Kt,vo.__scopeDialog),{forceMount:Ra=bo.forceMount,...hc}=vo,pc=st$2(Kt,vo.__scopeDialog);return jsx(it$1,{present:Ra||pc.open,children:pc.modal?jsx(fw,{...hc,ref:Ai}):jsx(mw,{...hc,ref:Ai})})});Qu.displayName=Kt;var fw=y$2.forwardRef((vo,Ai)=>{const bo=st$2(Kt,vo.__scopeDialog),Ra=y$2.useRef(null),hc=Fe$2(Ai,bo.contentRef,Ra);return y$2.useEffect(()=>{const pc=Ra.current;if(pc)return su(pc)},[]),jsx(Ju,{...vo,ref:hc,trapFocus:bo.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:re$2(vo.onCloseAutoFocus,pc=>{var mc;pc.preventDefault(),(mc=bo.triggerRef.current)==null||mc.focus()}),onPointerDownOutside:re$2(vo.onPointerDownOutside,pc=>{const mc=pc.detail.originalEvent,uf=mc.button===0&&mc.ctrlKey===!0;(mc.button===2||uf)&&pc.preventDefault()}),onFocusOutside:re$2(vo.onFocusOutside,pc=>pc.preventDefault())})}),mw=y$2.forwardRef((vo,Ai)=>{const bo=st$2(Kt,vo.__scopeDialog),Ra=y$2.useRef(!1),hc=y$2.useRef(!1);return jsx(Ju,{...vo,ref:Ai,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:pc=>{var mc,uf;(mc=vo.onCloseAutoFocus)==null||mc.call(vo,pc),pc.defaultPrevented||(Ra.current||(uf=bo.triggerRef.current)==null||uf.focus(),pc.preventDefault()),Ra.current=!1,hc.current=!1},onInteractOutside:pc=>{var mc,uf;(mc=vo.onInteractOutside)==null||mc.call(vo,pc),pc.defaultPrevented||(Ra.current=!0,pc.detail.originalEvent.type==="pointerdown"&&(hc.current=!0));const df=pc.target;(uf=bo.triggerRef.current)!=null&&uf.contains(df)&&pc.preventDefault(),pc.detail.originalEvent.type==="focusin"&&hc.current&&pc.preventDefault()}})}),Ju=y$2.forwardRef((vo,Ai)=>{const{__scopeDialog:bo,trapFocus:Ra,onOpenAutoFocus:hc,onCloseAutoFocus:pc,...mc}=vo,uf=st$2(Kt,bo),df=y$2.useRef(null),ff=Fe$2(Ai,df);return Fl(),jsxs(Fragment,{children:[jsx(ti,{asChild:!0,loop:!0,trapped:Ra,onMountAutoFocus:hc,onUnmountAutoFocus:pc,children:jsx(oo$1,{role:"dialog",id:uf.contentId,"aria-describedby":uf.descriptionId,"aria-labelledby":uf.titleId,"data-state":gi(uf.open),...mc,ref:ff,onDismiss:()=>uf.onOpenChange(!1)})}),jsxs(Fragment,{children:[jsx(hw,{titleId:uf.titleId}),jsx(vw,{contentRef:df,descriptionId:uf.descriptionId})]})]})}),hi="DialogTitle",ed=y$2.forwardRef((vo,Ai)=>{const{__scopeDialog:bo,...Ra}=vo,hc=st$2(hi,bo);return jsx(we$1.h2,{id:hc.titleId,...Ra,ref:Ai})});ed.displayName=hi;var td="DialogDescription",nd=y$2.forwardRef((vo,Ai)=>{const{__scopeDialog:bo,...Ra}=vo,hc=st$2(td,bo);return jsx(we$1.p,{id:hc.descriptionId,...Ra,ref:Ai})});nd.displayName=td;var rd="DialogClose",pw=y$2.forwardRef((vo,Ai)=>{const{__scopeDialog:bo,...Ra}=vo,hc=st$2(rd,bo);return jsx(we$1.button,{type:"button",...Ra,ref:Ai,onClick:re$2(vo.onClick,()=>hc.onOpenChange(!1))})});pw.displayName=rd;function gi(vo){return vo?"open":"closed"}var od="DialogTitleWarning",[y1,ad]=nb(od,{contentName:Kt,titleName:hi,docsSlug:"dialog"}),hw=({titleId:vo})=>{const Ai=ad(od),bo=`\`${Ai.contentName}\` requires a \`${Ai.titleName}\` for the component to be accessible for screen reader users.
|
|
55
|
-
|
|
56
|
-
If you want to hide the \`${Ai.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
57
|
-
|
|
58
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${Ai.docsSlug}`;return y$2.useEffect(()=>{vo&&(document.getElementById(vo)||console.error(bo))},[bo,vo]),null},gw="DialogDescriptionWarning",vw=({contentRef:vo,descriptionId:Ai})=>{const bo=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ad(gw).contentName}}.`;return y$2.useEffect(()=>{var Ra;const hc=(Ra=vo.current)==null?void 0:Ra.getAttribute("aria-describedby");Ai&&hc&&(document.getElementById(Ai)||console.warn(bo))},[bo,vo,Ai]),null},bw=Gu,yw=Ku,ww=Zu,xw=Qu,Sw=ed,Cw=nd,Iw="VisuallyHidden",id=y$2.forwardRef((vo,Ai)=>jsx(we$1.span,{...vo,ref:Ai,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...vo.style}}));id.displayName=Iw;var sd=id;function cd(vo){const{title:Ai,open:bo,onOpenChange:Ra,contentProps:hc,overlayProps:pc,children:mc,...uf}=vo;return jsx(bw,{defaultOpen:bo,onOpenChange:Ra,open:bo,children:jsx(yw,{children:jsx(ww,{...pc,className:Ne$1("fixed inset-0 grid place-items-center overflow-y-auto bg-slate-900/50 data-[state=closed]:animate-fade-out data-[state=open]:animate-fade-in",pc==null?void 0:pc.className),children:jsxs(xw,{...uf,...hc,className:Ne$1("bg-white data-[state=closed]:animate-zoom-out data-[state=open]:animate-zoom-in",hc==null?void 0:hc.className),children:[jsxs(sd,{children:[jsx(Sw,{children:Ai||"Modal"}),jsx(Cw,{children:Ai||"Modal"})]}),mc]})})})})}function ld(vo,Ai){const{itemsPerPage:bo=20,initialPage:Ra=0,pageRange:hc=3}={},[pc,mc]=useState(Ra),uf=Math.ceil(vo.length/bo),df=pc<uf-1,ff=pc>0,hf=useCallback(()=>{df&&mc(l1=>l1+1)},[df,mc]),pf=useCallback(()=>{ff&&mc(l1=>l1-1)},[ff,mc]),mf=useCallback(()=>{mc(uf-1)},[uf]),gf=useCallback(()=>{mc(0)},[]),yf=useCallback(l1=>{l1>=0&&l1<uf&&mc(l1)},[uf]),vf=Math.floor((hc-1)/2),bf=Math.min(hc,uf),Sf=Math.max(uf-bf),xf=Math.min(Sf,Math.max(pc-vf,0)),wf=useMemo(()=>{const l1=[];for(let c1=xf;c1<bf+xf;c1++)l1.push({index:c1,active:c1===pc,number:c1+1});return l1},[bf,xf,pc]),s1=vo.slice(pc*bo,(pc+1)*bo),If=wf.length>0&&wf.slice(-1)[0].index<uf-1;return{pages:wf,goToPage:yf,pageItems:s1,pageCount:uf,currentPage:pc,goToLastPage:mf,goToFirstPage:gf,goToNextPage:hf,hiddenNextPages:If,goToPreviousPage:pf,isNextPageAvailable:df,isPreviousPageAvailable:ff}}var[mo$1,w1]=Wt$2("Tooltip",[ao$1]),po$1=ao$1(),ud="TooltipProvider",Ew=700,Oa="tooltip.open",[Pw,vi]=mo$1(ud),dd=vo=>{const{__scopeTooltip:Ai,delayDuration:bo=Ew,skipDelayDuration:Ra=300,disableHoverableContent:hc=!1,children:pc}=vo,[mc,uf]=y$2.useState(!0),df=y$2.useRef(!1),ff=y$2.useRef(0);return y$2.useEffect(()=>{const hf=ff.current;return()=>window.clearTimeout(hf)},[]),jsx(Pw,{scope:Ai,isOpenDelayed:mc,delayDuration:bo,onOpen:y$2.useCallback(()=>{window.clearTimeout(ff.current),uf(!1)},[]),onClose:y$2.useCallback(()=>{window.clearTimeout(ff.current),ff.current=window.setTimeout(()=>uf(!0),Ra)},[Ra]),isPointerInTransitRef:df,onPointerInTransitChange:y$2.useCallback(hf=>{df.current=hf},[]),disableHoverableContent:hc,children:pc})};dd.displayName=ud;var ho="Tooltip",[Tw,tr$2]=mo$1(ho),fd=vo=>{const{__scopeTooltip:Ai,children:bo,open:Ra,defaultOpen:hc=!1,onOpenChange:pc,disableHoverableContent:mc,delayDuration:uf}=vo,df=vi(ho,vo.__scopeTooltip),ff=po$1(Ai),[hf,pf]=y$2.useState(null),mf=Ft$2(),gf=y$2.useRef(0),yf=mc??df.disableHoverableContent,vf=uf??df.delayDuration,bf=y$2.useRef(!1),[Sf=!1,xf]=Qn$2({prop:Ra,defaultProp:hc,onChange:c1=>{c1?(df.onOpen(),document.dispatchEvent(new CustomEvent(Oa))):df.onClose(),pc==null||pc(c1)}}),wf=y$2.useMemo(()=>Sf?bf.current?"delayed-open":"instant-open":"closed",[Sf]),s1=y$2.useCallback(()=>{window.clearTimeout(gf.current),gf.current=0,bf.current=!1,xf(!0)},[xf]),If=y$2.useCallback(()=>{window.clearTimeout(gf.current),gf.current=0,xf(!1)},[xf]),l1=y$2.useCallback(()=>{window.clearTimeout(gf.current),gf.current=window.setTimeout(()=>{bf.current=!0,xf(!0),gf.current=0},vf)},[vf,xf]);return y$2.useEffect(()=>()=>{gf.current&&(window.clearTimeout(gf.current),gf.current=0)},[]),jsx(Xl,{...ff,children:jsx(Tw,{scope:Ai,contentId:mf,open:Sf,stateAttribute:wf,trigger:hf,onTriggerChange:pf,onTriggerEnter:y$2.useCallback(()=>{df.isOpenDelayed?l1():s1()},[df.isOpenDelayed,l1,s1]),onTriggerLeave:y$2.useCallback(()=>{yf?If():(window.clearTimeout(gf.current),gf.current=0)},[If,yf]),onOpen:s1,onClose:If,disableHoverableContent:yf,children:bo})})};fd.displayName=ho;var Ma="TooltipTrigger",md=y$2.forwardRef((vo,Ai)=>{const{__scopeTooltip:bo,...Ra}=vo,hc=tr$2(Ma,bo),pc=vi(Ma,bo),mc=po$1(bo),uf=y$2.useRef(null),df=Fe$2(Ai,uf,hc.onTriggerChange),ff=y$2.useRef(!1),hf=y$2.useRef(!1),pf=y$2.useCallback(()=>ff.current=!1,[]);return y$2.useEffect(()=>()=>document.removeEventListener("pointerup",pf),[pf]),jsx(Kl,{asChild:!0,...mc,children:jsx(we$1.button,{"aria-describedby":hc.open?hc.contentId:void 0,"data-state":hc.stateAttribute,...Ra,ref:df,onPointerMove:re$2(vo.onPointerMove,mf=>{mf.pointerType!=="touch"&&!hf.current&&!pc.isPointerInTransitRef.current&&(hc.onTriggerEnter(),hf.current=!0)}),onPointerLeave:re$2(vo.onPointerLeave,()=>{hc.onTriggerLeave(),hf.current=!1}),onPointerDown:re$2(vo.onPointerDown,()=>{ff.current=!0,document.addEventListener("pointerup",pf,{once:!0})}),onFocus:re$2(vo.onFocus,()=>{ff.current||hc.onOpen()}),onBlur:re$2(vo.onBlur,hc.onClose),onClick:re$2(vo.onClick,hc.onClose)})})});md.displayName=Ma;var bi="TooltipPortal",[Ow,Mw]=mo$1(bi,{forceMount:void 0}),pd=vo=>{const{__scopeTooltip:Ai,forceMount:bo,children:Ra,container:hc}=vo,pc=tr$2(bi,Ai);return jsx(Ow,{scope:Ai,forceMount:bo,children:jsx(it$1,{present:bo||pc.open,children:jsx(io$1,{asChild:!0,container:hc,children:Ra})})})};pd.displayName=bi;var gn$1="TooltipContent",hd=y$2.forwardRef((vo,Ai)=>{const bo=Mw(gn$1,vo.__scopeTooltip),{forceMount:Ra=bo.forceMount,side:hc="top",...pc}=vo,mc=tr$2(gn$1,vo.__scopeTooltip);return jsx(it$1,{present:Ra||mc.open,children:mc.disableHoverableContent?jsx(gd,{side:hc,...pc,ref:Ai}):jsx(Nw,{side:hc,...pc,ref:Ai})})}),Nw=y$2.forwardRef((vo,Ai)=>{const bo=tr$2(gn$1,vo.__scopeTooltip),Ra=vi(gn$1,vo.__scopeTooltip),hc=y$2.useRef(null),pc=Fe$2(Ai,hc),[mc,uf]=y$2.useState(null),{trigger:df,onClose:ff}=bo,hf=hc.current,{onPointerInTransitChange:pf}=Ra,mf=y$2.useCallback(()=>{uf(null),pf(!1)},[pf]),gf=y$2.useCallback((yf,vf)=>{const bf=yf.currentTarget,Sf={x:yf.clientX,y:yf.clientY},xf=_w(Sf,bf.getBoundingClientRect()),wf=kw(Sf,xf),s1=Fw(vf.getBoundingClientRect()),If=Lw([...wf,...s1]);uf(If),pf(!0)},[pf]);return y$2.useEffect(()=>()=>mf(),[mf]),y$2.useEffect(()=>{if(df&&hf){const yf=bf=>gf(bf,hf),vf=bf=>gf(bf,df);return df.addEventListener("pointerleave",yf),hf.addEventListener("pointerleave",vf),()=>{df.removeEventListener("pointerleave",yf),hf.removeEventListener("pointerleave",vf)}}},[df,hf,gf,mf]),y$2.useEffect(()=>{if(mc){const yf=vf=>{const bf=vf.target,Sf={x:vf.clientX,y:vf.clientY},xf=(df==null?void 0:df.contains(bf))||(hf==null?void 0:hf.contains(bf)),wf=!Vw(Sf,mc);xf?mf():wf&&(mf(),ff())};return document.addEventListener("pointermove",yf),()=>document.removeEventListener("pointermove",yf)}},[df,hf,mc,ff,mf]),jsx(gd,{...vo,ref:pc})}),[Aw,Dw]=mo$1(ho,{isInside:!1}),gd=y$2.forwardRef((vo,Ai)=>{const{__scopeTooltip:bo,children:Ra,"aria-label":hc,onEscapeKeyDown:pc,onPointerDownOutside:mc,...uf}=vo,df=tr$2(gn$1,bo),ff=po$1(bo),{onClose:hf}=df;return y$2.useEffect(()=>(document.addEventListener(Oa,hf),()=>document.removeEventListener(Oa,hf)),[hf]),y$2.useEffect(()=>{if(df.trigger){const pf=mf=>{const gf=mf.target;gf!=null&&gf.contains(df.trigger)&&hf()};return window.addEventListener("scroll",pf,{capture:!0}),()=>window.removeEventListener("scroll",pf,{capture:!0})}},[df.trigger,hf]),jsx(oo$1,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:pc,onPointerDownOutside:mc,onFocusOutside:pf=>pf.preventDefault(),onDismiss:hf,children:jsxs(Zl,{"data-state":df.stateAttribute,...ff,...uf,ref:Ai,style:{...uf.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[jsx(Rc,{children:Ra}),jsx(Aw,{scope:bo,isInside:!0,children:jsx(sd,{id:df.contentId,role:"tooltip",children:hc||Ra})})]})})});hd.displayName=gn$1;var vd="TooltipArrow",Rw=y$2.forwardRef((vo,Ai)=>{const{__scopeTooltip:bo,...Ra}=vo,hc=po$1(bo);return Dw(vd,bo).isInside?null:jsx(Ql,{...hc,...Ra,ref:Ai})});Rw.displayName=vd;function _w(vo,Ai){const bo=Math.abs(Ai.top-vo.y),Ra=Math.abs(Ai.bottom-vo.y),hc=Math.abs(Ai.right-vo.x),pc=Math.abs(Ai.left-vo.x);switch(Math.min(bo,Ra,hc,pc)){case pc:return"left";case hc:return"right";case bo:return"top";case Ra:return"bottom";default:throw new Error("unreachable")}}function kw(vo,Ai,bo=5){const Ra=[];switch(Ai){case"top":Ra.push({x:vo.x-bo,y:vo.y+bo},{x:vo.x+bo,y:vo.y+bo});break;case"bottom":Ra.push({x:vo.x-bo,y:vo.y-bo},{x:vo.x+bo,y:vo.y-bo});break;case"left":Ra.push({x:vo.x+bo,y:vo.y-bo},{x:vo.x+bo,y:vo.y+bo});break;case"right":Ra.push({x:vo.x-bo,y:vo.y-bo},{x:vo.x-bo,y:vo.y+bo});break}return Ra}function Fw(vo){const{top:Ai,right:bo,bottom:Ra,left:hc}=vo;return[{x:hc,y:Ai},{x:bo,y:Ai},{x:bo,y:Ra},{x:hc,y:Ra}]}function Vw(vo,Ai){const{x:bo,y:Ra}=vo;let hc=!1;for(let pc=0,mc=Ai.length-1;pc<Ai.length;mc=pc++){const uf=Ai[pc].x,df=Ai[pc].y,ff=Ai[mc].x,hf=Ai[mc].y;df>Ra!=hf>Ra&&bo<(ff-uf)*(Ra-df)/(hf-df)+uf&&(hc=!hc)}return hc}function Lw(vo){const Ai=vo.slice();return Ai.sort((bo,Ra)=>bo.x<Ra.x?-1:bo.x>Ra.x?1:bo.y<Ra.y?-1:bo.y>Ra.y?1:0),$w(Ai)}function $w(vo){if(vo.length<=1)return vo.slice();const Ai=[];for(let Ra=0;Ra<vo.length;Ra++){const hc=vo[Ra];for(;Ai.length>=2;){const pc=Ai[Ai.length-1],mc=Ai[Ai.length-2];if((pc.x-mc.x)*(hc.y-mc.y)>=(pc.y-mc.y)*(hc.x-mc.x))Ai.pop();else break}Ai.push(hc)}Ai.pop();const bo=[];for(let Ra=vo.length-1;Ra>=0;Ra--){const hc=vo[Ra];for(;bo.length>=2;){const pc=bo[bo.length-1],mc=bo[bo.length-2];if((pc.x-mc.x)*(hc.y-mc.y)>=(pc.y-mc.y)*(hc.x-mc.x))bo.pop();else break}bo.push(hc)}return bo.pop(),Ai.length===1&&bo.length===1&&Ai[0].x===bo[0].x&&Ai[0].y===bo[0].y?Ai:Ai.concat(bo)}var Uw=dd,Hw=fd,Ww=md,Bw=pd,zw=hd;function jw(vo){const{children:Ai,content:bo,open:Ra,defaultOpen:hc,onOpenChange:pc,className:mc,...uf}=vo;return jsxs(Hw,{defaultOpen:hc,delayDuration:0,onOpenChange:pc,open:Ra,children:[jsx(Ww,{asChild:!0,children:Ai}),jsx(Bw,{children:jsx(zw,{...uf,className:Ne$1("rounded-lg border border-gray-200 bg-white p-2 text-xs shadow-tooltip",mc),children:bo})})]})}const Yw=Uw,bd=6048e5,Gw=864e5,Us=Symbol.for("constructDateFrom");function Ut$2(vo,Ai){return typeof vo=="function"?vo(Ai):vo&&typeof vo=="object"&&Us in vo?vo[Us](Ai):vo instanceof Date?new vo.constructor(Ai):new Date(Ai)}function ct$1(vo,Ai){return Ut$2(Ai||vo,vo)}let qw={};function nr$1(){return qw}function zn$1(vo,Ai){var bo,Ra,hc,pc;const mc=nr$1(),uf=(Ai==null?void 0:Ai.weekStartsOn)??((Ra=(bo=Ai==null?void 0:Ai.locale)==null?void 0:bo.options)==null?void 0:Ra.weekStartsOn)??mc.weekStartsOn??((pc=(hc=mc.locale)==null?void 0:hc.options)==null?void 0:pc.weekStartsOn)??0,df=ct$1(vo,Ai==null?void 0:Ai.in),ff=df.getDay(),hf=(ff<uf?7:0)+ff-uf;return df.setDate(df.getDate()-hf),df.setHours(0,0,0,0),df}function Hr$2(vo,Ai){return zn$1(vo,{...Ai,weekStartsOn:1})}function yd(vo,Ai){const bo=ct$1(vo,void 0),Ra=bo.getFullYear(),hc=Ut$2(bo,0);hc.setFullYear(Ra+1,0,4),hc.setHours(0,0,0,0);const pc=Hr$2(hc),mc=Ut$2(bo,0);mc.setFullYear(Ra,0,4),mc.setHours(0,0,0,0);const uf=Hr$2(mc);return bo.getTime()>=pc.getTime()?Ra+1:bo.getTime()>=uf.getTime()?Ra:Ra-1}function Hs(vo){const Ai=ct$1(vo),bo=new Date(Date.UTC(Ai.getFullYear(),Ai.getMonth(),Ai.getDate(),Ai.getHours(),Ai.getMinutes(),Ai.getSeconds(),Ai.getMilliseconds()));return bo.setUTCFullYear(Ai.getFullYear()),+vo-+bo}function Xw(vo,...Ai){const bo=Ut$2.bind(null,Ai.find(Ra=>typeof Ra=="object"));return Ai.map(bo)}function Ws(vo,Ai){const bo=ct$1(vo,void 0);return bo.setHours(0,0,0,0),bo}function Kw(vo,Ai,bo){const[Ra,hc]=Xw(void 0,vo,Ai),pc=Ws(Ra),mc=Ws(hc),uf=+pc-Hs(pc),df=+mc-Hs(mc);return Math.round((uf-df)/Gw)}function Zw(vo,Ai){const bo=yd(vo),Ra=Ut$2(vo,0);return Ra.setFullYear(bo,0,4),Ra.setHours(0,0,0,0),Hr$2(Ra)}function Qw(vo){return vo instanceof Date||typeof vo=="object"&&Object.prototype.toString.call(vo)==="[object Date]"}function Jw(vo){return!(!Qw(vo)&&typeof vo!="number"||isNaN(+ct$1(vo)))}function ex(vo,Ai){const bo=ct$1(vo,void 0);return bo.setFullYear(bo.getFullYear(),0,1),bo.setHours(0,0,0,0),bo}const tx={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},nx=(vo,Ai,bo)=>{let Ra;const hc=tx[vo];return typeof hc=="string"?Ra=hc:Ai===1?Ra=hc.one:Ra=hc.other.replace("{{count}}",Ai.toString()),bo!=null&&bo.addSuffix?bo.comparison&&bo.comparison>0?"in "+Ra:Ra+" ago":Ra};function Zo(vo){return(Ai={})=>{const bo=Ai.width?String(Ai.width):vo.defaultWidth;return vo.formats[bo]||vo.formats[vo.defaultWidth]}}const rx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ox={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ax={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ix={date:Zo({formats:rx,defaultWidth:"full"}),time:Zo({formats:ox,defaultWidth:"full"}),dateTime:Zo({formats:ax,defaultWidth:"full"})},sx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},cx$1=(vo,Ai,bo,Ra)=>sx[vo];function Mn$2(vo){return(Ai,bo)=>{const Ra=bo!=null&&bo.context?String(bo.context):"standalone";let hc;if(Ra==="formatting"&&vo.formattingValues){const mc=vo.defaultFormattingWidth||vo.defaultWidth,uf=bo!=null&&bo.width?String(bo.width):mc;hc=vo.formattingValues[uf]||vo.formattingValues[mc]}else{const mc=vo.defaultWidth,uf=bo!=null&&bo.width?String(bo.width):vo.defaultWidth;hc=vo.values[uf]||vo.values[mc]}const pc=vo.argumentCallback?vo.argumentCallback(Ai):Ai;return hc[pc]}}const lx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ux={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},dx={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},fx={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},mx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},px={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},hx=(vo,Ai)=>{const bo=Number(vo),Ra=bo%100;if(Ra>20||Ra<10)switch(Ra%10){case 1:return bo+"st";case 2:return bo+"nd";case 3:return bo+"rd"}return bo+"th"},gx={ordinalNumber:hx,era:Mn$2({values:lx,defaultWidth:"wide"}),quarter:Mn$2({values:ux,defaultWidth:"wide",argumentCallback:vo=>vo-1}),month:Mn$2({values:dx,defaultWidth:"wide"}),day:Mn$2({values:fx,defaultWidth:"wide"}),dayPeriod:Mn$2({values:mx,defaultWidth:"wide",formattingValues:px,defaultFormattingWidth:"wide"})};function Nn$2(vo){return(Ai,bo={})=>{const Ra=bo.width,hc=Ra&&vo.matchPatterns[Ra]||vo.matchPatterns[vo.defaultMatchWidth],pc=Ai.match(hc);if(!pc)return null;const mc=pc[0],uf=Ra&&vo.parsePatterns[Ra]||vo.parsePatterns[vo.defaultParseWidth],df=Array.isArray(uf)?bx(uf,pf=>pf.test(mc)):vx(uf,pf=>pf.test(mc));let ff;ff=vo.valueCallback?vo.valueCallback(df):df,ff=bo.valueCallback?bo.valueCallback(ff):ff;const hf=Ai.slice(mc.length);return{value:ff,rest:hf}}}function vx(vo,Ai){for(const bo in vo)if(Object.prototype.hasOwnProperty.call(vo,bo)&&Ai(vo[bo]))return bo}function bx(vo,Ai){for(let bo=0;bo<vo.length;bo++)if(Ai(vo[bo]))return bo}function yx(vo){return(Ai,bo={})=>{const Ra=Ai.match(vo.matchPattern);if(!Ra)return null;const hc=Ra[0],pc=Ai.match(vo.parsePattern);if(!pc)return null;let mc=vo.valueCallback?vo.valueCallback(pc[0]):pc[0];mc=bo.valueCallback?bo.valueCallback(mc):mc;const uf=Ai.slice(hc.length);return{value:mc,rest:uf}}}const wx=/^(\d+)(th|st|nd|rd)?/i,xx=/\d+/i,Sx={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Cx={any:[/^b/i,/^(a|c)/i]},Ix={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ex={any:[/1/i,/2/i,/3/i,/4/i]},Px={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Tx={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ox={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Mx={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Nx={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ax={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Dx={ordinalNumber:yx({matchPattern:wx,parsePattern:xx,valueCallback:vo=>parseInt(vo,10)}),era:Nn$2({matchPatterns:Sx,defaultMatchWidth:"wide",parsePatterns:Cx,defaultParseWidth:"any"}),quarter:Nn$2({matchPatterns:Ix,defaultMatchWidth:"wide",parsePatterns:Ex,defaultParseWidth:"any",valueCallback:vo=>vo+1}),month:Nn$2({matchPatterns:Px,defaultMatchWidth:"wide",parsePatterns:Tx,defaultParseWidth:"any"}),day:Nn$2({matchPatterns:Ox,defaultMatchWidth:"wide",parsePatterns:Mx,defaultParseWidth:"any"}),dayPeriod:Nn$2({matchPatterns:Nx,defaultMatchWidth:"any",parsePatterns:Ax,defaultParseWidth:"any"})},Rx={code:"en-US",formatDistance:nx,formatLong:ix,formatRelative:cx$1,localize:gx,match:Dx,options:{weekStartsOn:0,firstWeekContainsDate:1}};function _x(vo,Ai){const bo=ct$1(vo,void 0);return Kw(bo,ex(bo))+1}function kx(vo,Ai){const bo=ct$1(vo,void 0),Ra=+Hr$2(bo)-+Zw(bo);return Math.round(Ra/bd)+1}function wd(vo,Ai){var bo,Ra,hc,pc;const mc=ct$1(vo,Ai==null?void 0:Ai.in),uf=mc.getFullYear(),df=nr$1(),ff=(Ai==null?void 0:Ai.firstWeekContainsDate)??((Ra=(bo=Ai==null?void 0:Ai.locale)==null?void 0:bo.options)==null?void 0:Ra.firstWeekContainsDate)??df.firstWeekContainsDate??((pc=(hc=df.locale)==null?void 0:hc.options)==null?void 0:pc.firstWeekContainsDate)??1,hf=Ut$2((Ai==null?void 0:Ai.in)||vo,0);hf.setFullYear(uf+1,0,ff),hf.setHours(0,0,0,0);const pf=zn$1(hf,Ai),mf=Ut$2((Ai==null?void 0:Ai.in)||vo,0);mf.setFullYear(uf,0,ff),mf.setHours(0,0,0,0);const gf=zn$1(mf,Ai);return+mc>=+pf?uf+1:+mc>=+gf?uf:uf-1}function Fx(vo,Ai){var bo,Ra,hc,pc;const mc=nr$1(),uf=(Ai==null?void 0:Ai.firstWeekContainsDate)??((Ra=(bo=Ai==null?void 0:Ai.locale)==null?void 0:bo.options)==null?void 0:Ra.firstWeekContainsDate)??mc.firstWeekContainsDate??((pc=(hc=mc.locale)==null?void 0:hc.options)==null?void 0:pc.firstWeekContainsDate)??1,df=wd(vo,Ai),ff=Ut$2((Ai==null?void 0:Ai.in)||vo,0);return ff.setFullYear(df,0,uf),ff.setHours(0,0,0,0),zn$1(ff,Ai)}function Vx(vo,Ai){const bo=ct$1(vo,Ai==null?void 0:Ai.in),Ra=+zn$1(bo,Ai)-+Fx(bo,Ai);return Math.round(Ra/bd)+1}function ve$2(vo,Ai){const bo=vo<0?"-":"",Ra=Math.abs(vo).toString().padStart(Ai,"0");return bo+Ra}const Nt$2={y(vo,Ai){const bo=vo.getFullYear(),Ra=bo>0?bo:1-bo;return ve$2(Ai==="yy"?Ra%100:Ra,Ai.length)},M(vo,Ai){const bo=vo.getMonth();return Ai==="M"?String(bo+1):ve$2(bo+1,2)},d(vo,Ai){return ve$2(vo.getDate(),Ai.length)},a(vo,Ai){const bo=vo.getHours()/12>=1?"pm":"am";switch(Ai){case"a":case"aa":return bo.toUpperCase();case"aaa":return bo;case"aaaaa":return bo[0];case"aaaa":default:return bo==="am"?"a.m.":"p.m."}},h(vo,Ai){return ve$2(vo.getHours()%12||12,Ai.length)},H(vo,Ai){return ve$2(vo.getHours(),Ai.length)},m(vo,Ai){return ve$2(vo.getMinutes(),Ai.length)},s(vo,Ai){return ve$2(vo.getSeconds(),Ai.length)},S(vo,Ai){const bo=Ai.length,Ra=vo.getMilliseconds(),hc=Math.trunc(Ra*Math.pow(10,bo-3));return ve$2(hc,Ai.length)}},on$1={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Bs={G:function(vo,Ai,bo){const Ra=vo.getFullYear()>0?1:0;switch(Ai){case"G":case"GG":case"GGG":return bo.era(Ra,{width:"abbreviated"});case"GGGGG":return bo.era(Ra,{width:"narrow"});case"GGGG":default:return bo.era(Ra,{width:"wide"})}},y:function(vo,Ai,bo){if(Ai==="yo"){const Ra=vo.getFullYear(),hc=Ra>0?Ra:1-Ra;return bo.ordinalNumber(hc,{unit:"year"})}return Nt$2.y(vo,Ai)},Y:function(vo,Ai,bo,Ra){const hc=wd(vo,Ra),pc=hc>0?hc:1-hc;if(Ai==="YY"){const mc=pc%100;return ve$2(mc,2)}return Ai==="Yo"?bo.ordinalNumber(pc,{unit:"year"}):ve$2(pc,Ai.length)},R:function(vo,Ai){const bo=yd(vo);return ve$2(bo,Ai.length)},u:function(vo,Ai){const bo=vo.getFullYear();return ve$2(bo,Ai.length)},Q:function(vo,Ai,bo){const Ra=Math.ceil((vo.getMonth()+1)/3);switch(Ai){case"Q":return String(Ra);case"QQ":return ve$2(Ra,2);case"Qo":return bo.ordinalNumber(Ra,{unit:"quarter"});case"QQQ":return bo.quarter(Ra,{width:"abbreviated",context:"formatting"});case"QQQQQ":return bo.quarter(Ra,{width:"narrow",context:"formatting"});case"QQQQ":default:return bo.quarter(Ra,{width:"wide",context:"formatting"})}},q:function(vo,Ai,bo){const Ra=Math.ceil((vo.getMonth()+1)/3);switch(Ai){case"q":return String(Ra);case"qq":return ve$2(Ra,2);case"qo":return bo.ordinalNumber(Ra,{unit:"quarter"});case"qqq":return bo.quarter(Ra,{width:"abbreviated",context:"standalone"});case"qqqqq":return bo.quarter(Ra,{width:"narrow",context:"standalone"});case"qqqq":default:return bo.quarter(Ra,{width:"wide",context:"standalone"})}},M:function(vo,Ai,bo){const Ra=vo.getMonth();switch(Ai){case"M":case"MM":return Nt$2.M(vo,Ai);case"Mo":return bo.ordinalNumber(Ra+1,{unit:"month"});case"MMM":return bo.month(Ra,{width:"abbreviated",context:"formatting"});case"MMMMM":return bo.month(Ra,{width:"narrow",context:"formatting"});case"MMMM":default:return bo.month(Ra,{width:"wide",context:"formatting"})}},L:function(vo,Ai,bo){const Ra=vo.getMonth();switch(Ai){case"L":return String(Ra+1);case"LL":return ve$2(Ra+1,2);case"Lo":return bo.ordinalNumber(Ra+1,{unit:"month"});case"LLL":return bo.month(Ra,{width:"abbreviated",context:"standalone"});case"LLLLL":return bo.month(Ra,{width:"narrow",context:"standalone"});case"LLLL":default:return bo.month(Ra,{width:"wide",context:"standalone"})}},w:function(vo,Ai,bo,Ra){const hc=Vx(vo,Ra);return Ai==="wo"?bo.ordinalNumber(hc,{unit:"week"}):ve$2(hc,Ai.length)},I:function(vo,Ai,bo){const Ra=kx(vo);return Ai==="Io"?bo.ordinalNumber(Ra,{unit:"week"}):ve$2(Ra,Ai.length)},d:function(vo,Ai,bo){return Ai==="do"?bo.ordinalNumber(vo.getDate(),{unit:"date"}):Nt$2.d(vo,Ai)},D:function(vo,Ai,bo){const Ra=_x(vo);return Ai==="Do"?bo.ordinalNumber(Ra,{unit:"dayOfYear"}):ve$2(Ra,Ai.length)},E:function(vo,Ai,bo){const Ra=vo.getDay();switch(Ai){case"E":case"EE":case"EEE":return bo.day(Ra,{width:"abbreviated",context:"formatting"});case"EEEEE":return bo.day(Ra,{width:"narrow",context:"formatting"});case"EEEEEE":return bo.day(Ra,{width:"short",context:"formatting"});case"EEEE":default:return bo.day(Ra,{width:"wide",context:"formatting"})}},e:function(vo,Ai,bo,Ra){const hc=vo.getDay(),pc=(hc-Ra.weekStartsOn+8)%7||7;switch(Ai){case"e":return String(pc);case"ee":return ve$2(pc,2);case"eo":return bo.ordinalNumber(pc,{unit:"day"});case"eee":return bo.day(hc,{width:"abbreviated",context:"formatting"});case"eeeee":return bo.day(hc,{width:"narrow",context:"formatting"});case"eeeeee":return bo.day(hc,{width:"short",context:"formatting"});case"eeee":default:return bo.day(hc,{width:"wide",context:"formatting"})}},c:function(vo,Ai,bo,Ra){const hc=vo.getDay(),pc=(hc-Ra.weekStartsOn+8)%7||7;switch(Ai){case"c":return String(pc);case"cc":return ve$2(pc,Ai.length);case"co":return bo.ordinalNumber(pc,{unit:"day"});case"ccc":return bo.day(hc,{width:"abbreviated",context:"standalone"});case"ccccc":return bo.day(hc,{width:"narrow",context:"standalone"});case"cccccc":return bo.day(hc,{width:"short",context:"standalone"});case"cccc":default:return bo.day(hc,{width:"wide",context:"standalone"})}},i:function(vo,Ai,bo){const Ra=vo.getDay(),hc=Ra===0?7:Ra;switch(Ai){case"i":return String(hc);case"ii":return ve$2(hc,Ai.length);case"io":return bo.ordinalNumber(hc,{unit:"day"});case"iii":return bo.day(Ra,{width:"abbreviated",context:"formatting"});case"iiiii":return bo.day(Ra,{width:"narrow",context:"formatting"});case"iiiiii":return bo.day(Ra,{width:"short",context:"formatting"});case"iiii":default:return bo.day(Ra,{width:"wide",context:"formatting"})}},a:function(vo,Ai,bo){const Ra=vo.getHours()/12>=1?"pm":"am";switch(Ai){case"a":case"aa":return bo.dayPeriod(Ra,{width:"abbreviated",context:"formatting"});case"aaa":return bo.dayPeriod(Ra,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return bo.dayPeriod(Ra,{width:"narrow",context:"formatting"});case"aaaa":default:return bo.dayPeriod(Ra,{width:"wide",context:"formatting"})}},b:function(vo,Ai,bo){const Ra=vo.getHours();let hc;switch(Ra===12?hc=on$1.noon:Ra===0?hc=on$1.midnight:hc=Ra/12>=1?"pm":"am",Ai){case"b":case"bb":return bo.dayPeriod(hc,{width:"abbreviated",context:"formatting"});case"bbb":return bo.dayPeriod(hc,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return bo.dayPeriod(hc,{width:"narrow",context:"formatting"});case"bbbb":default:return bo.dayPeriod(hc,{width:"wide",context:"formatting"})}},B:function(vo,Ai,bo){const Ra=vo.getHours();let hc;switch(Ra>=17?hc=on$1.evening:Ra>=12?hc=on$1.afternoon:Ra>=4?hc=on$1.morning:hc=on$1.night,Ai){case"B":case"BB":case"BBB":return bo.dayPeriod(hc,{width:"abbreviated",context:"formatting"});case"BBBBB":return bo.dayPeriod(hc,{width:"narrow",context:"formatting"});case"BBBB":default:return bo.dayPeriod(hc,{width:"wide",context:"formatting"})}},h:function(vo,Ai,bo){if(Ai==="ho"){let Ra=vo.getHours()%12;return Ra===0&&(Ra=12),bo.ordinalNumber(Ra,{unit:"hour"})}return Nt$2.h(vo,Ai)},H:function(vo,Ai,bo){return Ai==="Ho"?bo.ordinalNumber(vo.getHours(),{unit:"hour"}):Nt$2.H(vo,Ai)},K:function(vo,Ai,bo){const Ra=vo.getHours()%12;return Ai==="Ko"?bo.ordinalNumber(Ra,{unit:"hour"}):ve$2(Ra,Ai.length)},k:function(vo,Ai,bo){let Ra=vo.getHours();return Ra===0&&(Ra=24),Ai==="ko"?bo.ordinalNumber(Ra,{unit:"hour"}):ve$2(Ra,Ai.length)},m:function(vo,Ai,bo){return Ai==="mo"?bo.ordinalNumber(vo.getMinutes(),{unit:"minute"}):Nt$2.m(vo,Ai)},s:function(vo,Ai,bo){return Ai==="so"?bo.ordinalNumber(vo.getSeconds(),{unit:"second"}):Nt$2.s(vo,Ai)},S:function(vo,Ai){return Nt$2.S(vo,Ai)},X:function(vo,Ai,bo){const Ra=vo.getTimezoneOffset();if(Ra===0)return"Z";switch(Ai){case"X":return js$1(Ra);case"XXXX":case"XX":return zt$2(Ra);case"XXXXX":case"XXX":default:return zt$2(Ra,":")}},x:function(vo,Ai,bo){const Ra=vo.getTimezoneOffset();switch(Ai){case"x":return js$1(Ra);case"xxxx":case"xx":return zt$2(Ra);case"xxxxx":case"xxx":default:return zt$2(Ra,":")}},O:function(vo,Ai,bo){const Ra=vo.getTimezoneOffset();switch(Ai){case"O":case"OO":case"OOO":return"GMT"+zs(Ra,":");case"OOOO":default:return"GMT"+zt$2(Ra,":")}},z:function(vo,Ai,bo){const Ra=vo.getTimezoneOffset();switch(Ai){case"z":case"zz":case"zzz":return"GMT"+zs(Ra,":");case"zzzz":default:return"GMT"+zt$2(Ra,":")}},t:function(vo,Ai,bo){const Ra=Math.trunc(+vo/1e3);return ve$2(Ra,Ai.length)},T:function(vo,Ai,bo){return ve$2(+vo,Ai.length)}};function zs(vo,Ai=""){const bo=vo>0?"-":"+",Ra=Math.abs(vo),hc=Math.trunc(Ra/60),pc=Ra%60;return pc===0?bo+String(hc):bo+String(hc)+Ai+ve$2(pc,2)}function js$1(vo,Ai){return vo%60===0?(vo>0?"-":"+")+ve$2(Math.abs(vo)/60,2):zt$2(vo,Ai)}function zt$2(vo,Ai=""){const bo=vo>0?"-":"+",Ra=Math.abs(vo),hc=ve$2(Math.trunc(Ra/60),2),pc=ve$2(Ra%60,2);return bo+hc+Ai+pc}const Ys=(vo,Ai)=>{switch(vo){case"P":return Ai.date({width:"short"});case"PP":return Ai.date({width:"medium"});case"PPP":return Ai.date({width:"long"});case"PPPP":default:return Ai.date({width:"full"})}},xd=(vo,Ai)=>{switch(vo){case"p":return Ai.time({width:"short"});case"pp":return Ai.time({width:"medium"});case"ppp":return Ai.time({width:"long"});case"pppp":default:return Ai.time({width:"full"})}},Lx=(vo,Ai)=>{const bo=vo.match(/(P+)(p+)?/)||[],Ra=bo[1],hc=bo[2];if(!hc)return Ys(vo,Ai);let pc;switch(Ra){case"P":pc=Ai.dateTime({width:"short"});break;case"PP":pc=Ai.dateTime({width:"medium"});break;case"PPP":pc=Ai.dateTime({width:"long"});break;case"PPPP":default:pc=Ai.dateTime({width:"full"});break}return pc.replace("{{date}}",Ys(Ra,Ai)).replace("{{time}}",xd(hc,Ai))},$x={p:xd,P:Lx},Ux=/^D+$/,Hx=/^Y+$/,Wx=["D","DD","YY","YYYY"];function Bx(vo){return Ux.test(vo)}function zx(vo){return Hx.test(vo)}function jx(vo,Ai,bo){const Ra=Yx(vo,Ai,bo);if(console.warn(Ra),Wx.includes(vo))throw new RangeError(Ra)}function Yx(vo,Ai,bo){const Ra=vo[0]==="Y"?"years":"days of the month";return`Use \`${vo.toLowerCase()}\` instead of \`${vo}\` (in \`${Ai}\`) for formatting ${Ra} to the input \`${bo}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Gx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,qx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Xx=/^'([^]*?)'?$/,Kx=/''/g,Zx=/[a-zA-Z]/;function Qx(vo,Ai,bo){var Ra,hc,pc,mc,uf,df,ff,hf;const pf=nr$1(),mf=(bo==null?void 0:bo.locale)??pf.locale??Rx,gf=(bo==null?void 0:bo.firstWeekContainsDate)??((hc=(Ra=bo==null?void 0:bo.locale)==null?void 0:Ra.options)==null?void 0:hc.firstWeekContainsDate)??pf.firstWeekContainsDate??((mc=(pc=pf.locale)==null?void 0:pc.options)==null?void 0:mc.firstWeekContainsDate)??1,yf=(bo==null?void 0:bo.weekStartsOn)??((df=(uf=bo==null?void 0:bo.locale)==null?void 0:uf.options)==null?void 0:df.weekStartsOn)??pf.weekStartsOn??((hf=(ff=pf.locale)==null?void 0:ff.options)==null?void 0:hf.weekStartsOn)??0,vf=ct$1(vo,bo==null?void 0:bo.in);if(!Jw(vf))throw new RangeError("Invalid time value");let bf=Ai.match(qx).map(xf=>{const wf=xf[0];if(wf==="p"||wf==="P"){const s1=$x[wf];return s1(xf,mf.formatLong)}return xf}).join("").match(Gx).map(xf=>{if(xf==="''")return{isToken:!1,value:"'"};const wf=xf[0];if(wf==="'")return{isToken:!1,value:Jx(xf)};if(Bs[wf])return{isToken:!0,value:xf};if(wf.match(Zx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+wf+"`");return{isToken:!1,value:xf}});mf.localize.preprocessor&&(bf=mf.localize.preprocessor(vf,bf));const Sf={firstWeekContainsDate:gf,weekStartsOn:yf,locale:mf};return bf.map(xf=>{if(!xf.isToken)return xf.value;const wf=xf.value;(!(bo!=null&&bo.useAdditionalWeekYearTokens)&&zx(wf)||!(bo!=null&&bo.useAdditionalDayOfYearTokens)&&Bx(wf))&&jx(wf,Ai,String(vo));const s1=Bs[wf[0]];return s1(vf,wf,mf.localize,Sf)}).join("")}function Jx(vo){const Ai=vo.match(Xx);return Ai?Ai[1].replace(Kx,"'"):vo}function eS(){return Object.assign({},nr$1())}const An$2=({active:vo=!1,...Ai})=>{const bo=Ne$1("h-8 min-w-8 border border-solid border-gray-300 bg-white px-3 py-1 text-xs text-gray-900 hover:bg-gray-100",!vo&&"border-0");return jsx(Dl,{color:"light",size:"small",...Al(Ai,bo),children:Ai.children})},Sd=vo=>{const{pages:Ai=[],goToFirstPage:bo,goToLastPage:Ra,goToNextPage:hc,goToPreviousPage:pc,goToPage:mc,isNextPageAvailable:uf,isPreviousPageAvailable:df,hiddenNextPages:ff,firstPageLabel:hf="First",lastPageLabel:pf="Last",nextPageLabel:mf="Next",previousPageLabel:gf="Previous"}=vo;return jsxs("div",{className:"flex gap-x-1",children:[hf?jsx(An$2,{disabled:!df,onClick:()=>bo(),children:hf}):null,gf?jsxs(An$2,{disabled:!df,onClick:()=>pc(),children:[jsx(_e$1,{className:"rotate-90",name:"ChevronDown",size:16}),gf]}):null,Ai.map(yf=>jsx(An$2,{active:yf.active,onClick:()=>mc(yf.index),children:yf.number},yf.index)),ff?jsx("span",{className:"flex items-center justify-center px-2",children:"..."}):null,mf?jsxs(An$2,{disabled:!uf,onClick:()=>hc(),children:[mf,jsx(_e$1,{className:"-rotate-90",name:"ChevronDown",size:16})]}):null,pf?jsx(An$2,{disabled:!uf,onClick:()=>Ra(),children:pf}):null]})},hr$2=vo=>jsx(Dl,{color:"light",size:"small",...Al(vo,"border border-solid border-gray-300 bg-white px-3 py-1 text-sm text-gray-900"),children:vo.children});function Gs(vo,Ai,bo){const Ra=eS(),hc=rS(vo,bo.timeZone,bo.locale??Ra.locale);return"formatToParts"in hc?tS(hc,Ai):nS(hc,Ai)}function tS(vo,Ai){const bo=vo.formatToParts(Ai);for(let Ra=bo.length-1;Ra>=0;--Ra)if(bo[Ra].type==="timeZoneName")return bo[Ra].value}function nS(vo,Ai){const bo=vo.format(Ai).replace(/\u200E/g,""),Ra=/ [\w-+ ]+$/.exec(bo);return Ra?Ra[0].substr(1):""}function rS(vo,Ai,bo){return new Intl.DateTimeFormat(bo?[bo.code,"en-US"]:void 0,{timeZone:Ai,timeZoneName:vo})}function oS(vo,Ai){const bo=lS(Ai);return"formatToParts"in bo?iS(bo,vo):sS(bo,vo)}const aS={year:0,month:1,day:2,hour:3,minute:4,second:5};function iS(vo,Ai){try{const bo=vo.formatToParts(Ai),Ra=[];for(let hc=0;hc<bo.length;hc++){const pc=aS[bo[hc].type];pc!==void 0&&(Ra[pc]=parseInt(bo[hc].value,10))}return Ra}catch(bo){if(bo instanceof RangeError)return[NaN];throw bo}}function sS(vo,Ai){const bo=vo.format(Ai),Ra=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(bo);return[parseInt(Ra[3],10),parseInt(Ra[1],10),parseInt(Ra[2],10),parseInt(Ra[4],10),parseInt(Ra[5],10),parseInt(Ra[6],10)]}const Qo={},qs$1=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),cS=qs$1==="06/25/2014, 00:00:00"||qs$1==="06/25/2014 00:00:00";function lS(vo){return Qo[vo]||(Qo[vo]=cS?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:vo,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:vo,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Qo[vo]}function Cd(vo,Ai,bo,Ra,hc,pc,mc){const uf=new Date(0);return uf.setUTCFullYear(vo,Ai,bo),uf.setUTCHours(Ra,hc,pc,mc),uf}const Xs=36e5,uS=6e4,Jo={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function yi(vo,Ai,bo){if(!vo)return 0;let Ra=Jo.timezoneZ.exec(vo);if(Ra)return 0;let hc,pc;if(Ra=Jo.timezoneHH.exec(vo),Ra)return hc=parseInt(Ra[1],10),Ks(hc)?-(hc*Xs):NaN;if(Ra=Jo.timezoneHHMM.exec(vo),Ra){hc=parseInt(Ra[2],10);const mc=parseInt(Ra[3],10);return Ks(hc,mc)?(pc=Math.abs(hc)*Xs+mc*uS,Ra[1]==="+"?-pc:pc):NaN}if(mS(vo)){Ai=new Date(Ai||Date.now());const mc=bo?Ai:dS(Ai),uf=Na(mc,vo);return-(bo?uf:fS(Ai,uf,vo))}return NaN}function dS(vo){return Cd(vo.getFullYear(),vo.getMonth(),vo.getDate(),vo.getHours(),vo.getMinutes(),vo.getSeconds(),vo.getMilliseconds())}function Na(vo,Ai){const bo=oS(vo,Ai),Ra=Cd(bo[0],bo[1]-1,bo[2],bo[3]%24,bo[4],bo[5],0).getTime();let hc=vo.getTime();const pc=hc%1e3;return hc-=pc>=0?pc:1e3+pc,Ra-hc}function fS(vo,Ai,bo){let Ra=vo.getTime()-Ai;const hc=Na(new Date(Ra),bo);if(Ai===hc)return Ai;Ra-=hc-Ai;const pc=Na(new Date(Ra),bo);return hc===pc?hc:Math.max(hc,pc)}function Ks(vo,Ai){return-23<=vo&&vo<=23&&(Ai==null||0<=Ai&&Ai<=59)}const Zs={};function mS(vo){if(Zs[vo])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:vo}),Zs[vo]=!0,!0}catch{return!1}}const pS=60*1e3,hS={X:function(vo,Ai,bo){const Ra=ea(bo.timeZone,vo);if(Ra===0)return"Z";switch(Ai){case"X":return Qs(Ra);case"XXXX":case"XX":return an$1(Ra);case"XXXXX":case"XXX":default:return an$1(Ra,":")}},x:function(vo,Ai,bo){const Ra=ea(bo.timeZone,vo);switch(Ai){case"x":return Qs(Ra);case"xxxx":case"xx":return an$1(Ra);case"xxxxx":case"xxx":default:return an$1(Ra,":")}},O:function(vo,Ai,bo){const Ra=ea(bo.timeZone,vo);switch(Ai){case"O":case"OO":case"OOO":return"GMT"+gS(Ra,":");case"OOOO":default:return"GMT"+an$1(Ra,":")}},z:function(vo,Ai,bo){switch(Ai){case"z":case"zz":case"zzz":return Gs("short",vo,bo);case"zzzz":default:return Gs("long",vo,bo)}}};function ea(vo,Ai){const bo=vo?yi(vo,Ai,!0)/pS:(Ai==null?void 0:Ai.getTimezoneOffset())??0;if(Number.isNaN(bo))throw new RangeError("Invalid time zone specified: "+vo);return bo}function Wr$2(vo,Ai){const bo=vo<0?"-":"";let Ra=Math.abs(vo).toString();for(;Ra.length<Ai;)Ra="0"+Ra;return bo+Ra}function an$1(vo,Ai=""){const bo=vo>0?"-":"+",Ra=Math.abs(vo),hc=Wr$2(Math.floor(Ra/60),2),pc=Wr$2(Math.floor(Ra%60),2);return bo+hc+Ai+pc}function Qs(vo,Ai){return vo%60===0?(vo>0?"-":"+")+Wr$2(Math.abs(vo)/60,2):an$1(vo,Ai)}function gS(vo,Ai=""){const bo=vo>0?"-":"+",Ra=Math.abs(vo),hc=Math.floor(Ra/60),pc=Ra%60;return pc===0?bo+String(hc):bo+String(hc)+Ai+Wr$2(pc,2)}function Js(vo){const Ai=new Date(Date.UTC(vo.getFullYear(),vo.getMonth(),vo.getDate(),vo.getHours(),vo.getMinutes(),vo.getSeconds(),vo.getMilliseconds()));return Ai.setUTCFullYear(vo.getFullYear()),+vo-+Ai}const vS=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,ta=36e5,ec=6e4,bS=2,ze$2={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:vS};function Id(vo,Ai={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(vo===null)return new Date(NaN);const bo=Ai.additionalDigits==null?bS:Number(Ai.additionalDigits);if(bo!==2&&bo!==1&&bo!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(vo instanceof Date||typeof vo=="object"&&Object.prototype.toString.call(vo)==="[object Date]")return new Date(vo.getTime());if(typeof vo=="number"||Object.prototype.toString.call(vo)==="[object Number]")return new Date(vo);if(Object.prototype.toString.call(vo)!=="[object String]")return new Date(NaN);const Ra=yS(vo),{year:hc,restDateString:pc}=wS(Ra.date,bo),mc=xS(pc,hc);if(mc===null||isNaN(mc.getTime()))return new Date(NaN);if(mc){const uf=mc.getTime();let df=0,ff;if(Ra.time&&(df=SS(Ra.time),df===null||isNaN(df)))return new Date(NaN);if(Ra.timeZone||Ai.timeZone){if(ff=yi(Ra.timeZone||Ai.timeZone,new Date(uf+df)),isNaN(ff))return new Date(NaN)}else ff=Js(new Date(uf+df)),ff=Js(new Date(uf+df+ff));return new Date(uf+df+ff)}else return new Date(NaN)}function yS(vo){const Ai={};let bo=ze$2.dateTimePattern.exec(vo),Ra;if(bo?(Ai.date=bo[1],Ra=bo[3]):(bo=ze$2.datePattern.exec(vo),bo?(Ai.date=bo[1],Ra=bo[2]):(Ai.date=null,Ra=vo)),Ra){const hc=ze$2.timeZone.exec(Ra);hc?(Ai.time=Ra.replace(hc[1],""),Ai.timeZone=hc[1].trim()):Ai.time=Ra}return Ai}function wS(vo,Ai){if(vo){const bo=ze$2.YYY[Ai],Ra=ze$2.YYYYY[Ai];let hc=ze$2.YYYY.exec(vo)||Ra.exec(vo);if(hc){const pc=hc[1];return{year:parseInt(pc,10),restDateString:vo.slice(pc.length)}}if(hc=ze$2.YY.exec(vo)||bo.exec(vo),hc){const pc=hc[1];return{year:parseInt(pc,10)*100,restDateString:vo.slice(pc.length)}}}return{year:null}}function xS(vo,Ai){if(Ai===null)return null;let bo,Ra,hc;if(!vo||!vo.length)return bo=new Date(0),bo.setUTCFullYear(Ai),bo;let pc=ze$2.MM.exec(vo);if(pc)return bo=new Date(0),Ra=parseInt(pc[1],10)-1,nc(Ai,Ra)?(bo.setUTCFullYear(Ai,Ra),bo):new Date(NaN);if(pc=ze$2.DDD.exec(vo),pc){bo=new Date(0);const mc=parseInt(pc[1],10);return ES(Ai,mc)?(bo.setUTCFullYear(Ai,0,mc),bo):new Date(NaN)}if(pc=ze$2.MMDD.exec(vo),pc){bo=new Date(0),Ra=parseInt(pc[1],10)-1;const mc=parseInt(pc[2],10);return nc(Ai,Ra,mc)?(bo.setUTCFullYear(Ai,Ra,mc),bo):new Date(NaN)}if(pc=ze$2.Www.exec(vo),pc)return hc=parseInt(pc[1],10)-1,rc(hc)?tc(Ai,hc):new Date(NaN);if(pc=ze$2.WwwD.exec(vo),pc){hc=parseInt(pc[1],10)-1;const mc=parseInt(pc[2],10)-1;return rc(hc,mc)?tc(Ai,hc,mc):new Date(NaN)}return null}function SS(vo){let Ai,bo,Ra=ze$2.HH.exec(vo);if(Ra)return Ai=parseFloat(Ra[1].replace(",",".")),na(Ai)?Ai%24*ta:NaN;if(Ra=ze$2.HHMM.exec(vo),Ra)return Ai=parseInt(Ra[1],10),bo=parseFloat(Ra[2].replace(",",".")),na(Ai,bo)?Ai%24*ta+bo*ec:NaN;if(Ra=ze$2.HHMMSS.exec(vo),Ra){Ai=parseInt(Ra[1],10),bo=parseInt(Ra[2],10);const hc=parseFloat(Ra[3].replace(",","."));return na(Ai,bo,hc)?Ai%24*ta+bo*ec+hc*1e3:NaN}return null}function tc(vo,Ai,bo){Ai=Ai||0,bo=bo||0;const Ra=new Date(0);Ra.setUTCFullYear(vo,0,4);const hc=Ra.getUTCDay()||7,pc=Ai*7+bo+1-hc;return Ra.setUTCDate(Ra.getUTCDate()+pc),Ra}const CS=[31,28,31,30,31,30,31,31,30,31,30,31],IS=[31,29,31,30,31,30,31,31,30,31,30,31];function Ed(vo){return vo%400===0||vo%4===0&&vo%100!==0}function nc(vo,Ai,bo){if(Ai<0||Ai>11)return!1;if(bo!=null){if(bo<1)return!1;const Ra=Ed(vo);if(Ra&&bo>IS[Ai]||!Ra&&bo>CS[Ai])return!1}return!0}function ES(vo,Ai){if(Ai<1)return!1;const bo=Ed(vo);return!(bo&&Ai>366||!bo&&Ai>365)}function rc(vo,Ai){return!(vo<0||vo>52||Ai!=null&&(Ai<0||Ai>6))}function na(vo,Ai,bo){return!(vo<0||vo>=25||Ai!=null&&(Ai<0||Ai>=60)||bo!=null&&(bo<0||bo>=60))}const PS=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function TS(vo,Ai,bo={}){Ai=String(Ai);const Ra=Ai.match(PS);if(Ra){const hc=Id(bo.originalDate||vo,bo);Ai=Ra.reduce(function(pc,mc){if(mc[0]==="'")return pc;const uf=pc.indexOf(mc),df=pc[uf-1]==="'",ff=pc.replace(mc,"'"+hS[mc[0]](hc,mc,bo)+"'");return df?ff.substring(0,uf-1)+ff.substring(uf+1):ff},Ai)}return Qx(vo,Ai,bo)}function OS(vo,Ai,bo){vo=Id(vo,bo);const Ra=yi(Ai,vo,!0),hc=new Date(vo.getTime()-Ra),pc=new Date(0);return pc.setFullYear(hc.getUTCFullYear(),hc.getUTCMonth(),hc.getUTCDate()),pc.setHours(hc.getUTCHours(),hc.getUTCMinutes(),hc.getUTCSeconds(),hc.getUTCMilliseconds()),pc}function Pd(vo,Ai,bo,Ra){return Ra={...Ra,timeZone:Ai,originalDate:vo},TS(OS(vo,Ai,{timeZone:Ra.timeZone}),bo,Ra)}function wi(vo,Ai=!0,bo=!1){const Ra=Ai?"yyyy/MM/dd, HH:mm:ss zzz":"yyyy/MM/dd",hc=bo?"UTC":Td();return Pd(vo,hc,Ra)}function MS(vo){if(!/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(vo))return!1;const Ai=new Date(vo);return Ai instanceof Date&&!isNaN(Ai.getTime())&&Ai.toISOString()===vo}function Td(){return Intl.DateTimeFormat().resolvedOptions().timeZone}function ra(vo,Ai=!1){const bo=Ai?"yyyy-MM-dd'T'HH:mm:ss":"yyyy-MM-dd",Ra=Td();return Pd(vo,Ra,bo)}const NS="SERVICE_PROVIDER_FEE_TYPE",AS="FIXED_INCOME_TYPE",DS="ACCOUNT",RS="TRANSACTION",_S="ASSET",kS="SPV",Ce$2={SERVICE_PROVIDER_FEE_TYPE:NS,FIXED_INCOME_TYPE:AS,ACCOUNT:DS,TRANSACTION:RS,ASSET:_S,SPV:kS},jn$2={SERVICE_PROVIDER_FEE_TYPE:"Service Provider Fee Type",FIXED_INCOME_TYPE:"Fixed Income Asset Type",ACCOUNT:"Account",TRANSACTION:"Transaction",ASSET:"Asset",SPV:"SPV"},Od="AssetPurchase",Md="AssetSale",FS="PrincipalDraw",VS="PrincipalReturn",LS="InterestIncome",$S="InterestPayment",Nd="FeesIncome",US="FeesPayment",HS=[FS,VS],xi=[Od,Md],Si=[Nd,US],WS=[LS,$S],Ci=[...HS,...xi,...Si,...WS],Ii$1={AssetPurchase:"Asset purchase",AssetSale:"Asset sale",PrincipalDraw:"Principal draw",PrincipalReturn:"Principal return",InterestIncome:"Interest income",InterestPayment:"Interest payment",FeesIncome:"Fees income",FeesPayment:"Fees payment"};function BS(vo){const{tableName:Ai,tableItem:bo,fixedIncomeTypes:Ra,spvs:hc,accounts:pc}=vo;return useMemo(()=>{var mc,uf,df,ff,hf;if(!bo)switch(Ai){case Ce$2.ASSET:return{fixedIncomeTypeId:((mc=Ra[0])==null?void 0:mc.id)??null,spvId:((uf=hc[0])==null?void 0:uf.id)??null,name:null,maturity:null,ISIN:null,CUSIP:null,coupon:null};case Ce$2.TRANSACTION:return{type:Ci[0],entryTime:ra(new Date().toISOString(),!0),cashAmount:null,fixedIncomeId:null,fixedIncomeAmount:null,serviceProviderFeeTypeId:null,fees:null,txRef:null};case Ce$2.SPV:return{name:null};case Ce$2.SERVICE_PROVIDER_FEE_TYPE:return{name:null,feeType:null,accountId:((df=pc[0])==null?void 0:df.id)??null};case Ce$2.FIXED_INCOME_TYPE:return{name:null};case Ce$2.ACCOUNT:return{label:null,reference:null}}switch(Ai){case Ce$2.ASSET:{const pf=bo;return{id:pf.id,fixedIncomeTypeId:pf.fixedIncomeTypeId,spvId:pf.spvId,name:pf.name,maturity:pf.maturity?ra(pf.maturity):null,ISIN:pf.ISIN,CUSIP:pf.CUSIP,coupon:pf.coupon}}case Ce$2.TRANSACTION:{const pf=bo;return{id:pf.id,type:pf.type,entryTime:pf.entryTime?ra(pf.entryTime,!0):null,cashAmount:pf.cashTransaction.amount??null,fixedIncomeId:((ff=pf.fixedIncomeTransaction)==null?void 0:ff.assetId)??null,fixedIncomeAmount:((hf=pf.fixedIncomeTransaction)==null?void 0:hf.amount)??null,serviceProviderFeeTypeId:pf.serviceProviderFeeTypeId??null,fees:pf.fees??null,txRef:pf.txRef??null}}case Ce$2.SPV:{const pf=bo;return{id:pf.id,name:pf.name}}case Ce$2.SERVICE_PROVIDER_FEE_TYPE:{const pf=bo;return{id:pf.id,name:pf.name,feeType:pf.feeType,accountId:pf.accountId}}case Ce$2.FIXED_INCOME_TYPE:{const pf=bo;return{id:pf.id,name:pf.name}}case Ce$2.ACCOUNT:{const pf=bo;return{id:pf.id,label:pf.label,reference:pf.reference}}}},[pc,Ra,hc,bo,Ai])}function zS(vo){return xi.includes(vo)}function jS(vo){return vo?vo.type==="FixedIncome"||"fixedIncomeId"in vo:!1}function YS(vo){return vo?vo.type==="Cash"||"currency"in vo:!1}function Ei(vo){return vo.filter(Ai=>jS(Ai))}function GS(vo){const Ai=vo.find(bo=>YS(bo));if(!Ai)throw new Error("Cash asset not found");return Ai}const qS={1520:10,1394:9,1239:8,1112:7,984:6},Ad={AssetSale:1,PrincipalDraw:1,AssetPurchase:-1,PrincipalReturn:-1,FeesIncome:1,FeesPayment:-1,InterestIncome:1,InterestPayment:-1},XS={AssetSale:-1,AssetPurchase:1};function KS(vo){return{ASSET:"portfolio",TRANSACTION:"transactions",ACCOUNT:"accounts",FIXED_INCOME_TYPE:"fixedIncomeTypes",SERVICE_PROVIDER_FEE_TYPE:"serviceProviderFeeTypes",SPV:"spvs"}[vo]}function ZS(vo){return vo.type.split("_").slice(1).join("_")}function QS(vo){return vo.type.split("_")[0]}function gr$2(vo,Ai){return vo.reduce((bo,Ra)=>bo+Number(Ra[Ai]),0)}const Dt$2=py$1(JR,{number:"BigNumber"});function JS(vo){const{asset:Ai,transactions:bo,fixedIncomeTypes:Ra,currentDate:hc=new Date}=vo;if(!(Ai!=null&&Ai.maturity))return null;const pc=Ra.find(({id:bf})=>bf===Ai.fixedIncomeTypeId);if(!pc||pc.name!=="Treasury Bill")return null;const mc=bo.filter(({type:bf,fixedIncomeTransaction:Sf})=>bf===Od&&(Sf==null?void 0:Sf.assetId)===Ai.id),uf=bo.filter(({type:bf,fixedIncomeTransaction:Sf})=>bf===Md&&(Sf==null?void 0:Sf.assetId)===Ai.id);if(!mc.length&&!uf.length)return null;const df=Dt$2.bignumber(hc.getTime()),ff=Dt$2.bignumber(new Date(Ai.maturity).getTime());if(ff.lessThan(df))return null;const hf=Dt$2.bignumber(new Date(Ai.purchaseDate).getTime()),pf=oc(mc).sub(oc(uf)),mf=Dt$2.bignumber(Ai.salesProceeds),gf=Dt$2.bignumber(Ai.realizedSurplus),yf=Dt$2.bignumber(Ai.purchaseProceeds).sub(mf).add(gf),vf=pf.sub(yf);return df.sub(hf).div(ff.sub(hf)).mul(vf).add(yf).toNumber()}function oc(vo){return vo.reduce((Ai,{fixedIncomeTransaction:bo})=>bo?Ai.add(Dt$2.bignumber(bo.amount)):Ai,Dt$2.bignumber(0))}function Dd(vo,Ai){var bo={};for(var Ra in vo)Object.prototype.hasOwnProperty.call(vo,Ra)&&Ai.indexOf(Ra)<0&&(bo[Ra]=vo[Ra]);if(vo!=null&&typeof Object.getOwnPropertySymbols=="function")for(var hc=0,Ra=Object.getOwnPropertySymbols(vo);hc<Ra.length;hc++)Ai.indexOf(Ra[hc])<0&&Object.prototype.propertyIsEnumerable.call(vo,Ra[hc])&&(bo[Ra[hc]]=vo[Ra[hc]]);return bo}var Yn$2;(function(vo){vo.event="event",vo.props="prop"})(Yn$2||(Yn$2={}));function _t$2(){}function eC(vo){var Ai,bo=void 0;return function(){for(var Ra=[],hc=arguments.length;hc--;)Ra[hc]=arguments[hc];return Ai&&Ra.length===Ai.length&&Ra.every(function(pc,mc){return pc===Ai[mc]})||(Ai=Ra,bo=vo.apply(void 0,Ra)),bo}}function Gn$1(vo){return!!(vo||"").match(/\d/)}function fn$1(vo){return vo==null}function tC(vo){return typeof vo=="number"&&isNaN(vo)}function Rd(vo){return fn$1(vo)||tC(vo)||typeof vo=="number"&&!isFinite(vo)}function _d(vo){return vo.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function nC(vo){switch(vo){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function rC(vo,Ai,bo){var Ra=nC(bo),hc=vo.search(/[1-9]/);return hc=hc===-1?vo.length:hc,vo.substring(0,hc)+vo.substring(hc,vo.length).replace(Ra,"$1"+Ai)}function oC(vo){var Ai=useRef(vo);Ai.current=vo;var bo=useRef(function(){for(var Ra=[],hc=arguments.length;hc--;)Ra[hc]=arguments[hc];return Ai.current.apply(Ai,Ra)});return bo.current}function Pi(vo,Ai){Ai===void 0&&(Ai=!0);var bo=vo[0]==="-",Ra=bo&&Ai;vo=vo.replace("-","");var hc=vo.split("."),pc=hc[0],mc=hc[1]||"";return{beforeDecimal:pc,afterDecimal:mc,hasNegation:bo,addNegation:Ra}}function aC(vo){if(!vo)return vo;var Ai=vo[0]==="-";Ai&&(vo=vo.substring(1,vo.length));var bo=vo.split("."),Ra=bo[0].replace(/^0+/,"")||"0",hc=bo[1]||"";return(Ai?"-":"")+Ra+(hc?"."+hc:"")}function kd(vo,Ai,bo){for(var Ra="",hc=bo?"0":"",pc=0;pc<=Ai-1;pc++)Ra+=vo[pc]||hc;return Ra}function ac(vo,Ai){return Array(Ai+1).join(vo)}function Fd(vo){var Ai=vo+"",bo=Ai[0]==="-"?"-":"";bo&&(Ai=Ai.substring(1));var Ra=Ai.split(/[eE]/g),hc=Ra[0],pc=Ra[1];if(pc=Number(pc),!pc)return bo+hc;hc=hc.replace(".","");var mc=1+pc,uf=hc.length;return mc<0?hc="0."+ac("0",Math.abs(mc))+hc:mc>=uf?hc=hc+ac("0",mc-uf):hc=(hc.substring(0,mc)||"0")+"."+hc.substring(mc),bo+hc}function ic(vo,Ai,bo){if(["","-"].indexOf(vo)!==-1)return vo;var Ra=(vo.indexOf(".")!==-1||bo)&&Ai,hc=Pi(vo),pc=hc.beforeDecimal,mc=hc.afterDecimal,uf=hc.hasNegation,df=parseFloat("0."+(mc||"0")),ff=mc.length<=Ai?"0."+mc:df.toFixed(Ai),hf=ff.split("."),pf=pc;pc&&Number(hf[0])&&(pf=pc.split("").reverse().reduce(function(vf,bf,Sf){return vf.length>Sf?(Number(vf[0])+Number(bf)).toString()+vf.substring(1,vf.length):bf+vf},hf[0]));var mf=kd(hf[1]||"",Ai,bo),gf=uf?"-":"",yf=Ra?".":"";return""+gf+pf+yf+mf}function Yt$1(vo,Ai){if(vo.value=vo.value,vo!==null){if(vo.createTextRange){var bo=vo.createTextRange();return bo.move("character",Ai),bo.select(),!0}return vo.selectionStart||vo.selectionStart===0?(vo.focus(),vo.setSelectionRange(Ai,Ai),!0):(vo.focus(),!1)}}var Vd=eC(function(vo,Ai){for(var bo=0,Ra=0,hc=vo.length,pc=Ai.length;vo[bo]===Ai[bo]&&bo<hc;)bo++;for(;vo[hc-1-Ra]===Ai[pc-1-Ra]&&pc-Ra>bo&&hc-Ra>bo;)Ra++;return{from:{start:bo,end:hc-Ra},to:{start:bo,end:pc-Ra}}}),iC=function(vo,Ai){var bo=Math.min(vo.selectionStart,Ai);return{from:{start:bo,end:vo.selectionEnd},to:{start:bo,end:Ai}}};function sC(vo,Ai,bo){return Math.min(Math.max(vo,Ai),bo)}function oa(vo){return Math.max(vo.selectionStart,vo.selectionEnd)}function cC(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function lC(vo){return{from:{start:0,end:0},to:{start:0,end:vo.length},lastValue:""}}function uC(vo){var Ai=vo.currentValue,bo=vo.formattedValue,Ra=vo.currentValueIndex,hc=vo.formattedValueIndex;return Ai[Ra]===bo[hc]}function dC(vo,Ai,bo,Ra,hc,pc,mc){mc===void 0&&(mc=uC);var uf=hc.findIndex(function(s1){return s1}),df=vo.slice(0,uf);!Ai&&!bo.startsWith(df)&&(Ai=df,bo=df+bo,Ra=Ra+df.length);for(var ff=bo.length,hf=vo.length,pf={},mf=new Array(ff),gf=0;gf<ff;gf++){mf[gf]=-1;for(var yf=0,vf=hf;yf<vf;yf++){var bf=mc({currentValue:bo,lastValue:Ai,formattedValue:vo,currentValueIndex:gf,formattedValueIndex:yf});if(bf&&pf[yf]!==!0){mf[gf]=yf,pf[yf]=!0;break}}}for(var Sf=Ra;Sf<ff&&(mf[Sf]===-1||!pc(bo[Sf]));)Sf++;var xf=Sf===ff||mf[Sf]===-1?hf:mf[Sf];for(Sf=Ra-1;Sf>0&&mf[Sf]===-1;)Sf--;var wf=Sf===-1||mf[Sf]===-1?0:mf[Sf]+1;return wf>xf?xf:Ra-wf<xf-Ra?wf:xf}function sc(vo,Ai,bo,Ra){var hc=vo.length;if(Ai=sC(Ai,0,hc),Ra==="left"){for(;Ai>=0&&!bo[Ai];)Ai--;Ai===-1&&(Ai=bo.indexOf(!0))}else{for(;Ai<=hc&&!bo[Ai];)Ai++;Ai>hc&&(Ai=bo.lastIndexOf(!0))}return Ai===-1&&(Ai=hc),Ai}function fC(vo){for(var Ai=Array.from({length:vo.length+1}).map(function(){return!0}),bo=0,Ra=Ai.length;bo<Ra;bo++)Ai[bo]=!!(Gn$1(vo[bo])||Gn$1(vo[bo-1]));return Ai}function Ld(vo,Ai,bo,Ra,hc,pc){pc===void 0&&(pc=_t$2);var mc=oC(function(yf,vf){var bf,Sf;return Rd(yf)?(Sf="",bf=""):typeof yf=="number"||vf?(Sf=typeof yf=="number"?Fd(yf):yf,bf=Ra(Sf)):(Sf=hc(yf,void 0),bf=Ra(Sf)),{formattedValue:bf,numAsString:Sf}}),uf=useState(function(){return mc(fn$1(vo)?Ai:vo,bo)}),df=uf[0],ff=uf[1],hf=function(yf,vf){yf.formattedValue!==df.formattedValue&&ff({formattedValue:yf.formattedValue,numAsString:yf.value}),pc(yf,vf)},pf=vo,mf=bo;fn$1(vo)&&(pf=df.numAsString,mf=!0);var gf=mc(pf,mf);return useMemo(function(){ff(gf)},[gf.formattedValue]),[df,hf]}function mC(vo){return vo.replace(/[^0-9]/g,"")}function pC(vo){return vo}function hC(vo){var Ai=vo.type;Ai===void 0&&(Ai="text");var bo=vo.displayType;bo===void 0&&(bo="input");var Ra=vo.customInput,hc=vo.renderText,pc=vo.getInputRef,mc=vo.format;mc===void 0&&(mc=pC);var uf=vo.removeFormatting;uf===void 0&&(uf=mC);var df=vo.defaultValue,ff=vo.valueIsNumericString,hf=vo.onValueChange,pf=vo.isAllowed,mf=vo.onChange;mf===void 0&&(mf=_t$2);var gf=vo.onKeyDown;gf===void 0&&(gf=_t$2);var yf=vo.onMouseUp;yf===void 0&&(yf=_t$2);var vf=vo.onFocus;vf===void 0&&(vf=_t$2);var bf=vo.onBlur;bf===void 0&&(bf=_t$2);var Sf=vo.value,xf=vo.getCaretBoundary;xf===void 0&&(xf=fC);var wf=vo.isValidInputCharacter;wf===void 0&&(wf=Gn$1);var s1=vo.isCharacterSame,If=Dd(vo,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),l1=Ld(Sf,df,!!ff,mc,uf,hf),c1=l1[0],m1=c1.formattedValue,k1=c1.numAsString,N1=l1[1],R1=useRef(),$1=useRef({formattedValue:m1,numAsString:k1}),D1=function(P1,u1){$1.current={formattedValue:P1.formattedValue,numAsString:P1.value},N1(P1,u1)},f1=useState(!1),T1=f1[0],A1=f1[1],L1=useRef(null),B1=useRef({setCaretTimeout:null,focusTimeout:null});useEffect(function(){return A1(!0),function(){clearTimeout(B1.current.setCaretTimeout),clearTimeout(B1.current.focusTimeout)}},[]);var V1=mc,Z1=function(P1,u1){var d1=parseFloat(u1);return{formattedValue:P1,value:u1,floatValue:isNaN(d1)?void 0:d1}},H1=function(P1,u1,d1){P1.selectionStart===0&&P1.selectionEnd===P1.value.length||(Yt$1(P1,u1),B1.current.setCaretTimeout=setTimeout(function(){P1.value===d1&&P1.selectionStart!==u1&&Yt$1(P1,u1)},0))},E1=function(P1,u1,d1){return sc(P1,u1,xf(P1),d1)},F1=function(P1,u1,d1){var O1=xf(u1),U1=dC(u1,m1,P1,d1,O1,wf,s1);return U1=sc(u1,U1,O1),U1},M1=function(P1){var u1=P1.formattedValue;u1===void 0&&(u1="");var d1=P1.input,O1=P1.source,U1=P1.event,Q1=P1.numAsString,G1;if(d1){var X1=P1.inputValue||d1.value,K1=oa(d1);d1.value=u1,G1=F1(X1,u1,K1),G1!==void 0&&H1(d1,G1,u1)}u1!==m1&&D1(Z1(u1,Q1),{event:U1,source:O1})};useEffect(function(){var P1=$1.current,u1=P1.formattedValue,d1=P1.numAsString;(m1!==u1||k1!==d1)&&D1(Z1(m1,k1),{event:void 0,source:Yn$2.props})},[m1,k1]);var q1=L1.current?oa(L1.current):void 0,z1=typeof window<"u"?useLayoutEffect:useEffect;z1(function(){var P1=L1.current;if(m1!==$1.current.formattedValue&&P1){var u1=F1($1.current.formattedValue,m1,q1);P1.value=m1,H1(P1,u1,m1)}},[m1]);var W1=function(P1,u1,d1){var O1=u1.target,U1=R1.current?iC(R1.current,O1.selectionEnd):Vd(m1,P1),Q1=Object.assign(Object.assign({},U1),{lastValue:m1}),G1=uf(P1,Q1),X1=V1(G1);if(G1=uf(X1,void 0),pf&&!pf(Z1(X1,G1))){var K1=u1.target,tT=oa(K1),oT=F1(P1,m1,tT);return K1.value=m1,H1(K1,oT,m1),!1}return M1({formattedValue:X1,numAsString:G1,inputValue:P1,event:u1,source:d1,input:u1.target}),!0},J1=function(P1,u1){u1===void 0&&(u1=0);var d1=P1.selectionStart,O1=P1.selectionEnd;R1.current={selectionStart:d1,selectionEnd:O1+u1}},eT=function(P1){var u1=P1.target,d1=u1.value,O1=W1(d1,P1,Yn$2.event);O1&&mf(P1),R1.current=void 0},nT=function(P1){var u1=P1.target,d1=P1.key,O1=u1.selectionStart,U1=u1.selectionEnd,Q1=u1.value;Q1===void 0&&(Q1="");var G1;d1==="ArrowLeft"||d1==="Backspace"?G1=Math.max(O1-1,0):d1==="ArrowRight"?G1=Math.min(O1+1,Q1.length):d1==="Delete"&&(G1=O1);var X1=0;d1==="Delete"&&O1===U1&&(X1=1);var K1=d1==="ArrowLeft"||d1==="ArrowRight";if(G1===void 0||O1!==U1&&!K1){gf(P1),J1(u1,X1);return}var tT=G1;if(K1){var oT=d1==="ArrowLeft"?"left":"right";tT=E1(Q1,G1,oT),tT!==G1&&P1.preventDefault()}else d1==="Delete"&&!wf(Q1[G1])?tT=E1(Q1,G1,"right"):d1==="Backspace"&&!wf(Q1[G1])&&(tT=E1(Q1,G1,"left"));tT!==G1&&H1(u1,tT,Q1),gf(P1),J1(u1,X1)},sT=function(P1){var u1=P1.target,d1=function(){var O1=u1.selectionStart,U1=u1.selectionEnd,Q1=u1.value;if(Q1===void 0&&(Q1=""),O1===U1){var G1=E1(Q1,O1);G1!==O1&&H1(u1,G1,Q1)}};d1(),requestAnimationFrame(function(){d1()}),yf(P1),J1(u1)},iT=function(P1){P1.persist&&P1.persist();var u1=P1.target,d1=P1.currentTarget;L1.current=u1,B1.current.focusTimeout=setTimeout(function(){var O1=u1.selectionStart,U1=u1.selectionEnd,Q1=u1.value;Q1===void 0&&(Q1="");var G1=E1(Q1,O1);G1!==O1&&!(O1===0&&U1===Q1.length)&&H1(u1,G1,Q1),vf(Object.assign(Object.assign({},P1),{currentTarget:d1}))},0)},rT=function(P1){L1.current=null,clearTimeout(B1.current.focusTimeout),clearTimeout(B1.current.setCaretTimeout),bf(P1)},lT=T1&&cC()?"numeric":void 0,_1=Object.assign({inputMode:lT},If,{type:Ai,value:m1,onChange:eT,onKeyDown:nT,onMouseUp:sT,onFocus:iT,onBlur:rT});if(bo==="text")return hc?y__default.createElement(y__default.Fragment,null,hc(m1,If)||null):y__default.createElement("span",Object.assign({},If,{ref:pc}),m1);if(Ra){var j1=Ra;return y__default.createElement(j1,Object.assign({},_1,{ref:pc}))}return y__default.createElement("input",Object.assign({},_1,{ref:pc}))}function cc(vo,Ai){var bo=Ai.decimalScale,Ra=Ai.fixedDecimalScale,hc=Ai.prefix;hc===void 0&&(hc="");var pc=Ai.suffix;pc===void 0&&(pc="");var mc=Ai.allowNegative,uf=Ai.thousandsGroupStyle;if(uf===void 0&&(uf="thousand"),vo===""||vo==="-")return vo;var df=go(Ai),ff=df.thousandSeparator,hf=df.decimalSeparator,pf=bo!==0&&vo.indexOf(".")!==-1||bo&&Ra,mf=Pi(vo,mc),gf=mf.beforeDecimal,yf=mf.afterDecimal,vf=mf.addNegation;return bo!==void 0&&(yf=kd(yf,bo,!!Ra)),ff&&(gf=rC(gf,ff,uf)),hc&&(gf=hc+gf),pc&&(yf=yf+pc),vf&&(gf="-"+gf),vo=gf+(pf&&hf||"")+yf,vo}function go(vo){var Ai=vo.decimalSeparator;Ai===void 0&&(Ai=".");var bo=vo.thousandSeparator,Ra=vo.allowedDecimalSeparators;return bo===!0&&(bo=","),Ra||(Ra=[Ai,"."]),{decimalSeparator:Ai,thousandSeparator:bo,allowedDecimalSeparators:Ra}}function gC(vo,Ai){vo===void 0&&(vo="");var bo=new RegExp("(-)"),Ra=new RegExp("(-)(.)*(-)"),hc=bo.test(vo),pc=Ra.test(vo);return vo=vo.replace(/-/g,""),hc&&!pc&&Ai&&(vo="-"+vo),vo}function vC(vo,Ai){return new RegExp("(^-)|[0-9]|"+_d(vo),"g")}function bC(vo,Ai,bo){return vo===""?!0:!(Ai!=null&&Ai.match(/\d/))&&!(bo!=null&&bo.match(/\d/))&&typeof vo=="string"&&!isNaN(Number(vo))}function yC(vo,Ai,bo){var Ra;Ai===void 0&&(Ai=lC(vo));var hc=bo.allowNegative,pc=bo.prefix;pc===void 0&&(pc="");var mc=bo.suffix;mc===void 0&&(mc="");var uf=bo.decimalScale,df=Ai.from,ff=Ai.to,hf=ff.start,pf=ff.end,mf=go(bo),gf=mf.allowedDecimalSeparators,yf=mf.decimalSeparator,vf=vo[pf]===yf;if(Gn$1(vo)&&(vo===pc||vo===mc)&&Ai.lastValue==="")return vo;if(pf-hf===1&&gf.indexOf(vo[hf])!==-1){var bf=uf===0?"":yf;vo=vo.substring(0,hf)+bf+vo.substring(hf+1,vo.length)}var Sf=function(L1,B1,V1){var Z1=!1,H1=!1;pc.startsWith("-")?Z1=!1:L1.startsWith("--")?(Z1=!1,H1=!0):mc.startsWith("-")&&L1.length===mc.length?Z1=!1:L1[0]==="-"&&(Z1=!0);var E1=Z1?1:0;return H1&&(E1=2),E1&&(L1=L1.substring(E1),B1-=E1,V1-=E1),{value:L1,start:B1,end:V1,hasNegation:Z1}},xf=Sf(vo,hf,pf),wf=xf.hasNegation;Ra=xf,vo=Ra.value,hf=Ra.start,pf=Ra.end;var s1=Sf(Ai.lastValue,df.start,df.end),If=s1.start,l1=s1.end,c1=s1.value,m1=vo.substring(hf,pf);vo.length&&c1.length&&(If>c1.length-mc.length||l1<pc.length)&&!(m1&&mc.startsWith(m1))&&(vo=c1);var k1=0;vo.startsWith(pc)?k1+=pc.length:hf<pc.length&&(k1=hf),vo=vo.substring(k1),pf-=k1;var N1=vo.length,R1=vo.length-mc.length;vo.endsWith(mc)?N1=R1:(pf>R1||pf>vo.length-mc.length)&&(N1=pf),vo=vo.substring(0,N1),vo=gC(wf?"-"+vo:vo,hc),vo=(vo.match(vC(yf))||[]).join("");var $1=vo.indexOf(yf);vo=vo.replace(new RegExp(_d(yf),"g"),function(L1,B1){return B1===$1?".":""});var D1=Pi(vo,hc),f1=D1.beforeDecimal,T1=D1.afterDecimal,A1=D1.addNegation;return ff.end-ff.start<df.end-df.start&&f1===""&&vf&&!parseFloat(T1)&&(vo=A1?"-":""),vo}function wC(vo,Ai){var bo=Ai.prefix;bo===void 0&&(bo="");var Ra=Ai.suffix;Ra===void 0&&(Ra="");var hc=Array.from({length:vo.length+1}).map(function(){return!0}),pc=vo[0]==="-";hc.fill(!1,0,bo.length+(pc?1:0));var mc=vo.length;return hc.fill(!1,mc-Ra.length+1,mc+1),hc}function xC(vo){var Ai=go(vo),bo=Ai.thousandSeparator,Ra=Ai.decimalSeparator,hc=vo.prefix;hc===void 0&&(hc="");var pc=vo.allowNegative;if(pc===void 0&&(pc=!0),bo===Ra)throw new Error(`
|
|
59
|
-
Decimal separator can't be same as thousand separator.
|
|
60
|
-
thousandSeparator: `+bo+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
61
|
-
decimalSeparator: `+Ra+` (default value for decimalSeparator is .)
|
|
62
|
-
`);return hc.startsWith("-")&&pc&&(console.error(`
|
|
63
|
-
Prefix can't start with '-' when allowNegative is true.
|
|
64
|
-
prefix: `+hc+`
|
|
65
|
-
allowNegative: `+pc+`
|
|
66
|
-
`),pc=!1),Object.assign(Object.assign({},vo),{allowNegative:pc})}function SC(vo){vo=xC(vo),vo.decimalSeparator,vo.allowedDecimalSeparators,vo.thousandsGroupStyle;var Ai=vo.suffix,bo=vo.allowNegative,Ra=vo.allowLeadingZeros,hc=vo.onKeyDown;hc===void 0&&(hc=_t$2);var pc=vo.onBlur;pc===void 0&&(pc=_t$2);var mc=vo.thousandSeparator,uf=vo.decimalScale,df=vo.fixedDecimalScale,ff=vo.prefix;ff===void 0&&(ff="");var hf=vo.defaultValue,pf=vo.value,mf=vo.valueIsNumericString,gf=vo.onValueChange,yf=Dd(vo,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),vf=go(vo),bf=vf.decimalSeparator,Sf=vf.allowedDecimalSeparators,xf=function(A1){return cc(A1,vo)},wf=function(A1,L1){return yC(A1,L1,vo)},s1=fn$1(pf)?hf:pf,If=mf??bC(s1,ff,Ai);fn$1(pf)?fn$1(hf)||(If=If||typeof hf=="number"):If=If||typeof pf=="number";var l1=function(A1){return Rd(A1)?A1:(typeof A1=="number"&&(A1=Fd(A1)),If&&typeof uf=="number"?ic(A1,uf,!!df):A1)},c1=Ld(l1(pf),l1(hf),!!If,xf,wf,gf),m1=c1[0],k1=m1.numAsString,N1=m1.formattedValue,R1=c1[1],$1=function(A1){var L1=A1.target,B1=A1.key,V1=L1.selectionStart,Z1=L1.selectionEnd,H1=L1.value;if(H1===void 0&&(H1=""),(B1==="Backspace"||B1==="Delete")&&Z1<ff.length){A1.preventDefault();return}if(V1!==Z1){hc(A1);return}B1==="Backspace"&&H1[0]==="-"&&V1===ff.length+1&&bo&&Yt$1(L1,1),uf&&df&&(B1==="Backspace"&&H1[V1-1]===bf?(Yt$1(L1,V1-1),A1.preventDefault()):B1==="Delete"&&H1[V1]===bf&&A1.preventDefault()),Sf!=null&&Sf.includes(B1)&&H1[V1]===bf&&Yt$1(L1,V1+1);var E1=mc===!0?",":mc;B1==="Backspace"&&H1[V1-1]===E1&&Yt$1(L1,V1-1),B1==="Delete"&&H1[V1]===E1&&Yt$1(L1,V1+1),hc(A1)},D1=function(A1){var L1=k1;if(L1.match(/\d/g)||(L1=""),Ra||(L1=aC(L1)),df&&uf&&(L1=ic(L1,uf,df)),L1!==k1){var B1=cc(L1,vo);R1({formattedValue:B1,value:L1,floatValue:parseFloat(L1)},{event:A1,source:Yn$2.event})}pc(A1)},f1=function(A1){return A1===bf?!0:Gn$1(A1)},T1=function(A1){var L1=A1.currentValue,B1=A1.lastValue,V1=A1.formattedValue,Z1=A1.currentValueIndex,H1=A1.formattedValueIndex,E1=L1[Z1],F1=V1[H1],M1=Vd(B1,L1),q1=M1.to,z1=function(W1){return wf(W1).indexOf(".")+ff.length};return pf===0&&df&&uf&&L1[q1.start]===bf&&z1(L1)<Z1&&z1(V1)>H1?!1:Z1>=q1.start&&Z1<q1.end&&Sf&&Sf.includes(E1)&&F1===bf?!0:E1===F1};return Object.assign(Object.assign({},yf),{value:N1,valueIsNumericString:!1,isValidInputCharacter:f1,isCharacterSame:T1,onValueChange:R1,format:xf,removeFormatting:wf,getCaretBoundary:function(A1){return wC(A1,vo)},onKeyDown:$1,onBlur:D1})}function $d(vo){var Ai=SC(vo);return y__default.createElement(hC,Object.assign({},Ai))}function Ti(vo){const{value:Ai,currency:bo,decimalScale:Ra=2,thousandSeparator:hc=",",fixedDecimalScale:pc=!0}=vo;return jsx($d,{decimalScale:Ra,displayType:"text",fixedDecimalScale:pc,prefix:bo==="USD"?"$":void 0,thousandSeparator:hc,value:Ai})}function CC(vo,Ai=!0){if(vo instanceof Date||MS(vo)){const bo=vo instanceof Date?vo.toISOString():vo;return wi(bo,Ai)}return vo}function pt$2(vo,Ai=2,bo=!0){return vo==null?"--":typeof vo=="number"?jsx(Ti,{decimalScale:Ai,value:vo}):CC(vo,bo)}function IC(vo,Ai){return!vo||!Ai?0:vo/Ai}function EC(vo,Ai,bo){if(!Ai||!vo)return 0;const Ra=Ad[vo],hc=((bo==null?void 0:bo.map(pc=>pc.amount).filter(Boolean))??[]).reduce((pc,mc)=>pc+mc,0);return Ai*Ra-hc}function PC(vo){const{fixedIncomeTypes:Ai}=vo;return xn$1(Ai)}function TC(vo){const{spvs:Ai}=vo;return xn$1(Ai)}function OC(vo){const{portfolio:Ai,transactions:bo,fixedIncomeTypes:Ra}=vo,hc=new Date,pc=Ei(Ai).map(mc=>{const uf=JS({asset:mc,currentDate:hc,transactions:bo,fixedIncomeTypes:Ra});return{...mc,currentValue:uf}});return xn$1(pc)}function aa$1(vo,Ai){return vo&&vo*Ai}function MC(vo){const{transactions:Ai,portfolio:bo}=vo,Ra=Ei(bo),hc=Ai.map(pc=>{var mc,uf,df;const ff=pc.id,hf=pc.entryTime,pf=(mc=Ra.find(s1=>{var If;return s1.id===((If=pc.fixedIncomeTransaction)==null?void 0:If.assetId)}))==null?void 0:mc.name,mf=pc.type,gf=Ii$1[mf],yf=Ad[mf],vf=zS(mf)?XS[mf]:1,bf=aa$1((uf=pc.fixedIncomeTransaction)==null?void 0:uf.amount,vf),Sf=aa$1(pc.cashTransaction.amount,yf),xf=Si.includes(pc.type)?aa$1(pc.cashTransaction.amount,pc.type===Nd?-1:1)??0:((df=pc.fees)==null?void 0:df.reduce((s1,If)=>s1+If.amount,0))??0,wf=pc.cashBalanceChange;return{...pc,id:ff,type:mf,typeLabel:gf,entryTime:hf,asset:pf,quantity:bf,cashAmount:Sf,totalFees:xf,cashBalanceChange:wf}});return xn$1(hc)}function NC(vo){const{accounts:Ai,principalLenderAccountId:bo}=vo,Ra=Ai.filter(hc=>hc.id!==bo);return xn$1(Ra)}function AC(vo){const{serviceProviderFeeTypes:Ai,accounts:bo}=vo,Ra=Ai.map(hc=>{const pc=bo.find(mc=>mc.id===hc.accountId);return{...hc,accountName:pc==null?void 0:pc.label,accountReference:pc==null?void 0:pc.reference}});return xn$1(Ra)}function xn$1(vo){return vo.map((Ai,bo)=>({...Ai,itemNumber:bo+1}))}function Aa(vo,Ai){return DC[vo](Ai)}const DC={ASSET:OC,TRANSACTION:MC,ACCOUNT:NC,FIXED_INCOME_TYPE:PC,SERVICE_PROVIDER_FEE_TYPE:AC,SPV:TC},RC={accounts:[],fixedIncomeTypes:[],portfolio:[],principalLenderAccountId:"",serviceProviderFeeTypes:[],spvs:[],transactions:[],fixedIncomes:[],cashAsset:{id:"",type:"Cash",currency:"USD",balance:0,spvId:""},isAllowedToCreateDocuments:!1,isAllowedToEditDocuments:!1,canUndo:!1,canRedo:!1,operation:null,onSwitchboardLinkClick:void 0,selectedTableItem:null,selectedTableName:null,getIsFormOpen:()=>!1,clearSelected:()=>{},viewItem:()=>{},createItem:()=>{},editItem:()=>{},onExport:()=>{},onClose:()=>{},handleUndo:()=>{},handleRedo:()=>{},onShowRevisionHistory:()=>{},handleAction:()=>{}},Oi$1=createContext(RC);Oi$1.displayName="EditorContext";function _C(vo,Ai){switch(Ai.type){case"VIEW_ITEM":return{selectedTableItem:Ai.item,selectedTableName:Ai.tableName,operation:"view"};case"CREATE_ITEM":return{selectedTableItem:null,selectedTableName:Ai.tableName,operation:"create"};case"EDIT_ITEM":return{selectedTableItem:Ai.item,selectedTableName:Ai.tableName,operation:"edit"};case"CLEAR_SELECTED":return{selectedTableItem:null,selectedTableName:null,operation:null};default:return vo}}function x1(vo){const{children:Ai,state:bo,isAllowedToCreateDocuments:Ra,isAllowedToEditDocuments:hc,canUndo:pc,canRedo:mc,undo:uf,redo:df,editorDispatcher:ff,onExport:hf,onClose:pf,onSwitchboardLinkClick:mf,onShowRevisionHistory:gf}=vo,[yf,vf]=useState(bo),bf=useRef(bo),[Sf,xf]=useReducer(_C,{selectedTableItem:null,selectedTableName:null,operation:null}),{selectedTableItem:wf,selectedTableName:s1,operation:If}=Sf;useEffect(()=>{(If===null||If==="view")&&vf(bf.current)},[If,bo]),useEffect(()=>{bf.current=bo},[bo]);const{accounts:l1,fixedIncomeTypes:c1,portfolio:m1,principalLenderAccountId:k1,serviceProviderFeeTypes:N1,spvs:R1,transactions:$1}=yf,D1=useMemo(()=>GS(m1),[m1]),f1=useMemo(()=>Ei(m1),[m1]),T1=useCallback(()=>{pc&&uf()},[pc,uf]),A1=useCallback(()=>{mc&&df()},[mc,df]),L1=useCallback(M1=>s1===M1,[s1]),B1=useCallback((M1,q1)=>{xf({type:"VIEW_ITEM",item:M1,tableName:q1})},[]),V1=useCallback(M1=>{xf({type:"CREATE_ITEM",tableName:M1})},[]),Z1=useCallback((M1,q1)=>{xf({type:"EDIT_ITEM",item:M1,tableName:q1})},[]),H1=useCallback(()=>{xf({type:"CLEAR_SELECTED"}),vf(bf.current)},[]),E1=useCallback(M1=>{try{const q1=ff(M1),z1=QS(M1);if(z1==="DELETE"||!q1){H1();return}const W1=ZS(M1),J1=KS(W1),eT=bf.current[J1];if(typeof eT=="string")return;if(z1==="CREATE"){const nT=[...eT,q1],sT={...bf.current,[J1]:nT};if(bf.current=sT,vf(sT),W1===s1){const iT=Aa(W1,sT).find(rT=>rT.id===q1.id);iT&&B1(iT,W1)}}if(z1==="EDIT"){const nT=eT.map(rT=>rT.id===q1.id?q1:rT),sT={...bf.current,[J1]:nT};bf.current=sT,vf(sT);const iT=Aa(W1,sT).find(rT=>rT.id===q1.id);iT&&Z1(iT,W1)}}catch(q1){console.error(`Failed to dispatch action ${M1.type}`,q1)}},[H1,ff,Z1,s1,B1]),F1=useMemo(()=>({accounts:l1,fixedIncomeTypes:c1,portfolio:m1,principalLenderAccountId:k1,serviceProviderFeeTypes:N1,spvs:R1,transactions:$1,cashAsset:D1,fixedIncomes:f1,canUndo:pc,canRedo:mc,isAllowedToCreateDocuments:Ra,isAllowedToEditDocuments:hc,selectedTableItem:wf,selectedTableName:s1,operation:If,handleAction:E1,handleUndo:T1,handleRedo:A1,viewItem:B1,createItem:V1,editItem:Z1,clearSelected:H1,getIsFormOpen:L1,onExport:hf,onClose:pf,onSwitchboardLinkClick:mf,onShowRevisionHistory:gf}),[l1,mc,pc,D1,H1,V1,Z1,c1,f1,L1,E1,A1,T1,Ra,hc,pf,hf,gf,mf,If,m1,k1,wf,s1,N1,R1,$1,B1]);return jsx(Oi$1.Provider,{value:F1,children:Ai})}function tt$2(){return useContext(Oi$1)}function kC(vo){return Wf({defaultValues:vo})}function FC(vo){const{operation:Ai,tableName:bo,tableItem:Ra}=vo,{handleAction:hc,fixedIncomeTypes:pc,spvs:mc,accounts:uf}=tt$2(),df=BS({tableName:bo,tableItem:Ra,fixedIncomeTypes:pc,spvs:mc,accounts:uf}),ff=Ai==="create"?"CREATE":"EDIT",hf=df,{register:pf,handleSubmit:mf,reset:gf,watch:yf,control:vf,formState:bf}=kC(hf);useEffect(()=>{gf(hf)},[hf,gf]);const Sf=useCallback(wf=>{const s1=`${ff}_${bo}`;hc({type:s1,payload:wf})},[ff,hc,bo]),xf=mf(Sf);return useMemo(()=>({register:pf,reset:gf,watch:yf,control:vf,formState:bf,submit:xf}),[vf,bf,pf,gf,xf,yf])}function VC(vo){const{control:Ai}=vo,bo=kt$2({control:Ai,name:"cashAmount"}),Ra=kt$2({control:Ai,name:"type"}),hc=kt$2({control:Ai,name:"fees"}),pc=EC(Ra,bo,hc);return jsxs("div",{className:"flex items-center justify-between border-t border-gray-300 bg-gray-100 p-3 font-semibold text-gray-800",children:[jsx("div",{className:"mr-6 text-sm text-gray-600",children:"Cash Balance Change $USD"}),jsx("div",{className:"h-px flex-1 border-b border-dashed border-gray-400"}),jsx("div",{className:"pl-8 text-sm text-gray-900",children:jsx(Ti,{value:pc})})]})}function LC({control:vo}){const Ai=kt$2({control:vo,name:"entryTime"});return Ai?wi(new Date(Ai),!0,!0):null}function jt$2(vo){const{options:Ai,name:bo,control:Ra,rules:hc,errorMessage:pc,errorMessageClassName:mc,disabled:uf=!1,...df}=vo,ff=vo["aria-invalid"]==="true";return jsx(Ec,{control:Ra,name:bo,render:({field:{onChange:hf,onBlur:pf,value:mf}})=>{var gf;return uf?jsx(Fragment,{children:(gf=Ai.find(yf=>yf.value===mf))==null?void 0:gf.label}):jsxs(Fragment,{children:[jsx(Ca,{isDisabled:uf,onBlur:pf,onChange:yf=>!!yf&&typeof yf=="object"&&"value"in yf&&hf(yf.value),options:Ai,value:Ai.find(yf=>yf.value===mf)??null,...df}),ff&&pc?jsx("p",{className:Ne$1("text-sm text-red-900",mc),role:"alert",children:pc}):null]})},rules:hc})}const nt$1=forwardRef(function(vo,Ai){const bo=vo["aria-invalid"]==="true",{errorMessage:Ra,labelClassName:hc,inputClassName:pc,errorMessageClassName:mc,...uf}=vo;return jsxs("label",{className:hc,children:[jsx("input",{...uf,className:Ne$1("h-8 w-full rounded-md border border-transparent bg-gray-100 p-3 text-right placeholder:text-gray-500 disabled:bg-transparent disabled:p-0 disabled:text-left",bo&&"border-red-900 outline-red-900 placeholder:text-red-800",pc),ref:Ai,type:"text"}),bo&&Ra?jsx("p",{className:Ne$1("text-sm text-red-900",mc),role:"alert",children:Ra}):null]})});function Da(vo){const{name:Ai,control:bo,currency:Ra,rules:hc,errorMessage:pc,errorMessageClassName:mc,numericFormatProps:uf,value:df,onChange:ff,...hf}=vo,{allowNegative:pf=!1,decimalScale:mf=2,thousandSeparator:gf=",",fixedDecimalScale:yf=!0}=uf??{},vf=Ra==="USD"?"$":void 0,bf=vo["aria-invalid"]==="true";return jsx(Ec,{control:bo,name:Ai,render:({field:{onChange:Sf,value:xf,ref:wf}})=>jsxs(Fragment,{children:[jsx($d,{...hf,allowNegative:pf,customInput:nt$1,decimalScale:mf,fixedDecimalScale:yf,getInputRef:wf,onValueChange:({floatValue:s1})=>Sf(s1),prefix:vf,thousandSeparator:gf,value:xf}),bf&&pc?jsx("p",{className:Ne$1("text-sm text-red-900",mc),role:"alert",children:pc}):null]}),rules:hc})}function $C(vo){const Ai=["Fees","Service Provider","Amount",""],{canHaveTransactionFees:bo,serviceProviderFeeTypes:Ra,serviceProviderFeeTypeOptions:hc,control:pc,errors:mc,isViewOnly:uf,showCreateServiceProviderFeeTypeModal:df}=vo,{fields:ff,append:hf,remove:pf}=Rf({control:pc,name:"fees"});return bo?jsxs(Fragment,{children:[ff.length>0&&jsx("div",{className:"bg-gray-50 pl-5 pt-3",children:jsxs("table",{className:"w-full border-separate text-xs font-medium",children:[jsx("thead",{className:"mb-2",children:jsx("tr",{children:Ai.map(mf=>jsx("th",{className:Ne$1("py-2 text-left font-medium text-gray-600",mf==="Amount"&&!uf&&"text-right"),children:mf},mf))})}),jsx("tbody",{children:ff.map((mf,gf)=>{var yf,vf,bf,Sf;return jsxs("tr",{children:[jsx("td",{className:"w-52"}),jsx("td",{className:"w-96",children:jsx(jt$2,{addItemButtonProps:{onClick:df,label:"Add Service Provider"},"aria-invalid":(vf=(yf=mc.fees)==null?void 0:yf[gf])!=null&&vf.serviceProviderFeeTypeId?"true":"false",control:pc,disabled:uf,name:`fees.${gf}.serviceProviderFeeTypeId`,options:hc,rules:{required:"Service provider is required"}})}),jsx("td",{className:"w-52",children:jsx(Da,{"aria-invalid":(Sf=(bf=mc.fees)==null?void 0:bf[gf])!=null&&Sf.amount?"true":"false",control:pc,currency:"USD",disabled:uf,name:`fees.${gf}.amount`,placeholder:"E.g. $1,000.00",rules:{required:"Amount is required",validate:{positive:xf=>!!xf&&Number(xf)>0||"Fee amount must be greater than zero"}}})}),jsx("td",{className:"",children:!uf&&jsx("button",{className:"flex items-center",onClick:()=>pf(gf),type:"button",children:jsx(_e$1,{className:"text-gray-900",name:"Xmark"})})})]},mf.id)})})]})}),!uf&&jsxs("button",{className:"ml-[234px] mt-1 flex w-fit items-center justify-center gap-x-2 rounded-lg bg-white pb-6 text-sm font-semibold text-gray-900",onClick:()=>{var mf;return hf({amount:null,serviceProviderFeeTypeId:(mf=Ra[0])==null?void 0:mf.id})},children:[jsx("span",{children:"Add Fee"}),jsx(_e$1,{name:"Plus",size:16})]})]}):null}function UC(vo){const{control:Ai}=vo,bo=kt$2({control:Ai,name:"cashAmount"}),Ra=kt$2({control:Ai,name:"fixedIncomeAmount"}),hc=IC(bo,Ra);return jsxs("div",{className:Ne$1("mt-1 w-fit",!vo.isViewOnly&&"ml-auto"),children:[jsx("span",{className:"text-gray-600",children:"Unit Price"})," ",jsx("span",{className:"text-gray-900",children:jsx(Ti,{decimalScale:6,value:hc})})]})}function HC(vo){return WC(vo)?vo.length===66:!1}function WC(vo){return typeof vo=="string"&&vo.startsWith("0x")}const BC=forwardRef(function(vo,Ai){const{control:bo,disabled:Ra}=vo,hc=kt$2({control:bo,name:"txRef"}),pc=46,mc=typeof hc=="string"&&hc.length>=pc?`${hc.slice(0,pc)}...`:hc,uf=HC(hc),df=jsxs("div",{children:[jsx("p",{children:hc}),uf?jsx("p",{className:"mt-2 text-center",children:jsx("a",{className:"text-blue-900 underline",href:`https://etherscan.io/tx/${hc}`,children:"View on Etherscan"})}):null]});return Ra?jsx(Yw,{children:jsx(jw,{content:df,children:jsx("span",{children:mc})})}):jsx(nt$1,{...vo,ref:Ai})});function Ud(vo){let Ai=vo.name;return vo.ISIN&&(Ai+=` - ${vo.ISIN}`),vo.CUSIP&&(Ai+=` - ${vo.CUSIP}`),Ai}function zC(vo){const{tableName:Ai,operation:bo,formState:Ra,tableItem:hc,register:pc,watch:mc,control:uf}=vo,{fixedIncomeTypes:df,spvs:ff,serviceProviderFeeTypes:hf,accounts:pf,fixedIncomes:mf}=tt$2(),{showModal:gf}=Bd(),yf=useCallback(vf=>()=>{gf("createItem",{tableName:vf})},[gf]);return useMemo(()=>{switch(Ai){case Ce$2.ASSET:{const vf=hc,bf=pc,Sf=Ra,{errors:xf}=Sf,wf=uf,s1=bo!=="create"&&vf?[{label:"Notional",Input:()=>jsx(Fragment,{children:pt$2(vf.notional)})},{label:"Purchase Date",Input:()=>jsx(Fragment,{children:pt$2(vf.purchaseDate)})},{label:"Purchase Price",Input:()=>jsx(Fragment,{children:pt$2(vf.purchasePrice,6)})},{label:"Purchase Proceeds",Input:()=>jsx(Fragment,{children:pt$2(vf.purchaseProceeds)})}]:[];return{inputs:[{label:"Asset Name",Input:()=>{var If;return jsx(nt$1,{...bf("name",{disabled:bo==="view",required:"Asset name is required"}),"aria-invalid":xf.name?"true":"false",errorMessage:(If=xf.name)==null?void 0:If.message,inputClassName:"text-left",placeholder:"E.g. My Asset"})}},{label:"CUSIP",Input:()=>{var If;return bo==="view"?(vf==null?void 0:vf.CUSIP)??"Not available":jsx(nt$1,{...bf("CUSIP",{maxLength:{value:9,message:"CUSIP cannot be longer than 9 characters"},minLength:{value:9,message:"CUSIP cannot be shorter than 9 characters"},pattern:{value:/^[a-zA-Z0-9]*$/,message:"CUSIP must be alphanumeric"}}),"aria-invalid":xf.CUSIP?"true":"false",errorMessage:(If=xf.CUSIP)==null?void 0:If.message,placeholder:"E.g. A2345B789"})}},{label:"ISIN",Input:()=>{var If;return bo==="view"?(vf==null?void 0:vf.ISIN)??"Not available":jsx(nt$1,{...bf("ISIN",{maxLength:{value:12,message:"ISIN cannot be longer than 12 characters"},minLength:{value:12,message:"ISIN cannot be shorter than 12 characters"},pattern:{value:/^[a-zA-Z0-9]*$/,message:"ISIN must be alphanumeric"}}),"aria-invalid":xf.ISIN?"true":"false",errorMessage:(If=xf.ISIN)==null?void 0:If.message,placeholder:"E.g. 123456789ABC"})}},{label:"Maturity",Input:()=>jsx("input",{className:"h-8 w-full rounded-md bg-gray-100 px-3 disabled:bg-transparent disabled:p-0",step:1,type:"date",...bf("maturity",{disabled:bo==="view"})}),inputLabel:vf!=null&&vf.maturity?wi(vf.maturity,!0):null},{label:"Asset Type",Input:()=>{var If;return jsx(jt$2,{addItemButtonProps:{onClick:yf("ASSET"),label:"Create Fixed Income Type"},"aria-invalid":xf.fixedIncomeTypeId?"true":"false",control:wf,disabled:bo==="view",errorMessage:(If=xf.fixedIncomeTypeId)==null?void 0:If.message,name:"fixedIncomeTypeId",options:df.map(l1=>({...l1,value:l1.id,label:l1.name})),rules:{required:"Asset type is required"}})}},{label:"SPV",Input:()=>{var If;return jsx(jt$2,{addItemButtonProps:{onClick:yf("SPV"),label:"Create SPV"},"aria-invalid":xf.spvId?"true":"false",control:wf,disabled:bo==="view",errorMessage:(If=xf.spvId)==null?void 0:If.message,name:"spvId",options:ff.map(l1=>({...l1,value:l1.id,label:l1.name})),rules:{required:"SPV is required"}})}},...s1]}}case Ce$2.TRANSACTION:{const vf=pc,bf=mc,{errors:Sf}=Ra,xf=uf,wf=bf("type"),s1=!!wf&&Si.includes(wf),If=!!wf&&xi.includes(wf),l1=!s1,c1=Ci.map($1=>({label:Ii$1[$1],value:$1})),m1=mf.map($1=>({label:Ud($1),value:$1.id})),k1=hf.map($1=>{var D1;return{label:`${$1.name} — ${$1.feeType} — ${(D1=pf.find(f1=>f1.id===$1.accountId))==null?void 0:D1.reference}`,value:$1.id}}),N1=[{label:"Transaction Type",Input:()=>{var $1;return jsx(jt$2,{"aria-invalid":Sf.type?"true":"false",control:xf,disabled:bo==="view",errorMessage:($1=Sf.type)==null?void 0:$1.message,name:"type",options:c1,rules:{required:"Transaction type is required"}})}},{label:"Entry Time",Input:()=>jsx("input",{className:"h-8 w-full rounded-md bg-gray-100 px-3 disabled:bg-transparent disabled:p-0",step:1,type:"datetime-local",...vf("entryTime",{disabled:bo==="view",required:"Entry time is required"})}),inputLabel:jsx(LC,{control:xf})},s1?{label:"Service Provider",Input:()=>jsx(jt$2,{addItemButtonProps:{onClick:yf("SERVICE_PROVIDER_FEE_TYPE"),label:"Add Service Provider"},control:xf,disabled:bo==="view",name:"serviceProviderFeeTypeId",options:k1})}:null,If?{label:"Asset name",Input:()=>{var $1;return jsx(jt$2,{addItemButtonProps:{onClick:yf("ASSET"),label:"Create Asset"},"aria-invalid":Sf.type?"true":"false",control:xf,disabled:bo==="view",errorMessage:($1=Sf.type)==null?void 0:$1.message,name:"fixedIncomeId",options:m1,rules:{required:"Asset name is required"}})}}:void 0,If?{label:"Quantity",Input:()=>{var $1;return jsx(Da,{"aria-invalid":Sf.fixedIncomeAmount?"true":"false",control:xf,disabled:bo==="view",errorMessage:($1=Sf.fixedIncomeAmount)==null?void 0:$1.message,name:"fixedIncomeAmount",placeholder:"E.g. 1,000.00",rules:{required:"Quantity is required",validate:{positive:D1=>!!D1&&Number(D1)>0||"Asset proceeds must be greater than zero"}}})}}:void 0,{label:If?"Asset Proceeds":"Cash Amount",Input:()=>{var $1;return jsxs(Fragment,{children:[jsx(Da,{"aria-invalid":Sf.cashAmount?"true":"false",control:xf,currency:"USD",disabled:bo==="view",errorMessage:($1=Sf.cashAmount)==null?void 0:$1.message,name:"cashAmount",placeholder:"E.g. $1,000.00",rules:{required:"Asset proceeds is required",validate:{positive:D1=>!!D1&&Number(D1)>0||"Asset proceeds must be greater than zero"}}}),If?jsx(UC,{control:xf,isViewOnly:bo==="view"}):null]})}},{label:"Transaction reference",Input:()=>{var $1;return jsx(BC,{...vf("txRef",{disabled:bo==="view"}),"aria-invalid":Sf.txRef?"true":"false",control:xf,errorMessage:($1=Sf.txRef)==null?void 0:$1.message,placeholder:"E.g. 0x123..."})}}].filter(Boolean),R1=jsxs(Fragment,{children:[jsx($C,{canHaveTransactionFees:l1,control:xf,errors:Sf,isViewOnly:bo==="view",serviceProviderFeeTypeOptions:k1,serviceProviderFeeTypes:hf,showCreateServiceProviderFeeTypeModal:yf("SERVICE_PROVIDER_FEE_TYPE")}),jsx(VC,{control:xf})]});return{inputs:N1,additionalInputs:R1}}case Ce$2.ACCOUNT:{const vf=pc,bf=Ra,{errors:Sf}=bf;return{inputs:[{label:"Account Label",Input:()=>{var xf,wf;return jsx(nt$1,{...vf("label",{disabled:bo==="view",required:"Account label is required"}),"aria-invalid":((xf=Sf.label)==null?void 0:xf.type)==="required"?"true":"false",errorMessage:(wf=Sf.label)==null?void 0:wf.message,placeholder:"E.g. My Label"})}},{label:"Account Reference",Input:()=>{var xf,wf;return jsx(nt$1,{...vf("reference",{disabled:bo==="view",required:"Account reference is required"}),"aria-invalid":((xf=Sf.reference)==null?void 0:xf.type)==="required"?"true":"false",errorMessage:(wf=Sf.reference)==null?void 0:wf.message,placeholder:"E.g. bank account number or ETH address"})}}]}}case Ce$2.SPV:{const vf=pc,bf=Ra,{errors:Sf}=bf;return{inputs:[{label:"SPV name",Input:()=>{var xf,wf;return jsx(nt$1,{...vf("name",{disabled:bo==="view",required:"SPV name is required"}),"aria-invalid":((xf=Sf.name)==null?void 0:xf.type)==="required"?"true":"false",errorMessage:(wf=Sf.name)==null?void 0:wf.message,placeholder:"E.g. My SPV name"})}}]}}case Ce$2.FIXED_INCOME_TYPE:{const vf=pc,bf=Ra,{errors:Sf}=bf;return{inputs:[{label:"Fixed Income Type Name",Input:()=>{var xf,wf;return jsx(nt$1,{...vf("name",{disabled:bo==="view",required:"Fixed Income Type name is required"}),"aria-invalid":((xf=Sf.name)==null?void 0:xf.type)==="required"?"true":"false",errorMessage:(wf=Sf.name)==null?void 0:wf.message,placeholder:"E.g. My Fixed Income Type name"})}}]}}case Ce$2.SERVICE_PROVIDER_FEE_TYPE:{const vf=pc,bf=Ra,{errors:Sf}=bf,xf=uf,wf=If=>`${If.label} (${If.reference})`,s1=If=>If.map(l1=>({...l1,value:l1.id,label:wf(l1)}));return{inputs:[{label:"Service Provider Name",Input:()=>{var If,l1;return jsx(nt$1,{...vf("name",{disabled:bo==="view",required:"Service provider name is required"}),"aria-invalid":((If=Sf.name)==null?void 0:If.type)==="required"?"true":"false",errorMessage:(l1=Sf.name)==null?void 0:l1.message,placeholder:"E.g. My Service Provider"})}},{label:"Fee Type",Input:()=>{var If,l1;return jsx(nt$1,{...vf("feeType",{disabled:bo==="view",required:"Fee type is required"}),"aria-invalid":((If=Sf.name)==null?void 0:If.type)==="required"?"true":"false",errorMessage:(l1=Sf.name)==null?void 0:l1.message,placeholder:"E.g. My Fee Type"})}},{label:"Account",Input:()=>{var If;return jsx(jt$2,{addItemButtonProps:{onClick:yf("ACCOUNT"),label:"Create Account"},"aria-invalid":Sf.accountId?"true":"false",control:xf,disabled:bo==="view",errorMessage:(If=Sf.accountId)==null?void 0:If.message,name:"accountId",options:s1(pf),rules:{required:"Account is required"}})}}]}}}},[Ra,uf,pc,hc,mc,pf,df,mf,bo,hf,yf,ff,Ai])}function Hd(vo){const{operation:Ai,tableName:bo,tableItem:Ra}=vo,{submit:hc,reset:pc,register:mc,control:uf,formState:df,watch:ff}=FC({operation:Ai,tableName:bo,tableItem:Ra}),hf=zC({formState:df,operation:Ai,control:uf,watch:ff,tableItem:Ra,tableName:bo,register:mc});return useMemo(()=>({submit:hc,reset:pc,register:mc,control:uf,formInputs:hf,formState:df}),[hc,pc,mc,uf,hf,df])}function jC(vo){const{inputs:Ai}=vo;return jsx("div",{className:"bg-white text-xs font-medium",children:Ai.map(({label:bo,Input:Ra},hc)=>jsxs("div",{className:"mb-4 mt-2 grid gap-1",children:[jsx("label",{className:"text-base",children:bo}),jsx("div",{children:jsx(Ra,{})},hc)]},bo))})}const YC=memo(function(vo){const{tableName:Ai,open:bo,onOpenChange:Ra}=vo,{reset:hc,submit:pc,formInputs:{inputs:mc,additionalInputs:uf}}=Hd({operation:"create",tableName:Ai}),df=jn$2[Ai],ff=useCallback(()=>{hc(),Ra(!1)},[Ra,hc]),hf=useCallback(async()=>{try{await pc(),Ra(!1)}catch(mf){console.error(mf)}},[Ra,pc]),pf="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all";return jsx(cd,{contentProps:{className:"rounded-3xl"},onOpenChange:Ra,open:bo,overlayProps:{className:"top-10"},children:jsxs("div",{className:"w-[400px] p-6 text-slate-300",children:[jsxs("div",{className:"mb-6 flex justify-between",children:[jsxs("h1",{className:"text-xl font-bold",children:["Create ",df]}),jsx("button",{className:"flex size-8 items-center justify-center rounded-md bg-gray-100 text-gray-500 outline-none hover:text-gray-900",onClick:ff,tabIndex:-1,children:jsx(_e$1,{name:"XmarkLight",size:24})})]}),jsx(jC,{inputs:mc}),uf,jsxs("div",{className:"mt-8 flex justify-between gap-3",children:[jsx("button",{className:Ne$1(pf,"flex-1 bg-slate-50 text-slate-800"),onClick:ff,children:"Cancel"}),jsx("button",{className:Ne$1(pf,"flex-1 bg-gray-800 text-gray-50"),onClick:hf,children:"Save"})]})]})})}),GC=memo(function(vo){const{tableName:Ai,dependentItemProps:bo,onOpenChange:Ra,open:hc}=vo,pc=jn$2[Ai].toLowerCase(),mc=useCallback(()=>{Ra==null||Ra(!1)},[Ra]);return jsx(cd,{contentProps:{className:"rounded-3xl"},onOpenChange:Ra,open:hc,overlayProps:{className:"top-10"},children:jsxs("div",{className:"w-[400px] p-6 text-slate-300",children:[jsxs("div",{className:"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800",children:["Cannot delete ",Ai]}),jsxs("div",{className:"my-6 flex gap-2 rounded-md bg-orange-100 p-4 text-orange-800",children:[jsx("div",{children:jsx(_e$1,{className:"mt-1 text-orange-800",name:"Error"})}),jsxs("div",{children:["Warning! Cannot delete this ",pc," because there are items that depend on it. Please change or delete those first."]})]}),jsx("div",{className:"my-6 rounded-md bg-slate-50 p-4 text-slate-200",children:bo.map(({dependentTableName:uf,dependentItems:df})=>jsxs("div",{children:[jsx("div",{className:"mb-0.5 font-semibold",children:`${jn$2[uf]}s: `},1),df.map(({id:ff,label:hf})=>jsx("div",{children:hf},ff))]},uf))}),jsx("div",{className:"mt-8 flex justify-between gap-3",children:jsx("button",{className:"min-h-12 min-w-36 flex-1 rounded-xl bg-gray-800 px-6 py-3 text-base font-semibold text-gray-50 outline-none transition-all hover:scale-105 active:opacity-75",onClick:mc,children:"Back"})})]})})}),qC={createItem:YC,deleteItem:GC},Wd=y__default.createContext({showModal:()=>{},closeModal:()=>{}}),Bd=()=>useContext(Wd),XC=vo=>{const{children:Ai}=vo,[bo,Ra]=useState(),[hc,pc]=useState(),[mc,uf]=useState(!1),df=useCallback((mf,gf)=>{uf(!0),Ra(gf),pc(mf)},[]),ff=useCallback(()=>{uf(!1)},[]),hf=hc?qC[hc]:null,pf=useMemo(()=>({showModal:df,closeModal:ff}),[ff,df]);return jsxs(Wd.Provider,{value:pf,children:[Ai,hf?jsx(hf,{...bo,onOpenChange:uf,open:mc}):null]})};var Mi="Tabs",[KC,S1]=Wt$2(Mi,[co$1]),zd=co$1(),[ZC,Ni]=KC(Mi),jd=y$2.forwardRef((vo,Ai)=>{const{__scopeTabs:bo,value:Ra,onValueChange:hc,defaultValue:pc,orientation:mc="horizontal",dir:uf,activationMode:df="automatic",...ff}=vo,hf=ei(uf),[pf,mf]=Qn$2({prop:Ra,onChange:hc,defaultProp:pc});return jsx(ZC,{scope:bo,baseId:Ft$2(),value:pf,onValueChange:mf,orientation:mc,dir:hf,activationMode:df,children:jsx(we$1.div,{dir:hf,"data-orientation":mc,...ff,ref:Ai})})});jd.displayName=Mi;var Yd="TabsList",Gd=y$2.forwardRef((vo,Ai)=>{const{__scopeTabs:bo,loop:Ra=!0,...hc}=vo,pc=Ni(Yd,bo),mc=zd(bo);return jsx(ou,{asChild:!0,...mc,orientation:pc.orientation,dir:pc.dir,loop:Ra,children:jsx(we$1.div,{role:"tablist","aria-orientation":pc.orientation,...hc,ref:Ai})})});Gd.displayName=Yd;var qd="TabsTrigger",Xd=y$2.forwardRef((vo,Ai)=>{const{__scopeTabs:bo,value:Ra,disabled:hc=!1,...pc}=vo,mc=Ni(qd,bo),uf=zd(bo),df=Qd(mc.baseId,Ra),ff=Jd(mc.baseId,Ra),hf=Ra===mc.value;return jsx(au,{asChild:!0,...uf,focusable:!hc,active:hf,children:jsx(we$1.button,{type:"button",role:"tab","aria-selected":hf,"aria-controls":ff,"data-state":hf?"active":"inactive","data-disabled":hc?"":void 0,disabled:hc,id:df,...pc,ref:Ai,onMouseDown:re$2(vo.onMouseDown,pf=>{!hc&&pf.button===0&&pf.ctrlKey===!1?mc.onValueChange(Ra):pf.preventDefault()}),onKeyDown:re$2(vo.onKeyDown,pf=>{[" ","Enter"].includes(pf.key)&&mc.onValueChange(Ra)}),onFocus:re$2(vo.onFocus,()=>{const pf=mc.activationMode!=="manual";!hf&&!hc&&pf&&mc.onValueChange(Ra)})})})});Xd.displayName=qd;var Kd="TabsContent",Zd=y$2.forwardRef((vo,Ai)=>{const{__scopeTabs:bo,value:Ra,forceMount:hc,children:pc,...mc}=vo,uf=Ni(Kd,bo),df=Qd(uf.baseId,Ra),ff=Jd(uf.baseId,Ra),hf=Ra===uf.value,pf=y$2.useRef(hf);return y$2.useEffect(()=>{const mf=requestAnimationFrame(()=>pf.current=!1);return()=>cancelAnimationFrame(mf)},[]),jsx(it$1,{present:hc||hf,children:({present:mf})=>jsx(we$1.div,{"data-state":hf?"active":"inactive","data-orientation":uf.orientation,role:"tabpanel","aria-labelledby":df,hidden:!mf,id:ff,tabIndex:0,...mc,ref:Ai,style:{...vo.style,animationDuration:pf.current?"0s":void 0},children:mf&&pc})})});Zd.displayName=Kd;function Qd(vo,Ai){return`${vo}-trigger-${Ai}`}function Jd(vo,Ai){return`${vo}-content-${Ai}`}var QC=jd,JC=Gd,eI=Xd,ia=Zd;function ef(vo){const{label:Ai,description:bo,children:Ra}=vo;return jsxs("div",{children:[jsx("h1",{className:"mb-2 text-lg font-bold",children:Ai}),jsx("p",{className:"mb-4 text-xs text-gray-600",children:bo}),Ra]})}const Br$2=forwardRef(function(vo,Ai){const{children:bo,className:Ra,...hc}=vo;return jsx("tr",{...hc,className:Ne$1("odd:bg-white even:bg-gray-50",Ra),ref:Ai,children:bo})}),Ye$2=vo=>jsx("td",{...vo,className:Ne$1("truncate border-l border-gray-300 px-3 py-2 text-xs font-medium text-gray-900 first:border-l-0",vo.className)});function tI(vo){return jsx(Ye$2,{className:"w-4",children:vo.itemNumber})}function nI(vo){const{isSelected:Ai,tableName:bo,tableItem:Ra}=vo,{viewItem:hc,clearSelected:pc}=tt$2(),mc=useCallback(()=>{if(Ai){pc();return}hc(Ra,bo)},[pc,Ai,Ra,bo,hc]);return jsx(Ye$2,{className:"w-4",children:jsx("button",{className:"flex size-full items-center justify-center",onClick:mc,children:jsx(_e$1,{className:Ne$1("text-gray-600",Ai&&"rotate-180"),name:"CaretDown",size:16})})})}/**
|
|
67
|
-
* natural-orderby v4.0.0
|
|
68
|
-
*
|
|
69
|
-
* Copyright (c) Olaf Ennen
|
|
70
|
-
*
|
|
71
|
-
* This source code is licensed under the MIT license found in the
|
|
72
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
73
|
-
*
|
|
74
|
-
* @license MIT
|
|
75
|
-
*/var tf=function(vo,Ai){return vo<Ai?-1:vo>Ai?1:0},rI=function(vo,Ai){var bo=vo.localeCompare(Ai);return bo?bo/Math.abs(bo):0},oI=/(^0x[\da-fA-F]+$|^([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?!\.\d+)(?=\D|\s|$))|\d+)/g,nf=/^\s+|\s+$/g,aI=/\s+/g,iI=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/,sI=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[/-]\d{1,4}[/-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,cI=/^0+[1-9]{1}[0-9]*$/,lI=/[^\x00-\x80]/,lc=function(vo,Ai){return vo<Ai?-1:vo>Ai?1:0},uI=function(vo,Ai){for(var bo=vo.length,Ra=Ai.length,hc=Math.min(bo,Ra),pc=0;pc<hc;pc++){var mc=vo[pc],uf=Ai[pc];if(mc.normalizedString!==uf.normalizedString){if(mc.normalizedString===""!=(uf.normalizedString===""))return mc.normalizedString===""?-1:1;if(mc.parsedNumber!==void 0&&uf.parsedNumber!==void 0){var df=tf(mc.parsedNumber,uf.parsedNumber);return df===0?lc(mc.normalizedString,uf.normalizedString):df}else return mc.parsedNumber!==void 0||uf.parsedNumber!==void 0?mc.parsedNumber!==void 0?-1:1:lI.test(mc.normalizedString+uf.normalizedString)?rI(mc.normalizedString,uf.normalizedString):lc(mc.normalizedString,uf.normalizedString)}}return bo>hc||Ra>hc?bo<=hc?-1:1:0},dI=function(vo,Ai){return(vo.chunks?!Ai.chunks:Ai.chunks)?vo.chunks?-1:1:(vo.isNaN?!Ai.isNaN:Ai.isNaN)?vo.isNaN?-1:1:(vo.isSymbol?!Ai.isSymbol:Ai.isSymbol)?vo.isSymbol?-1:1:(vo.isObject?!Ai.isObject:Ai.isObject)?vo.isObject?-1:1:(vo.isArray?!Ai.isArray:Ai.isArray)?vo.isArray?-1:1:(vo.isFunction?!Ai.isFunction:Ai.isFunction)?vo.isFunction?-1:1:(vo.isNull?!Ai.isNull:Ai.isNull)?vo.isNull?-1:1:0},fI=function(vo,Ai){return vo.value===Ai.value?0:vo.parsedNumber!==void 0&&Ai.parsedNumber!==void 0?tf(vo.parsedNumber,Ai.parsedNumber):vo.chunks&&Ai.chunks?uI(vo.chunks,Ai.chunks):dI(vo,Ai)},mI=function(vo){return vo.replace(aI," ").replace(nf,"")},rf=function(vo){if(vo.length!==0){var Ai=Number(vo);if(!Number.isNaN(Ai))return Ai}},pI=function(vo,Ai,bo){if(iI.test(vo)&&(!cI.test(vo)||Ai===0||bo[Ai-1]!=="."))return rf(vo)||0},hI=function(vo,Ai,bo){return{parsedNumber:pI(vo,Ai,bo),normalizedString:mI(vo)}},gI=function(vo){return vo.replace(oI,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0")},vI=function(vo){var Ai=gI(vo).map(hI);return Ai},bI=function(vo){return typeof vo=="function"},uc=function(vo){return Number.isNaN(vo)||vo instanceof Number&&Number.isNaN(vo.valueOf())},yI=function(vo){return vo===null},wI=function(vo){return vo!==null&&typeof vo=="object"&&!Array.isArray(vo)&&!(vo instanceof Number)&&!(vo instanceof String)&&!(vo instanceof Boolean)&&!(vo instanceof Date)},xI=function(vo){return typeof vo=="symbol"},SI=function(vo){return vo===void 0},CI=function(vo){try{var Ai=Date.parse(vo);return!Number.isNaN(Ai)&&sI.test(vo)?Ai:void 0}catch{return}},II=function(vo){var Ai=rf(vo);return Ai!==void 0?Ai:CI(vo)},EI=function(vo){return typeof vo=="boolean"||vo instanceof Boolean?Number(vo).toString():typeof vo=="number"||vo instanceof Number?vo.toString():vo instanceof Date?vo.getTime().toString():typeof vo=="string"||vo instanceof String?vo.toLowerCase().replace(nf,""):""},PI=function(vo){if(typeof vo=="string"||vo instanceof String||(typeof vo=="number"||vo instanceof Number)&&!uc(vo)||typeof vo=="boolean"||vo instanceof Boolean||vo instanceof Date){var Ai=EI(vo),bo=II(Ai),Ra=vI(bo?""+bo:Ai);return{parsedNumber:bo,chunks:Ra,value:vo}}return{isArray:Array.isArray(vo),isFunction:bI(vo),isNaN:uc(vo),isNull:yI(vo),isObject:wI(vo),isSymbol:xI(vo),isUndefined:SI(vo),value:vo}},TI=function(vo,Ai,bo){for(var Ra=vo.index,hc=vo.values,pc=Ai.index,mc=Ai.values,uf=hc.length,df=bo.length,ff=0;ff<uf;ff++){var hf=ff<df?bo[ff]:null;if(hf&&typeof hf=="function"){var pf=hf(hc[ff].value,mc[ff].value);if(pf)return pf}else{var mf=fI(hc[ff],mc[ff]);if(mf)return mf*(hf==="desc"?-1:1)}}return Ra-pc},OI=function(vo){return typeof vo=="function"?vo:function(Ai){if(Array.isArray(Ai)){var bo=Number(vo);if(Number.isInteger(bo))return Ai[bo]}else if(Ai&&typeof Ai=="object"){var Ra=Object.getOwnPropertyDescriptor(Ai,vo);return Ra==null?void 0:Ra.value}return Ai}},MI=function(vo,Ai){return vo[Ai]},NI=function(vo,Ai){return Ai(vo)},AI=function(vo,Ai,bo){var Ra=Ai.length?Ai.map(OI):[function(pc){return pc}],hc=vo.map(function(pc,mc){var uf=Ra.map(function(df){return NI(pc,df)}).map(PI);return{index:mc,values:uf}});return hc.sort(function(pc,mc){return TI(pc,mc,bo)}),hc.map(function(pc){return MI(vo,pc.index)})},DI=function(vo){if(!vo)return[];var Ai=Array.isArray(vo)?[].concat(vo):[vo];return Ai.some(function(bo){return typeof bo!="string"&&typeof bo!="number"&&typeof bo!="function"})?[]:Ai},RI=function(vo){if(!vo)return[];var Ai=Array.isArray(vo)?[].concat(vo):[vo];return Ai.some(function(bo){return bo!=="asc"&&bo!=="desc"&&typeof bo!="function"})?[]:Ai};function _I(vo,Ai,bo){if(!vo||!Array.isArray(vo))return[];var Ra=DI(Ai),hc=RI(bo);return AI(vo,Ra,hc)}function kI(vo){const[Ai,bo]=useState(vo),[Ra,hc]=useState(),[pc,mc]=useState("asc"),uf=useCallback((df,ff)=>{hc(df),mc(ff)},[]);return useEffect(()=>{if(vo){if(!Ra){bo(vo);return}bo(_I(vo,[Ra],[pc]))}},[Ra,pc,vo,uf]),useMemo(()=>({sortedItems:Ai,sortHandler:uf}),[Ai,uf])}function of(vo){const Ai=tt$2(),bo=useMemo(()=>Aa(vo,Ai),[Ai,vo]),{sortedItems:Ra,sortHandler:hc}=kI(bo);return useMemo(()=>({tableData:Ra??[],sortHandler:hc}),[Ra,hc])}const FI={ASSET:[{key:"name",label:"Name",allowSorting:!0},{key:"purchaseDate",label:"Purchase Date",allowSorting:!0},{key:"maturity",label:"Maturity",allowSorting:!0,displayTime:!1},{key:"notional",label:"Notional",allowSorting:!0,isNumberColumn:!0},{key:"currentValue",label:"Current Value",allowSorting:!0,isNumberColumn:!0},{key:"purchasePrice",label:"Purchase Price",allowSorting:!0,isNumberColumn:!0,decimalScale:6},{key:"purchaseProceeds",label:"Purchase Proceeds",allowSorting:!0,isNumberColumn:!0},{key:"salesProceeds",label:"Sales Proceeds",allowSorting:!0,isNumberColumn:!0},{key:"totalDiscount",label:"Total Discount",allowSorting:!0,isNumberColumn:!0},{key:"realizedSurplus",label:"Realized Surplus",allowSorting:!0,isNumberColumn:!0}],TRANSACTION:[{key:"typeLabel",label:"Type",allowSorting:!0},{key:"entryTime",label:"Entry Time",allowSorting:!0},{key:"asset",label:"Asset",allowSorting:!0},{key:"quantity",label:"Quantity",allowSorting:!0,isNumberColumn:!0},{key:"cashAmount",label:"Cash Amount ($)",allowSorting:!0,isNumberColumn:!0},{key:"totalFees",label:"Total Fees ($)",allowSorting:!0,isNumberColumn:!0},{key:"cashBalanceChange",label:"Cash Balance Change ($)",allowSorting:!0,isNumberColumn:!0}],FIXED_INCOME_TYPE:[{key:"name",label:"Name",allowSorting:!0}],SPV:[{key:"name",label:"Name",allowSorting:!0}],SERVICE_PROVIDER_FEE_TYPE:[{key:"name",label:"Name",allowSorting:!0},{key:"feeType",label:"Fee Type",allowSorting:!0},{key:"accountName",label:"Account Name",allowSorting:!0},{key:"accountReference",label:"Account Reference",allowSorting:!0}],ACCOUNT:[{key:"label",label:"Label",allowSorting:!0},{key:"reference",label:"Reference",allowSorting:!0}]};function VI(vo){const{columnCountByTableWidth:Ai,tableContainerRef:bo,columns:Ra,hasItemNumberColumn:hc=!0,hasMoreDetailsColumn:pc=!0}=vo,[mc,uf]=useState(0),df=useMemo(()=>hc?{key:"itemNumber",label:"#",allowSorting:!0,isSpecialColumn:!0}:void 0,[hc]),ff=useMemo(()=>pc?{key:"moreDetails",label:"",isSpecialColumn:!0}:void 0,[pc]),[hf,pf]=useState([]),mf=useCallback(()=>{var yf;(yf=bo.current)!=null&&yf.parentElement&&uf(bo.current.parentElement.offsetWidth)},[bo]),gf=useCallback(()=>{const yf=LI(mc,Ai),vf=(Ra==null?void 0:Ra.slice(0,yf))??[];pf([df,...vf,ff].filter(Boolean))},[mc,Ra,Ai,df,ff]);return useEffect(()=>(mf(),window.addEventListener("resize",mf),()=>window.removeEventListener("resize",mf)),[mf]),useEffect(()=>{gf()},[gf,mc]),useMemo(()=>hf,[hf])}function LI(vo,Ai){let bo=1520,Ra=1/0;return Object.keys(Ai).forEach(hc=>{const pc=parseInt(hc),mc=Math.abs(vo-pc);mc<Ra&&(Ra=mc,bo=parseInt(hc))}),Ai[bo]}const af=34,sf=42,$I=20,UI=af*$I+sf;function HI(vo){var Ai,bo;const{selectedItemNumber:Ra,tableContainerRef:hc,rowRefs:pc,headerRef:mc,hasSpecialLastRow:uf=!1}=vo,[df,ff]=useState(`${UI}px`),hf=Ra?Ra-1+(uf?1:0):void 0,pf=((Ai=pc.current[1])==null?void 0:Ai.offsetHeight)??af,mf=((bo=mc.current)==null?void 0:bo.offsetHeight)??sf,gf=useCallback(()=>{var yf,vf;if(hf===void 0){const xf=pf*20+mf;ff(`${xf}px`);return}const bf=(yf=hc.current)==null?void 0:yf.getBoundingClientRect(),Sf=(vf=pc.current[hf])==null?void 0:vf.getBoundingClientRect();if(Sf&&bf){const xf=Sf.bottom,wf=bf.top,s1=xf-wf;ff(`${s1}px`)}},[mf,pf,pc,hf,hc]);return useEffect(()=>{gf()},[gf]),useEffect(()=>{const yf=()=>{gf()},vf=hc.current;return vf&&vf.addEventListener("scroll",yf),()=>{vf&&vf.removeEventListener("scroll",yf)}},[hc,gf]),df}const WI=forwardRef(function(vo,Ai){const{children:bo,tableData:Ra,columns:hc,footer:pc,renderRow:mc,onClickSort:uf,specialFirstRow:df,specialLastRow:ff,maxHeight:hf,headerRef:pf,hasSelectedItem:mf}=vo,[gf,yf]=useState(null),[vf,bf]=useState(null);return jsxs(Fragment,{children:[jsx("div",{className:Xr$1("relative rounded-lg border border-gray-300 bg-white",mf?"overflow-hidden":"overflow-scroll"),ref:Ai,style:{maxHeight:hf},children:jsxs("table",{className:"w-full",children:[jsx("thead",{className:"sticky top-0 isolate select-none text-nowrap border-b border-gray-300 bg-gray-100",ref:pf,children:jsx("tr",{children:hc.map(Sf=>jsx("th",{className:Ne$1("group border-l border-gray-300 py-3 pl-3 text-start text-xs font-medium text-gray-600 first:border-l-0",Sf.allowSorting&&"cursor-pointer hover:text-gray-900"),onClick:()=>{if(!Sf.allowSorting)return;let xf="asc";vf===Sf.key&&gf==="asc"&&(xf="desc"),yf(xf),bf(Sf.key),uf(Sf.key,xf)},children:jsxs("div",{className:Ne$1("group flex items-center",Sf.isNumberColumn&&"justify-end"),children:[Sf.label,Sf.allowSorting?jsx(_e$1,{className:Ne$1("invisible ml-1 rotate-90",vf===Sf.key&&"group-hover:visible",gf==="asc"&&"rotate-[270deg]"),name:"ArrowFilledRight",size:6}):null]})},Sf.key))})}),jsxs("tbody",{children:[bo,df==null?void 0:df(hc),Ra==null?void 0:Ra.map((Sf,xf)=>mc(Sf,hc,xf)),ff==null?void 0:ff(hc)]})]})}),pc]})});function cf(vo){const{tableName:Ai,tableData:bo,columnCountByTableWidth:Ra=qS,sortHandler:hc,specialFirstRow:pc,specialLastRow:mc}=vo,uf=FI[Ai],{operation:df,selectedTableItem:ff,isAllowedToCreateDocuments:hf,createItem:pf}=tt$2(),mf=useRef(null),gf=useRef([]),yf=useRef(null),vf=VI({columns:uf,columnCountByTableWidth:Ra,tableContainerRef:mf}),bf=HI({tableContainerRef:mf,rowRefs:gf,headerRef:yf,selectedItemNumber:ff==null?void 0:ff.itemNumber,hasSpecialLastRow:!!mc}),Sf=jn$2[Ai],xf=useCallback(()=>{pf(Ai)},[pf,Ai]),wf=useCallback((s1,If,l1)=>{const c1=(ff==null?void 0:ff.id)===s1.id;return jsx(Br$2,{ref:m1=>gf.current[l1]=m1,children:If.map(m1=>jsxs(Fragment,{children:[m1.key==="itemNumber"&&jsx(tI,{itemNumber:s1.itemNumber}),m1.key!=="itemNumber"&&m1.key!=="moreDetails"&&jsx(Ye$2,{className:m1.isNumberColumn?"text-right":"",children:pt$2(s1[m1.key],m1.decimalScale,m1.displayTime)},m1.key),m1.key==="moreDetails"&&jsx(nI,{isSelected:c1,tableItem:s1,tableName:Ai})]},m1.key))},s1.id)},[ff==null?void 0:ff.id,Ai]);return jsxs(Fragment,{children:[jsx(WI,{columns:vf,hasSelectedItem:!!ff,headerRef:yf,maxHeight:bf,onClickSort:hc,ref:mf,renderRow:wf,specialFirstRow:pc,specialLastRow:mc,tableData:bo}),hf&&!df?jsxs("button",{className:"mt-4 flex h-11 w-full items-center justify-center gap-x-2 rounded-lg border border-gray-300 bg-white text-sm font-semibold text-gray-900",onClick:xf,children:[jsxs("span",{children:["Create ",Sf]}),jsx(_e$1,{name:"Plus",size:14})]}):null]})}function BI(vo,Ai){const{fixedIncomes:bo,serviceProviderFeeTypes:Ra,transactions:hc}=tt$2();return useMemo(()=>{if(!Ai)return[];switch(vo){case"TRANSACTION":return[];case"SPV":return[{dependentTableName:"ASSET",dependentItems:dc(vo,Ai,bo)}];case"FIXED_INCOME_TYPE":return[{dependentTableName:"ASSET",dependentItems:dc(vo,Ai,bo)}];case"ASSET":return[{dependentTableName:"TRANSACTION",dependentItems:sa(vo,Ai,hc)}];case"SERVICE_PROVIDER_FEE_TYPE":return[{dependentTableName:"TRANSACTION",dependentItems:sa(vo,Ai,hc)}];case"ACCOUNT":return[{dependentTableName:"TRANSACTION",dependentItems:sa(vo,Ai,hc)},{dependentTableName:"SERVICE_PROVIDER_FEE_TYPE",dependentItems:zI(Ai,Ra)}]}},[bo,Ai,Ra,vo,hc])}function zI(vo,Ai){const bo=Ra=>({id:Ra.id,label:Ra.name});return Ai.filter(Ra=>Ra.accountId===vo).map(bo)}function dc(vo,Ai,bo){const Ra=hc=>({id:hc.id,label:hc.name});switch(vo){case"FIXED_INCOME_TYPE":return bo.filter(hc=>hc.fixedIncomeTypeId===Ai).map(Ra);case"SPV":return bo.filter(hc=>hc.spvId===Ai).map(Ra)}}function sa(vo,Ai,bo){const Ra=(hc,pc)=>({id:hc.id,label:`Transaction #${pc+1}`});switch(vo){case"ASSET":return bo.filter(hc=>{var pc;return((pc=hc.fixedIncomeTransaction)==null?void 0:pc.assetId)===Ai}).map(Ra);case"ACCOUNT":return bo.filter(hc=>{var pc;return hc.cashTransaction.accountId===Ai||((pc=hc.fixedIncomeTransaction)==null?void 0:pc.accountId)===Ai}).map(Ra);case"SERVICE_PROVIDER_FEE_TYPE":return bo.filter(hc=>{var pc;return(pc=hc.fees)==null?void 0:pc.some(mc=>mc.serviceProviderFeeTypeId===Ai)}).map(Ra)}}function jI(vo){const{inputs:Ai}=vo;return jsx("div",{className:"rounded-md bg-white text-xs font-medium",children:Ai.map(({label:bo,Input:Ra,inputLabel:hc},pc)=>jsxs("div",{className:Xr$1("grid min-h-11 grid-cols-[208px,380px] items-center px-6 text-gray-600 last:rounded-b-md",pc%2!==0&&"bg-gray-50"),children:[jsx("div",{children:bo}),jsxs("div",{className:"h-max py-2 text-gray-900",children:[jsx(Ra,{}),hc?jsx("div",{className:"text-left text-gray-500",children:hc}):null]},pc)]},bo))})}const lf=memo(function(vo){const{tableName:Ai}=vo,{showModal:bo,closeModal:Ra}=Bd(),{selectedTableItem:hc,operation:pc,viewItem:mc,editItem:uf,clearSelected:df,handleAction:ff,isAllowedToCreateDocuments:hf,isAllowedToEditDocuments:pf,principalLenderAccountId:mf}=tt$2(),gf=BI(Ai,hc==null?void 0:hc.id),yf=gf.some(M1=>M1.dependentItems.length>0),vf=pc==="edit",bf=pc==="create",Sf=pc==="view",xf=hf||pf,wf=!(Ai==="ACCOUNT"&&(hc==null?void 0:hc.id)===mf),s1=!Sf&&xf,If=!Sf&&xf,l1=vf&&pf&&wf,c1=Sf&&pf,m1=Sf,k1=jn$2[Ai],{submit:N1,reset:R1,formInputs:{inputs:$1,additionalInputs:D1}}=Hd({tableName:Ai,tableItem:hc,operation:pc}),f1=useCallback(()=>{R1(),df()},[df,R1]),T1=useCallback(()=>{if(pc==="edit"&&hc){mc(hc,Ai);return}f1()},[f1,pc,hc,Ai,mc]),A1=useCallback(()=>{!wf||!yf||bo("deleteItem",{tableName:Ai,dependentItemProps:gf})},[wf,yf,bo,Ai,gf]),L1=useCallback(()=>{if(!hc)return;if(yf){A1();return}const M1=`DELETE_${Ai}`;ff({type:M1,payload:hc}),df(),Ra()},[hc,yf,Ai,ff,df,Ra,A1]),B1=useCallback(()=>{hc&&uf(hc,Ai)},[hc,uf,Ai]),V1=jsx(hr$2,{className:"text-gray-600",onClick:f1,children:"Close"}),Z1=jsx(hr$2,{className:"text-gray-600",onClick:T1,children:"Cancel"}),H1=jsx(hr$2,{icon:jsx(_e$1,{name:"Save",size:16}),iconPosition:"right",onClick:N1,children:bf?"Save":"Save Edits"}),E1=jsx("button",{onClick:L1,children:jsx(_e$1,{className:"ml-3 text-red-800",name:"Trash",size:22})}),F1=jsxs(hr$2,{icon:jsx(_e$1,{name:"Pencil",size:16}),iconPosition:"right",onClick:B1,children:["Edit ",k1]});return jsxs("div",{className:"flex flex-col rounded-md border border-gray-300 bg-white",children:[jsxs("div",{className:"flex justify-between rounded-t-md border-b border-gray-300 bg-gray-100 p-3 font-semibold text-gray-800",children:[jsx("div",{className:"flex items-center",children:hc!=null&&hc.itemNumber?`${k1} #${hc.itemNumber}`:`New ${k1}`}),jsxs("div",{className:"flex gap-x-2",children:[s1?Z1:null,m1?V1:null,If?H1:null,l1?E1:null,c1?F1:null]})]}),jsx(jI,{inputs:$1}),D1]})});function kn$2(vo){const{tableName:Ai,specialFirstRow:bo,specialLastRow:Ra}=vo,{getIsFormOpen:hc}=tt$2(),pc=hc(Ai),{tableData:mc,sortHandler:uf}=of(Ai),df=mc.length>20,{pageItems:ff,pages:hf,goToPage:pf,goToNextPage:mf,goToPreviousPage:gf,goToFirstPage:yf,goToLastPage:vf,hiddenNextPages:bf,isNextPageAvailable:Sf,isPreviousPageAvailable:xf}=ld(mc);return jsxs(Fragment,{children:[jsx("div",{className:"mb-2 flex w-full justify-end",children:df?jsx(Sd,{goToFirstPage:yf,goToLastPage:vf,goToNextPage:mf,goToPage:pf,goToPreviousPage:gf,hiddenNextPages:bf,isNextPageAvailable:Sf,isPreviousPageAvailable:xf,nextPageLabel:"Next",pages:hf,previousPageLabel:"Previous"}):null}),jsx(cf,{sortHandler:uf,specialFirstRow:bo,specialLastRow:Ra,tableData:ff,tableName:Ai}),pc?jsx("div",{className:"mt-4 rounded-md bg-white",children:jsx(lf,{tableName:Ai})}):null]})}function YI(){const vo=Ce$2.ASSET,{selectedTableItem:Ai,fixedIncomes:bo,cashAsset:Ra}=tt$2(),hc=useMemo(()=>({id:"special-first-row",name:"Cash $USD",fixedIncomeTypeId:"--",spvId:"--",maturity:"--",ISIN:"--",CUSIP:"--",coupon:null,notional:Ra.balance??0,purchaseDate:"--",purchasePrice:"--",purchaseProceeds:"--",salesProceeds:"--",totalDiscount:"--",realizedSurplus:"--",currentValue:"--"}),[Ra.balance]),pc=gr$2(bo,"purchaseProceeds"),mc=gr$2(bo,"salesProceeds"),uf=gr$2(bo,"totalDiscount"),df=gr$2(bo,"realizedSurplus"),ff=useCallback(pf=>jsx(Br$2,{children:pf.map(mf=>jsxs(Fragment$1,{children:[mf.key==="name"&&jsx(Ye$2,{children:"Cash $USD"}),mf.key==="notional"&&jsx(Ye$2,{className:"text-right",children:pt$2(hc[mf.key])},mf.key),mf.key!=="name"&&mf.key!=="notional"&&jsx(Ye$2,{})]},mf.key))}),[hc]),hf=useCallback(pf=>jsx(Br$2,{className:"sticky bottom-0",children:pf.map(mf=>jsxs(Fragment$1,{children:[mf.key==="name"&&jsx(Ye$2,{children:"Totals"}),mf.key==="purchaseProceeds"&&jsx(Ye$2,{className:"text-right",children:pt$2(pc)},mf.key),mf.key==="salesProceeds"&&jsx(Ye$2,{className:"text-right",children:pt$2(mc)},mf.key),mf.key==="totalDiscount"&&jsx(Ye$2,{className:"text-right",children:pt$2(uf)},mf.key),mf.key==="realizedSurplus"&&jsx(Ye$2,{className:"text-right",children:pt$2(df)},mf.key),mf.key!=="name"&&mf.key!=="purchaseProceeds"&&mf.key!=="salesProceeds"&&mf.key!=="totalDiscount"&&mf.key!=="realizedSurplus"&&jsx(Ye$2,{})]},mf.key))}),[Ai,pc,df,mc,uf]);return jsx(kn$2,{specialFirstRow:ff,specialLastRow:hf,tableName:vo})}function GI(){return jsx(ef,{description:"Details on the distribution of assets among different financial institutions or investment vehicles.",label:"Portfolio",children:jsx(YI,{})})}function qI(){const vo=Ce$2.TRANSACTION,{getIsFormOpen:Ai,fixedIncomes:bo}=tt$2(),Ra=Ai(vo),{tableData:hc,sortHandler:pc}=of(vo),[mc,uf]=useState(hc),[df,ff]=useState(),[hf,pf]=useState([]),mf=mc.length>20;useEffect(()=>{if(!df&&!hf.length){uf(hc);return}uf(hc.filter(R1=>{var $1,D1;if(df&&hf.length)return(($1=R1.fixedIncomeTransaction)==null?void 0:$1.assetId)===df&&hf.includes(R1.type);if(df)return((D1=R1.fixedIncomeTransaction)==null?void 0:D1.assetId)===df;if(hf.length)return hf.includes(R1.type)}))},[df,hf,hc]);const gf=useMemo(()=>bo.map(R1=>({label:Ud(R1),value:R1.id})),[bo]),yf=useMemo(()=>Ci.map(R1=>({label:Ii$1[R1],value:R1})),[]),{pageItems:vf,pages:bf,goToPage:Sf,goToNextPage:xf,goToPreviousPage:wf,goToFirstPage:s1,goToLastPage:If,hiddenNextPages:l1,isNextPageAvailable:c1,isPreviousPageAvailable:m1}=ld(mc),k1=useCallback(R1=>{if(!R1||typeof R1!="object"||!("value"in R1)){ff(void 0);return}const{value:$1}=R1;ff($1)},[]),N1=useCallback(R1=>{if(!R1||!Array.isArray(R1)){pf([]);return}pf(R1.map(({value:$1})=>$1))},[]);return jsxs(Fragment,{children:[jsxs("div",{className:"mb-2 flex gap-2",children:[jsx("div",{className:"min-w-72 max-w-96",children:jsx(Ca,{isClearable:!0,onChange:k1,options:gf,placeholder:"Filter by Asset"})}),jsx("div",{className:"min-w-72 max-w-96",children:jsx(Ca,{isClearable:!0,isMulti:!0,onChange:N1,options:yf,placeholder:"Filter by Type"})}),jsx("div",{className:"flex w-full justify-end",children:mf?jsx(Sd,{goToFirstPage:s1,goToLastPage:If,goToNextPage:xf,goToPage:Sf,goToPreviousPage:wf,hiddenNextPages:l1,isNextPageAvailable:c1,isPreviousPageAvailable:m1,nextPageLabel:"Next",pages:bf,previousPageLabel:"Previous"}):null})]}),jsx(cf,{sortHandler:pc,tableData:vf,tableName:vo}),Ra?jsx("div",{className:"mt-4 rounded-md bg-white",children:jsx(lf,{tableName:vo})}):null]})}function XI(){return jsx(ef,{description:"Details on the distribution of assets among different financial institutions or investment vehicles.",label:"Transactions",children:jsx(qI,{})})}function KI(){const{accounts:vo,principalLenderAccountId:Ai}=tt$2(),bo=vo.find(pc=>pc.id===Ai),Ra=useCallback(pc=>jsx(Br$2,{children:pc.map(mc=>jsx(Fragment,{children:mc.key==="label"?jsxs(Ye$2,{children:[bo==null?void 0:bo.label,jsxs("span",{className:"ml-2 inline-flex items-center gap-1 rounded bg-green-100 px-1 font-extralight",children:["Lender ",jsx(_e$1,{name:"CheckCircle",size:14})]})]}):jsx(Ye$2,{})},mc.key))}),[bo==null?void 0:bo.label]),hc=bo!=null&&bo.label?Ra:void 0;return jsx(kn$2,{specialFirstRow:hc,tableName:Ce$2.ACCOUNT})}function ZI(){return jsxs("div",{className:"grid grid-rows-4 gap-4",children:[jsxs("div",{children:[jsx("h2",{className:"mb-2 text-lg font-bold",children:"Accounts"}),jsx("p",{className:"mb-4 text-xs text-gray-600",children:"Add and manage accounts that can be associated with transactions and fees."}),jsx(KI,{})]}),jsxs("div",{children:[jsx("h2",{className:"mb-2 text-lg font-bold",children:"Fixed Income Types"}),jsx("p",{className:"mb-4 text-xs text-gray-600",children:"Add and manage fixed income asset types."}),jsx(kn$2,{tableName:Ce$2.FIXED_INCOME_TYPE})]}),jsxs("div",{children:[jsx("h2",{className:"mb-2 text-lg font-bold",children:"SPVs"}),jsx("p",{className:"mb-4 text-xs text-gray-600",children:"Add and manage special purpose vehicles (SPVs)."}),jsx(kn$2,{tableName:Ce$2.SPV})]}),jsxs("div",{children:[jsx("h2",{className:"mb-2 text-lg font-bold",children:"Service Provider Fee Types"}),jsx("p",{className:"mb-4 text-xs text-gray-600",children:"Add and manage service providers and their associated fee types."}),jsx(kn$2,{tableName:Ce$2.SERVICE_PROVIDER_FEE_TYPE})]})]})}function QI(){const vo=["Portfolio","Transactions","Other"],{onSwitchboardLinkClick:Ai,onExport:bo,onClose:Ra,onShowRevisionHistory:hc,clearSelected:pc}=tt$2(),mc=useCallback(()=>{pc()},[pc]);return jsxs(QC,{defaultValue:"Portfolio",onValueChange:mc,children:[jsxs("div",{className:"flex justify-between",children:[jsx(JC,{className:"flex gap-x-2 rounded-xl bg-slate-50 p-1 text-sm font-semibold text-gray-600 outline-none",children:vo.map(uf=>jsx(eI,{className:"data-[state='active']:tab-shadow data-disabled:cursor-not-allowed data-disabled:text-gray-400 h-7 w-32 rounded-lg transition duration-300 data-[state='active']:bg-gray-50 data-[state='active']:text-gray-900",value:uf,children:uf},uf))}),jsx(sw,{onClose:Ra,onExport:bo,onShowRevisionHistory:hc,onSwitchboardLinkClick:Ai})]}),jsxs("div",{className:"mt-3 rounded-md bg-slate-50 p-8",children:[jsx(ia,{value:"Portfolio",children:jsx(GI,{})}),jsx(ia,{value:"Transactions",children:jsx(XI,{})}),jsx(ia,{value:"Other",children:jsx(ZI,{})})]})]})}function C1(){return jsx(XC,{children:jsx(QI,{})})}const JI={cry:"😢",laughing:"😂",heart:"❤️",thumbsDown:"👎",thumbsUp:"👍"},e1=vo=>{const{imgUrl:Ai,userName:bo,isCurrentUser:Ra,...hc}=vo,{disabled:pc=!1}=hc,[mc,uf]=useState(!1),[df,ff]=useState(!1);return jsxs("div",{onMouseEnter:()=>uf(!0),onMouseLeave:()=>!df&&uf(!1),style:{display:"flex",gap:"2px",alignItems:"flex-end",flexDirection:Ra?"row-reverse":"row",marginLeft:Ra?"80px":"0px",marginRight:Ra?"0px":"80px"},children:[jsx(Om,{imgUrl:Ai,userName:bo}),jsxs(rw,{dir:"rtl",onOpenChange:hf=>{ff(hf),hf||uf(!1)},open:df,children:[jsx(Nm,{isCurrentUser:Ra,userName:bo,...hc}),jsx(ow,{asChild:!0,onClick:()=>ff(!0),children:jsx("div",{style:{fontSize:"26px",cursor:"pointer",visibility:!pc&&mc?"visible":"hidden"},children:"🫥"})}),jsx(aw,{side:"top",style:{fontSize:"26px",display:"flex",gap:"8px",backgroundColor:"white",padding:"8px",borderRadius:"8px",paddingTop:"2px",paddingBottom:"2px",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.1)"},children:Object.entries(JI).map(([hf,pf])=>jsx(iw,{onClick:()=>hc.onClickReaction?hc.onClickReaction({emoji:pf,type:hf,messageId:hc.id,reactedBy:[]}):null,style:{outline:"none",cursor:"pointer"},children:pf},hf))})]})]})},t1=()=>jsxs("svg",{className:"lucide lucide-send",fill:"none",height:"20",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"}),jsx("path",{d:"m21.854 2.147-10.94 10.939"})]}),n1=({onSendMessage:vo,disabled:Ai=!1})=>{const[bo,Ra]=useState(""),hc=()=>{vo(bo),Ra("")};return jsxs("div",{style:{backgroundColor:"#eeeef8",borderRadius:"8px",display:"flex",padding:"8px",paddingLeft:"16px",paddingRight:"16px",fontSize:"14px",gap:"8px"},children:[jsx("input",{disabled:Ai,onChange:pc=>Ra(pc.target.value),onKeyDown:pc=>{pc.key==="Enter"&&(pc.stopPropagation(),pc.preventDefault(),hc())},placeholder:"Type a message...",style:{backgroundColor:"transparent",display:"flex",flex:1,outline:"none"},type:"text",value:bo}),jsx("button",{disabled:Ai,onClick:hc,style:{color:"#434385",padding:"4px"},type:"button",children:jsx(t1,{})})]})},r1=()=>jsxs("svg",{fill:"none",height:"18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"18",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}),jsx("path",{d:"m15 5 4 4"})]}),o1=()=>jsxs("svg",{fill:"none",height:"18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"18",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M18 6 6 18"}),jsx("path",{d:"m6 6 12 12"})]}),fc=({label:vo,onSubmit:Ai,style:bo})=>{const[Ra,hc]=useState(!1),[pc,mc]=useState(!1),[uf,df]=useState(vo);return useEffect(()=>{df(vo)},[vo]),jsxs("div",{onMouseEnter:()=>hc(!0),onMouseLeave:()=>hc(!1),style:{display:"flex",alignItems:"center",gap:"8px"},children:[pc?jsx("input",{onChange:ff=>df(ff.target.value),onKeyDown:ff=>{ff.key==="Escape"&&(mc(!1),df(vo)),ff.key==="Enter"&&(ff.preventDefault(),ff.stopPropagation(),mc(!1),Ai==null||Ai(uf))},style:bo,type:"text",value:uf}):jsx("h1",{style:bo,children:uf}),Ra||pc?pc?jsx("div",{onClick:()=>{mc(!1),df(vo)},style:{cursor:"pointer"},children:jsx(o1,{})}):jsx("div",{onClick:()=>mc(!0),style:{cursor:"pointer"},children:jsx(r1,{})}):null]})},a1=({title:vo,description:Ai,onTitleSubmit:bo,onDescriptionSubmit:Ra})=>jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[jsx(fc,{label:vo,onSubmit:bo,style:{fontSize:"18px",fontWeight:"bold",margin:0}}),Ai?jsx(fc,{label:Ai,onSubmit:Ra,style:{minWidth:"200px",fontSize:"14px",color:"#666",margin:0}}):null]}),i1=vo=>{const{onSendMessage:Ai,title:bo,description:Ra,disabled:hc=!1,messages:pc=[],onSubmitTitle:mc,onSubmitDescription:uf,onClickReaction:df=()=>{}}=vo,ff=useRef(null);return useEffect(()=>{var hf,pf,mf,gf;const yf=((hf=ff.current)==null?void 0:hf.scrollHeight)||0,vf=((pf=ff.current)==null?void 0:pf.clientHeight)||0,bf=((mf=ff.current)==null?void 0:mf.scrollTop)||0;yf-(vf+100)<=bf&&((gf=ff.current)==null||gf.scrollTo({top:ff.current.scrollHeight,behavior:"smooth"}))},[pc,ff]),jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",flex:1},children:[jsx("div",{children:jsx(a1,{description:Ra,onDescriptionSubmit:uf,onTitleSubmit:mc,title:bo})}),jsx("div",{ref:ff,style:{display:"flex",flex:1,flexDirection:"column",gap:"8px",overflowY:"auto",marginTop:"20px",marginBottom:"20px"},children:pc.map(hf=>jsx(e1,{...hf,disabled:hc,onClickReaction:df},hf.id))}),hc?jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:jsx("span",{style:{padding:"8px",paddingTop:"4px",paddingBottom:"4px",minWidth:"200px",backgroundColor:"#f0f0f0",borderRadius:"8px"},children:"You need to login to start chatting ⚠️"})}):jsx("div",{children:jsx(n1,{onSendMessage:Ai})})]})};function I1(vo){const Ai=!vo.context.user,bo=vo.document.state.global.messages.map(ff=>{var hf;return{id:ff.id,message:ff.content||"",timestamp:ff.sentAt,userName:ff.sender.name||ff.sender.id,imgUrl:ff.sender.avatarUrl||void 0,isCurrentUser:ff.sender.id===((hf=vo.context.user)==null?void 0:hf.address),reactions:Tm(ff.reactions)}}),Ra=ff=>{var hf,pf,mf,gf,yf;vo.dispatch($$4.addMessage({messageId:index.hashKey(),content:ff,sender:{id:((hf=vo.context.user)==null?void 0:hf.address)||"anon-user",name:((mf=(pf=vo.context.user)==null?void 0:pf.ens)==null?void 0:mf.name)||null,avatarUrl:((yf=(gf=vo.context.user)==null?void 0:gf.ens)==null?void 0:yf.avatarUrl)||null},sentAt:new Date().toISOString()}))},hc=(ff,hf,pf)=>{vo.dispatch($$4.addEmojiReaction({messageId:ff,reactedBy:hf,type:pf}))},pc=(ff,hf,pf)=>{vo.dispatch($$4.removeEmojiReaction({messageId:ff,senderId:hf,type:pf}))},mc=ff=>{var hf,pf;const mf=bo.find(Sf=>Sf.id===ff.messageId);if(!mf)return;const gf=ff.messageId,yf=Pm(ff.type),vf=((hf=vo.context.user)==null?void 0:hf.address)||"anon-user",bf=(pf=mf.reactions)==null?void 0:pf.find(Sf=>Sf.type===ff.type);bf?(bf.reactedBy.includes(vf)?pc:hc)(gf,vf,yf):hc(gf,vf,yf)},uf=ff=>{vo.dispatch($$4.editChatName({name:ff}))},df=ff=>{vo.dispatch($$4.editChatDescription({description:ff}))};return jsx("div",{style:{height:"calc(100vh - 140px)"},children:jsx(i1,{description:vo.document.state.global.description||"This is a chat room demo",messages:bo,disabled:Ai,onClickReaction:mc,onSendMessage:Ra,onSubmitDescription:df,onSubmitTitle:uf,title:vo.document.state.global.name||"Chat Room Demo"})})}var e$2={},d$1;function s$4(){if(d$1)return e$2;d$1=1,Object.defineProperty(e$2,"__esModule",{value:!0}),e$2.lazyWithPreload=void 0;var vo=y__default;function Ai(bo){var Ra=(0,vo.lazy)(bo),hc,pc,mc=(0,vo.forwardRef)(function(df,ff){var hf=(0,vo.useRef)(hc??Ra);return(0,vo.createElement)(hf.current,Object.assign(ff?{ref:ff}:{},df))}),uf=mc;return uf.preload=function(){return pc||(pc=bo().then(function(df){return hc=df.default,hc})),pc},uf}return e$2.lazyWithPreload=Ai,e$2.default=Ai,e$2}var P$4=s$4();function devAssert$1(vo,Ai){if(!!!vo)throw new Error(Ai)}function isObjectLike$1(vo){return typeof vo=="object"&&vo!==null}function invariant$2(vo,Ai){if(!!!vo)throw new Error("Unexpected invariant triggered.")}const LineRegExp$1=/\r\n|[\n\r]/g;function getLocation$2(vo,Ai){let bo=0,Ra=1;for(const hc of vo.body.matchAll(LineRegExp$1)){if(typeof hc.index=="number"||invariant$2(!1),hc.index>=Ai)break;bo=hc.index+hc[0].length,Ra+=1}return{line:Ra,column:Ai+1-bo}}function printLocation$1(vo){return printSourceLocation$1(vo.source,getLocation$2(vo.source,vo.start))}function printSourceLocation$1(vo,Ai){const bo=vo.locationOffset.column-1,Ra="".padStart(bo)+vo.body,hc=Ai.line-1,pc=vo.locationOffset.line-1,mc=Ai.line+pc,uf=Ai.line===1?bo:0,df=Ai.column+uf,ff=`${vo.name}:${mc}:${df}
|
|
76
|
-
`,hf=Ra.split(/\r\n|[\n\r]/g),pf=hf[hc];if(pf.length>120){const mf=Math.floor(df/80),gf=df%80,yf=[];for(let vf=0;vf<pf.length;vf+=80)yf.push(pf.slice(vf,vf+80));return ff+printPrefixedLines$1([[`${mc} |`,yf[0]],...yf.slice(1,mf+1).map(vf=>["|",vf]),["|","^".padStart(gf)],["|",yf[mf+1]]])}return ff+printPrefixedLines$1([[`${mc-1} |`,hf[hc-1]],[`${mc} |`,pf],["|","^".padStart(df)],[`${mc+1} |`,hf[hc+1]]])}function printPrefixedLines$1(vo){const Ai=vo.filter(([Ra,hc])=>hc!==void 0),bo=Math.max(...Ai.map(([Ra])=>Ra.length));return Ai.map(([Ra,hc])=>Ra.padStart(bo)+(hc?" "+hc:"")).join(`
|
|
77
|
-
`)}function toNormalizedOptions$1(vo){const Ai=vo[0];return Ai==null||"kind"in Ai||"length"in Ai?{nodes:Ai,source:vo[1],positions:vo[2],path:vo[3],originalError:vo[4],extensions:vo[5]}:Ai}let GraphQLError$1=class IT extends Error{constructor(Ai,...bo){var Ra,hc,pc;const{nodes:mc,source:uf,positions:df,path:ff,originalError:hf,extensions:pf}=toNormalizedOptions$1(bo);super(Ai),this.name="GraphQLError",this.path=ff??void 0,this.originalError=hf??void 0,this.nodes=undefinedIfEmpty$1(Array.isArray(mc)?mc:mc?[mc]:void 0);const mf=undefinedIfEmpty$1((Ra=this.nodes)===null||Ra===void 0?void 0:Ra.map(yf=>yf.loc).filter(yf=>yf!=null));this.source=uf??(mf==null||(hc=mf[0])===null||hc===void 0?void 0:hc.source),this.positions=df??(mf==null?void 0:mf.map(yf=>yf.start)),this.locations=df&&uf?df.map(yf=>getLocation$2(uf,yf)):mf==null?void 0:mf.map(yf=>getLocation$2(yf.source,yf.start));const gf=isObjectLike$1(hf==null?void 0:hf.extensions)?hf==null?void 0:hf.extensions:void 0;this.extensions=(pc=pf??gf)!==null&&pc!==void 0?pc:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),hf!=null&&hf.stack?Object.defineProperty(this,"stack",{value:hf.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,IT):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let Ai=this.message;if(this.nodes)for(const bo of this.nodes)bo.loc&&(Ai+=`
|
|
78
|
-
|
|
79
|
-
`+printLocation$1(bo.loc));else if(this.source&&this.locations)for(const bo of this.locations)Ai+=`
|
|
80
|
-
|
|
81
|
-
`+printSourceLocation$1(this.source,bo);return Ai}toJSON(){const Ai={message:this.message};return this.locations!=null&&(Ai.locations=this.locations),this.path!=null&&(Ai.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(Ai.extensions=this.extensions),Ai}};function undefinedIfEmpty$1(vo){return vo===void 0||vo.length===0?void 0:vo}var Kind$1;(function(vo){vo.NAME="Name",vo.DOCUMENT="Document",vo.OPERATION_DEFINITION="OperationDefinition",vo.VARIABLE_DEFINITION="VariableDefinition",vo.SELECTION_SET="SelectionSet",vo.FIELD="Field",vo.ARGUMENT="Argument",vo.FRAGMENT_SPREAD="FragmentSpread",vo.INLINE_FRAGMENT="InlineFragment",vo.FRAGMENT_DEFINITION="FragmentDefinition",vo.VARIABLE="Variable",vo.INT="IntValue",vo.FLOAT="FloatValue",vo.STRING="StringValue",vo.BOOLEAN="BooleanValue",vo.NULL="NullValue",vo.ENUM="EnumValue",vo.LIST="ListValue",vo.OBJECT="ObjectValue",vo.OBJECT_FIELD="ObjectField",vo.DIRECTIVE="Directive",vo.NAMED_TYPE="NamedType",vo.LIST_TYPE="ListType",vo.NON_NULL_TYPE="NonNullType",vo.SCHEMA_DEFINITION="SchemaDefinition",vo.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",vo.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",vo.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",vo.FIELD_DEFINITION="FieldDefinition",vo.INPUT_VALUE_DEFINITION="InputValueDefinition",vo.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",vo.UNION_TYPE_DEFINITION="UnionTypeDefinition",vo.ENUM_TYPE_DEFINITION="EnumTypeDefinition",vo.ENUM_VALUE_DEFINITION="EnumValueDefinition",vo.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",vo.DIRECTIVE_DEFINITION="DirectiveDefinition",vo.SCHEMA_EXTENSION="SchemaExtension",vo.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",vo.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",vo.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",vo.UNION_TYPE_EXTENSION="UnionTypeExtension",vo.ENUM_TYPE_EXTENSION="EnumTypeExtension",vo.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(Kind$1||(Kind$1={}));function isDigit$2(vo){return vo>=48&&vo<=57}function isLetter$1(vo){return vo>=97&&vo<=122||vo>=65&&vo<=90}function isNameStart$1(vo){return isLetter$1(vo)||vo===95}function isNameContinue$1(vo){return isLetter$1(vo)||isDigit$2(vo)||vo===95}const MAX_ARRAY_LENGTH$1=10,MAX_RECURSIVE_DEPTH$1=2;function inspect$1(vo){return formatValue$1(vo,[])}function formatValue$1(vo,Ai){switch(typeof vo){case"string":return JSON.stringify(vo);case"function":return vo.name?`[function ${vo.name}]`:"[function]";case"object":return formatObjectValue$1(vo,Ai);default:return String(vo)}}function formatObjectValue$1(vo,Ai){if(vo===null)return"null";if(Ai.includes(vo))return"[Circular]";const bo=[...Ai,vo];if(isJSONable$1(vo)){const Ra=vo.toJSON();if(Ra!==vo)return typeof Ra=="string"?Ra:formatValue$1(Ra,bo)}else if(Array.isArray(vo))return formatArray$1(vo,bo);return formatObject$1(vo,bo)}function isJSONable$1(vo){return typeof vo.toJSON=="function"}function formatObject$1(vo,Ai){const bo=Object.entries(vo);return bo.length===0?"{}":Ai.length>MAX_RECURSIVE_DEPTH$1?"["+getObjectTag$1(vo)+"]":"{ "+bo.map(([hc,pc])=>hc+": "+formatValue$1(pc,Ai)).join(", ")+" }"}function formatArray$1(vo,Ai){if(vo.length===0)return"[]";if(Ai.length>MAX_RECURSIVE_DEPTH$1)return"[Array]";const bo=Math.min(MAX_ARRAY_LENGTH$1,vo.length),Ra=vo.length-bo,hc=[];for(let pc=0;pc<bo;++pc)hc.push(formatValue$1(vo[pc],Ai));return Ra===1?hc.push("... 1 more item"):Ra>1&&hc.push(`... ${Ra} more items`),"["+hc.join(", ")+"]"}function getObjectTag$1(vo){const Ai=Object.prototype.toString.call(vo).replace(/^\[object /,"").replace(/]$/,"");if(Ai==="Object"&&typeof vo.constructor=="function"){const bo=vo.constructor.name;if(typeof bo=="string"&&bo!=="")return bo}return Ai}function identityFunc$1(vo){return vo}function keyValMap$1(vo,Ai,bo){const Ra=Object.create(null);for(const hc of vo)Ra[Ai(hc)]=bo(hc);return Ra}function toObjMap$1(vo){if(vo==null)return Object.create(null);if(Object.getPrototypeOf(vo)===null)return vo;const Ai=Object.create(null);for(const[bo,Ra]of Object.entries(vo))Ai[bo]=Ra;return Ai}function valueFromASTUntyped$1(vo,Ai){switch(vo.kind){case Kind$1.NULL:return null;case Kind$1.INT:return parseInt(vo.value,10);case Kind$1.FLOAT:return parseFloat(vo.value);case Kind$1.STRING:case Kind$1.ENUM:case Kind$1.BOOLEAN:return vo.value;case Kind$1.LIST:return vo.values.map(bo=>valueFromASTUntyped$1(bo,Ai));case Kind$1.OBJECT:return keyValMap$1(vo.fields,bo=>bo.name.value,bo=>valueFromASTUntyped$1(bo.value,Ai));case Kind$1.VARIABLE:return Ai==null?void 0:Ai[vo.name.value]}}function assertName$1(vo){if(vo!=null||devAssert$1(!1,"Must provide name."),typeof vo=="string"||devAssert$1(!1,"Expected name to be a string."),vo.length===0)throw new GraphQLError$1("Expected name to be a non-empty string.");for(let Ai=1;Ai<vo.length;++Ai)if(!isNameContinue$1(vo.charCodeAt(Ai)))throw new GraphQLError$1(`Names must only contain [_a-zA-Z0-9] but "${vo}" does not.`);if(!isNameStart$1(vo.charCodeAt(0)))throw new GraphQLError$1(`Names must start with [_a-zA-Z] but "${vo}" does not.`);return vo}let GraphQLScalarType$1=class{constructor(Ai){var bo,Ra,hc,pc;const mc=(bo=Ai.parseValue)!==null&&bo!==void 0?bo:identityFunc$1;this.name=assertName$1(Ai.name),this.description=Ai.description,this.specifiedByURL=Ai.specifiedByURL,this.serialize=(Ra=Ai.serialize)!==null&&Ra!==void 0?Ra:identityFunc$1,this.parseValue=mc,this.parseLiteral=(hc=Ai.parseLiteral)!==null&&hc!==void 0?hc:(uf,df)=>mc(valueFromASTUntyped$1(uf,df)),this.extensions=toObjMap$1(Ai.extensions),this.astNode=Ai.astNode,this.extensionASTNodes=(pc=Ai.extensionASTNodes)!==null&&pc!==void 0?pc:[],Ai.specifiedByURL==null||typeof Ai.specifiedByURL=="string"||devAssert$1(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${inspect$1(Ai.specifiedByURL)}.`),Ai.serialize==null||typeof Ai.serialize=="function"||devAssert$1(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),Ai.parseLiteral&&(typeof Ai.parseValue=="function"&&typeof Ai.parseLiteral=="function"||devAssert$1(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};var util;(function(vo){vo.assertEqual=hc=>hc;function Ai(hc){}vo.assertIs=Ai;function bo(hc){throw new Error}vo.assertNever=bo,vo.arrayToEnum=hc=>{const pc={};for(const mc of hc)pc[mc]=mc;return pc},vo.getValidEnumValues=hc=>{const pc=vo.objectKeys(hc).filter(uf=>typeof hc[hc[uf]]!="number"),mc={};for(const uf of pc)mc[uf]=hc[uf];return vo.objectValues(mc)},vo.objectValues=hc=>vo.objectKeys(hc).map(function(pc){return hc[pc]}),vo.objectKeys=typeof Object.keys=="function"?hc=>Object.keys(hc):hc=>{const pc=[];for(const mc in hc)Object.prototype.hasOwnProperty.call(hc,mc)&&pc.push(mc);return pc},vo.find=(hc,pc)=>{for(const mc of hc)if(pc(mc))return mc},vo.isInteger=typeof Number.isInteger=="function"?hc=>Number.isInteger(hc):hc=>typeof hc=="number"&&isFinite(hc)&&Math.floor(hc)===hc;function Ra(hc,pc=" | "){return hc.map(mc=>typeof mc=="string"?`'${mc}'`:mc).join(pc)}vo.joinValues=Ra,vo.jsonStringifyReplacer=(hc,pc)=>typeof pc=="bigint"?pc.toString():pc})(util||(util={}));var objectUtil;(function(vo){vo.mergeShapes=(Ai,bo)=>({...Ai,...bo})})(objectUtil||(objectUtil={}));const ZodParsedType=util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=vo=>{switch(typeof vo){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(vo)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(vo)?ZodParsedType.array:vo===null?ZodParsedType.null:vo.then&&typeof vo.then=="function"&&vo.catch&&typeof vo.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&vo instanceof Map?ZodParsedType.map:typeof Set<"u"&&vo instanceof Set?ZodParsedType.set:typeof Date<"u"&&vo instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=vo=>JSON.stringify(vo,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{get errors(){return this.issues}constructor(Ai){super(),this.issues=[],this.addIssue=Ra=>{this.issues=[...this.issues,Ra]},this.addIssues=(Ra=[])=>{this.issues=[...this.issues,...Ra]};const bo=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,bo):this.__proto__=bo,this.name="ZodError",this.issues=Ai}format(Ai){const bo=Ai||function(pc){return pc.message},Ra={_errors:[]},hc=pc=>{for(const mc of pc.issues)if(mc.code==="invalid_union")mc.unionErrors.map(hc);else if(mc.code==="invalid_return_type")hc(mc.returnTypeError);else if(mc.code==="invalid_arguments")hc(mc.argumentsError);else if(mc.path.length===0)Ra._errors.push(bo(mc));else{let uf=Ra,df=0;for(;df<mc.path.length;){const ff=mc.path[df];df===mc.path.length-1?(uf[ff]=uf[ff]||{_errors:[]},uf[ff]._errors.push(bo(mc))):uf[ff]=uf[ff]||{_errors:[]},uf=uf[ff],df++}}};return hc(this),Ra}static assert(Ai){if(!(Ai instanceof ZodError))throw new Error(`Not a ZodError: ${Ai}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(Ai=bo=>bo.message){const bo={},Ra=[];for(const hc of this.issues)hc.path.length>0?(bo[hc.path[0]]=bo[hc.path[0]]||[],bo[hc.path[0]].push(Ai(hc))):Ra.push(Ai(hc));return{formErrors:Ra,fieldErrors:bo}}get formErrors(){return this.flatten()}}ZodError.create=vo=>new ZodError(vo);const errorMap=(vo,Ai)=>{let bo;switch(vo.code){case ZodIssueCode.invalid_type:vo.received===ZodParsedType.undefined?bo="Required":bo=`Expected ${vo.expected}, received ${vo.received}`;break;case ZodIssueCode.invalid_literal:bo=`Invalid literal value, expected ${JSON.stringify(vo.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:bo=`Unrecognized key(s) in object: ${util.joinValues(vo.keys,", ")}`;break;case ZodIssueCode.invalid_union:bo="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:bo=`Invalid discriminator value. Expected ${util.joinValues(vo.options)}`;break;case ZodIssueCode.invalid_enum_value:bo=`Invalid enum value. Expected ${util.joinValues(vo.options)}, received '${vo.received}'`;break;case ZodIssueCode.invalid_arguments:bo="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:bo="Invalid function return type";break;case ZodIssueCode.invalid_date:bo="Invalid date";break;case ZodIssueCode.invalid_string:typeof vo.validation=="object"?"includes"in vo.validation?(bo=`Invalid input: must include "${vo.validation.includes}"`,typeof vo.validation.position=="number"&&(bo=`${bo} at one or more positions greater than or equal to ${vo.validation.position}`)):"startsWith"in vo.validation?bo=`Invalid input: must start with "${vo.validation.startsWith}"`:"endsWith"in vo.validation?bo=`Invalid input: must end with "${vo.validation.endsWith}"`:util.assertNever(vo.validation):vo.validation!=="regex"?bo=`Invalid ${vo.validation}`:bo="Invalid";break;case ZodIssueCode.too_small:vo.type==="array"?bo=`Array must contain ${vo.exact?"exactly":vo.inclusive?"at least":"more than"} ${vo.minimum} element(s)`:vo.type==="string"?bo=`String must contain ${vo.exact?"exactly":vo.inclusive?"at least":"over"} ${vo.minimum} character(s)`:vo.type==="number"?bo=`Number must be ${vo.exact?"exactly equal to ":vo.inclusive?"greater than or equal to ":"greater than "}${vo.minimum}`:vo.type==="date"?bo=`Date must be ${vo.exact?"exactly equal to ":vo.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(vo.minimum))}`:bo="Invalid input";break;case ZodIssueCode.too_big:vo.type==="array"?bo=`Array must contain ${vo.exact?"exactly":vo.inclusive?"at most":"less than"} ${vo.maximum} element(s)`:vo.type==="string"?bo=`String must contain ${vo.exact?"exactly":vo.inclusive?"at most":"under"} ${vo.maximum} character(s)`:vo.type==="number"?bo=`Number must be ${vo.exact?"exactly":vo.inclusive?"less than or equal to":"less than"} ${vo.maximum}`:vo.type==="bigint"?bo=`BigInt must be ${vo.exact?"exactly":vo.inclusive?"less than or equal to":"less than"} ${vo.maximum}`:vo.type==="date"?bo=`Date must be ${vo.exact?"exactly":vo.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(vo.maximum))}`:bo="Invalid input";break;case ZodIssueCode.custom:bo="Invalid input";break;case ZodIssueCode.invalid_intersection_types:bo="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:bo=`Number must be a multiple of ${vo.multipleOf}`;break;case ZodIssueCode.not_finite:bo="Number must be finite";break;default:bo=Ai.defaultError,util.assertNever(vo)}return{message:bo}};let overrideErrorMap=errorMap;function setErrorMap(vo){overrideErrorMap=vo}function getErrorMap(){return overrideErrorMap}const makeIssue=vo=>{const{data:Ai,path:bo,errorMaps:Ra,issueData:hc}=vo,pc=[...bo,...hc.path||[]],mc={...hc,path:pc};if(hc.message!==void 0)return{...hc,path:pc,message:hc.message};let uf="";const df=Ra.filter(ff=>!!ff).slice().reverse();for(const ff of df)uf=ff(mc,{data:Ai,defaultError:uf}).message;return{...hc,path:pc,message:uf}},EMPTY_PATH=[];function addIssueToContext(vo,Ai){const bo=getErrorMap(),Ra=makeIssue({issueData:Ai,data:vo.data,path:vo.path,errorMaps:[vo.common.contextualErrorMap,vo.schemaErrorMap,bo,bo===errorMap?void 0:errorMap].filter(hc=>!!hc)});vo.common.issues.push(Ra)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(Ai,bo){const Ra=[];for(const hc of bo){if(hc.status==="aborted")return INVALID;hc.status==="dirty"&&Ai.dirty(),Ra.push(hc.value)}return{status:Ai.value,value:Ra}}static async mergeObjectAsync(Ai,bo){const Ra=[];for(const hc of bo){const pc=await hc.key,mc=await hc.value;Ra.push({key:pc,value:mc})}return ParseStatus.mergeObjectSync(Ai,Ra)}static mergeObjectSync(Ai,bo){const Ra={};for(const hc of bo){const{key:pc,value:mc}=hc;if(pc.status==="aborted"||mc.status==="aborted")return INVALID;pc.status==="dirty"&&Ai.dirty(),mc.status==="dirty"&&Ai.dirty(),pc.value!=="__proto__"&&(typeof mc.value<"u"||hc.alwaysSet)&&(Ra[pc.value]=mc.value)}return{status:Ai.value,value:Ra}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=vo=>({status:"dirty",value:vo}),OK=vo=>({status:"valid",value:vo}),isAborted=vo=>vo.status==="aborted",isDirty=vo=>vo.status==="dirty",isValid=vo=>vo.status==="valid",isAsync=vo=>typeof Promise<"u"&&vo instanceof Promise;function __classPrivateFieldGet(vo,Ai,bo,Ra){if(typeof Ai=="function"?vo!==Ai||!Ra:!Ai.has(vo))throw new TypeError("Cannot read private member from an object whose class did not declare it");return Ai.get(vo)}function __classPrivateFieldSet(vo,Ai,bo,Ra,hc){if(typeof Ai=="function"?vo!==Ai||!hc:!Ai.has(vo))throw new TypeError("Cannot write private member to an object whose class did not declare it");return Ai.set(vo,bo),bo}typeof SuppressedError=="function"&&SuppressedError;var errorUtil;(function(vo){vo.errToObj=Ai=>typeof Ai=="string"?{message:Ai}:Ai||{},vo.toString=Ai=>typeof Ai=="string"?Ai:Ai==null?void 0:Ai.message})(errorUtil||(errorUtil={}));var _ZodEnum_cache,_ZodNativeEnum_cache;class ParseInputLazyPath{constructor(Ai,bo,Ra,hc){this._cachedPath=[],this.parent=Ai,this.data=bo,this._path=Ra,this._key=hc}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(vo,Ai)=>{if(isValid(Ai))return{success:!0,data:Ai.value};if(!vo.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const bo=new ZodError(vo.common.issues);return this._error=bo,this._error}}};function processCreateParams(vo){if(!vo)return{};const{errorMap:Ai,invalid_type_error:bo,required_error:Ra,description:hc}=vo;if(Ai&&(bo||Ra))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return Ai?{errorMap:Ai,description:hc}:{errorMap:(mc,uf)=>{var df,ff;const{message:hf}=vo;return mc.code==="invalid_enum_value"?{message:hf??uf.defaultError}:typeof uf.data>"u"?{message:(df=hf??Ra)!==null&&df!==void 0?df:uf.defaultError}:mc.code!=="invalid_type"?{message:uf.defaultError}:{message:(ff=hf??bo)!==null&&ff!==void 0?ff:uf.defaultError}},description:hc}}class ZodType{get description(){return this._def.description}_getType(Ai){return getParsedType(Ai.data)}_getOrReturnCtx(Ai,bo){return bo||{common:Ai.parent.common,data:Ai.data,parsedType:getParsedType(Ai.data),schemaErrorMap:this._def.errorMap,path:Ai.path,parent:Ai.parent}}_processInputParams(Ai){return{status:new ParseStatus,ctx:{common:Ai.parent.common,data:Ai.data,parsedType:getParsedType(Ai.data),schemaErrorMap:this._def.errorMap,path:Ai.path,parent:Ai.parent}}}_parseSync(Ai){const bo=this._parse(Ai);if(isAsync(bo))throw new Error("Synchronous parse encountered promise.");return bo}_parseAsync(Ai){const bo=this._parse(Ai);return Promise.resolve(bo)}parse(Ai,bo){const Ra=this.safeParse(Ai,bo);if(Ra.success)return Ra.data;throw Ra.error}safeParse(Ai,bo){var Ra;const hc={common:{issues:[],async:(Ra=bo==null?void 0:bo.async)!==null&&Ra!==void 0?Ra:!1,contextualErrorMap:bo==null?void 0:bo.errorMap},path:(bo==null?void 0:bo.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:Ai,parsedType:getParsedType(Ai)},pc=this._parseSync({data:Ai,path:hc.path,parent:hc});return handleResult(hc,pc)}"~validate"(Ai){var bo,Ra;const hc={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:Ai,parsedType:getParsedType(Ai)};if(!this["~standard"].async)try{const pc=this._parseSync({data:Ai,path:[],parent:hc});return isValid(pc)?{value:pc.value}:{issues:hc.common.issues}}catch(pc){!((Ra=(bo=pc==null?void 0:pc.message)===null||bo===void 0?void 0:bo.toLowerCase())===null||Ra===void 0)&&Ra.includes("encountered")&&(this["~standard"].async=!0),hc.common={issues:[],async:!0}}return this._parseAsync({data:Ai,path:[],parent:hc}).then(pc=>isValid(pc)?{value:pc.value}:{issues:hc.common.issues})}async parseAsync(Ai,bo){const Ra=await this.safeParseAsync(Ai,bo);if(Ra.success)return Ra.data;throw Ra.error}async safeParseAsync(Ai,bo){const Ra={common:{issues:[],contextualErrorMap:bo==null?void 0:bo.errorMap,async:!0},path:(bo==null?void 0:bo.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:Ai,parsedType:getParsedType(Ai)},hc=this._parse({data:Ai,path:Ra.path,parent:Ra}),pc=await(isAsync(hc)?hc:Promise.resolve(hc));return handleResult(Ra,pc)}refine(Ai,bo){const Ra=hc=>typeof bo=="string"||typeof bo>"u"?{message:bo}:typeof bo=="function"?bo(hc):bo;return this._refinement((hc,pc)=>{const mc=Ai(hc),uf=()=>pc.addIssue({code:ZodIssueCode.custom,...Ra(hc)});return typeof Promise<"u"&&mc instanceof Promise?mc.then(df=>df?!0:(uf(),!1)):mc?!0:(uf(),!1)})}refinement(Ai,bo){return this._refinement((Ra,hc)=>Ai(Ra)?!0:(hc.addIssue(typeof bo=="function"?bo(Ra,hc):bo),!1))}_refinement(Ai){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:Ai}})}superRefine(Ai){return this._refinement(Ai)}constructor(Ai){this.spa=this.safeParseAsync,this._def=Ai,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:bo=>this["~validate"](bo)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(Ai){return ZodUnion.create([this,Ai],this._def)}and(Ai){return ZodIntersection.create(this,Ai,this._def)}transform(Ai){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:Ai}})}default(Ai){const bo=typeof Ai=="function"?Ai:()=>Ai;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:bo,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(Ai){const bo=typeof Ai=="function"?Ai:()=>Ai;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:bo,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(Ai){const bo=this.constructor;return new bo({...this._def,description:Ai})}pipe(Ai){return ZodPipeline.create(this,Ai)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,jwtRegex=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(?:(?: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])$/,ipv4CidrRegex=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,ipv6Regex=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ipv6CidrRegex=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64urlRegex=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dateRegexSource="((\\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])))",dateRegex=new RegExp(`^${dateRegexSource}$`);function timeRegexSource(vo){let Ai="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return vo.precision?Ai=`${Ai}\\.\\d{${vo.precision}}`:vo.precision==null&&(Ai=`${Ai}(\\.\\d+)?`),Ai}function timeRegex(vo){return new RegExp(`^${timeRegexSource(vo)}$`)}function datetimeRegex(vo){let Ai=`${dateRegexSource}T${timeRegexSource(vo)}`;const bo=[];return bo.push(vo.local?"Z?":"Z"),vo.offset&&bo.push("([+-]\\d{2}:?\\d{2})"),Ai=`${Ai}(${bo.join("|")})`,new RegExp(`^${Ai}$`)}function isValidIP(vo,Ai){return!!((Ai==="v4"||!Ai)&&ipv4Regex.test(vo)||(Ai==="v6"||!Ai)&&ipv6Regex.test(vo))}function isValidJWT(vo,Ai){if(!jwtRegex.test(vo))return!1;try{const[bo]=vo.split("."),Ra=bo.replace(/-/g,"+").replace(/_/g,"/").padEnd(bo.length+(4-bo.length%4)%4,"="),hc=JSON.parse(atob(Ra));return!(typeof hc!="object"||hc===null||!hc.typ||!hc.alg||Ai&&hc.alg!==Ai)}catch{return!1}}function isValidCidr(vo,Ai){return!!((Ai==="v4"||!Ai)&&ipv4CidrRegex.test(vo)||(Ai==="v6"||!Ai)&&ipv6CidrRegex.test(vo))}class ZodString extends ZodType{_parse(Ai){if(this._def.coerce&&(Ai.data=String(Ai.data)),this._getType(Ai)!==ZodParsedType.string){const pc=this._getOrReturnCtx(Ai);return addIssueToContext(pc,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:pc.parsedType}),INVALID}const Ra=new ParseStatus;let hc;for(const pc of this._def.checks)if(pc.kind==="min")Ai.data.length<pc.value&&(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{code:ZodIssueCode.too_small,minimum:pc.value,type:"string",inclusive:!0,exact:!1,message:pc.message}),Ra.dirty());else if(pc.kind==="max")Ai.data.length>pc.value&&(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{code:ZodIssueCode.too_big,maximum:pc.value,type:"string",inclusive:!0,exact:!1,message:pc.message}),Ra.dirty());else if(pc.kind==="length"){const mc=Ai.data.length>pc.value,uf=Ai.data.length<pc.value;(mc||uf)&&(hc=this._getOrReturnCtx(Ai,hc),mc?addIssueToContext(hc,{code:ZodIssueCode.too_big,maximum:pc.value,type:"string",inclusive:!0,exact:!0,message:pc.message}):uf&&addIssueToContext(hc,{code:ZodIssueCode.too_small,minimum:pc.value,type:"string",inclusive:!0,exact:!0,message:pc.message}),Ra.dirty())}else if(pc.kind==="email")emailRegex.test(Ai.data)||(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{validation:"email",code:ZodIssueCode.invalid_string,message:pc.message}),Ra.dirty());else if(pc.kind==="emoji")emojiRegex||(emojiRegex=new RegExp(_emojiRegex,"u")),emojiRegex.test(Ai.data)||(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{validation:"emoji",code:ZodIssueCode.invalid_string,message:pc.message}),Ra.dirty());else if(pc.kind==="uuid")uuidRegex.test(Ai.data)||(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{validation:"uuid",code:ZodIssueCode.invalid_string,message:pc.message}),Ra.dirty());else if(pc.kind==="nanoid")nanoidRegex.test(Ai.data)||(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{validation:"nanoid",code:ZodIssueCode.invalid_string,message:pc.message}),Ra.dirty());else if(pc.kind==="cuid")cuidRegex.test(Ai.data)||(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{validation:"cuid",code:ZodIssueCode.invalid_string,message:pc.message}),Ra.dirty());else if(pc.kind==="cuid2")cuid2Regex.test(Ai.data)||(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{validation:"cuid2",code:ZodIssueCode.invalid_string,message:pc.message}),Ra.dirty());else if(pc.kind==="ulid")ulidRegex.test(Ai.data)||(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{validation:"ulid",code:ZodIssueCode.invalid_string,message:pc.message}),Ra.dirty());else if(pc.kind==="url")try{new URL(Ai.data)}catch{hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{validation:"url",code:ZodIssueCode.invalid_string,message:pc.message}),Ra.dirty()}else pc.kind==="regex"?(pc.regex.lastIndex=0,pc.regex.test(Ai.data)||(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{validation:"regex",code:ZodIssueCode.invalid_string,message:pc.message}),Ra.dirty())):pc.kind==="trim"?Ai.data=Ai.data.trim():pc.kind==="includes"?Ai.data.includes(pc.value,pc.position)||(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{code:ZodIssueCode.invalid_string,validation:{includes:pc.value,position:pc.position},message:pc.message}),Ra.dirty()):pc.kind==="toLowerCase"?Ai.data=Ai.data.toLowerCase():pc.kind==="toUpperCase"?Ai.data=Ai.data.toUpperCase():pc.kind==="startsWith"?Ai.data.startsWith(pc.value)||(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{code:ZodIssueCode.invalid_string,validation:{startsWith:pc.value},message:pc.message}),Ra.dirty()):pc.kind==="endsWith"?Ai.data.endsWith(pc.value)||(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{code:ZodIssueCode.invalid_string,validation:{endsWith:pc.value},message:pc.message}),Ra.dirty()):pc.kind==="datetime"?datetimeRegex(pc).test(Ai.data)||(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{code:ZodIssueCode.invalid_string,validation:"datetime",message:pc.message}),Ra.dirty()):pc.kind==="date"?dateRegex.test(Ai.data)||(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{code:ZodIssueCode.invalid_string,validation:"date",message:pc.message}),Ra.dirty()):pc.kind==="time"?timeRegex(pc).test(Ai.data)||(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{code:ZodIssueCode.invalid_string,validation:"time",message:pc.message}),Ra.dirty()):pc.kind==="duration"?durationRegex.test(Ai.data)||(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{validation:"duration",code:ZodIssueCode.invalid_string,message:pc.message}),Ra.dirty()):pc.kind==="ip"?isValidIP(Ai.data,pc.version)||(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{validation:"ip",code:ZodIssueCode.invalid_string,message:pc.message}),Ra.dirty()):pc.kind==="jwt"?isValidJWT(Ai.data,pc.alg)||(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{validation:"jwt",code:ZodIssueCode.invalid_string,message:pc.message}),Ra.dirty()):pc.kind==="cidr"?isValidCidr(Ai.data,pc.version)||(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{validation:"cidr",code:ZodIssueCode.invalid_string,message:pc.message}),Ra.dirty()):pc.kind==="base64"?base64Regex.test(Ai.data)||(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{validation:"base64",code:ZodIssueCode.invalid_string,message:pc.message}),Ra.dirty()):pc.kind==="base64url"?base64urlRegex.test(Ai.data)||(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{validation:"base64url",code:ZodIssueCode.invalid_string,message:pc.message}),Ra.dirty()):util.assertNever(pc);return{status:Ra.value,value:Ai.data}}_regex(Ai,bo,Ra){return this.refinement(hc=>Ai.test(hc),{validation:bo,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(Ra)})}_addCheck(Ai){return new ZodString({...this._def,checks:[...this._def.checks,Ai]})}email(Ai){return this._addCheck({kind:"email",...errorUtil.errToObj(Ai)})}url(Ai){return this._addCheck({kind:"url",...errorUtil.errToObj(Ai)})}emoji(Ai){return this._addCheck({kind:"emoji",...errorUtil.errToObj(Ai)})}uuid(Ai){return this._addCheck({kind:"uuid",...errorUtil.errToObj(Ai)})}nanoid(Ai){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(Ai)})}cuid(Ai){return this._addCheck({kind:"cuid",...errorUtil.errToObj(Ai)})}cuid2(Ai){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(Ai)})}ulid(Ai){return this._addCheck({kind:"ulid",...errorUtil.errToObj(Ai)})}base64(Ai){return this._addCheck({kind:"base64",...errorUtil.errToObj(Ai)})}base64url(Ai){return this._addCheck({kind:"base64url",...errorUtil.errToObj(Ai)})}jwt(Ai){return this._addCheck({kind:"jwt",...errorUtil.errToObj(Ai)})}ip(Ai){return this._addCheck({kind:"ip",...errorUtil.errToObj(Ai)})}cidr(Ai){return this._addCheck({kind:"cidr",...errorUtil.errToObj(Ai)})}datetime(Ai){var bo,Ra;return typeof Ai=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:Ai}):this._addCheck({kind:"datetime",precision:typeof(Ai==null?void 0:Ai.precision)>"u"?null:Ai==null?void 0:Ai.precision,offset:(bo=Ai==null?void 0:Ai.offset)!==null&&bo!==void 0?bo:!1,local:(Ra=Ai==null?void 0:Ai.local)!==null&&Ra!==void 0?Ra:!1,...errorUtil.errToObj(Ai==null?void 0:Ai.message)})}date(Ai){return this._addCheck({kind:"date",message:Ai})}time(Ai){return typeof Ai=="string"?this._addCheck({kind:"time",precision:null,message:Ai}):this._addCheck({kind:"time",precision:typeof(Ai==null?void 0:Ai.precision)>"u"?null:Ai==null?void 0:Ai.precision,...errorUtil.errToObj(Ai==null?void 0:Ai.message)})}duration(Ai){return this._addCheck({kind:"duration",...errorUtil.errToObj(Ai)})}regex(Ai,bo){return this._addCheck({kind:"regex",regex:Ai,...errorUtil.errToObj(bo)})}includes(Ai,bo){return this._addCheck({kind:"includes",value:Ai,position:bo==null?void 0:bo.position,...errorUtil.errToObj(bo==null?void 0:bo.message)})}startsWith(Ai,bo){return this._addCheck({kind:"startsWith",value:Ai,...errorUtil.errToObj(bo)})}endsWith(Ai,bo){return this._addCheck({kind:"endsWith",value:Ai,...errorUtil.errToObj(bo)})}min(Ai,bo){return this._addCheck({kind:"min",value:Ai,...errorUtil.errToObj(bo)})}max(Ai,bo){return this._addCheck({kind:"max",value:Ai,...errorUtil.errToObj(bo)})}length(Ai,bo){return this._addCheck({kind:"length",value:Ai,...errorUtil.errToObj(bo)})}nonempty(Ai){return this.min(1,errorUtil.errToObj(Ai))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(Ai=>Ai.kind==="datetime")}get isDate(){return!!this._def.checks.find(Ai=>Ai.kind==="date")}get isTime(){return!!this._def.checks.find(Ai=>Ai.kind==="time")}get isDuration(){return!!this._def.checks.find(Ai=>Ai.kind==="duration")}get isEmail(){return!!this._def.checks.find(Ai=>Ai.kind==="email")}get isURL(){return!!this._def.checks.find(Ai=>Ai.kind==="url")}get isEmoji(){return!!this._def.checks.find(Ai=>Ai.kind==="emoji")}get isUUID(){return!!this._def.checks.find(Ai=>Ai.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(Ai=>Ai.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(Ai=>Ai.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(Ai=>Ai.kind==="cuid2")}get isULID(){return!!this._def.checks.find(Ai=>Ai.kind==="ulid")}get isIP(){return!!this._def.checks.find(Ai=>Ai.kind==="ip")}get isCIDR(){return!!this._def.checks.find(Ai=>Ai.kind==="cidr")}get isBase64(){return!!this._def.checks.find(Ai=>Ai.kind==="base64")}get isBase64url(){return!!this._def.checks.find(Ai=>Ai.kind==="base64url")}get minLength(){let Ai=null;for(const bo of this._def.checks)bo.kind==="min"&&(Ai===null||bo.value>Ai)&&(Ai=bo.value);return Ai}get maxLength(){let Ai=null;for(const bo of this._def.checks)bo.kind==="max"&&(Ai===null||bo.value<Ai)&&(Ai=bo.value);return Ai}}ZodString.create=vo=>{var Ai;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:(Ai=vo==null?void 0:vo.coerce)!==null&&Ai!==void 0?Ai:!1,...processCreateParams(vo)})};function floatSafeRemainder(vo,Ai){const bo=(vo.toString().split(".")[1]||"").length,Ra=(Ai.toString().split(".")[1]||"").length,hc=bo>Ra?bo:Ra,pc=parseInt(vo.toFixed(hc).replace(".","")),mc=parseInt(Ai.toFixed(hc).replace(".",""));return pc%mc/Math.pow(10,hc)}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(Ai){if(this._def.coerce&&(Ai.data=Number(Ai.data)),this._getType(Ai)!==ZodParsedType.number){const pc=this._getOrReturnCtx(Ai);return addIssueToContext(pc,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:pc.parsedType}),INVALID}let Ra;const hc=new ParseStatus;for(const pc of this._def.checks)pc.kind==="int"?util.isInteger(Ai.data)||(Ra=this._getOrReturnCtx(Ai,Ra),addIssueToContext(Ra,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:pc.message}),hc.dirty()):pc.kind==="min"?(pc.inclusive?Ai.data<pc.value:Ai.data<=pc.value)&&(Ra=this._getOrReturnCtx(Ai,Ra),addIssueToContext(Ra,{code:ZodIssueCode.too_small,minimum:pc.value,type:"number",inclusive:pc.inclusive,exact:!1,message:pc.message}),hc.dirty()):pc.kind==="max"?(pc.inclusive?Ai.data>pc.value:Ai.data>=pc.value)&&(Ra=this._getOrReturnCtx(Ai,Ra),addIssueToContext(Ra,{code:ZodIssueCode.too_big,maximum:pc.value,type:"number",inclusive:pc.inclusive,exact:!1,message:pc.message}),hc.dirty()):pc.kind==="multipleOf"?floatSafeRemainder(Ai.data,pc.value)!==0&&(Ra=this._getOrReturnCtx(Ai,Ra),addIssueToContext(Ra,{code:ZodIssueCode.not_multiple_of,multipleOf:pc.value,message:pc.message}),hc.dirty()):pc.kind==="finite"?Number.isFinite(Ai.data)||(Ra=this._getOrReturnCtx(Ai,Ra),addIssueToContext(Ra,{code:ZodIssueCode.not_finite,message:pc.message}),hc.dirty()):util.assertNever(pc);return{status:hc.value,value:Ai.data}}gte(Ai,bo){return this.setLimit("min",Ai,!0,errorUtil.toString(bo))}gt(Ai,bo){return this.setLimit("min",Ai,!1,errorUtil.toString(bo))}lte(Ai,bo){return this.setLimit("max",Ai,!0,errorUtil.toString(bo))}lt(Ai,bo){return this.setLimit("max",Ai,!1,errorUtil.toString(bo))}setLimit(Ai,bo,Ra,hc){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:Ai,value:bo,inclusive:Ra,message:errorUtil.toString(hc)}]})}_addCheck(Ai){return new ZodNumber({...this._def,checks:[...this._def.checks,Ai]})}int(Ai){return this._addCheck({kind:"int",message:errorUtil.toString(Ai)})}positive(Ai){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(Ai)})}negative(Ai){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(Ai)})}nonpositive(Ai){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(Ai)})}nonnegative(Ai){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(Ai)})}multipleOf(Ai,bo){return this._addCheck({kind:"multipleOf",value:Ai,message:errorUtil.toString(bo)})}finite(Ai){return this._addCheck({kind:"finite",message:errorUtil.toString(Ai)})}safe(Ai){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(Ai)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(Ai)})}get minValue(){let Ai=null;for(const bo of this._def.checks)bo.kind==="min"&&(Ai===null||bo.value>Ai)&&(Ai=bo.value);return Ai}get maxValue(){let Ai=null;for(const bo of this._def.checks)bo.kind==="max"&&(Ai===null||bo.value<Ai)&&(Ai=bo.value);return Ai}get isInt(){return!!this._def.checks.find(Ai=>Ai.kind==="int"||Ai.kind==="multipleOf"&&util.isInteger(Ai.value))}get isFinite(){let Ai=null,bo=null;for(const Ra of this._def.checks){if(Ra.kind==="finite"||Ra.kind==="int"||Ra.kind==="multipleOf")return!0;Ra.kind==="min"?(bo===null||Ra.value>bo)&&(bo=Ra.value):Ra.kind==="max"&&(Ai===null||Ra.value<Ai)&&(Ai=Ra.value)}return Number.isFinite(bo)&&Number.isFinite(Ai)}}ZodNumber.create=vo=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(vo==null?void 0:vo.coerce)||!1,...processCreateParams(vo)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(Ai){if(this._def.coerce)try{Ai.data=BigInt(Ai.data)}catch{return this._getInvalidInput(Ai)}if(this._getType(Ai)!==ZodParsedType.bigint)return this._getInvalidInput(Ai);let Ra;const hc=new ParseStatus;for(const pc of this._def.checks)pc.kind==="min"?(pc.inclusive?Ai.data<pc.value:Ai.data<=pc.value)&&(Ra=this._getOrReturnCtx(Ai,Ra),addIssueToContext(Ra,{code:ZodIssueCode.too_small,type:"bigint",minimum:pc.value,inclusive:pc.inclusive,message:pc.message}),hc.dirty()):pc.kind==="max"?(pc.inclusive?Ai.data>pc.value:Ai.data>=pc.value)&&(Ra=this._getOrReturnCtx(Ai,Ra),addIssueToContext(Ra,{code:ZodIssueCode.too_big,type:"bigint",maximum:pc.value,inclusive:pc.inclusive,message:pc.message}),hc.dirty()):pc.kind==="multipleOf"?Ai.data%pc.value!==BigInt(0)&&(Ra=this._getOrReturnCtx(Ai,Ra),addIssueToContext(Ra,{code:ZodIssueCode.not_multiple_of,multipleOf:pc.value,message:pc.message}),hc.dirty()):util.assertNever(pc);return{status:hc.value,value:Ai.data}}_getInvalidInput(Ai){const bo=this._getOrReturnCtx(Ai);return addIssueToContext(bo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:bo.parsedType}),INVALID}gte(Ai,bo){return this.setLimit("min",Ai,!0,errorUtil.toString(bo))}gt(Ai,bo){return this.setLimit("min",Ai,!1,errorUtil.toString(bo))}lte(Ai,bo){return this.setLimit("max",Ai,!0,errorUtil.toString(bo))}lt(Ai,bo){return this.setLimit("max",Ai,!1,errorUtil.toString(bo))}setLimit(Ai,bo,Ra,hc){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:Ai,value:bo,inclusive:Ra,message:errorUtil.toString(hc)}]})}_addCheck(Ai){return new ZodBigInt({...this._def,checks:[...this._def.checks,Ai]})}positive(Ai){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(Ai)})}negative(Ai){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(Ai)})}nonpositive(Ai){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(Ai)})}nonnegative(Ai){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(Ai)})}multipleOf(Ai,bo){return this._addCheck({kind:"multipleOf",value:Ai,message:errorUtil.toString(bo)})}get minValue(){let Ai=null;for(const bo of this._def.checks)bo.kind==="min"&&(Ai===null||bo.value>Ai)&&(Ai=bo.value);return Ai}get maxValue(){let Ai=null;for(const bo of this._def.checks)bo.kind==="max"&&(Ai===null||bo.value<Ai)&&(Ai=bo.value);return Ai}}ZodBigInt.create=vo=>{var Ai;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:(Ai=vo==null?void 0:vo.coerce)!==null&&Ai!==void 0?Ai:!1,...processCreateParams(vo)})};class ZodBoolean extends ZodType{_parse(Ai){if(this._def.coerce&&(Ai.data=!!Ai.data),this._getType(Ai)!==ZodParsedType.boolean){const Ra=this._getOrReturnCtx(Ai);return addIssueToContext(Ra,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:Ra.parsedType}),INVALID}return OK(Ai.data)}}ZodBoolean.create=vo=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(vo==null?void 0:vo.coerce)||!1,...processCreateParams(vo)});class ZodDate extends ZodType{_parse(Ai){if(this._def.coerce&&(Ai.data=new Date(Ai.data)),this._getType(Ai)!==ZodParsedType.date){const pc=this._getOrReturnCtx(Ai);return addIssueToContext(pc,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:pc.parsedType}),INVALID}if(isNaN(Ai.data.getTime())){const pc=this._getOrReturnCtx(Ai);return addIssueToContext(pc,{code:ZodIssueCode.invalid_date}),INVALID}const Ra=new ParseStatus;let hc;for(const pc of this._def.checks)pc.kind==="min"?Ai.data.getTime()<pc.value&&(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{code:ZodIssueCode.too_small,message:pc.message,inclusive:!0,exact:!1,minimum:pc.value,type:"date"}),Ra.dirty()):pc.kind==="max"?Ai.data.getTime()>pc.value&&(hc=this._getOrReturnCtx(Ai,hc),addIssueToContext(hc,{code:ZodIssueCode.too_big,message:pc.message,inclusive:!0,exact:!1,maximum:pc.value,type:"date"}),Ra.dirty()):util.assertNever(pc);return{status:Ra.value,value:new Date(Ai.data.getTime())}}_addCheck(Ai){return new ZodDate({...this._def,checks:[...this._def.checks,Ai]})}min(Ai,bo){return this._addCheck({kind:"min",value:Ai.getTime(),message:errorUtil.toString(bo)})}max(Ai,bo){return this._addCheck({kind:"max",value:Ai.getTime(),message:errorUtil.toString(bo)})}get minDate(){let Ai=null;for(const bo of this._def.checks)bo.kind==="min"&&(Ai===null||bo.value>Ai)&&(Ai=bo.value);return Ai!=null?new Date(Ai):null}get maxDate(){let Ai=null;for(const bo of this._def.checks)bo.kind==="max"&&(Ai===null||bo.value<Ai)&&(Ai=bo.value);return Ai!=null?new Date(Ai):null}}ZodDate.create=vo=>new ZodDate({checks:[],coerce:(vo==null?void 0:vo.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(vo)});class ZodSymbol extends ZodType{_parse(Ai){if(this._getType(Ai)!==ZodParsedType.symbol){const Ra=this._getOrReturnCtx(Ai);return addIssueToContext(Ra,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:Ra.parsedType}),INVALID}return OK(Ai.data)}}ZodSymbol.create=vo=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(vo)});class ZodUndefined extends ZodType{_parse(Ai){if(this._getType(Ai)!==ZodParsedType.undefined){const Ra=this._getOrReturnCtx(Ai);return addIssueToContext(Ra,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:Ra.parsedType}),INVALID}return OK(Ai.data)}}ZodUndefined.create=vo=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(vo)});class ZodNull extends ZodType{_parse(Ai){if(this._getType(Ai)!==ZodParsedType.null){const Ra=this._getOrReturnCtx(Ai);return addIssueToContext(Ra,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:Ra.parsedType}),INVALID}return OK(Ai.data)}}ZodNull.create=vo=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(vo)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(Ai){return OK(Ai.data)}}ZodAny.create=vo=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(vo)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(Ai){return OK(Ai.data)}}ZodUnknown.create=vo=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(vo)});class ZodNever extends ZodType{_parse(Ai){const bo=this._getOrReturnCtx(Ai);return addIssueToContext(bo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:bo.parsedType}),INVALID}}ZodNever.create=vo=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(vo)});class ZodVoid extends ZodType{_parse(Ai){if(this._getType(Ai)!==ZodParsedType.undefined){const Ra=this._getOrReturnCtx(Ai);return addIssueToContext(Ra,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:Ra.parsedType}),INVALID}return OK(Ai.data)}}ZodVoid.create=vo=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(vo)});class ZodArray extends ZodType{_parse(Ai){const{ctx:bo,status:Ra}=this._processInputParams(Ai),hc=this._def;if(bo.parsedType!==ZodParsedType.array)return addIssueToContext(bo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:bo.parsedType}),INVALID;if(hc.exactLength!==null){const mc=bo.data.length>hc.exactLength.value,uf=bo.data.length<hc.exactLength.value;(mc||uf)&&(addIssueToContext(bo,{code:mc?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:uf?hc.exactLength.value:void 0,maximum:mc?hc.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:hc.exactLength.message}),Ra.dirty())}if(hc.minLength!==null&&bo.data.length<hc.minLength.value&&(addIssueToContext(bo,{code:ZodIssueCode.too_small,minimum:hc.minLength.value,type:"array",inclusive:!0,exact:!1,message:hc.minLength.message}),Ra.dirty()),hc.maxLength!==null&&bo.data.length>hc.maxLength.value&&(addIssueToContext(bo,{code:ZodIssueCode.too_big,maximum:hc.maxLength.value,type:"array",inclusive:!0,exact:!1,message:hc.maxLength.message}),Ra.dirty()),bo.common.async)return Promise.all([...bo.data].map((mc,uf)=>hc.type._parseAsync(new ParseInputLazyPath(bo,mc,bo.path,uf)))).then(mc=>ParseStatus.mergeArray(Ra,mc));const pc=[...bo.data].map((mc,uf)=>hc.type._parseSync(new ParseInputLazyPath(bo,mc,bo.path,uf)));return ParseStatus.mergeArray(Ra,pc)}get element(){return this._def.type}min(Ai,bo){return new ZodArray({...this._def,minLength:{value:Ai,message:errorUtil.toString(bo)}})}max(Ai,bo){return new ZodArray({...this._def,maxLength:{value:Ai,message:errorUtil.toString(bo)}})}length(Ai,bo){return new ZodArray({...this._def,exactLength:{value:Ai,message:errorUtil.toString(bo)}})}nonempty(Ai){return this.min(1,Ai)}}ZodArray.create=(vo,Ai)=>new ZodArray({type:vo,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(Ai)});function deepPartialify(vo){if(vo instanceof ZodObject){const Ai={};for(const bo in vo.shape){const Ra=vo.shape[bo];Ai[bo]=ZodOptional.create(deepPartialify(Ra))}return new ZodObject({...vo._def,shape:()=>Ai})}else return vo instanceof ZodArray?new ZodArray({...vo._def,type:deepPartialify(vo.element)}):vo instanceof ZodOptional?ZodOptional.create(deepPartialify(vo.unwrap())):vo instanceof ZodNullable?ZodNullable.create(deepPartialify(vo.unwrap())):vo instanceof ZodTuple?ZodTuple.create(vo.items.map(Ai=>deepPartialify(Ai))):vo}class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const Ai=this._def.shape(),bo=util.objectKeys(Ai);return this._cached={shape:Ai,keys:bo}}_parse(Ai){if(this._getType(Ai)!==ZodParsedType.object){const ff=this._getOrReturnCtx(Ai);return addIssueToContext(ff,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:ff.parsedType}),INVALID}const{status:Ra,ctx:hc}=this._processInputParams(Ai),{shape:pc,keys:mc}=this._getCached(),uf=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const ff in hc.data)mc.includes(ff)||uf.push(ff);const df=[];for(const ff of mc){const hf=pc[ff],pf=hc.data[ff];df.push({key:{status:"valid",value:ff},value:hf._parse(new ParseInputLazyPath(hc,pf,hc.path,ff)),alwaysSet:ff in hc.data})}if(this._def.catchall instanceof ZodNever){const ff=this._def.unknownKeys;if(ff==="passthrough")for(const hf of uf)df.push({key:{status:"valid",value:hf},value:{status:"valid",value:hc.data[hf]}});else if(ff==="strict")uf.length>0&&(addIssueToContext(hc,{code:ZodIssueCode.unrecognized_keys,keys:uf}),Ra.dirty());else if(ff!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const ff=this._def.catchall;for(const hf of uf){const pf=hc.data[hf];df.push({key:{status:"valid",value:hf},value:ff._parse(new ParseInputLazyPath(hc,pf,hc.path,hf)),alwaysSet:hf in hc.data})}}return hc.common.async?Promise.resolve().then(async()=>{const ff=[];for(const hf of df){const pf=await hf.key,mf=await hf.value;ff.push({key:pf,value:mf,alwaysSet:hf.alwaysSet})}return ff}).then(ff=>ParseStatus.mergeObjectSync(Ra,ff)):ParseStatus.mergeObjectSync(Ra,df)}get shape(){return this._def.shape()}strict(Ai){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...Ai!==void 0?{errorMap:(bo,Ra)=>{var hc,pc,mc,uf;const df=(mc=(pc=(hc=this._def).errorMap)===null||pc===void 0?void 0:pc.call(hc,bo,Ra).message)!==null&&mc!==void 0?mc:Ra.defaultError;return bo.code==="unrecognized_keys"?{message:(uf=errorUtil.errToObj(Ai).message)!==null&&uf!==void 0?uf:df}:{message:df}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(Ai){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...Ai})})}merge(Ai){return new ZodObject({unknownKeys:Ai._def.unknownKeys,catchall:Ai._def.catchall,shape:()=>({...this._def.shape(),...Ai._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(Ai,bo){return this.augment({[Ai]:bo})}catchall(Ai){return new ZodObject({...this._def,catchall:Ai})}pick(Ai){const bo={};return util.objectKeys(Ai).forEach(Ra=>{Ai[Ra]&&this.shape[Ra]&&(bo[Ra]=this.shape[Ra])}),new ZodObject({...this._def,shape:()=>bo})}omit(Ai){const bo={};return util.objectKeys(this.shape).forEach(Ra=>{Ai[Ra]||(bo[Ra]=this.shape[Ra])}),new ZodObject({...this._def,shape:()=>bo})}deepPartial(){return deepPartialify(this)}partial(Ai){const bo={};return util.objectKeys(this.shape).forEach(Ra=>{const hc=this.shape[Ra];Ai&&!Ai[Ra]?bo[Ra]=hc:bo[Ra]=hc.optional()}),new ZodObject({...this._def,shape:()=>bo})}required(Ai){const bo={};return util.objectKeys(this.shape).forEach(Ra=>{if(Ai&&!Ai[Ra])bo[Ra]=this.shape[Ra];else{let pc=this.shape[Ra];for(;pc instanceof ZodOptional;)pc=pc._def.innerType;bo[Ra]=pc}}),new ZodObject({...this._def,shape:()=>bo})}keyof(){return createZodEnum(util.objectKeys(this.shape))}}ZodObject.create=(vo,Ai)=>new ZodObject({shape:()=>vo,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(Ai)});ZodObject.strictCreate=(vo,Ai)=>new ZodObject({shape:()=>vo,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(Ai)});ZodObject.lazycreate=(vo,Ai)=>new ZodObject({shape:vo,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(Ai)});class ZodUnion extends ZodType{_parse(Ai){const{ctx:bo}=this._processInputParams(Ai),Ra=this._def.options;function hc(pc){for(const uf of pc)if(uf.result.status==="valid")return uf.result;for(const uf of pc)if(uf.result.status==="dirty")return bo.common.issues.push(...uf.ctx.common.issues),uf.result;const mc=pc.map(uf=>new ZodError(uf.ctx.common.issues));return addIssueToContext(bo,{code:ZodIssueCode.invalid_union,unionErrors:mc}),INVALID}if(bo.common.async)return Promise.all(Ra.map(async pc=>{const mc={...bo,common:{...bo.common,issues:[]},parent:null};return{result:await pc._parseAsync({data:bo.data,path:bo.path,parent:mc}),ctx:mc}})).then(hc);{let pc;const mc=[];for(const df of Ra){const ff={...bo,common:{...bo.common,issues:[]},parent:null},hf=df._parseSync({data:bo.data,path:bo.path,parent:ff});if(hf.status==="valid")return hf;hf.status==="dirty"&&!pc&&(pc={result:hf,ctx:ff}),ff.common.issues.length&&mc.push(ff.common.issues)}if(pc)return bo.common.issues.push(...pc.ctx.common.issues),pc.result;const uf=mc.map(df=>new ZodError(df));return addIssueToContext(bo,{code:ZodIssueCode.invalid_union,unionErrors:uf}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(vo,Ai)=>new ZodUnion({options:vo,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(Ai)});const getDiscriminator=vo=>vo instanceof ZodLazy?getDiscriminator(vo.schema):vo instanceof ZodEffects?getDiscriminator(vo.innerType()):vo instanceof ZodLiteral?[vo.value]:vo instanceof ZodEnum?vo.options:vo instanceof ZodNativeEnum?util.objectValues(vo.enum):vo instanceof ZodDefault?getDiscriminator(vo._def.innerType):vo instanceof ZodUndefined?[void 0]:vo instanceof ZodNull?[null]:vo instanceof ZodOptional?[void 0,...getDiscriminator(vo.unwrap())]:vo instanceof ZodNullable?[null,...getDiscriminator(vo.unwrap())]:vo instanceof ZodBranded||vo instanceof ZodReadonly?getDiscriminator(vo.unwrap()):vo instanceof ZodCatch?getDiscriminator(vo._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(Ai){const{ctx:bo}=this._processInputParams(Ai);if(bo.parsedType!==ZodParsedType.object)return addIssueToContext(bo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:bo.parsedType}),INVALID;const Ra=this.discriminator,hc=bo.data[Ra],pc=this.optionsMap.get(hc);return pc?bo.common.async?pc._parseAsync({data:bo.data,path:bo.path,parent:bo}):pc._parseSync({data:bo.data,path:bo.path,parent:bo}):(addIssueToContext(bo,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[Ra]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(Ai,bo,Ra){const hc=new Map;for(const pc of bo){const mc=getDiscriminator(pc.shape[Ai]);if(!mc.length)throw new Error(`A discriminator value for key \`${Ai}\` could not be extracted from all schema options`);for(const uf of mc){if(hc.has(uf))throw new Error(`Discriminator property ${String(Ai)} has duplicate value ${String(uf)}`);hc.set(uf,pc)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:Ai,options:bo,optionsMap:hc,...processCreateParams(Ra)})}}function mergeValues(vo,Ai){const bo=getParsedType(vo),Ra=getParsedType(Ai);if(vo===Ai)return{valid:!0,data:vo};if(bo===ZodParsedType.object&&Ra===ZodParsedType.object){const hc=util.objectKeys(Ai),pc=util.objectKeys(vo).filter(uf=>hc.indexOf(uf)!==-1),mc={...vo,...Ai};for(const uf of pc){const df=mergeValues(vo[uf],Ai[uf]);if(!df.valid)return{valid:!1};mc[uf]=df.data}return{valid:!0,data:mc}}else if(bo===ZodParsedType.array&&Ra===ZodParsedType.array){if(vo.length!==Ai.length)return{valid:!1};const hc=[];for(let pc=0;pc<vo.length;pc++){const mc=vo[pc],uf=Ai[pc],df=mergeValues(mc,uf);if(!df.valid)return{valid:!1};hc.push(df.data)}return{valid:!0,data:hc}}else return bo===ZodParsedType.date&&Ra===ZodParsedType.date&&+vo==+Ai?{valid:!0,data:vo}:{valid:!1}}class ZodIntersection extends ZodType{_parse(Ai){const{status:bo,ctx:Ra}=this._processInputParams(Ai),hc=(pc,mc)=>{if(isAborted(pc)||isAborted(mc))return INVALID;const uf=mergeValues(pc.value,mc.value);return uf.valid?((isDirty(pc)||isDirty(mc))&&bo.dirty(),{status:bo.value,value:uf.data}):(addIssueToContext(Ra,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return Ra.common.async?Promise.all([this._def.left._parseAsync({data:Ra.data,path:Ra.path,parent:Ra}),this._def.right._parseAsync({data:Ra.data,path:Ra.path,parent:Ra})]).then(([pc,mc])=>hc(pc,mc)):hc(this._def.left._parseSync({data:Ra.data,path:Ra.path,parent:Ra}),this._def.right._parseSync({data:Ra.data,path:Ra.path,parent:Ra}))}}ZodIntersection.create=(vo,Ai,bo)=>new ZodIntersection({left:vo,right:Ai,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(bo)});class ZodTuple extends ZodType{_parse(Ai){const{status:bo,ctx:Ra}=this._processInputParams(Ai);if(Ra.parsedType!==ZodParsedType.array)return addIssueToContext(Ra,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:Ra.parsedType}),INVALID;if(Ra.data.length<this._def.items.length)return addIssueToContext(Ra,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),INVALID;!this._def.rest&&Ra.data.length>this._def.items.length&&(addIssueToContext(Ra,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),bo.dirty());const pc=[...Ra.data].map((mc,uf)=>{const df=this._def.items[uf]||this._def.rest;return df?df._parse(new ParseInputLazyPath(Ra,mc,Ra.path,uf)):null}).filter(mc=>!!mc);return Ra.common.async?Promise.all(pc).then(mc=>ParseStatus.mergeArray(bo,mc)):ParseStatus.mergeArray(bo,pc)}get items(){return this._def.items}rest(Ai){return new ZodTuple({...this._def,rest:Ai})}}ZodTuple.create=(vo,Ai)=>{if(!Array.isArray(vo))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:vo,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(Ai)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(Ai){const{status:bo,ctx:Ra}=this._processInputParams(Ai);if(Ra.parsedType!==ZodParsedType.object)return addIssueToContext(Ra,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:Ra.parsedType}),INVALID;const hc=[],pc=this._def.keyType,mc=this._def.valueType;for(const uf in Ra.data)hc.push({key:pc._parse(new ParseInputLazyPath(Ra,uf,Ra.path,uf)),value:mc._parse(new ParseInputLazyPath(Ra,Ra.data[uf],Ra.path,uf)),alwaysSet:uf in Ra.data});return Ra.common.async?ParseStatus.mergeObjectAsync(bo,hc):ParseStatus.mergeObjectSync(bo,hc)}get element(){return this._def.valueType}static create(Ai,bo,Ra){return bo instanceof ZodType?new ZodRecord({keyType:Ai,valueType:bo,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(Ra)}):new ZodRecord({keyType:ZodString.create(),valueType:Ai,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(bo)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(Ai){const{status:bo,ctx:Ra}=this._processInputParams(Ai);if(Ra.parsedType!==ZodParsedType.map)return addIssueToContext(Ra,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:Ra.parsedType}),INVALID;const hc=this._def.keyType,pc=this._def.valueType,mc=[...Ra.data.entries()].map(([uf,df],ff)=>({key:hc._parse(new ParseInputLazyPath(Ra,uf,Ra.path,[ff,"key"])),value:pc._parse(new ParseInputLazyPath(Ra,df,Ra.path,[ff,"value"]))}));if(Ra.common.async){const uf=new Map;return Promise.resolve().then(async()=>{for(const df of mc){const ff=await df.key,hf=await df.value;if(ff.status==="aborted"||hf.status==="aborted")return INVALID;(ff.status==="dirty"||hf.status==="dirty")&&bo.dirty(),uf.set(ff.value,hf.value)}return{status:bo.value,value:uf}})}else{const uf=new Map;for(const df of mc){const ff=df.key,hf=df.value;if(ff.status==="aborted"||hf.status==="aborted")return INVALID;(ff.status==="dirty"||hf.status==="dirty")&&bo.dirty(),uf.set(ff.value,hf.value)}return{status:bo.value,value:uf}}}}ZodMap.create=(vo,Ai,bo)=>new ZodMap({valueType:Ai,keyType:vo,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(bo)});class ZodSet extends ZodType{_parse(Ai){const{status:bo,ctx:Ra}=this._processInputParams(Ai);if(Ra.parsedType!==ZodParsedType.set)return addIssueToContext(Ra,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:Ra.parsedType}),INVALID;const hc=this._def;hc.minSize!==null&&Ra.data.size<hc.minSize.value&&(addIssueToContext(Ra,{code:ZodIssueCode.too_small,minimum:hc.minSize.value,type:"set",inclusive:!0,exact:!1,message:hc.minSize.message}),bo.dirty()),hc.maxSize!==null&&Ra.data.size>hc.maxSize.value&&(addIssueToContext(Ra,{code:ZodIssueCode.too_big,maximum:hc.maxSize.value,type:"set",inclusive:!0,exact:!1,message:hc.maxSize.message}),bo.dirty());const pc=this._def.valueType;function mc(df){const ff=new Set;for(const hf of df){if(hf.status==="aborted")return INVALID;hf.status==="dirty"&&bo.dirty(),ff.add(hf.value)}return{status:bo.value,value:ff}}const uf=[...Ra.data.values()].map((df,ff)=>pc._parse(new ParseInputLazyPath(Ra,df,Ra.path,ff)));return Ra.common.async?Promise.all(uf).then(df=>mc(df)):mc(uf)}min(Ai,bo){return new ZodSet({...this._def,minSize:{value:Ai,message:errorUtil.toString(bo)}})}max(Ai,bo){return new ZodSet({...this._def,maxSize:{value:Ai,message:errorUtil.toString(bo)}})}size(Ai,bo){return this.min(Ai,bo).max(Ai,bo)}nonempty(Ai){return this.min(1,Ai)}}ZodSet.create=(vo,Ai)=>new ZodSet({valueType:vo,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(Ai)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(Ai){const{ctx:bo}=this._processInputParams(Ai);if(bo.parsedType!==ZodParsedType.function)return addIssueToContext(bo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:bo.parsedType}),INVALID;function Ra(uf,df){return makeIssue({data:uf,path:bo.path,errorMaps:[bo.common.contextualErrorMap,bo.schemaErrorMap,getErrorMap(),errorMap].filter(ff=>!!ff),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:df}})}function hc(uf,df){return makeIssue({data:uf,path:bo.path,errorMaps:[bo.common.contextualErrorMap,bo.schemaErrorMap,getErrorMap(),errorMap].filter(ff=>!!ff),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:df}})}const pc={errorMap:bo.common.contextualErrorMap},mc=bo.data;if(this._def.returns instanceof ZodPromise){const uf=this;return OK(async function(...df){const ff=new ZodError([]),hf=await uf._def.args.parseAsync(df,pc).catch(gf=>{throw ff.addIssue(Ra(df,gf)),ff}),pf=await Reflect.apply(mc,this,hf);return await uf._def.returns._def.type.parseAsync(pf,pc).catch(gf=>{throw ff.addIssue(hc(pf,gf)),ff})})}else{const uf=this;return OK(function(...df){const ff=uf._def.args.safeParse(df,pc);if(!ff.success)throw new ZodError([Ra(df,ff.error)]);const hf=Reflect.apply(mc,this,ff.data),pf=uf._def.returns.safeParse(hf,pc);if(!pf.success)throw new ZodError([hc(hf,pf.error)]);return pf.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...Ai){return new ZodFunction({...this._def,args:ZodTuple.create(Ai).rest(ZodUnknown.create())})}returns(Ai){return new ZodFunction({...this._def,returns:Ai})}implement(Ai){return this.parse(Ai)}strictImplement(Ai){return this.parse(Ai)}static create(Ai,bo,Ra){return new ZodFunction({args:Ai||ZodTuple.create([]).rest(ZodUnknown.create()),returns:bo||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(Ra)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(Ai){const{ctx:bo}=this._processInputParams(Ai);return this._def.getter()._parse({data:bo.data,path:bo.path,parent:bo})}}ZodLazy.create=(vo,Ai)=>new ZodLazy({getter:vo,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(Ai)});class ZodLiteral extends ZodType{_parse(Ai){if(Ai.data!==this._def.value){const bo=this._getOrReturnCtx(Ai);return addIssueToContext(bo,{received:bo.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:Ai.data}}get value(){return this._def.value}}ZodLiteral.create=(vo,Ai)=>new ZodLiteral({value:vo,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(Ai)});function createZodEnum(vo,Ai){return new ZodEnum({values:vo,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(Ai)})}class ZodEnum extends ZodType{constructor(){super(...arguments),_ZodEnum_cache.set(this,void 0)}_parse(Ai){if(typeof Ai.data!="string"){const bo=this._getOrReturnCtx(Ai),Ra=this._def.values;return addIssueToContext(bo,{expected:util.joinValues(Ra),received:bo.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodEnum_cache)||__classPrivateFieldSet(this,_ZodEnum_cache,new Set(this._def.values)),!__classPrivateFieldGet(this,_ZodEnum_cache).has(Ai.data)){const bo=this._getOrReturnCtx(Ai),Ra=this._def.values;return addIssueToContext(bo,{received:bo.data,code:ZodIssueCode.invalid_enum_value,options:Ra}),INVALID}return OK(Ai.data)}get options(){return this._def.values}get enum(){const Ai={};for(const bo of this._def.values)Ai[bo]=bo;return Ai}get Values(){const Ai={};for(const bo of this._def.values)Ai[bo]=bo;return Ai}get Enum(){const Ai={};for(const bo of this._def.values)Ai[bo]=bo;return Ai}extract(Ai,bo=this._def){return ZodEnum.create(Ai,{...this._def,...bo})}exclude(Ai,bo=this._def){return ZodEnum.create(this.options.filter(Ra=>!Ai.includes(Ra)),{...this._def,...bo})}}_ZodEnum_cache=new WeakMap;ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{constructor(){super(...arguments),_ZodNativeEnum_cache.set(this,void 0)}_parse(Ai){const bo=util.getValidEnumValues(this._def.values),Ra=this._getOrReturnCtx(Ai);if(Ra.parsedType!==ZodParsedType.string&&Ra.parsedType!==ZodParsedType.number){const hc=util.objectValues(bo);return addIssueToContext(Ra,{expected:util.joinValues(hc),received:Ra.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodNativeEnum_cache)||__classPrivateFieldSet(this,_ZodNativeEnum_cache,new Set(util.getValidEnumValues(this._def.values))),!__classPrivateFieldGet(this,_ZodNativeEnum_cache).has(Ai.data)){const hc=util.objectValues(bo);return addIssueToContext(Ra,{received:Ra.data,code:ZodIssueCode.invalid_enum_value,options:hc}),INVALID}return OK(Ai.data)}get enum(){return this._def.values}}_ZodNativeEnum_cache=new WeakMap;ZodNativeEnum.create=(vo,Ai)=>new ZodNativeEnum({values:vo,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(Ai)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(Ai){const{ctx:bo}=this._processInputParams(Ai);if(bo.parsedType!==ZodParsedType.promise&&bo.common.async===!1)return addIssueToContext(bo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:bo.parsedType}),INVALID;const Ra=bo.parsedType===ZodParsedType.promise?bo.data:Promise.resolve(bo.data);return OK(Ra.then(hc=>this._def.type.parseAsync(hc,{path:bo.path,errorMap:bo.common.contextualErrorMap})))}}ZodPromise.create=(vo,Ai)=>new ZodPromise({type:vo,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(Ai)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(Ai){const{status:bo,ctx:Ra}=this._processInputParams(Ai),hc=this._def.effect||null,pc={addIssue:mc=>{addIssueToContext(Ra,mc),mc.fatal?bo.abort():bo.dirty()},get path(){return Ra.path}};if(pc.addIssue=pc.addIssue.bind(pc),hc.type==="preprocess"){const mc=hc.transform(Ra.data,pc);if(Ra.common.async)return Promise.resolve(mc).then(async uf=>{if(bo.value==="aborted")return INVALID;const df=await this._def.schema._parseAsync({data:uf,path:Ra.path,parent:Ra});return df.status==="aborted"?INVALID:df.status==="dirty"||bo.value==="dirty"?DIRTY(df.value):df});{if(bo.value==="aborted")return INVALID;const uf=this._def.schema._parseSync({data:mc,path:Ra.path,parent:Ra});return uf.status==="aborted"?INVALID:uf.status==="dirty"||bo.value==="dirty"?DIRTY(uf.value):uf}}if(hc.type==="refinement"){const mc=uf=>{const df=hc.refinement(uf,pc);if(Ra.common.async)return Promise.resolve(df);if(df instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return uf};if(Ra.common.async===!1){const uf=this._def.schema._parseSync({data:Ra.data,path:Ra.path,parent:Ra});return uf.status==="aborted"?INVALID:(uf.status==="dirty"&&bo.dirty(),mc(uf.value),{status:bo.value,value:uf.value})}else return this._def.schema._parseAsync({data:Ra.data,path:Ra.path,parent:Ra}).then(uf=>uf.status==="aborted"?INVALID:(uf.status==="dirty"&&bo.dirty(),mc(uf.value).then(()=>({status:bo.value,value:uf.value}))))}if(hc.type==="transform")if(Ra.common.async===!1){const mc=this._def.schema._parseSync({data:Ra.data,path:Ra.path,parent:Ra});if(!isValid(mc))return mc;const uf=hc.transform(mc.value,pc);if(uf instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:bo.value,value:uf}}else return this._def.schema._parseAsync({data:Ra.data,path:Ra.path,parent:Ra}).then(mc=>isValid(mc)?Promise.resolve(hc.transform(mc.value,pc)).then(uf=>({status:bo.value,value:uf})):mc);util.assertNever(hc)}}ZodEffects.create=(vo,Ai,bo)=>new ZodEffects({schema:vo,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:Ai,...processCreateParams(bo)});ZodEffects.createWithPreprocess=(vo,Ai,bo)=>new ZodEffects({schema:Ai,effect:{type:"preprocess",transform:vo},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(bo)});class ZodOptional extends ZodType{_parse(Ai){return this._getType(Ai)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(Ai)}unwrap(){return this._def.innerType}}ZodOptional.create=(vo,Ai)=>new ZodOptional({innerType:vo,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(Ai)});class ZodNullable extends ZodType{_parse(Ai){return this._getType(Ai)===ZodParsedType.null?OK(null):this._def.innerType._parse(Ai)}unwrap(){return this._def.innerType}}ZodNullable.create=(vo,Ai)=>new ZodNullable({innerType:vo,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(Ai)});class ZodDefault extends ZodType{_parse(Ai){const{ctx:bo}=this._processInputParams(Ai);let Ra=bo.data;return bo.parsedType===ZodParsedType.undefined&&(Ra=this._def.defaultValue()),this._def.innerType._parse({data:Ra,path:bo.path,parent:bo})}removeDefault(){return this._def.innerType}}ZodDefault.create=(vo,Ai)=>new ZodDefault({innerType:vo,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof Ai.default=="function"?Ai.default:()=>Ai.default,...processCreateParams(Ai)});class ZodCatch extends ZodType{_parse(Ai){const{ctx:bo}=this._processInputParams(Ai),Ra={...bo,common:{...bo.common,issues:[]}},hc=this._def.innerType._parse({data:Ra.data,path:Ra.path,parent:{...Ra}});return isAsync(hc)?hc.then(pc=>({status:"valid",value:pc.status==="valid"?pc.value:this._def.catchValue({get error(){return new ZodError(Ra.common.issues)},input:Ra.data})})):{status:"valid",value:hc.status==="valid"?hc.value:this._def.catchValue({get error(){return new ZodError(Ra.common.issues)},input:Ra.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(vo,Ai)=>new ZodCatch({innerType:vo,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof Ai.catch=="function"?Ai.catch:()=>Ai.catch,...processCreateParams(Ai)});class ZodNaN extends ZodType{_parse(Ai){if(this._getType(Ai)!==ZodParsedType.nan){const Ra=this._getOrReturnCtx(Ai);return addIssueToContext(Ra,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:Ra.parsedType}),INVALID}return{status:"valid",value:Ai.data}}}ZodNaN.create=vo=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(vo)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(Ai){const{ctx:bo}=this._processInputParams(Ai),Ra=bo.data;return this._def.type._parse({data:Ra,path:bo.path,parent:bo})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(Ai){const{status:bo,ctx:Ra}=this._processInputParams(Ai);if(Ra.common.async)return(async()=>{const pc=await this._def.in._parseAsync({data:Ra.data,path:Ra.path,parent:Ra});return pc.status==="aborted"?INVALID:pc.status==="dirty"?(bo.dirty(),DIRTY(pc.value)):this._def.out._parseAsync({data:pc.value,path:Ra.path,parent:Ra})})();{const hc=this._def.in._parseSync({data:Ra.data,path:Ra.path,parent:Ra});return hc.status==="aborted"?INVALID:hc.status==="dirty"?(bo.dirty(),{status:"dirty",value:hc.value}):this._def.out._parseSync({data:hc.value,path:Ra.path,parent:Ra})}}static create(Ai,bo){return new ZodPipeline({in:Ai,out:bo,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(Ai){const bo=this._def.innerType._parse(Ai),Ra=hc=>(isValid(hc)&&(hc.value=Object.freeze(hc.value)),hc);return isAsync(bo)?bo.then(hc=>Ra(hc)):Ra(bo)}unwrap(){return this._def.innerType}}ZodReadonly.create=(vo,Ai)=>new ZodReadonly({innerType:vo,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(Ai)});function custom(vo,Ai={},bo){return vo?ZodAny.create().superRefine((Ra,hc)=>{var pc,mc;if(!vo(Ra)){const uf=typeof Ai=="function"?Ai(Ra):typeof Ai=="string"?{message:Ai}:Ai,df=(mc=(pc=uf.fatal)!==null&&pc!==void 0?pc:bo)!==null&&mc!==void 0?mc:!0,ff=typeof uf=="string"?{message:uf}:uf;hc.addIssue({code:"custom",...ff,fatal:df})}}):ZodAny.create()}const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(vo){vo.ZodString="ZodString",vo.ZodNumber="ZodNumber",vo.ZodNaN="ZodNaN",vo.ZodBigInt="ZodBigInt",vo.ZodBoolean="ZodBoolean",vo.ZodDate="ZodDate",vo.ZodSymbol="ZodSymbol",vo.ZodUndefined="ZodUndefined",vo.ZodNull="ZodNull",vo.ZodAny="ZodAny",vo.ZodUnknown="ZodUnknown",vo.ZodNever="ZodNever",vo.ZodVoid="ZodVoid",vo.ZodArray="ZodArray",vo.ZodObject="ZodObject",vo.ZodUnion="ZodUnion",vo.ZodDiscriminatedUnion="ZodDiscriminatedUnion",vo.ZodIntersection="ZodIntersection",vo.ZodTuple="ZodTuple",vo.ZodRecord="ZodRecord",vo.ZodMap="ZodMap",vo.ZodSet="ZodSet",vo.ZodFunction="ZodFunction",vo.ZodLazy="ZodLazy",vo.ZodLiteral="ZodLiteral",vo.ZodEnum="ZodEnum",vo.ZodEffects="ZodEffects",vo.ZodNativeEnum="ZodNativeEnum",vo.ZodOptional="ZodOptional",vo.ZodNullable="ZodNullable",vo.ZodDefault="ZodDefault",vo.ZodCatch="ZodCatch",vo.ZodPromise="ZodPromise",vo.ZodBranded="ZodBranded",vo.ZodPipeline="ZodPipeline",vo.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(vo,Ai={message:`Input not instance of ${vo.name}`})=>custom(bo=>bo instanceof vo,Ai),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:vo=>ZodString.create({...vo,coerce:!0}),number:vo=>ZodNumber.create({...vo,coerce:!0}),boolean:vo=>ZodBoolean.create({...vo,coerce:!0}),bigint:vo=>ZodBigInt.create({...vo,coerce:!0}),date:vo=>ZodDate.create({...vo,coerce:!0})},NEVER=INVALID;var z$4=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap,getErrorMap,makeIssue,EMPTY_PATH,addIssueToContext,ParseStatus,INVALID,DIRTY,OK,isAborted,isDirty,isValid,isAsync,get util(){return util},get objectUtil(){return objectUtil},ZodParsedType,getParsedType,ZodType,datetimeRegex,ZodString,ZodNumber,ZodBigInt,ZodBoolean,ZodDate,ZodSymbol,ZodUndefined,ZodNull,ZodAny,ZodUnknown,ZodNever,ZodVoid,ZodArray,ZodObject,ZodUnion,ZodDiscriminatedUnion,ZodIntersection,ZodTuple,ZodRecord,ZodMap,ZodSet,ZodFunction,ZodLazy,ZodLiteral,ZodEnum,ZodNativeEnum,ZodPromise,ZodEffects,ZodTransformer:ZodEffects,ZodOptional,ZodNullable,ZodDefault,ZodCatch,ZodNaN,BRAND,ZodBranded,ZodPipeline,ZodReadonly,custom,Schema:ZodType,ZodSchema:ZodType,late,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,oboolean,onumber,optional:optionalType,ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER,ZodIssueCode,quotelessJson,ZodError});const type$c="number",typedef$b="scalar Amount_Tokens",schema$b=z$4.number(),stringSchema$b="z.number()",amountTokensValidation=vo=>{if(typeof vo!="number")throw new GraphQLError$1(`Value is not number: ${JSON.stringify(vo)}`);if(!Number.isFinite(vo))throw new GraphQLError$1(`Value is not a finite number: ${vo}`);const Ai=schema$b.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$c={name:"Amount_Tokens",description:"A custom scalar that represents an amount of tokens",serialize:amountTokensValidation,parseValue:amountTokensValidation,parseLiteral:vo=>{if(vo.kind!==Kind$1.FLOAT)throw new GraphQLError$1("some error message",{nodes:vo});const Ai=parseFloat(vo.value);return amountTokensValidation(Ai)}},scalar$b=new GraphQLScalarType$1(config$c),AmountTokens=Object.freeze(Object.defineProperty({__proto__:null,config:config$c,scalar:scalar$b,schema:schema$b,stringSchema:stringSchema$b,type:type$c,typedef:typedef$b},Symbol.toStringTag,{value:"Module"})),type$b="string",typedef$a="scalar EthereumAddress",schema$a=z$4.string().regex(/^0x[a-fA-F0-9]{40}$/,{message:"Invalid Ethereum address format"}),stringSchema$a="z.string().regex(/^0x[a-fA-F0-9]{40}$/, { message: 'Invalid Ethereum address format' })",addressValidation=vo=>{if(typeof vo!="string")throw new GraphQLError$1(`Value is not string: ${JSON.stringify(vo)}`);const Ai=schema$a.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$b={name:"EthereumAddress",description:'A custom scalar representing an Ethereum address, validated as a 42-character hexadecimal string prefixed with "0x"',serialize:addressValidation,parseValue:addressValidation,parseLiteral:vo=>{if(vo.kind!==Kind$1.STRING)throw new GraphQLError$1("some error message",{nodes:vo});return addressValidation(vo.value)}},scalar$a=new GraphQLScalarType$1(config$b),EthereumAddress=Object.freeze(Object.defineProperty({__proto__:null,config:config$b,scalar:scalar$a,schema:schema$a,stringSchema:stringSchema$a,type:type$b,typedef:typedef$a},Symbol.toStringTag,{value:"Module"})),type$a="number",typedef$9="scalar Amount_Percentage",schema$9=z$4.number(),stringSchema$9="z.number()",amountPercentageValidation=vo=>{if(typeof vo!="number")throw new GraphQLError$1(`Value is not number: ${JSON.stringify(vo)}`);if(!Number.isFinite(vo))throw new GraphQLError$1(`Value is not a finite number: ${vo}`);const Ai=schema$9.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$a={name:"Amount_Percentage",description:"",serialize:amountPercentageValidation,parseValue:amountPercentageValidation,parseLiteral:vo=>{if(vo.kind!==Kind$1.FLOAT)throw new GraphQLError$1("some error message",{nodes:vo});const Ai=parseFloat(vo.value);return amountPercentageValidation(Ai)}},scalar$9=new GraphQLScalarType$1(config$a),AmountPercentage=Object.freeze(Object.defineProperty({__proto__:null,config:config$a,scalar:scalar$9,schema:schema$9,stringSchema:stringSchema$9,type:type$a,typedef:typedef$9},Symbol.toStringTag,{value:"Module"})),type$9="string",typedef$8="scalar EmailAddress",schema$8=z$4.string().email(),stringSchema$8="z.string().email()",emailValidation=vo=>{if(typeof vo!="string")throw new GraphQLError$1(`Value is not string: ${JSON.stringify(vo)}`);const Ai=schema$8.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$9={name:"EmailAddress",description:"A field whose value conforms to the standard internet email address format as specified in RFC822: https://www.w3.org/Protocols/rfc822/.",serialize:emailValidation,parseValue:emailValidation,parseLiteral:vo=>{if(vo.kind!==Kind$1.STRING)throw new GraphQLError$1(`Can only validate strings as email addresses but got a: ${vo.kind}`,{nodes:vo});return emailValidation(vo.value)}},scalar$8=new GraphQLScalarType$1(config$9),EmailAddress=Object.freeze(Object.defineProperty({__proto__:null,config:config$9,scalar:scalar$8,schema:schema$8,stringSchema:stringSchema$8,type:type$9,typedef:typedef$8},Symbol.toStringTag,{value:"Module"})),type$8="string",typedef$7="scalar Date",schema$7=z$4.string().datetime(),stringSchema$7="z.string().datetime()",datetimeValidation$1=vo=>{if(typeof vo!="string")throw new GraphQLError$1(`Value is not iso string: ${JSON.stringify(vo)}`);const Ai=schema$7.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$8={name:"Date",description:"A custom scalar that represents a datetime in ISO 8601 format (Time: 00:00:00)",serialize:datetimeValidation$1,parseValue:datetimeValidation$1,parseLiteral:vo=>{if(vo.kind!==Kind$1.STRING)throw new GraphQLError$1("Value is not an string",{nodes:vo});return datetimeValidation$1(vo.value)}},scalar$7=new GraphQLScalarType$1(config$8),Date$1=Object.freeze(Object.defineProperty({__proto__:null,config:config$8,scalar:scalar$7,schema:schema$7,stringSchema:stringSchema$7,type:type$8,typedef:typedef$7},Symbol.toStringTag,{value:"Module"})),type$7="string",typedef$6="scalar DateTime",schema$6=z$4.string().datetime(),stringSchema$6="z.string().datetime()",datetimeValidation=vo=>{if(typeof vo!="string")throw new GraphQLError$1(`Value is not iso string: ${JSON.stringify(vo)}`);const Ai=schema$6.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$7={name:"DateTime",description:"A custom scalar that represents a datetime in ISO 8601 format",serialize:datetimeValidation,parseValue:datetimeValidation,parseLiteral:vo=>{if(vo.kind!==Kind$1.STRING)throw new GraphQLError$1("Value is not an string",{nodes:vo});return datetimeValidation(vo.value)}},scalar$6=new GraphQLScalarType$1(config$7),DateTime=Object.freeze(Object.defineProperty({__proto__:null,config:config$7,scalar:scalar$6,schema:schema$6,stringSchema:stringSchema$6,type:type$7,typedef:typedef$6},Symbol.toStringTag,{value:"Module"})),type$6="string",typedef$5="scalar URL",schema$5=z$4.string().url(),stringSchema$5="z.string().url()",urlValidation=vo=>{if(typeof vo!="string")throw new GraphQLError$1(`Value is not iso string: ${JSON.stringify(vo)}`);const Ai=schema$5.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$6={name:"URL",description:"A custom scalar that represents a URL string",serialize:urlValidation,parseValue:urlValidation,parseLiteral:vo=>{if(vo.kind!==Kind$1.STRING)throw new GraphQLError$1("Value is not an string",{nodes:vo});return urlValidation(vo.value)}},scalar$5=new GraphQLScalarType$1(config$6),URL$1=Object.freeze(Object.defineProperty({__proto__:null,config:config$6,scalar:scalar$5,schema:schema$5,stringSchema:stringSchema$5,type:type$6,typedef:typedef$5},Symbol.toStringTag,{value:"Module"})),type$5="number",typedef$4="scalar Amount_Money",schema$4=z$4.number(),stringSchema$4="z.number()",amountMoneyValidation=vo=>{if(typeof vo!="number")throw new GraphQLError$1(`Value is not number: ${JSON.stringify(vo)}`);if(!Number.isFinite(vo))throw new GraphQLError$1(`Value is not a finite number: ${vo}`);const Ai=schema$4.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$5={name:"Amount_Money",description:"A custom scalar that represents a monetary amount in a currency",serialize:amountMoneyValidation,parseValue:amountMoneyValidation,parseLiteral:vo=>{if(vo.kind!==Kind$1.FLOAT)throw new GraphQLError$1("Value is not a float type",{nodes:vo});const Ai=parseFloat(vo.value);return amountMoneyValidation(Ai)}},scalar$4=new GraphQLScalarType$1(config$5),AmountMoney=Object.freeze(Object.defineProperty({__proto__:null,config:config$5,scalar:scalar$4,schema:schema$4,stringSchema:stringSchema$4,type:type$5,typedef:typedef$4},Symbol.toStringTag,{value:"Module"})),type$4="string",typedef$3="scalar OLabel",schema$3=z$4.string(),stringSchema$3="z.string()",oLabelValidation=vo=>{if(typeof vo!="string")throw new GraphQLError$1(`Value is not string: ${JSON.stringify(vo)}`);const Ai=schema$3.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$4={name:"OLabel",description:"A custom scalar that represents a OLabel string",serialize:oLabelValidation,parseValue:oLabelValidation,parseLiteral:vo=>{if(vo.kind!==Kind$1.STRING)throw new GraphQLError$1(`Value is not a valid string: ${vo.kind}`,{nodes:vo});return oLabelValidation(vo.value)}},scalar$3=new GraphQLScalarType$1(config$4),OLabel=Object.freeze(Object.defineProperty({__proto__:null,config:config$4,scalar:scalar$3,schema:schema$3,stringSchema:stringSchema$3,type:type$4,typedef:typedef$3},Symbol.toStringTag,{value:"Module"})),type$3="string",typedef$2="scalar Currency",schema$2=z$4.string(),stringSchema$2="z.string()",currencyValidation=vo=>{if(typeof vo!="string")throw new GraphQLError$1(`Value is not string: ${JSON.stringify(vo)}`);const Ai=schema$2.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$3={name:"Currency",description:"A custom scalar that represents a Currency Code string",serialize:currencyValidation,parseValue:currencyValidation,parseLiteral:vo=>{if(vo.kind!==Kind$1.STRING)throw new GraphQLError$1(`Value is not a valid string: ${vo.kind}`,{nodes:vo});return currencyValidation(vo.value)}},scalar$2=new GraphQLScalarType$1(config$3),Currency=Object.freeze(Object.defineProperty({__proto__:null,config:config$3,scalar:scalar$2,schema:schema$2,stringSchema:stringSchema$2,type:type$3,typedef:typedef$2},Symbol.toStringTag,{value:"Module"})),type$2="string",typedef$1="scalar PHID",schema$1=z$4.string(),stringSchema$1="z.string()",phidlValidation=vo=>{if(typeof vo!="string")throw new GraphQLError$1(`Value is not string: ${JSON.stringify(vo)}`);const Ai=schema$1.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$2={name:"PHID",description:"A custom scalar that represents a PowerhouseID string",serialize:phidlValidation,parseValue:phidlValidation,parseLiteral:vo=>{if(vo.kind!==Kind$1.STRING)throw new GraphQLError$1(`Value is not a valid string: ${vo.kind}`,{nodes:vo});return phidlValidation(vo.value)}},scalar$1=new GraphQLScalarType$1(config$2),PHID=Object.freeze(Object.defineProperty({__proto__:null,config:config$2,scalar:scalar$1,schema:schema$1,stringSchema:stringSchema$1,type:type$2,typedef:typedef$1},Symbol.toStringTag,{value:"Module"})),type$1="string",typedef="scalar OID",schema=z$4.string(),stringSchema="z.string()",oIdValidation=vo=>{if(typeof vo!="string")throw new GraphQLError$1(`Value is not string: ${JSON.stringify(vo)}`);const Ai=schema.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$1={name:"OID",description:"A custom scalar that represents a OID string",serialize:oIdValidation,parseValue:oIdValidation,parseLiteral:vo=>{if(vo.kind!==Kind$1.STRING)throw new GraphQLError$1(`Value is not a valid string: ${vo.kind}`,{nodes:vo});return oIdValidation(vo.value)}},scalar=new GraphQLScalarType$1(config$1),OID=Object.freeze(Object.defineProperty({__proto__:null,config:config$1,scalar,schema,stringSchema,type:type$1,typedef},Symbol.toStringTag,{value:"Module"})),resolvers={AmountTokens:scalar$b,EthereumAddress:scalar$a,AmountPercentage:scalar$9,EmailAddress:scalar$8,Date:scalar$7,DateTime:scalar$6,URL:scalar$5,AmountMoney:scalar$4,OLabel:scalar$3,Currency:scalar$2,PHID:scalar$1,OID:scalar},typeDefs=[typedef$b,typedef$a,typedef$9,typedef$8,typedef$7,typedef$6,typedef$5,typedef$4,typedef$3,typedef$2,typedef$1,typedef],generatorTypeDefs={[config$c.name]:type$c,[config$b.name]:type$b,[config$9.name]:type$9,[config$a.name]:type$a,[config$8.name]:type$8,[config$7.name]:type$7,[config$6.name]:type$6,[config$5.name]:type$5,[config$4.name]:type$4,[config$3.name]:type$3,[config$2.name]:type$2,[config$1.name]:type$1},validationSchema={[config$c.name]:stringSchema$b,[config$b.name]:stringSchema$a,[config$9.name]:stringSchema$8,[config$a.name]:stringSchema$9,[config$8.name]:stringSchema$7,[config$7.name]:stringSchema$6,[config$6.name]:stringSchema$5,[config$5.name]:stringSchema$4,[config$4.name]:stringSchema$3,[config$3.name]:stringSchema$2,[config$2.name]:stringSchema$1,[config$1.name]:stringSchema},customScalars=Object.freeze(Object.defineProperty({__proto__:null,AmountMoney,AmountPercentage,AmountTokens,Currency,DateScalar:Date$1,DateTime,EmailAddress,EthereumAddress,OID,OLabel,PHID,URLScalar:URL$1,generatorTypeDefs,resolvers,typeDefs,validationSchema},Symbol.toStringTag,{value:"Module"}));var define_process_env_default={};function DocumentEditor(vo){const Ai=["document-editor",`${vo.mode}-mode`];return jsx("div",{className:Ai.join(" "),children:vo.children})}function EditorToolbar(vo){const Ai=vo.left||[],bo=vo.center||[],Ra=vo.right||[];return jsxs("div",{className:"editor-toolbar",children:[jsx("div",{className:"editor-toolbar--column editor-toolbar--left",children:Ai}),jsx("div",{className:"editor-toolbar--column editor-toolbar--center",children:bo}),jsx("div",{className:"editor-toolbar--column editor-toolbar--right",children:Ra})]})}function EditorWorksheet(vo){return jsx("div",{className:"editor-worksheet",children:jsx("div",{className:"editor-worksheet--page",children:vo.children})})}const colorScheme$1={light:{color:"#222222",bgColor:"#FFFFFF",border:"#EEEEEE",shadow:"rgba(128,128,128,0.65)",inputColor:"#222222",inputBg:"#F6F6F6"},dark:{color:"#E6E6E6",bgColor:"#181818",border:"#181818",shadow:"rgba(0, 0, 0, 0.25)",inputColor:"#E6E6E6",inputBg:"#222222"}},typographySizes$1={huge:{fontSize:"36pt",fontWeight:"bold",padding:"6pt",margin:"30pt 0 0 0"},larger:{fontSize:"24pt",fontWeight:"bold",padding:"6pt",margin:"18pt 0 0 0"},large:{fontSize:"18pt",fontWeight:"bold",padding:"6pt",margin:"12pt 0 0 0"},medium:{fontSize:"11pt",fontWeight:"bold",padding:"6pt",margin:"5pt 0 0 0"},small:{fontSize:"10pt",fontWeight:"normal",padding:"6pt",margin:"0"},smaller:{fontSize:"9pt",fontWeight:"normal",padding:"6pt",margin:"0"},tiny:{fontSize:"8pt",fontWeight:"normal",padding:"6pt",margin:"0"}},inputStyle$1=(vo="light",Ai=!1)=>{const bo=colorScheme$1[vo];return{width:"100%",border:"none",boxSizing:"border-box",backgroundColor:Ai?bo.inputBg:bo.bgColor,outline:"none",color:bo.inputColor,resize:"none",fontFamily:"Roboto, sans-serif",overflow:"hidden",lineHeight:"1.5"}},colorScheme={light:{color:"#222222",bgColor:"#FFFFFF",border:"#EEEEEE",shadow:"rgba(128,128,128,0.65)",inputColor:"#222222",inputBg:"#F6F6F6"},dark:{color:"#CCCCCC",bgColor:"#0A0A0A",border:"#181818",shadow:"rgba(255, 255, 255, 0.25)",inputColor:"#CCCCCC",inputBg:"#1A1D1F"}},typographySizes={chapter:{fontSize:"64pt",fontWeight:"bold",padding:"6pt 24pt",margin:"0",lineHeight:1,textAlign:"right",borderLeft:"4px solid"},huge:{fontSize:"32pt",fontWeight:"normal",padding:"6pt",margin:"0 0 0 -6pt",lineHeight:1},larger:{fontSize:"24pt",fontWeight:"bold",padding:"6pt",margin:"-12pt 0 0 0"},large:{fontSize:"18pt",fontWeight:"bold",padding:"6pt",margin:"-10.5pt 0 0 0"},medium:{fontSize:"11pt",fontWeight:"bold",padding:"6pt",margin:"-8pt 0 0 0"},small:{fontSize:"10pt",fontWeight:"normal",padding:"6pt",margin:"-6pt 0 0 0"},smaller:{fontSize:"9pt",fontWeight:"normal",padding:"6pt",margin:"-5pt 0 0 0"},tiny:{fontSize:"8pt",fontWeight:"normal",padding:"6pt",margin:"-8pt 0 0 0"}},inputStyle=(vo="light",Ai=!1)=>{const bo=colorScheme[vo];return{width:"100%",border:"none",boxSizing:"border-box",backgroundColor:Ai?bo.inputBg:bo.bgColor,outline:"none",color:bo.inputColor,resize:"none",fontFamily:"Roboto, sans-serif",overflow:"hidden",lineHeight:"1.5"}};function TextInput(vo){const[Ai,bo]=useState({value:vo.value||"",hasFocus:!1,pressingEnter:!1});useEffect(()=>{bo(ff=>ff.value!==vo.value?{...ff,value:vo.value||""}:ff)},[vo.value]);const Ra=ff=>{ff.key==="Enter"&&(bo({...Ai,pressingEnter:!0}),ff.preventDefault())},hc=ff=>{ff.key==="Enter"&&(ff.target&&vo.onSubmit&&vo.onSubmit(ff.target.value),vo.clearOnSubmit?bo({...Ai,value:"",pressingEnter:!1}):bo({...Ai,pressingEnter:!1}),ff.preventDefault()),(ff.key==="Backspace"||ff.key==="Delete")&&(vo.onEmpty&&ff.target.value.length<1&&vo.onEmpty(vo.id||""),ff.preventDefault())},pc=ff=>{if(!Ai.pressingEnter){const hf=ff.target;bo({...Ai,value:hf.value}),hf.style.height="1px",hf.style.height=hf.scrollHeight+"px"}},mc=ff=>{var hf;if(bo(pf=>({...pf,hasFocus:ff})),!ff){const pf=((hf=uf.current)==null?void 0:hf.value)||"",mf=vo.value||"";pf!=mf&&vo.onSubmit&&(vo.onSubmit(pf),vo.clearOnSubmit&&bo(gf=>({...gf,value:""})))}},uf=useRef(null);useEffect(()=>{const ff=()=>{uf.current&&(uf.current.style.height="1px",uf.current.style.height=uf.current.scrollHeight+"px")};return window.addEventListener("resize",ff),ff(),()=>{window.removeEventListener("resize",ff)}});const df={...inputStyle$1(vo.theme,Ai.hasFocus),...typographySizes$1[vo.size||"small"]};return jsxs("div",{children:[vo.horizontalLine?jsx("hr",{style:{borderColor:inputStyle$1(vo.theme,!1).backgroundColor}},"line"):"",jsx("textarea",{autoFocus:vo.autoFocus||!1,onBlur:ff=>mc(!1),onFocus:ff=>mc(!0),onInput:pc,onKeyDown:Ra,onKeyUp:hc,placeholder:vo.placeholder||"",ref:uf,style:df,value:Ai.value},"text")]})}function TextInputVariant(vo){const[Ai,bo]=useState({value:vo.value||"",hasFocus:!1,pressingEnter:!1});useEffect(()=>{bo({...Ai,value:vo.value||""})},[vo.value]);const Ra=ff=>{ff.key==="Enter"&&(bo({...Ai,pressingEnter:!0}),ff.preventDefault())},hc=ff=>{ff.key==="Enter"&&(ff.target&&vo.onSubmit&&vo.onSubmit(ff.target.value),vo.clearOnSubmit?bo({...Ai,value:"",pressingEnter:!1}):bo({...Ai,pressingEnter:!1}),ff.preventDefault()),(ff.key==="Backspace"||ff.key==="Delete")&&(vo.onEmpty&&ff.target.value.length<1&&vo.onEmpty(vo.id||""),ff.preventDefault())},pc=ff=>{if(!Ai.pressingEnter){const hf=ff.target;bo({...Ai,value:hf.value}),hf.style.height="1px",hf.style.height=hf.scrollHeight+"px"}},mc=ff=>{var hf;if(bo({...Ai,hasFocus:ff}),!ff){const pf=((hf=uf.current)==null?void 0:hf.value)||"",mf=vo.value||"";pf!=mf&&vo.onSubmit&&vo.onSubmit(pf)}},uf=useRef(null);useEffect(()=>{const ff=()=>{uf.current&&(uf.current.style.height="1px",uf.current.style.height=uf.current.scrollHeight+"px")};return window.addEventListener("resize",ff),ff(),()=>{window.removeEventListener("resize",ff)}});const df={...inputStyle(vo.theme,Ai.hasFocus),...typographySizes[vo.size||"small"]};return vo.labelStyle&&(df.textAlign="center",df.textTransform="uppercase",df.backgroundColor="rgba(0, 0, 255, 0.05)",df.borderRadius="8px",df.padding="1px 0 4px 0",df.margin="0",df.fontWeight="bold",df.fontSize="8pt",df.color="#518EBE",df.border="2px solid #518EBE",df.cursor="pointer",df.lineHeight="1.5"),jsxs("div",{children:[vo.horizontalLine?jsx("hr",{style:{borderColor:inputStyle(vo.theme,!1).backgroundColor}},"line"):"",jsx("textarea",{autoFocus:vo.autoFocus||!1,onBlur:ff=>mc(!1),onFocus:ff=>mc(!0),onInput:pc,onKeyDown:Ra,onKeyUp:hc,placeholder:vo.placeholder||"",ref:uf,spellCheck:Ai.hasFocus,style:df,tabIndex:vo.labelStyle?-1:1,value:Ai.value},"text")]})}function ToolbarButton(vo){const Ai=vo.onClick||(()=>{console.log("No onClick handler attached to button.")});return jsx("div",{className:"toolbar-button",onClick:Ai,style:{userSelect:"none"},children:vo.children})}var u$2=Object.defineProperty,a$1=(vo,Ai)=>u$2(vo,"name",{value:Ai,configurable:!0}),y$1=(()=>{let vo;return typeof window<"u"?vo=window:typeof globalThis<"u"?vo=globalThis:typeof global<"u"?vo=global:typeof self<"u"?vo=self:vo={},vo})(),{LOGLEVEL:b$3}=y$1,t$5={trace:1,debug:2,info:3,warn:4,error:5,silent:10},L$3=b$3,i$4=t$5[L$3]||t$5.info,s$3={trace:a$1((vo,...Ai)=>{i$4<=t$5.trace&&console.trace(vo,...Ai)},"trace"),debug:a$1((vo,...Ai)=>{i$4<=t$5.debug&&console.debug(vo,...Ai)},"debug"),info:a$1((vo,...Ai)=>{i$4<=t$5.info&&console.info(vo,...Ai)},"info"),warn:a$1((vo,...Ai)=>{i$4<=t$5.warn&&console.warn(vo,...Ai)},"warn"),error:a$1((vo,...Ai)=>{i$4<=t$5.error&&console.error(vo,...Ai)},"error"),log:a$1((vo,...Ai)=>{i$4<t$5.silent&&console.log(vo,...Ai)},"log")},c$1=new Set,n$2=a$1(vo=>(Ai,...bo)=>{if(!c$1.has(Ai))return c$1.add(Ai),s$3[vo](Ai,...bo)},"once");n$2.clear=()=>c$1.clear();n$2.trace=n$2("trace");n$2.debug=n$2("debug");n$2.info=n$2("info");n$2.warn=n$2("warn");n$2.error=n$2("error");n$2.log=n$2("log");var m$2=n$2("warn"),r$3=a$1(vo=>(...Ai)=>{let bo=[];if(Ai.length){let Ra=/<span\s+style=(['"])([^'"]*)\1\s*>/gi,hc=/<\/span>/gi,pc;for(bo.push(Ai[0].replace(Ra,"%c").replace(hc,"%c"));pc=Ra.exec(Ai[0]);)bo.push(pc[2]),bo.push("");for(let mc=1;mc<Ai.length;mc++)bo.push(Ai[mc])}s$3[vo].apply(s$3,bo)},"pretty");r$3.trace=r$3("trace");r$3.debug=r$3("debug");r$3.info=r$3("info");r$3.warn=r$3("warn");r$3.error=r$3("error");var _$1=(vo=>(vo.CHANNEL_WS_DISCONNECT="channelWSDisconnect",vo.CHANNEL_CREATED="channelCreated",vo.CONFIG_ERROR="configError",vo.STORY_INDEX_INVALIDATED="storyIndexInvalidated",vo.STORY_SPECIFIED="storySpecified",vo.SET_CONFIG="setConfig",vo.SET_STORIES="setStories",vo.SET_INDEX="setIndex",vo.SET_CURRENT_STORY="setCurrentStory",vo.CURRENT_STORY_WAS_SET="currentStoryWasSet",vo.FORCE_RE_RENDER="forceReRender",vo.FORCE_REMOUNT="forceRemount",vo.PRELOAD_ENTRIES="preloadStories",vo.STORY_PREPARED="storyPrepared",vo.DOCS_PREPARED="docsPrepared",vo.STORY_CHANGED="storyChanged",vo.STORY_UNCHANGED="storyUnchanged",vo.STORY_RENDERED="storyRendered",vo.STORY_MISSING="storyMissing",vo.STORY_ERRORED="storyErrored",vo.STORY_THREW_EXCEPTION="storyThrewException",vo.STORY_RENDER_PHASE_CHANGED="storyRenderPhaseChanged",vo.PLAY_FUNCTION_THREW_EXCEPTION="playFunctionThrewException",vo.UNHANDLED_ERRORS_WHILE_PLAYING="unhandledErrorsWhilePlaying",vo.UPDATE_STORY_ARGS="updateStoryArgs",vo.STORY_ARGS_UPDATED="storyArgsUpdated",vo.RESET_STORY_ARGS="resetStoryArgs",vo.SET_FILTER="setFilter",vo.SET_GLOBALS="setGlobals",vo.UPDATE_GLOBALS="updateGlobals",vo.GLOBALS_UPDATED="globalsUpdated",vo.REGISTER_SUBSCRIPTION="registerSubscription",vo.PREVIEW_KEYDOWN="previewKeydown",vo.PREVIEW_BUILDER_PROGRESS="preview_builder_progress",vo.SELECT_STORY="selectStory",vo.STORIES_COLLAPSE_ALL="storiesCollapseAll",vo.STORIES_EXPAND_ALL="storiesExpandAll",vo.DOCS_RENDERED="docsRendered",vo.SHARED_STATE_CHANGED="sharedStateChanged",vo.SHARED_STATE_SET="sharedStateSet",vo.NAVIGATE_URL="navigateUrl",vo.UPDATE_QUERY_PARAMS="updateQueryParams",vo.REQUEST_WHATS_NEW_DATA="requestWhatsNewData",vo.RESULT_WHATS_NEW_DATA="resultWhatsNewData",vo.SET_WHATS_NEW_CACHE="setWhatsNewCache",vo.TOGGLE_WHATS_NEW_NOTIFICATIONS="toggleWhatsNewNotifications",vo.TELEMETRY_ERROR="telemetryError",vo.FILE_COMPONENT_SEARCH_REQUEST="fileComponentSearchRequest",vo.FILE_COMPONENT_SEARCH_RESPONSE="fileComponentSearchResponse",vo.SAVE_STORY_REQUEST="saveStoryRequest",vo.SAVE_STORY_RESPONSE="saveStoryResponse",vo.ARGTYPES_INFO_REQUEST="argtypesInfoRequest",vo.ARGTYPES_INFO_RESPONSE="argtypesInfoResponse",vo.CREATE_NEW_STORYFILE_REQUEST="createNewStoryfileRequest",vo.CREATE_NEW_STORYFILE_RESPONSE="createNewStoryfileResponse",vo.TESTING_MODULE_CRASH_REPORT="testingModuleCrashReport",vo.TESTING_MODULE_PROGRESS_REPORT="testingModuleProgressReport",vo.TESTING_MODULE_RUN_REQUEST="testingModuleRunRequest",vo.TESTING_MODULE_RUN_ALL_REQUEST="testingModuleRunAllRequest",vo.TESTING_MODULE_CANCEL_TEST_RUN_REQUEST="testingModuleCancelTestRunRequest",vo.TESTING_MODULE_CANCEL_TEST_RUN_RESPONSE="testingModuleCancelTestRunResponse",vo.TESTING_MODULE_WATCH_MODE_REQUEST="testingModuleWatchModeRequest",vo))(_$1||{}),R$2=_$1,{CHANNEL_WS_DISCONNECT:S$2,CHANNEL_CREATED:T$1,CONFIG_ERROR:N$2,CREATE_NEW_STORYFILE_REQUEST:O$3,CREATE_NEW_STORYFILE_RESPONSE:A$1,CURRENT_STORY_WAS_SET:r$2,DOCS_PREPARED:D$3,DOCS_RENDERED:I$2,FILE_COMPONENT_SEARCH_REQUEST:C$3,FILE_COMPONENT_SEARCH_RESPONSE:o$2,FORCE_RE_RENDER:L$2,FORCE_REMOUNT:P$3,GLOBALS_UPDATED:U$3,NAVIGATE_URL:G$3,PLAY_FUNCTION_THREW_EXCEPTION:a,UNHANDLED_ERRORS_WHILE_PLAYING:Y$2,PRELOAD_ENTRIES:t$4,PREVIEW_BUILDER_PROGRESS:e$1,PREVIEW_KEYDOWN:W$2,REGISTER_SUBSCRIPTION:d,RESET_STORY_ARGS:H$2,SELECT_STORY:l$1,SET_CONFIG:i$3,SET_CURRENT_STORY:p$2,SET_FILTER:M$4,SET_GLOBALS:u$1,SET_INDEX:F$3,SET_STORIES:s$2,SHARED_STATE_CHANGED:c,SHARED_STATE_SET:g,STORIES_COLLAPSE_ALL:y,STORIES_EXPAND_ALL:h$1,STORY_ARGS_UPDATED:Q,STORY_CHANGED:f$2,STORY_ERRORED:x$3,STORY_INDEX_INVALIDATED:m$1$1,STORY_MISSING:V$1,STORY_PREPARED:w$2,STORY_RENDER_PHASE_CHANGED:B$2,STORY_RENDERED:X$2,STORY_SPECIFIED:q$3,STORY_THREW_EXCEPTION:b$2,STORY_UNCHANGED:K$2,UPDATE_GLOBALS:j,UPDATE_QUERY_PARAMS:k$4,UPDATE_STORY_ARGS:n$1,REQUEST_WHATS_NEW_DATA:z$3,RESULT_WHATS_NEW_DATA:J$2,SET_WHATS_NEW_CACHE:Z,TOGGLE_WHATS_NEW_NOTIFICATIONS:$$3,TELEMETRY_ERROR:v$3,SAVE_STORY_REQUEST:EE,SAVE_STORY_RESPONSE:_E,ARGTYPES_INFO_REQUEST:RE,ARGTYPES_INFO_RESPONSE:SE,TESTING_MODULE_CRASH_REPORT:TE,TESTING_MODULE_PROGRESS_REPORT:NE,TESTING_MODULE_RUN_REQUEST:OE,TESTING_MODULE_RUN_ALL_REQUEST:AE,TESTING_MODULE_CANCEL_TEST_RUN_REQUEST:rE,TESTING_MODULE_CANCEL_TEST_RUN_RESPONSE:DE,TESTING_MODULE_WATCH_MODE_REQUEST:IE}=_$1;const Qn$1=Object.freeze(Object.defineProperty({__proto__:null,ARGTYPES_INFO_REQUEST:RE,ARGTYPES_INFO_RESPONSE:SE,CHANNEL_CREATED:T$1,CHANNEL_WS_DISCONNECT:S$2,CONFIG_ERROR:N$2,CREATE_NEW_STORYFILE_REQUEST:O$3,CREATE_NEW_STORYFILE_RESPONSE:A$1,CURRENT_STORY_WAS_SET:r$2,DOCS_PREPARED:D$3,DOCS_RENDERED:I$2,FILE_COMPONENT_SEARCH_REQUEST:C$3,FILE_COMPONENT_SEARCH_RESPONSE:o$2,FORCE_REMOUNT:P$3,FORCE_RE_RENDER:L$2,GLOBALS_UPDATED:U$3,NAVIGATE_URL:G$3,PLAY_FUNCTION_THREW_EXCEPTION:a,PRELOAD_ENTRIES:t$4,PREVIEW_BUILDER_PROGRESS:e$1,PREVIEW_KEYDOWN:W$2,REGISTER_SUBSCRIPTION:d,REQUEST_WHATS_NEW_DATA:z$3,RESET_STORY_ARGS:H$2,RESULT_WHATS_NEW_DATA:J$2,SAVE_STORY_REQUEST:EE,SAVE_STORY_RESPONSE:_E,SELECT_STORY:l$1,SET_CONFIG:i$3,SET_CURRENT_STORY:p$2,SET_FILTER:M$4,SET_GLOBALS:u$1,SET_INDEX:F$3,SET_STORIES:s$2,SET_WHATS_NEW_CACHE:Z,SHARED_STATE_CHANGED:c,SHARED_STATE_SET:g,STORIES_COLLAPSE_ALL:y,STORIES_EXPAND_ALL:h$1,STORY_ARGS_UPDATED:Q,STORY_CHANGED:f$2,STORY_ERRORED:x$3,STORY_INDEX_INVALIDATED:m$1$1,STORY_MISSING:V$1,STORY_PREPARED:w$2,STORY_RENDERED:X$2,STORY_RENDER_PHASE_CHANGED:B$2,STORY_SPECIFIED:q$3,STORY_THREW_EXCEPTION:b$2,STORY_UNCHANGED:K$2,TELEMETRY_ERROR:v$3,TESTING_MODULE_CANCEL_TEST_RUN_REQUEST:rE,TESTING_MODULE_CANCEL_TEST_RUN_RESPONSE:DE,TESTING_MODULE_CRASH_REPORT:TE,TESTING_MODULE_PROGRESS_REPORT:NE,TESTING_MODULE_RUN_ALL_REQUEST:AE,TESTING_MODULE_RUN_REQUEST:OE,TESTING_MODULE_WATCH_MODE_REQUEST:IE,TOGGLE_WHATS_NEW_NOTIFICATIONS:$$3,UNHANDLED_ERRORS_WHILE_PLAYING:Y$2,UPDATE_GLOBALS:j,UPDATE_QUERY_PARAMS:k$4,UPDATE_STORY_ARGS:n$1,default:R$2},Symbol.toStringTag,{value:"Module"}));var Qt$1=Object.create,st$1=Object.defineProperty,te$1=Object.getOwnPropertyDescriptor,ee$1=Object.getOwnPropertyNames,re$1=Object.getPrototypeOf,ne$1=Object.prototype.hasOwnProperty,i$2=(vo,Ai)=>st$1(vo,"name",{value:Ai,configurable:!0}),U$2=(vo=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(vo,{get:(Ai,bo)=>(typeof require<"u"?require:Ai)[bo]}):vo)(function(vo){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+vo+'" is not supported')}),oe$2=(vo,Ai)=>()=>(Ai||vo((Ai={exports:{}}).exports,Ai),Ai.exports),ae=(vo,Ai,bo,Ra)=>{if(Ai&&typeof Ai=="object"||typeof Ai=="function")for(let hc of ee$1(Ai))!ne$1.call(vo,hc)&&hc!==bo&&st$1(vo,hc,{get:()=>Ai[hc],enumerable:!(Ra=te$1(Ai,hc))||Ra.enumerable});return vo},ie$2=(vo,Ai,bo)=>(bo=vo!=null?Qt$1(re$1(vo)):{},ae(st$1(bo,"default",{value:vo,enumerable:!0}),vo)),At$1=oe$2((vo,Ai)=>{(function(bo){if(typeof vo=="object"&&typeof Ai<"u")Ai.exports=bo();else if(typeof define=="function"&&define.amd)define([],bo);else{var Ra;typeof window<"u"?Ra=window:typeof global<"u"?Ra=global:typeof self<"u"?Ra=self:Ra=this,Ra.memoizerific=bo()}})(function(){return i$2(function bo(Ra,hc,pc){function mc(ff,hf){if(!hc[ff]){if(!Ra[ff]){var pf=typeof U$2=="function"&&U$2;if(!hf&&pf)return pf(ff,!0);if(uf)return uf(ff,!0);var mf=new Error("Cannot find module '"+ff+"'");throw mf.code="MODULE_NOT_FOUND",mf}var gf=hc[ff]={exports:{}};Ra[ff][0].call(gf.exports,function(yf){var vf=Ra[ff][1][yf];return mc(vf||yf)},gf,gf.exports,bo,Ra,hc,pc)}return hc[ff].exports}i$2(mc,"s");for(var uf=typeof U$2=="function"&&U$2,df=0;df<pc.length;df++)mc(pc[df]);return mc},"e")({1:[function(bo,Ra,hc){Ra.exports=function(pc){if(typeof Map!="function"||pc){var mc=bo("./similar");return new mc}else return new Map}},{"./similar":2}],2:[function(bo,Ra,hc){function pc(){return this.list=[],this.lastItem=void 0,this.size=0,this}i$2(pc,"Similar"),pc.prototype.get=function(mc){var uf;if(this.lastItem&&this.isEqual(this.lastItem.key,mc))return this.lastItem.val;if(uf=this.indexOf(mc),uf>=0)return this.lastItem=this.list[uf],this.list[uf].val},pc.prototype.set=function(mc,uf){var df;return this.lastItem&&this.isEqual(this.lastItem.key,mc)?(this.lastItem.val=uf,this):(df=this.indexOf(mc),df>=0?(this.lastItem=this.list[df],this.list[df].val=uf,this):(this.lastItem={key:mc,val:uf},this.list.push(this.lastItem),this.size++,this))},pc.prototype.delete=function(mc){var uf;if(this.lastItem&&this.isEqual(this.lastItem.key,mc)&&(this.lastItem=void 0),uf=this.indexOf(mc),uf>=0)return this.size--,this.list.splice(uf,1)[0]},pc.prototype.has=function(mc){var uf;return this.lastItem&&this.isEqual(this.lastItem.key,mc)?!0:(uf=this.indexOf(mc),uf>=0?(this.lastItem=this.list[uf],!0):!1)},pc.prototype.forEach=function(mc,uf){var df;for(df=0;df<this.size;df++)mc.call(uf||this,this.list[df].val,this.list[df].key,this)},pc.prototype.indexOf=function(mc){var uf;for(uf=0;uf<this.size;uf++)if(this.isEqual(this.list[uf].key,mc))return uf;return-1},pc.prototype.isEqual=function(mc,uf){return mc===uf||mc!==mc&&uf!==uf},Ra.exports=pc},{}],3:[function(bo,Ra,hc){var pc=bo("map-or-similar");Ra.exports=function(ff){var hf=new pc(!1),pf=[];return function(mf){var gf=i$2(function(){var yf=hf,vf,bf,Sf=arguments.length-1,xf=Array(Sf+1),wf=!0,s1;if((gf.numArgs||gf.numArgs===0)&&gf.numArgs!==Sf+1)throw new Error("Memoizerific functions should always be called with the same number of arguments");for(s1=0;s1<Sf;s1++){if(xf[s1]={cacheItem:yf,arg:arguments[s1]},yf.has(arguments[s1])){yf=yf.get(arguments[s1]);continue}wf=!1,vf=new pc(!1),yf.set(arguments[s1],vf),yf=vf}return wf&&(yf.has(arguments[Sf])?bf=yf.get(arguments[Sf]):wf=!1),wf||(bf=mf.apply(null,arguments),yf.set(arguments[Sf],bf)),ff>0&&(xf[Sf]={cacheItem:yf,arg:arguments[Sf]},wf?mc(pf,xf):pf.push(xf),pf.length>ff&&uf(pf.shift())),gf.wasMemoized=wf,gf.numArgs=Sf+1,bf},"memoizerific");return gf.limit=ff,gf.wasMemoized=!1,gf.cache=hf,gf.lru=pf,gf}};function mc(ff,hf){var pf=ff.length,mf=hf.length,gf,yf,vf;for(yf=0;yf<pf;yf++){for(gf=!0,vf=0;vf<mf;vf++)if(!df(ff[yf][vf].arg,hf[vf].arg)){gf=!1;break}if(gf)break}ff.push(ff.splice(yf,1)[0])}i$2(mc,"moveToMostRecentLru");function uf(ff){var hf=ff.length,pf=ff[hf-1],mf,gf;for(pf.cacheItem.delete(pf.arg),gf=hf-2;gf>=0&&(pf=ff[gf],mf=pf.cacheItem.get(pf.arg),!mf||!mf.size);gf--)pf.cacheItem.delete(pf.arg)}i$2(uf,"removeCachedResult");function df(ff,hf){return ff===hf||ff!==ff&&hf!==hf}i$2(df,"isEqual")},{"map-or-similar":1}]},{},[3])(3)})}),b$1=(()=>{let vo;return typeof window<"u"?vo=window:typeof globalThis<"u"?vo=globalThis:typeof global<"u"?vo=global:typeof self<"u"?vo=self:vo={},vo})(),se=i$2(vo=>vo.transports!==void 0,"isMulti"),le$1=i$2(()=>Math.random().toString(16).slice(2),"generateRandomId"),lt$1=class{constructor(vo={}){this.sender=le$1(),this.events={},this.data={},this.transports=[],this.isAsync=vo.async||!1,se(vo)?(this.transports=vo.transports||[],this.transports.forEach(Ai=>{Ai.setHandler(bo=>this.handleEvent(bo))})):this.transports=vo.transport?[vo.transport]:[],this.transports.forEach(Ai=>{Ai.setHandler(bo=>this.handleEvent(bo))})}get hasTransport(){return this.transports.length>0}addListener(vo,Ai){this.events[vo]=this.events[vo]||[],this.events[vo].push(Ai)}emit(vo,...Ai){let bo={type:vo,args:Ai,from:this.sender},Ra={};Ai.length>=1&&Ai[0]&&Ai[0].options&&(Ra=Ai[0].options);let hc=i$2(()=>{this.transports.forEach(pc=>{pc.send(bo,Ra)}),this.handleEvent(bo)},"handler");this.isAsync?setImmediate(hc):hc()}last(vo){return this.data[vo]}eventNames(){return Object.keys(this.events)}listenerCount(vo){let Ai=this.listeners(vo);return Ai?Ai.length:0}listeners(vo){return this.events[vo]||void 0}once(vo,Ai){let bo=this.onceListener(vo,Ai);this.addListener(vo,bo)}removeAllListeners(vo){vo?this.events[vo]&&delete this.events[vo]:this.events={}}removeListener(vo,Ai){let bo=this.listeners(vo);bo&&(this.events[vo]=bo.filter(Ra=>Ra!==Ai))}on(vo,Ai){this.addListener(vo,Ai)}off(vo,Ai){this.removeListener(vo,Ai)}handleEvent(vo){let Ai=this.listeners(vo.type);Ai&&Ai.length&&Ai.forEach(bo=>{bo.apply(vo,vo.args)}),this.data[vo.type]=vo.args}onceListener(vo,Ai){let bo=i$2((...Ra)=>(this.removeListener(vo,bo),Ai(...Ra)),"onceListener");return bo}};i$2(lt$1,"Channel");var z$2=lt$1,ce$1=Object.create,St=Object.defineProperty,fe$1=Object.getOwnPropertyDescriptor,wt$1=Object.getOwnPropertyNames,ue$1=Object.getPrototypeOf,pe$1=Object.prototype.hasOwnProperty,x$2=i$2((vo,Ai)=>i$2(function(){return Ai||(0,vo[wt$1(vo)[0]])((Ai={exports:{}}).exports,Ai),Ai.exports},"__require"),"__commonJS"),ye$1=i$2((vo,Ai,bo,Ra)=>{if(Ai&&typeof Ai=="object"||typeof Ai=="function")for(let hc of wt$1(Ai))!pe$1.call(vo,hc)&&hc!==bo&&St(vo,hc,{get:i$2(()=>Ai[hc],"get"),enumerable:!(Ra=fe$1(Ai,hc))||Ra.enumerable});return vo},"__copyProps"),tt$1=i$2((vo,Ai,bo)=>(bo=vo!=null?ce$1(ue$1(vo)):{},ye$1(Ai||!vo||!vo.__esModule?St(bo,"default",{value:vo,enumerable:!0}):bo,vo)),"__toESM"),de$1=["bubbles","cancelBubble","cancelable","composed","currentTarget","defaultPrevented","eventPhase","isTrusted","returnValue","srcElement","target","timeStamp","type"],he$1=["detail"];function Et$1(vo){let Ai=de$1.filter(bo=>vo[bo]!==void 0).reduce((bo,Ra)=>({...bo,[Ra]:vo[Ra]}),{});return vo instanceof CustomEvent&&he$1.filter(bo=>vo[bo]!==void 0).forEach(bo=>{Ai[bo]=vo[bo]}),Ai}i$2(Et$1,"extractEventHiddenProperties");var Ut$1=ie$2(At$1()),Tt$1=x$2({"node_modules/has-symbols/shams.js"(vo,Ai){Ai.exports=i$2(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var bo={},Ra=Symbol("test"),hc=Object(Ra);if(typeof Ra=="string"||Object.prototype.toString.call(Ra)!=="[object Symbol]"||Object.prototype.toString.call(hc)!=="[object Symbol]")return!1;var pc=42;bo[Ra]=pc;for(Ra in bo)return!1;if(typeof Object.keys=="function"&&Object.keys(bo).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(bo).length!==0)return!1;var mc=Object.getOwnPropertySymbols(bo);if(mc.length!==1||mc[0]!==Ra||!Object.prototype.propertyIsEnumerable.call(bo,Ra))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var uf=Object.getOwnPropertyDescriptor(bo,Ra);if(uf.value!==pc||uf.enumerable!==!0)return!1}return!0},"hasSymbols")}}),Ft$1=x$2({"node_modules/has-symbols/index.js"(vo,Ai){var bo=typeof Symbol<"u"&&Symbol,Ra=Tt$1();Ai.exports=i$2(function(){return typeof bo!="function"||typeof Symbol!="function"||typeof bo("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Ra()},"hasNativeSymbols")}}),ge$1=x$2({"node_modules/function-bind/implementation.js"(vo,Ai){var bo="Function.prototype.bind called on incompatible ",Ra=Array.prototype.slice,hc=Object.prototype.toString,pc="[object Function]";Ai.exports=i$2(function(mc){var uf=this;if(typeof uf!="function"||hc.call(uf)!==pc)throw new TypeError(bo+uf);for(var df=Ra.call(arguments,1),ff,hf=i$2(function(){if(this instanceof ff){var vf=uf.apply(this,df.concat(Ra.call(arguments)));return Object(vf)===vf?vf:this}else return uf.apply(mc,df.concat(Ra.call(arguments)))},"binder"),pf=Math.max(0,uf.length-df.length),mf=[],gf=0;gf<pf;gf++)mf.push("$"+gf);if(ff=Function("binder","return function ("+mf.join(",")+"){ return binder.apply(this,arguments); }")(hf),uf.prototype){var yf=i$2(function(){},"Empty2");yf.prototype=uf.prototype,ff.prototype=new yf,yf.prototype=null}return ff},"bind")}}),ut=x$2({"node_modules/function-bind/index.js"(vo,Ai){var bo=ge$1();Ai.exports=Function.prototype.bind||bo}}),me$1=x$2({"node_modules/has/src/index.js"(vo,Ai){var bo=ut();Ai.exports=bo.call(Function.call,Object.prototype.hasOwnProperty)}}),Nt$1=x$2({"node_modules/get-intrinsic/index.js"(vo,Ai){var bo,Ra=SyntaxError,hc=Function,pc=TypeError,mc=i$2(function($1){try{return hc('"use strict"; return ('+$1+").constructor;")()}catch{}},"getEvalledConstructor"),uf=Object.getOwnPropertyDescriptor;if(uf)try{uf({},"")}catch{uf=null}var df=i$2(function(){throw new pc},"throwTypeError"),ff=uf?function(){try{return arguments.callee,df}catch{try{return uf(arguments,"callee").get}catch{return df}}}():df,hf=Ft$1()(),pf=Object.getPrototypeOf||function($1){return $1.__proto__},mf={},gf=typeof Uint8Array>"u"?bo:pf(Uint8Array),yf={"%AggregateError%":typeof AggregateError>"u"?bo:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?bo:ArrayBuffer,"%ArrayIteratorPrototype%":hf?pf([][Symbol.iterator]()):bo,"%AsyncFromSyncIteratorPrototype%":bo,"%AsyncFunction%":mf,"%AsyncGenerator%":mf,"%AsyncGeneratorFunction%":mf,"%AsyncIteratorPrototype%":mf,"%Atomics%":typeof Atomics>"u"?bo:Atomics,"%BigInt%":typeof BigInt>"u"?bo:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?bo:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?bo:Float32Array,"%Float64Array%":typeof Float64Array>"u"?bo:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?bo:FinalizationRegistry,"%Function%":hc,"%GeneratorFunction%":mf,"%Int8Array%":typeof Int8Array>"u"?bo:Int8Array,"%Int16Array%":typeof Int16Array>"u"?bo:Int16Array,"%Int32Array%":typeof Int32Array>"u"?bo:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hf?pf(pf([][Symbol.iterator]())):bo,"%JSON%":typeof JSON=="object"?JSON:bo,"%Map%":typeof Map>"u"?bo:Map,"%MapIteratorPrototype%":typeof Map>"u"||!hf?bo:pf(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?bo:Promise,"%Proxy%":typeof Proxy>"u"?bo:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?bo:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?bo:Set,"%SetIteratorPrototype%":typeof Set>"u"||!hf?bo:pf(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?bo:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hf?pf(""[Symbol.iterator]()):bo,"%Symbol%":hf?Symbol:bo,"%SyntaxError%":Ra,"%ThrowTypeError%":ff,"%TypedArray%":gf,"%TypeError%":pc,"%Uint8Array%":typeof Uint8Array>"u"?bo:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?bo:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?bo:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?bo:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?bo:WeakMap,"%WeakRef%":typeof WeakRef>"u"?bo:WeakRef,"%WeakSet%":typeof WeakSet>"u"?bo:WeakSet},vf=i$2(function $1(D1){var f1;if(D1==="%AsyncFunction%")f1=mc("async function () {}");else if(D1==="%GeneratorFunction%")f1=mc("function* () {}");else if(D1==="%AsyncGeneratorFunction%")f1=mc("async function* () {}");else if(D1==="%AsyncGenerator%"){var T1=$1("%AsyncGeneratorFunction%");T1&&(f1=T1.prototype)}else if(D1==="%AsyncIteratorPrototype%"){var A1=$1("%AsyncGenerator%");A1&&(f1=pf(A1.prototype))}return yf[D1]=f1,f1},"doEval2"),bf={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Sf=ut(),xf=me$1(),wf=Sf.call(Function.call,Array.prototype.concat),s1=Sf.call(Function.apply,Array.prototype.splice),If=Sf.call(Function.call,String.prototype.replace),l1=Sf.call(Function.call,String.prototype.slice),c1=Sf.call(Function.call,RegExp.prototype.exec),m1=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,k1=/\\(\\)?/g,N1=i$2(function($1){var D1=l1($1,0,1),f1=l1($1,-1);if(D1==="%"&&f1!=="%")throw new Ra("invalid intrinsic syntax, expected closing `%`");if(f1==="%"&&D1!=="%")throw new Ra("invalid intrinsic syntax, expected opening `%`");var T1=[];return If($1,m1,function(A1,L1,B1,V1){T1[T1.length]=B1?If(V1,k1,"$1"):L1||A1}),T1},"stringToPath3"),R1=i$2(function($1,D1){var f1=$1,T1;if(xf(bf,f1)&&(T1=bf[f1],f1="%"+T1[0]+"%"),xf(yf,f1)){var A1=yf[f1];if(A1===mf&&(A1=vf(f1)),typeof A1>"u"&&!D1)throw new pc("intrinsic "+$1+" exists, but is not available. Please file an issue!");return{alias:T1,name:f1,value:A1}}throw new Ra("intrinsic "+$1+" does not exist!")},"getBaseIntrinsic2");Ai.exports=i$2(function($1,D1){if(typeof $1!="string"||$1.length===0)throw new pc("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof D1!="boolean")throw new pc('"allowMissing" argument must be a boolean');if(c1(/^%?[^%]*%?$/,$1)===null)throw new Ra("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var f1=N1($1),T1=f1.length>0?f1[0]:"",A1=R1("%"+T1+"%",D1),L1=A1.name,B1=A1.value,V1=!1,Z1=A1.alias;Z1&&(T1=Z1[0],s1(f1,wf([0,1],Z1)));for(var H1=1,E1=!0;H1<f1.length;H1+=1){var F1=f1[H1],M1=l1(F1,0,1),q1=l1(F1,-1);if((M1==='"'||M1==="'"||M1==="`"||q1==='"'||q1==="'"||q1==="`")&&M1!==q1)throw new Ra("property names with quotes must have matching quotes");if((F1==="constructor"||!E1)&&(V1=!0),T1+="."+F1,L1="%"+T1+"%",xf(yf,L1))B1=yf[L1];else if(B1!=null){if(!(F1 in B1)){if(!D1)throw new pc("base intrinsic for "+$1+" exists, but the property is not available.");return}if(uf&&H1+1>=f1.length){var z1=uf(B1,F1);E1=!!z1,E1&&"get"in z1&&!("originalValue"in z1.get)?B1=z1.get:B1=B1[F1]}else E1=xf(B1,F1),B1=B1[F1];E1&&!V1&&(yf[L1]=B1)}}return B1},"GetIntrinsic")}}),ve$1=x$2({"node_modules/call-bind/index.js"(vo,Ai){var bo=ut(),Ra=Nt$1(),hc=Ra("%Function.prototype.apply%"),pc=Ra("%Function.prototype.call%"),mc=Ra("%Reflect.apply%",!0)||bo.call(pc,hc),uf=Ra("%Object.getOwnPropertyDescriptor%",!0),df=Ra("%Object.defineProperty%",!0),ff=Ra("%Math.max%");if(df)try{df({},"a",{value:1})}catch{df=null}Ai.exports=i$2(function(pf){var mf=mc(bo,pc,arguments);if(uf&&df){var gf=uf(mf,"length");gf.configurable&&df(mf,"length",{value:1+ff(0,pf.length-(arguments.length-1))})}return mf},"callBind");var hf=i$2(function(){return mc(bo,hc,arguments)},"applyBind2");df?df(Ai.exports,"apply",{value:hf}):Ai.exports.apply=hf}}),_e=x$2({"node_modules/call-bind/callBound.js"(vo,Ai){var bo=Nt$1(),Ra=ve$1(),hc=Ra(bo("String.prototype.indexOf"));Ai.exports=i$2(function(pc,mc){var uf=bo(pc,!!mc);return typeof uf=="function"&&hc(pc,".prototype.")>-1?Ra(uf):uf},"callBoundIntrinsic")}}),be$1=x$2({"node_modules/has-tostringtag/shams.js"(vo,Ai){var bo=Tt$1();Ai.exports=i$2(function(){return bo()&&!!Symbol.toStringTag},"hasToStringTagShams")}}),Se=x$2({"node_modules/is-regex/index.js"(vo,Ai){var bo=_e(),Ra=be$1()(),hc,pc,mc,uf;Ra&&(hc=bo("Object.prototype.hasOwnProperty"),pc=bo("RegExp.prototype.exec"),mc={},df=i$2(function(){throw mc},"throwRegexMarker"),uf={toString:df,valueOf:df},typeof Symbol.toPrimitive=="symbol"&&(uf[Symbol.toPrimitive]=df));var df,ff=bo("Object.prototype.toString"),hf=Object.getOwnPropertyDescriptor,pf="[object RegExp]";Ai.exports=i$2(Ra?function(mf){if(!mf||typeof mf!="object")return!1;var gf=hf(mf,"lastIndex"),yf=gf&&hc(gf,"value");if(!yf)return!1;try{pc(mf,uf)}catch(vf){return vf===mc}}:function(mf){return!mf||typeof mf!="object"&&typeof mf!="function"?!1:ff(mf)===pf},"isRegex")}}),we=x$2({"node_modules/is-function/index.js"(vo,Ai){Ai.exports=Ra;var bo=Object.prototype.toString;function Ra(hc){if(!hc)return!1;var pc=bo.call(hc);return pc==="[object Function]"||typeof hc=="function"&&pc!=="[object RegExp]"||typeof window<"u"&&(hc===window.setTimeout||hc===window.alert||hc===window.confirm||hc===window.prompt)}i$2(Ra,"isFunction3")}}),Ee$1=x$2({"node_modules/is-symbol/index.js"(vo,Ai){var bo=Object.prototype.toString,Ra=Ft$1()();Ra?(hc=Symbol.prototype.toString,pc=/^Symbol\(.*\)$/,mc=i$2(function(uf){return typeof uf.valueOf()!="symbol"?!1:pc.test(hc.call(uf))},"isRealSymbolObject"),Ai.exports=i$2(function(uf){if(typeof uf=="symbol")return!0;if(bo.call(uf)!=="[object Symbol]")return!1;try{return mc(uf)}catch{return!1}},"isSymbol3")):Ai.exports=i$2(function(uf){return!1},"isSymbol3");var hc,pc,mc}}),Oe$1=tt$1(Se()),Ae$1=tt$1(we()),Pe$1=tt$1(Ee$1());function xe(vo){return vo!=null&&typeof vo=="object"&&Array.isArray(vo)===!1}i$2(xe,"isObject");var Ce$1=typeof global=="object"&&global&&global.Object===Object&&global,Ie$1=Ce$1,je$1=typeof self=="object"&&self&&self.Object===Object&&self,Te=Ie$1||je$1||Function("return this")(),pt$1=Te,Fe$1=pt$1.Symbol,M$3=Fe$1,Rt$1=Object.prototype,Ne=Rt$1.hasOwnProperty,Re$1=Rt$1.toString,W$1=M$3?M$3.toStringTag:void 0;function Me$1(vo){var Ai=Ne.call(vo,W$1),bo=vo[W$1];try{vo[W$1]=void 0;var Ra=!0}catch{}var hc=Re$1.call(vo);return Ra&&(Ai?vo[W$1]=bo:delete vo[W$1]),hc}i$2(Me$1,"getRawTag");var $e$1=Me$1,ke$1=Object.prototype,De$1=ke$1.toString;function Le(vo){return De$1.call(vo)}i$2(Le,"objectToString");var Ue$1=Le,ze$1="[object Null]",We$1="[object Undefined]",Pt$1=M$3?M$3.toStringTag:void 0;function Be$1(vo){return vo==null?vo===void 0?We$1:ze$1:Pt$1&&Pt$1 in Object(vo)?$e$1(vo):Ue$1(vo)}i$2(Be$1,"baseGetTag");var Mt$1=Be$1;function He$1(vo){return vo!=null&&typeof vo=="object"}i$2(He$1,"isObjectLike");var qe$1=He$1,Ge$1="[object Symbol]";function Je(vo){return typeof vo=="symbol"||qe$1(vo)&&Mt$1(vo)==Ge$1}i$2(Je,"isSymbol");var yt$1=Je;function Ve$1(vo,Ai){for(var bo=-1,Ra=vo==null?0:vo.length,hc=Array(Ra);++bo<Ra;)hc[bo]=Ai(vo[bo],bo,vo);return hc}i$2(Ve$1,"arrayMap");var Ke$1=Ve$1,Ye$1=Array.isArray,dt=Ye$1,Ze=1/0,xt$1=M$3?M$3.prototype:void 0,Ct$1=xt$1?xt$1.toString:void 0;function $t$1(vo){if(typeof vo=="string")return vo;if(dt(vo))return Ke$1(vo,$t$1)+"";if(yt$1(vo))return Ct$1?Ct$1.call(vo):"";var Ai=vo+"";return Ai=="0"&&1/vo==-Ze?"-0":Ai}i$2($t$1,"baseToString");var Xe$1=$t$1;function Qe$1(vo){var Ai=typeof vo;return vo!=null&&(Ai=="object"||Ai=="function")}i$2(Qe$1,"isObject2");var kt$1=Qe$1,tr$1="[object AsyncFunction]",er="[object Function]",rr="[object GeneratorFunction]",nr="[object Proxy]";function or(vo){if(!kt$1(vo))return!1;var Ai=Mt$1(vo);return Ai==er||Ai==rr||Ai==tr$1||Ai==nr}i$2(or,"isFunction");var ar=or,ir=pt$1["__core-js_shared__"],ft$1=ir,It$1=function(){var vo=/[^.]+$/.exec(ft$1&&ft$1.keys&&ft$1.keys.IE_PROTO||"");return vo?"Symbol(src)_1."+vo:""}();function sr(vo){return!!It$1&&It$1 in vo}i$2(sr,"isMasked");var lr=sr,cr=Function.prototype,fr$1=cr.toString;function ur$1(vo){if(vo!=null){try{return fr$1.call(vo)}catch{}try{return vo+""}catch{}}return""}i$2(ur$1,"toSource");var pr$1=ur$1,yr$1=/[\\^$.*+?()[\]{}|]/g,dr=/^\[object .+?Constructor\]$/,hr$1=Function.prototype,gr$1=Object.prototype,mr$1=hr$1.toString,vr$1=gr$1.hasOwnProperty,_r$1=RegExp("^"+mr$1.call(vr$1).replace(yr$1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function br$1(vo){if(!kt$1(vo)||lr(vo))return!1;var Ai=ar(vo)?_r$1:dr;return Ai.test(pr$1(vo))}i$2(br$1,"baseIsNative");var Sr$1=br$1;function wr$1(vo,Ai){return vo==null?void 0:vo[Ai]}i$2(wr$1,"getValue");var Er$1=wr$1;function Or(vo,Ai){var bo=Er$1(vo,Ai);return Sr$1(bo)?bo:void 0}i$2(Or,"getNative");var Dt$1=Or;function Ar$1(vo,Ai){return vo===Ai||vo!==vo&&Ai!==Ai}i$2(Ar$1,"eq");var Pr$1=Ar$1,xr$1=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Cr$1=/^\w*$/;function Ir$1(vo,Ai){if(dt(vo))return!1;var bo=typeof vo;return bo=="number"||bo=="symbol"||bo=="boolean"||vo==null||yt$1(vo)?!0:Cr$1.test(vo)||!xr$1.test(vo)||Ai!=null&&vo in Object(Ai)}i$2(Ir$1,"isKey");var jr$1=Ir$1,Tr$1=Dt$1(Object,"create"),B$1=Tr$1;function Fr(){this.__data__=B$1?B$1(null):{},this.size=0}i$2(Fr,"hashClear");var Nr$1=Fr;function Rr$1(vo){var Ai=this.has(vo)&&delete this.__data__[vo];return this.size-=Ai?1:0,Ai}i$2(Rr$1,"hashDelete");var Mr$1=Rr$1,$r$1="__lodash_hash_undefined__",kr$1=Object.prototype,Dr$1=kr$1.hasOwnProperty;function Lr$1(vo){var Ai=this.__data__;if(B$1){var bo=Ai[vo];return bo===$r$1?void 0:bo}return Dr$1.call(Ai,vo)?Ai[vo]:void 0}i$2(Lr$1,"hashGet");var Ur$1=Lr$1,zr$1=Object.prototype,Wr$1=zr$1.hasOwnProperty;function Br$1(vo){var Ai=this.__data__;return B$1?Ai[vo]!==void 0:Wr$1.call(Ai,vo)}i$2(Br$1,"hashHas");var Hr$1=Br$1,qr$1="__lodash_hash_undefined__";function Gr$1(vo,Ai){var bo=this.__data__;return this.size+=this.has(vo)?0:1,bo[vo]=B$1&&Ai===void 0?qr$1:Ai,this}i$2(Gr$1,"hashSet");var Jr$1=Gr$1;function $$2(vo){var Ai=-1,bo=vo==null?0:vo.length;for(this.clear();++Ai<bo;){var Ra=vo[Ai];this.set(Ra[0],Ra[1])}}i$2($$2,"Hash");$$2.prototype.clear=Nr$1;$$2.prototype.delete=Mr$1;$$2.prototype.get=Ur$1;$$2.prototype.has=Hr$1;$$2.prototype.set=Jr$1;var jt$1=$$2;function Vr$1(){this.__data__=[],this.size=0}i$2(Vr$1,"listCacheClear");var Kr$1=Vr$1;function Yr$1(vo,Ai){for(var bo=vo.length;bo--;)if(Pr$1(vo[bo][0],Ai))return bo;return-1}i$2(Yr$1,"assocIndexOf");var rt=Yr$1,Zr=Array.prototype,Xr=Zr.splice;function Qr$1(vo){var Ai=this.__data__,bo=rt(Ai,vo);if(bo<0)return!1;var Ra=Ai.length-1;return bo==Ra?Ai.pop():Xr.call(Ai,bo,1),--this.size,!0}i$2(Qr$1,"listCacheDelete");var tn=Qr$1;function en(vo){var Ai=this.__data__,bo=rt(Ai,vo);return bo<0?void 0:Ai[bo][1]}i$2(en,"listCacheGet");var rn=en;function nn(vo){return rt(this.__data__,vo)>-1}i$2(nn,"listCacheHas");var on=nn;function an(vo,Ai){var bo=this.__data__,Ra=rt(bo,vo);return Ra<0?(++this.size,bo.push([vo,Ai])):bo[Ra][1]=Ai,this}i$2(an,"listCacheSet");var sn=an;function k$3(vo){var Ai=-1,bo=vo==null?0:vo.length;for(this.clear();++Ai<bo;){var Ra=vo[Ai];this.set(Ra[0],Ra[1])}}i$2(k$3,"ListCache");k$3.prototype.clear=Kr$1;k$3.prototype.delete=tn;k$3.prototype.get=rn;k$3.prototype.has=on;k$3.prototype.set=sn;var ln=k$3,cn$1=Dt$1(pt$1,"Map"),fn=cn$1;function un(){this.size=0,this.__data__={hash:new jt$1,map:new(fn||ln),string:new jt$1}}i$2(un,"mapCacheClear");var pn$1=un;function yn(vo){var Ai=typeof vo;return Ai=="string"||Ai=="number"||Ai=="symbol"||Ai=="boolean"?vo!=="__proto__":vo===null}i$2(yn,"isKeyable");var dn=yn;function hn(vo,Ai){var bo=vo.__data__;return dn(Ai)?bo[typeof Ai=="string"?"string":"hash"]:bo.map}i$2(hn,"getMapData");var nt=hn;function gn(vo){var Ai=nt(this,vo).delete(vo);return this.size-=Ai?1:0,Ai}i$2(gn,"mapCacheDelete");var mn=gn;function vn$1(vo){return nt(this,vo).get(vo)}i$2(vn$1,"mapCacheGet");var _n$1=vn$1;function bn(vo){return nt(this,vo).has(vo)}i$2(bn,"mapCacheHas");var Sn=bn;function wn$1(vo,Ai){var bo=nt(this,vo),Ra=bo.size;return bo.set(vo,Ai),this.size+=bo.size==Ra?0:1,this}i$2(wn$1,"mapCacheSet");var En$1=wn$1;function D$2(vo){var Ai=-1,bo=vo==null?0:vo.length;for(this.clear();++Ai<bo;){var Ra=vo[Ai];this.set(Ra[0],Ra[1])}}i$2(D$2,"MapCache");D$2.prototype.clear=pn$1;D$2.prototype.delete=mn;D$2.prototype.get=_n$1;D$2.prototype.has=Sn;D$2.prototype.set=En$1;var Lt$1=D$2,On$1="Expected a function";function ht$1(vo,Ai){if(typeof vo!="function"||Ai!=null&&typeof Ai!="function")throw new TypeError(On$1);var bo=i$2(function(){var Ra=arguments,hc=Ai?Ai.apply(this,Ra):Ra[0],pc=bo.cache;if(pc.has(hc))return pc.get(hc);var mc=vo.apply(this,Ra);return bo.cache=pc.set(hc,mc)||pc,mc},"memoized");return bo.cache=new(ht$1.Cache||Lt$1),bo}i$2(ht$1,"memoize");ht$1.Cache=Lt$1;var An$1=ht$1,Pn$1=500;function xn(vo){var Ai=An$1(vo,function(Ra){return bo.size===Pn$1&&bo.clear(),Ra}),bo=Ai.cache;return Ai}i$2(xn,"memoizeCapped");var Cn$1=xn,In$1=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,jn$1=/\\(\\)?/g,Tn=Cn$1(function(vo){var Ai=[];return vo.charCodeAt(0)===46&&Ai.push(""),vo.replace(In$1,function(bo,Ra,hc,pc){Ai.push(hc?pc.replace(jn$1,"$1"):Ra||bo)}),Ai}),Fn$1=Tn;function Nn$1(vo){return vo==null?"":Xe$1(vo)}i$2(Nn$1,"toString");var Rn$1=Nn$1;function Mn$1(vo,Ai){return dt(vo)?vo:jr$1(vo,Ai)?[vo]:Fn$1(Rn$1(vo))}i$2(Mn$1,"castPath");var $n$1=Mn$1,kn$1=1/0;function Dn$1(vo){if(typeof vo=="string"||yt$1(vo))return vo;var Ai=vo+"";return Ai=="0"&&1/vo==-kn$1?"-0":Ai}i$2(Dn$1,"toKey");var Ln=Dn$1;function Un$1(vo,Ai){Ai=$n$1(Ai,vo);for(var bo=0,Ra=Ai.length;vo!=null&&bo<Ra;)vo=vo[Ln(Ai[bo++])];return bo&&bo==Ra?vo:void 0}i$2(Un$1,"baseGet");var zn=Un$1;function Wn$1(vo,Ai,bo){var Ra=vo==null?void 0:zn(vo,Ai);return Ra===void 0?bo:Ra}i$2(Wn$1,"get");var Bn=Wn$1,et$1=xe,Hn$1=i$2(vo=>{let Ai=null,bo=!1,Ra=!1,hc=!1,pc="";if(vo.indexOf("//")>=0||vo.indexOf("/*")>=0)for(let mc=0;mc<vo.length;mc+=1)!Ai&&!bo&&!Ra&&!hc?vo[mc]==='"'||vo[mc]==="'"||vo[mc]==="`"?Ai=vo[mc]:vo[mc]==="/"&&vo[mc+1]==="*"?bo=!0:vo[mc]==="/"&&vo[mc+1]==="/"?Ra=!0:vo[mc]==="/"&&vo[mc+1]!=="/"&&(hc=!0):(Ai&&(vo[mc]===Ai&&vo[mc-1]!=="\\"||vo[mc]===`
|
|
82
|
-
`&&Ai!=="`")&&(Ai=null),hc&&(vo[mc]==="/"&&vo[mc-1]!=="\\"||vo[mc]===`
|
|
83
|
-
`)&&(hc=!1),bo&&vo[mc-1]==="/"&&vo[mc-2]==="*"&&(bo=!1),Ra&&vo[mc]===`
|
|
84
|
-
`&&(Ra=!1)),!bo&&!Ra&&(pc+=vo[mc]);else pc=vo;return pc},"removeCodeComments"),qn=(0,Ut$1.default)(1e4)(vo=>Hn$1(vo).replace(/\n\s*/g,"").trim()),Gn=i$2(function(vo,Ai){let bo=Ai.slice(0,Ai.indexOf("{")),Ra=Ai.slice(Ai.indexOf("{"));if(bo.includes("=>")||bo.includes("function"))return Ai;let hc=bo;return hc=hc.replace(vo,"function"),hc+Ra},"convertShorthandMethods2"),Jn$1=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$/,H$1=i$2(vo=>vo.match(/^[\[\{\"\}].*[\]\}\"]$/),"isJSON");function zt$1(vo){if(!et$1(vo))return vo;let Ai=vo,bo=!1;return typeof Event<"u"&&vo instanceof Event&&(Ai=Et$1(Ai),bo=!0),Ai=Object.keys(Ai).reduce((Ra,hc)=>{try{Ai[hc]&&Ai[hc].toJSON,Ra[hc]=Ai[hc]}catch{bo=!0}return Ra},{}),bo?Ai:vo}i$2(zt$1,"convertUnconventionalData");var Vn$1=i$2(function(vo){let Ai,bo,Ra,hc;return i$2(function(pc,mc){try{if(pc==="")return hc=[],Ai=new Map([[mc,"[]"]]),bo=new Map,Ra=[],mc;let uf=bo.get(this)||this;for(;Ra.length&&uf!==Ra[0];)Ra.shift(),hc.pop();if(typeof mc=="boolean")return mc;if(mc===void 0)return vo.allowUndefined?"_undefined_":void 0;if(mc===null)return null;if(typeof mc=="number")return mc===-1/0?"_-Infinity_":mc===1/0?"_Infinity_":Number.isNaN(mc)?"_NaN_":mc;if(typeof mc=="bigint")return`_bigint_${mc.toString()}`;if(typeof mc=="string")return Jn$1.test(mc)?vo.allowDate?`_date_${mc}`:void 0:mc;if((0,Oe$1.default)(mc))return vo.allowRegExp?`_regexp_${mc.flags}|${mc.source}`:void 0;if((0,Ae$1.default)(mc)){if(!vo.allowFunction)return;let{name:ff}=mc,hf=mc.toString();return hf.match(/(\[native code\]|WEBPACK_IMPORTED_MODULE|__webpack_exports__|__webpack_require__)/)?`_function_${ff}|${(()=>{}).toString()}`:`_function_${ff}|${qn(Gn(pc,hf))}`}if((0,Pe$1.default)(mc)){if(!vo.allowSymbol)return;let ff=Symbol.keyFor(mc);return ff!==void 0?`_gsymbol_${ff}`:`_symbol_${mc.toString().slice(7,-1)}`}if(Ra.length>=vo.maxDepth)return Array.isArray(mc)?`[Array(${mc.length})]`:"[Object]";if(mc===this)return`_duplicate_${JSON.stringify(hc)}`;if(mc instanceof Error&&vo.allowError)return{__isConvertedError__:!0,errorProperties:{...mc.cause?{cause:mc.cause}:{},...mc,name:mc.name,message:mc.message,stack:mc.stack,"_constructor-name_":mc.constructor.name}};if(mc.constructor&&mc.constructor.name&&mc.constructor.name!=="Object"&&!Array.isArray(mc)&&!vo.allowClass)return;let df=Ai.get(mc);if(!df){let ff=Array.isArray(mc)?mc:zt$1(mc);if(mc.constructor&&mc.constructor.name&&mc.constructor.name!=="Object"&&!Array.isArray(mc)&&vo.allowClass)try{Object.assign(ff,{"_constructor-name_":mc.constructor.name})}catch{}return hc.push(pc),Ra.unshift(ff),Ai.set(mc,JSON.stringify(hc)),mc!==ff&&bo.set(mc,ff),ff}return`_duplicate_${df}`}catch{return}},"replace")},"replacer2"),Kn$1=i$2(function reviver(options){let refs=[],root;return i$2(function revive(key,value){if(key===""&&(root=value,refs.forEach(({target:vo,container:Ai,replacement:bo})=>{let Ra=H$1(bo)?JSON.parse(bo):bo.split(".");Ra.length===0?Ai[vo]=root:Ai[vo]=Bn(root,Ra)})),key==="_constructor-name_")return value;if(et$1(value)&&value.__isConvertedError__){let{message:vo,...Ai}=value.errorProperties,bo=new Error(vo);return Object.assign(bo,Ai),bo}if(et$1(value)&&value["_constructor-name_"]&&options.allowFunction){let vo=value["_constructor-name_"];if(vo!=="Object"){let Ai=new Function(`return function ${vo.replace(/[^a-zA-Z0-9$_]+/g,"")}(){}`)();Object.setPrototypeOf(value,new Ai)}return delete value["_constructor-name_"],value}if(typeof value=="string"&&value.startsWith("_function_")&&options.allowFunction){let[,name,source]=value.match(/_function_([^|]*)\|(.*)/)||[],sourceSanitized=source.replace(/[(\(\))|\\| |\]|`]*$/,"");if(!options.lazyEval)return eval(`(${sourceSanitized})`);let result=i$2((...args)=>{let f=eval(`(${sourceSanitized})`);return f(...args)},"result");return Object.defineProperty(result,"toString",{value:i$2(()=>sourceSanitized,"value")}),Object.defineProperty(result,"name",{value:name}),result}if(typeof value=="string"&&value.startsWith("_regexp_")&&options.allowRegExp){let[,vo,Ai]=value.match(/_regexp_([^|]*)\|(.*)/)||[];return new RegExp(Ai,vo)}return typeof value=="string"&&value.startsWith("_date_")&&options.allowDate?new Date(value.replace("_date_","")):typeof value=="string"&&value.startsWith("_duplicate_")?(refs.push({target:key,container:this,replacement:value.replace(/^_duplicate_/,"")}),null):typeof value=="string"&&value.startsWith("_symbol_")&&options.allowSymbol?Symbol(value.replace("_symbol_","")):typeof value=="string"&&value.startsWith("_gsymbol_")&&options.allowSymbol?Symbol.for(value.replace("_gsymbol_","")):typeof value=="string"&&value==="_-Infinity_"?-1/0:typeof value=="string"&&value==="_Infinity_"?1/0:typeof value=="string"&&value==="_NaN_"?NaN:typeof value=="string"&&value.startsWith("_bigint_")&&typeof BigInt=="function"?BigInt(value.replace("_bigint_","")):value},"revive")},"reviver"),Wt$1={maxDepth:10,space:void 0,allowFunction:!0,allowRegExp:!0,allowDate:!0,allowClass:!0,allowError:!0,allowUndefined:!0,allowSymbol:!0,lazyEval:!0},ot=i$2((vo,Ai={})=>{let bo={...Wt$1,...Ai};return JSON.stringify(zt$1(vo),Vn$1(bo),Ai.space)},"stringify"),Yn$1=i$2(()=>{let vo=new Map;return i$2(function Ai(bo){et$1(bo)&&Object.entries(bo).forEach(([Ra,hc])=>{hc==="_undefined_"?bo[Ra]=void 0:vo.get(hc)||(vo.set(hc,!0),Ai(hc))}),Array.isArray(bo)&&bo.forEach((Ra,hc)=>{Ra==="_undefined_"?(vo.set(Ra,!0),bo[hc]=void 0):vo.get(Ra)||(vo.set(Ra,!0),Ai(Ra))})},"mutateUndefined")},"mutator"),at$1=i$2((vo,Ai={})=>{let bo={...Wt$1,...Ai},Ra=JSON.parse(vo,Kn$1(bo));return Yn$1()(Ra),Ra},"parse"),gt$1="Invariant failed";function q$2(vo,Ai){if(!vo){var bo=typeof Ai=="function"?Ai():Ai,Ra=bo?"".concat(gt$1,": ").concat(bo):gt$1;throw new Error(Ra)}}i$2(q$2,"invariant");var Bt$1=i$2(vo=>{let Ai=Array.from(document.querySelectorAll("iframe[data-is-storybook]")),[bo,...Ra]=Ai.filter(pc=>{var mc,uf;try{return((mc=pc.contentWindow)==null?void 0:mc.location.origin)===vo.source.location.origin&&((uf=pc.contentWindow)==null?void 0:uf.location.pathname)===vo.source.location.pathname}catch{}try{return pc.contentWindow===vo.source}catch{}let df=pc.getAttribute("src"),ff;try{if(!df)return!1;({origin:ff}=new URL(df,document.location.toString()))}catch{return!1}return ff===vo.origin}),hc=bo==null?void 0:bo.getAttribute("src");if(hc&&Ra.length===0){let{protocol:pc,host:mc,pathname:uf}=new URL(hc,document.location.toString());return`${pc}//${mc}${uf}`}return Ra.length>0&&s$3.error("found multiple candidates for event source"),null},"getEventSourceUrl"),{document:mt$1,location:vt$1}=b$1,Gt$1="storybook-channel",to$1={allowFunction:!1,maxDepth:25},_t$1=class{constructor(vo){if(this.config=vo,this.connected=!1,this.buffer=[],typeof(b$1==null?void 0:b$1.addEventListener)=="function"&&b$1.addEventListener("message",this.handleEvent.bind(this),!1),vo.page!=="manager"&&vo.page!=="preview")throw new Error(`postmsg-channel: "config.page" cannot be "${vo.page}"`)}setHandler(vo){this.handler=(...Ai)=>{vo.apply(this,Ai),!this.connected&&this.getLocalFrame().length&&(this.flush(),this.connected=!0)}}send(vo,Ai){let{target:bo,allowRegExp:Ra,allowFunction:hc,allowSymbol:pc,allowDate:mc,allowError:uf,allowUndefined:df,allowClass:ff,maxDepth:hf,space:pf,lazyEval:mf}=Ai||{},gf=Object.fromEntries(Object.entries({allowRegExp:Ra,allowFunction:hc,allowSymbol:pc,allowDate:mc,allowError:uf,allowUndefined:df,allowClass:ff,maxDepth:hf,space:pf,lazyEval:mf}).filter(([xf,wf])=>typeof wf<"u")),yf={...to$1,...b$1.CHANNEL_OPTIONS||{},...gf},vf=this.getFrames(bo),bf=new URLSearchParams((vt$1==null?void 0:vt$1.search)||""),Sf=ot({key:Gt$1,event:vo,refId:bf.get("refId")},yf);return vf.length?(this.buffer.length&&this.flush(),vf.forEach(xf=>{try{xf.postMessage(Sf,"*")}catch{s$3.error("sending over postmessage fail")}}),Promise.resolve(null)):new Promise((xf,wf)=>{this.buffer.push({event:vo,resolve:xf,reject:wf})})}flush(){let{buffer:vo}=this;this.buffer=[],vo.forEach(Ai=>{this.send(Ai.event).then(Ai.resolve).catch(Ai.reject)})}getFrames(vo){if(this.config.page==="manager"){let Ai=Array.from(mt$1.querySelectorAll("iframe[data-is-storybook][data-is-loaded]")).flatMap(bo=>{try{return bo.contentWindow&&bo.dataset.isStorybook!==void 0&&bo.id===vo?[bo.contentWindow]:[]}catch{return[]}});return Ai!=null&&Ai.length?Ai:this.getCurrentFrames()}return b$1&&b$1.parent&&b$1.parent!==b$1.self?[b$1.parent]:[]}getCurrentFrames(){return this.config.page==="manager"?Array.from(mt$1.querySelectorAll('[data-is-storybook="true"]')).flatMap(vo=>vo.contentWindow?[vo.contentWindow]:[]):b$1&&b$1.parent?[b$1.parent]:[]}getLocalFrame(){return this.config.page==="manager"?Array.from(mt$1.querySelectorAll("#storybook-preview-iframe")).flatMap(vo=>vo.contentWindow?[vo.contentWindow]:[]):b$1&&b$1.parent?[b$1.parent]:[]}handleEvent(vo){try{let{data:Ai}=vo,{key:bo,event:Ra,refId:hc}=typeof Ai=="string"&&H$1(Ai)?at$1(Ai,b$1.CHANNEL_OPTIONS||{}):Ai;if(bo===Gt$1){let pc=this.config.page==="manager"?'<span style="color: #37D5D3; background: black"> manager </span>':'<span style="color: #1EA7FD; background: black"> preview </span>',mc=Object.values(Qn$1).includes(Ra.type)?`<span style="color: #FF4785">${Ra.type}</span>`:`<span style="color: #FFAE00">${Ra.type}</span>`;if(hc&&(Ra.refId=hc),Ra.source=this.config.page==="preview"?vo.origin:Bt$1(vo),!Ra.source){r$3.error(`${pc} received ${mc} but was unable to determine the source of the event`);return}let uf=`${pc} received ${mc} (${Ai.length})`;r$3.debug(vt$1.origin!==Ra.source?uf:`${uf} <span style="color: gray">(on ${vt$1.origin} from ${Ra.source})</span>`,...Ra.args),q$2(this.handler,"ChannelHandler should be set"),this.handler(Ra)}}catch(Ai){s$3.error(Ai)}}};i$2(_t$1,"PostMessageTransport");var G$2=_t$1,{WebSocket:eo$1}=b$1,bt=class{constructor({url:vo,onError:Ai,page:bo}){this.buffer=[],this.isReady=!1,this.socket=new eo$1(vo),this.socket.onopen=()=>{this.isReady=!0,this.flush()},this.socket.onmessage=({data:Ra})=>{let hc=typeof Ra=="string"&&H$1(Ra)?at$1(Ra):Ra;q$2(this.handler,"WebsocketTransport handler should be set"),this.handler(hc)},this.socket.onerror=Ra=>{Ai&&Ai(Ra)},this.socket.onclose=()=>{q$2(this.handler,"WebsocketTransport handler should be set"),this.handler({type:S$2,args:[],from:bo||"preview"})}}setHandler(vo){this.handler=vo}send(vo){this.isReady?this.sendNow(vo):this.sendLater(vo)}sendLater(vo){this.buffer.push(vo)}sendNow(vo){let Ai=ot(vo,{maxDepth:15,allowFunction:!1,...b$1.CHANNEL_OPTIONS});this.socket.send(Ai)}flush(){let{buffer:vo}=this;this.buffer=[],vo.forEach(Ai=>this.send(Ai))}};i$2(bt,"WebsocketTransport");var J$1=bt,{CONFIG_TYPE:ro}=b$1;function $o$1({page:vo,extraTransports:Ai=[]}){let bo=[new G$2({page:vo}),...Ai];if(ro==="DEVELOPMENT"){let Ra=window.location.protocol==="http:"?"ws":"wss",{hostname:hc,port:pc}=window.location,mc=`${Ra}://${hc}:${pc}/storybook-server-channel`;bo.push(new J$1({url:mc,onError:i$2(()=>{},"onError"),page:vo}))}return new z$2({transports:bo})}i$2($o$1,"createBrowserChannel");var oe$1=Object.defineProperty,t$3=(vo,Ai)=>oe$1(vo,"name",{value:Ai,configurable:!0});function r$1(vo){for(var Ai=[],bo=1;bo<arguments.length;bo++)Ai[bo-1]=arguments[bo];var Ra=Array.from(typeof vo=="string"?[vo]:vo);Ra[Ra.length-1]=Ra[Ra.length-1].replace(/\r?\n([\t ]*)$/,"");var hc=Ra.reduce(function(uf,df){var ff=df.match(/\n([\t ]+|(?!\s).)/g);return ff?uf.concat(ff.map(function(hf){var pf,mf;return(mf=(pf=hf.match(/[\t ]/g))===null||pf===void 0?void 0:pf.length)!==null&&mf!==void 0?mf:0})):uf},[]);if(hc.length){var pc=new RegExp(`
|
|
85
|
-
[ ]{`+Math.min.apply(Math,hc)+"}","g");Ra=Ra.map(function(uf){return uf.replace(pc,`
|
|
86
|
-
`)})}Ra[0]=Ra[0].replace(/^\r?\n/,"");var mc=Ra[0];return Ai.forEach(function(uf,df){var ff=mc.match(/(?:^|\n)( *)$/),hf=ff?ff[1]:"",pf=uf;typeof uf=="string"&&uf.includes(`
|
|
87
|
-
`)&&(pf=String(uf).split(`
|
|
88
|
-
`).map(function(mf,gf){return gf===0?mf:""+hf+mf}).join(`
|
|
89
|
-
`)),mc+=pf+Ra[df+1]}),mc}t$3(r$1,"dedent");function C$2({code:vo,category:Ai}){let bo=String(vo).padStart(4,"0");return`SB_${Ai}_${bo}`}t$3(C$2,"parseErrorCode");var p$1=class CT extends Error{constructor(Ai){super(CT.getFullMessage(Ai)),this.data={},this.fromStorybook=!0,this.category=Ai.category,this.documentation=Ai.documentation??!1,this.code=Ai.code}get fullErrorCode(){return C$2({code:this.code,category:this.category})}get name(){let Ai=this.constructor.name;return`${this.fullErrorCode} (${Ai})`}static getFullMessage({documentation:Ai,code:bo,category:Ra,message:hc}){let pc;return Ai===!0?pc=`https://storybook.js.org/error/${C$2({code:bo,category:Ra})}`:typeof Ai=="string"?pc=Ai:Array.isArray(Ai)&&(pc=`
|
|
90
|
-
${Ai.map(mc=>` - ${mc}`).join(`
|
|
91
|
-
`)}`),`${hc}${pc!=null?`
|
|
92
|
-
|
|
93
|
-
More info: ${pc}
|
|
94
|
-
`:""}`}};t$3(p$1,"StorybookError");var o$1=p$1,f$1=class extends o$1{constructor(vo){super({category:"PREVIEW_API",code:1,message:r$1`
|
|
95
|
-
Couldn't find story matching id '${vo.storyId}' after HMR.
|
|
96
|
-
- Did you just rename a story?
|
|
97
|
-
- Did you remove it from your CSF file?
|
|
98
|
-
- Are you sure a story with the id '${vo.storyId}' exists?
|
|
99
|
-
- Please check the values in the stories field of your main.js config and see if they would match your CSF File.
|
|
100
|
-
- Also check the browser console and terminal for potential error messages.`}),this.data=vo}};t$3(f$1,"MissingStoryAfterHmrError");var D$1=f$1,R$1=class extends o$1{constructor(vo){super({category:"PREVIEW_API",code:2,documentation:"https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#using-implicit-actions-during-rendering-is-deprecated-for-example-in-the-play-function",message:r$1`
|
|
101
|
-
We detected that you use an implicit action arg while ${vo.phase} of your story.
|
|
102
|
-
${vo.deprecated?`
|
|
103
|
-
This is deprecated and won't work in Storybook 8 anymore.
|
|
104
|
-
`:""}
|
|
105
|
-
Please provide an explicit spy to your args like this:
|
|
106
|
-
import { fn } from '@storybook/test';
|
|
107
|
-
...
|
|
108
|
-
args: {
|
|
109
|
-
${vo.name}: fn()
|
|
110
|
-
}`}),this.data=vo}};t$3(R$1,"ImplicitActionsDuringRendering");var b=class extends o$1{constructor(){super({category:"PREVIEW_API",code:3,message:r$1`
|
|
111
|
-
Cannot call \`storyStore.extract()\` without calling \`storyStore.cacheAllCsfFiles()\` first.
|
|
112
|
-
|
|
113
|
-
You probably meant to call \`await preview.extract()\` which does the above for you.`})}};t$3(b,"CalledExtractOnStoreError");var L$1=b,I$1=class extends o$1{constructor(){super({category:"PREVIEW_API",code:4,message:r$1`
|
|
114
|
-
Expected your framework's preset to export a \`renderToCanvas\` field.
|
|
115
|
-
|
|
116
|
-
Perhaps it needs to be upgraded for Storybook 7.0?`,documentation:"https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#mainjs-framework-field"})}};t$3(I$1,"MissingRenderToCanvasError");var G$1=I$1,P$2=class extends o$1{constructor(vo){super({category:"PREVIEW_API",code:5,message:r$1`
|
|
117
|
-
Called \`Preview.${vo.methodName}()\` before initialization.
|
|
118
|
-
|
|
119
|
-
The preview needs to load the story index before most methods can be called. If you want
|
|
120
|
-
to call \`${vo.methodName}\`, try \`await preview.initializationPromise;\` first.
|
|
121
|
-
|
|
122
|
-
If you didn't call the above code, then likely it was called by an addon that needs to
|
|
123
|
-
do the above.`}),this.data=vo}};t$3(P$2,"CalledPreviewMethodBeforeInitializationError");var Y$1=P$2,x$1=class extends o$1{constructor(vo){super({category:"PREVIEW_API",code:6,message:r$1`
|
|
124
|
-
Error fetching \`/index.json\`:
|
|
125
|
-
|
|
126
|
-
${vo.text}
|
|
127
|
-
|
|
128
|
-
If you are in development, this likely indicates a problem with your Storybook process,
|
|
129
|
-
check the terminal for errors.
|
|
130
|
-
|
|
131
|
-
If you are in a deployed Storybook, there may have been an issue deploying the full Storybook
|
|
132
|
-
build.`}),this.data=vo}};t$3(x$1,"StoryIndexFetchError");var M$2=x$1,T=class extends o$1{constructor(vo){super({category:"PREVIEW_API",code:7,message:r$1`
|
|
133
|
-
Tried to render docs entry ${vo.storyId} but it is a MDX file that has no CSF
|
|
134
|
-
references, or autodocs for a CSF file that some doesn't refer to itself.
|
|
135
|
-
|
|
136
|
-
This likely is an internal error in Storybook's indexing, or you've attached the
|
|
137
|
-
\`attached-mdx\` tag to an MDX file that is not attached.`}),this.data=vo}};t$3(T,"MdxFileWithNoCsfReferencesError");var H=T,w$1=class extends o$1{constructor(){super({category:"PREVIEW_API",code:8,message:r$1`
|
|
138
|
-
Couldn't find any stories in your Storybook.
|
|
139
|
-
|
|
140
|
-
- Please check your stories field of your main.js config: does it match correctly?
|
|
141
|
-
- Also check the browser console and terminal for error messages.`})}};t$3(w$1,"EmptyIndexError");var F$2=w$1,k$2=class extends o$1{constructor(vo){super({category:"PREVIEW_API",code:9,message:r$1`
|
|
142
|
-
Couldn't find story matching '${vo.storySpecifier}'.
|
|
143
|
-
|
|
144
|
-
- Are you sure a story with that id exists?
|
|
145
|
-
- Please check your stories field of your main.js config.
|
|
146
|
-
- Also check the browser console and terminal for error messages.`}),this.data=vo}};t$3(k$2,"NoStoryMatchError");var K$1=k$2,S$1=class extends o$1{constructor(vo){super({category:"PREVIEW_API",code:10,message:r$1`
|
|
147
|
-
Couldn't find story matching id '${vo.storyId}' after importing a CSF file.
|
|
148
|
-
|
|
149
|
-
The file was indexed as if the story was there, but then after importing the file in the browser
|
|
150
|
-
we didn't find the story. Possible reasons:
|
|
151
|
-
- You are using a custom story indexer that is misbehaving.
|
|
152
|
-
- You have a custom file loader that is removing or renaming exports.
|
|
153
|
-
|
|
154
|
-
Please check your browser console and terminal for errors that may explain the issue.`}),this.data=vo}};t$3(S$1,"MissingStoryFromCsfFileError");var X$1=S$1,v$2=class extends o$1{constructor(){super({category:"PREVIEW_API",code:11,message:r$1`
|
|
155
|
-
Cannot access the Story Store until the index is ready.
|
|
156
|
-
|
|
157
|
-
It is not recommended to use methods directly on the Story Store anyway, in Storybook 9 we will
|
|
158
|
-
remove access to the store entirely`})}};t$3(v$2,"StoryStoreAccessedBeforeInitializationError");var U$1=v$2,_=class extends o$1{constructor(vo){super({category:"PREVIEW_API",code:12,message:r$1`
|
|
159
|
-
Incorrect use of mount in the play function.
|
|
160
|
-
|
|
161
|
-
To use mount in the play function, you must satisfy the following two requirements:
|
|
162
|
-
|
|
163
|
-
1. You *must* destructure the mount property from the \`context\` (the argument passed to your play function).
|
|
164
|
-
This makes sure that Storybook does not start rendering the story before the play function begins.
|
|
165
|
-
|
|
166
|
-
2. Your Storybook framework or builder must be configured to transpile to ES2017 or newer.
|
|
167
|
-
This is because destructuring statements and async/await usages are otherwise transpiled away,
|
|
168
|
-
which prevents Storybook from recognizing your usage of \`mount\`.
|
|
169
|
-
|
|
170
|
-
Note that Angular is not supported. As async/await is transpiled to support the zone.js polyfill.
|
|
171
|
-
|
|
172
|
-
More info: https://storybook.js.org/docs/writing-tests/interaction-testing#run-code-before-the-component-gets-rendered
|
|
173
|
-
|
|
174
|
-
Received the following play function:
|
|
175
|
-
${vo.playFunction}`}),this.data=vo}};t$3(_,"MountMustBeDestructuredError");var J=_,V=class extends o$1{constructor(vo){super({category:"PREVIEW_API",code:14,message:r$1`
|
|
176
|
-
No render function available for storyId '${vo.id}'
|
|
177
|
-
`}),this.data=vo}};t$3(V,"NoRenderFunctionError");var q$1=V,N$1=class extends o$1{constructor(){super({category:"PREVIEW_API",code:15,message:r$1`
|
|
178
|
-
No component is mounted in your story.
|
|
179
|
-
|
|
180
|
-
This usually occurs when you destructure mount in the play function, but forget to call it.
|
|
181
|
-
|
|
182
|
-
For example:
|
|
183
|
-
|
|
184
|
-
async play({ mount, canvasElement }) {
|
|
185
|
-
// 👈 mount should be called: await mount();
|
|
186
|
-
const canvas = within(canvasElement);
|
|
187
|
-
const button = await canvas.findByRole('button');
|
|
188
|
-
await userEvent.click(button);
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
Make sure to either remove it or call mount in your play function.
|
|
192
|
-
`})}};t$3(N$1,"NoStoryMountedError");var z$1=N$1,A=class extends o$1{constructor(){super({category:"FRAMEWORK_NEXTJS",code:1,documentation:"https://storybook.js.org/docs/get-started/nextjs#faq",message:r$1`
|
|
193
|
-
You are importing avif images, but you don't have sharp installed.
|
|
194
|
-
|
|
195
|
-
You have to install sharp in order to use image optimization features in Next.js.
|
|
196
|
-
`})}};t$3(A,"NextJsSharpError");var W=class extends o$1{constructor(vo){super({category:"FRAMEWORK_NEXTJS",code:2,message:r$1`
|
|
197
|
-
Tried to access router mocks from "${vo.importType}" but they were not created yet. You might be running code in an unsupported environment.
|
|
198
|
-
`}),this.data=vo}};t$3(W,"NextjsRouterMocksNotAvailable");var $$1=class extends o$1{constructor(vo){super({category:"DOCS-TOOLS",code:1,documentation:"https://github.com/storybookjs/storybook/issues/26606",message:r$1`
|
|
199
|
-
There was a failure when generating detailed ArgTypes in ${vo.language} for:
|
|
200
|
-
${JSON.stringify(vo.type,null,2)}
|
|
201
|
-
|
|
202
|
-
Storybook will fall back to use a generic type description instead.
|
|
203
|
-
|
|
204
|
-
This type is either not supported or it is a bug in the docgen generation in Storybook.
|
|
205
|
-
If you think this is a bug, please detail it as much as possible in the Github issue.
|
|
206
|
-
`}),this.data=vo}};t$3($$1,"UnknownArgTypesError");var O$2=class extends o$1{constructor(vo){super({category:"ADDON_VITEST",code:1,message:r$1`
|
|
207
|
-
Encountered an unsupported value "${vo.value}" when setting the viewport ${vo.dimension} dimension.
|
|
208
|
-
|
|
209
|
-
The Storybook plugin only supports values in the following units:
|
|
210
|
-
- px, vh, vw, em, rem and %.
|
|
211
|
-
|
|
212
|
-
You can either change the viewport for this story to use one of the supported units or skip the test by adding '!test' to the story's tags per https://storybook.js.org/docs/writing-stories/tags
|
|
213
|
-
`}),this.data=vo}};t$3(O$2,"UnsupportedViewportDimensionError");var C$1=Object.create,u=Object.defineProperty,B=Object.getOwnPropertyDescriptor,F$1=Object.getOwnPropertyNames,h=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,E=(vo,Ai)=>()=>(Ai||vo((Ai={exports:{}}).exports,Ai),Ai.exports),v$1=(vo,Ai,bo,Ra)=>{if(Ai&&typeof Ai=="object"||typeof Ai=="function")for(let hc of F$1(Ai))!w.call(vo,hc)&&hc!==bo&&u(vo,hc,{get:()=>Ai[hc],enumerable:!(Ra=B(Ai,hc))||Ra.enumerable});return vo},I=(vo,Ai,bo)=>(bo=vo!=null?C$1(h(vo)):{},v$1(!vo||!vo.__esModule?u(bo,"default",{value:vo,enumerable:!0}):bo,vo)),x=E(vo=>{Object.defineProperty(vo,"__esModule",{value:!0}),vo.isEqual=function(){var Ai=Object.prototype.toString,bo=Object.getPrototypeOf,Ra=Object.getOwnPropertySymbols?function(hc){return Object.keys(hc).concat(Object.getOwnPropertySymbols(hc))}:Object.keys;return function(hc,pc){return function mc(uf,df,ff){var hf,pf,mf,gf=Ai.call(uf),yf=Ai.call(df);if(uf===df)return!0;if(uf==null||df==null)return!1;if(ff.indexOf(uf)>-1&&ff.indexOf(df)>-1)return!0;if(ff.push(uf,df),gf!=yf||(hf=Ra(uf),pf=Ra(df),hf.length!=pf.length||hf.some(function(vf){return!mc(uf[vf],df[vf],ff)})))return!1;switch(gf.slice(8,-1)){case"Symbol":return uf.valueOf()==df.valueOf();case"Date":case"Number":return+uf==+df||+uf!=+uf&&+df!=+df;case"RegExp":case"Function":case"String":case"Boolean":return""+uf==""+df;case"Set":case"Map":hf=uf.entries(),pf=df.entries();do if(!mc((mf=hf.next()).value,pf.next().value,ff))return!1;while(!mf.done);return!0;case"ArrayBuffer":uf=new Uint8Array(uf),df=new Uint8Array(df);case"DataView":uf=new Uint8Array(uf.buffer),df=new Uint8Array(df.buffer);case"Float32Array":case"Float64Array":case"Int8Array":case"Int16Array":case"Int32Array":case"Uint8Array":case"Uint16Array":case"Uint32Array":case"Uint8ClampedArray":case"Arguments":case"Array":if(uf.length!=df.length)return!1;for(mf=0;mf<uf.length;mf++)if((mf in uf||mf in df)&&(mf in uf!=mf in df||!mc(uf[mf],df[mf],ff)))return!1;return!0;case"Object":return mc(bo(uf),bo(df),ff);default:return!1}}(hc,pc,[])}}()});function R(vo){return vo.replace(/_/g," ").replace(/-/g," ").replace(/\./g," ").replace(/([^\n])([A-Z])([a-z])/g,(Ai,bo,Ra,hc)=>`${bo} ${Ra}${hc}`).replace(/([a-z])([A-Z])/g,(Ai,bo,Ra)=>`${bo} ${Ra}`).replace(/([a-z])([0-9])/gi,(Ai,bo,Ra)=>`${bo} ${Ra}`).replace(/([0-9])([a-z])/gi,(Ai,bo,Ra)=>`${bo} ${Ra}`).replace(/(\s|^)(\w)/g,(Ai,bo,Ra)=>`${bo}${Ra.toUpperCase()}`).replace(/ +/g," ").trim()}var l=I(x()),S=vo=>vo.map(Ai=>typeof Ai<"u").filter(Boolean).length,k$1=(vo,Ai)=>{let{exists:bo,eq:Ra,neq:hc,truthy:pc}=vo;if(S([bo,Ra,hc,pc])>1)throw new Error(`Invalid conditional test ${JSON.stringify({exists:bo,eq:Ra,neq:hc})}`);if(typeof Ra<"u")return(0,l.isEqual)(Ai,Ra);if(typeof hc<"u")return!(0,l.isEqual)(Ai,hc);if(typeof bo<"u"){let mc=typeof Ai<"u";return bo?mc:!mc}return typeof pc>"u"||pc?!!Ai:!Ai},P$1=(vo,Ai,bo)=>{if(!vo.if)return!0;let{arg:Ra,global:hc}=vo.if;if(S([Ra,hc])!==1)throw new Error(`Invalid conditional value ${JSON.stringify({arg:Ra,global:hc})}`);let pc=Ra?Ai[Ra]:bo[hc];return k$1(vo.if,pc)},O$1=vo=>vo.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,"-").replace(/-+/g,"-").replace(/^-+/,"").replace(/-+$/,""),f=(vo,Ai)=>{let bo=O$1(vo);if(bo==="")throw new Error(`Invalid ${Ai} '${vo}', must include alphanumeric characters`);return bo},G=(vo,Ai)=>`${f(vo,"kind")}${Ai?`--${f(Ai,"name")}`:""}`,N=vo=>R(vo);function m$3(vo,Ai){return Array.isArray(Ai)?Ai.includes(vo):vo.match(Ai)}function M$1(vo,{includeStories:Ai,excludeStories:bo}){return vo!=="__esModule"&&(!Ai||m$3(vo,Ai))&&(!bo||!m$3(vo,bo))}var z=(...vo)=>{let Ai=vo.reduce((bo,Ra)=>(Ra.startsWith("!")?bo.delete(Ra.slice(1)):bo.add(Ra),bo),new Set);return Array.from(Ai)},On=Object.create,ur=Object.defineProperty,Dn=Object.getOwnPropertyDescriptor,kn=Object.getOwnPropertyNames,jn=Object.getPrototypeOf,Mn=Object.prototype.hasOwnProperty,s$1=(vo,Ai)=>ur(vo,"name",{value:Ai,configurable:!0}),Re=(vo=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(vo,{get:(Ai,bo)=>(typeof require<"u"?require:Ai)[bo]}):vo)(function(vo){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+vo+'" is not supported')}),O=(vo,Ai)=>()=>(Ai||vo((Ai={exports:{}}).exports,Ai),Ai.exports),_n=(vo,Ai,bo,Ra)=>{if(Ai&&typeof Ai=="object"||typeof Ai=="function")for(let hc of kn(Ai))!Mn.call(vo,hc)&&hc!==bo&&ur(vo,hc,{get:()=>Ai[hc],enumerable:!(Ra=Dn(Ai,hc))||Ra.enumerable});return vo},ce=(vo,Ai,bo)=>(bo=vo!=null?On(jn(vo)):{},_n(ur(bo,"default",{value:vo,enumerable:!0}),vo)),Ir=O((vo,Ai)=>{(function(bo){if(typeof vo=="object"&&typeof Ai<"u")Ai.exports=bo();else if(typeof define=="function"&&define.amd)define([],bo);else{var Ra;typeof window<"u"?Ra=window:typeof global<"u"?Ra=global:typeof self<"u"?Ra=self:Ra=this,Ra.memoizerific=bo()}})(function(){return s$1(function bo(Ra,hc,pc){function mc(ff,hf){if(!hc[ff]){if(!Ra[ff]){var pf=typeof Re=="function"&ℜif(!hf&&pf)return pf(ff,!0);if(uf)return uf(ff,!0);var mf=new Error("Cannot find module '"+ff+"'");throw mf.code="MODULE_NOT_FOUND",mf}var gf=hc[ff]={exports:{}};Ra[ff][0].call(gf.exports,function(yf){var vf=Ra[ff][1][yf];return mc(vf||yf)},gf,gf.exports,bo,Ra,hc,pc)}return hc[ff].exports}s$1(mc,"s");for(var uf=typeof Re=="function"&&Re,df=0;df<pc.length;df++)mc(pc[df]);return mc},"e")({1:[function(bo,Ra,hc){Ra.exports=function(pc){if(typeof Map!="function"||pc){var mc=bo("./similar");return new mc}else return new Map}},{"./similar":2}],2:[function(bo,Ra,hc){function pc(){return this.list=[],this.lastItem=void 0,this.size=0,this}s$1(pc,"Similar"),pc.prototype.get=function(mc){var uf;if(this.lastItem&&this.isEqual(this.lastItem.key,mc))return this.lastItem.val;if(uf=this.indexOf(mc),uf>=0)return this.lastItem=this.list[uf],this.list[uf].val},pc.prototype.set=function(mc,uf){var df;return this.lastItem&&this.isEqual(this.lastItem.key,mc)?(this.lastItem.val=uf,this):(df=this.indexOf(mc),df>=0?(this.lastItem=this.list[df],this.list[df].val=uf,this):(this.lastItem={key:mc,val:uf},this.list.push(this.lastItem),this.size++,this))},pc.prototype.delete=function(mc){var uf;if(this.lastItem&&this.isEqual(this.lastItem.key,mc)&&(this.lastItem=void 0),uf=this.indexOf(mc),uf>=0)return this.size--,this.list.splice(uf,1)[0]},pc.prototype.has=function(mc){var uf;return this.lastItem&&this.isEqual(this.lastItem.key,mc)?!0:(uf=this.indexOf(mc),uf>=0?(this.lastItem=this.list[uf],!0):!1)},pc.prototype.forEach=function(mc,uf){var df;for(df=0;df<this.size;df++)mc.call(uf||this,this.list[df].val,this.list[df].key,this)},pc.prototype.indexOf=function(mc){var uf;for(uf=0;uf<this.size;uf++)if(this.isEqual(this.list[uf].key,mc))return uf;return-1},pc.prototype.isEqual=function(mc,uf){return mc===uf||mc!==mc&&uf!==uf},Ra.exports=pc},{}],3:[function(bo,Ra,hc){var pc=bo("map-or-similar");Ra.exports=function(ff){var hf=new pc(!1),pf=[];return function(mf){var gf=s$1(function(){var yf=hf,vf,bf,Sf=arguments.length-1,xf=Array(Sf+1),wf=!0,s1;if((gf.numArgs||gf.numArgs===0)&&gf.numArgs!==Sf+1)throw new Error("Memoizerific functions should always be called with the same number of arguments");for(s1=0;s1<Sf;s1++){if(xf[s1]={cacheItem:yf,arg:arguments[s1]},yf.has(arguments[s1])){yf=yf.get(arguments[s1]);continue}wf=!1,vf=new pc(!1),yf.set(arguments[s1],vf),yf=vf}return wf&&(yf.has(arguments[Sf])?bf=yf.get(arguments[Sf]):wf=!1),wf||(bf=mf.apply(null,arguments),yf.set(arguments[Sf],bf)),ff>0&&(xf[Sf]={cacheItem:yf,arg:arguments[Sf]},wf?mc(pf,xf):pf.push(xf),pf.length>ff&&uf(pf.shift())),gf.wasMemoized=wf,gf.numArgs=Sf+1,bf},"memoizerific");return gf.limit=ff,gf.wasMemoized=!1,gf.cache=hf,gf.lru=pf,gf}};function mc(ff,hf){var pf=ff.length,mf=hf.length,gf,yf,vf;for(yf=0;yf<pf;yf++){for(gf=!0,vf=0;vf<mf;vf++)if(!df(ff[yf][vf].arg,hf[vf].arg)){gf=!1;break}if(gf)break}ff.push(ff.splice(yf,1)[0])}s$1(mc,"moveToMostRecentLru");function uf(ff){var hf=ff.length,pf=ff[hf-1],mf,gf;for(pf.cacheItem.delete(pf.arg),gf=hf-2;gf>=0&&(pf=ff[gf],mf=pf.cacheItem.get(pf.arg),!mf||!mf.size);gf--)pf.cacheItem.delete(pf.arg)}s$1(uf,"removeCachedResult");function df(ff,hf){return ff===hf||ff!==ff&&hf!==hf}s$1(df,"isEqual")},{"map-or-similar":1}]},{},[3])(3)})}),et=O(vo=>{Object.defineProperty(vo,"__esModule",{value:!0}),vo.encodeString=Ra;var Ai=Array.from({length:256},(hc,pc)=>"%"+((pc<16?"0":"")+pc.toString(16)).toUpperCase()),bo=new Int8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0]);function Ra(hc){let pc=hc.length;if(pc===0)return"";let mc="",uf=0,df=0;e:for(;df<pc;df++){let ff=hc.charCodeAt(df);for(;ff<128;){if(bo[ff]!==1&&(uf<df&&(mc+=hc.slice(uf,df)),uf=df+1,mc+=Ai[ff]),++df===pc)break e;ff=hc.charCodeAt(df)}if(uf<df&&(mc+=hc.slice(uf,df)),ff<2048){uf=df+1,mc+=Ai[192|ff>>6]+Ai[128|ff&63];continue}if(ff<55296||ff>=57344){uf=df+1,mc+=Ai[224|ff>>12]+Ai[128|ff>>6&63]+Ai[128|ff&63];continue}if(++df,df>=pc)throw new Error("URI malformed");let hf=hc.charCodeAt(df)&1023;uf=df+1,ff=65536+((ff&1023)<<10|hf),mc+=Ai[240|ff>>18]+Ai[128|ff>>12&63]+Ai[128|ff>>6&63]+Ai[128|ff&63]}return uf===0?hc:uf<pc?mc+hc.slice(uf):mc}s$1(Ra,"encodeString")}),Qe=O(vo=>{Object.defineProperty(vo,"__esModule",{value:!0}),vo.defaultOptions=vo.defaultShouldSerializeObject=vo.defaultValueSerializer=void 0;var Ai=et(),bo=s$1(pc=>{switch(typeof pc){case"string":return(0,Ai.encodeString)(pc);case"bigint":case"boolean":return""+pc;case"number":if(Number.isFinite(pc))return pc<1e21?""+pc:(0,Ai.encodeString)(""+pc);break}return pc instanceof Date?(0,Ai.encodeString)(pc.toISOString()):""},"defaultValueSerializer");vo.defaultValueSerializer=bo;var Ra=s$1(pc=>pc instanceof Date,"defaultShouldSerializeObject");vo.defaultShouldSerializeObject=Ra;var hc=s$1(pc=>pc,"identityFunc");vo.defaultOptions={nesting:!0,nestingSyntax:"dot",arrayRepeat:!1,arrayRepeatSyntax:"repeat",delimiter:38,valueDeserializer:hc,valueSerializer:vo.defaultValueSerializer,keyDeserializer:hc,shouldSerializeObject:vo.defaultShouldSerializeObject}}),tt=O(vo=>{Object.defineProperty(vo,"__esModule",{value:!0}),vo.getDeepObject=hc,vo.stringifyObject=hf;var Ai=Qe(),bo=et();function Ra(pf){return pf==="__proto__"||pf==="constructor"||pf==="prototype"}s$1(Ra,"isPrototypeKey");function hc(pf,mf,gf,yf,vf){if(Ra(mf))return pf;let bf=pf[mf];return typeof bf=="object"&&bf!==null?bf:!yf&&(vf||typeof gf=="number"||typeof gf=="string"&&gf*0===0&&gf.indexOf(".")===-1)?pf[mf]=[]:pf[mf]={}}s$1(hc,"getDeepObject");var pc=20,mc="[]",uf="[",df="]",ff=".";function hf(pf,mf,gf=0,yf,vf){let{nestingSyntax:bf=Ai.defaultOptions.nestingSyntax,arrayRepeat:Sf=Ai.defaultOptions.arrayRepeat,arrayRepeatSyntax:xf=Ai.defaultOptions.arrayRepeatSyntax,nesting:wf=Ai.defaultOptions.nesting,delimiter:s1=Ai.defaultOptions.delimiter,valueSerializer:If=Ai.defaultOptions.valueSerializer,shouldSerializeObject:l1=Ai.defaultOptions.shouldSerializeObject}=mf,c1=typeof s1=="number"?String.fromCharCode(s1):s1,m1=vf===!0&&Sf,k1=bf==="dot"||bf==="js"&&!vf;if(gf>pc)return"";let N1="",R1=!0,$1=!1;for(let D1 in pf){let f1=pf[D1],T1;yf?(T1=yf,m1?xf==="bracket"&&(T1+=mc):k1?(T1+=ff,T1+=D1):(T1+=uf,T1+=D1,T1+=df)):T1=D1,R1||(N1+=c1),typeof f1=="object"&&f1!==null&&!l1(f1)?($1=f1.pop!==void 0,(wf||Sf&&$1)&&(N1+=hf(f1,mf,gf+1,T1,$1))):(N1+=(0,bo.encodeString)(T1),N1+="=",N1+=If(f1,D1)),R1&&(R1=!1)}return N1}s$1(hf,"stringifyObject")}),Mo=O((vo,Ai)=>{var bo=12,Ra=0,hc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,7,7,7,7,7,7,7,7,7,7,7,7,8,7,7,10,9,9,9,11,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,24,36,48,60,72,84,96,0,12,12,12,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,24,24,24,0,0,0,0,0,0,0,0,0,24,24,0,0,0,0,0,0,0,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,48,48,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,127,63,63,63,0,31,15,15,15,7,7,7];function pc(df){var ff=df.indexOf("%");if(ff===-1)return df;for(var hf=df.length,pf="",mf=0,gf=0,yf=ff,vf=bo;ff>-1&&ff<hf;){var bf=uf(df[ff+1],4),Sf=uf(df[ff+2],0),xf=bf|Sf,wf=hc[xf];if(vf=hc[256+vf+wf],gf=gf<<6|xf&hc[364+wf],vf===bo)pf+=df.slice(mf,yf),pf+=gf<=65535?String.fromCharCode(gf):String.fromCharCode(55232+(gf>>10),56320+(gf&1023)),gf=0,mf=ff+3,ff=yf=df.indexOf("%",mf);else{if(vf===Ra)return null;if(ff+=3,ff<hf&&df.charCodeAt(ff)===37)continue;return null}}return pf+df.slice(mf)}s$1(pc,"decodeURIComponent");var mc={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};function uf(df,ff){var hf=mc[df];return hf===void 0?255:hf<<ff}s$1(uf,"hexCodeToInt"),Ai.exports=pc}),qo=O(vo=>{var Ai=vo&&vo.__importDefault||function(pf){return pf&&pf.__esModule?pf:{default:pf}};Object.defineProperty(vo,"__esModule",{value:!0}),vo.numberValueDeserializer=vo.numberKeyDeserializer=void 0,vo.parse=hf;var bo=tt(),Ra=Qe(),hc=Ai(Mo()),pc=s$1(pf=>{let mf=Number(pf);return Number.isNaN(mf)?pf:mf},"numberKeyDeserializer");vo.numberKeyDeserializer=pc;var mc=s$1(pf=>{let mf=Number(pf);return Number.isNaN(mf)?pf:mf},"numberValueDeserializer");vo.numberValueDeserializer=mc;var uf=/\+/g,df=s$1(function(){},"Empty");df.prototype=Object.create(null);function ff(pf,mf,gf,yf,vf){let bf=pf.substring(mf,gf);return yf&&(bf=bf.replace(uf," ")),vf&&(bf=(0,hc.default)(bf)||bf),bf}s$1(ff,"computeKeySlice");function hf(pf,mf){let{valueDeserializer:gf=Ra.defaultOptions.valueDeserializer,keyDeserializer:yf=Ra.defaultOptions.keyDeserializer,arrayRepeatSyntax:vf=Ra.defaultOptions.arrayRepeatSyntax,nesting:bf=Ra.defaultOptions.nesting,arrayRepeat:Sf=Ra.defaultOptions.arrayRepeat,nestingSyntax:xf=Ra.defaultOptions.nestingSyntax,delimiter:wf=Ra.defaultOptions.delimiter}=mf??{},s1=typeof wf=="string"?wf.charCodeAt(0):wf,If=xf==="js",l1=new df;if(typeof pf!="string")return l1;let c1=pf.length,m1="",k1=-1,N1=-1,R1=-1,$1=l1,D1,f1="",T1="",A1=!1,L1=!1,B1=!1,V1=!1,Z1=!1,H1=!1,E1=!1,F1=0,M1=-1,q1=-1,z1=-1;for(let W1=0;W1<c1+1;W1++){if(F1=W1!==c1?pf.charCodeAt(W1):s1,F1===s1){if(E1=N1>k1,E1||(N1=W1),R1!==N1-1&&(T1=ff(pf,R1+1,M1>-1?M1:N1,B1,A1),f1=yf(T1),D1!==void 0&&($1=(0,bo.getDeepObject)($1,D1,f1,If&&Z1,If&&H1))),E1||f1!==""){E1&&(m1=pf.slice(N1+1,W1),V1&&(m1=m1.replace(uf," ")),L1&&(m1=(0,hc.default)(m1)||m1));let J1=gf(m1,f1);if(Sf){let eT=$1[f1];eT===void 0?M1>-1?$1[f1]=[J1]:$1[f1]=J1:eT.pop?eT.push(J1):$1[f1]=[eT,J1]}else $1[f1]=J1}m1="",k1=W1,N1=W1,A1=!1,L1=!1,B1=!1,V1=!1,Z1=!1,H1=!1,M1=-1,R1=W1,$1=l1,D1=void 0,f1=""}else F1===93?(Sf&&vf==="bracket"&&z1===91&&(M1=q1),bf&&(xf==="index"||If)&&N1<=k1&&(R1!==q1&&(T1=ff(pf,R1+1,W1,B1,A1),f1=yf(T1),D1!==void 0&&($1=(0,bo.getDeepObject)($1,D1,f1,void 0,If)),D1=f1,B1=!1,A1=!1),R1=W1,H1=!0,Z1=!1)):F1===46?bf&&(xf==="dot"||If)&&N1<=k1&&(R1!==q1&&(T1=ff(pf,R1+1,W1,B1,A1),f1=yf(T1),D1!==void 0&&($1=(0,bo.getDeepObject)($1,D1,f1,If)),D1=f1,B1=!1,A1=!1),Z1=!0,H1=!1,R1=W1):F1===91?bf&&(xf==="index"||If)&&N1<=k1&&(R1!==q1&&(T1=ff(pf,R1+1,W1,B1,A1),f1=yf(T1),If&&D1!==void 0&&($1=(0,bo.getDeepObject)($1,D1,f1,If)),D1=f1,B1=!1,A1=!1,Z1=!1,H1=!0),R1=W1):F1===61?N1<=k1?N1=W1:L1=!0:F1===43?N1>k1?V1=!0:B1=!0:F1===37&&(N1>k1?L1=!0:A1=!0);q1=W1,z1=F1}return l1}s$1(hf,"parse")}),Bo=O(vo=>{Object.defineProperty(vo,"__esModule",{value:!0}),vo.stringify=bo;var Ai=tt();function bo(Ra,hc){if(Ra===null||typeof Ra!="object")return"";let pc=hc??{};return(0,Ai.stringifyObject)(Ra,pc)}s$1(bo,"stringify")}),tr=O(vo=>{var Ai=vo&&vo.__createBinding||(Object.create?function(pc,mc,uf,df){df===void 0&&(df=uf);var ff=Object.getOwnPropertyDescriptor(mc,uf);(!ff||("get"in ff?!mc.__esModule:ff.writable||ff.configurable))&&(ff={enumerable:!0,get:s$1(function(){return mc[uf]},"get")}),Object.defineProperty(pc,df,ff)}:function(pc,mc,uf,df){df===void 0&&(df=uf),pc[df]=mc[uf]}),bo=vo&&vo.__exportStar||function(pc,mc){for(var uf in pc)uf!=="default"&&!Object.prototype.hasOwnProperty.call(mc,uf)&&Ai(mc,pc,uf)};Object.defineProperty(vo,"__esModule",{value:!0}),vo.stringify=vo.parse=void 0;var Ra=qo();Object.defineProperty(vo,"parse",{enumerable:!0,get:s$1(function(){return Ra.parse},"get")});var hc=Bo();Object.defineProperty(vo,"stringify",{enumerable:!0,get:s$1(function(){return hc.stringify},"get")}),bo(Qe(),vo)}),lt=O((vo,Ai)=>{Ai.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅",in:"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺",int:"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
|
|
214
|
-
`,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:" ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""}}),$o=O((vo,Ai)=>{Ai.exports={Aacute:"Á",aacute:"á",Acirc:"Â",acirc:"â",acute:"´",AElig:"Æ",aelig:"æ",Agrave:"À",agrave:"à",amp:"&",AMP:"&",Aring:"Å",aring:"å",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",brvbar:"¦",Ccedil:"Ç",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",Eacute:"É",eacute:"é",Ecirc:"Ê",ecirc:"ê",Egrave:"È",egrave:"è",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",iquest:"¿",Iuml:"Ï",iuml:"ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",Ntilde:"Ñ",ntilde:"ñ",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",Ograve:"Ò",ograve:"ò",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",Ouml:"Ö",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",THORN:"Þ",thorn:"þ",times:"×",Uacute:"Ú",uacute:"ú",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",Uuml:"Ü",uuml:"ü",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ"}}),ct=O((vo,Ai)=>{Ai.exports={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}}),Yo=O((vo,Ai)=>{Ai.exports={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376}}),Xo=O(vo=>{var Ai=vo&&vo.__importDefault||function(pc){return pc&&pc.__esModule?pc:{default:pc}};Object.defineProperty(vo,"__esModule",{value:!0});var bo=Ai(Yo()),Ra=String.fromCodePoint||function(pc){var mc="";return pc>65535&&(pc-=65536,mc+=String.fromCharCode(pc>>>10&1023|55296),pc=56320|pc&1023),mc+=String.fromCharCode(pc),mc};function hc(pc){return pc>=55296&&pc<=57343||pc>1114111?"�":(pc in bo.default&&(pc=bo.default[pc]),Ra(pc))}s$1(hc,"decodeCodePoint"),vo.default=hc}),pt=O(vo=>{var Ai=vo&&vo.__importDefault||function(hf){return hf&&hf.__esModule?hf:{default:hf}};Object.defineProperty(vo,"__esModule",{value:!0}),vo.decodeHTML=vo.decodeHTMLStrict=vo.decodeXML=void 0;var bo=Ai(lt()),Ra=Ai($o()),hc=Ai(ct()),pc=Ai(Xo()),mc=/&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;vo.decodeXML=uf(hc.default),vo.decodeHTMLStrict=uf(bo.default);function uf(hf){var pf=ff(hf);return function(mf){return String(mf).replace(mc,pf)}}s$1(uf,"getStrictDecoder");var df=s$1(function(hf,pf){return hf<pf?1:-1},"sorter");vo.decodeHTML=function(){for(var hf=Object.keys(Ra.default).sort(df),pf=Object.keys(bo.default).sort(df),mf=0,gf=0;mf<pf.length;mf++)hf[gf]===pf[mf]?(pf[mf]+=";?",gf++):pf[mf]+=";";var yf=new RegExp("&(?:"+pf.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),vf=ff(bo.default);function bf(Sf){return Sf.substr(-1)!==";"&&(Sf+=";"),vf(Sf)}return s$1(bf,"replacer"),function(Sf){return String(Sf).replace(yf,bf)}}();function ff(hf){return s$1(function(pf){if(pf.charAt(1)==="#"){var mf=pf.charAt(2);return mf==="X"||mf==="x"?pc.default(parseInt(pf.substr(3),16)):pc.default(parseInt(pf.substr(2),10))}return hf[pf.slice(1,-1)]||pf},"replace")}s$1(ff,"getReplacer")}),ft=O(vo=>{var Ai=vo&&vo.__importDefault||function(xf){return xf&&xf.__esModule?xf:{default:xf}};Object.defineProperty(vo,"__esModule",{value:!0}),vo.escapeUTF8=vo.escape=vo.encodeNonAsciiHTML=vo.encodeHTML=vo.encodeXML=void 0;var bo=Ai(ct()),Ra=df(bo.default),hc=ff(Ra);vo.encodeXML=Sf(Ra);var pc=Ai(lt()),mc=df(pc.default),uf=ff(mc);vo.encodeHTML=gf(mc,uf),vo.encodeNonAsciiHTML=Sf(mc);function df(xf){return Object.keys(xf).sort().reduce(function(wf,s1){return wf[xf[s1]]="&"+s1+";",wf},{})}s$1(df,"getInverseObj");function ff(xf){for(var wf=[],s1=[],If=0,l1=Object.keys(xf);If<l1.length;If++){var c1=l1[If];c1.length===1?wf.push("\\"+c1):s1.push(c1)}wf.sort();for(var m1=0;m1<wf.length-1;m1++){for(var k1=m1;k1<wf.length-1&&wf[k1].charCodeAt(1)+1===wf[k1+1].charCodeAt(1);)k1+=1;var N1=1+k1-m1;N1<3||wf.splice(m1,N1,wf[m1]+"-"+wf[k1])}return s1.unshift("["+wf.join("")+"]"),new RegExp(s1.join("|"),"g")}s$1(ff,"getInverseReplacer");var hf=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,pf=String.prototype.codePointAt!=null?function(xf){return xf.codePointAt(0)}:function(xf){return(xf.charCodeAt(0)-55296)*1024+xf.charCodeAt(1)-56320+65536};function mf(xf){return"&#x"+(xf.length>1?pf(xf):xf.charCodeAt(0)).toString(16).toUpperCase()+";"}s$1(mf,"singleCharReplacer");function gf(xf,wf){return function(s1){return s1.replace(wf,function(If){return xf[If]}).replace(hf,mf)}}s$1(gf,"getInverse");var yf=new RegExp(hc.source+"|"+hf.source,"g");function vf(xf){return xf.replace(yf,mf)}s$1(vf,"escape"),vo.escape=vf;function bf(xf){return xf.replace(hc,mf)}s$1(bf,"escapeUTF8"),vo.escapeUTF8=bf;function Sf(xf){return function(wf){return wf.replace(yf,function(s1){return xf[s1]||mf(s1)})}}s$1(Sf,"getASCIIEncoder")}),pn=O(vo=>{Object.defineProperty(vo,"__esModule",{value:!0}),vo.decodeXMLStrict=vo.decodeHTML5Strict=vo.decodeHTML4Strict=vo.decodeHTML5=vo.decodeHTML4=vo.decodeHTMLStrict=vo.decodeHTML=vo.decodeXML=vo.encodeHTML5=vo.encodeHTML4=vo.escapeUTF8=vo.escape=vo.encodeNonAsciiHTML=vo.encodeHTML=vo.encodeXML=vo.encode=vo.decodeStrict=vo.decode=void 0;var Ai=pt(),bo=ft();function Ra(df,ff){return(!ff||ff<=0?Ai.decodeXML:Ai.decodeHTML)(df)}s$1(Ra,"decode"),vo.decode=Ra;function hc(df,ff){return(!ff||ff<=0?Ai.decodeXML:Ai.decodeHTMLStrict)(df)}s$1(hc,"decodeStrict"),vo.decodeStrict=hc;function pc(df,ff){return(!ff||ff<=0?bo.encodeXML:bo.encodeHTML)(df)}s$1(pc,"encode"),vo.encode=pc;var mc=ft();Object.defineProperty(vo,"encodeXML",{enumerable:!0,get:s$1(function(){return mc.encodeXML},"get")}),Object.defineProperty(vo,"encodeHTML",{enumerable:!0,get:s$1(function(){return mc.encodeHTML},"get")}),Object.defineProperty(vo,"encodeNonAsciiHTML",{enumerable:!0,get:s$1(function(){return mc.encodeNonAsciiHTML},"get")}),Object.defineProperty(vo,"escape",{enumerable:!0,get:s$1(function(){return mc.escape},"get")}),Object.defineProperty(vo,"escapeUTF8",{enumerable:!0,get:s$1(function(){return mc.escapeUTF8},"get")}),Object.defineProperty(vo,"encodeHTML4",{enumerable:!0,get:s$1(function(){return mc.encodeHTML},"get")}),Object.defineProperty(vo,"encodeHTML5",{enumerable:!0,get:s$1(function(){return mc.encodeHTML},"get")});var uf=pt();Object.defineProperty(vo,"decodeXML",{enumerable:!0,get:s$1(function(){return uf.decodeXML},"get")}),Object.defineProperty(vo,"decodeHTML",{enumerable:!0,get:s$1(function(){return uf.decodeHTML},"get")}),Object.defineProperty(vo,"decodeHTMLStrict",{enumerable:!0,get:s$1(function(){return uf.decodeHTMLStrict},"get")}),Object.defineProperty(vo,"decodeHTML4",{enumerable:!0,get:s$1(function(){return uf.decodeHTML},"get")}),Object.defineProperty(vo,"decodeHTML5",{enumerable:!0,get:s$1(function(){return uf.decodeHTML},"get")}),Object.defineProperty(vo,"decodeHTML4Strict",{enumerable:!0,get:s$1(function(){return uf.decodeHTMLStrict},"get")}),Object.defineProperty(vo,"decodeHTML5Strict",{enumerable:!0,get:s$1(function(){return uf.decodeHTMLStrict},"get")}),Object.defineProperty(vo,"decodeXMLStrict",{enumerable:!0,get:s$1(function(){return uf.decodeXML},"get")})}),Rn=O((vo,Ai)=>{function bo(f1,T1){if(!(f1 instanceof T1))throw new TypeError("Cannot call a class as a function")}s$1(bo,"_classCallCheck");function Ra(f1,T1){for(var A1=0;A1<T1.length;A1++){var L1=T1[A1];L1.enumerable=L1.enumerable||!1,L1.configurable=!0,"value"in L1&&(L1.writable=!0),Object.defineProperty(f1,L1.key,L1)}}s$1(Ra,"_defineProperties");function hc(f1,T1,A1){return T1&&Ra(f1.prototype,T1),A1&&Ra(f1,A1),f1}s$1(hc,"_createClass");function pc(f1,T1){var A1=typeof Symbol<"u"&&f1[Symbol.iterator]||f1["@@iterator"];if(!A1){if(Array.isArray(f1)||(A1=mc(f1))||T1&&f1&&typeof f1.length=="number"){A1&&(f1=A1);var L1=0,B1=s$1(function(){},"F");return{s:B1,n:s$1(function(){return L1>=f1.length?{done:!0}:{done:!1,value:f1[L1++]}},"n"),e:s$1(function(E1){throw E1},"e"),f:B1}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
215
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var V1=!0,Z1=!1,H1;return{s:s$1(function(){A1=A1.call(f1)},"s"),n:s$1(function(){var E1=A1.next();return V1=E1.done,E1},"n"),e:s$1(function(E1){Z1=!0,H1=E1},"e"),f:s$1(function(){try{!V1&&A1.return!=null&&A1.return()}finally{if(Z1)throw H1}},"f")}}s$1(pc,"_createForOfIteratorHelper");function mc(f1,T1){if(f1){if(typeof f1=="string")return uf(f1,T1);var A1=Object.prototype.toString.call(f1).slice(8,-1);if(A1==="Object"&&f1.constructor&&(A1=f1.constructor.name),A1==="Map"||A1==="Set")return Array.from(f1);if(A1==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A1))return uf(f1,T1)}}s$1(mc,"_unsupportedIterableToArray");function uf(f1,T1){(T1==null||T1>f1.length)&&(T1=f1.length);for(var A1=0,L1=new Array(T1);A1<T1;A1++)L1[A1]=f1[A1];return L1}s$1(uf,"_arrayLikeToArray");var df=pn(),ff={fg:"#FFF",bg:"#000",newline:!1,escapeXML:!1,stream:!1,colors:hf()};function hf(){var f1={0:"#000",1:"#A00",2:"#0A0",3:"#A50",4:"#00A",5:"#A0A",6:"#0AA",7:"#AAA",8:"#555",9:"#F55",10:"#5F5",11:"#FF5",12:"#55F",13:"#F5F",14:"#5FF",15:"#FFF"};return xf(0,5).forEach(function(T1){xf(0,5).forEach(function(A1){xf(0,5).forEach(function(L1){return pf(T1,A1,L1,f1)})})}),xf(0,23).forEach(function(T1){var A1=T1+232,L1=mf(T1*10+8);f1[A1]="#"+L1+L1+L1}),f1}s$1(hf,"getDefaultColors");function pf(f1,T1,A1,L1){var B1=16+f1*36+T1*6+A1,V1=f1>0?f1*40+55:0,Z1=T1>0?T1*40+55:0,H1=A1>0?A1*40+55:0;L1[B1]=gf([V1,Z1,H1])}s$1(pf,"setStyleColor");function mf(f1){for(var T1=f1.toString(16);T1.length<2;)T1="0"+T1;return T1}s$1(mf,"toHexString");function gf(f1){var T1=[],A1=pc(f1),L1;try{for(A1.s();!(L1=A1.n()).done;){var B1=L1.value;T1.push(mf(B1))}}catch(V1){A1.e(V1)}finally{A1.f()}return"#"+T1.join("")}s$1(gf,"toColorHexString");function yf(f1,T1,A1,L1){var B1;return T1==="text"?B1=If(A1,L1):T1==="display"?B1=bf(f1,A1,L1):T1==="xterm256Foreground"?B1=m1(f1,L1.colors[A1]):T1==="xterm256Background"?B1=k1(f1,L1.colors[A1]):T1==="rgb"&&(B1=vf(f1,A1)),B1}s$1(yf,"generateOutput");function vf(f1,T1){T1=T1.substring(2).slice(0,-1);var A1=+T1.substr(0,2),L1=T1.substring(5).split(";"),B1=L1.map(function(V1){return("0"+Number(V1).toString(16)).substr(-2)}).join("");return c1(f1,(A1===38?"color:#":"background-color:#")+B1)}s$1(vf,"handleRgb");function bf(f1,T1,A1){T1=parseInt(T1,10);var L1={"-1":s$1(function(){return"<br/>"},"_"),0:s$1(function(){return f1.length&&Sf(f1)},"_"),1:s$1(function(){return l1(f1,"b")},"_"),3:s$1(function(){return l1(f1,"i")},"_"),4:s$1(function(){return l1(f1,"u")},"_"),8:s$1(function(){return c1(f1,"display:none")},"_"),9:s$1(function(){return l1(f1,"strike")},"_"),22:s$1(function(){return c1(f1,"font-weight:normal;text-decoration:none;font-style:normal")},"_"),23:s$1(function(){return N1(f1,"i")},"_"),24:s$1(function(){return N1(f1,"u")},"_"),39:s$1(function(){return m1(f1,A1.fg)},"_"),49:s$1(function(){return k1(f1,A1.bg)},"_"),53:s$1(function(){return c1(f1,"text-decoration:overline")},"_")},B1;return L1[T1]?B1=L1[T1]():4<T1&&T1<7?B1=l1(f1,"blink"):29<T1&&T1<38?B1=m1(f1,A1.colors[T1-30]):39<T1&&T1<48?B1=k1(f1,A1.colors[T1-40]):89<T1&&T1<98?B1=m1(f1,A1.colors[8+(T1-90)]):99<T1&&T1<108&&(B1=k1(f1,A1.colors[8+(T1-100)])),B1}s$1(bf,"handleDisplay");function Sf(f1){var T1=f1.slice(0);return f1.length=0,T1.reverse().map(function(A1){return"</"+A1+">"}).join("")}s$1(Sf,"resetStyles");function xf(f1,T1){for(var A1=[],L1=f1;L1<=T1;L1++)A1.push(L1);return A1}s$1(xf,"range");function wf(f1){return function(T1){return(f1===null||T1.category!==f1)&&f1!=="all"}}s$1(wf,"notCategory");function s1(f1){f1=parseInt(f1,10);var T1=null;return f1===0?T1="all":f1===1?T1="bold":2<f1&&f1<5?T1="underline":4<f1&&f1<7?T1="blink":f1===8?T1="hide":f1===9?T1="strike":29<f1&&f1<38||f1===39||89<f1&&f1<98?T1="foreground-color":(39<f1&&f1<48||f1===49||99<f1&&f1<108)&&(T1="background-color"),T1}s$1(s1,"categoryForCode");function If(f1,T1){return T1.escapeXML?df.encodeXML(f1):f1}s$1(If,"pushText");function l1(f1,T1,A1){return A1||(A1=""),f1.push(T1),"<".concat(T1).concat(A1?' style="'.concat(A1,'"'):"",">")}s$1(l1,"pushTag");function c1(f1,T1){return l1(f1,"span",T1)}s$1(c1,"pushStyle");function m1(f1,T1){return l1(f1,"span","color:"+T1)}s$1(m1,"pushForegroundColor");function k1(f1,T1){return l1(f1,"span","background-color:"+T1)}s$1(k1,"pushBackgroundColor");function N1(f1,T1){var A1;if(f1.slice(-1)[0]===T1&&(A1=f1.pop()),A1)return"</"+T1+">"}s$1(N1,"closeTag");function R1(f1,T1,A1){var L1=!1,B1=3;function V1(){return""}s$1(V1,"remove");function Z1(_1,j1){return A1("xterm256Foreground",j1),""}s$1(Z1,"removeXterm256Foreground");function H1(_1,j1){return A1("xterm256Background",j1),""}s$1(H1,"removeXterm256Background");function E1(_1){return T1.newline?A1("display",-1):A1("text",_1),""}s$1(E1,"newline");function F1(_1,j1){L1=!0,j1.trim().length===0&&(j1="0"),j1=j1.trimRight(";").split(";");var P1=pc(j1),u1;try{for(P1.s();!(u1=P1.n()).done;){var d1=u1.value;A1("display",d1)}}catch(O1){P1.e(O1)}finally{P1.f()}return""}s$1(F1,"ansiMess");function M1(_1){return A1("text",_1),""}s$1(M1,"realText");function q1(_1){return A1("rgb",_1),""}s$1(q1,"rgb");var z1=[{pattern:/^\x08+/,sub:V1},{pattern:/^\x1b\[[012]?K/,sub:V1},{pattern:/^\x1b\[\(B/,sub:V1},{pattern:/^\x1b\[[34]8;2;\d+;\d+;\d+m/,sub:q1},{pattern:/^\x1b\[38;5;(\d+)m/,sub:Z1},{pattern:/^\x1b\[48;5;(\d+)m/,sub:H1},{pattern:/^\n/,sub:E1},{pattern:/^\r+\n/,sub:E1},{pattern:/^\r/,sub:E1},{pattern:/^\x1b\[((?:\d{1,3};?)+|)m/,sub:F1},{pattern:/^\x1b\[\d?J/,sub:V1},{pattern:/^\x1b\[\d{0,3};\d{0,3}f/,sub:V1},{pattern:/^\x1b\[?[\d;]{0,3}/,sub:V1},{pattern:/^(([^\x1b\x08\r\n])+)/,sub:M1}];function W1(_1,j1){j1>B1&&L1||(L1=!1,f1=f1.replace(_1.pattern,_1.sub))}s$1(W1,"process");var J1=[],eT=f1,nT=eT.length;e:for(;nT>0;){for(var sT=0,iT=0,rT=z1.length;iT<rT;sT=++iT){var lT=z1[sT];if(W1(lT,sT),f1.length!==nT){nT=f1.length;continue e}}if(f1.length===nT)break;J1.push(0),nT=f1.length}return J1}s$1(R1,"tokenize");function $1(f1,T1,A1){return T1!=="text"&&(f1=f1.filter(wf(s1(A1))),f1.push({token:T1,data:A1,category:s1(A1)})),f1}s$1($1,"updateStickyStack");var D1=function(){function f1(T1){bo(this,f1),T1=T1||{},T1.colors&&(T1.colors=Object.assign({},ff.colors,T1.colors)),this.options=Object.assign({},ff,T1),this.stack=[],this.stickyStack=[]}return s$1(f1,"Filter"),hc(f1,[{key:"toHtml",value:s$1(function(T1){var A1=this;T1=typeof T1=="string"?[T1]:T1;var L1=this.stack,B1=this.options,V1=[];return this.stickyStack.forEach(function(Z1){var H1=yf(L1,Z1.token,Z1.data,B1);H1&&V1.push(H1)}),R1(T1.join(""),B1,function(Z1,H1){var E1=yf(L1,Z1,H1,B1);E1&&V1.push(E1),B1.stream&&(A1.stickyStack=$1(A1.stickyStack,Z1,H1))}),L1.length&&V1.push(Sf(L1)),V1.join("")},"toHtml")}]),f1}();Ai.exports=D1}),v=(()=>{let vo;return typeof window<"u"?vo=window:typeof globalThis<"u"?vo=globalThis:typeof global<"u"?vo=global:typeof self<"u"?vo=self:vo={},vo})();function fr(){let vo={setHandler:s$1(()=>{},"setHandler"),send:s$1(()=>{},"send")};return new z$2({transport:vo})}s$1(fr,"mockChannel");var hr=class{constructor(){this.getChannel=s$1(()=>{if(!this.channel){let vo=fr();return this.setChannel(vo),vo}return this.channel},"getChannel"),this.ready=s$1(()=>this.promise,"ready"),this.hasChannel=s$1(()=>!!this.channel,"hasChannel"),this.setChannel=s$1(vo=>{this.channel=vo,this.resolve()},"setChannel"),this.promise=new Promise(vo=>{this.resolve=()=>vo(this.getChannel())})}};s$1(hr,"AddonStore");var mr=hr,yr="__STORYBOOK_ADDONS_PREVIEW";function Nn(){return v[yr]||(v[yr]=new mr),v[yr]}s$1(Nn,"getAddonsStore");var q=Nn(),xr=class{constructor(){this.hookListsMap=void 0,this.mountedDecorators=void 0,this.prevMountedDecorators=void 0,this.currentHooks=void 0,this.nextHookIndex=void 0,this.currentPhase=void 0,this.currentEffects=void 0,this.prevEffects=void 0,this.currentDecoratorName=void 0,this.hasUpdates=void 0,this.currentContext=void 0,this.renderListener=s$1(vo=>{var Ai;vo===((Ai=this.currentContext)==null?void 0:Ai.id)&&(this.triggerEffects(),this.currentContext=null,this.removeRenderListeners())},"renderListener"),this.init()}init(){this.hookListsMap=new WeakMap,this.mountedDecorators=new Set,this.prevMountedDecorators=new Set,this.currentHooks=[],this.nextHookIndex=0,this.currentPhase="NONE",this.currentEffects=[],this.prevEffects=[],this.currentDecoratorName=null,this.hasUpdates=!1,this.currentContext=null}clean(){this.prevEffects.forEach(vo=>{vo.destroy&&vo.destroy()}),this.init(),this.removeRenderListeners()}getNextHook(){let vo=this.currentHooks[this.nextHookIndex];return this.nextHookIndex+=1,vo}triggerEffects(){this.prevEffects.forEach(vo=>{!this.currentEffects.includes(vo)&&vo.destroy&&vo.destroy()}),this.currentEffects.forEach(vo=>{this.prevEffects.includes(vo)||(vo.destroy=vo.create())}),this.prevEffects=this.currentEffects,this.currentEffects=[]}addRenderListeners(){this.removeRenderListeners(),q.getChannel().on(X$2,this.renderListener)}removeRenderListeners(){q.getChannel().removeListener(X$2,this.renderListener)}};s$1(xr,"HooksContext");var ee=xr;function Tt(vo){let Ai=s$1((...bo)=>{let{hooks:Ra}=typeof bo[0]=="function"?bo[1]:bo[0],hc=Ra.currentPhase,pc=Ra.currentHooks,mc=Ra.nextHookIndex,uf=Ra.currentDecoratorName;Ra.currentDecoratorName=vo.name,Ra.prevMountedDecorators.has(vo)?(Ra.currentPhase="UPDATE",Ra.currentHooks=Ra.hookListsMap.get(vo)||[]):(Ra.currentPhase="MOUNT",Ra.currentHooks=[],Ra.hookListsMap.set(vo,Ra.currentHooks),Ra.prevMountedDecorators.add(vo)),Ra.nextHookIndex=0;let df=v.STORYBOOK_HOOKS_CONTEXT;v.STORYBOOK_HOOKS_CONTEXT=Ra;let ff=vo(...bo);if(v.STORYBOOK_HOOKS_CONTEXT=df,Ra.currentPhase==="UPDATE"&&Ra.getNextHook()!=null)throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");return Ra.currentPhase=hc,Ra.currentHooks=pc,Ra.nextHookIndex=mc,Ra.currentDecoratorName=uf,ff},"hookified");return Ai.originalFn=vo,Ai}s$1(Tt,"hookify");var gr=0,Vn=25,br=s$1(vo=>(Ai,bo)=>{let Ra=vo(Tt(Ai),bo.map(hc=>Tt(hc)));return hc=>{let{hooks:pc}=hc;pc.prevMountedDecorators??(pc.prevMountedDecorators=new Set),pc.mountedDecorators=new Set([Ai,...bo]),pc.currentContext=hc,pc.hasUpdates=!1;let mc=Ra(hc);for(gr=1;pc.hasUpdates;)if(pc.hasUpdates=!1,pc.currentEffects=[],mc=Ra(hc),gr+=1,gr>Vn)throw new Error("Too many re-renders. Storybook limits the number of renders to prevent an infinite loop.");return pc.addRenderListeners(),mc}},"applyHooks"),Un=s$1((vo,Ai)=>vo.length===Ai.length&&vo.every((bo,Ra)=>bo===Ai[Ra]),"areDepsEqual"),Sr=s$1(()=>new Error("Storybook preview hooks can only be called inside decorators and story functions."),"invalidHooksError");function xt(){return v.STORYBOOK_HOOKS_CONTEXT||null}s$1(xt,"getHooksContextOrNull");function Tr(){let vo=xt();if(vo==null)throw Sr();return vo}s$1(Tr,"getHooksContextOrThrow");function Hn(vo,Ai,bo){let Ra=Tr();if(Ra.currentPhase==="MOUNT"){bo!=null&&!Array.isArray(bo)&&s$3.warn(`${vo} received a final argument that is not an array (instead, received ${bo}). When specified, the final argument must be an array.`);let hc={name:vo,deps:bo};return Ra.currentHooks.push(hc),Ai(hc),hc}if(Ra.currentPhase==="UPDATE"){let hc=Ra.getNextHook();if(hc==null)throw new Error("Rendered more hooks than during the previous render.");return hc.name!==vo&&s$3.warn(`Storybook has detected a change in the order of Hooks${Ra.currentDecoratorName?` called by ${Ra.currentDecoratorName}`:""}. This will lead to bugs and errors if not fixed.`),bo!=null&&hc.deps==null&&s$3.warn(`${vo} received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.`),bo!=null&&hc.deps!=null&&bo.length!==hc.deps.length&&s$3.warn(`The final argument passed to ${vo} changed size between renders. The order and size of this array must remain constant.
|
|
216
|
-
Previous: ${hc.deps}
|
|
217
|
-
Incoming: ${bo}`),(bo==null||hc.deps==null||!Un(bo,hc.deps))&&(Ai(hc),hc.deps=bo),hc}throw Sr()}s$1(Hn,"useHook");function qe(vo,Ai,bo){let{memoizedState:Ra}=Hn(vo,hc=>{hc.memoizedState=Ai()},bo);return Ra}s$1(qe,"useMemoLike");function Wn(vo,Ai){return qe("useMemo",vo,Ai)}s$1(Wn,"useMemo");function Ee(vo,Ai){return qe("useCallback",()=>vo,Ai)}s$1(Ee,"useCallback");function Rt(vo,Ai){return qe(vo,()=>({current:Ai}),[])}s$1(Rt,"useRefLike");function $n(vo){return Rt("useRef",vo)}s$1($n,"useRef");function Yn(){let vo=xt();if(vo!=null&&vo.currentPhase!=="NONE")vo.hasUpdates=!0;else try{q.getChannel().emit(L$2)}catch{s$3.warn("State updates of Storybook preview hooks work only in browser")}}s$1(Yn,"triggerUpdate");function wt(vo,Ai){let bo=Rt(vo,typeof Ai=="function"?Ai():Ai),Ra=s$1(hc=>{bo.current=typeof hc=="function"?hc(bo.current):hc,Yn()},"setState");return[bo.current,Ra]}s$1(wt,"useStateLike");function Kn(vo){return wt("useState",vo)}s$1(Kn,"useState");function Xn(vo,Ai,bo){let Ra=bo!=null?()=>bo(Ai):Ai,[hc,pc]=wt("useReducer",Ra);return[hc,s$1(mc=>pc(uf=>vo(uf,mc)),"dispatch")]}s$1(Xn,"useReducer");function Et(vo,Ai){let bo=Tr(),Ra=qe("useEffect",()=>({create:vo}),Ai);bo.currentEffects.includes(Ra)||bo.currentEffects.push(Ra)}s$1(Et,"useEffect");function Jn(vo,Ai=[]){let bo=q.getChannel();return Et(()=>(Object.entries(vo).forEach(([Ra,hc])=>bo.on(Ra,hc)),()=>{Object.entries(vo).forEach(([Ra,hc])=>bo.removeListener(Ra,hc))}),[...Object.keys(vo),...Ai]),Ee(bo.emit.bind(bo),[bo])}s$1(Jn,"useChannel");function Be(){let{currentContext:vo}=Tr();if(vo==null)throw Sr();return vo}s$1(Be,"useStoryContext");function Qn(vo,Ai){let{parameters:bo}=Be();if(vo)return bo[vo]??Ai}s$1(Qn,"useParameter");function Zn(){let vo=q.getChannel(),{id:Ai,args:bo}=Be(),Ra=Ee(pc=>vo.emit(n$1,{storyId:Ai,updatedArgs:pc}),[vo,Ai]),hc=Ee(pc=>vo.emit(H$2,{storyId:Ai,argNames:pc}),[vo,Ai]);return[bo,Ra,hc]}s$1(Zn,"useArgs");function es(){let vo=q.getChannel(),{globals:Ai}=Be(),bo=Ee(Ra=>vo.emit(j,{globals:Ra}),[vo]);return[Ai,bo]}s$1(es,"useGlobals");function Rr(vo,Ai){let bo={},Ra=Object.entries(vo);for(let hc=0;hc<Ra.length;hc++){let[pc,mc]=Ra[hc];Ai(mc,pc)||(bo[pc]=mc)}return bo}s$1(Rr,"omitBy");function wr(vo,Ai){let bo={};for(let Ra=0;Ra<Ai.length;Ra++){let hc=Ai[Ra];Object.prototype.hasOwnProperty.call(vo,hc)&&(bo[hc]=vo[hc])}return bo}s$1(wr,"pick");function Er(vo,Ai){let bo={},Ra=Object.entries(vo);for(let hc=0;hc<Ra.length;hc++){let[pc,mc]=Ra[hc];Ai(mc,pc)&&(bo[pc]=mc)}return bo}s$1(Er,"pickBy");function k(vo){if(typeof vo!="object"||vo==null)return!1;if(Object.getPrototypeOf(vo)===null)return!0;if(vo.toString()!=="[object Object]")return!1;let Ai=vo;for(;Object.getPrototypeOf(Ai)!==null;)Ai=Object.getPrototypeOf(Ai);return Object.getPrototypeOf(vo)===Ai}s$1(k,"isPlainObject");function L(vo,Ai){let bo={},Ra=Object.keys(vo);for(let hc=0;hc<Ra.length;hc++){let pc=Ra[hc],mc=vo[pc];bo[pc]=Ai(mc,pc,vo)}return bo}s$1(L,"mapValues");var At="[object RegExp]",vt="[object String]",Ct="[object Number]",Pt="[object Boolean]",Ar="[object Arguments]",Ft="[object Symbol]",It="[object Date]",Ot="[object Map]",Dt="[object Set]",kt="[object Array]",jt="[object Function]",Mt="[object ArrayBuffer]",ze="[object Object]",_t="[object Error]",Lt="[object DataView]",Nt="[object Uint8Array]",qt="[object Uint8ClampedArray]",Bt="[object Uint16Array]",zt="[object Uint32Array]",Gt="[object BigUint64Array]",Vt="[object Int8Array]",Ut="[object Int16Array]",Ht="[object Int32Array]",Wt="[object BigInt64Array]",$t="[object Float32Array]",Yt="[object Float64Array]";function vr(vo){return Object.getOwnPropertySymbols(vo).filter(Ai=>Object.prototype.propertyIsEnumerable.call(vo,Ai))}s$1(vr,"getSymbols");function Cr(vo){return vo==null?vo===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(vo)}s$1(Cr,"getTag");function Pr(vo,Ai){if(typeof vo==typeof Ai)switch(typeof vo){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return vo===Ai;case"number":return vo===Ai||Object.is(vo,Ai);case"function":return vo===Ai;case"object":return U(vo,Ai)}return U(vo,Ai)}s$1(Pr,"isEqual");function U(vo,Ai,bo){if(Object.is(vo,Ai))return!0;let Ra=Cr(vo),hc=Cr(Ai);if(Ra===Ar&&(Ra=ze),hc===Ar&&(hc=ze),Ra!==hc)return!1;switch(Ra){case vt:return vo.toString()===Ai.toString();case Ct:{let uf=vo.valueOf(),df=Ai.valueOf();return uf===df||Number.isNaN(uf)&&Number.isNaN(df)}case Pt:case It:case Ft:return Object.is(vo.valueOf(),Ai.valueOf());case At:return vo.source===Ai.source&&vo.flags===Ai.flags;case jt:return vo===Ai}bo=bo??new Map;let pc=bo.get(vo),mc=bo.get(Ai);if(pc!=null&&mc!=null)return pc===Ai;bo.set(vo,Ai),bo.set(Ai,vo);try{switch(Ra){case Ot:{if(vo.size!==Ai.size)return!1;for(let[uf,df]of vo.entries())if(!Ai.has(uf)||!U(df,Ai.get(uf),bo))return!1;return!0}case Dt:{if(vo.size!==Ai.size)return!1;let uf=Array.from(vo.values()),df=Array.from(Ai.values());for(let ff=0;ff<uf.length;ff++){let hf=uf[ff],pf=df.findIndex(mf=>U(hf,mf,bo));if(pf===-1)return!1;df.splice(pf,1)}return!0}case kt:case Nt:case qt:case Bt:case zt:case Gt:case Vt:case Ut:case Ht:case Wt:case $t:case Yt:{if(typeof Buffer<"u"&&Buffer.isBuffer(vo)!==Buffer.isBuffer(Ai)||vo.length!==Ai.length)return!1;for(let uf=0;uf<vo.length;uf++)if(!U(vo[uf],Ai[uf],bo))return!1;return!0}case Mt:return vo.byteLength!==Ai.byteLength?!1:U(new Uint8Array(vo),new Uint8Array(Ai),bo);case Lt:return vo.byteLength!==Ai.byteLength||vo.byteOffset!==Ai.byteOffset?!1:U(vo.buffer,Ai.buffer,bo);case _t:return vo.name===Ai.name&&vo.message===Ai.message;case ze:{if(!(U(vo.constructor,Ai.constructor,bo)||k(vo)&&k(Ai)))return!1;let uf=[...Object.keys(vo),...vr(vo)],df=[...Object.keys(Ai),...vr(Ai)];if(uf.length!==df.length)return!1;for(let ff=0;ff<uf.length;ff++){let hf=uf[ff],pf=vo[hf];if(!Object.prototype.hasOwnProperty.call(Ai,hf))return!1;let mf=Ai[hf];if(!U(pf,mf,bo))return!1}return!0}default:return!1}}finally{bo.delete(vo),bo.delete(Ai)}}s$1(U,"areObjectsEqual");var Ke=ce(Ir());function F(vo){for(var Ai=[],bo=1;bo<arguments.length;bo++)Ai[bo-1]=arguments[bo];var Ra=Array.from(typeof vo=="string"?[vo]:vo);Ra[Ra.length-1]=Ra[Ra.length-1].replace(/\r?\n([\t ]*)$/,"");var hc=Ra.reduce(function(uf,df){var ff=df.match(/\n([\t ]+|(?!\s).)/g);return ff?uf.concat(ff.map(function(hf){var pf,mf;return(mf=(pf=hf.match(/[\t ]/g))===null||pf===void 0?void 0:pf.length)!==null&&mf!==void 0?mf:0})):uf},[]);if(hc.length){var pc=new RegExp(`
|
|
218
|
-
[ ]{`+Math.min.apply(Math,hc)+"}","g");Ra=Ra.map(function(uf){return uf.replace(pc,`
|
|
219
|
-
`)})}Ra[0]=Ra[0].replace(/^\r?\n/,"");var mc=Ra[0];return Ai.forEach(function(uf,df){var ff=mc.match(/(?:^|\n)( *)$/),hf=ff?ff[1]:"",pf=uf;typeof uf=="string"&&uf.includes(`
|
|
220
|
-
`)&&(pf=String(uf).split(`
|
|
221
|
-
`).map(function(mf,gf){return gf===0?mf:""+hf+mf}).join(`
|
|
222
|
-
`)),mc+=pf+Ra[df+1]}),mc}s$1(F,"dedent");var de=Symbol("incompatible"),Dr=s$1((vo,Ai)=>{let bo=Ai.type;if(vo==null||!bo||Ai.mapping)return vo;switch(bo.name){case"string":return String(vo);case"enum":return vo;case"number":return Number(vo);case"boolean":return String(vo)==="true";case"array":return!bo.value||!Array.isArray(vo)?de:vo.reduce((Ra,hc,pc)=>{let mc=Dr(hc,{type:bo.value});return mc!==de&&(Ra[pc]=mc),Ra},new Array(vo.length));case"object":return typeof vo=="string"||typeof vo=="number"?vo:!bo.value||typeof vo!="object"?de:Object.entries(vo).reduce((Ra,[hc,pc])=>{let mc=Dr(pc,{type:bo.value[hc]});return mc===de?Ra:Object.assign(Ra,{[hc]:mc})},{});default:return de}},"map"),Xt=s$1((vo,Ai)=>Object.entries(vo).reduce((bo,[Ra,hc])=>{if(!Ai[Ra])return bo;let pc=Dr(hc,Ai[Ra]);return pc===de?bo:Object.assign(bo,{[Ra]:pc})},{}),"mapArgsToTypes"),Ae=s$1((vo,Ai)=>Array.isArray(vo)&&Array.isArray(Ai)?Ai.reduce((bo,Ra,hc)=>(bo[hc]=Ae(vo[hc],Ai[hc]),bo),[...vo]).filter(bo=>bo!==void 0):!k(vo)||!k(Ai)?Ai:Object.keys({...vo,...Ai}).reduce((bo,Ra)=>{if(Ra in Ai){let hc=Ae(vo[Ra],Ai[Ra]);hc!==void 0&&(bo[Ra]=hc)}else bo[Ra]=vo[Ra];return bo},{}),"combineArgs"),Jt=s$1((vo,Ai)=>Object.entries(Ai).reduce((bo,[Ra,{options:hc}])=>{function pc(){return Ra in vo&&(bo[Ra]=vo[Ra]),bo}if(s$1(pc,"allowArg"),!hc)return pc();if(!Array.isArray(hc))return n$2.error(F`
|
|
223
|
-
Invalid argType: '${Ra}.options' should be an array.
|
|
224
|
-
|
|
225
|
-
More info: https://storybook.js.org/docs/api/arg-types
|
|
226
|
-
`),pc();if(hc.some(pf=>pf&&["object","function"].includes(typeof pf)))return n$2.error(F`
|
|
227
|
-
Invalid argType: '${Ra}.options' should only contain primitives. Use a 'mapping' for complex values.
|
|
228
|
-
|
|
229
|
-
More info: https://storybook.js.org/docs/writing-stories/args#mapping-to-complex-arg-values
|
|
230
|
-
`),pc();let mc=Array.isArray(vo[Ra]),uf=mc&&vo[Ra].findIndex(pf=>!hc.includes(pf)),df=mc&&uf===-1;if(vo[Ra]===void 0||hc.includes(vo[Ra])||df)return pc();let ff=mc?`${Ra}[${uf}]`:Ra,hf=hc.map(pf=>typeof pf=="string"?`'${pf}'`:String(pf)).join(", ");return n$2.warn(`Received illegal value for '${ff}'. Supported options: ${hf}`),bo},{}),"validateOptions"),re=Symbol("Deeply equal"),pe=s$1((vo,Ai)=>{if(typeof vo!=typeof Ai)return Ai;if(Pr(vo,Ai))return re;if(Array.isArray(vo)&&Array.isArray(Ai)){let bo=Ai.reduce((Ra,hc,pc)=>{let mc=pe(vo[pc],hc);return mc!==re&&(Ra[pc]=mc),Ra},new Array(Ai.length));return Ai.length>=vo.length?bo:bo.concat(new Array(vo.length-Ai.length).fill(void 0))}return k(vo)&&k(Ai)?Object.keys({...vo,...Ai}).reduce((bo,Ra)=>{let hc=pe(vo==null?void 0:vo[Ra],Ai==null?void 0:Ai[Ra]);return hc===re?bo:Object.assign(bo,{[Ra]:hc})},{}):Ai},"deepDiff"),kr="UNTARGETED";function Qt({args:vo,argTypes:Ai}){let bo={};return Object.entries(vo).forEach(([Ra,hc])=>{let{target:pc=kr}=Ai[Ra]||{};bo[pc]=bo[pc]||{},bo[pc][Ra]=hc}),bo}s$1(Qt,"groupArgsByTarget");function ts(vo){return Object.keys(vo).forEach(Ai=>vo[Ai]===void 0&&delete vo[Ai]),vo}s$1(ts,"deleteUndefined");var jr=class{constructor(){this.initialArgsByStoryId={},this.argsByStoryId={}}get(vo){if(!(vo in this.argsByStoryId))throw new Error(`No args known for ${vo} -- has it been rendered yet?`);return this.argsByStoryId[vo]}setInitial(vo){if(!this.initialArgsByStoryId[vo.id])this.initialArgsByStoryId[vo.id]=vo.initialArgs,this.argsByStoryId[vo.id]=vo.initialArgs;else if(this.initialArgsByStoryId[vo.id]!==vo.initialArgs){let Ai=pe(this.initialArgsByStoryId[vo.id],this.argsByStoryId[vo.id]);this.initialArgsByStoryId[vo.id]=vo.initialArgs,this.argsByStoryId[vo.id]=vo.initialArgs,Ai!==re&&this.updateFromDelta(vo,Ai)}}updateFromDelta(vo,Ai){let bo=Jt(Ai,vo.argTypes);this.argsByStoryId[vo.id]=Ae(this.argsByStoryId[vo.id],bo)}updateFromPersisted(vo,Ai){let bo=Xt(Ai,vo.argTypes);return this.updateFromDelta(vo,bo)}update(vo,Ai){if(!(vo in this.argsByStoryId))throw new Error(`No args known for ${vo} -- has it been rendered yet?`);this.argsByStoryId[vo]=ts({...this.argsByStoryId[vo],...Ai})}};s$1(jr,"ArgsStore");var Ge=jr,Ve=s$1((vo={})=>Object.entries(vo).reduce((Ai,[bo,{defaultValue:Ra}])=>(typeof Ra<"u"&&(Ai[bo]=Ra),Ai),{}),"getValuesFromArgTypes"),Mr=class{constructor({globals:vo={},globalTypes:Ai={}}){this.set({globals:vo,globalTypes:Ai})}set({globals:vo={},globalTypes:Ai={}}){let bo=this.initialGlobals&&pe(this.initialGlobals,this.globals);this.allowedGlobalNames=new Set([...Object.keys(vo),...Object.keys(Ai)]);let Ra=Ve(Ai);this.initialGlobals={...Ra,...vo},this.globals=this.initialGlobals,bo&&bo!==re&&this.updateFromPersisted(bo)}filterAllowedGlobals(vo){return Object.entries(vo).reduce((Ai,[bo,Ra])=>(this.allowedGlobalNames.has(bo)?Ai[bo]=Ra:s$3.warn(`Attempted to set a global (${bo}) that is not defined in initial globals or globalTypes`),Ai),{})}updateFromPersisted(vo){let Ai=this.filterAllowedGlobals(vo);this.globals={...this.globals,...Ai}}get(){return this.globals}update(vo){this.globals={...this.globals,...this.filterAllowedGlobals(vo)}}};s$1(Mr,"GlobalsStore");var Ue=Mr,Zt=ce(Ir()),ss=(0,Zt.default)(1)(vo=>Object.values(vo).reduce((Ai,bo)=>(Ai[bo.importPath]=Ai[bo.importPath]||bo,Ai),{})),_r=class{constructor({entries:vo}={v:5,entries:{}}){this.entries=vo}entryFromSpecifier(vo){let Ai=Object.values(this.entries);if(vo==="*")return Ai[0];if(typeof vo=="string")return this.entries[vo]?this.entries[vo]:Ai.find(hc=>hc.id.startsWith(vo));let{name:bo,title:Ra}=vo;return Ai.find(hc=>hc.name===bo&&hc.title===Ra)}storyIdToEntry(vo){let Ai=this.entries[vo];if(!Ai)throw new D$1({storyId:vo});return Ai}importPathToEntry(vo){return ss(this.entries)[vo]}};s$1(_r,"StoryIndexStore");var He=_r,is=s$1(vo=>typeof vo=="string"?{name:vo}:vo,"normalizeType"),as=s$1(vo=>typeof vo=="string"?{type:vo}:vo,"normalizeControl"),ls=s$1((vo,Ai)=>{let{type:bo,control:Ra,...hc}=vo,pc={name:Ai,...hc};return bo&&(pc.type=is(bo)),Ra?pc.control=as(Ra):Ra===!1&&(pc.control={disable:!0}),pc},"normalizeInputType"),te=s$1(vo=>L(vo,ls),"normalizeInputTypes"),P=s$1(vo=>Array.isArray(vo)?vo:vo?[vo]:[],"normalizeArrays"),fs=F`
|
|
231
|
-
CSF .story annotations deprecated; annotate story functions directly:
|
|
232
|
-
- StoryFn.story.name => StoryFn.storyName
|
|
233
|
-
- StoryFn.story.(parameters|decorators) => StoryFn.(parameters|decorators)
|
|
234
|
-
See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#hoisted-csf-annotations for details and codemod.
|
|
235
|
-
`;function ve(vo,Ai,bo){let Ra=Ai,hc=typeof Ai=="function"?Ai:null,{story:pc}=Ra;pc&&(s$3.debug("deprecated story",pc),m$2(fs));let mc=N(vo),uf=typeof Ra!="function"&&Ra.name||Ra.storyName||(pc==null?void 0:pc.name)||mc,df=[...P(Ra.decorators),...P(pc==null?void 0:pc.decorators)],ff={...pc==null?void 0:pc.parameters,...Ra.parameters},hf={...pc==null?void 0:pc.args,...Ra.args},pf={...pc==null?void 0:pc.argTypes,...Ra.argTypes},mf=[...P(Ra.loaders),...P(pc==null?void 0:pc.loaders)],gf=[...P(Ra.beforeEach),...P(pc==null?void 0:pc.beforeEach)],{render:yf,play:vf,tags:bf=[],globals:Sf={}}=Ra,xf=ff.__id||G(bo.id,mc);return{moduleExport:Ai,id:xf,name:uf,tags:bf,decorators:df,parameters:ff,args:hf,argTypes:te(pf),loaders:mf,beforeEach:gf,globals:Sf,...yf&&{render:yf},...hc&&{userStoryFn:hc},...vf&&{play:vf}}}s$1(ve,"normalizeStory");function We(vo,Ai=vo.title,bo){let{id:Ra,argTypes:hc}=vo;return{id:O$1(Ra||Ai),...vo,title:Ai,...hc&&{argTypes:te(hc)},parameters:{fileName:bo,...vo.parameters}}}s$1(We,"normalizeComponentAnnotations");var hs=s$1(vo=>{let{globals:Ai,globalTypes:bo}=vo;(Ai||bo)&&s$3.error("Global args/argTypes can only be set globally",JSON.stringify({globals:Ai,globalTypes:bo}))},"checkGlobals"),gs=s$1(vo=>{let{options:Ai}=vo;Ai!=null&&Ai.storySort&&s$3.error("The storySort option parameter can only be set globally")},"checkStorySort"),eo=s$1(vo=>{vo&&(hs(vo),gs(vo))},"checkDisallowedParameters");function to(vo,Ai,bo){let{default:Ra,__namedExportsOrder:hc,...pc}=vo,mc=We(Ra,bo,Ai);eo(mc.parameters);let uf={meta:mc,stories:{},moduleExports:vo};return Object.keys(pc).forEach(df=>{if(M$1(df,mc)){let ff=ve(df,pc[df],mc);eo(ff.parameters),uf.stories[ff.id]=ff}}),uf}s$1(to,"processCSFFile");function no(vo){return vo!=null&&bs(vo).includes("mount")}s$1(no,"mountDestructured");function bs(vo){let Ai=vo.toString().match(/[^(]*\(([^)]*)/);if(!Ai)return[];let bo=oo(Ai[1]);if(!bo.length)return[];let Ra=bo[0];return Ra.startsWith("{")&&Ra.endsWith("}")?oo(Ra.slice(1,-1).replace(/\s/g,"")).map(hc=>hc.replace(/:.*|=.*/g,"")):[]}s$1(bs,"getUsedProps");function oo(vo){let Ai=[],bo=[],Ra=0;for(let pc=0;pc<vo.length;pc++)if(vo[pc]==="{"||vo[pc]==="[")bo.push(vo[pc]==="{"?"}":"]");else if(vo[pc]===bo[bo.length-1])bo.pop();else if(!bo.length&&vo[pc]===","){let mc=vo.substring(Ra,pc).trim();mc&&Ai.push(mc),Ra=pc+1}let hc=vo.substring(Ra).trim();return hc&&Ai.push(hc),Ai}s$1(oo,"splitByComma");function so(vo,Ai,bo){let Ra=bo(vo);return hc=>Ai(Ra,hc)}s$1(so,"decorateStory");function io({componentId:vo,title:Ai,kind:bo,id:Ra,name:hc,story:pc,parameters:mc,initialArgs:uf,argTypes:df,...ff}={}){return ff}s$1(io,"sanitizeStoryContextUpdate");function Lr(vo,Ai){let bo={},Ra=s$1(pc=>mc=>{if(!bo.value)throw new Error("Decorated function called without init");return bo.value={...bo.value,...io(mc)},pc(bo.value)},"bindWithContext"),hc=Ai.reduce((pc,mc)=>so(pc,mc,Ra),vo);return pc=>(bo.value=pc,hc(pc))}s$1(Lr,"defaultDecorateStory");var M=s$1((...vo)=>{let Ai={},bo=vo.filter(Boolean),Ra=bo.reduce((hc,pc)=>(Object.entries(pc).forEach(([mc,uf])=>{let df=hc[mc];Array.isArray(uf)||typeof df>"u"?hc[mc]=uf:k(uf)&&k(df)?Ai[mc]=!0:typeof uf<"u"&&(hc[mc]=uf)}),hc),{});return Object.keys(Ai).forEach(hc=>{let pc=bo.filter(Boolean).map(mc=>mc[hc]).filter(mc=>typeof mc<"u");pc.every(mc=>k(mc))?Ra[hc]=M(...pc):Ra[hc]=pc[pc.length-1]}),Ra},"combineParameters");function Ce(vo,Ai,bo){let{moduleExport:Ra,id:hc,name:pc}=vo||{},mc=ao(vo,Ai,bo),uf=s$1(async If=>{let l1={};for(let c1 of[..."__STORYBOOK_TEST_LOADERS__"in v&&Array.isArray(v.__STORYBOOK_TEST_LOADERS__)?[v.__STORYBOOK_TEST_LOADERS__]:[],P(bo.loaders),P(Ai.loaders),P(vo.loaders)]){if(If.abortSignal.aborted)return l1;let m1=await Promise.all(c1.map(k1=>k1(If)));Object.assign(l1,...m1)}return l1},"applyLoaders"),df=s$1(async If=>{let l1=new Array;for(let c1 of[...P(bo.beforeEach),...P(Ai.beforeEach),...P(vo.beforeEach)]){if(If.abortSignal.aborted)return l1;let m1=await c1(If);m1&&l1.push(m1)}return l1},"applyBeforeEach"),ff=s$1(If=>If.originalStoryFn(If.args,If),"undecoratedStoryFn"),{applyDecorators:hf=Lr,runStep:pf}=bo,mf=[...P(vo==null?void 0:vo.decorators),...P(Ai==null?void 0:Ai.decorators),...P(bo==null?void 0:bo.decorators)],gf=(vo==null?void 0:vo.userStoryFn)||(vo==null?void 0:vo.render)||Ai.render||bo.render,yf=br(hf)(ff,mf),vf=s$1(If=>yf(If),"unboundStoryFn"),bf=(vo==null?void 0:vo.play)??(Ai==null?void 0:Ai.play),Sf=no(bf);if(!gf&&!Sf)throw new q$1({id:hc});let xf=s$1(If=>async()=>(await If.renderToCanvas(),If.canvas),"defaultMount"),wf=vo.mount??Ai.mount??bo.mount??xf,s1=bo.testingLibraryRender;return{storyGlobals:{},...mc,moduleExport:Ra,id:hc,name:pc,story:pc,originalStoryFn:gf,undecoratedStoryFn:ff,unboundStoryFn:vf,applyLoaders:uf,applyBeforeEach:df,playFunction:bf,runStep:pf,mount:wf,testingLibraryRender:s1,renderToCanvas:bo.renderToCanvas,usesMount:Sf}}s$1(Ce,"prepareStory");function Nr(vo,Ai,bo){return{...ao(void 0,vo,Ai),moduleExport:bo}}s$1(Nr,"prepareMeta");function ao(vo,Ai,bo){var Ra;let hc=["dev","test"],pc=((Ra=v.DOCS_OPTIONS)==null?void 0:Ra.autodocs)===!0?["autodocs"]:[],mc=z(...hc,...pc,...bo.tags??[],...Ai.tags??[],...(vo==null?void 0:vo.tags)??[]),uf=M(bo.parameters,Ai.parameters,vo==null?void 0:vo.parameters),{argTypesEnhancers:df=[],argsEnhancers:ff=[]}=bo,hf=M(bo.argTypes,Ai.argTypes,vo==null?void 0:vo.argTypes);if(vo){let xf=(vo==null?void 0:vo.userStoryFn)||(vo==null?void 0:vo.render)||Ai.render||bo.render;uf.__isArgsStory=xf&&xf.length>0}let pf={...bo.args,...Ai.args,...vo==null?void 0:vo.args},mf={...Ai.globals,...vo==null?void 0:vo.globals},gf={componentId:Ai.id,title:Ai.title,kind:Ai.title,id:(vo==null?void 0:vo.id)||Ai.id,name:(vo==null?void 0:vo.name)||"__meta",story:(vo==null?void 0:vo.name)||"__meta",component:Ai.component,subcomponents:Ai.subcomponents,tags:mc,parameters:uf,initialArgs:pf,argTypes:hf,storyGlobals:mf};gf.argTypes=df.reduce((xf,wf)=>wf({...gf,argTypes:xf}),gf.argTypes);let yf={...pf};gf.initialArgs=ff.reduce((xf,wf)=>({...xf,...wf({...gf,initialArgs:xf})}),yf);let{name:vf,story:bf,...Sf}=gf;return Sf}s$1(ao,"preparePartialAnnotations");function $e(vo){var Ai;let{args:bo}=vo,Ra={...vo,allArgs:void 0,argsByTarget:void 0};if((Ai=v.FEATURES)!=null&&Ai.argTypeTargetsV7){let mc=Qt(vo);Ra={...vo,allArgs:vo.args,argsByTarget:mc,args:mc[kr]||{}}}let hc=Object.entries(Ra.args).reduce((mc,[uf,df])=>{var ff;if(!((ff=Ra.argTypes[uf])!=null&&ff.mapping))return mc[uf]=df,mc;let hf=s$1(pf=>{let mf=Ra.argTypes[uf].mapping;return mf&&pf in mf?mf[pf]:pf},"mappingFn");return mc[uf]=Array.isArray(df)?df.map(hf):hf(df),mc},{}),pc=Object.entries(hc).reduce((mc,[uf,df])=>{let ff=Ra.argTypes[uf]||{};return P$1(ff,hc,Ra.globals)&&(mc[uf]=df),mc},{});return{...Ra,unmappedArgs:bo,args:pc}}s$1($e,"prepareContext");var qr=s$1((vo,Ai,bo)=>{let Ra=typeof vo;switch(Ra){case"boolean":case"string":case"number":case"function":case"symbol":return{name:Ra}}return vo?bo.has(vo)?(s$3.warn(F`
|
|
236
|
-
We've detected a cycle in arg '${Ai}'. Args should be JSON-serializable.
|
|
237
|
-
|
|
238
|
-
Consider using the mapping feature or fully custom args:
|
|
239
|
-
- Mapping: https://storybook.js.org/docs/writing-stories/args#mapping-to-complex-arg-values
|
|
240
|
-
- Custom args: https://storybook.js.org/docs/essentials/controls#fully-custom-args
|
|
241
|
-
`),{name:"other",value:"cyclic object"}):(bo.add(vo),Array.isArray(vo)?{name:"array",value:vo.length>0?qr(vo[0],Ai,new Set(bo)):{name:"other",value:"unknown"}}:{name:"object",value:L(vo,hc=>qr(hc,Ai,new Set(bo)))}):{name:"object",value:{}}},"inferType"),Br=s$1(vo=>{let{id:Ai,argTypes:bo={},initialArgs:Ra={}}=vo,hc=L(Ra,(mc,uf)=>({name:uf,type:qr(mc,`${Ai}.${uf}`,new Set)})),pc=L(bo,(mc,uf)=>({name:uf}));return M(hc,pc,bo)},"inferArgTypes");Br.secondPass=!0;var lo=s$1((vo,Ai)=>Array.isArray(Ai)?Ai.includes(vo):vo.match(Ai),"matches"),Ye=s$1((vo,Ai,bo)=>!Ai&&!bo?vo:vo&&Er(vo,(Ra,hc)=>{let pc=Ra.name||hc.toString();return!!(!Ai||lo(pc,Ai))&&(!bo||!lo(pc,bo))}),"filterArgTypes"),Es=s$1((vo,Ai,bo)=>{let{type:Ra,options:hc}=vo;if(Ra){if(bo.color&&bo.color.test(Ai)){let pc=Ra.name;if(pc==="string")return{control:{type:"color"}};pc!=="enum"&&s$3.warn(`Addon controls: Control of type color only supports string, received "${pc}" instead`)}if(bo.date&&bo.date.test(Ai))return{control:{type:"date"}};switch(Ra.name){case"array":return{control:{type:"object"}};case"boolean":return{control:{type:"boolean"}};case"string":return{control:{type:"text"}};case"number":return{control:{type:"number"}};case"enum":{let{value:pc}=Ra;return{control:{type:(pc==null?void 0:pc.length)<=5?"radio":"select"},options:pc}}case"function":case"symbol":return null;default:return{control:{type:hc?"select":"object"}}}}},"inferControl"),Pe=s$1(vo=>{let{argTypes:Ai,parameters:{__isArgsStory:bo,controls:{include:Ra=null,exclude:hc=null,matchers:pc={}}={}}}=vo;if(!bo)return Ai;let mc=Ye(Ai,Ra,hc),uf=L(mc,(df,ff)=>(df==null?void 0:df.type)&&Es(df,ff.toString(),pc));return M(uf,mc)},"inferControls");Pe.secondPass=!0;function Fe({argTypes:vo,globalTypes:Ai,argTypesEnhancers:bo,decorators:Ra,loaders:hc,beforeEach:pc,globals:mc,initialGlobals:uf,...df}){return mc&&Object.keys(mc).length>0&&m$2(F`
|
|
242
|
-
The preview.js 'globals' field is deprecated and will be removed in Storybook 9.0.
|
|
243
|
-
Please use 'initialGlobals' instead. Learn more:
|
|
244
|
-
|
|
245
|
-
https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#previewjs-globals-renamed-to-initialglobals
|
|
246
|
-
`),{...vo&&{argTypes:te(vo)},...Ai&&{globalTypes:te(Ai)},decorators:P(Ra),loaders:P(hc),beforeEach:P(pc),argTypesEnhancers:[...bo||[],Br,Pe],initialGlobals:M(uf,mc),...df}}s$1(Fe,"normalizeProjectAnnotations");var co=s$1(vo=>async()=>{let Ai=[];for(let bo of vo){let Ra=await bo();Ra&&Ai.unshift(Ra)}return async()=>{for(let bo of Ai)await bo()}},"composeBeforeAllHooks");function zr(vo){return async(Ai,bo,Ra)=>{await vo.reduceRight((hc,pc)=>async()=>pc(Ai,hc,Ra),async()=>bo(Ra))()}}s$1(zr,"composeStepRunners");function Oe(vo,Ai){return vo.map(bo=>{var Ra;return((Ra=bo.default)==null?void 0:Ra[Ai])??bo[Ai]}).filter(Boolean)}s$1(Oe,"getField");function oe(vo,Ai,bo={}){return Oe(vo,Ai).reduce((Ra,hc)=>{let pc=P(hc);return bo.reverseFileOrder?[...pc,...Ra]:[...Ra,...pc]},[])}s$1(oe,"getArrayField");function Ie(vo,Ai){return Object.assign({},...Oe(vo,Ai))}s$1(Ie,"getObjectField");function ue(vo,Ai){return Oe(vo,Ai).pop()}s$1(ue,"getSingletonField");function fe(vo){var Ai;let bo=oe(vo,"argTypesEnhancers"),Ra=Oe(vo,"runStep"),hc=oe(vo,"beforeAll");return{parameters:M(...Oe(vo,"parameters")),decorators:oe(vo,"decorators",{reverseFileOrder:!(((Ai=v.FEATURES)==null?void 0:Ai.legacyDecoratorFileOrder)??!1)}),args:Ie(vo,"args"),argsEnhancers:oe(vo,"argsEnhancers"),argTypes:Ie(vo,"argTypes"),argTypesEnhancers:[...bo.filter(pc=>!pc.secondPass),...bo.filter(pc=>pc.secondPass)],globals:Ie(vo,"globals"),initialGlobals:Ie(vo,"initialGlobals"),globalTypes:Ie(vo,"globalTypes"),loaders:oe(vo,"loaders"),beforeAll:co(hc),beforeEach:oe(vo,"beforeEach"),render:ue(vo,"render"),renderToCanvas:ue(vo,"renderToCanvas"),renderToDOM:ue(vo,"renderToDOM"),applyDecorators:ue(vo,"applyDecorators"),runStep:zr(Ra),tags:oe(vo,"tags"),mount:ue(vo,"mount"),testingLibraryRender:ue(vo,"testingLibraryRender")}}s$1(fe,"composeConfigs");function Ps(vo){globalThis.defaultProjectAnnotations=vo}s$1(Ps,"setDefaultProjectAnnotations");var Fs="ComposedStory",Is$1="Unnamed Story";function Os(vo){return vo?fe([vo]):{}}s$1(Os,"extractAnnotation");function Ds(vo){let Ai=Array.isArray(vo)?vo:[vo];return globalThis.globalProjectAnnotations=fe(Ai.map(Os)),fe([globalThis.defaultProjectAnnotations??{},globalThis.globalProjectAnnotations??{}])}s$1(Ds,"setProjectAnnotations");var $=[];function po(vo,Ai,bo,Ra,hc){var pc;if(vo===void 0)throw new Error("Expected a story but received undefined.");Ai.title=Ai.title??Fs;let mc=We(Ai),uf=hc||vo.storyName||((pc=vo.story)==null?void 0:pc.name)||vo.name||Is$1,df=ve(uf,vo,mc),ff=Fe(fe([Ra&&Object.keys(Ra).length>0?Ra:globalThis.defaultProjectAnnotations??{},globalThis.globalProjectAnnotations??{},bo??{}])),hf=Ce(df,mc,ff),pf={...Ve(ff.globalTypes),...ff.initialGlobals,...hf.storyGlobals},mf=s$1(()=>{let Sf=$e({hooks:new ee,globals:pf,args:{...hf.initialArgs},viewMode:"story",loaded:{},abortSignal:new AbortController().signal,step:s$1((xf,wf)=>hf.runStep(xf,wf,Sf),"step"),canvasElement:null,canvas:{},globalTypes:ff.globalTypes,...hf,context:null,mount:null});return Sf.context=Sf,hf.renderToCanvas&&(Sf.renderToCanvas=async()=>{var xf;let wf=await((xf=hf.renderToCanvas)==null?void 0:xf.call(hf,{componentId:hf.componentId,title:hf.title,id:hf.id,name:hf.name,tags:hf.tags,showMain:s$1(()=>{},"showMain"),showError:s$1(s1=>{throw new Error(`${s1.title}
|
|
247
|
-
${s1.description}`)},"showError"),showException:s$1(s1=>{throw s1},"showException"),forceRemount:!0,storyContext:Sf,storyFn:s$1(()=>hf.unboundStoryFn(Sf),"storyFn"),unboundStoryFn:hf.unboundStoryFn},Sf.canvasElement));wf&&$.push(wf)}),Sf.mount=hf.mount(Sf),Sf},"initializeContext"),gf,yf=s$1(async Sf=>{var xf;let wf=mf();return wf.canvasElement??(wf.canvasElement=(xf=globalThis==null?void 0:globalThis.document)==null?void 0:xf.body),gf&&(wf.loaded=gf.loaded),Object.assign(wf,Sf),hf.playFunction(wf)},"play"),vf=s$1(Sf=>{let xf=mf();return Object.assign(xf,Sf),_s(hf,xf)},"run"),bf=hf.playFunction?yf:void 0;return Object.assign(s$1(function(Sf){let xf=mf();return gf&&(xf.loaded=gf.loaded),xf.args={...xf.initialArgs,...Sf},hf.unboundStoryFn(xf)},"storyFn"),{id:hf.id,storyName:uf,load:s$1(async()=>{for(let xf of[...$].reverse())await xf();$.length=0;let Sf=mf();Sf.loaded=await hf.applyLoaders(Sf),$.push(...(await hf.applyBeforeEach(Sf)).filter(Boolean)),gf=Sf},"load"),globals:pf,args:hf.initialArgs,parameters:hf.parameters,argTypes:hf.argTypes,play:bf,run:vf,tags:hf.tags})}s$1(po,"composeStory");var ks=s$1((vo,Ai,bo,Ra)=>po(vo,Ai,bo,{},Ra),"defaultComposeStory");function js(vo,Ai,bo=ks){let{default:Ra,__esModule:hc,__namedExportsOrder:pc,...mc}=vo;return Object.entries(mc).reduce((uf,[df,ff])=>M$1(df,Ra)?Object.assign(uf,{[df]:bo(ff,Ra,Ai,df)}):uf,{})}s$1(js,"composeStories");function Ms(vo){return vo.extend({mount:s$1(async({mount:Ai,page:bo},Ra)=>{await Ra(async(hc,...pc)=>{if(!("__pw_type"in hc)||"__pw_type"in hc&&hc.__pw_type!=="jsx")throw new Error(F`
|
|
248
|
-
Portable stories in Playwright CT only work when referencing JSX elements.
|
|
249
|
-
Please use JSX format for your components such as:
|
|
250
|
-
|
|
251
|
-
instead of:
|
|
252
|
-
await mount(MyComponent, { props: { foo: 'bar' } })
|
|
253
|
-
|
|
254
|
-
do:
|
|
255
|
-
await mount(<MyComponent foo="bar"/>)
|
|
256
|
-
|
|
257
|
-
More info: https://storybook.js.org/docs/api/portable-stories-playwright
|
|
258
|
-
`);await bo.evaluate(async uf=>{var df,ff,hf;let pf=await((df=globalThis.__pwUnwrapObject)==null?void 0:df.call(globalThis,uf));return(hf=(ff="__pw_type"in pf?pf.type:pf)==null?void 0:ff.load)==null?void 0:hf.call(ff)},hc);let mc=await Ai(hc,...pc);return await bo.evaluate(async uf=>{var df,ff;let hf=await((df=globalThis.__pwUnwrapObject)==null?void 0:df.call(globalThis,uf)),pf="__pw_type"in hf?hf.type:hf,mf=document.querySelector("#root");return(ff=pf==null?void 0:pf.play)==null?void 0:ff.call(pf,{canvasElement:mf})},hc),mc})},"mount")})}s$1(Ms,"createPlaywrightTest");async function _s(vo,Ai){var bo,Ra;for(let mc of[...$].reverse())await mc();if($.length=0,!Ai.canvasElement){let mc=document.createElement("div");(Ra=(bo=globalThis==null?void 0:globalThis.document)==null?void 0:bo.body)==null||Ra.appendChild(mc),Ai.canvasElement=mc,$.push(()=>{var uf,df,ff,hf;(df=(uf=globalThis==null?void 0:globalThis.document)==null?void 0:uf.body)!=null&&df.contains(mc)&&((hf=(ff=globalThis==null?void 0:globalThis.document)==null?void 0:ff.body)==null||hf.removeChild(mc))})}if(Ai.loaded=await vo.applyLoaders(Ai),Ai.abortSignal.aborted)return;$.push(...(await vo.applyBeforeEach(Ai)).filter(Boolean));let hc=vo.playFunction,pc=vo.usesMount;pc||await Ai.mount(),!Ai.abortSignal.aborted&&hc&&(pc||(Ai.mount=async()=>{throw new J({playFunction:hc.toString()})}),await hc(Ai))}s$1(_s,"runStory");function fo(vo,Ai){return Rr(wr(vo,Ai),bo=>bo===void 0)}s$1(fo,"picky");var yo=1e3,qs=1e4,Gr=class{constructor(vo,Ai,bo){this.importFn=Ai,this.getStoriesJsonData=s$1(()=>{let pc=this.getSetStoriesPayload(),mc=["fileName","docsOnly","framework","__id","__isArgsStory"];return{v:3,stories:L(pc.stories,uf=>{let{importPath:df}=this.storyIndex.entries[uf.id];return{...fo(uf,["id","name","title"]),importPath:df,kind:uf.title,story:uf.name,parameters:{...fo(uf.parameters,mc),fileName:df}}})}},"getStoriesJsonData"),this.storyIndex=new He(vo),this.projectAnnotations=Fe(bo);let{initialGlobals:Ra,globalTypes:hc}=this.projectAnnotations;this.args=new Ge,this.userGlobals=new Ue({globals:Ra,globalTypes:hc}),this.hooks={},this.cleanupCallbacks={},this.processCSFFileWithCache=(0,Ke.default)(yo)(to),this.prepareMetaWithCache=(0,Ke.default)(yo)(Nr),this.prepareStoryWithCache=(0,Ke.default)(qs)(Ce)}setProjectAnnotations(vo){this.projectAnnotations=Fe(vo);let{initialGlobals:Ai,globalTypes:bo}=vo;this.userGlobals.set({globals:Ai,globalTypes:bo})}async onStoriesChanged({importFn:vo,storyIndex:Ai}){vo&&(this.importFn=vo),Ai&&(this.storyIndex.entries=Ai.entries),this.cachedCSFFiles&&await this.cacheAllCSFFiles()}async storyIdToEntry(vo){return this.storyIndex.storyIdToEntry(vo)}async loadCSFFileByStoryId(vo){let{importPath:Ai,title:bo}=this.storyIndex.storyIdToEntry(vo),Ra=await this.importFn(Ai);return this.processCSFFileWithCache(Ra,Ai,bo)}async loadAllCSFFiles(){let vo={};return Object.entries(this.storyIndex.entries).forEach(([Ai,{importPath:bo}])=>{vo[bo]=Ai}),(await Promise.all(Object.entries(vo).map(async([Ai,bo])=>({importPath:Ai,csfFile:await this.loadCSFFileByStoryId(bo)})))).reduce((Ai,{importPath:bo,csfFile:Ra})=>(Ai[bo]=Ra,Ai),{})}async cacheAllCSFFiles(){this.cachedCSFFiles=await this.loadAllCSFFiles()}preparedMetaFromCSFFile({csfFile:vo}){let Ai=vo.meta;return this.prepareMetaWithCache(Ai,this.projectAnnotations,vo.moduleExports.default)}async loadStory({storyId:vo}){let Ai=await this.loadCSFFileByStoryId(vo);return this.storyFromCSFFile({storyId:vo,csfFile:Ai})}storyFromCSFFile({storyId:vo,csfFile:Ai}){let bo=Ai.stories[vo];if(!bo)throw new X$1({storyId:vo});let Ra=Ai.meta,hc=this.prepareStoryWithCache(bo,Ra,this.projectAnnotations);return this.args.setInitial(hc),this.hooks[hc.id]=this.hooks[hc.id]||new ee,hc}componentStoriesFromCSFFile({csfFile:vo}){return Object.keys(this.storyIndex.entries).filter(Ai=>!!vo.stories[Ai]).map(Ai=>this.storyFromCSFFile({storyId:Ai,csfFile:vo}))}async loadEntry(vo){let Ai=await this.storyIdToEntry(vo),bo=Ai.type==="docs"?Ai.storiesImports:[],[Ra,...hc]=await Promise.all([this.importFn(Ai.importPath),...bo.map(pc=>{let mc=this.storyIndex.importPathToEntry(pc);return this.loadCSFFileByStoryId(mc.id)})]);return{entryExports:Ra,csfFiles:hc}}getStoryContext(vo,{forceInitialArgs:Ai=!1}={}){let bo=this.userGlobals.get(),{initialGlobals:Ra}=this.userGlobals;return $e({...vo,args:Ai?vo.initialArgs:this.args.get(vo.id),initialGlobals:Ra,globalTypes:this.projectAnnotations.globalTypes,userGlobals:bo,globals:{...bo,...vo.storyGlobals},hooks:this.hooks[vo.id]})}addCleanupCallbacks(vo,Ai){this.cleanupCallbacks[vo.id]=Ai}async cleanupStory(vo){this.hooks[vo.id].clean();let Ai=this.cleanupCallbacks[vo.id];if(Ai)for(let bo of[...Ai].reverse())await bo();delete this.cleanupCallbacks[vo.id]}extract(vo={includeDocsOnly:!1}){let{cachedCSFFiles:Ai}=this;if(!Ai)throw new L$1;return Object.entries(this.storyIndex.entries).reduce((bo,[Ra,{type:hc,importPath:pc}])=>{if(hc==="docs")return bo;let mc=Ai[pc],uf=this.storyFromCSFFile({storyId:Ra,csfFile:mc});return!vo.includeDocsOnly&&uf.parameters.docsOnly||(bo[Ra]=Object.entries(uf).reduce((df,[ff,hf])=>ff==="moduleExport"||typeof hf=="function"?df:Array.isArray(hf)?Object.assign(df,{[ff]:hf.slice().sort()}):Object.assign(df,{[ff]:hf}),{args:uf.initialArgs})),bo},{})}getSetStoriesPayload(){let vo=this.extract({includeDocsOnly:!0}),Ai=Object.values(vo).reduce((bo,{title:Ra})=>(bo[Ra]={},bo),{});return{v:2,globals:this.userGlobals.get(),globalParameters:{},kindParameters:Ai,stories:vo}}raw(){return m$2("StoryStore.raw() is deprecated and will be removed in 9.0, please use extract() instead"),Object.values(this.extract()).map(({id:vo})=>this.fromId(vo)).filter(Boolean)}fromId(vo){if(m$2("StoryStore.fromId() is deprecated and will be removed in 9.0, please use loadStory() instead"),!this.cachedCSFFiles)throw new Error("Cannot call fromId/raw() unless you call cacheAllCSFFiles() first.");let Ai;try{({importPath:Ai}=this.storyIndex.storyIdToEntry(vo))}catch{return null}let bo=this.cachedCSFFiles[Ai],Ra=this.storyFromCSFFile({storyId:vo,csfFile:bo});return{...Ra,storyFn:s$1(hc=>{let pc={...this.getStoryContext(Ra),abortSignal:new AbortController().signal,canvasElement:null,loaded:{},step:s$1((mc,uf)=>Ra.runStep(mc,uf,pc),"step"),context:null,mount:null,canvas:{},viewMode:"story"};return Ra.unboundStoryFn({...pc,...hc})},"storyFn")}}};s$1(Gr,"StoryStore");var ye=Gr;function Vr(vo){return vo.startsWith("\\\\?\\")?vo:vo.replace(/\\/g,"/")}s$1(Vr,"slash");function mo(vo){return vo.flatMap(Ai=>Ai.split("/")).filter(Boolean).join("/")}s$1(mo,"pathJoin");var Y=new Error("prepareAborted"),{AbortController:To}=globalThis;function xo(vo){try{let{name:Ai="Error",message:bo=String(vo),stack:Ra}=vo;return{name:Ai,message:bo,stack:Ra}}catch{return{name:"Error",message:String(vo)}}}s$1(xo,"serializeError");var Ur=class{constructor(vo,Ai,bo,Ra,hc,pc,mc={autoplay:!0,forceInitialArgs:!1},uf){this.channel=vo,this.store=Ai,this.renderToScreen=bo,this.callbacks=Ra,this.id=hc,this.viewMode=pc,this.renderOptions=mc,this.type="story",this.notYetRendered=!0,this.rerenderEnqueued=!1,this.disableKeyListeners=!1,this.teardownRender=s$1(()=>{},"teardownRender"),this.torndown=!1,this.abortController=new To,uf&&(this.story=uf,this.phase="preparing")}async runPhase(vo,Ai,bo){this.phase=Ai,this.channel.emit(B$2,{newPhase:this.phase,storyId:this.id}),bo&&(await bo(),this.checkIfAborted(vo))}checkIfAborted(vo){return vo.aborted?(this.phase="aborted",this.channel.emit(B$2,{newPhase:this.phase,storyId:this.id}),!0):!1}async prepare(){if(await this.runPhase(this.abortController.signal,"preparing",async()=>{this.story=await this.store.loadStory({storyId:this.id})}),this.abortController.signal.aborted)throw await this.store.cleanupStory(this.story),Y}isEqual(vo){return!!(this.id===vo.id&&this.story&&this.story===vo.story)}isPreparing(){return["preparing"].includes(this.phase)}isPending(){return["loading","beforeEach","rendering","playing"].includes(this.phase)}async renderToElement(vo){return this.canvasElement=vo,this.render({initial:!0,forceRemount:!0})}storyContext(){if(!this.story)throw new Error("Cannot call storyContext before preparing");let{forceInitialArgs:vo}=this.renderOptions;return this.store.getStoryContext(this.story,{forceInitialArgs:vo})}async render({initial:vo=!1,forceRemount:Ai=!1}={}){var bo,Ra,hc,pc;let{canvasElement:mc}=this;if(!this.story)throw new Error("cannot render when not prepared");let uf=this.story;if(!mc)throw new Error("cannot render when canvasElement is unset");let{id:df,componentId:ff,title:hf,name:pf,tags:mf,applyLoaders:gf,applyBeforeEach:yf,unboundStoryFn:vf,playFunction:bf,runStep:Sf}=uf;Ai&&!vo&&(this.cancelRender(),this.abortController=new To);let xf=this.abortController.signal,wf=!1,s1=uf.usesMount;try{let If={...this.storyContext(),viewMode:this.viewMode,abortSignal:xf,canvasElement:mc,loaded:{},step:s$1((R1,$1)=>Sf(R1,$1,If),"step"),context:null,canvas:{},renderToCanvas:s$1(async()=>{let R1=await this.renderToScreen(l1,mc);this.teardownRender=R1||(()=>{}),wf=!0},"renderToCanvas"),mount:s$1(async(...R1)=>{var $1,D1;(D1=($1=this.callbacks).showStoryDuringRender)==null||D1.call($1);let f1=null;return await this.runPhase(xf,"rendering",async()=>{f1=await uf.mount(If)(...R1)}),s1&&await this.runPhase(xf,"playing"),f1},"mount")};If.context=If;let l1={componentId:ff,title:hf,kind:hf,id:df,name:pf,story:pf,tags:mf,...this.callbacks,showError:s$1(R1=>(this.phase="errored",this.callbacks.showError(R1)),"showError"),showException:s$1(R1=>(this.phase="errored",this.callbacks.showException(R1)),"showException"),forceRemount:Ai||this.notYetRendered,storyContext:If,storyFn:s$1(()=>vf(If),"storyFn"),unboundStoryFn:vf};if(await this.runPhase(xf,"loading",async()=>{If.loaded=await gf(If)}),xf.aborted)return;let c1=await yf(If);if(this.store.addCleanupCallbacks(uf,c1),this.checkIfAborted(xf)||(!wf&&!s1&&await If.mount(),this.notYetRendered=!1,xf.aborted))return;let m1=((Ra=(bo=this.story.parameters)==null?void 0:bo.test)==null?void 0:Ra.dangerouslyIgnoreUnhandledErrors)===!0,k1=new Set,N1=s$1(R1=>k1.add("error"in R1?R1.error:R1.reason),"onError");if(this.renderOptions.autoplay&&Ai&&bf&&this.phase!=="errored"){window.addEventListener("error",N1),window.addEventListener("unhandledrejection",N1),this.disableKeyListeners=!0;try{if(s1?await bf(If):(If.mount=async()=>{throw new J({playFunction:bf.toString()})},await this.runPhase(xf,"playing",async()=>bf(If))),!wf)throw new z$1;this.checkIfAborted(xf),!m1&&k1.size>0?await this.runPhase(xf,"errored"):await this.runPhase(xf,"played")}catch(R1){if((pc=(hc=this.callbacks).showStoryDuringRender)==null||pc.call(hc),await this.runPhase(xf,"errored",async()=>{this.channel.emit(a,xo(R1))}),this.story.parameters.throwPlayFunctionExceptions!==!1)throw R1;console.error(R1)}if(!m1&&k1.size>0&&this.channel.emit(Y$2,Array.from(k1).map(xo)),this.disableKeyListeners=!1,window.removeEventListener("unhandledrejection",N1),window.removeEventListener("error",N1),xf.aborted)return}await this.runPhase(xf,"completed",async()=>this.channel.emit(X$2,df))}catch(If){this.phase="errored",this.callbacks.showException(If)}this.rerenderEnqueued&&(this.rerenderEnqueued=!1,this.render())}async rerender(){if(this.isPending()&&this.phase!=="playing")this.rerenderEnqueued=!0;else return this.render()}async remount(){return await this.teardown(),this.render({forceRemount:!0})}cancelRender(){var vo;(vo=this.abortController)==null||vo.abort()}async teardown(){this.torndown=!0,this.cancelRender(),this.story&&await this.store.cleanupStory(this.story);for(let vo=0;vo<3;vo+=1){if(!this.isPending()){await this.teardownRender();return}await new Promise(Ai=>setTimeout(Ai,0))}window.location.reload(),await new Promise(()=>{})}};s$1(Ur,"StoryRender");var ne=Ur,{fetch:di}=v,pi="./index.json",Hr=class{constructor(vo,Ai,bo=q.getChannel(),Ra=!0){this.importFn=vo,this.getProjectAnnotations=Ai,this.channel=bo,this.storyRenders=[],this.storeInitializationPromise=new Promise((hc,pc)=>{this.resolveStoreInitializationPromise=hc,this.rejectStoreInitializationPromise=pc}),Ra&&this.initialize()}get storyStore(){return new Proxy({},{get:s$1((vo,Ai)=>{if(this.storyStoreValue)return m$2("Accessing the Story Store is deprecated and will be removed in 9.0"),this.storyStoreValue[Ai];throw new U$1},"get")})}async initialize(){this.setupListeners();try{let vo=await this.getProjectAnnotationsOrRenderError();await this.runBeforeAllHook(vo),await this.initializeWithProjectAnnotations(vo)}catch(vo){this.rejectStoreInitializationPromise(vo)}}ready(){return this.storeInitializationPromise}setupListeners(){this.channel.on(m$1$1,this.onStoryIndexChanged.bind(this)),this.channel.on(j,this.onUpdateGlobals.bind(this)),this.channel.on(n$1,this.onUpdateArgs.bind(this)),this.channel.on(RE,this.onRequestArgTypesInfo.bind(this)),this.channel.on(H$2,this.onResetArgs.bind(this)),this.channel.on(L$2,this.onForceReRender.bind(this)),this.channel.on(P$3,this.onForceRemount.bind(this))}async getProjectAnnotationsOrRenderError(){try{let vo=await this.getProjectAnnotations();if(this.renderToCanvas=vo.renderToCanvas,!this.renderToCanvas)throw new G$1;return vo}catch(vo){throw this.renderPreviewEntryError("Error reading preview.js:",vo),vo}}async initializeWithProjectAnnotations(vo){this.projectAnnotationsBeforeInitialization=vo;try{let Ai=await this.getStoryIndexFromServer();return this.initializeWithStoryIndex(Ai)}catch(Ai){throw this.renderPreviewEntryError("Error loading story index:",Ai),Ai}}async runBeforeAllHook(vo){var Ai,bo;try{await((Ai=this.beforeAllCleanup)==null?void 0:Ai.call(this)),this.beforeAllCleanup=await((bo=vo.beforeAll)==null?void 0:bo.call(vo))}catch(Ra){throw this.renderPreviewEntryError("Error in beforeAll hook:",Ra),Ra}}async getStoryIndexFromServer(){let vo=await di(pi);if(vo.status===200)return vo.json();throw new M$2({text:await vo.text()})}initializeWithStoryIndex(vo){if(!this.projectAnnotationsBeforeInitialization)throw new Error("Cannot call initializeWithStoryIndex until project annotations resolve");this.storyStoreValue=new ye(vo,this.importFn,this.projectAnnotationsBeforeInitialization),delete this.projectAnnotationsBeforeInitialization,this.setInitialGlobals(),this.resolveStoreInitializationPromise()}async setInitialGlobals(){this.emitGlobals()}emitGlobals(){if(!this.storyStoreValue)throw new Y$1({methodName:"emitGlobals"});let vo={globals:this.storyStoreValue.userGlobals.get()||{},globalTypes:this.storyStoreValue.projectAnnotations.globalTypes||{}};this.channel.emit(u$1,vo)}async onGetProjectAnnotationsChanged({getProjectAnnotations:vo}){delete this.previewEntryError,this.getProjectAnnotations=vo;let Ai=await this.getProjectAnnotationsOrRenderError();if(await this.runBeforeAllHook(Ai),!this.storyStoreValue){await this.initializeWithProjectAnnotations(Ai);return}this.storyStoreValue.setProjectAnnotations(Ai),this.emitGlobals()}async onStoryIndexChanged(){if(delete this.previewEntryError,!(!this.storyStoreValue&&!this.projectAnnotationsBeforeInitialization))try{let vo=await this.getStoryIndexFromServer();if(this.projectAnnotationsBeforeInitialization){this.initializeWithStoryIndex(vo);return}await this.onStoriesChanged({storyIndex:vo})}catch(vo){throw this.renderPreviewEntryError("Error loading story index:",vo),vo}}async onStoriesChanged({importFn:vo,storyIndex:Ai}){if(!this.storyStoreValue)throw new Y$1({methodName:"onStoriesChanged"});await this.storyStoreValue.onStoriesChanged({importFn:vo,storyIndex:Ai})}async onUpdateGlobals({globals:vo,currentStory:Ai}){if(this.storyStoreValue||await this.storeInitializationPromise,!this.storyStoreValue)throw new Y$1({methodName:"onUpdateGlobals"});if(this.storyStoreValue.userGlobals.update(vo),Ai){let{initialGlobals:bo,storyGlobals:Ra,userGlobals:hc,globals:pc}=this.storyStoreValue.getStoryContext(Ai);this.channel.emit(U$3,{initialGlobals:bo,userGlobals:hc,storyGlobals:Ra,globals:pc})}else{let{initialGlobals:bo,globals:Ra}=this.storyStoreValue.userGlobals;this.channel.emit(U$3,{initialGlobals:bo,userGlobals:Ra,storyGlobals:{},globals:Ra})}await Promise.all(this.storyRenders.map(bo=>bo.rerender()))}async onUpdateArgs({storyId:vo,updatedArgs:Ai}){if(!this.storyStoreValue)throw new Y$1({methodName:"onUpdateArgs"});this.storyStoreValue.args.update(vo,Ai),await Promise.all(this.storyRenders.filter(bo=>bo.id===vo&&!bo.renderOptions.forceInitialArgs).map(bo=>bo.story&&bo.story.usesMount?bo.remount():bo.rerender())),this.channel.emit(Q,{storyId:vo,args:this.storyStoreValue.args.get(vo)})}async onRequestArgTypesInfo({id:vo,payload:Ai}){var bo;try{await this.storeInitializationPromise;let Ra=await((bo=this.storyStoreValue)==null?void 0:bo.loadStory(Ai));this.channel.emit(SE,{id:vo,success:!0,payload:{argTypes:(Ra==null?void 0:Ra.argTypes)||{}},error:null})}catch(Ra){this.channel.emit(SE,{id:vo,success:!1,error:Ra==null?void 0:Ra.message})}}async onResetArgs({storyId:vo,argNames:Ai}){var bo;if(!this.storyStoreValue)throw new Y$1({methodName:"onResetArgs"});let Ra=((bo=this.storyRenders.find(pc=>pc.id===vo))==null?void 0:bo.story)||await this.storyStoreValue.loadStory({storyId:vo}),hc=(Ai||[...new Set([...Object.keys(Ra.initialArgs),...Object.keys(this.storyStoreValue.args.get(vo))])]).reduce((pc,mc)=>(pc[mc]=Ra.initialArgs[mc],pc),{});await this.onUpdateArgs({storyId:vo,updatedArgs:hc})}async onForceReRender(){await Promise.all(this.storyRenders.map(vo=>vo.rerender()))}async onForceRemount({storyId:vo}){await Promise.all(this.storyRenders.filter(Ai=>Ai.id===vo).map(Ai=>Ai.remount()))}renderStoryToElement(vo,Ai,bo,Ra){if(!this.renderToCanvas||!this.storyStoreValue)throw new Y$1({methodName:"renderStoryToElement"});let hc=new ne(this.channel,this.storyStoreValue,this.renderToCanvas,bo,vo.id,"docs",Ra,vo);return hc.renderToElement(Ai),this.storyRenders.push(hc),async()=>{await this.teardownRender(hc)}}async teardownRender(vo,{viewModeChanged:Ai}={}){var bo;this.storyRenders=this.storyRenders.filter(Ra=>Ra!==vo),await((bo=vo==null?void 0:vo.teardown)==null?void 0:bo.call(vo,{viewModeChanged:Ai}))}async loadStory({storyId:vo}){if(!this.storyStoreValue)throw new Y$1({methodName:"loadStory"});return this.storyStoreValue.loadStory({storyId:vo})}getStoryContext(vo,{forceInitialArgs:Ai=!1}={}){if(!this.storyStoreValue)throw new Y$1({methodName:"getStoryContext"});return this.storyStoreValue.getStoryContext(vo,{forceInitialArgs:Ai})}async extract(vo){if(!this.storyStoreValue)throw new Y$1({methodName:"extract"});if(this.previewEntryError)throw this.previewEntryError;return await this.storyStoreValue.cacheAllCSFFiles(),this.storyStoreValue.extract(vo)}renderPreviewEntryError(vo,Ai){this.previewEntryError=Ai,s$3.error(vo),s$3.error(Ai),this.channel.emit(N$2,Ai)}};s$1(Hr,"Preview");var me=Hr,Wr="Invariant failed";function Xe(vo,Ai){if(!vo){var bo=typeof Ai=="function"?Ai():Ai,Ra=bo?"".concat(Wr,": ").concat(bo):Wr;throw new Error(Ra)}}s$1(Xe,"invariant");var $r=class{constructor(vo,Ai,bo,Ra){this.channel=vo,this.store=Ai,this.renderStoryToElement=bo,this.storyIdByName=s$1(hc=>{let pc=this.nameToStoryId.get(hc);if(pc)return pc;throw new Error(`No story found with that name: ${hc}`)},"storyIdByName"),this.componentStories=s$1(()=>this.componentStoriesValue,"componentStories"),this.componentStoriesFromCSFFile=s$1(hc=>this.store.componentStoriesFromCSFFile({csfFile:hc}),"componentStoriesFromCSFFile"),this.storyById=s$1(hc=>{if(!hc){if(!this.primaryStory)throw new Error("No primary story defined for docs entry. Did you forget to use `<Meta>`?");return this.primaryStory}let pc=this.storyIdToCSFFile.get(hc);if(!pc)throw new Error(`Called \`storyById\` for story that was never loaded: ${hc}`);return this.store.storyFromCSFFile({storyId:hc,csfFile:pc})},"storyById"),this.getStoryContext=s$1(hc=>({...this.store.getStoryContext(hc),loaded:{},viewMode:"docs"}),"getStoryContext"),this.loadStory=s$1(hc=>this.store.loadStory({storyId:hc}),"loadStory"),this.componentStoriesValue=[],this.storyIdToCSFFile=new Map,this.exportToStory=new Map,this.exportsToCSFFile=new Map,this.nameToStoryId=new Map,this.attachedCSFFiles=new Set,Ra.forEach((hc,pc)=>{this.referenceCSFFile(hc)})}referenceCSFFile(vo){this.exportsToCSFFile.set(vo.moduleExports,vo),this.exportsToCSFFile.set(vo.moduleExports.default,vo),this.store.componentStoriesFromCSFFile({csfFile:vo}).forEach(Ai=>{let bo=vo.stories[Ai.id];this.storyIdToCSFFile.set(bo.id,vo),this.exportToStory.set(bo.moduleExport,Ai)})}attachCSFFile(vo){if(!this.exportsToCSFFile.has(vo.moduleExports))throw new Error("Cannot attach a CSF file that has not been referenced");this.attachedCSFFiles.has(vo)||(this.attachedCSFFiles.add(vo),this.store.componentStoriesFromCSFFile({csfFile:vo}).forEach(Ai=>{this.nameToStoryId.set(Ai.name,Ai.id),this.componentStoriesValue.push(Ai),this.primaryStory||(this.primaryStory=Ai)}))}referenceMeta(vo,Ai){let bo=this.resolveModuleExport(vo);if(bo.type!=="meta")throw new Error("<Meta of={} /> must reference a CSF file module export or meta export. Did you mistakenly reference your component instead of your CSF file?");Ai&&this.attachCSFFile(bo.csfFile)}get projectAnnotations(){let{projectAnnotations:vo}=this.store;if(!vo)throw new Error("Can't get projectAnnotations from DocsContext before they are initialized");return vo}resolveAttachedModuleExportType(vo){if(vo==="story"){if(!this.primaryStory)throw new Error("No primary story attached to this docs file, did you forget to use <Meta of={} />?");return{type:"story",story:this.primaryStory}}if(this.attachedCSFFiles.size===0)throw new Error("No CSF file attached to this docs file, did you forget to use <Meta of={} />?");let Ai=Array.from(this.attachedCSFFiles)[0];if(vo==="meta")return{type:"meta",csfFile:Ai};let{component:bo}=Ai.meta;if(!bo)throw new Error("Attached CSF file does not defined a component, did you forget to export one?");return{type:"component",component:bo}}resolveModuleExport(vo){let Ai=this.exportsToCSFFile.get(vo);if(Ai)return{type:"meta",csfFile:Ai};let bo=this.exportToStory.get(vo);return bo?{type:"story",story:bo}:{type:"component",component:vo}}resolveOf(vo,Ai=[]){let bo;if(["component","meta","story"].includes(vo)){let Ra=vo;bo=this.resolveAttachedModuleExportType(Ra)}else bo=this.resolveModuleExport(vo);if(Ai.length&&!Ai.includes(bo.type)){let Ra=bo.type==="component"?"component or unknown":bo.type;throw new Error(F`Invalid value passed to the 'of' prop. The value was resolved to a '${Ra}' type but the only types for this block are: ${Ai.join(", ")}.
|
|
259
|
-
- Did you pass a component to the 'of' prop when the block only supports a story or a meta?
|
|
260
|
-
- ... or vice versa?
|
|
261
|
-
- Did you pass a story, CSF file or meta to the 'of' prop that is not indexed, ie. is not targeted by the 'stories' globs in the main configuration?`)}switch(bo.type){case"component":return{...bo,projectAnnotations:this.projectAnnotations};case"meta":return{...bo,preparedMeta:this.store.preparedMetaFromCSFFile({csfFile:bo.csfFile})};case"story":default:return bo}}};s$1($r,"DocsContext");var K=$r,Yr=class{constructor(vo,Ai,bo,Ra){this.channel=vo,this.store=Ai,this.entry=bo,this.callbacks=Ra,this.type="docs",this.subtype="csf",this.torndown=!1,this.disableKeyListeners=!1,this.preparing=!1,this.id=bo.id}isPreparing(){return this.preparing}async prepare(){this.preparing=!0;let{entryExports:vo,csfFiles:Ai=[]}=await this.store.loadEntry(this.id);if(this.torndown)throw Y;let{importPath:bo,title:Ra}=this.entry,hc=this.store.processCSFFileWithCache(vo,bo,Ra),pc=Object.keys(hc.stories)[0];this.story=this.store.storyFromCSFFile({storyId:pc,csfFile:hc}),this.csfFiles=[hc,...Ai],this.preparing=!1}isEqual(vo){return!!(this.id===vo.id&&this.story&&this.story===vo.story)}docsContext(vo){if(!this.csfFiles)throw new Error("Cannot render docs before preparing");let Ai=new K(this.channel,this.store,vo,this.csfFiles);return this.csfFiles.forEach(bo=>Ai.attachCSFFile(bo)),Ai}async renderToElement(vo,Ai){if(!this.story||!this.csfFiles)throw new Error("Cannot render docs before preparing");let bo=this.docsContext(Ai),{docs:Ra}=this.story.parameters||{};if(!Ra)throw new Error("Cannot render a story in viewMode=docs if `@storybook/addon-docs` is not installed");let hc=await Ra.renderer(),{render:pc}=hc,mc=s$1(async()=>{try{await pc(bo,Ra,vo),this.channel.emit(I$2,this.id)}catch(uf){this.callbacks.showException(uf)}},"renderDocs");return this.rerender=async()=>mc(),this.teardownRender=async({viewModeChanged:uf})=>{!uf||!vo||hc.unmount(vo)},mc()}async teardown({viewModeChanged:vo}={}){var Ai;(Ai=this.teardownRender)==null||Ai.call(this,{viewModeChanged:vo}),this.torndown=!0}};s$1(Yr,"CsfDocsRender");var De=Yr,Kr=class{constructor(vo,Ai,bo,Ra){this.channel=vo,this.store=Ai,this.entry=bo,this.callbacks=Ra,this.type="docs",this.subtype="mdx",this.torndown=!1,this.disableKeyListeners=!1,this.preparing=!1,this.id=bo.id}isPreparing(){return this.preparing}async prepare(){this.preparing=!0;let{entryExports:vo,csfFiles:Ai=[]}=await this.store.loadEntry(this.id);if(this.torndown)throw Y;this.csfFiles=Ai,this.exports=vo,this.preparing=!1}isEqual(vo){return!!(this.id===vo.id&&this.exports&&this.exports===vo.exports)}docsContext(vo){if(!this.csfFiles)throw new Error("Cannot render docs before preparing");return new K(this.channel,this.store,vo,this.csfFiles)}async renderToElement(vo,Ai){if(!this.exports||!this.csfFiles||!this.store.projectAnnotations)throw new Error("Cannot render docs before preparing");let bo=this.docsContext(Ai),{docs:Ra}=this.store.projectAnnotations.parameters||{};if(!Ra)throw new Error("Cannot render a story in viewMode=docs if `@storybook/addon-docs` is not installed");let hc={...Ra,page:this.exports.default},pc=await Ra.renderer(),{render:mc}=pc,uf=s$1(async()=>{try{await mc(bo,hc,vo),this.channel.emit(I$2,this.id)}catch(df){this.callbacks.showException(df)}},"renderDocs");return this.rerender=async()=>uf(),this.teardownRender=async({viewModeChanged:df}={})=>{!df||!vo||(pc.unmount(vo),this.torndown=!0)},uf()}async teardown({viewModeChanged:vo}={}){var Ai;(Ai=this.teardownRender)==null||Ai.call(this,{viewModeChanged:vo}),this.torndown=!0}};s$1(Kr,"MdxDocsRender");var ke=Kr,Fi=globalThis;function Ii(vo){let Ai=vo.composedPath&&vo.composedPath()[0]||vo.target;return/input|textarea/i.test(Ai.tagName)||Ai.getAttribute("contenteditable")!==null}s$1(Ii,"focusInInput");var Fo="attached-mdx",Oi="unattached-mdx";function Di({tags:vo}){return(vo==null?void 0:vo.includes(Oi))||(vo==null?void 0:vo.includes(Fo))}s$1(Di,"isMdxEntry");function Jr(vo){return vo.type==="story"}s$1(Jr,"isStoryRender");function ki(vo){return vo.type==="docs"}s$1(ki,"isDocsRender");function ji(vo){return ki(vo)&&vo.subtype==="csf"}s$1(ji,"isCsfDocsRender");var Qr=class extends me{constructor(vo,Ai,bo,Ra){super(vo,Ai,void 0,!1),this.importFn=vo,this.getProjectAnnotations=Ai,this.selectionStore=bo,this.view=Ra,this.initialize()}setupListeners(){super.setupListeners(),Fi.onkeydown=this.onKeydown.bind(this),this.channel.on(p$2,this.onSetCurrentStory.bind(this)),this.channel.on(k$4,this.onUpdateQueryParams.bind(this)),this.channel.on(t$4,this.onPreloadStories.bind(this))}async setInitialGlobals(){if(!this.storyStoreValue)throw new Y$1({methodName:"setInitialGlobals"});let{globals:vo}=this.selectionStore.selectionSpecifier||{};vo&&this.storyStoreValue.userGlobals.updateFromPersisted(vo),this.emitGlobals()}async initializeWithStoryIndex(vo){return await super.initializeWithStoryIndex(vo),this.selectSpecifiedStory()}async selectSpecifiedStory(){if(!this.storyStoreValue)throw new Y$1({methodName:"selectSpecifiedStory"});if(this.selectionStore.selection){await this.renderSelection();return}if(!this.selectionStore.selectionSpecifier){this.renderMissingStory();return}let{storySpecifier:vo,args:Ai}=this.selectionStore.selectionSpecifier,bo=this.storyStoreValue.storyIndex.entryFromSpecifier(vo);if(!bo){vo==="*"?this.renderStoryLoadingException(vo,new F$2):this.renderStoryLoadingException(vo,new K$1({storySpecifier:vo.toString()}));return}let{id:Ra,type:hc}=bo;this.selectionStore.setSelection({storyId:Ra,viewMode:hc}),this.channel.emit(q$3,this.selectionStore.selection),this.channel.emit(r$2,this.selectionStore.selection),await this.renderSelection({persistedArgs:Ai})}async onGetProjectAnnotationsChanged({getProjectAnnotations:vo}){await super.onGetProjectAnnotationsChanged({getProjectAnnotations:vo}),this.selectionStore.selection&&this.renderSelection()}async onStoriesChanged({importFn:vo,storyIndex:Ai}){await super.onStoriesChanged({importFn:vo,storyIndex:Ai}),this.selectionStore.selection?await this.renderSelection():await this.selectSpecifiedStory()}onKeydown(vo){if(!this.storyRenders.find(Ai=>Ai.disableKeyListeners)&&!Ii(vo)){let{altKey:Ai,ctrlKey:bo,metaKey:Ra,shiftKey:hc,key:pc,code:mc,keyCode:uf}=vo;this.channel.emit(W$2,{event:{altKey:Ai,ctrlKey:bo,metaKey:Ra,shiftKey:hc,key:pc,code:mc,keyCode:uf}})}}async onSetCurrentStory(vo){this.selectionStore.setSelection({viewMode:"story",...vo}),await this.storeInitializationPromise,this.channel.emit(r$2,this.selectionStore.selection),this.renderSelection()}onUpdateQueryParams(vo){this.selectionStore.setQueryParams(vo)}async onUpdateGlobals({globals:vo}){var Ai,bo;let Ra=this.currentRender instanceof ne&&this.currentRender.story||void 0;super.onUpdateGlobals({globals:vo,currentStory:Ra}),(this.currentRender instanceof ke||this.currentRender instanceof De)&&await((bo=(Ai=this.currentRender).rerender)==null?void 0:bo.call(Ai))}async onUpdateArgs({storyId:vo,updatedArgs:Ai}){super.onUpdateArgs({storyId:vo,updatedArgs:Ai})}async onPreloadStories({ids:vo}){await this.storeInitializationPromise,this.storyStoreValue&&await Promise.allSettled(vo.map(Ai=>{var bo;return(bo=this.storyStoreValue)==null?void 0:bo.loadEntry(Ai)}))}async renderSelection({persistedArgs:vo}={}){var Ai,bo,Ra,hc;let{renderToCanvas:pc}=this;if(!this.storyStoreValue||!pc)throw new Y$1({methodName:"renderSelection"});let{selection:mc}=this.selectionStore;if(!mc)throw new Error("Cannot call renderSelection as no selection was made");let{storyId:uf}=mc,df;try{df=await this.storyStoreValue.storyIdToEntry(uf)}catch(vf){this.currentRender&&await this.teardownRender(this.currentRender),this.renderStoryLoadingException(uf,vf);return}let ff=((Ai=this.currentSelection)==null?void 0:Ai.storyId)!==uf,hf=((bo=this.currentRender)==null?void 0:bo.type)!==df.type;df.type==="story"?this.view.showPreparingStory({immediate:hf}):this.view.showPreparingDocs({immediate:hf}),(Ra=this.currentRender)!=null&&Ra.isPreparing()&&await this.teardownRender(this.currentRender);let pf;df.type==="story"?pf=new ne(this.channel,this.storyStoreValue,pc,this.mainStoryCallbacks(uf),uf,"story"):Di(df)?pf=new ke(this.channel,this.storyStoreValue,df,this.mainStoryCallbacks(uf)):pf=new De(this.channel,this.storyStoreValue,df,this.mainStoryCallbacks(uf));let mf=this.currentSelection;this.currentSelection=mc;let gf=this.currentRender;this.currentRender=pf;try{await pf.prepare()}catch(vf){gf&&await this.teardownRender(gf),vf!==Y&&this.renderStoryLoadingException(uf,vf);return}let yf=!ff&&gf&&!pf.isEqual(gf);if(vo&&Jr(pf)&&(Xe(!!pf.story),this.storyStoreValue.args.updateFromPersisted(pf.story,vo)),gf&&!gf.torndown&&!ff&&!yf&&!hf){this.currentRender=gf,this.channel.emit(K$2,uf),this.view.showMain();return}if(gf&&await this.teardownRender(gf,{viewModeChanged:hf}),mf&&(ff||hf)&&this.channel.emit(f$2,uf),Jr(pf)){Xe(!!pf.story);let{parameters:vf,initialArgs:bf,argTypes:Sf,unmappedArgs:xf,initialGlobals:wf,userGlobals:s1,storyGlobals:If,globals:l1}=this.storyStoreValue.getStoryContext(pf.story);this.channel.emit(w$2,{id:uf,parameters:vf,initialArgs:bf,argTypes:Sf,args:xf}),this.channel.emit(U$3,{userGlobals:s1,storyGlobals:If,globals:l1,initialGlobals:wf})}else{let{parameters:vf}=this.storyStoreValue.projectAnnotations,{initialGlobals:bf,globals:Sf}=this.storyStoreValue.userGlobals;if(this.channel.emit(U$3,{globals:Sf,initialGlobals:bf,storyGlobals:{},userGlobals:Sf}),ji(pf)||((hc=pf.entry.tags)==null?void 0:hc.includes(Fo))){if(!pf.csfFiles)throw new H({storyId:uf});({parameters:vf}=this.storyStoreValue.preparedMetaFromCSFFile({csfFile:pf.csfFiles[0]}))}this.channel.emit(D$3,{id:uf,parameters:vf})}Jr(pf)?(Xe(!!pf.story),this.storyRenders.push(pf),this.currentRender.renderToElement(this.view.prepareForStory(pf.story))):this.currentRender.renderToElement(this.view.prepareForDocs(),this.renderStoryToElement.bind(this))}async teardownRender(vo,{viewModeChanged:Ai=!1}={}){var bo;this.storyRenders=this.storyRenders.filter(Ra=>Ra!==vo),await((bo=vo==null?void 0:vo.teardown)==null?void 0:bo.call(vo,{viewModeChanged:Ai}))}mainStoryCallbacks(vo){return{showStoryDuringRender:s$1(()=>this.view.showStoryDuringRender(),"showStoryDuringRender"),showMain:s$1(()=>this.view.showMain(),"showMain"),showError:s$1(Ai=>this.renderError(vo,Ai),"showError"),showException:s$1(Ai=>this.renderException(vo,Ai),"showException")}}renderPreviewEntryError(vo,Ai){super.renderPreviewEntryError(vo,Ai),this.view.showErrorDisplay(Ai)}renderMissingStory(){this.view.showNoPreview(),this.channel.emit(V$1)}renderStoryLoadingException(vo,Ai){s$3.error(Ai),this.view.showErrorDisplay(Ai),this.channel.emit(V$1,vo)}renderException(vo,Ai){let{name:bo="Error",message:Ra=String(Ai),stack:hc}=Ai;this.channel.emit(b$2,{name:bo,message:Ra,stack:hc}),this.channel.emit(B$2,{newPhase:"errored",storyId:vo}),this.view.showErrorDisplay(Ai),s$3.error(`Error rendering story '${vo}':`),s$3.error(Ai)}renderError(vo,{title:Ai,description:bo}){s$3.error(`Error rendering story ${Ai}: ${bo}`),this.channel.emit(x$3,{title:Ai,description:bo}),this.channel.emit(B$2,{newPhase:"errored",storyId:vo}),this.view.showErrorDisplay({message:Ai,stack:bo})}};s$1(Qr,"PreviewWithSelection");var he=Qr,Me=ce(tr()),Go=ce(tr()),zo=/^[a-zA-Z0-9 _-]*$/,Vo=/^-?[0-9]+(\.[0-9]+)?$/,aa=/^#([a-f0-9]{3,4}|[a-f0-9]{6}|[a-f0-9]{8})$/i,Uo=/^(rgba?|hsla?)\(([0-9]{1,3}),\s?([0-9]{1,3})%?,\s?([0-9]{1,3})%?,?\s?([0-9](\.[0-9]{1,2})?)?\)$/i,st=s$1((vo="",Ai)=>vo===null||vo===""||!zo.test(vo)?!1:Ai==null||Ai instanceof Date||typeof Ai=="number"||typeof Ai=="boolean"?!0:typeof Ai=="string"?zo.test(Ai)||Vo.test(Ai)||aa.test(Ai)||Uo.test(Ai):Array.isArray(Ai)?Ai.every(bo=>st(vo,bo)):k(Ai)?Object.entries(Ai).every(([bo,Ra])=>st(bo,Ra)):!1,"validateArgs"),la={delimiter:";",nesting:!0,arrayRepeat:!0,arrayRepeatSyntax:"bracket",nestingSyntax:"js",valueDeserializer(vo){if(vo.startsWith("!")){if(vo==="!undefined")return;if(vo==="!null")return null;if(vo==="!true")return!0;if(vo==="!false")return!1;if(vo.startsWith("!date(")&&vo.endsWith(")"))return new Date(vo.replaceAll(" ","+").slice(6,-1));if(vo.startsWith("!hex(")&&vo.endsWith(")"))return`#${vo.slice(5,-1)}`;let Ai=vo.slice(1).match(Uo);if(Ai)return vo.startsWith("!rgba")||vo.startsWith("!RGBA")?`${Ai[1]}(${Ai[2]}, ${Ai[3]}, ${Ai[4]}, ${Ai[5]})`:vo.startsWith("!hsla")||vo.startsWith("!HSLA")?`${Ai[1]}(${Ai[2]}, ${Ai[3]}%, ${Ai[4]}%, ${Ai[5]})`:vo.startsWith("!rgb")||vo.startsWith("!RGB")?`${Ai[1]}(${Ai[2]}, ${Ai[3]}, ${Ai[4]})`:`${Ai[1]}(${Ai[2]}, ${Ai[3]}%, ${Ai[4]}%)`}return Vo.test(vo)?Number(vo):vo}},it=s$1(vo=>{let Ai=vo.split(";").map(bo=>bo.replace("=","~").replace(":","="));return Object.entries((0,Go.parse)(Ai.join(";"),la)).reduce((bo,[Ra,hc])=>st(Ra,hc)?Object.assign(bo,{[Ra]:hc}):(n$2.warn(F`
|
|
262
|
-
Omitted potentially unsafe URL args.
|
|
263
|
-
|
|
264
|
-
More info: https://storybook.js.org/docs/writing-stories/args#setting-args-through-the-url
|
|
265
|
-
`),bo),{})},"parseArgsParam"),{history:Ho,document:X}=v;function ca(vo){let Ai=(vo||"").match(/^\/story\/(.+)/);if(!Ai)throw new Error(`Invalid path '${vo}', must start with '/story/'`);return Ai[1]}s$1(ca,"pathToId");var Wo=s$1(({selection:vo,extraParams:Ai})=>{let bo=X==null?void 0:X.location.search.slice(1),{path:Ra,selectedKind:hc,selectedStory:pc,...mc}=(0,Me.parse)(bo);return`?${(0,Me.stringify)({...mc,...Ai,...vo&&{id:vo.storyId,viewMode:vo.viewMode}})}`},"getQueryString"),da=s$1(vo=>{if(!vo)return;let Ai=Wo({selection:vo}),{hash:bo=""}=X.location;X.title=vo.storyId,Ho.replaceState({},"",`${X.location.pathname}${Ai}${bo}`)},"setPath"),pa=s$1(vo=>vo!=null&&typeof vo=="object"&&Array.isArray(vo)===!1,"isObject"),je=s$1(vo=>{if(vo!==void 0){if(typeof vo=="string")return vo;if(Array.isArray(vo))return je(vo[0]);if(pa(vo))return je(Object.values(vo).filter(Boolean))}},"getFirstString"),ua=s$1(()=>{if(typeof X<"u"){let vo=X.location.search.slice(1),Ai=(0,Me.parse)(vo),bo=typeof Ai.args=="string"?it(Ai.args):void 0,Ra=typeof Ai.globals=="string"?it(Ai.globals):void 0,hc=je(Ai.viewMode);(typeof hc!="string"||!hc.match(/docs|story/))&&(hc="story");let pc=je(Ai.path),mc=pc?ca(pc):je(Ai.id);if(mc)return{storySpecifier:mc,args:bo,globals:Ra,viewMode:hc}}return null},"getSelectionSpecifierFromPath"),at=class{constructor(){this.selectionSpecifier=ua()}setSelection(vo){this.selection=vo,da(this.selection)}setQueryParams(vo){let Ai=Wo({extraParams:vo}),{hash:bo=""}=X.location;Ho.replaceState({},"",`${X.location.pathname}${Ai}${bo}`)}};s$1(at,"UrlStore");var ge=at,An=ce(Rn()),vn=ce(tr()),{document:D}=v,wn=100,Cn=(vo=>(vo.MAIN="MAIN",vo.NOPREVIEW="NOPREVIEW",vo.PREPARING_STORY="PREPARING_STORY",vo.PREPARING_DOCS="PREPARING_DOCS",vo.ERROR="ERROR",vo))(Cn||{}),yt={PREPARING_STORY:"sb-show-preparing-story",PREPARING_DOCS:"sb-show-preparing-docs",MAIN:"sb-show-main",NOPREVIEW:"sb-show-nopreview",ERROR:"sb-show-errordisplay"},mt={centered:"sb-main-centered",fullscreen:"sb-main-fullscreen",padded:"sb-main-padded"},En=new An.default({escapeXML:!0}),ht=class{constructor(){if(this.testing=!1,typeof D<"u"){let{__SPECIAL_TEST_PARAMETER__:vo}=(0,vn.parse)(D.location.search.slice(1));switch(vo){case"preparing-story":{this.showPreparingStory(),this.testing=!0;break}case"preparing-docs":{this.showPreparingDocs(),this.testing=!0;break}}}}prepareForStory(vo){return this.showStory(),this.applyLayout(vo.parameters.layout),D.documentElement.scrollTop=0,D.documentElement.scrollLeft=0,this.storyRoot()}storyRoot(){return D.getElementById("storybook-root")}prepareForDocs(){return this.showMain(),this.showDocs(),this.applyLayout("fullscreen"),D.documentElement.scrollTop=0,D.documentElement.scrollLeft=0,this.docsRoot()}docsRoot(){return D.getElementById("storybook-docs")}applyLayout(vo="padded"){if(vo==="none"){D.body.classList.remove(this.currentLayoutClass),this.currentLayoutClass=null;return}this.checkIfLayoutExists(vo);let Ai=mt[vo];D.body.classList.remove(this.currentLayoutClass),D.body.classList.add(Ai),this.currentLayoutClass=Ai}checkIfLayoutExists(vo){mt[vo]||s$3.warn(F`
|
|
266
|
-
The desired layout: ${vo} is not a valid option.
|
|
267
|
-
The possible options are: ${Object.keys(mt).join(", ")}, none.
|
|
268
|
-
`)}showMode(vo){clearTimeout(this.preparingTimeout),Object.keys(Cn).forEach(Ai=>{Ai===vo?D.body.classList.add(yt[Ai]):D.body.classList.remove(yt[Ai])})}showErrorDisplay({message:vo="",stack:Ai=""}){let bo=vo,Ra=Ai,hc=vo.split(`
|
|
269
|
-
`);hc.length>1&&([bo]=hc,Ra=hc.slice(1).join(`
|
|
270
|
-
`).replace(/^\n/,"")),D.getElementById("error-message").innerHTML=En.toHtml(bo),D.getElementById("error-stack").innerHTML=En.toHtml(Ra),this.showMode("ERROR")}showNoPreview(){var vo,Ai;this.testing||(this.showMode("NOPREVIEW"),(vo=this.storyRoot())==null||vo.setAttribute("hidden","true"),(Ai=this.docsRoot())==null||Ai.setAttribute("hidden","true"))}showPreparingStory({immediate:vo=!1}={}){clearTimeout(this.preparingTimeout),vo?this.showMode("PREPARING_STORY"):this.preparingTimeout=setTimeout(()=>this.showMode("PREPARING_STORY"),wn)}showPreparingDocs({immediate:vo=!1}={}){clearTimeout(this.preparingTimeout),vo?this.showMode("PREPARING_DOCS"):this.preparingTimeout=setTimeout(()=>this.showMode("PREPARING_DOCS"),wn)}showMain(){this.showMode("MAIN")}showDocs(){this.storyRoot().setAttribute("hidden","true"),this.docsRoot().removeAttribute("hidden")}showStory(){this.docsRoot().setAttribute("hidden","true"),this.storyRoot().removeAttribute("hidden")}showStoryDuringRender(){D.body.classList.add(yt.MAIN)}};s$1(ht,"WebView");var be=ht,gt=class extends he{constructor(vo,Ai){super(vo,Ai,new ge,new be),this.importFn=vo,this.getProjectAnnotations=Ai,v.__STORYBOOK_PREVIEW__=this}};s$1(gt,"PreviewWeb");var{document:le}=v,Ya=["application/javascript","application/ecmascript","application/x-ecmascript","application/x-javascript","text/ecmascript","text/javascript","text/javascript1.0","text/javascript1.1","text/javascript1.2","text/javascript1.3","text/javascript1.4","text/javascript1.5","text/jscript","text/livescript","text/x-ecmascript","text/x-javascript","module"],Ka="script",Pn="scripts-root";function pr(){let vo=le.createEvent("Event");vo.initEvent("DOMContentLoaded",!0,!0),le.dispatchEvent(vo)}s$1(pr,"simulateDOMContentLoaded");function Xa(vo,Ai,bo){let Ra=le.createElement("script");Ra.type=vo.type==="module"?"module":"text/javascript",vo.src?(Ra.onload=Ai,Ra.onerror=Ai,Ra.src=vo.src):Ra.textContent=vo.innerText,bo?bo.appendChild(Ra):le.head.appendChild(Ra),vo.parentNode.removeChild(vo),vo.src||Ai()}s$1(Xa,"insertScript");function Fn(vo,Ai,bo=0){vo[bo](()=>{bo++,bo===vo.length?Ai():Fn(vo,Ai,bo)})}s$1(Fn,"insertScriptsSequentially");function In(vo){let Ai=le.getElementById(Pn);Ai?Ai.innerHTML="":(Ai=le.createElement("div"),Ai.id=Pn,le.body.appendChild(Ai));let bo=Array.from(vo.querySelectorAll(Ka));if(bo.length){let Ra=[];bo.forEach(hc=>{let pc=hc.getAttribute("type");(!pc||Ya.includes(pc))&&Ra.push(mc=>Xa(hc,mc,Ai))}),Ra.length&&Fn(Ra,pr,void 0)}else pr()}s$1(In,"simulatePageLoad");const FormFieldContext=y__default.createContext({}),FormItemContext=y__default.createContext({}),useFormField=()=>{const vo=y__default.useContext(FormFieldContext),Ai=y__default.useContext(FormItemContext),{getFieldState:bo,formState:Ra}=Yr$2(),hc=bo(vo.name,Ra);if(!vo)throw new Error("useFormField should be used within <FormField>");const{id:pc}=Ai;return{id:pc,name:vo.name,formItemId:`${pc}-form-item`,formDescriptionId:`${pc}-form-item-description`,formMessageId:`${pc}-form-item-message`,...hc}},Form=p1,FormField=({...vo})=>jsx(FormFieldContext.Provider,{value:{name:vo.name},children:jsx(Ec,{...vo})}),FormItem=y$2.forwardRef(({className:vo,...Ai},bo)=>{const Ra=y$2.useId();return jsx(FormItemContext.Provider,{value:{id:Ra},children:jsx("div",{ref:bo,className:cn("",vo),...Ai})})});FormItem.displayName="FormItem";const FormLabel=y$2.forwardRef(({className:vo,...Ai},bo)=>{const{error:Ra,formItemId:hc}=useFormField();return jsx(Label,{ref:bo,className:cn(Ra&&"text-destructive",vo),htmlFor:hc,...Ai})});FormLabel.displayName="FormLabel";const FormControl=y$2.forwardRef(({...vo},Ai)=>{const{error:bo,formItemId:Ra,formDescriptionId:hc,formMessageId:pc}=useFormField();return jsx(mn$1,{ref:Ai,id:Ra,"aria-describedby":bo?`${hc} ${pc}`:hc,"aria-invalid":!!bo,...vo})});FormControl.displayName="FormControl";const FormDescription=y$2.forwardRef(({className:vo,...Ai},bo)=>{const{formDescriptionId:Ra}=useFormField();return jsx("p",{ref:bo,id:Ra,className:cn("text-[0.8rem] text-gray-600",vo),...Ai})});FormDescription.displayName="FormDescription";const FormMessage=y$2.forwardRef(({className:vo,children:Ai,...bo},Ra)=>{const{error:hc,formMessageId:pc}=useFormField(),mc=hc?String(hc.message):Ai;return mc?jsx("p",{ref:Ra,id:pc,className:cn("text-[0.8rem] font-medium text-red-800",vo),...bo,children:mc}):null});FormMessage.displayName="FormMessage";var NAME="Label",Label$1=y$2.forwardRef((vo,Ai)=>jsx(we$1.label,{...vo,ref:Ai,onMouseDown:bo=>{var Ra;bo.target.closest("button, input, select, textarea")||((Ra=vo.onMouseDown)==null||Ra.call(vo,bo),!bo.defaultPrevented&&bo.detail>1&&bo.preventDefault())}}));Label$1.displayName=NAME;var Root=Label$1;const cx=h1,cva=(vo,Ai)=>bo=>cx(vo,bo==null?void 0:bo.class,bo==null?void 0:bo.className);function cn(...vo){return Ne$1(h1(vo))}const SPLIT_LOWER_UPPER_RE=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),SPLIT_UPPER_UPPER_RE=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),SPLIT_SEPARATE_NUMBER_RE=new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d","u"),DEFAULT_STRIP_REGEXP=/[^\p{L}\d]+/giu,SPLIT_REPLACE_VALUE="$1\0$2",DEFAULT_PREFIX_SUFFIX_CHARACTERS="";function split(vo){let Ai=vo.trim();Ai=Ai.replace(SPLIT_LOWER_UPPER_RE,SPLIT_REPLACE_VALUE).replace(SPLIT_UPPER_UPPER_RE,SPLIT_REPLACE_VALUE),Ai=Ai.replace(DEFAULT_STRIP_REGEXP,"\0");let bo=0,Ra=Ai.length;for(;Ai.charAt(bo)==="\0";)bo++;if(bo===Ra)return[];for(;Ai.charAt(Ra-1)==="\0";)Ra--;return Ai.slice(bo,Ra).split(/\0/g)}function splitSeparateNumbers(vo){const Ai=split(vo);for(let bo=0;bo<Ai.length;bo++){const Ra=Ai[bo],hc=SPLIT_SEPARATE_NUMBER_RE.exec(Ra);if(hc){const pc=hc.index+(hc[1]??hc[2]).length;Ai.splice(bo,1,Ra.slice(0,pc),Ra.slice(pc))}}return Ai}function noCase(vo,Ai){const[bo,Ra,hc]=splitPrefixSuffix(vo,Ai);return bo+Ra.map(lowerFactory(Ai==null?void 0:Ai.locale)).join((Ai==null?void 0:Ai.delimiter)??" ")+hc}function pascalCase(vo,Ai){const[bo,Ra,hc]=splitPrefixSuffix(vo,Ai),pc=lowerFactory(void 0),mc=upperFactory(void 0),uf=pascalCaseTransformFactory(pc,mc);return bo+Ra.map(uf).join("")+hc}function constantCase(vo,Ai){const[bo,Ra,hc]=splitPrefixSuffix(vo,Ai);return bo+Ra.map(upperFactory(void 0)).join("_")+hc}function sentenceCase(vo,Ai){const[bo,Ra,hc]=splitPrefixSuffix(vo,Ai),pc=lowerFactory(void 0),mc=upperFactory(void 0),uf=capitalCaseTransformFactory(pc,mc);return bo+Ra.map((df,ff)=>ff===0?uf(df):pc(df)).join(" ")+hc}function snakeCase(vo,Ai){return noCase(vo,{delimiter:"_",...Ai})}function lowerFactory(vo){return vo===!1?Ai=>Ai.toLowerCase():Ai=>Ai.toLocaleLowerCase(vo)}function upperFactory(vo){return Ai=>Ai.toLocaleUpperCase(vo)}function capitalCaseTransformFactory(vo,Ai){return bo=>`${Ai(bo[0])}${vo(bo.slice(1))}`}function pascalCaseTransformFactory(vo,Ai){return(bo,Ra)=>{const hc=bo[0];return(Ra>0&&hc>="0"&&hc<="9"?"_"+hc:Ai(hc))+vo(bo.slice(1))}}function splitPrefixSuffix(vo,Ai={}){const bo=Ai.split??(Ai.separateNumbers?splitSeparateNumbers:split),Ra=Ai.prefixCharacters??DEFAULT_PREFIX_SUFFIX_CHARACTERS,hc=Ai.suffixCharacters??DEFAULT_PREFIX_SUFFIX_CHARACTERS;let pc=0,mc=vo.length;for(;pc<vo.length;){const uf=vo.charAt(pc);if(!Ra.includes(uf))break;pc++}for(;mc>pc;){const uf=mc-1,df=vo.charAt(uf);if(!hc.includes(df))break;mc=uf}return[vo.slice(0,pc),bo(vo.slice(pc,mc)),vo.slice(mc)]}const versionInfo=Object.freeze({major:16,minor:10,patch:0,preReleaseTag:null});function devAssert(vo,Ai){throw new Error(Ai)}function isObjectLike(vo){return typeof vo=="object"&&vo!==null}function invariant$1(vo,Ai){throw new Error(Ai??"Unexpected invariant triggered.")}const LineRegExp=/\r\n|[\n\r]/g;function getLocation$1(vo,Ai){let bo=0,Ra=1;for(const hc of vo.body.matchAll(LineRegExp)){if(typeof hc.index=="number"||invariant$1(),hc.index>=Ai)break;bo=hc.index+hc[0].length,Ra+=1}return{line:Ra,column:Ai+1-bo}}function printLocation(vo){return printSourceLocation(vo.source,getLocation$1(vo.source,vo.start))}function printSourceLocation(vo,Ai){const bo=vo.locationOffset.column-1,Ra="".padStart(bo)+vo.body,hc=Ai.line-1,pc=vo.locationOffset.line-1,mc=Ai.line+pc,uf=Ai.line===1?bo:0,df=Ai.column+uf,ff=`${vo.name}:${mc}:${df}
|
|
271
|
-
`,hf=Ra.split(/\r\n|[\n\r]/g),pf=hf[hc];if(pf.length>120){const mf=Math.floor(df/80),gf=df%80,yf=[];for(let vf=0;vf<pf.length;vf+=80)yf.push(pf.slice(vf,vf+80));return ff+printPrefixedLines([[`${mc} |`,yf[0]],...yf.slice(1,mf+1).map(vf=>["|",vf]),["|","^".padStart(gf)],["|",yf[mf+1]]])}return ff+printPrefixedLines([[`${mc-1} |`,hf[hc-1]],[`${mc} |`,pf],["|","^".padStart(df)],[`${mc+1} |`,hf[hc+1]]])}function printPrefixedLines(vo){const Ai=vo.filter(([Ra,hc])=>hc!==void 0),bo=Math.max(...Ai.map(([Ra])=>Ra.length));return Ai.map(([Ra,hc])=>Ra.padStart(bo)+(hc?" "+hc:"")).join(`
|
|
272
|
-
`)}function toNormalizedOptions(vo){const Ai=vo[0];return Ai==null||"kind"in Ai||"length"in Ai?{nodes:Ai,source:vo[1],positions:vo[2],path:vo[3],originalError:vo[4],extensions:vo[5]}:Ai}class GraphQLError extends Error{constructor(Ai,...bo){var Ra,hc,pc;const{nodes:mc,source:uf,positions:df,path:ff,originalError:hf,extensions:pf}=toNormalizedOptions(bo);super(Ai),this.name="GraphQLError",this.path=ff??void 0,this.originalError=hf??void 0,this.nodes=undefinedIfEmpty(Array.isArray(mc)?mc:mc?[mc]:void 0);const mf=undefinedIfEmpty((Ra=this.nodes)===null||Ra===void 0?void 0:Ra.map(yf=>yf.loc).filter(yf=>yf!=null));this.source=uf??(mf==null||(hc=mf[0])===null||hc===void 0?void 0:hc.source),this.positions=df??(mf==null?void 0:mf.map(yf=>yf.start)),this.locations=df&&uf?df.map(yf=>getLocation$1(uf,yf)):mf==null?void 0:mf.map(yf=>getLocation$1(yf.source,yf.start));const gf=isObjectLike(hf==null?void 0:hf.extensions)?hf==null?void 0:hf.extensions:void 0;this.extensions=(pc=pf??gf)!==null&&pc!==void 0?pc:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),hf!=null&&hf.stack?Object.defineProperty(this,"stack",{value:hf.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,GraphQLError):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let Ai=this.message;if(this.nodes)for(const bo of this.nodes)bo.loc&&(Ai+=`
|
|
273
|
-
|
|
274
|
-
`+printLocation(bo.loc));else if(this.source&&this.locations)for(const bo of this.locations)Ai+=`
|
|
275
|
-
|
|
276
|
-
`+printSourceLocation(this.source,bo);return Ai}toJSON(){const Ai={message:this.message};return this.locations!=null&&(Ai.locations=this.locations),this.path!=null&&(Ai.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(Ai.extensions=this.extensions),Ai}}function undefinedIfEmpty(vo){return vo===void 0||vo.length===0?void 0:vo}function syntaxError(vo,Ai,bo){return new GraphQLError(`Syntax Error: ${bo}`,{source:vo,positions:[Ai]})}let Location$1=class{constructor(vo,Ai,bo){this.start=vo.start,this.end=Ai.end,this.startToken=vo,this.endToken=Ai,this.source=bo}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}};class Token{constructor(Ai,bo,Ra,hc,pc,mc){this.kind=Ai,this.start=bo,this.end=Ra,this.line=hc,this.column=pc,this.value=mc,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const QueryDocumentKeys={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},kindValues=new Set(Object.keys(QueryDocumentKeys));function isNode(vo){const Ai=vo==null?void 0:vo.kind;return typeof Ai=="string"&&kindValues.has(Ai)}var OperationTypeNode;(function(vo){vo.QUERY="query",vo.MUTATION="mutation",vo.SUBSCRIPTION="subscription"})(OperationTypeNode||(OperationTypeNode={}));var DirectiveLocation;(function(vo){vo.QUERY="QUERY",vo.MUTATION="MUTATION",vo.SUBSCRIPTION="SUBSCRIPTION",vo.FIELD="FIELD",vo.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",vo.FRAGMENT_SPREAD="FRAGMENT_SPREAD",vo.INLINE_FRAGMENT="INLINE_FRAGMENT",vo.VARIABLE_DEFINITION="VARIABLE_DEFINITION",vo.SCHEMA="SCHEMA",vo.SCALAR="SCALAR",vo.OBJECT="OBJECT",vo.FIELD_DEFINITION="FIELD_DEFINITION",vo.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",vo.INTERFACE="INTERFACE",vo.UNION="UNION",vo.ENUM="ENUM",vo.ENUM_VALUE="ENUM_VALUE",vo.INPUT_OBJECT="INPUT_OBJECT",vo.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(DirectiveLocation||(DirectiveLocation={}));var Kind;(function(vo){vo.NAME="Name",vo.DOCUMENT="Document",vo.OPERATION_DEFINITION="OperationDefinition",vo.VARIABLE_DEFINITION="VariableDefinition",vo.SELECTION_SET="SelectionSet",vo.FIELD="Field",vo.ARGUMENT="Argument",vo.FRAGMENT_SPREAD="FragmentSpread",vo.INLINE_FRAGMENT="InlineFragment",vo.FRAGMENT_DEFINITION="FragmentDefinition",vo.VARIABLE="Variable",vo.INT="IntValue",vo.FLOAT="FloatValue",vo.STRING="StringValue",vo.BOOLEAN="BooleanValue",vo.NULL="NullValue",vo.ENUM="EnumValue",vo.LIST="ListValue",vo.OBJECT="ObjectValue",vo.OBJECT_FIELD="ObjectField",vo.DIRECTIVE="Directive",vo.NAMED_TYPE="NamedType",vo.LIST_TYPE="ListType",vo.NON_NULL_TYPE="NonNullType",vo.SCHEMA_DEFINITION="SchemaDefinition",vo.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",vo.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",vo.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",vo.FIELD_DEFINITION="FieldDefinition",vo.INPUT_VALUE_DEFINITION="InputValueDefinition",vo.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",vo.UNION_TYPE_DEFINITION="UnionTypeDefinition",vo.ENUM_TYPE_DEFINITION="EnumTypeDefinition",vo.ENUM_VALUE_DEFINITION="EnumValueDefinition",vo.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",vo.DIRECTIVE_DEFINITION="DirectiveDefinition",vo.SCHEMA_EXTENSION="SchemaExtension",vo.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",vo.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",vo.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",vo.UNION_TYPE_EXTENSION="UnionTypeExtension",vo.ENUM_TYPE_EXTENSION="EnumTypeExtension",vo.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(Kind||(Kind={}));function isWhiteSpace(vo){return vo===9||vo===32}function isDigit$1(vo){return vo>=48&&vo<=57}function isLetter(vo){return vo>=97&&vo<=122||vo>=65&&vo<=90}function isNameStart(vo){return isLetter(vo)||vo===95}function isNameContinue(vo){return isLetter(vo)||isDigit$1(vo)||vo===95}function dedentBlockStringLines(vo){var Ai;let bo=Number.MAX_SAFE_INTEGER,Ra=null,hc=-1;for(let mc=0;mc<vo.length;++mc){var pc;const uf=vo[mc],df=leadingWhitespace(uf);df!==uf.length&&(Ra=(pc=Ra)!==null&&pc!==void 0?pc:mc,hc=mc,mc!==0&&df<bo&&(bo=df))}return vo.map((mc,uf)=>uf===0?mc:mc.slice(bo)).slice((Ai=Ra)!==null&&Ai!==void 0?Ai:0,hc+1)}function leadingWhitespace(vo){let Ai=0;for(;Ai<vo.length&&isWhiteSpace(vo.charCodeAt(Ai));)++Ai;return Ai}function isPrintableAsBlockString(vo){if(vo==="")return!0;let Ai=!0,bo=!1,Ra=!0,hc=!1;for(let pc=0;pc<vo.length;++pc)switch(vo.codePointAt(pc)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:return!1;case 13:return!1;case 10:if(Ai&&!hc)return!1;hc=!0,Ai=!0,bo=!1;break;case 9:case 32:bo||(bo=Ai);break;default:Ra&&(Ra=bo),Ai=!1}return!(Ai||Ra&&hc)}function printBlockString(vo,Ai){const bo=vo.replace(/"""/g,'\\"""'),Ra=bo.split(/\r\n|[\n\r]/g),hc=Ra.length===1,pc=Ra.length>1&&Ra.slice(1).every(gf=>gf.length===0||isWhiteSpace(gf.charCodeAt(0))),mc=bo.endsWith('\\"""'),uf=vo.endsWith('"')&&!mc,df=vo.endsWith("\\"),ff=uf||df,hf=!hc||vo.length>70||ff||pc||mc;let pf="";const mf=hc&&isWhiteSpace(vo.charCodeAt(0));return(hf&&!mf||pc)&&(pf+=`
|
|
277
|
-
`),pf+=bo,(hf||ff)&&(pf+=`
|
|
278
|
-
`),'"""'+pf+'"""'}var TokenKind;(function(vo){vo.SOF="<SOF>",vo.EOF="<EOF>",vo.BANG="!",vo.DOLLAR="$",vo.AMP="&",vo.PAREN_L="(",vo.PAREN_R=")",vo.SPREAD="...",vo.COLON=":",vo.EQUALS="=",vo.AT="@",vo.BRACKET_L="[",vo.BRACKET_R="]",vo.BRACE_L="{",vo.PIPE="|",vo.BRACE_R="}",vo.NAME="Name",vo.INT="Int",vo.FLOAT="Float",vo.STRING="String",vo.BLOCK_STRING="BlockString",vo.COMMENT="Comment"})(TokenKind||(TokenKind={}));class Lexer{constructor(Ai){const bo=new Token(TokenKind.SOF,0,0,0,0);this.source=Ai,this.lastToken=bo,this.token=bo,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let Ai=this.token;if(Ai.kind!==TokenKind.EOF)do if(Ai.next)Ai=Ai.next;else{const bo=readNextToken(this,Ai.end);Ai.next=bo,bo.prev=Ai,Ai=bo}while(Ai.kind===TokenKind.COMMENT);return Ai}}function isPunctuatorTokenKind(vo){return vo===TokenKind.BANG||vo===TokenKind.DOLLAR||vo===TokenKind.AMP||vo===TokenKind.PAREN_L||vo===TokenKind.PAREN_R||vo===TokenKind.SPREAD||vo===TokenKind.COLON||vo===TokenKind.EQUALS||vo===TokenKind.AT||vo===TokenKind.BRACKET_L||vo===TokenKind.BRACKET_R||vo===TokenKind.BRACE_L||vo===TokenKind.PIPE||vo===TokenKind.BRACE_R}function isUnicodeScalarValue(vo){return vo>=0&&vo<=55295||vo>=57344&&vo<=1114111}function isSupplementaryCodePoint(vo,Ai){return isLeadingSurrogate(vo.charCodeAt(Ai))&&isTrailingSurrogate(vo.charCodeAt(Ai+1))}function isLeadingSurrogate(vo){return vo>=55296&&vo<=56319}function isTrailingSurrogate(vo){return vo>=56320&&vo<=57343}function printCodePointAt(vo,Ai){const bo=vo.source.body.codePointAt(Ai);if(bo===void 0)return TokenKind.EOF;if(bo>=32&&bo<=126){const Ra=String.fromCodePoint(bo);return Ra==='"'?`'"'`:`"${Ra}"`}return"U+"+bo.toString(16).toUpperCase().padStart(4,"0")}function createToken(vo,Ai,bo,Ra,hc){const pc=vo.line,mc=1+bo-vo.lineStart;return new Token(Ai,bo,Ra,pc,mc,hc)}function readNextToken(vo,Ai){const bo=vo.source.body,Ra=bo.length;let hc=Ai;for(;hc<Ra;){const pc=bo.charCodeAt(hc);switch(pc){case 65279:case 9:case 32:case 44:++hc;continue;case 10:++hc,++vo.line,vo.lineStart=hc;continue;case 13:bo.charCodeAt(hc+1)===10?hc+=2:++hc,++vo.line,vo.lineStart=hc;continue;case 35:return readComment(vo,hc);case 33:return createToken(vo,TokenKind.BANG,hc,hc+1);case 36:return createToken(vo,TokenKind.DOLLAR,hc,hc+1);case 38:return createToken(vo,TokenKind.AMP,hc,hc+1);case 40:return createToken(vo,TokenKind.PAREN_L,hc,hc+1);case 41:return createToken(vo,TokenKind.PAREN_R,hc,hc+1);case 46:if(bo.charCodeAt(hc+1)===46&&bo.charCodeAt(hc+2)===46)return createToken(vo,TokenKind.SPREAD,hc,hc+3);break;case 58:return createToken(vo,TokenKind.COLON,hc,hc+1);case 61:return createToken(vo,TokenKind.EQUALS,hc,hc+1);case 64:return createToken(vo,TokenKind.AT,hc,hc+1);case 91:return createToken(vo,TokenKind.BRACKET_L,hc,hc+1);case 93:return createToken(vo,TokenKind.BRACKET_R,hc,hc+1);case 123:return createToken(vo,TokenKind.BRACE_L,hc,hc+1);case 124:return createToken(vo,TokenKind.PIPE,hc,hc+1);case 125:return createToken(vo,TokenKind.BRACE_R,hc,hc+1);case 34:return bo.charCodeAt(hc+1)===34&&bo.charCodeAt(hc+2)===34?readBlockString(vo,hc):readString(vo,hc)}if(isDigit$1(pc)||pc===45)return readNumber(vo,hc,pc);if(isNameStart(pc))return readName(vo,hc);throw syntaxError(vo.source,hc,pc===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:isUnicodeScalarValue(pc)||isSupplementaryCodePoint(bo,hc)?`Unexpected character: ${printCodePointAt(vo,hc)}.`:`Invalid character: ${printCodePointAt(vo,hc)}.`)}return createToken(vo,TokenKind.EOF,Ra,Ra)}function readComment(vo,Ai){const bo=vo.source.body,Ra=bo.length;let hc=Ai+1;for(;hc<Ra;){const pc=bo.charCodeAt(hc);if(pc===10||pc===13)break;if(isUnicodeScalarValue(pc))++hc;else if(isSupplementaryCodePoint(bo,hc))hc+=2;else break}return createToken(vo,TokenKind.COMMENT,Ai,hc,bo.slice(Ai+1,hc))}function readNumber(vo,Ai,bo){const Ra=vo.source.body;let hc=Ai,pc=bo,mc=!1;if(pc===45&&(pc=Ra.charCodeAt(++hc)),pc===48){if(pc=Ra.charCodeAt(++hc),isDigit$1(pc))throw syntaxError(vo.source,hc,`Invalid number, unexpected digit after 0: ${printCodePointAt(vo,hc)}.`)}else hc=readDigits(vo,hc,pc),pc=Ra.charCodeAt(hc);if(pc===46&&(mc=!0,pc=Ra.charCodeAt(++hc),hc=readDigits(vo,hc,pc),pc=Ra.charCodeAt(hc)),(pc===69||pc===101)&&(mc=!0,pc=Ra.charCodeAt(++hc),(pc===43||pc===45)&&(pc=Ra.charCodeAt(++hc)),hc=readDigits(vo,hc,pc),pc=Ra.charCodeAt(hc)),pc===46||isNameStart(pc))throw syntaxError(vo.source,hc,`Invalid number, expected digit but got: ${printCodePointAt(vo,hc)}.`);return createToken(vo,mc?TokenKind.FLOAT:TokenKind.INT,Ai,hc,Ra.slice(Ai,hc))}function readDigits(vo,Ai,bo){if(!isDigit$1(bo))throw syntaxError(vo.source,Ai,`Invalid number, expected digit but got: ${printCodePointAt(vo,Ai)}.`);const Ra=vo.source.body;let hc=Ai+1;for(;isDigit$1(Ra.charCodeAt(hc));)++hc;return hc}function readString(vo,Ai){const bo=vo.source.body,Ra=bo.length;let hc=Ai+1,pc=hc,mc="";for(;hc<Ra;){const uf=bo.charCodeAt(hc);if(uf===34)return mc+=bo.slice(pc,hc),createToken(vo,TokenKind.STRING,Ai,hc+1,mc);if(uf===92){mc+=bo.slice(pc,hc);const df=bo.charCodeAt(hc+1)===117?bo.charCodeAt(hc+2)===123?readEscapedUnicodeVariableWidth(vo,hc):readEscapedUnicodeFixedWidth(vo,hc):readEscapedCharacter(vo,hc);mc+=df.value,hc+=df.size,pc=hc;continue}if(uf===10||uf===13)break;if(isUnicodeScalarValue(uf))++hc;else if(isSupplementaryCodePoint(bo,hc))hc+=2;else throw syntaxError(vo.source,hc,`Invalid character within String: ${printCodePointAt(vo,hc)}.`)}throw syntaxError(vo.source,hc,"Unterminated string.")}function readEscapedUnicodeVariableWidth(vo,Ai){const bo=vo.source.body;let Ra=0,hc=3;for(;hc<12;){const pc=bo.charCodeAt(Ai+hc++);if(pc===125){if(hc<5||!isUnicodeScalarValue(Ra))break;return{value:String.fromCodePoint(Ra),size:hc}}if(Ra=Ra<<4|readHexDigit(pc),Ra<0)break}throw syntaxError(vo.source,Ai,`Invalid Unicode escape sequence: "${bo.slice(Ai,Ai+hc)}".`)}function readEscapedUnicodeFixedWidth(vo,Ai){const bo=vo.source.body,Ra=read16BitHexCode(bo,Ai+2);if(isUnicodeScalarValue(Ra))return{value:String.fromCodePoint(Ra),size:6};if(isLeadingSurrogate(Ra)&&bo.charCodeAt(Ai+6)===92&&bo.charCodeAt(Ai+7)===117){const hc=read16BitHexCode(bo,Ai+8);if(isTrailingSurrogate(hc))return{value:String.fromCodePoint(Ra,hc),size:12}}throw syntaxError(vo.source,Ai,`Invalid Unicode escape sequence: "${bo.slice(Ai,Ai+6)}".`)}function read16BitHexCode(vo,Ai){return readHexDigit(vo.charCodeAt(Ai))<<12|readHexDigit(vo.charCodeAt(Ai+1))<<8|readHexDigit(vo.charCodeAt(Ai+2))<<4|readHexDigit(vo.charCodeAt(Ai+3))}function readHexDigit(vo){return vo>=48&&vo<=57?vo-48:vo>=65&&vo<=70?vo-55:vo>=97&&vo<=102?vo-87:-1}function readEscapedCharacter(vo,Ai){const bo=vo.source.body;switch(bo.charCodeAt(Ai+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
|
|
279
|
-
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw syntaxError(vo.source,Ai,`Invalid character escape sequence: "${bo.slice(Ai,Ai+2)}".`)}function readBlockString(vo,Ai){const bo=vo.source.body,Ra=bo.length;let hc=vo.lineStart,pc=Ai+3,mc=pc,uf="";const df=[];for(;pc<Ra;){const ff=bo.charCodeAt(pc);if(ff===34&&bo.charCodeAt(pc+1)===34&&bo.charCodeAt(pc+2)===34){uf+=bo.slice(mc,pc),df.push(uf);const hf=createToken(vo,TokenKind.BLOCK_STRING,Ai,pc+3,dedentBlockStringLines(df).join(`
|
|
280
|
-
`));return vo.line+=df.length-1,vo.lineStart=hc,hf}if(ff===92&&bo.charCodeAt(pc+1)===34&&bo.charCodeAt(pc+2)===34&&bo.charCodeAt(pc+3)===34){uf+=bo.slice(mc,pc),mc=pc+1,pc+=4;continue}if(ff===10||ff===13){uf+=bo.slice(mc,pc),df.push(uf),ff===13&&bo.charCodeAt(pc+1)===10?pc+=2:++pc,uf="",mc=pc,hc=pc;continue}if(isUnicodeScalarValue(ff))++pc;else if(isSupplementaryCodePoint(bo,pc))pc+=2;else throw syntaxError(vo.source,pc,`Invalid character within String: ${printCodePointAt(vo,pc)}.`)}throw syntaxError(vo.source,pc,"Unterminated string.")}function readName(vo,Ai){const bo=vo.source.body,Ra=bo.length;let hc=Ai+1;for(;hc<Ra;){const pc=bo.charCodeAt(hc);if(isNameContinue(pc))++hc;else break}return createToken(vo,TokenKind.NAME,Ai,hc,bo.slice(Ai,hc))}const MAX_ARRAY_LENGTH=10,MAX_RECURSIVE_DEPTH=2;function inspect(vo){return formatValue(vo,[])}function formatValue(vo,Ai){switch(typeof vo){case"string":return JSON.stringify(vo);case"function":return vo.name?`[function ${vo.name}]`:"[function]";case"object":return formatObjectValue(vo,Ai);default:return String(vo)}}function formatObjectValue(vo,Ai){if(vo===null)return"null";if(Ai.includes(vo))return"[Circular]";const bo=[...Ai,vo];if(isJSONable(vo)){const Ra=vo.toJSON();if(Ra!==vo)return typeof Ra=="string"?Ra:formatValue(Ra,bo)}else if(Array.isArray(vo))return formatArray(vo,bo);return formatObject(vo,bo)}function isJSONable(vo){return typeof vo.toJSON=="function"}function formatObject(vo,Ai){const bo=Object.entries(vo);return bo.length===0?"{}":Ai.length>MAX_RECURSIVE_DEPTH?"["+getObjectTag(vo)+"]":"{ "+bo.map(([Ra,hc])=>Ra+": "+formatValue(hc,Ai)).join(", ")+" }"}function formatArray(vo,Ai){if(vo.length===0)return"[]";if(Ai.length>MAX_RECURSIVE_DEPTH)return"[Array]";const bo=Math.min(MAX_ARRAY_LENGTH,vo.length),Ra=vo.length-bo,hc=[];for(let pc=0;pc<bo;++pc)hc.push(formatValue(vo[pc],Ai));return Ra===1?hc.push("... 1 more item"):Ra>1&&hc.push(`... ${Ra} more items`),"["+hc.join(", ")+"]"}function getObjectTag(vo){const Ai=Object.prototype.toString.call(vo).replace(/^\[object /,"").replace(/]$/,"");if(Ai==="Object"&&typeof vo.constructor=="function"){const bo=vo.constructor.name;if(typeof bo=="string"&&bo!=="")return bo}return Ai}const isProduction=globalThis.process&&!0,instanceOf=isProduction?function vo(Ai,bo){return Ai instanceof bo}:function vo(Ai,bo){if(Ai instanceof bo)return!0;if(typeof Ai=="object"&&Ai!==null){var Ra;const hc=bo.prototype[Symbol.toStringTag],pc=Symbol.toStringTag in Ai?Ai[Symbol.toStringTag]:(Ra=Ai.constructor)===null||Ra===void 0?void 0:Ra.name;if(hc===pc){const mc=inspect(Ai);throw new Error(`Cannot use ${hc} "${mc}" from another module or realm.
|
|
281
|
-
|
|
282
|
-
Ensure that there is only one instance of "graphql" in the node_modules
|
|
283
|
-
directory. If different versions of "graphql" are the dependencies of other
|
|
284
|
-
relied on modules, use "resolutions" to ensure only one version is installed.
|
|
285
|
-
|
|
286
|
-
https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
287
|
-
|
|
288
|
-
Duplicate "graphql" modules cannot be used at the same time since different
|
|
289
|
-
versions may have different capabilities and behavior. The data from one
|
|
290
|
-
version used in the function from another could produce confusing and
|
|
291
|
-
spurious results.`)}}return!1};class Source{constructor(Ai,bo="GraphQL request",Ra={line:1,column:1}){typeof Ai=="string"||devAssert(!1,`Body must be a string. Received: ${inspect(Ai)}.`),this.body=Ai,this.name=bo,this.locationOffset=Ra,this.locationOffset.line>0||devAssert(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||devAssert(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function isSource(vo){return instanceOf(vo,Source)}function parse(vo,Ai){const bo=new Parser$1(vo,Ai),Ra=bo.parseDocument();return Object.defineProperty(Ra,"tokenCount",{enumerable:!1,value:bo.tokenCount}),Ra}let Parser$1=class{constructor(vo,Ai={}){const bo=isSource(vo)?vo:new Source(vo);this._lexer=new Lexer(bo),this._options=Ai,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const vo=this.expectToken(TokenKind.NAME);return this.node(vo,{kind:Kind.NAME,value:vo.value})}parseDocument(){return this.node(this._lexer.token,{kind:Kind.DOCUMENT,definitions:this.many(TokenKind.SOF,this.parseDefinition,TokenKind.EOF)})}parseDefinition(){if(this.peek(TokenKind.BRACE_L))return this.parseOperationDefinition();const vo=this.peekDescription(),Ai=vo?this._lexer.lookahead():this._lexer.token;if(Ai.kind===TokenKind.NAME){switch(Ai.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(vo)throw syntaxError(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(Ai.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(Ai)}parseOperationDefinition(){const vo=this._lexer.token;if(this.peek(TokenKind.BRACE_L))return this.node(vo,{kind:Kind.OPERATION_DEFINITION,operation:OperationTypeNode.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const Ai=this.parseOperationType();let bo;return this.peek(TokenKind.NAME)&&(bo=this.parseName()),this.node(vo,{kind:Kind.OPERATION_DEFINITION,operation:Ai,name:bo,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const vo=this.expectToken(TokenKind.NAME);switch(vo.value){case"query":return OperationTypeNode.QUERY;case"mutation":return OperationTypeNode.MUTATION;case"subscription":return OperationTypeNode.SUBSCRIPTION}throw this.unexpected(vo)}parseVariableDefinitions(){return this.optionalMany(TokenKind.PAREN_L,this.parseVariableDefinition,TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const vo=this._lexer.token;return this.expectToken(TokenKind.DOLLAR),this.node(vo,{kind:Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:Kind.SELECTION_SET,selections:this.many(TokenKind.BRACE_L,this.parseSelection,TokenKind.BRACE_R)})}parseSelection(){return this.peek(TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){const vo=this._lexer.token,Ai=this.parseName();let bo,Ra;return this.expectOptionalToken(TokenKind.COLON)?(bo=Ai,Ra=this.parseName()):Ra=Ai,this.node(vo,{kind:Kind.FIELD,alias:bo,name:Ra,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(vo){const Ai=vo?this.parseConstArgument:this.parseArgument;return this.optionalMany(TokenKind.PAREN_L,Ai,TokenKind.PAREN_R)}parseArgument(vo=!1){const Ai=this._lexer.token,bo=this.parseName();return this.expectToken(TokenKind.COLON),this.node(Ai,{kind:Kind.ARGUMENT,name:bo,value:this.parseValueLiteral(vo)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const vo=this._lexer.token;this.expectToken(TokenKind.SPREAD);const Ai=this.expectOptionalKeyword("on");return!Ai&&this.peek(TokenKind.NAME)?this.node(vo,{kind:Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(vo,{kind:Kind.INLINE_FRAGMENT,typeCondition:Ai?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const vo=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(vo,{kind:Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(vo,{kind:Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(vo){const Ai=this._lexer.token;switch(Ai.kind){case TokenKind.BRACKET_L:return this.parseList(vo);case TokenKind.BRACE_L:return this.parseObject(vo);case TokenKind.INT:return this.advanceLexer(),this.node(Ai,{kind:Kind.INT,value:Ai.value});case TokenKind.FLOAT:return this.advanceLexer(),this.node(Ai,{kind:Kind.FLOAT,value:Ai.value});case TokenKind.STRING:case TokenKind.BLOCK_STRING:return this.parseStringLiteral();case TokenKind.NAME:switch(this.advanceLexer(),Ai.value){case"true":return this.node(Ai,{kind:Kind.BOOLEAN,value:!0});case"false":return this.node(Ai,{kind:Kind.BOOLEAN,value:!1});case"null":return this.node(Ai,{kind:Kind.NULL});default:return this.node(Ai,{kind:Kind.ENUM,value:Ai.value})}case TokenKind.DOLLAR:if(vo)if(this.expectToken(TokenKind.DOLLAR),this._lexer.token.kind===TokenKind.NAME){const bo=this._lexer.token.value;throw syntaxError(this._lexer.source,Ai.start,`Unexpected variable "$${bo}" in constant value.`)}else throw this.unexpected(Ai);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const vo=this._lexer.token;return this.advanceLexer(),this.node(vo,{kind:Kind.STRING,value:vo.value,block:vo.kind===TokenKind.BLOCK_STRING})}parseList(vo){const Ai=()=>this.parseValueLiteral(vo);return this.node(this._lexer.token,{kind:Kind.LIST,values:this.any(TokenKind.BRACKET_L,Ai,TokenKind.BRACKET_R)})}parseObject(vo){const Ai=()=>this.parseObjectField(vo);return this.node(this._lexer.token,{kind:Kind.OBJECT,fields:this.any(TokenKind.BRACE_L,Ai,TokenKind.BRACE_R)})}parseObjectField(vo){const Ai=this._lexer.token,bo=this.parseName();return this.expectToken(TokenKind.COLON),this.node(Ai,{kind:Kind.OBJECT_FIELD,name:bo,value:this.parseValueLiteral(vo)})}parseDirectives(vo){const Ai=[];for(;this.peek(TokenKind.AT);)Ai.push(this.parseDirective(vo));return Ai}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(vo){const Ai=this._lexer.token;return this.expectToken(TokenKind.AT),this.node(Ai,{kind:Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(vo)})}parseTypeReference(){const vo=this._lexer.token;let Ai;if(this.expectOptionalToken(TokenKind.BRACKET_L)){const bo=this.parseTypeReference();this.expectToken(TokenKind.BRACKET_R),Ai=this.node(vo,{kind:Kind.LIST_TYPE,type:bo})}else Ai=this.parseNamedType();return this.expectOptionalToken(TokenKind.BANG)?this.node(vo,{kind:Kind.NON_NULL_TYPE,type:Ai}):Ai}parseNamedType(){return this.node(this._lexer.token,{kind:Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(TokenKind.STRING)||this.peek(TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const vo=this._lexer.token,Ai=this.parseDescription();this.expectKeyword("schema");const bo=this.parseConstDirectives(),Ra=this.many(TokenKind.BRACE_L,this.parseOperationTypeDefinition,TokenKind.BRACE_R);return this.node(vo,{kind:Kind.SCHEMA_DEFINITION,description:Ai,directives:bo,operationTypes:Ra})}parseOperationTypeDefinition(){const vo=this._lexer.token,Ai=this.parseOperationType();this.expectToken(TokenKind.COLON);const bo=this.parseNamedType();return this.node(vo,{kind:Kind.OPERATION_TYPE_DEFINITION,operation:Ai,type:bo})}parseScalarTypeDefinition(){const vo=this._lexer.token,Ai=this.parseDescription();this.expectKeyword("scalar");const bo=this.parseName(),Ra=this.parseConstDirectives();return this.node(vo,{kind:Kind.SCALAR_TYPE_DEFINITION,description:Ai,name:bo,directives:Ra})}parseObjectTypeDefinition(){const vo=this._lexer.token,Ai=this.parseDescription();this.expectKeyword("type");const bo=this.parseName(),Ra=this.parseImplementsInterfaces(),hc=this.parseConstDirectives(),pc=this.parseFieldsDefinition();return this.node(vo,{kind:Kind.OBJECT_TYPE_DEFINITION,description:Ai,name:bo,interfaces:Ra,directives:hc,fields:pc})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(TokenKind.BRACE_L,this.parseFieldDefinition,TokenKind.BRACE_R)}parseFieldDefinition(){const vo=this._lexer.token,Ai=this.parseDescription(),bo=this.parseName(),Ra=this.parseArgumentDefs();this.expectToken(TokenKind.COLON);const hc=this.parseTypeReference(),pc=this.parseConstDirectives();return this.node(vo,{kind:Kind.FIELD_DEFINITION,description:Ai,name:bo,arguments:Ra,type:hc,directives:pc})}parseArgumentDefs(){return this.optionalMany(TokenKind.PAREN_L,this.parseInputValueDef,TokenKind.PAREN_R)}parseInputValueDef(){const vo=this._lexer.token,Ai=this.parseDescription(),bo=this.parseName();this.expectToken(TokenKind.COLON);const Ra=this.parseTypeReference();let hc;this.expectOptionalToken(TokenKind.EQUALS)&&(hc=this.parseConstValueLiteral());const pc=this.parseConstDirectives();return this.node(vo,{kind:Kind.INPUT_VALUE_DEFINITION,description:Ai,name:bo,type:Ra,defaultValue:hc,directives:pc})}parseInterfaceTypeDefinition(){const vo=this._lexer.token,Ai=this.parseDescription();this.expectKeyword("interface");const bo=this.parseName(),Ra=this.parseImplementsInterfaces(),hc=this.parseConstDirectives(),pc=this.parseFieldsDefinition();return this.node(vo,{kind:Kind.INTERFACE_TYPE_DEFINITION,description:Ai,name:bo,interfaces:Ra,directives:hc,fields:pc})}parseUnionTypeDefinition(){const vo=this._lexer.token,Ai=this.parseDescription();this.expectKeyword("union");const bo=this.parseName(),Ra=this.parseConstDirectives(),hc=this.parseUnionMemberTypes();return this.node(vo,{kind:Kind.UNION_TYPE_DEFINITION,description:Ai,name:bo,directives:Ra,types:hc})}parseUnionMemberTypes(){return this.expectOptionalToken(TokenKind.EQUALS)?this.delimitedMany(TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const vo=this._lexer.token,Ai=this.parseDescription();this.expectKeyword("enum");const bo=this.parseName(),Ra=this.parseConstDirectives(),hc=this.parseEnumValuesDefinition();return this.node(vo,{kind:Kind.ENUM_TYPE_DEFINITION,description:Ai,name:bo,directives:Ra,values:hc})}parseEnumValuesDefinition(){return this.optionalMany(TokenKind.BRACE_L,this.parseEnumValueDefinition,TokenKind.BRACE_R)}parseEnumValueDefinition(){const vo=this._lexer.token,Ai=this.parseDescription(),bo=this.parseEnumValueName(),Ra=this.parseConstDirectives();return this.node(vo,{kind:Kind.ENUM_VALUE_DEFINITION,description:Ai,name:bo,directives:Ra})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw syntaxError(this._lexer.source,this._lexer.token.start,`${getTokenDesc(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const vo=this._lexer.token,Ai=this.parseDescription();this.expectKeyword("input");const bo=this.parseName(),Ra=this.parseConstDirectives(),hc=this.parseInputFieldsDefinition();return this.node(vo,{kind:Kind.INPUT_OBJECT_TYPE_DEFINITION,description:Ai,name:bo,directives:Ra,fields:hc})}parseInputFieldsDefinition(){return this.optionalMany(TokenKind.BRACE_L,this.parseInputValueDef,TokenKind.BRACE_R)}parseTypeSystemExtension(){const vo=this._lexer.lookahead();if(vo.kind===TokenKind.NAME)switch(vo.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(vo)}parseSchemaExtension(){const vo=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const Ai=this.parseConstDirectives(),bo=this.optionalMany(TokenKind.BRACE_L,this.parseOperationTypeDefinition,TokenKind.BRACE_R);if(Ai.length===0&&bo.length===0)throw this.unexpected();return this.node(vo,{kind:Kind.SCHEMA_EXTENSION,directives:Ai,operationTypes:bo})}parseScalarTypeExtension(){const vo=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const Ai=this.parseName(),bo=this.parseConstDirectives();if(bo.length===0)throw this.unexpected();return this.node(vo,{kind:Kind.SCALAR_TYPE_EXTENSION,name:Ai,directives:bo})}parseObjectTypeExtension(){const vo=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const Ai=this.parseName(),bo=this.parseImplementsInterfaces(),Ra=this.parseConstDirectives(),hc=this.parseFieldsDefinition();if(bo.length===0&&Ra.length===0&&hc.length===0)throw this.unexpected();return this.node(vo,{kind:Kind.OBJECT_TYPE_EXTENSION,name:Ai,interfaces:bo,directives:Ra,fields:hc})}parseInterfaceTypeExtension(){const vo=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const Ai=this.parseName(),bo=this.parseImplementsInterfaces(),Ra=this.parseConstDirectives(),hc=this.parseFieldsDefinition();if(bo.length===0&&Ra.length===0&&hc.length===0)throw this.unexpected();return this.node(vo,{kind:Kind.INTERFACE_TYPE_EXTENSION,name:Ai,interfaces:bo,directives:Ra,fields:hc})}parseUnionTypeExtension(){const vo=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const Ai=this.parseName(),bo=this.parseConstDirectives(),Ra=this.parseUnionMemberTypes();if(bo.length===0&&Ra.length===0)throw this.unexpected();return this.node(vo,{kind:Kind.UNION_TYPE_EXTENSION,name:Ai,directives:bo,types:Ra})}parseEnumTypeExtension(){const vo=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const Ai=this.parseName(),bo=this.parseConstDirectives(),Ra=this.parseEnumValuesDefinition();if(bo.length===0&&Ra.length===0)throw this.unexpected();return this.node(vo,{kind:Kind.ENUM_TYPE_EXTENSION,name:Ai,directives:bo,values:Ra})}parseInputObjectTypeExtension(){const vo=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const Ai=this.parseName(),bo=this.parseConstDirectives(),Ra=this.parseInputFieldsDefinition();if(bo.length===0&&Ra.length===0)throw this.unexpected();return this.node(vo,{kind:Kind.INPUT_OBJECT_TYPE_EXTENSION,name:Ai,directives:bo,fields:Ra})}parseDirectiveDefinition(){const vo=this._lexer.token,Ai=this.parseDescription();this.expectKeyword("directive"),this.expectToken(TokenKind.AT);const bo=this.parseName(),Ra=this.parseArgumentDefs(),hc=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const pc=this.parseDirectiveLocations();return this.node(vo,{kind:Kind.DIRECTIVE_DEFINITION,description:Ai,name:bo,arguments:Ra,repeatable:hc,locations:pc})}parseDirectiveLocations(){return this.delimitedMany(TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const vo=this._lexer.token,Ai=this.parseName();if(Object.prototype.hasOwnProperty.call(DirectiveLocation,Ai.value))return Ai;throw this.unexpected(vo)}node(vo,Ai){return this._options.noLocation!==!0&&(Ai.loc=new Location$1(vo,this._lexer.lastToken,this._lexer.source)),Ai}peek(vo){return this._lexer.token.kind===vo}expectToken(vo){const Ai=this._lexer.token;if(Ai.kind===vo)return this.advanceLexer(),Ai;throw syntaxError(this._lexer.source,Ai.start,`Expected ${getTokenKindDesc(vo)}, found ${getTokenDesc(Ai)}.`)}expectOptionalToken(vo){return this._lexer.token.kind===vo?(this.advanceLexer(),!0):!1}expectKeyword(vo){const Ai=this._lexer.token;if(Ai.kind===TokenKind.NAME&&Ai.value===vo)this.advanceLexer();else throw syntaxError(this._lexer.source,Ai.start,`Expected "${vo}", found ${getTokenDesc(Ai)}.`)}expectOptionalKeyword(vo){const Ai=this._lexer.token;return Ai.kind===TokenKind.NAME&&Ai.value===vo?(this.advanceLexer(),!0):!1}unexpected(vo){const Ai=vo??this._lexer.token;return syntaxError(this._lexer.source,Ai.start,`Unexpected ${getTokenDesc(Ai)}.`)}any(vo,Ai,bo){this.expectToken(vo);const Ra=[];for(;!this.expectOptionalToken(bo);)Ra.push(Ai.call(this));return Ra}optionalMany(vo,Ai,bo){if(this.expectOptionalToken(vo)){const Ra=[];do Ra.push(Ai.call(this));while(!this.expectOptionalToken(bo));return Ra}return[]}many(vo,Ai,bo){this.expectToken(vo);const Ra=[];do Ra.push(Ai.call(this));while(!this.expectOptionalToken(bo));return Ra}delimitedMany(vo,Ai){this.expectOptionalToken(vo);const bo=[];do bo.push(Ai.call(this));while(this.expectOptionalToken(vo));return bo}advanceLexer(){const{maxTokens:vo}=this._options,Ai=this._lexer.advance();if(Ai.kind!==TokenKind.EOF&&(++this._tokenCounter,vo!==void 0&&this._tokenCounter>vo))throw syntaxError(this._lexer.source,Ai.start,`Document contains more that ${vo} tokens. Parsing aborted.`)}};function getTokenDesc(vo){const Ai=vo.value;return getTokenKindDesc(vo.kind)+(Ai!=null?` "${Ai}"`:"")}function getTokenKindDesc(vo){return isPunctuatorTokenKind(vo)?`"${vo}"`:vo}const MAX_SUGGESTIONS=5;function didYouMean(vo,Ai){const[bo,Ra]=Ai?[vo,Ai]:[void 0,vo];let hc=" Did you mean ";bo&&(hc+=bo+" ");const pc=Ra.map(df=>`"${df}"`);switch(pc.length){case 0:return"";case 1:return hc+pc[0]+"?";case 2:return hc+pc[0]+" or "+pc[1]+"?"}const mc=pc.slice(0,MAX_SUGGESTIONS),uf=mc.pop();return hc+mc.join(", ")+", or "+uf+"?"}function identityFunc(vo){return vo}function keyMap(vo,Ai){const bo=Object.create(null);for(const Ra of vo)bo[Ai(Ra)]=Ra;return bo}function keyValMap(vo,Ai,bo){const Ra=Object.create(null);for(const hc of vo)Ra[Ai(hc)]=bo(hc);return Ra}function mapValue(vo,Ai){const bo=Object.create(null);for(const Ra of Object.keys(vo))bo[Ra]=Ai(vo[Ra],Ra);return bo}function naturalCompare(vo,Ai){let bo=0,Ra=0;for(;bo<vo.length&&Ra<Ai.length;){let hc=vo.charCodeAt(bo),pc=Ai.charCodeAt(Ra);if(isDigit(hc)&&isDigit(pc)){let mc=0;do++bo,mc=mc*10+hc-DIGIT_0,hc=vo.charCodeAt(bo);while(isDigit(hc)&&mc>0);let uf=0;do++Ra,uf=uf*10+pc-DIGIT_0,pc=Ai.charCodeAt(Ra);while(isDigit(pc)&&uf>0);if(mc<uf)return-1;if(mc>uf)return 1}else{if(hc<pc)return-1;if(hc>pc)return 1;++bo,++Ra}}return vo.length-Ai.length}const DIGIT_0=48,DIGIT_9=57;function isDigit(vo){return!isNaN(vo)&&DIGIT_0<=vo&&vo<=DIGIT_9}function suggestionList(vo,Ai){const bo=Object.create(null),Ra=new LexicalDistance(vo),hc=Math.floor(vo.length*.4)+1;for(const pc of Ai){const mc=Ra.measure(pc,hc);mc!==void 0&&(bo[pc]=mc)}return Object.keys(bo).sort((pc,mc)=>{const uf=bo[pc]-bo[mc];return uf!==0?uf:naturalCompare(pc,mc)})}class LexicalDistance{constructor(Ai){this._input=Ai,this._inputLowerCase=Ai.toLowerCase(),this._inputArray=stringToArray(this._inputLowerCase),this._rows=[new Array(Ai.length+1).fill(0),new Array(Ai.length+1).fill(0),new Array(Ai.length+1).fill(0)]}measure(Ai,bo){if(this._input===Ai)return 0;const Ra=Ai.toLowerCase();if(this._inputLowerCase===Ra)return 1;let hc=stringToArray(Ra),pc=this._inputArray;if(hc.length<pc.length){const hf=hc;hc=pc,pc=hf}const mc=hc.length,uf=pc.length;if(mc-uf>bo)return;const df=this._rows;for(let hf=0;hf<=uf;hf++)df[0][hf]=hf;for(let hf=1;hf<=mc;hf++){const pf=df[(hf-1)%3],mf=df[hf%3];let gf=mf[0]=hf;for(let yf=1;yf<=uf;yf++){const vf=hc[hf-1]===pc[yf-1]?0:1;let bf=Math.min(pf[yf]+1,mf[yf-1]+1,pf[yf-1]+vf);if(hf>1&&yf>1&&hc[hf-1]===pc[yf-2]&&hc[hf-2]===pc[yf-1]){const Sf=df[(hf-2)%3][yf-2];bf=Math.min(bf,Sf+1)}bf<gf&&(gf=bf),mf[yf]=bf}if(gf>bo)return}const ff=df[mc%3][uf];return ff<=bo?ff:void 0}}function stringToArray(vo){const Ai=vo.length,bo=new Array(Ai);for(let Ra=0;Ra<Ai;++Ra)bo[Ra]=vo.charCodeAt(Ra);return bo}function toObjMap(vo){if(vo==null)return Object.create(null);if(Object.getPrototypeOf(vo)===null)return vo;const Ai=Object.create(null);for(const[bo,Ra]of Object.entries(vo))Ai[bo]=Ra;return Ai}function printString(vo){return`"${vo.replace(escapedRegExp,escapedReplacer)}"`}const escapedRegExp=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function escapedReplacer(vo){return escapeSequences[vo.charCodeAt(0)]}const escapeSequences=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],BREAK=Object.freeze({});function visit(vo,Ai,bo=QueryDocumentKeys){const Ra=new Map;for(const Sf of Object.values(Kind))Ra.set(Sf,getEnterLeaveForKind(Ai,Sf));let hc,pc=Array.isArray(vo),mc=[vo],uf=-1,df=[],ff=vo,hf,pf;const mf=[],gf=[];do{uf++;const Sf=uf===mc.length,xf=Sf&&df.length!==0;if(Sf){if(hf=gf.length===0?void 0:mf[mf.length-1],ff=pf,pf=gf.pop(),xf)if(pc){ff=ff.slice();let s1=0;for(const[If,l1]of df){const c1=If-s1;l1===null?(ff.splice(c1,1),s1++):ff[c1]=l1}}else{ff=Object.defineProperties({},Object.getOwnPropertyDescriptors(ff));for(const[s1,If]of df)ff[s1]=If}uf=hc.index,mc=hc.keys,df=hc.edits,pc=hc.inArray,hc=hc.prev}else if(pf){if(hf=pc?uf:mc[uf],ff=pf[hf],ff==null)continue;mf.push(hf)}let wf;if(!Array.isArray(ff)){var yf,vf;isNode(ff)||devAssert(!1,`Invalid AST Node: ${inspect(ff)}.`);const s1=Sf?(yf=Ra.get(ff.kind))===null||yf===void 0?void 0:yf.leave:(vf=Ra.get(ff.kind))===null||vf===void 0?void 0:vf.enter;if(wf=s1==null?void 0:s1.call(Ai,ff,hf,pf,mf,gf),wf===BREAK)break;if(wf===!1){if(!Sf){mf.pop();continue}}else if(wf!==void 0&&(df.push([hf,wf]),!Sf))if(isNode(wf))ff=wf;else{mf.pop();continue}}if(wf===void 0&&xf&&df.push([hf,ff]),Sf)mf.pop();else{var bf;hc={inArray:pc,index:uf,keys:mc,edits:df,prev:hc},pc=Array.isArray(ff),mc=pc?ff:(bf=bo[ff.kind])!==null&&bf!==void 0?bf:[],uf=-1,df=[],pf&&gf.push(pf),pf=ff}}while(hc!==void 0);return df.length!==0?df[df.length-1][1]:vo}function visitInParallel(vo){const Ai=new Array(vo.length).fill(null),bo=Object.create(null);for(const Ra of Object.values(Kind)){let hc=!1;const pc=new Array(vo.length).fill(void 0),mc=new Array(vo.length).fill(void 0);for(let df=0;df<vo.length;++df){const{enter:ff,leave:hf}=getEnterLeaveForKind(vo[df],Ra);hc||(hc=ff!=null||hf!=null),pc[df]=ff,mc[df]=hf}if(!hc)continue;const uf={enter(...df){const ff=df[0];for(let pf=0;pf<vo.length;pf++)if(Ai[pf]===null){var hf;const mf=(hf=pc[pf])===null||hf===void 0?void 0:hf.apply(vo[pf],df);if(mf===!1)Ai[pf]=ff;else if(mf===BREAK)Ai[pf]=BREAK;else if(mf!==void 0)return mf}},leave(...df){const ff=df[0];for(let pf=0;pf<vo.length;pf++)if(Ai[pf]===null){var hf;const mf=(hf=mc[pf])===null||hf===void 0?void 0:hf.apply(vo[pf],df);if(mf===BREAK)Ai[pf]=BREAK;else if(mf!==void 0&&mf!==!1)return mf}else Ai[pf]===ff&&(Ai[pf]=null)}};bo[Ra]=uf}return bo}function getEnterLeaveForKind(vo,Ai){const bo=vo[Ai];return typeof bo=="object"?bo:typeof bo=="function"?{enter:bo,leave:void 0}:{enter:vo.enter,leave:vo.leave}}function print(vo){return visit(vo,printDocASTReducer)}const MAX_LINE_LENGTH=80,printDocASTReducer={Name:{leave:vo=>vo.value},Variable:{leave:vo=>"$"+vo.name},Document:{leave:vo=>join(vo.definitions,`
|
|
292
|
-
|
|
293
|
-
`)},OperationDefinition:{leave(vo){const Ai=wrap("(",join(vo.variableDefinitions,", "),")"),bo=join([vo.operation,join([vo.name,Ai]),join(vo.directives," ")]," ");return(bo==="query"?"":bo+" ")+vo.selectionSet}},VariableDefinition:{leave:({variable:vo,type:Ai,defaultValue:bo,directives:Ra})=>vo+": "+Ai+wrap(" = ",bo)+wrap(" ",join(Ra," "))},SelectionSet:{leave:({selections:vo})=>block(vo)},Field:{leave({alias:vo,name:Ai,arguments:bo,directives:Ra,selectionSet:hc}){const pc=wrap("",vo,": ")+Ai;let mc=pc+wrap("(",join(bo,", "),")");return mc.length>MAX_LINE_LENGTH&&(mc=pc+wrap(`(
|
|
294
|
-
`,indent(join(bo,`
|
|
295
|
-
`)),`
|
|
296
|
-
)`)),join([mc,join(Ra," "),hc]," ")}},Argument:{leave:({name:vo,value:Ai})=>vo+": "+Ai},FragmentSpread:{leave:({name:vo,directives:Ai})=>"..."+vo+wrap(" ",join(Ai," "))},InlineFragment:{leave:({typeCondition:vo,directives:Ai,selectionSet:bo})=>join(["...",wrap("on ",vo),join(Ai," "),bo]," ")},FragmentDefinition:{leave:({name:vo,typeCondition:Ai,variableDefinitions:bo,directives:Ra,selectionSet:hc})=>`fragment ${vo}${wrap("(",join(bo,", "),")")} on ${Ai} ${wrap("",join(Ra," ")," ")}`+hc},IntValue:{leave:({value:vo})=>vo},FloatValue:{leave:({value:vo})=>vo},StringValue:{leave:({value:vo,block:Ai})=>Ai?printBlockString(vo):printString(vo)},BooleanValue:{leave:({value:vo})=>vo?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:vo})=>vo},ListValue:{leave:({values:vo})=>"["+join(vo,", ")+"]"},ObjectValue:{leave:({fields:vo})=>"{"+join(vo,", ")+"}"},ObjectField:{leave:({name:vo,value:Ai})=>vo+": "+Ai},Directive:{leave:({name:vo,arguments:Ai})=>"@"+vo+wrap("(",join(Ai,", "),")")},NamedType:{leave:({name:vo})=>vo},ListType:{leave:({type:vo})=>"["+vo+"]"},NonNullType:{leave:({type:vo})=>vo+"!"},SchemaDefinition:{leave:({description:vo,directives:Ai,operationTypes:bo})=>wrap("",vo,`
|
|
297
|
-
`)+join(["schema",join(Ai," "),block(bo)]," ")},OperationTypeDefinition:{leave:({operation:vo,type:Ai})=>vo+": "+Ai},ScalarTypeDefinition:{leave:({description:vo,name:Ai,directives:bo})=>wrap("",vo,`
|
|
298
|
-
`)+join(["scalar",Ai,join(bo," ")]," ")},ObjectTypeDefinition:{leave:({description:vo,name:Ai,interfaces:bo,directives:Ra,fields:hc})=>wrap("",vo,`
|
|
299
|
-
`)+join(["type",Ai,wrap("implements ",join(bo," & ")),join(Ra," "),block(hc)]," ")},FieldDefinition:{leave:({description:vo,name:Ai,arguments:bo,type:Ra,directives:hc})=>wrap("",vo,`
|
|
300
|
-
`)+Ai+(hasMultilineItems(bo)?wrap(`(
|
|
301
|
-
`,indent(join(bo,`
|
|
302
|
-
`)),`
|
|
303
|
-
)`):wrap("(",join(bo,", "),")"))+": "+Ra+wrap(" ",join(hc," "))},InputValueDefinition:{leave:({description:vo,name:Ai,type:bo,defaultValue:Ra,directives:hc})=>wrap("",vo,`
|
|
304
|
-
`)+join([Ai+": "+bo,wrap("= ",Ra),join(hc," ")]," ")},InterfaceTypeDefinition:{leave:({description:vo,name:Ai,interfaces:bo,directives:Ra,fields:hc})=>wrap("",vo,`
|
|
305
|
-
`)+join(["interface",Ai,wrap("implements ",join(bo," & ")),join(Ra," "),block(hc)]," ")},UnionTypeDefinition:{leave:({description:vo,name:Ai,directives:bo,types:Ra})=>wrap("",vo,`
|
|
306
|
-
`)+join(["union",Ai,join(bo," "),wrap("= ",join(Ra," | "))]," ")},EnumTypeDefinition:{leave:({description:vo,name:Ai,directives:bo,values:Ra})=>wrap("",vo,`
|
|
307
|
-
`)+join(["enum",Ai,join(bo," "),block(Ra)]," ")},EnumValueDefinition:{leave:({description:vo,name:Ai,directives:bo})=>wrap("",vo,`
|
|
308
|
-
`)+join([Ai,join(bo," ")]," ")},InputObjectTypeDefinition:{leave:({description:vo,name:Ai,directives:bo,fields:Ra})=>wrap("",vo,`
|
|
309
|
-
`)+join(["input",Ai,join(bo," "),block(Ra)]," ")},DirectiveDefinition:{leave:({description:vo,name:Ai,arguments:bo,repeatable:Ra,locations:hc})=>wrap("",vo,`
|
|
310
|
-
`)+"directive @"+Ai+(hasMultilineItems(bo)?wrap(`(
|
|
311
|
-
`,indent(join(bo,`
|
|
312
|
-
`)),`
|
|
313
|
-
)`):wrap("(",join(bo,", "),")"))+(Ra?" repeatable":"")+" on "+join(hc," | ")},SchemaExtension:{leave:({directives:vo,operationTypes:Ai})=>join(["extend schema",join(vo," "),block(Ai)]," ")},ScalarTypeExtension:{leave:({name:vo,directives:Ai})=>join(["extend scalar",vo,join(Ai," ")]," ")},ObjectTypeExtension:{leave:({name:vo,interfaces:Ai,directives:bo,fields:Ra})=>join(["extend type",vo,wrap("implements ",join(Ai," & ")),join(bo," "),block(Ra)]," ")},InterfaceTypeExtension:{leave:({name:vo,interfaces:Ai,directives:bo,fields:Ra})=>join(["extend interface",vo,wrap("implements ",join(Ai," & ")),join(bo," "),block(Ra)]," ")},UnionTypeExtension:{leave:({name:vo,directives:Ai,types:bo})=>join(["extend union",vo,join(Ai," "),wrap("= ",join(bo," | "))]," ")},EnumTypeExtension:{leave:({name:vo,directives:Ai,values:bo})=>join(["extend enum",vo,join(Ai," "),block(bo)]," ")},InputObjectTypeExtension:{leave:({name:vo,directives:Ai,fields:bo})=>join(["extend input",vo,join(Ai," "),block(bo)]," ")}};function join(vo,Ai=""){var bo;return(bo=vo==null?void 0:vo.filter(Ra=>Ra).join(Ai))!==null&&bo!==void 0?bo:""}function block(vo){return wrap(`{
|
|
314
|
-
`,indent(join(vo,`
|
|
315
|
-
`)),`
|
|
316
|
-
}`)}function wrap(vo,Ai,bo=""){return Ai!=null&&Ai!==""?vo+Ai+bo:""}function indent(vo){return wrap(" ",vo.replace(/\n/g,`
|
|
317
|
-
`))}function hasMultilineItems(vo){var Ai;return(Ai=vo==null?void 0:vo.some(bo=>bo.includes(`
|
|
318
|
-
`)))!==null&&Ai!==void 0?Ai:!1}function valueFromASTUntyped(vo,Ai){switch(vo.kind){case Kind.NULL:return null;case Kind.INT:return parseInt(vo.value,10);case Kind.FLOAT:return parseFloat(vo.value);case Kind.STRING:case Kind.ENUM:case Kind.BOOLEAN:return vo.value;case Kind.LIST:return vo.values.map(bo=>valueFromASTUntyped(bo,Ai));case Kind.OBJECT:return keyValMap(vo.fields,bo=>bo.name.value,bo=>valueFromASTUntyped(bo.value,Ai));case Kind.VARIABLE:return Ai==null?void 0:Ai[vo.name.value]}}function assertName(vo){if(vo!=null||devAssert(!1,"Must provide name."),typeof vo=="string"||devAssert(!1,"Expected name to be a string."),vo.length===0)throw new GraphQLError("Expected name to be a non-empty string.");for(let Ai=1;Ai<vo.length;++Ai)if(!isNameContinue(vo.charCodeAt(Ai)))throw new GraphQLError(`Names must only contain [_a-zA-Z0-9] but "${vo}" does not.`);if(!isNameStart(vo.charCodeAt(0)))throw new GraphQLError(`Names must start with [_a-zA-Z] but "${vo}" does not.`);return vo}function assertEnumValueName(vo){if(vo==="true"||vo==="false"||vo==="null")throw new GraphQLError(`Enum values cannot be named: ${vo}`);return assertName(vo)}function isType(vo){return isScalarType(vo)||isObjectType(vo)||isInterfaceType(vo)||isUnionType(vo)||isEnumType(vo)||isInputObjectType(vo)||isListType(vo)||isNonNullType(vo)}function isScalarType(vo){return instanceOf(vo,GraphQLScalarType)}function isObjectType(vo){return instanceOf(vo,GraphQLObjectType)}function isInterfaceType(vo){return instanceOf(vo,GraphQLInterfaceType)}function isUnionType(vo){return instanceOf(vo,GraphQLUnionType)}function isEnumType(vo){return instanceOf(vo,GraphQLEnumType)}function isInputObjectType(vo){return instanceOf(vo,GraphQLInputObjectType)}function isListType(vo){return instanceOf(vo,GraphQLList)}function isNonNullType(vo){return instanceOf(vo,GraphQLNonNull)}function isInputType(vo){return isScalarType(vo)||isEnumType(vo)||isInputObjectType(vo)||isWrappingType(vo)&&isInputType(vo.ofType)}function isOutputType(vo){return isScalarType(vo)||isObjectType(vo)||isInterfaceType(vo)||isUnionType(vo)||isEnumType(vo)||isWrappingType(vo)&&isOutputType(vo.ofType)}function isLeafType(vo){return isScalarType(vo)||isEnumType(vo)}function isCompositeType(vo){return isObjectType(vo)||isInterfaceType(vo)||isUnionType(vo)}function isAbstractType(vo){return isInterfaceType(vo)||isUnionType(vo)}function assertAbstractType(vo){if(!isAbstractType(vo))throw new Error(`Expected ${inspect(vo)} to be a GraphQL abstract type.`);return vo}class GraphQLList{constructor(Ai){isType(Ai)||devAssert(!1,`Expected ${inspect(Ai)} to be a GraphQL type.`),this.ofType=Ai}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class GraphQLNonNull{constructor(Ai){isNullableType(Ai)||devAssert(!1,`Expected ${inspect(Ai)} to be a GraphQL nullable type.`),this.ofType=Ai}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function isWrappingType(vo){return isListType(vo)||isNonNullType(vo)}function isNullableType(vo){return isType(vo)&&!isNonNullType(vo)}function getNullableType(vo){if(vo)return isNonNullType(vo)?vo.ofType:vo}function isNamedType(vo){return isScalarType(vo)||isObjectType(vo)||isInterfaceType(vo)||isUnionType(vo)||isEnumType(vo)||isInputObjectType(vo)}function getNamedType(vo){if(vo){let Ai=vo;for(;isWrappingType(Ai);)Ai=Ai.ofType;return Ai}}function resolveReadonlyArrayThunk(vo){return typeof vo=="function"?vo():vo}function resolveObjMapThunk(vo){return typeof vo=="function"?vo():vo}class GraphQLScalarType{constructor(Ai){var bo,Ra,hc,pc;const mc=(bo=Ai.parseValue)!==null&&bo!==void 0?bo:identityFunc;this.name=assertName(Ai.name),this.description=Ai.description,this.specifiedByURL=Ai.specifiedByURL,this.serialize=(Ra=Ai.serialize)!==null&&Ra!==void 0?Ra:identityFunc,this.parseValue=mc,this.parseLiteral=(hc=Ai.parseLiteral)!==null&&hc!==void 0?hc:(uf,df)=>mc(valueFromASTUntyped(uf,df)),this.extensions=toObjMap(Ai.extensions),this.astNode=Ai.astNode,this.extensionASTNodes=(pc=Ai.extensionASTNodes)!==null&&pc!==void 0?pc:[],Ai.specifiedByURL==null||typeof Ai.specifiedByURL=="string"||devAssert(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${inspect(Ai.specifiedByURL)}.`),Ai.serialize==null||typeof Ai.serialize=="function"||devAssert(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),Ai.parseLiteral&&(typeof Ai.parseValue=="function"&&typeof Ai.parseLiteral=="function"||devAssert(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLObjectType{constructor(Ai){var bo;this.name=assertName(Ai.name),this.description=Ai.description,this.isTypeOf=Ai.isTypeOf,this.extensions=toObjMap(Ai.extensions),this.astNode=Ai.astNode,this.extensionASTNodes=(bo=Ai.extensionASTNodes)!==null&&bo!==void 0?bo:[],this._fields=()=>defineFieldMap(Ai),this._interfaces=()=>defineInterfaces(Ai),Ai.isTypeOf==null||typeof Ai.isTypeOf=="function"||devAssert(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${inspect(Ai.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:fieldsToFieldsConfig(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function defineInterfaces(vo){var Ai;const bo=resolveReadonlyArrayThunk((Ai=vo.interfaces)!==null&&Ai!==void 0?Ai:[]);return Array.isArray(bo)||devAssert(!1,`${vo.name} interfaces must be an Array or a function which returns an Array.`),bo}function defineFieldMap(vo){const Ai=resolveObjMapThunk(vo.fields);return isPlainObj(Ai)||devAssert(!1,`${vo.name} fields must be an object with field names as keys or a function which returns such an object.`),mapValue(Ai,(bo,Ra)=>{var hc;isPlainObj(bo)||devAssert(!1,`${vo.name}.${Ra} field config must be an object.`),bo.resolve==null||typeof bo.resolve=="function"||devAssert(!1,`${vo.name}.${Ra} field resolver must be a function if provided, but got: ${inspect(bo.resolve)}.`);const pc=(hc=bo.args)!==null&&hc!==void 0?hc:{};return isPlainObj(pc)||devAssert(!1,`${vo.name}.${Ra} args must be an object with argument names as keys.`),{name:assertName(Ra),description:bo.description,type:bo.type,args:defineArguments(pc),resolve:bo.resolve,subscribe:bo.subscribe,deprecationReason:bo.deprecationReason,extensions:toObjMap(bo.extensions),astNode:bo.astNode}})}function defineArguments(vo){return Object.entries(vo).map(([Ai,bo])=>({name:assertName(Ai),description:bo.description,type:bo.type,defaultValue:bo.defaultValue,deprecationReason:bo.deprecationReason,extensions:toObjMap(bo.extensions),astNode:bo.astNode}))}function isPlainObj(vo){return isObjectLike(vo)&&!Array.isArray(vo)}function fieldsToFieldsConfig(vo){return mapValue(vo,Ai=>({description:Ai.description,type:Ai.type,args:argsToArgsConfig(Ai.args),resolve:Ai.resolve,subscribe:Ai.subscribe,deprecationReason:Ai.deprecationReason,extensions:Ai.extensions,astNode:Ai.astNode}))}function argsToArgsConfig(vo){return keyValMap(vo,Ai=>Ai.name,Ai=>({description:Ai.description,type:Ai.type,defaultValue:Ai.defaultValue,deprecationReason:Ai.deprecationReason,extensions:Ai.extensions,astNode:Ai.astNode}))}function isRequiredArgument(vo){return isNonNullType(vo.type)&&vo.defaultValue===void 0}class GraphQLInterfaceType{constructor(Ai){var bo;this.name=assertName(Ai.name),this.description=Ai.description,this.resolveType=Ai.resolveType,this.extensions=toObjMap(Ai.extensions),this.astNode=Ai.astNode,this.extensionASTNodes=(bo=Ai.extensionASTNodes)!==null&&bo!==void 0?bo:[],this._fields=defineFieldMap.bind(void 0,Ai),this._interfaces=defineInterfaces.bind(void 0,Ai),Ai.resolveType==null||typeof Ai.resolveType=="function"||devAssert(!1,`${this.name} must provide "resolveType" as a function, but got: ${inspect(Ai.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:fieldsToFieldsConfig(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLUnionType{constructor(Ai){var bo;this.name=assertName(Ai.name),this.description=Ai.description,this.resolveType=Ai.resolveType,this.extensions=toObjMap(Ai.extensions),this.astNode=Ai.astNode,this.extensionASTNodes=(bo=Ai.extensionASTNodes)!==null&&bo!==void 0?bo:[],this._types=defineTypes.bind(void 0,Ai),Ai.resolveType==null||typeof Ai.resolveType=="function"||devAssert(!1,`${this.name} must provide "resolveType" as a function, but got: ${inspect(Ai.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function defineTypes(vo){const Ai=resolveReadonlyArrayThunk(vo.types);return Array.isArray(Ai)||devAssert(!1,`Must provide Array of types or a function which returns such an array for Union ${vo.name}.`),Ai}class GraphQLEnumType{constructor(Ai){var bo;this.name=assertName(Ai.name),this.description=Ai.description,this.extensions=toObjMap(Ai.extensions),this.astNode=Ai.astNode,this.extensionASTNodes=(bo=Ai.extensionASTNodes)!==null&&bo!==void 0?bo:[],this._values=typeof Ai.values=="function"?Ai.values:defineEnumValues(this.name,Ai.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=defineEnumValues(this.name,this._values())),this._values}getValue(Ai){return this._nameLookup===null&&(this._nameLookup=keyMap(this.getValues(),bo=>bo.name)),this._nameLookup[Ai]}serialize(Ai){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(Ra=>[Ra.value,Ra])));const bo=this._valueLookup.get(Ai);if(bo===void 0)throw new GraphQLError(`Enum "${this.name}" cannot represent value: ${inspect(Ai)}`);return bo.name}parseValue(Ai){if(typeof Ai!="string"){const Ra=inspect(Ai);throw new GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${Ra}.`+didYouMeanEnumValue(this,Ra))}const bo=this.getValue(Ai);if(bo==null)throw new GraphQLError(`Value "${Ai}" does not exist in "${this.name}" enum.`+didYouMeanEnumValue(this,Ai));return bo.value}parseLiteral(Ai,bo){if(Ai.kind!==Kind.ENUM){const hc=print(Ai);throw new GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${hc}.`+didYouMeanEnumValue(this,hc),{nodes:Ai})}const Ra=this.getValue(Ai.value);if(Ra==null){const hc=print(Ai);throw new GraphQLError(`Value "${hc}" does not exist in "${this.name}" enum.`+didYouMeanEnumValue(this,hc),{nodes:Ai})}return Ra.value}toConfig(){const Ai=keyValMap(this.getValues(),bo=>bo.name,bo=>({description:bo.description,value:bo.value,deprecationReason:bo.deprecationReason,extensions:bo.extensions,astNode:bo.astNode}));return{name:this.name,description:this.description,values:Ai,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function didYouMeanEnumValue(vo,Ai){const bo=vo.getValues().map(hc=>hc.name),Ra=suggestionList(Ai,bo);return didYouMean("the enum value",Ra)}function defineEnumValues(vo,Ai){return isPlainObj(Ai)||devAssert(!1,`${vo} values must be an object with value names as keys.`),Object.entries(Ai).map(([bo,Ra])=>(isPlainObj(Ra)||devAssert(!1,`${vo}.${bo} must refer to an object with a "value" key representing an internal value but got: ${inspect(Ra)}.`),{name:assertEnumValueName(bo),description:Ra.description,value:Ra.value!==void 0?Ra.value:bo,deprecationReason:Ra.deprecationReason,extensions:toObjMap(Ra.extensions),astNode:Ra.astNode}))}class GraphQLInputObjectType{constructor(Ai){var bo,Ra;this.name=assertName(Ai.name),this.description=Ai.description,this.extensions=toObjMap(Ai.extensions),this.astNode=Ai.astNode,this.extensionASTNodes=(bo=Ai.extensionASTNodes)!==null&&bo!==void 0?bo:[],this.isOneOf=(Ra=Ai.isOneOf)!==null&&Ra!==void 0?Ra:!1,this._fields=defineInputFieldMap.bind(void 0,Ai)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){const Ai=mapValue(this.getFields(),bo=>({description:bo.description,type:bo.type,defaultValue:bo.defaultValue,deprecationReason:bo.deprecationReason,extensions:bo.extensions,astNode:bo.astNode}));return{name:this.name,description:this.description,fields:Ai,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function defineInputFieldMap(vo){const Ai=resolveObjMapThunk(vo.fields);return isPlainObj(Ai)||devAssert(!1,`${vo.name} fields must be an object with field names as keys or a function which returns such an object.`),mapValue(Ai,(bo,Ra)=>(!("resolve"in bo)||devAssert(!1,`${vo.name}.${Ra} field has a resolve property, but Input Types cannot define resolvers.`),{name:assertName(Ra),description:bo.description,type:bo.type,defaultValue:bo.defaultValue,deprecationReason:bo.deprecationReason,extensions:toObjMap(bo.extensions),astNode:bo.astNode}))}function isRequiredInputField(vo){return isNonNullType(vo.type)&&vo.defaultValue===void 0}function isEqualType(vo,Ai){return vo===Ai?!0:isNonNullType(vo)&&isNonNullType(Ai)||isListType(vo)&&isListType(Ai)?isEqualType(vo.ofType,Ai.ofType):!1}function isTypeSubTypeOf(vo,Ai,bo){return Ai===bo?!0:isNonNullType(bo)?isNonNullType(Ai)?isTypeSubTypeOf(vo,Ai.ofType,bo.ofType):!1:isNonNullType(Ai)?isTypeSubTypeOf(vo,Ai.ofType,bo):isListType(bo)?isListType(Ai)?isTypeSubTypeOf(vo,Ai.ofType,bo.ofType):!1:isListType(Ai)?!1:isAbstractType(bo)&&(isInterfaceType(Ai)||isObjectType(Ai))&&vo.isSubType(bo,Ai)}function doTypesOverlap(vo,Ai,bo){return Ai===bo?!0:isAbstractType(Ai)?isAbstractType(bo)?vo.getPossibleTypes(Ai).some(Ra=>vo.isSubType(bo,Ra)):vo.isSubType(Ai,bo):isAbstractType(bo)?vo.isSubType(bo,Ai):!1}const GRAPHQL_MAX_INT=2147483647,GRAPHQL_MIN_INT=-2147483648,GraphQLInt=new GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(vo){const Ai=serializeObject(vo);if(typeof Ai=="boolean")return Ai?1:0;let bo=Ai;if(typeof Ai=="string"&&Ai!==""&&(bo=Number(Ai)),typeof bo!="number"||!Number.isInteger(bo))throw new GraphQLError(`Int cannot represent non-integer value: ${inspect(Ai)}`);if(bo>GRAPHQL_MAX_INT||bo<GRAPHQL_MIN_INT)throw new GraphQLError("Int cannot represent non 32-bit signed integer value: "+inspect(Ai));return bo},parseValue(vo){if(typeof vo!="number"||!Number.isInteger(vo))throw new GraphQLError(`Int cannot represent non-integer value: ${inspect(vo)}`);if(vo>GRAPHQL_MAX_INT||vo<GRAPHQL_MIN_INT)throw new GraphQLError(`Int cannot represent non 32-bit signed integer value: ${vo}`);return vo},parseLiteral(vo){if(vo.kind!==Kind.INT)throw new GraphQLError(`Int cannot represent non-integer value: ${print(vo)}`,{nodes:vo});const Ai=parseInt(vo.value,10);if(Ai>GRAPHQL_MAX_INT||Ai<GRAPHQL_MIN_INT)throw new GraphQLError(`Int cannot represent non 32-bit signed integer value: ${vo.value}`,{nodes:vo});return Ai}}),GraphQLFloat=new GraphQLScalarType({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(vo){const Ai=serializeObject(vo);if(typeof Ai=="boolean")return Ai?1:0;let bo=Ai;if(typeof Ai=="string"&&Ai!==""&&(bo=Number(Ai)),typeof bo!="number"||!Number.isFinite(bo))throw new GraphQLError(`Float cannot represent non numeric value: ${inspect(Ai)}`);return bo},parseValue(vo){if(typeof vo!="number"||!Number.isFinite(vo))throw new GraphQLError(`Float cannot represent non numeric value: ${inspect(vo)}`);return vo},parseLiteral(vo){if(vo.kind!==Kind.FLOAT&&vo.kind!==Kind.INT)throw new GraphQLError(`Float cannot represent non numeric value: ${print(vo)}`,vo);return parseFloat(vo.value)}}),GraphQLString=new GraphQLScalarType({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(vo){const Ai=serializeObject(vo);if(typeof Ai=="string")return Ai;if(typeof Ai=="boolean")return Ai?"true":"false";if(typeof Ai=="number"&&Number.isFinite(Ai))return Ai.toString();throw new GraphQLError(`String cannot represent value: ${inspect(vo)}`)},parseValue(vo){if(typeof vo!="string")throw new GraphQLError(`String cannot represent a non string value: ${inspect(vo)}`);return vo},parseLiteral(vo){if(vo.kind!==Kind.STRING)throw new GraphQLError(`String cannot represent a non string value: ${print(vo)}`,{nodes:vo});return vo.value}}),GraphQLBoolean=new GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(vo){const Ai=serializeObject(vo);if(typeof Ai=="boolean")return Ai;if(Number.isFinite(Ai))return Ai!==0;throw new GraphQLError(`Boolean cannot represent a non boolean value: ${inspect(Ai)}`)},parseValue(vo){if(typeof vo!="boolean")throw new GraphQLError(`Boolean cannot represent a non boolean value: ${inspect(vo)}`);return vo},parseLiteral(vo){if(vo.kind!==Kind.BOOLEAN)throw new GraphQLError(`Boolean cannot represent a non boolean value: ${print(vo)}`,{nodes:vo});return vo.value}}),GraphQLID=new GraphQLScalarType({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(vo){const Ai=serializeObject(vo);if(typeof Ai=="string")return Ai;if(Number.isInteger(Ai))return String(Ai);throw new GraphQLError(`ID cannot represent value: ${inspect(vo)}`)},parseValue(vo){if(typeof vo=="string")return vo;if(typeof vo=="number"&&Number.isInteger(vo))return vo.toString();throw new GraphQLError(`ID cannot represent value: ${inspect(vo)}`)},parseLiteral(vo){if(vo.kind!==Kind.STRING&&vo.kind!==Kind.INT)throw new GraphQLError("ID cannot represent a non-string and non-integer value: "+print(vo),{nodes:vo});return vo.value}}),specifiedScalarTypes=Object.freeze([GraphQLString,GraphQLInt,GraphQLFloat,GraphQLBoolean,GraphQLID]);function isSpecifiedScalarType(vo){return specifiedScalarTypes.some(({name:Ai})=>vo.name===Ai)}function serializeObject(vo){if(isObjectLike(vo)){if(typeof vo.valueOf=="function"){const Ai=vo.valueOf();if(!isObjectLike(Ai))return Ai}if(typeof vo.toJSON=="function")return vo.toJSON()}return vo}function isDirective(vo){return instanceOf(vo,GraphQLDirective)}class GraphQLDirective{constructor(Ai){var bo,Ra;this.name=assertName(Ai.name),this.description=Ai.description,this.locations=Ai.locations,this.isRepeatable=(bo=Ai.isRepeatable)!==null&&bo!==void 0?bo:!1,this.extensions=toObjMap(Ai.extensions),this.astNode=Ai.astNode,Array.isArray(Ai.locations)||devAssert(!1,`@${Ai.name} locations must be an Array.`);const hc=(Ra=Ai.args)!==null&&Ra!==void 0?Ra:{};isObjectLike(hc)&&!Array.isArray(hc)||devAssert(!1,`@${Ai.name} args must be an object with argument names as keys.`),this.args=defineArguments(hc)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:argsToArgsConfig(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const GraphQLIncludeDirective=new GraphQLDirective({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[DirectiveLocation.FIELD,DirectiveLocation.FRAGMENT_SPREAD,DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(GraphQLBoolean),description:"Included when true."}}}),GraphQLSkipDirective=new GraphQLDirective({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[DirectiveLocation.FIELD,DirectiveLocation.FRAGMENT_SPREAD,DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(GraphQLBoolean),description:"Skipped when true."}}}),DEFAULT_DEPRECATION_REASON="No longer supported",GraphQLDeprecatedDirective=new GraphQLDirective({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[DirectiveLocation.FIELD_DEFINITION,DirectiveLocation.ARGUMENT_DEFINITION,DirectiveLocation.INPUT_FIELD_DEFINITION,DirectiveLocation.ENUM_VALUE],args:{reason:{type:GraphQLString,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:DEFAULT_DEPRECATION_REASON}}}),GraphQLSpecifiedByDirective=new GraphQLDirective({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[DirectiveLocation.SCALAR],args:{url:{type:new GraphQLNonNull(GraphQLString),description:"The URL that specifies the behavior of this scalar."}}}),GraphQLOneOfDirective=new GraphQLDirective({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[DirectiveLocation.INPUT_OBJECT],args:{}}),specifiedDirectives=Object.freeze([GraphQLIncludeDirective,GraphQLSkipDirective,GraphQLDeprecatedDirective,GraphQLSpecifiedByDirective,GraphQLOneOfDirective]);function isSpecifiedDirective(vo){return specifiedDirectives.some(({name:Ai})=>Ai===vo.name)}function isIterableObject(vo){return typeof vo=="object"&&typeof(vo==null?void 0:vo[Symbol.iterator])=="function"}function astFromValue(vo,Ai){if(isNonNullType(Ai)){const bo=astFromValue(vo,Ai.ofType);return(bo==null?void 0:bo.kind)===Kind.NULL?null:bo}if(vo===null)return{kind:Kind.NULL};if(vo===void 0)return null;if(isListType(Ai)){const bo=Ai.ofType;if(isIterableObject(vo)){const Ra=[];for(const hc of vo){const pc=astFromValue(hc,bo);pc!=null&&Ra.push(pc)}return{kind:Kind.LIST,values:Ra}}return astFromValue(vo,bo)}if(isInputObjectType(Ai)){if(!isObjectLike(vo))return null;const bo=[];for(const Ra of Object.values(Ai.getFields())){const hc=astFromValue(vo[Ra.name],Ra.type);hc&&bo.push({kind:Kind.OBJECT_FIELD,name:{kind:Kind.NAME,value:Ra.name},value:hc})}return{kind:Kind.OBJECT,fields:bo}}if(isLeafType(Ai)){const bo=Ai.serialize(vo);if(bo==null)return null;if(typeof bo=="boolean")return{kind:Kind.BOOLEAN,value:bo};if(typeof bo=="number"&&Number.isFinite(bo)){const Ra=String(bo);return integerStringRegExp.test(Ra)?{kind:Kind.INT,value:Ra}:{kind:Kind.FLOAT,value:Ra}}if(typeof bo=="string")return isEnumType(Ai)?{kind:Kind.ENUM,value:bo}:Ai===GraphQLID&&integerStringRegExp.test(bo)?{kind:Kind.INT,value:bo}:{kind:Kind.STRING,value:bo};throw new TypeError(`Cannot convert value to AST: ${inspect(bo)}.`)}invariant$1(!1,"Unexpected input type: "+inspect(Ai))}const integerStringRegExp=/^-?(?:0|[1-9][0-9]*)$/,__Schema=new GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:GraphQLString,resolve:vo=>vo.description},types:{description:"A list of all types supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Type))),resolve(vo){return Object.values(vo.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new GraphQLNonNull(__Type),resolve:vo=>vo.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:__Type,resolve:vo=>vo.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:__Type,resolve:vo=>vo.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Directive))),resolve:vo=>vo.getDirectives()}})}),__Directive=new GraphQLObjectType({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
319
|
-
|
|
320
|
-
In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new GraphQLNonNull(GraphQLString),resolve:vo=>vo.name},description:{type:GraphQLString,resolve:vo=>vo.description},isRepeatable:{type:new GraphQLNonNull(GraphQLBoolean),resolve:vo=>vo.isRepeatable},locations:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__DirectiveLocation))),resolve:vo=>vo.locations},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))),args:{includeDeprecated:{type:GraphQLBoolean,defaultValue:!1}},resolve(vo,{includeDeprecated:Ai}){return Ai?vo.args:vo.args.filter(bo=>bo.deprecationReason==null)}}})}),__DirectiveLocation=new GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),__Type=new GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new GraphQLNonNull(__TypeKind),resolve(vo){if(isScalarType(vo))return TypeKind.SCALAR;if(isObjectType(vo))return TypeKind.OBJECT;if(isInterfaceType(vo))return TypeKind.INTERFACE;if(isUnionType(vo))return TypeKind.UNION;if(isEnumType(vo))return TypeKind.ENUM;if(isInputObjectType(vo))return TypeKind.INPUT_OBJECT;if(isListType(vo))return TypeKind.LIST;if(isNonNullType(vo))return TypeKind.NON_NULL;invariant$1(!1,`Unexpected type: "${inspect(vo)}".`)}},name:{type:GraphQLString,resolve:vo=>"name"in vo?vo.name:void 0},description:{type:GraphQLString,resolve:vo=>"description"in vo?vo.description:void 0},specifiedByURL:{type:GraphQLString,resolve:vo=>"specifiedByURL"in vo?vo.specifiedByURL:void 0},fields:{type:new GraphQLList(new GraphQLNonNull(__Field)),args:{includeDeprecated:{type:GraphQLBoolean,defaultValue:!1}},resolve(vo,{includeDeprecated:Ai}){if(isObjectType(vo)||isInterfaceType(vo)){const bo=Object.values(vo.getFields());return Ai?bo:bo.filter(Ra=>Ra.deprecationReason==null)}}},interfaces:{type:new GraphQLList(new GraphQLNonNull(__Type)),resolve(vo){if(isObjectType(vo)||isInterfaceType(vo))return vo.getInterfaces()}},possibleTypes:{type:new GraphQLList(new GraphQLNonNull(__Type)),resolve(vo,Ai,bo,{schema:Ra}){if(isAbstractType(vo))return Ra.getPossibleTypes(vo)}},enumValues:{type:new GraphQLList(new GraphQLNonNull(__EnumValue)),args:{includeDeprecated:{type:GraphQLBoolean,defaultValue:!1}},resolve(vo,{includeDeprecated:Ai}){if(isEnumType(vo)){const bo=vo.getValues();return Ai?bo:bo.filter(Ra=>Ra.deprecationReason==null)}}},inputFields:{type:new GraphQLList(new GraphQLNonNull(__InputValue)),args:{includeDeprecated:{type:GraphQLBoolean,defaultValue:!1}},resolve(vo,{includeDeprecated:Ai}){if(isInputObjectType(vo)){const bo=Object.values(vo.getFields());return Ai?bo:bo.filter(Ra=>Ra.deprecationReason==null)}}},ofType:{type:__Type,resolve:vo=>"ofType"in vo?vo.ofType:void 0},isOneOf:{type:GraphQLBoolean,resolve:vo=>{if(isInputObjectType(vo))return vo.isOneOf}}})}),__Field=new GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new GraphQLNonNull(GraphQLString),resolve:vo=>vo.name},description:{type:GraphQLString,resolve:vo=>vo.description},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))),args:{includeDeprecated:{type:GraphQLBoolean,defaultValue:!1}},resolve(vo,{includeDeprecated:Ai}){return Ai?vo.args:vo.args.filter(bo=>bo.deprecationReason==null)}},type:{type:new GraphQLNonNull(__Type),resolve:vo=>vo.type},isDeprecated:{type:new GraphQLNonNull(GraphQLBoolean),resolve:vo=>vo.deprecationReason!=null},deprecationReason:{type:GraphQLString,resolve:vo=>vo.deprecationReason}})}),__InputValue=new GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new GraphQLNonNull(GraphQLString),resolve:vo=>vo.name},description:{type:GraphQLString,resolve:vo=>vo.description},type:{type:new GraphQLNonNull(__Type),resolve:vo=>vo.type},defaultValue:{type:GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(vo){const{type:Ai,defaultValue:bo}=vo,Ra=astFromValue(bo,Ai);return Ra?print(Ra):null}},isDeprecated:{type:new GraphQLNonNull(GraphQLBoolean),resolve:vo=>vo.deprecationReason!=null},deprecationReason:{type:GraphQLString,resolve:vo=>vo.deprecationReason}})}),__EnumValue=new GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new GraphQLNonNull(GraphQLString),resolve:vo=>vo.name},description:{type:GraphQLString,resolve:vo=>vo.description},isDeprecated:{type:new GraphQLNonNull(GraphQLBoolean),resolve:vo=>vo.deprecationReason!=null},deprecationReason:{type:GraphQLString,resolve:vo=>vo.deprecationReason}})});var TypeKind;(function(vo){vo.SCALAR="SCALAR",vo.OBJECT="OBJECT",vo.INTERFACE="INTERFACE",vo.UNION="UNION",vo.ENUM="ENUM",vo.INPUT_OBJECT="INPUT_OBJECT",vo.LIST="LIST",vo.NON_NULL="NON_NULL"})(TypeKind||(TypeKind={}));const __TypeKind=new GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:TypeKind.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:TypeKind.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:TypeKind.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:TypeKind.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:TypeKind.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:TypeKind.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:TypeKind.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:TypeKind.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),SchemaMetaFieldDef={name:"__schema",type:new GraphQLNonNull(__Schema),description:"Access the current type schema of this server.",args:[],resolve:(vo,Ai,bo,{schema:Ra})=>Ra,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},TypeMetaFieldDef={name:"__type",type:__Type,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new GraphQLNonNull(GraphQLString),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(vo,{name:Ai},bo,{schema:Ra})=>Ra.getType(Ai),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},TypeNameMetaFieldDef={name:"__typename",type:new GraphQLNonNull(GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:(vo,Ai,bo,{parentType:Ra})=>Ra.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},introspectionTypes=Object.freeze([__Schema,__Directive,__DirectiveLocation,__Type,__Field,__InputValue,__EnumValue,__TypeKind]);function isIntrospectionType(vo){return introspectionTypes.some(({name:Ai})=>vo.name===Ai)}function isSchema(vo){return instanceOf(vo,GraphQLSchema)}function assertSchema(vo){if(!isSchema(vo))throw new Error(`Expected ${inspect(vo)} to be a GraphQL schema.`);return vo}class GraphQLSchema{constructor(Ai){var bo,Ra;this.__validationErrors=Ai.assumeValid===!0?[]:void 0,isObjectLike(Ai)||devAssert(!1,"Must provide configuration object."),!Ai.types||Array.isArray(Ai.types)||devAssert(!1,`"types" must be Array if provided but got: ${inspect(Ai.types)}.`),!Ai.directives||Array.isArray(Ai.directives)||devAssert(!1,`"directives" must be Array if provided but got: ${inspect(Ai.directives)}.`),this.description=Ai.description,this.extensions=toObjMap(Ai.extensions),this.astNode=Ai.astNode,this.extensionASTNodes=(bo=Ai.extensionASTNodes)!==null&&bo!==void 0?bo:[],this._queryType=Ai.query,this._mutationType=Ai.mutation,this._subscriptionType=Ai.subscription,this._directives=(Ra=Ai.directives)!==null&&Ra!==void 0?Ra:specifiedDirectives;const hc=new Set(Ai.types);if(Ai.types!=null)for(const pc of Ai.types)hc.delete(pc),collectReferencedTypes(pc,hc);this._queryType!=null&&collectReferencedTypes(this._queryType,hc),this._mutationType!=null&&collectReferencedTypes(this._mutationType,hc),this._subscriptionType!=null&&collectReferencedTypes(this._subscriptionType,hc);for(const pc of this._directives)if(isDirective(pc))for(const mc of pc.args)collectReferencedTypes(mc.type,hc);collectReferencedTypes(__Schema,hc),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const pc of hc){if(pc==null)continue;const mc=pc.name;if(mc||devAssert(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[mc]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${mc}".`);if(this._typeMap[mc]=pc,isInterfaceType(pc)){for(const uf of pc.getInterfaces())if(isInterfaceType(uf)){let df=this._implementationsMap[uf.name];df===void 0&&(df=this._implementationsMap[uf.name]={objects:[],interfaces:[]}),df.interfaces.push(pc)}}else if(isObjectType(pc)){for(const uf of pc.getInterfaces())if(isInterfaceType(uf)){let df=this._implementationsMap[uf.name];df===void 0&&(df=this._implementationsMap[uf.name]={objects:[],interfaces:[]}),df.objects.push(pc)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(Ai){switch(Ai){case OperationTypeNode.QUERY:return this.getQueryType();case OperationTypeNode.MUTATION:return this.getMutationType();case OperationTypeNode.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(Ai){return this.getTypeMap()[Ai]}getPossibleTypes(Ai){return isUnionType(Ai)?Ai.getTypes():this.getImplementations(Ai).objects}getImplementations(Ai){return this._implementationsMap[Ai.name]??{objects:[],interfaces:[]}}isSubType(Ai,bo){let Ra=this._subTypeMap[Ai.name];if(Ra===void 0){if(Ra=Object.create(null),isUnionType(Ai))for(const hc of Ai.getTypes())Ra[hc.name]=!0;else{const hc=this.getImplementations(Ai);for(const pc of hc.objects)Ra[pc.name]=!0;for(const pc of hc.interfaces)Ra[pc.name]=!0}this._subTypeMap[Ai.name]=Ra}return Ra[bo.name]!==void 0}getDirectives(){return this._directives}getDirective(Ai){return this.getDirectives().find(bo=>bo.name===Ai)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}function collectReferencedTypes(vo,Ai){const bo=getNamedType(vo);if(!Ai.has(bo)){if(Ai.add(bo),isUnionType(bo))for(const Ra of bo.getTypes())collectReferencedTypes(Ra,Ai);else if(isObjectType(bo)||isInterfaceType(bo)){for(const Ra of bo.getInterfaces())collectReferencedTypes(Ra,Ai);for(const Ra of Object.values(bo.getFields())){collectReferencedTypes(Ra.type,Ai);for(const hc of Ra.args)collectReferencedTypes(hc.type,Ai)}}else if(isInputObjectType(bo))for(const Ra of Object.values(bo.getFields()))collectReferencedTypes(Ra.type,Ai)}return Ai}function validateSchema(vo){if(assertSchema(vo),vo.__validationErrors)return vo.__validationErrors;const Ai=new SchemaValidationContext(vo);validateRootTypes(Ai),validateDirectives(Ai),validateTypes(Ai);const bo=Ai.getErrors();return vo.__validationErrors=bo,bo}function assertValidSchema(vo){const Ai=validateSchema(vo);if(Ai.length!==0)throw new Error(Ai.map(bo=>bo.message).join(`
|
|
321
|
-
|
|
322
|
-
`))}class SchemaValidationContext{constructor(Ai){this._errors=[],this.schema=Ai}reportError(Ai,bo){const Ra=Array.isArray(bo)?bo.filter(Boolean):bo;this._errors.push(new GraphQLError(Ai,{nodes:Ra}))}getErrors(){return this._errors}}function validateRootTypes(vo){const Ai=vo.schema,bo=Ai.getQueryType();if(!bo)vo.reportError("Query root type must be provided.",Ai.astNode);else if(!isObjectType(bo)){var Ra;vo.reportError(`Query root type must be Object type, it cannot be ${inspect(bo)}.`,(Ra=getOperationTypeNode(Ai,OperationTypeNode.QUERY))!==null&&Ra!==void 0?Ra:bo.astNode)}const hc=Ai.getMutationType();if(hc&&!isObjectType(hc)){var pc;vo.reportError(`Mutation root type must be Object type if provided, it cannot be ${inspect(hc)}.`,(pc=getOperationTypeNode(Ai,OperationTypeNode.MUTATION))!==null&&pc!==void 0?pc:hc.astNode)}const mc=Ai.getSubscriptionType();if(mc&&!isObjectType(mc)){var uf;vo.reportError(`Subscription root type must be Object type if provided, it cannot be ${inspect(mc)}.`,(uf=getOperationTypeNode(Ai,OperationTypeNode.SUBSCRIPTION))!==null&&uf!==void 0?uf:mc.astNode)}}function getOperationTypeNode(vo,Ai){var bo;return(bo=[vo.astNode,...vo.extensionASTNodes].flatMap(Ra=>{var hc;return(hc=Ra==null?void 0:Ra.operationTypes)!==null&&hc!==void 0?hc:[]}).find(Ra=>Ra.operation===Ai))===null||bo===void 0?void 0:bo.type}function validateDirectives(vo){for(const bo of vo.schema.getDirectives()){if(!isDirective(bo)){vo.reportError(`Expected directive but got: ${inspect(bo)}.`,bo==null?void 0:bo.astNode);continue}validateName(vo,bo),bo.locations.length===0&&vo.reportError(`Directive @${bo.name} must include 1 or more locations.`,bo.astNode);for(const Ra of bo.args)if(validateName(vo,Ra),isInputType(Ra.type)||vo.reportError(`The type of @${bo.name}(${Ra.name}:) must be Input Type but got: ${inspect(Ra.type)}.`,Ra.astNode),isRequiredArgument(Ra)&&Ra.deprecationReason!=null){var Ai;vo.reportError(`Required argument @${bo.name}(${Ra.name}:) cannot be deprecated.`,[getDeprecatedDirectiveNode(Ra.astNode),(Ai=Ra.astNode)===null||Ai===void 0?void 0:Ai.type])}}}function validateName(vo,Ai){Ai.name.startsWith("__")&&vo.reportError(`Name "${Ai.name}" must not begin with "__", which is reserved by GraphQL introspection.`,Ai.astNode)}function validateTypes(vo){const Ai=createInputObjectCircularRefsValidator(vo),bo=vo.schema.getTypeMap();for(const Ra of Object.values(bo)){if(!isNamedType(Ra)){vo.reportError(`Expected GraphQL named type but got: ${inspect(Ra)}.`,Ra.astNode);continue}isIntrospectionType(Ra)||validateName(vo,Ra),isObjectType(Ra)||isInterfaceType(Ra)?(validateFields(vo,Ra),validateInterfaces(vo,Ra)):isUnionType(Ra)?validateUnionMembers(vo,Ra):isEnumType(Ra)?validateEnumValues(vo,Ra):isInputObjectType(Ra)&&(validateInputFields(vo,Ra),Ai(Ra))}}function validateFields(vo,Ai){const bo=Object.values(Ai.getFields());bo.length===0&&vo.reportError(`Type ${Ai.name} must define one or more fields.`,[Ai.astNode,...Ai.extensionASTNodes]);for(const mc of bo){if(validateName(vo,mc),!isOutputType(mc.type)){var Ra;vo.reportError(`The type of ${Ai.name}.${mc.name} must be Output Type but got: ${inspect(mc.type)}.`,(Ra=mc.astNode)===null||Ra===void 0?void 0:Ra.type)}for(const uf of mc.args){const df=uf.name;if(validateName(vo,uf),!isInputType(uf.type)){var hc;vo.reportError(`The type of ${Ai.name}.${mc.name}(${df}:) must be Input Type but got: ${inspect(uf.type)}.`,(hc=uf.astNode)===null||hc===void 0?void 0:hc.type)}if(isRequiredArgument(uf)&&uf.deprecationReason!=null){var pc;vo.reportError(`Required argument ${Ai.name}.${mc.name}(${df}:) cannot be deprecated.`,[getDeprecatedDirectiveNode(uf.astNode),(pc=uf.astNode)===null||pc===void 0?void 0:pc.type])}}}}function validateInterfaces(vo,Ai){const bo=Object.create(null);for(const Ra of Ai.getInterfaces()){if(!isInterfaceType(Ra)){vo.reportError(`Type ${inspect(Ai)} must only implement Interface types, it cannot implement ${inspect(Ra)}.`,getAllImplementsInterfaceNodes(Ai,Ra));continue}if(Ai===Ra){vo.reportError(`Type ${Ai.name} cannot implement itself because it would create a circular reference.`,getAllImplementsInterfaceNodes(Ai,Ra));continue}if(bo[Ra.name]){vo.reportError(`Type ${Ai.name} can only implement ${Ra.name} once.`,getAllImplementsInterfaceNodes(Ai,Ra));continue}bo[Ra.name]=!0,validateTypeImplementsAncestors(vo,Ai,Ra),validateTypeImplementsInterface(vo,Ai,Ra)}}function validateTypeImplementsInterface(vo,Ai,bo){const Ra=Ai.getFields();for(const df of Object.values(bo.getFields())){const ff=df.name,hf=Ra[ff];if(!hf){vo.reportError(`Interface field ${bo.name}.${ff} expected but ${Ai.name} does not provide it.`,[df.astNode,Ai.astNode,...Ai.extensionASTNodes]);continue}if(!isTypeSubTypeOf(vo.schema,hf.type,df.type)){var hc,pc;vo.reportError(`Interface field ${bo.name}.${ff} expects type ${inspect(df.type)} but ${Ai.name}.${ff} is type ${inspect(hf.type)}.`,[(hc=df.astNode)===null||hc===void 0?void 0:hc.type,(pc=hf.astNode)===null||pc===void 0?void 0:pc.type])}for(const pf of df.args){const mf=pf.name,gf=hf.args.find(yf=>yf.name===mf);if(!gf){vo.reportError(`Interface field argument ${bo.name}.${ff}(${mf}:) expected but ${Ai.name}.${ff} does not provide it.`,[pf.astNode,hf.astNode]);continue}if(!isEqualType(pf.type,gf.type)){var mc,uf;vo.reportError(`Interface field argument ${bo.name}.${ff}(${mf}:) expects type ${inspect(pf.type)} but ${Ai.name}.${ff}(${mf}:) is type ${inspect(gf.type)}.`,[(mc=pf.astNode)===null||mc===void 0?void 0:mc.type,(uf=gf.astNode)===null||uf===void 0?void 0:uf.type])}}for(const pf of hf.args){const mf=pf.name;!df.args.find(gf=>gf.name===mf)&&isRequiredArgument(pf)&&vo.reportError(`Object field ${Ai.name}.${ff} includes required argument ${mf} that is missing from the Interface field ${bo.name}.${ff}.`,[pf.astNode,df.astNode])}}}function validateTypeImplementsAncestors(vo,Ai,bo){const Ra=Ai.getInterfaces();for(const hc of bo.getInterfaces())Ra.includes(hc)||vo.reportError(hc===Ai?`Type ${Ai.name} cannot implement ${bo.name} because it would create a circular reference.`:`Type ${Ai.name} must implement ${hc.name} because it is implemented by ${bo.name}.`,[...getAllImplementsInterfaceNodes(bo,hc),...getAllImplementsInterfaceNodes(Ai,bo)])}function validateUnionMembers(vo,Ai){const bo=Ai.getTypes();bo.length===0&&vo.reportError(`Union type ${Ai.name} must define one or more member types.`,[Ai.astNode,...Ai.extensionASTNodes]);const Ra=Object.create(null);for(const hc of bo){if(Ra[hc.name]){vo.reportError(`Union type ${Ai.name} can only include type ${hc.name} once.`,getUnionMemberTypeNodes(Ai,hc.name));continue}Ra[hc.name]=!0,isObjectType(hc)||vo.reportError(`Union type ${Ai.name} can only include Object types, it cannot include ${inspect(hc)}.`,getUnionMemberTypeNodes(Ai,String(hc)))}}function validateEnumValues(vo,Ai){const bo=Ai.getValues();bo.length===0&&vo.reportError(`Enum type ${Ai.name} must define one or more values.`,[Ai.astNode,...Ai.extensionASTNodes]);for(const Ra of bo)validateName(vo,Ra)}function validateInputFields(vo,Ai){const bo=Object.values(Ai.getFields());bo.length===0&&vo.reportError(`Input Object type ${Ai.name} must define one or more fields.`,[Ai.astNode,...Ai.extensionASTNodes]);for(const pc of bo){if(validateName(vo,pc),!isInputType(pc.type)){var Ra;vo.reportError(`The type of ${Ai.name}.${pc.name} must be Input Type but got: ${inspect(pc.type)}.`,(Ra=pc.astNode)===null||Ra===void 0?void 0:Ra.type)}if(isRequiredInputField(pc)&&pc.deprecationReason!=null){var hc;vo.reportError(`Required input field ${Ai.name}.${pc.name} cannot be deprecated.`,[getDeprecatedDirectiveNode(pc.astNode),(hc=pc.astNode)===null||hc===void 0?void 0:hc.type])}Ai.isOneOf&&validateOneOfInputObjectField(Ai,pc,vo)}}function validateOneOfInputObjectField(vo,Ai,bo){if(isNonNullType(Ai.type)){var Ra;bo.reportError(`OneOf input field ${vo.name}.${Ai.name} must be nullable.`,(Ra=Ai.astNode)===null||Ra===void 0?void 0:Ra.type)}Ai.defaultValue!==void 0&&bo.reportError(`OneOf input field ${vo.name}.${Ai.name} cannot have a default value.`,Ai.astNode)}function createInputObjectCircularRefsValidator(vo){const Ai=Object.create(null),bo=[],Ra=Object.create(null);return hc;function hc(pc){if(Ai[pc.name])return;Ai[pc.name]=!0,Ra[pc.name]=bo.length;const mc=Object.values(pc.getFields());for(const uf of mc)if(isNonNullType(uf.type)&&isInputObjectType(uf.type.ofType)){const df=uf.type.ofType,ff=Ra[df.name];if(bo.push(uf),ff===void 0)hc(df);else{const hf=bo.slice(ff),pf=hf.map(mf=>mf.name).join(".");vo.reportError(`Cannot reference Input Object "${df.name}" within itself through a series of non-null fields: "${pf}".`,hf.map(mf=>mf.astNode))}bo.pop()}Ra[pc.name]=void 0}}function getAllImplementsInterfaceNodes(vo,Ai){const{astNode:bo,extensionASTNodes:Ra}=vo;return(bo!=null?[bo,...Ra]:Ra).flatMap(hc=>{var pc;return(pc=hc.interfaces)!==null&&pc!==void 0?pc:[]}).filter(hc=>hc.name.value===Ai.name)}function getUnionMemberTypeNodes(vo,Ai){const{astNode:bo,extensionASTNodes:Ra}=vo;return(bo!=null?[bo,...Ra]:Ra).flatMap(hc=>{var pc;return(pc=hc.types)!==null&&pc!==void 0?pc:[]}).filter(hc=>hc.name.value===Ai)}function getDeprecatedDirectiveNode(vo){var Ai;return vo==null||(Ai=vo.directives)===null||Ai===void 0?void 0:Ai.find(bo=>bo.name.value===GraphQLDeprecatedDirective.name)}function typeFromAST(vo,Ai){switch(Ai.kind){case Kind.LIST_TYPE:{const bo=typeFromAST(vo,Ai.type);return bo&&new GraphQLList(bo)}case Kind.NON_NULL_TYPE:{const bo=typeFromAST(vo,Ai.type);return bo&&new GraphQLNonNull(bo)}case Kind.NAMED_TYPE:return vo.getType(Ai.name.value)}}class TypeInfo{constructor(Ai,bo,Ra){this._schema=Ai,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=Ra??getFieldDef$1,bo&&(isInputType(bo)&&this._inputTypeStack.push(bo),isCompositeType(bo)&&this._parentTypeStack.push(bo),isOutputType(bo)&&this._typeStack.push(bo))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(Ai){const bo=this._schema;switch(Ai.kind){case Kind.SELECTION_SET:{const hc=getNamedType(this.getType());this._parentTypeStack.push(isCompositeType(hc)?hc:void 0);break}case Kind.FIELD:{const hc=this.getParentType();let pc,mc;hc&&(pc=this._getFieldDef(bo,hc,Ai),pc&&(mc=pc.type)),this._fieldDefStack.push(pc),this._typeStack.push(isOutputType(mc)?mc:void 0);break}case Kind.DIRECTIVE:this._directive=bo.getDirective(Ai.name.value);break;case Kind.OPERATION_DEFINITION:{const hc=bo.getRootType(Ai.operation);this._typeStack.push(isObjectType(hc)?hc:void 0);break}case Kind.INLINE_FRAGMENT:case Kind.FRAGMENT_DEFINITION:{const hc=Ai.typeCondition,pc=hc?typeFromAST(bo,hc):getNamedType(this.getType());this._typeStack.push(isOutputType(pc)?pc:void 0);break}case Kind.VARIABLE_DEFINITION:{const hc=typeFromAST(bo,Ai.type);this._inputTypeStack.push(isInputType(hc)?hc:void 0);break}case Kind.ARGUMENT:{var Ra;let hc,pc;const mc=(Ra=this.getDirective())!==null&&Ra!==void 0?Ra:this.getFieldDef();mc&&(hc=mc.args.find(uf=>uf.name===Ai.name.value),hc&&(pc=hc.type)),this._argument=hc,this._defaultValueStack.push(hc?hc.defaultValue:void 0),this._inputTypeStack.push(isInputType(pc)?pc:void 0);break}case Kind.LIST:{const hc=getNullableType(this.getInputType()),pc=isListType(hc)?hc.ofType:hc;this._defaultValueStack.push(void 0),this._inputTypeStack.push(isInputType(pc)?pc:void 0);break}case Kind.OBJECT_FIELD:{const hc=getNamedType(this.getInputType());let pc,mc;isInputObjectType(hc)&&(mc=hc.getFields()[Ai.name.value],mc&&(pc=mc.type)),this._defaultValueStack.push(mc?mc.defaultValue:void 0),this._inputTypeStack.push(isInputType(pc)?pc:void 0);break}case Kind.ENUM:{const hc=getNamedType(this.getInputType());let pc;isEnumType(hc)&&(pc=hc.getValue(Ai.value)),this._enumValue=pc;break}}}leave(Ai){switch(Ai.kind){case Kind.SELECTION_SET:this._parentTypeStack.pop();break;case Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case Kind.DIRECTIVE:this._directive=null;break;case Kind.OPERATION_DEFINITION:case Kind.INLINE_FRAGMENT:case Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case Kind.LIST:case Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case Kind.ENUM:this._enumValue=null;break}}}function getFieldDef$1(vo,Ai,bo){const Ra=bo.name.value;if(Ra===SchemaMetaFieldDef.name&&vo.getQueryType()===Ai)return SchemaMetaFieldDef;if(Ra===TypeMetaFieldDef.name&&vo.getQueryType()===Ai)return TypeMetaFieldDef;if(Ra===TypeNameMetaFieldDef.name&&isCompositeType(Ai))return TypeNameMetaFieldDef;if(isObjectType(Ai)||isInterfaceType(Ai))return Ai.getFields()[Ra]}function visitWithTypeInfo(vo,Ai){return{enter(...bo){const Ra=bo[0];vo.enter(Ra);const hc=getEnterLeaveForKind(Ai,Ra.kind).enter;if(hc){const pc=hc.apply(Ai,bo);return pc!==void 0&&(vo.leave(Ra),isNode(pc)&&vo.enter(pc)),pc}},leave(...bo){const Ra=bo[0],hc=getEnterLeaveForKind(Ai,Ra.kind).leave;let pc;return hc&&(pc=hc.apply(Ai,bo)),vo.leave(Ra),pc}}}function isExecutableDefinitionNode(vo){return vo.kind===Kind.OPERATION_DEFINITION||vo.kind===Kind.FRAGMENT_DEFINITION}function isTypeSystemDefinitionNode(vo){return vo.kind===Kind.SCHEMA_DEFINITION||isTypeDefinitionNode(vo)||vo.kind===Kind.DIRECTIVE_DEFINITION}function isTypeDefinitionNode(vo){return vo.kind===Kind.SCALAR_TYPE_DEFINITION||vo.kind===Kind.OBJECT_TYPE_DEFINITION||vo.kind===Kind.INTERFACE_TYPE_DEFINITION||vo.kind===Kind.UNION_TYPE_DEFINITION||vo.kind===Kind.ENUM_TYPE_DEFINITION||vo.kind===Kind.INPUT_OBJECT_TYPE_DEFINITION}function isTypeSystemExtensionNode(vo){return vo.kind===Kind.SCHEMA_EXTENSION||isTypeExtensionNode(vo)}function isTypeExtensionNode(vo){return vo.kind===Kind.SCALAR_TYPE_EXTENSION||vo.kind===Kind.OBJECT_TYPE_EXTENSION||vo.kind===Kind.INTERFACE_TYPE_EXTENSION||vo.kind===Kind.UNION_TYPE_EXTENSION||vo.kind===Kind.ENUM_TYPE_EXTENSION||vo.kind===Kind.INPUT_OBJECT_TYPE_EXTENSION}function ExecutableDefinitionsRule(vo){return{Document(Ai){for(const bo of Ai.definitions)if(!isExecutableDefinitionNode(bo)){const Ra=bo.kind===Kind.SCHEMA_DEFINITION||bo.kind===Kind.SCHEMA_EXTENSION?"schema":'"'+bo.name.value+'"';vo.reportError(new GraphQLError(`The ${Ra} definition is not executable.`,{nodes:bo}))}return!1}}}function FieldsOnCorrectTypeRule(vo){return{Field(Ai){const bo=vo.getParentType();if(bo&&!vo.getFieldDef()){const Ra=vo.getSchema(),hc=Ai.name.value;let pc=didYouMean("to use an inline fragment on",getSuggestedTypeNames(Ra,bo,hc));pc===""&&(pc=didYouMean(getSuggestedFieldNames(bo,hc))),vo.reportError(new GraphQLError(`Cannot query field "${hc}" on type "${bo.name}".`+pc,{nodes:Ai}))}}}}function getSuggestedTypeNames(vo,Ai,bo){if(!isAbstractType(Ai))return[];const Ra=new Set,hc=Object.create(null);for(const mc of vo.getPossibleTypes(Ai))if(mc.getFields()[bo]){Ra.add(mc),hc[mc.name]=1;for(const uf of mc.getInterfaces()){var pc;uf.getFields()[bo]&&(Ra.add(uf),hc[uf.name]=((pc=hc[uf.name])!==null&&pc!==void 0?pc:0)+1)}}return[...Ra].sort((mc,uf)=>{const df=hc[uf.name]-hc[mc.name];return df!==0?df:isInterfaceType(mc)&&vo.isSubType(mc,uf)?-1:isInterfaceType(uf)&&vo.isSubType(uf,mc)?1:naturalCompare(mc.name,uf.name)}).map(mc=>mc.name)}function getSuggestedFieldNames(vo,Ai){if(isObjectType(vo)||isInterfaceType(vo)){const bo=Object.keys(vo.getFields());return suggestionList(Ai,bo)}return[]}function FragmentsOnCompositeTypesRule(vo){return{InlineFragment(Ai){const bo=Ai.typeCondition;if(bo){const Ra=typeFromAST(vo.getSchema(),bo);if(Ra&&!isCompositeType(Ra)){const hc=print(bo);vo.reportError(new GraphQLError(`Fragment cannot condition on non composite type "${hc}".`,{nodes:bo}))}}},FragmentDefinition(Ai){const bo=typeFromAST(vo.getSchema(),Ai.typeCondition);if(bo&&!isCompositeType(bo)){const Ra=print(Ai.typeCondition);vo.reportError(new GraphQLError(`Fragment "${Ai.name.value}" cannot condition on non composite type "${Ra}".`,{nodes:Ai.typeCondition}))}}}}function KnownArgumentNamesRule(vo){return{...KnownArgumentNamesOnDirectivesRule(vo),Argument(Ai){const bo=vo.getArgument(),Ra=vo.getFieldDef(),hc=vo.getParentType();if(!bo&&Ra&&hc){const pc=Ai.name.value,mc=Ra.args.map(df=>df.name),uf=suggestionList(pc,mc);vo.reportError(new GraphQLError(`Unknown argument "${pc}" on field "${hc.name}.${Ra.name}".`+didYouMean(uf),{nodes:Ai}))}}}}function KnownArgumentNamesOnDirectivesRule(vo){const Ai=Object.create(null),bo=vo.getSchema(),Ra=bo?bo.getDirectives():specifiedDirectives;for(const mc of Ra)Ai[mc.name]=mc.args.map(uf=>uf.name);const hc=vo.getDocument().definitions;for(const mc of hc)if(mc.kind===Kind.DIRECTIVE_DEFINITION){var pc;const uf=(pc=mc.arguments)!==null&&pc!==void 0?pc:[];Ai[mc.name.value]=uf.map(df=>df.name.value)}return{Directive(mc){const uf=mc.name.value,df=Ai[uf];if(mc.arguments&&df)for(const ff of mc.arguments){const hf=ff.name.value;if(!df.includes(hf)){const pf=suggestionList(hf,df);vo.reportError(new GraphQLError(`Unknown argument "${hf}" on directive "@${uf}".`+didYouMean(pf),{nodes:ff}))}}return!1}}}function KnownDirectivesRule(vo){const Ai=Object.create(null),bo=vo.getSchema(),Ra=bo?bo.getDirectives():specifiedDirectives;for(const pc of Ra)Ai[pc.name]=pc.locations;const hc=vo.getDocument().definitions;for(const pc of hc)pc.kind===Kind.DIRECTIVE_DEFINITION&&(Ai[pc.name.value]=pc.locations.map(mc=>mc.value));return{Directive(pc,mc,uf,df,ff){const hf=pc.name.value,pf=Ai[hf];if(!pf){vo.reportError(new GraphQLError(`Unknown directive "@${hf}".`,{nodes:pc}));return}const mf=getDirectiveLocationForASTPath(ff);mf&&!pf.includes(mf)&&vo.reportError(new GraphQLError(`Directive "@${hf}" may not be used on ${mf}.`,{nodes:pc}))}}}function getDirectiveLocationForASTPath(vo){const Ai=vo[vo.length-1];switch("kind"in Ai||invariant$1(),Ai.kind){case Kind.OPERATION_DEFINITION:return getDirectiveLocationForOperation(Ai.operation);case Kind.FIELD:return DirectiveLocation.FIELD;case Kind.FRAGMENT_SPREAD:return DirectiveLocation.FRAGMENT_SPREAD;case Kind.INLINE_FRAGMENT:return DirectiveLocation.INLINE_FRAGMENT;case Kind.FRAGMENT_DEFINITION:return DirectiveLocation.FRAGMENT_DEFINITION;case Kind.VARIABLE_DEFINITION:return DirectiveLocation.VARIABLE_DEFINITION;case Kind.SCHEMA_DEFINITION:case Kind.SCHEMA_EXTENSION:return DirectiveLocation.SCHEMA;case Kind.SCALAR_TYPE_DEFINITION:case Kind.SCALAR_TYPE_EXTENSION:return DirectiveLocation.SCALAR;case Kind.OBJECT_TYPE_DEFINITION:case Kind.OBJECT_TYPE_EXTENSION:return DirectiveLocation.OBJECT;case Kind.FIELD_DEFINITION:return DirectiveLocation.FIELD_DEFINITION;case Kind.INTERFACE_TYPE_DEFINITION:case Kind.INTERFACE_TYPE_EXTENSION:return DirectiveLocation.INTERFACE;case Kind.UNION_TYPE_DEFINITION:case Kind.UNION_TYPE_EXTENSION:return DirectiveLocation.UNION;case Kind.ENUM_TYPE_DEFINITION:case Kind.ENUM_TYPE_EXTENSION:return DirectiveLocation.ENUM;case Kind.ENUM_VALUE_DEFINITION:return DirectiveLocation.ENUM_VALUE;case Kind.INPUT_OBJECT_TYPE_DEFINITION:case Kind.INPUT_OBJECT_TYPE_EXTENSION:return DirectiveLocation.INPUT_OBJECT;case Kind.INPUT_VALUE_DEFINITION:{const bo=vo[vo.length-3];return"kind"in bo||invariant$1(),bo.kind===Kind.INPUT_OBJECT_TYPE_DEFINITION?DirectiveLocation.INPUT_FIELD_DEFINITION:DirectiveLocation.ARGUMENT_DEFINITION}default:invariant$1(!1,"Unexpected kind: "+inspect(Ai.kind))}}function getDirectiveLocationForOperation(vo){switch(vo){case OperationTypeNode.QUERY:return DirectiveLocation.QUERY;case OperationTypeNode.MUTATION:return DirectiveLocation.MUTATION;case OperationTypeNode.SUBSCRIPTION:return DirectiveLocation.SUBSCRIPTION}}function KnownFragmentNamesRule(vo){return{FragmentSpread(Ai){const bo=Ai.name.value;vo.getFragment(bo)||vo.reportError(new GraphQLError(`Unknown fragment "${bo}".`,{nodes:Ai.name}))}}}function KnownTypeNamesRule(vo){const Ai=vo.getSchema(),bo=Ai?Ai.getTypeMap():Object.create(null),Ra=Object.create(null);for(const pc of vo.getDocument().definitions)isTypeDefinitionNode(pc)&&(Ra[pc.name.value]=!0);const hc=[...Object.keys(bo),...Object.keys(Ra)];return{NamedType(pc,mc,uf,df,ff){const hf=pc.name.value;if(!bo[hf]&&!Ra[hf]){var pf;const mf=(pf=ff[2])!==null&&pf!==void 0?pf:uf,gf=mf!=null&&isSDLNode(mf);if(gf&&standardTypeNames.includes(hf))return;const yf=suggestionList(hf,gf?standardTypeNames.concat(hc):hc);vo.reportError(new GraphQLError(`Unknown type "${hf}".`+didYouMean(yf),{nodes:pc}))}}}}const standardTypeNames=[...specifiedScalarTypes,...introspectionTypes].map(vo=>vo.name);function isSDLNode(vo){return"kind"in vo&&(isTypeSystemDefinitionNode(vo)||isTypeSystemExtensionNode(vo))}function LoneAnonymousOperationRule(vo){let Ai=0;return{Document(bo){Ai=bo.definitions.filter(Ra=>Ra.kind===Kind.OPERATION_DEFINITION).length},OperationDefinition(bo){!bo.name&&Ai>1&&vo.reportError(new GraphQLError("This anonymous operation must be the only defined operation.",{nodes:bo}))}}}function LoneSchemaDefinitionRule(vo){var Ai,bo,Ra;const hc=vo.getSchema(),pc=(Ai=(bo=(Ra=hc==null?void 0:hc.astNode)!==null&&Ra!==void 0?Ra:hc==null?void 0:hc.getQueryType())!==null&&bo!==void 0?bo:hc==null?void 0:hc.getMutationType())!==null&&Ai!==void 0?Ai:hc==null?void 0:hc.getSubscriptionType();let mc=0;return{SchemaDefinition(uf){if(pc){vo.reportError(new GraphQLError("Cannot define a new schema within a schema extension.",{nodes:uf}));return}mc>0&&vo.reportError(new GraphQLError("Must provide only one schema definition.",{nodes:uf})),++mc}}}const MAX_LISTS_DEPTH=3;function MaxIntrospectionDepthRule(vo){function Ai(bo,Ra=Object.create(null),hc=0){if(bo.kind===Kind.FRAGMENT_SPREAD){const pc=bo.name.value;if(Ra[pc]===!0)return!1;const mc=vo.getFragment(pc);if(!mc)return!1;try{return Ra[pc]=!0,Ai(mc,Ra,hc)}finally{Ra[pc]=void 0}}if(bo.kind===Kind.FIELD&&(bo.name.value==="fields"||bo.name.value==="interfaces"||bo.name.value==="possibleTypes"||bo.name.value==="inputFields")&&(hc++,hc>=MAX_LISTS_DEPTH))return!0;if("selectionSet"in bo&&bo.selectionSet){for(const pc of bo.selectionSet.selections)if(Ai(pc,Ra,hc))return!0}return!1}return{Field(bo){if((bo.name.value==="__schema"||bo.name.value==="__type")&&Ai(bo))return vo.reportError(new GraphQLError("Maximum introspection depth exceeded",{nodes:[bo]})),!1}}}function NoFragmentCyclesRule(vo){const Ai=Object.create(null),bo=[],Ra=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(pc){return hc(pc),!1}};function hc(pc){if(Ai[pc.name.value])return;const mc=pc.name.value;Ai[mc]=!0;const uf=vo.getFragmentSpreads(pc.selectionSet);if(uf.length!==0){Ra[mc]=bo.length;for(const df of uf){const ff=df.name.value,hf=Ra[ff];if(bo.push(df),hf===void 0){const pf=vo.getFragment(ff);pf&&hc(pf)}else{const pf=bo.slice(hf),mf=pf.slice(0,-1).map(gf=>'"'+gf.name.value+'"').join(", ");vo.reportError(new GraphQLError(`Cannot spread fragment "${ff}" within itself`+(mf!==""?` via ${mf}.`:"."),{nodes:pf}))}bo.pop()}Ra[mc]=void 0}}}function NoUndefinedVariablesRule(vo){let Ai=Object.create(null);return{OperationDefinition:{enter(){Ai=Object.create(null)},leave(bo){const Ra=vo.getRecursiveVariableUsages(bo);for(const{node:hc}of Ra){const pc=hc.name.value;Ai[pc]!==!0&&vo.reportError(new GraphQLError(bo.name?`Variable "$${pc}" is not defined by operation "${bo.name.value}".`:`Variable "$${pc}" is not defined.`,{nodes:[hc,bo]}))}}},VariableDefinition(bo){Ai[bo.variable.name.value]=!0}}}function NoUnusedFragmentsRule(vo){const Ai=[],bo=[];return{OperationDefinition(Ra){return Ai.push(Ra),!1},FragmentDefinition(Ra){return bo.push(Ra),!1},Document:{leave(){const Ra=Object.create(null);for(const hc of Ai)for(const pc of vo.getRecursivelyReferencedFragments(hc))Ra[pc.name.value]=!0;for(const hc of bo){const pc=hc.name.value;Ra[pc]!==!0&&vo.reportError(new GraphQLError(`Fragment "${pc}" is never used.`,{nodes:hc}))}}}}}function NoUnusedVariablesRule(vo){let Ai=[];return{OperationDefinition:{enter(){Ai=[]},leave(bo){const Ra=Object.create(null),hc=vo.getRecursiveVariableUsages(bo);for(const{node:pc}of hc)Ra[pc.name.value]=!0;for(const pc of Ai){const mc=pc.variable.name.value;Ra[mc]!==!0&&vo.reportError(new GraphQLError(bo.name?`Variable "$${mc}" is never used in operation "${bo.name.value}".`:`Variable "$${mc}" is never used.`,{nodes:pc}))}}},VariableDefinition(bo){Ai.push(bo)}}}function sortValueNode(vo){switch(vo.kind){case Kind.OBJECT:return{...vo,fields:sortFields(vo.fields)};case Kind.LIST:return{...vo,values:vo.values.map(sortValueNode)};case Kind.INT:case Kind.FLOAT:case Kind.STRING:case Kind.BOOLEAN:case Kind.NULL:case Kind.ENUM:case Kind.VARIABLE:return vo}}function sortFields(vo){return vo.map(Ai=>({...Ai,value:sortValueNode(Ai.value)})).sort((Ai,bo)=>naturalCompare(Ai.name.value,bo.name.value))}function reasonMessage(vo){return Array.isArray(vo)?vo.map(([Ai,bo])=>`subfields "${Ai}" conflict because `+reasonMessage(bo)).join(" and "):vo}function OverlappingFieldsCanBeMergedRule(vo){const Ai=new OrderedPairSet,bo=new PairSet,Ra=new Map;return{SelectionSet(hc){const pc=findConflictsWithinSelectionSet(vo,Ra,Ai,bo,vo.getParentType(),hc);for(const[[mc,uf],df,ff]of pc){const hf=reasonMessage(uf);vo.reportError(new GraphQLError(`Fields "${mc}" conflict because ${hf}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:df.concat(ff)}))}}}}function findConflictsWithinSelectionSet(vo,Ai,bo,Ra,hc,pc){const mc=[],[uf,df]=getFieldsAndFragmentNames(vo,Ai,hc,pc);if(collectConflictsWithin(vo,mc,Ai,bo,Ra,uf),df.length!==0)for(let ff=0;ff<df.length;ff++){collectConflictsBetweenFieldsAndFragment(vo,mc,Ai,bo,Ra,!1,uf,df[ff]);for(let hf=ff+1;hf<df.length;hf++)collectConflictsBetweenFragments(vo,mc,Ai,bo,Ra,!1,df[ff],df[hf])}return mc}function collectConflictsBetweenFieldsAndFragment(vo,Ai,bo,Ra,hc,pc,mc,uf){if(Ra.has(mc,uf,pc))return;Ra.add(mc,uf,pc);const df=vo.getFragment(uf);if(!df)return;const[ff,hf]=getReferencedFieldsAndFragmentNames(vo,bo,df);if(mc!==ff){collectConflictsBetween(vo,Ai,bo,Ra,hc,pc,mc,ff);for(const pf of hf)collectConflictsBetweenFieldsAndFragment(vo,Ai,bo,Ra,hc,pc,mc,pf)}}function collectConflictsBetweenFragments(vo,Ai,bo,Ra,hc,pc,mc,uf){if(mc===uf||hc.has(mc,uf,pc))return;hc.add(mc,uf,pc);const df=vo.getFragment(mc),ff=vo.getFragment(uf);if(!df||!ff)return;const[hf,pf]=getReferencedFieldsAndFragmentNames(vo,bo,df),[mf,gf]=getReferencedFieldsAndFragmentNames(vo,bo,ff);collectConflictsBetween(vo,Ai,bo,Ra,hc,pc,hf,mf);for(const yf of gf)collectConflictsBetweenFragments(vo,Ai,bo,Ra,hc,pc,mc,yf);for(const yf of pf)collectConflictsBetweenFragments(vo,Ai,bo,Ra,hc,pc,yf,uf)}function findConflictsBetweenSubSelectionSets(vo,Ai,bo,Ra,hc,pc,mc,uf,df){const ff=[],[hf,pf]=getFieldsAndFragmentNames(vo,Ai,pc,mc),[mf,gf]=getFieldsAndFragmentNames(vo,Ai,uf,df);collectConflictsBetween(vo,ff,Ai,bo,Ra,hc,hf,mf);for(const yf of gf)collectConflictsBetweenFieldsAndFragment(vo,ff,Ai,bo,Ra,hc,hf,yf);for(const yf of pf)collectConflictsBetweenFieldsAndFragment(vo,ff,Ai,bo,Ra,hc,mf,yf);for(const yf of pf)for(const vf of gf)collectConflictsBetweenFragments(vo,ff,Ai,bo,Ra,hc,yf,vf);return ff}function collectConflictsWithin(vo,Ai,bo,Ra,hc,pc){for(const[mc,uf]of Object.entries(pc))if(uf.length>1)for(let df=0;df<uf.length;df++)for(let ff=df+1;ff<uf.length;ff++){const hf=findConflict(vo,bo,Ra,hc,!1,mc,uf[df],uf[ff]);hf&&Ai.push(hf)}}function collectConflictsBetween(vo,Ai,bo,Ra,hc,pc,mc,uf){for(const[df,ff]of Object.entries(mc)){const hf=uf[df];if(hf)for(const pf of ff)for(const mf of hf){const gf=findConflict(vo,bo,Ra,hc,pc,df,pf,mf);gf&&Ai.push(gf)}}}function findConflict(vo,Ai,bo,Ra,hc,pc,mc,uf){const[df,ff,hf]=mc,[pf,mf,gf]=uf,yf=hc||df!==pf&&isObjectType(df)&&isObjectType(pf);if(!yf){const wf=ff.name.value,s1=mf.name.value;if(wf!==s1)return[[pc,`"${wf}" and "${s1}" are different fields`],[ff],[mf]];if(!sameArguments(ff,mf))return[[pc,"they have differing arguments"],[ff],[mf]]}const vf=hf==null?void 0:hf.type,bf=gf==null?void 0:gf.type;if(vf&&bf&&doTypesConflict(vf,bf))return[[pc,`they return conflicting types "${inspect(vf)}" and "${inspect(bf)}"`],[ff],[mf]];const Sf=ff.selectionSet,xf=mf.selectionSet;if(Sf&&xf){const wf=findConflictsBetweenSubSelectionSets(vo,Ai,bo,Ra,yf,getNamedType(vf),Sf,getNamedType(bf),xf);return subfieldConflicts(wf,pc,ff,mf)}}function sameArguments(vo,Ai){const bo=vo.arguments,Ra=Ai.arguments;if(bo===void 0||bo.length===0)return Ra===void 0||Ra.length===0;if(Ra===void 0||Ra.length===0||bo.length!==Ra.length)return!1;const hc=new Map(Ra.map(({name:pc,value:mc})=>[pc.value,mc]));return bo.every(pc=>{const mc=pc.value,uf=hc.get(pc.name.value);return uf===void 0?!1:stringifyValue(mc)===stringifyValue(uf)})}function stringifyValue(vo){return print(sortValueNode(vo))}function doTypesConflict(vo,Ai){return isListType(vo)?isListType(Ai)?doTypesConflict(vo.ofType,Ai.ofType):!0:isListType(Ai)?!0:isNonNullType(vo)?isNonNullType(Ai)?doTypesConflict(vo.ofType,Ai.ofType):!0:isNonNullType(Ai)?!0:isLeafType(vo)||isLeafType(Ai)?vo!==Ai:!1}function getFieldsAndFragmentNames(vo,Ai,bo,Ra){const hc=Ai.get(Ra);if(hc)return hc;const pc=Object.create(null),mc=Object.create(null);_collectFieldsAndFragmentNames(vo,bo,Ra,pc,mc);const uf=[pc,Object.keys(mc)];return Ai.set(Ra,uf),uf}function getReferencedFieldsAndFragmentNames(vo,Ai,bo){const Ra=Ai.get(bo.selectionSet);if(Ra)return Ra;const hc=typeFromAST(vo.getSchema(),bo.typeCondition);return getFieldsAndFragmentNames(vo,Ai,hc,bo.selectionSet)}function _collectFieldsAndFragmentNames(vo,Ai,bo,Ra,hc){for(const pc of bo.selections)switch(pc.kind){case Kind.FIELD:{const mc=pc.name.value;let uf;(isObjectType(Ai)||isInterfaceType(Ai))&&(uf=Ai.getFields()[mc]);const df=pc.alias?pc.alias.value:mc;Ra[df]||(Ra[df]=[]),Ra[df].push([Ai,pc,uf]);break}case Kind.FRAGMENT_SPREAD:hc[pc.name.value]=!0;break;case Kind.INLINE_FRAGMENT:{const mc=pc.typeCondition,uf=mc?typeFromAST(vo.getSchema(),mc):Ai;_collectFieldsAndFragmentNames(vo,uf,pc.selectionSet,Ra,hc);break}}}function subfieldConflicts(vo,Ai,bo,Ra){if(vo.length>0)return[[Ai,vo.map(([hc])=>hc)],[bo,...vo.map(([,hc])=>hc).flat()],[Ra,...vo.map(([,,hc])=>hc).flat()]]}class OrderedPairSet{constructor(){this._data=new Map}has(Ai,bo,Ra){var hc;const pc=(hc=this._data.get(Ai))===null||hc===void 0?void 0:hc.get(bo);return pc===void 0?!1:Ra?!0:Ra===pc}add(Ai,bo,Ra){const hc=this._data.get(Ai);hc===void 0?this._data.set(Ai,new Map([[bo,Ra]])):hc.set(bo,Ra)}}class PairSet{constructor(){this._orderedPairSet=new OrderedPairSet}has(Ai,bo,Ra){return Ai<bo?this._orderedPairSet.has(Ai,bo,Ra):this._orderedPairSet.has(bo,Ai,Ra)}add(Ai,bo,Ra){Ai<bo?this._orderedPairSet.add(Ai,bo,Ra):this._orderedPairSet.add(bo,Ai,Ra)}}function PossibleFragmentSpreadsRule(vo){return{InlineFragment(Ai){const bo=vo.getType(),Ra=vo.getParentType();if(isCompositeType(bo)&&isCompositeType(Ra)&&!doTypesOverlap(vo.getSchema(),bo,Ra)){const hc=inspect(Ra),pc=inspect(bo);vo.reportError(new GraphQLError(`Fragment cannot be spread here as objects of type "${hc}" can never be of type "${pc}".`,{nodes:Ai}))}},FragmentSpread(Ai){const bo=Ai.name.value,Ra=getFragmentType(vo,bo),hc=vo.getParentType();if(Ra&&hc&&!doTypesOverlap(vo.getSchema(),Ra,hc)){const pc=inspect(hc),mc=inspect(Ra);vo.reportError(new GraphQLError(`Fragment "${bo}" cannot be spread here as objects of type "${pc}" can never be of type "${mc}".`,{nodes:Ai}))}}}}function getFragmentType(vo,Ai){const bo=vo.getFragment(Ai);if(bo){const Ra=typeFromAST(vo.getSchema(),bo.typeCondition);if(isCompositeType(Ra))return Ra}}function PossibleTypeExtensionsRule(vo){const Ai=vo.getSchema(),bo=Object.create(null);for(const hc of vo.getDocument().definitions)isTypeDefinitionNode(hc)&&(bo[hc.name.value]=hc);return{ScalarTypeExtension:Ra,ObjectTypeExtension:Ra,InterfaceTypeExtension:Ra,UnionTypeExtension:Ra,EnumTypeExtension:Ra,InputObjectTypeExtension:Ra};function Ra(hc){const pc=hc.name.value,mc=bo[pc],uf=Ai==null?void 0:Ai.getType(pc);let df;if(mc?df=defKindToExtKind[mc.kind]:uf&&(df=typeToExtKind(uf)),df){if(df!==hc.kind){const ff=extensionKindToTypeName(hc.kind);vo.reportError(new GraphQLError(`Cannot extend non-${ff} type "${pc}".`,{nodes:mc?[mc,hc]:hc}))}}else{const ff=Object.keys({...bo,...Ai==null?void 0:Ai.getTypeMap()}),hf=suggestionList(pc,ff);vo.reportError(new GraphQLError(`Cannot extend type "${pc}" because it is not defined.`+didYouMean(hf),{nodes:hc.name}))}}}const defKindToExtKind={[Kind.SCALAR_TYPE_DEFINITION]:Kind.SCALAR_TYPE_EXTENSION,[Kind.OBJECT_TYPE_DEFINITION]:Kind.OBJECT_TYPE_EXTENSION,[Kind.INTERFACE_TYPE_DEFINITION]:Kind.INTERFACE_TYPE_EXTENSION,[Kind.UNION_TYPE_DEFINITION]:Kind.UNION_TYPE_EXTENSION,[Kind.ENUM_TYPE_DEFINITION]:Kind.ENUM_TYPE_EXTENSION,[Kind.INPUT_OBJECT_TYPE_DEFINITION]:Kind.INPUT_OBJECT_TYPE_EXTENSION};function typeToExtKind(vo){if(isScalarType(vo))return Kind.SCALAR_TYPE_EXTENSION;if(isObjectType(vo))return Kind.OBJECT_TYPE_EXTENSION;if(isInterfaceType(vo))return Kind.INTERFACE_TYPE_EXTENSION;if(isUnionType(vo))return Kind.UNION_TYPE_EXTENSION;if(isEnumType(vo))return Kind.ENUM_TYPE_EXTENSION;if(isInputObjectType(vo))return Kind.INPUT_OBJECT_TYPE_EXTENSION;invariant$1(!1,"Unexpected type: "+inspect(vo))}function extensionKindToTypeName(vo){switch(vo){case Kind.SCALAR_TYPE_EXTENSION:return"scalar";case Kind.OBJECT_TYPE_EXTENSION:return"object";case Kind.INTERFACE_TYPE_EXTENSION:return"interface";case Kind.UNION_TYPE_EXTENSION:return"union";case Kind.ENUM_TYPE_EXTENSION:return"enum";case Kind.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:invariant$1(!1,"Unexpected kind: "+inspect(vo))}}function ProvidedRequiredArgumentsRule(vo){return{...ProvidedRequiredArgumentsOnDirectivesRule(vo),Field:{leave(Ai){var bo;const Ra=vo.getFieldDef();if(!Ra)return!1;const hc=new Set((bo=Ai.arguments)===null||bo===void 0?void 0:bo.map(pc=>pc.name.value));for(const pc of Ra.args)if(!hc.has(pc.name)&&isRequiredArgument(pc)){const mc=inspect(pc.type);vo.reportError(new GraphQLError(`Field "${Ra.name}" argument "${pc.name}" of type "${mc}" is required, but it was not provided.`,{nodes:Ai}))}}}}}function ProvidedRequiredArgumentsOnDirectivesRule(vo){var Ai;const bo=Object.create(null),Ra=vo.getSchema(),hc=(Ai=Ra==null?void 0:Ra.getDirectives())!==null&&Ai!==void 0?Ai:specifiedDirectives;for(const uf of hc)bo[uf.name]=keyMap(uf.args.filter(isRequiredArgument),df=>df.name);const pc=vo.getDocument().definitions;for(const uf of pc)if(uf.kind===Kind.DIRECTIVE_DEFINITION){var mc;const df=(mc=uf.arguments)!==null&&mc!==void 0?mc:[];bo[uf.name.value]=keyMap(df.filter(isRequiredArgumentNode),ff=>ff.name.value)}return{Directive:{leave(uf){const df=uf.name.value,ff=bo[df];if(ff){var hf;const pf=(hf=uf.arguments)!==null&&hf!==void 0?hf:[],mf=new Set(pf.map(gf=>gf.name.value));for(const[gf,yf]of Object.entries(ff))if(!mf.has(gf)){const vf=isType(yf.type)?inspect(yf.type):print(yf.type);vo.reportError(new GraphQLError(`Directive "@${df}" argument "${gf}" of type "${vf}" is required, but it was not provided.`,{nodes:uf}))}}}}}}function isRequiredArgumentNode(vo){return vo.type.kind===Kind.NON_NULL_TYPE&&vo.defaultValue==null}function ScalarLeafsRule(vo){return{Field(Ai){const bo=vo.getType(),Ra=Ai.selectionSet;if(bo)if(isLeafType(getNamedType(bo))){if(Ra){const hc=Ai.name.value,pc=inspect(bo);vo.reportError(new GraphQLError(`Field "${hc}" must not have a selection since type "${pc}" has no subfields.`,{nodes:Ra}))}}else if(Ra){if(Ra.selections.length===0){const hc=Ai.name.value,pc=inspect(bo);vo.reportError(new GraphQLError(`Field "${hc}" of type "${pc}" must have at least one field selected.`,{nodes:Ai}))}}else{const hc=Ai.name.value,pc=inspect(bo);vo.reportError(new GraphQLError(`Field "${hc}" of type "${pc}" must have a selection of subfields. Did you mean "${hc} { ... }"?`,{nodes:Ai}))}}}}function valueFromAST(vo,Ai,bo){if(vo){if(vo.kind===Kind.VARIABLE){const Ra=vo.name.value;if(bo==null||bo[Ra]===void 0)return;const hc=bo[Ra];return hc===null&&isNonNullType(Ai)?void 0:hc}if(isNonNullType(Ai))return vo.kind===Kind.NULL?void 0:valueFromAST(vo,Ai.ofType,bo);if(vo.kind===Kind.NULL)return null;if(isListType(Ai)){const Ra=Ai.ofType;if(vo.kind===Kind.LIST){const pc=[];for(const mc of vo.values)if(isMissingVariable(mc,bo)){if(isNonNullType(Ra))return;pc.push(null)}else{const uf=valueFromAST(mc,Ra,bo);if(uf===void 0)return;pc.push(uf)}return pc}const hc=valueFromAST(vo,Ra,bo);return hc===void 0?void 0:[hc]}if(isInputObjectType(Ai)){if(vo.kind!==Kind.OBJECT)return;const Ra=Object.create(null),hc=keyMap(vo.fields,pc=>pc.name.value);for(const pc of Object.values(Ai.getFields())){const mc=hc[pc.name];if(!mc||isMissingVariable(mc.value,bo)){if(pc.defaultValue!==void 0)Ra[pc.name]=pc.defaultValue;else if(isNonNullType(pc.type))return;continue}const uf=valueFromAST(mc.value,pc.type,bo);if(uf===void 0)return;Ra[pc.name]=uf}if(Ai.isOneOf){const pc=Object.keys(Ra);if(pc.length!==1||Ra[pc[0]]===null)return}return Ra}if(isLeafType(Ai)){let Ra;try{Ra=Ai.parseLiteral(vo,bo)}catch{return}return Ra===void 0?void 0:Ra}invariant$1(!1,"Unexpected input type: "+inspect(Ai))}}function isMissingVariable(vo,Ai){return vo.kind===Kind.VARIABLE&&(Ai==null||Ai[vo.name.value]===void 0)}function getArgumentValues(vo,Ai,bo){var Ra;const hc={},pc=(Ra=Ai.arguments)!==null&&Ra!==void 0?Ra:[],mc=keyMap(pc,uf=>uf.name.value);for(const uf of vo.args){const df=uf.name,ff=uf.type,hf=mc[df];if(!hf){if(uf.defaultValue!==void 0)hc[df]=uf.defaultValue;else if(isNonNullType(ff))throw new GraphQLError(`Argument "${df}" of required type "${inspect(ff)}" was not provided.`,{nodes:Ai});continue}const pf=hf.value;let mf=pf.kind===Kind.NULL;if(pf.kind===Kind.VARIABLE){const yf=pf.name.value;if(bo==null||!hasOwnProperty(bo,yf)){if(uf.defaultValue!==void 0)hc[df]=uf.defaultValue;else if(isNonNullType(ff))throw new GraphQLError(`Argument "${df}" of required type "${inspect(ff)}" was provided the variable "$${yf}" which was not provided a runtime value.`,{nodes:pf});continue}mf=bo[yf]==null}if(mf&&isNonNullType(ff))throw new GraphQLError(`Argument "${df}" of non-null type "${inspect(ff)}" must not be null.`,{nodes:pf});const gf=valueFromAST(pf,ff,bo);if(gf===void 0)throw new GraphQLError(`Argument "${df}" has invalid value ${print(pf)}.`,{nodes:pf});hc[df]=gf}return hc}function getDirectiveValues(vo,Ai,bo){var Ra;const hc=(Ra=Ai.directives)===null||Ra===void 0?void 0:Ra.find(pc=>pc.name.value===vo.name);if(hc)return getArgumentValues(vo,hc,bo)}function hasOwnProperty(vo,Ai){return Object.prototype.hasOwnProperty.call(vo,Ai)}function collectFields(vo,Ai,bo,Ra,hc){const pc=new Map;return collectFieldsImpl(vo,Ai,bo,Ra,hc,pc,new Set),pc}function collectFieldsImpl(vo,Ai,bo,Ra,hc,pc,mc){for(const uf of hc.selections)switch(uf.kind){case Kind.FIELD:{if(!shouldIncludeNode(bo,uf))continue;const df=getFieldEntryKey(uf),ff=pc.get(df);ff!==void 0?ff.push(uf):pc.set(df,[uf]);break}case Kind.INLINE_FRAGMENT:{if(!shouldIncludeNode(bo,uf)||!doesFragmentConditionMatch(vo,uf,Ra))continue;collectFieldsImpl(vo,Ai,bo,Ra,uf.selectionSet,pc,mc);break}case Kind.FRAGMENT_SPREAD:{const df=uf.name.value;if(mc.has(df)||!shouldIncludeNode(bo,uf))continue;mc.add(df);const ff=Ai[df];if(!ff||!doesFragmentConditionMatch(vo,ff,Ra))continue;collectFieldsImpl(vo,Ai,bo,Ra,ff.selectionSet,pc,mc);break}}}function shouldIncludeNode(vo,Ai){const bo=getDirectiveValues(GraphQLSkipDirective,Ai,vo);if((bo==null?void 0:bo.if)===!0)return!1;const Ra=getDirectiveValues(GraphQLIncludeDirective,Ai,vo);return(Ra==null?void 0:Ra.if)!==!1}function doesFragmentConditionMatch(vo,Ai,bo){const Ra=Ai.typeCondition;if(!Ra)return!0;const hc=typeFromAST(vo,Ra);return hc===bo?!0:isAbstractType(hc)?vo.isSubType(hc,bo):!1}function getFieldEntryKey(vo){return vo.alias?vo.alias.value:vo.name.value}function SingleFieldSubscriptionsRule(vo){return{OperationDefinition(Ai){if(Ai.operation==="subscription"){const bo=vo.getSchema(),Ra=bo.getSubscriptionType();if(Ra){const hc=Ai.name?Ai.name.value:null,pc=Object.create(null),mc=vo.getDocument(),uf=Object.create(null);for(const ff of mc.definitions)ff.kind===Kind.FRAGMENT_DEFINITION&&(uf[ff.name.value]=ff);const df=collectFields(bo,uf,pc,Ra,Ai.selectionSet);if(df.size>1){const ff=[...df.values()].slice(1).flat();vo.reportError(new GraphQLError(hc!=null?`Subscription "${hc}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:ff}))}for(const ff of df.values())ff[0].name.value.startsWith("__")&&vo.reportError(new GraphQLError(hc!=null?`Subscription "${hc}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:ff}))}}}}}function groupBy(vo,Ai){const bo=new Map;for(const Ra of vo){const hc=Ai(Ra),pc=bo.get(hc);pc===void 0?bo.set(hc,[Ra]):pc.push(Ra)}return bo}function UniqueArgumentDefinitionNamesRule(vo){return{DirectiveDefinition(Ra){var hc;const pc=(hc=Ra.arguments)!==null&&hc!==void 0?hc:[];return bo(`@${Ra.name.value}`,pc)},InterfaceTypeDefinition:Ai,InterfaceTypeExtension:Ai,ObjectTypeDefinition:Ai,ObjectTypeExtension:Ai};function Ai(Ra){var hc;const pc=Ra.name.value,mc=(hc=Ra.fields)!==null&&hc!==void 0?hc:[];for(const df of mc){var uf;const ff=df.name.value,hf=(uf=df.arguments)!==null&&uf!==void 0?uf:[];bo(`${pc}.${ff}`,hf)}return!1}function bo(Ra,hc){const pc=groupBy(hc,mc=>mc.name.value);for(const[mc,uf]of pc)uf.length>1&&vo.reportError(new GraphQLError(`Argument "${Ra}(${mc}:)" can only be defined once.`,{nodes:uf.map(df=>df.name)}));return!1}}function UniqueArgumentNamesRule(vo){return{Field:Ai,Directive:Ai};function Ai(bo){var Ra;const hc=(Ra=bo.arguments)!==null&&Ra!==void 0?Ra:[],pc=groupBy(hc,mc=>mc.name.value);for(const[mc,uf]of pc)uf.length>1&&vo.reportError(new GraphQLError(`There can be only one argument named "${mc}".`,{nodes:uf.map(df=>df.name)}))}}function UniqueDirectiveNamesRule(vo){const Ai=Object.create(null),bo=vo.getSchema();return{DirectiveDefinition(Ra){const hc=Ra.name.value;if(bo!=null&&bo.getDirective(hc)){vo.reportError(new GraphQLError(`Directive "@${hc}" already exists in the schema. It cannot be redefined.`,{nodes:Ra.name}));return}return Ai[hc]?vo.reportError(new GraphQLError(`There can be only one directive named "@${hc}".`,{nodes:[Ai[hc],Ra.name]})):Ai[hc]=Ra.name,!1}}}function UniqueDirectivesPerLocationRule(vo){const Ai=Object.create(null),bo=vo.getSchema(),Ra=bo?bo.getDirectives():specifiedDirectives;for(const uf of Ra)Ai[uf.name]=!uf.isRepeatable;const hc=vo.getDocument().definitions;for(const uf of hc)uf.kind===Kind.DIRECTIVE_DEFINITION&&(Ai[uf.name.value]=!uf.repeatable);const pc=Object.create(null),mc=Object.create(null);return{enter(uf){if(!("directives"in uf)||!uf.directives)return;let df;if(uf.kind===Kind.SCHEMA_DEFINITION||uf.kind===Kind.SCHEMA_EXTENSION)df=pc;else if(isTypeDefinitionNode(uf)||isTypeExtensionNode(uf)){const ff=uf.name.value;df=mc[ff],df===void 0&&(mc[ff]=df=Object.create(null))}else df=Object.create(null);for(const ff of uf.directives){const hf=ff.name.value;Ai[hf]&&(df[hf]?vo.reportError(new GraphQLError(`The directive "@${hf}" can only be used once at this location.`,{nodes:[df[hf],ff]})):df[hf]=ff)}}}}function UniqueEnumValueNamesRule(vo){const Ai=vo.getSchema(),bo=Ai?Ai.getTypeMap():Object.create(null),Ra=Object.create(null);return{EnumTypeDefinition:hc,EnumTypeExtension:hc};function hc(pc){var mc;const uf=pc.name.value;Ra[uf]||(Ra[uf]=Object.create(null));const df=(mc=pc.values)!==null&&mc!==void 0?mc:[],ff=Ra[uf];for(const hf of df){const pf=hf.name.value,mf=bo[uf];isEnumType(mf)&&mf.getValue(pf)?vo.reportError(new GraphQLError(`Enum value "${uf}.${pf}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:hf.name})):ff[pf]?vo.reportError(new GraphQLError(`Enum value "${uf}.${pf}" can only be defined once.`,{nodes:[ff[pf],hf.name]})):ff[pf]=hf.name}return!1}}function UniqueFieldDefinitionNamesRule(vo){const Ai=vo.getSchema(),bo=Ai?Ai.getTypeMap():Object.create(null),Ra=Object.create(null);return{InputObjectTypeDefinition:hc,InputObjectTypeExtension:hc,InterfaceTypeDefinition:hc,InterfaceTypeExtension:hc,ObjectTypeDefinition:hc,ObjectTypeExtension:hc};function hc(pc){var mc;const uf=pc.name.value;Ra[uf]||(Ra[uf]=Object.create(null));const df=(mc=pc.fields)!==null&&mc!==void 0?mc:[],ff=Ra[uf];for(const hf of df){const pf=hf.name.value;hasField(bo[uf],pf)?vo.reportError(new GraphQLError(`Field "${uf}.${pf}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:hf.name})):ff[pf]?vo.reportError(new GraphQLError(`Field "${uf}.${pf}" can only be defined once.`,{nodes:[ff[pf],hf.name]})):ff[pf]=hf.name}return!1}}function hasField(vo,Ai){return isObjectType(vo)||isInterfaceType(vo)||isInputObjectType(vo)?vo.getFields()[Ai]!=null:!1}function UniqueFragmentNamesRule(vo){const Ai=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(bo){const Ra=bo.name.value;return Ai[Ra]?vo.reportError(new GraphQLError(`There can be only one fragment named "${Ra}".`,{nodes:[Ai[Ra],bo.name]})):Ai[Ra]=bo.name,!1}}}function UniqueInputFieldNamesRule(vo){const Ai=[];let bo=Object.create(null);return{ObjectValue:{enter(){Ai.push(bo),bo=Object.create(null)},leave(){const Ra=Ai.pop();Ra||invariant$1(),bo=Ra}},ObjectField(Ra){const hc=Ra.name.value;bo[hc]?vo.reportError(new GraphQLError(`There can be only one input field named "${hc}".`,{nodes:[bo[hc],Ra.name]})):bo[hc]=Ra.name}}}function UniqueOperationNamesRule(vo){const Ai=Object.create(null);return{OperationDefinition(bo){const Ra=bo.name;return Ra&&(Ai[Ra.value]?vo.reportError(new GraphQLError(`There can be only one operation named "${Ra.value}".`,{nodes:[Ai[Ra.value],Ra]})):Ai[Ra.value]=Ra),!1},FragmentDefinition:()=>!1}}function UniqueOperationTypesRule(vo){const Ai=vo.getSchema(),bo=Object.create(null),Ra=Ai?{query:Ai.getQueryType(),mutation:Ai.getMutationType(),subscription:Ai.getSubscriptionType()}:{};return{SchemaDefinition:hc,SchemaExtension:hc};function hc(pc){var mc;const uf=(mc=pc.operationTypes)!==null&&mc!==void 0?mc:[];for(const df of uf){const ff=df.operation,hf=bo[ff];Ra[ff]?vo.reportError(new GraphQLError(`Type for ${ff} already defined in the schema. It cannot be redefined.`,{nodes:df})):hf?vo.reportError(new GraphQLError(`There can be only one ${ff} type in schema.`,{nodes:[hf,df]})):bo[ff]=df}return!1}}function UniqueTypeNamesRule(vo){const Ai=Object.create(null),bo=vo.getSchema();return{ScalarTypeDefinition:Ra,ObjectTypeDefinition:Ra,InterfaceTypeDefinition:Ra,UnionTypeDefinition:Ra,EnumTypeDefinition:Ra,InputObjectTypeDefinition:Ra};function Ra(hc){const pc=hc.name.value;if(bo!=null&&bo.getType(pc)){vo.reportError(new GraphQLError(`Type "${pc}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:hc.name}));return}return Ai[pc]?vo.reportError(new GraphQLError(`There can be only one type named "${pc}".`,{nodes:[Ai[pc],hc.name]})):Ai[pc]=hc.name,!1}}function UniqueVariableNamesRule(vo){return{OperationDefinition(Ai){var bo;const Ra=(bo=Ai.variableDefinitions)!==null&&bo!==void 0?bo:[],hc=groupBy(Ra,pc=>pc.variable.name.value);for(const[pc,mc]of hc)mc.length>1&&vo.reportError(new GraphQLError(`There can be only one variable named "$${pc}".`,{nodes:mc.map(uf=>uf.variable.name)}))}}}function ValuesOfCorrectTypeRule(vo){let Ai={};return{OperationDefinition:{enter(){Ai={}}},VariableDefinition(bo){Ai[bo.variable.name.value]=bo},ListValue(bo){const Ra=getNullableType(vo.getParentInputType());if(!isListType(Ra))return isValidValueNode(vo,bo),!1},ObjectValue(bo){const Ra=getNamedType(vo.getInputType());if(!isInputObjectType(Ra))return isValidValueNode(vo,bo),!1;const hc=keyMap(bo.fields,pc=>pc.name.value);for(const pc of Object.values(Ra.getFields()))if(!hc[pc.name]&&isRequiredInputField(pc)){const mc=inspect(pc.type);vo.reportError(new GraphQLError(`Field "${Ra.name}.${pc.name}" of required type "${mc}" was not provided.`,{nodes:bo}))}Ra.isOneOf&&validateOneOfInputObject(vo,bo,Ra,hc,Ai)},ObjectField(bo){const Ra=getNamedType(vo.getParentInputType());if(!vo.getInputType()&&isInputObjectType(Ra)){const hc=suggestionList(bo.name.value,Object.keys(Ra.getFields()));vo.reportError(new GraphQLError(`Field "${bo.name.value}" is not defined by type "${Ra.name}".`+didYouMean(hc),{nodes:bo}))}},NullValue(bo){const Ra=vo.getInputType();isNonNullType(Ra)&&vo.reportError(new GraphQLError(`Expected value of type "${inspect(Ra)}", found ${print(bo)}.`,{nodes:bo}))},EnumValue:bo=>isValidValueNode(vo,bo),IntValue:bo=>isValidValueNode(vo,bo),FloatValue:bo=>isValidValueNode(vo,bo),StringValue:bo=>isValidValueNode(vo,bo),BooleanValue:bo=>isValidValueNode(vo,bo)}}function isValidValueNode(vo,Ai){const bo=vo.getInputType();if(!bo)return;const Ra=getNamedType(bo);if(!isLeafType(Ra)){const hc=inspect(bo);vo.reportError(new GraphQLError(`Expected value of type "${hc}", found ${print(Ai)}.`,{nodes:Ai}));return}try{if(Ra.parseLiteral(Ai,void 0)===void 0){const hc=inspect(bo);vo.reportError(new GraphQLError(`Expected value of type "${hc}", found ${print(Ai)}.`,{nodes:Ai}))}}catch(hc){const pc=inspect(bo);hc instanceof GraphQLError?vo.reportError(hc):vo.reportError(new GraphQLError(`Expected value of type "${pc}", found ${print(Ai)}; `+hc.message,{nodes:Ai,originalError:hc}))}}function validateOneOfInputObject(vo,Ai,bo,Ra,hc){var pc;const mc=Object.keys(Ra);if(mc.length!==1){vo.reportError(new GraphQLError(`OneOf Input Object "${bo.name}" must specify exactly one key.`,{nodes:[Ai]}));return}const uf=(pc=Ra[mc[0]])===null||pc===void 0?void 0:pc.value,df=!uf||uf.kind===Kind.NULL,ff=(uf==null?void 0:uf.kind)===Kind.VARIABLE;if(df){vo.reportError(new GraphQLError(`Field "${bo.name}.${mc[0]}" must be non-null.`,{nodes:[Ai]}));return}if(ff){const hf=uf.name.value;hc[hf].type.kind!==Kind.NON_NULL_TYPE&&vo.reportError(new GraphQLError(`Variable "${hf}" must be non-nullable to be used for OneOf Input Object "${bo.name}".`,{nodes:[Ai]}))}}function VariablesAreInputTypesRule(vo){return{VariableDefinition(Ai){const bo=typeFromAST(vo.getSchema(),Ai.type);if(bo!==void 0&&!isInputType(bo)){const Ra=Ai.variable.name.value,hc=print(Ai.type);vo.reportError(new GraphQLError(`Variable "$${Ra}" cannot be non-input type "${hc}".`,{nodes:Ai.type}))}}}}function VariablesInAllowedPositionRule(vo){let Ai=Object.create(null);return{OperationDefinition:{enter(){Ai=Object.create(null)},leave(bo){const Ra=vo.getRecursiveVariableUsages(bo);for(const{node:hc,type:pc,defaultValue:mc}of Ra){const uf=hc.name.value,df=Ai[uf];if(df&&pc){const ff=vo.getSchema(),hf=typeFromAST(ff,df.type);if(hf&&!allowedVariableUsage(ff,hf,df.defaultValue,pc,mc)){const pf=inspect(hf),mf=inspect(pc);vo.reportError(new GraphQLError(`Variable "$${uf}" of type "${pf}" used in position expecting type "${mf}".`,{nodes:[df,hc]}))}}}}},VariableDefinition(bo){Ai[bo.variable.name.value]=bo}}}function allowedVariableUsage(vo,Ai,bo,Ra,hc){if(isNonNullType(Ra)&&!isNonNullType(Ai)){if(!(bo!=null&&bo.kind!==Kind.NULL)&&hc===void 0)return!1;const pc=Ra.ofType;return isTypeSubTypeOf(vo,Ai,pc)}return isTypeSubTypeOf(vo,Ai,Ra)}const recommendedRules=Object.freeze([MaxIntrospectionDepthRule]),specifiedRules=Object.freeze([ExecutableDefinitionsRule,UniqueOperationNamesRule,LoneAnonymousOperationRule,SingleFieldSubscriptionsRule,KnownTypeNamesRule,FragmentsOnCompositeTypesRule,VariablesAreInputTypesRule,ScalarLeafsRule,FieldsOnCorrectTypeRule,UniqueFragmentNamesRule,KnownFragmentNamesRule,NoUnusedFragmentsRule,PossibleFragmentSpreadsRule,NoFragmentCyclesRule,UniqueVariableNamesRule,NoUndefinedVariablesRule,NoUnusedVariablesRule,KnownDirectivesRule,UniqueDirectivesPerLocationRule,KnownArgumentNamesRule,UniqueArgumentNamesRule,ValuesOfCorrectTypeRule,ProvidedRequiredArgumentsRule,VariablesInAllowedPositionRule,OverlappingFieldsCanBeMergedRule,UniqueInputFieldNamesRule,...recommendedRules]),specifiedSDLRules=Object.freeze([LoneSchemaDefinitionRule,UniqueOperationTypesRule,UniqueTypeNamesRule,UniqueEnumValueNamesRule,UniqueFieldDefinitionNamesRule,UniqueArgumentDefinitionNamesRule,UniqueDirectiveNamesRule,KnownTypeNamesRule,KnownDirectivesRule,UniqueDirectivesPerLocationRule,PossibleTypeExtensionsRule,KnownArgumentNamesOnDirectivesRule,UniqueArgumentNamesRule,UniqueInputFieldNamesRule,ProvidedRequiredArgumentsOnDirectivesRule]);class ASTValidationContext{constructor(Ai,bo){this._ast=Ai,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=bo}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(Ai){this._onError(Ai)}getDocument(){return this._ast}getFragment(Ai){let bo;if(this._fragments)bo=this._fragments;else{bo=Object.create(null);for(const Ra of this.getDocument().definitions)Ra.kind===Kind.FRAGMENT_DEFINITION&&(bo[Ra.name.value]=Ra);this._fragments=bo}return bo[Ai]}getFragmentSpreads(Ai){let bo=this._fragmentSpreads.get(Ai);if(!bo){bo=[];const Ra=[Ai];let hc;for(;hc=Ra.pop();)for(const pc of hc.selections)pc.kind===Kind.FRAGMENT_SPREAD?bo.push(pc):pc.selectionSet&&Ra.push(pc.selectionSet);this._fragmentSpreads.set(Ai,bo)}return bo}getRecursivelyReferencedFragments(Ai){let bo=this._recursivelyReferencedFragments.get(Ai);if(!bo){bo=[];const Ra=Object.create(null),hc=[Ai.selectionSet];let pc;for(;pc=hc.pop();)for(const mc of this.getFragmentSpreads(pc)){const uf=mc.name.value;if(Ra[uf]!==!0){Ra[uf]=!0;const df=this.getFragment(uf);df&&(bo.push(df),hc.push(df.selectionSet))}}this._recursivelyReferencedFragments.set(Ai,bo)}return bo}}class SDLValidationContext extends ASTValidationContext{constructor(Ai,bo,Ra){super(Ai,Ra),this._schema=bo}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class ValidationContext extends ASTValidationContext{constructor(Ai,bo,Ra,hc){super(bo,hc),this._schema=Ai,this._typeInfo=Ra,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(Ai){let bo=this._variableUsages.get(Ai);if(!bo){const Ra=[],hc=new TypeInfo(this._schema);visit(Ai,visitWithTypeInfo(hc,{VariableDefinition:()=>!1,Variable(pc){Ra.push({node:pc,type:hc.getInputType(),defaultValue:hc.getDefaultValue()})}})),bo=Ra,this._variableUsages.set(Ai,bo)}return bo}getRecursiveVariableUsages(Ai){let bo=this._recursiveVariableUsages.get(Ai);if(!bo){bo=this.getVariableUsages(Ai);for(const Ra of this.getRecursivelyReferencedFragments(Ai))bo=bo.concat(this.getVariableUsages(Ra));this._recursiveVariableUsages.set(Ai,bo)}return bo}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}function validate(vo,Ai,bo=specifiedRules,Ra,hc=new TypeInfo(vo)){var pc;const mc=(pc=void 0)!==null&&pc!==void 0?pc:100;Ai||devAssert(!1,"Must provide document."),assertValidSchema(vo);const uf=Object.freeze({}),df=[],ff=new ValidationContext(vo,Ai,hc,pf=>{if(df.length>=mc)throw df.push(new GraphQLError("Too many validation errors, error limit reached. Validation aborted.")),uf;df.push(pf)}),hf=visitInParallel(bo.map(pf=>pf(ff)));try{visit(Ai,visitWithTypeInfo(hc,hf))}catch(pf){if(pf!==uf)throw pf}return df}function validateSDL(vo,Ai,bo=specifiedSDLRules){const Ra=[],hc=new SDLValidationContext(vo,Ai,mc=>{Ra.push(mc)}),pc=bo.map(mc=>mc(hc));return visit(vo,visitInParallel(pc)),Ra}function assertValidSDL(vo){const Ai=validateSDL(vo);if(Ai.length!==0)throw new Error(Ai.map(bo=>bo.message).join(`
|
|
323
|
-
|
|
324
|
-
`))}function assertValidSDLExtension(vo,Ai){const bo=validateSDL(vo,Ai);if(bo.length!==0)throw new Error(bo.map(Ra=>Ra.message).join(`
|
|
325
|
-
|
|
326
|
-
`))}function toError(vo){return vo instanceof Error?vo:new NonErrorThrown(vo)}class NonErrorThrown extends Error{constructor(Ai){super("Unexpected error value: "+inspect(Ai)),this.name="NonErrorThrown",this.thrownValue=Ai}}function locatedError(vo,Ai,bo){var Ra;const hc=toError(vo);return isLocatedGraphQLError(hc)?hc:new GraphQLError(hc.message,{nodes:(Ra=hc.nodes)!==null&&Ra!==void 0?Ra:Ai,source:hc.source,positions:hc.positions,path:bo,originalError:hc})}function isLocatedGraphQLError(vo){return Array.isArray(vo.path)}function NoDeprecatedCustomRule(vo){return{Field(Ai){const bo=vo.getFieldDef(),Ra=bo==null?void 0:bo.deprecationReason;if(bo&&Ra!=null){const hc=vo.getParentType();hc!=null||invariant$1(),vo.reportError(new GraphQLError(`The field ${hc.name}.${bo.name} is deprecated. ${Ra}`,{nodes:Ai}))}},Argument(Ai){const bo=vo.getArgument(),Ra=bo==null?void 0:bo.deprecationReason;if(bo&&Ra!=null){const hc=vo.getDirective();if(hc!=null)vo.reportError(new GraphQLError(`Directive "@${hc.name}" argument "${bo.name}" is deprecated. ${Ra}`,{nodes:Ai}));else{const pc=vo.getParentType(),mc=vo.getFieldDef();pc!=null&&mc!=null||invariant$1(),vo.reportError(new GraphQLError(`Field "${pc.name}.${mc.name}" argument "${bo.name}" is deprecated. ${Ra}`,{nodes:Ai}))}}},ObjectField(Ai){const bo=getNamedType(vo.getParentInputType());if(isInputObjectType(bo)){const Ra=bo.getFields()[Ai.name.value],hc=Ra==null?void 0:Ra.deprecationReason;hc!=null&&vo.reportError(new GraphQLError(`The input field ${bo.name}.${Ra.name} is deprecated. ${hc}`,{nodes:Ai}))}},EnumValue(Ai){const bo=vo.getEnumValue(),Ra=bo==null?void 0:bo.deprecationReason;if(bo&&Ra!=null){const hc=getNamedType(vo.getInputType());hc!=null||invariant$1(),vo.reportError(new GraphQLError(`The enum value "${hc.name}.${bo.name}" is deprecated. ${Ra}`,{nodes:Ai}))}}}}function extendSchema(vo,Ai,bo){assertSchema(vo),Ai!=null&&Ai.kind===Kind.DOCUMENT||devAssert(!1,"Must provide valid Document AST."),assertValidSDLExtension(Ai,vo);const Ra=vo.toConfig(),hc=extendSchemaImpl(Ra,Ai,bo);return Ra===hc?vo:new GraphQLSchema(hc)}function extendSchemaImpl(vo,Ai,bo){var Ra,hc,pc,mc;const uf=[],df=Object.create(null),ff=[];let hf;const pf=[];for(const E1 of Ai.definitions)if(E1.kind===Kind.SCHEMA_DEFINITION)hf=E1;else if(E1.kind===Kind.SCHEMA_EXTENSION)pf.push(E1);else if(isTypeDefinitionNode(E1))uf.push(E1);else if(isTypeExtensionNode(E1)){const F1=E1.name.value,M1=df[F1];df[F1]=M1?M1.concat([E1]):[E1]}else E1.kind===Kind.DIRECTIVE_DEFINITION&&ff.push(E1);if(Object.keys(df).length===0&&uf.length===0&&ff.length===0&&pf.length===0&&hf==null)return vo;const mf=Object.create(null);for(const E1 of vo.types)mf[E1.name]=xf(E1);for(const E1 of uf){var gf;const F1=E1.name.value;mf[F1]=(gf=stdTypeMap[F1])!==null&&gf!==void 0?gf:H1(E1)}const yf={query:vo.query&&bf(vo.query),mutation:vo.mutation&&bf(vo.mutation),subscription:vo.subscription&&bf(vo.subscription),...hf&&R1([hf]),...R1(pf)};return{description:(Ra=hf)===null||Ra===void 0||(hc=Ra.description)===null||hc===void 0?void 0:hc.value,...yf,types:Object.values(mf),directives:[...vo.directives.map(Sf),...ff.map(f1)],extensions:Object.create(null),astNode:(pc=hf)!==null&&pc!==void 0?pc:vo.astNode,extensionASTNodes:vo.extensionASTNodes.concat(pf),assumeValid:(mc=bo==null?void 0:bo.assumeValid)!==null&&mc!==void 0?mc:!1};function vf(E1){return isListType(E1)?new GraphQLList(vf(E1.ofType)):isNonNullType(E1)?new GraphQLNonNull(vf(E1.ofType)):bf(E1)}function bf(E1){return mf[E1.name]}function Sf(E1){const F1=E1.toConfig();return new GraphQLDirective({...F1,args:mapValue(F1.args,N1)})}function xf(E1){if(isIntrospectionType(E1)||isSpecifiedScalarType(E1))return E1;if(isScalarType(E1))return If(E1);if(isObjectType(E1))return l1(E1);if(isInterfaceType(E1))return c1(E1);if(isUnionType(E1))return m1(E1);if(isEnumType(E1))return s1(E1);if(isInputObjectType(E1))return wf(E1);invariant$1(!1,"Unexpected type: "+inspect(E1))}function wf(E1){var F1;const M1=E1.toConfig(),q1=(F1=df[M1.name])!==null&&F1!==void 0?F1:[];return new GraphQLInputObjectType({...M1,fields:()=>({...mapValue(M1.fields,z1=>({...z1,type:vf(z1.type)})),...L1(q1)}),extensionASTNodes:M1.extensionASTNodes.concat(q1)})}function s1(E1){var F1;const M1=E1.toConfig(),q1=(F1=df[E1.name])!==null&&F1!==void 0?F1:[];return new GraphQLEnumType({...M1,values:{...M1.values,...B1(q1)},extensionASTNodes:M1.extensionASTNodes.concat(q1)})}function If(E1){var F1;const M1=E1.toConfig(),q1=(F1=df[M1.name])!==null&&F1!==void 0?F1:[];let z1=M1.specifiedByURL;for(const J1 of q1){var W1;z1=(W1=getSpecifiedByURL(J1))!==null&&W1!==void 0?W1:z1}return new GraphQLScalarType({...M1,specifiedByURL:z1,extensionASTNodes:M1.extensionASTNodes.concat(q1)})}function l1(E1){var F1;const M1=E1.toConfig(),q1=(F1=df[M1.name])!==null&&F1!==void 0?F1:[];return new GraphQLObjectType({...M1,interfaces:()=>[...E1.getInterfaces().map(bf),...V1(q1)],fields:()=>({...mapValue(M1.fields,k1),...T1(q1)}),extensionASTNodes:M1.extensionASTNodes.concat(q1)})}function c1(E1){var F1;const M1=E1.toConfig(),q1=(F1=df[M1.name])!==null&&F1!==void 0?F1:[];return new GraphQLInterfaceType({...M1,interfaces:()=>[...E1.getInterfaces().map(bf),...V1(q1)],fields:()=>({...mapValue(M1.fields,k1),...T1(q1)}),extensionASTNodes:M1.extensionASTNodes.concat(q1)})}function m1(E1){var F1;const M1=E1.toConfig(),q1=(F1=df[M1.name])!==null&&F1!==void 0?F1:[];return new GraphQLUnionType({...M1,types:()=>[...E1.getTypes().map(bf),...Z1(q1)],extensionASTNodes:M1.extensionASTNodes.concat(q1)})}function k1(E1){return{...E1,type:vf(E1.type),args:E1.args&&mapValue(E1.args,N1)}}function N1(E1){return{...E1,type:vf(E1.type)}}function R1(E1){const F1={};for(const q1 of E1){var M1;const z1=(M1=q1.operationTypes)!==null&&M1!==void 0?M1:[];for(const W1 of z1)F1[W1.operation]=$1(W1.type)}return F1}function $1(E1){var F1;const M1=E1.name.value,q1=(F1=stdTypeMap[M1])!==null&&F1!==void 0?F1:mf[M1];if(q1===void 0)throw new Error(`Unknown type: "${M1}".`);return q1}function D1(E1){return E1.kind===Kind.LIST_TYPE?new GraphQLList(D1(E1.type)):E1.kind===Kind.NON_NULL_TYPE?new GraphQLNonNull(D1(E1.type)):$1(E1)}function f1(E1){var F1;return new GraphQLDirective({name:E1.name.value,description:(F1=E1.description)===null||F1===void 0?void 0:F1.value,locations:E1.locations.map(({value:M1})=>M1),isRepeatable:E1.repeatable,args:A1(E1.arguments),astNode:E1})}function T1(E1){const F1=Object.create(null);for(const z1 of E1){var M1;const W1=(M1=z1.fields)!==null&&M1!==void 0?M1:[];for(const J1 of W1){var q1;F1[J1.name.value]={type:D1(J1.type),description:(q1=J1.description)===null||q1===void 0?void 0:q1.value,args:A1(J1.arguments),deprecationReason:getDeprecationReason(J1),astNode:J1}}}return F1}function A1(E1){const F1=E1??[],M1=Object.create(null);for(const z1 of F1){var q1;const W1=D1(z1.type);M1[z1.name.value]={type:W1,description:(q1=z1.description)===null||q1===void 0?void 0:q1.value,defaultValue:valueFromAST(z1.defaultValue,W1),deprecationReason:getDeprecationReason(z1),astNode:z1}}return M1}function L1(E1){const F1=Object.create(null);for(const z1 of E1){var M1;const W1=(M1=z1.fields)!==null&&M1!==void 0?M1:[];for(const J1 of W1){var q1;const eT=D1(J1.type);F1[J1.name.value]={type:eT,description:(q1=J1.description)===null||q1===void 0?void 0:q1.value,defaultValue:valueFromAST(J1.defaultValue,eT),deprecationReason:getDeprecationReason(J1),astNode:J1}}}return F1}function B1(E1){const F1=Object.create(null);for(const z1 of E1){var M1;const W1=(M1=z1.values)!==null&&M1!==void 0?M1:[];for(const J1 of W1){var q1;F1[J1.name.value]={description:(q1=J1.description)===null||q1===void 0?void 0:q1.value,deprecationReason:getDeprecationReason(J1),astNode:J1}}}return F1}function V1(E1){return E1.flatMap(F1=>{var M1,q1;return(M1=(q1=F1.interfaces)===null||q1===void 0?void 0:q1.map($1))!==null&&M1!==void 0?M1:[]})}function Z1(E1){return E1.flatMap(F1=>{var M1,q1;return(M1=(q1=F1.types)===null||q1===void 0?void 0:q1.map($1))!==null&&M1!==void 0?M1:[]})}function H1(E1){var F1;const M1=E1.name.value,q1=(F1=df[M1])!==null&&F1!==void 0?F1:[];switch(E1.kind){case Kind.OBJECT_TYPE_DEFINITION:{var z1;const iT=[E1,...q1];return new GraphQLObjectType({name:M1,description:(z1=E1.description)===null||z1===void 0?void 0:z1.value,interfaces:()=>V1(iT),fields:()=>T1(iT),astNode:E1,extensionASTNodes:q1})}case Kind.INTERFACE_TYPE_DEFINITION:{var W1;const iT=[E1,...q1];return new GraphQLInterfaceType({name:M1,description:(W1=E1.description)===null||W1===void 0?void 0:W1.value,interfaces:()=>V1(iT),fields:()=>T1(iT),astNode:E1,extensionASTNodes:q1})}case Kind.ENUM_TYPE_DEFINITION:{var J1;const iT=[E1,...q1];return new GraphQLEnumType({name:M1,description:(J1=E1.description)===null||J1===void 0?void 0:J1.value,values:B1(iT),astNode:E1,extensionASTNodes:q1})}case Kind.UNION_TYPE_DEFINITION:{var eT;const iT=[E1,...q1];return new GraphQLUnionType({name:M1,description:(eT=E1.description)===null||eT===void 0?void 0:eT.value,types:()=>Z1(iT),astNode:E1,extensionASTNodes:q1})}case Kind.SCALAR_TYPE_DEFINITION:{var nT;return new GraphQLScalarType({name:M1,description:(nT=E1.description)===null||nT===void 0?void 0:nT.value,specifiedByURL:getSpecifiedByURL(E1),astNode:E1,extensionASTNodes:q1})}case Kind.INPUT_OBJECT_TYPE_DEFINITION:{var sT;const iT=[E1,...q1];return new GraphQLInputObjectType({name:M1,description:(sT=E1.description)===null||sT===void 0?void 0:sT.value,fields:()=>L1(iT),astNode:E1,extensionASTNodes:q1,isOneOf:isOneOf(E1)})}}}}const stdTypeMap=keyMap([...specifiedScalarTypes,...introspectionTypes],vo=>vo.name);function getDeprecationReason(vo){const Ai=getDirectiveValues(GraphQLDeprecatedDirective,vo);return Ai==null?void 0:Ai.reason}function getSpecifiedByURL(vo){const Ai=getDirectiveValues(GraphQLSpecifiedByDirective,vo);return Ai==null?void 0:Ai.url}function isOneOf(vo){return!!getDirectiveValues(GraphQLOneOfDirective,vo)}function buildASTSchema(vo,Ai){vo!=null&&vo.kind===Kind.DOCUMENT||devAssert(!1,"Must provide valid Document AST."),(Ai==null?void 0:Ai.assumeValid)!==!0&&(Ai==null?void 0:Ai.assumeValidSDL)!==!0&&assertValidSDL(vo);const bo=extendSchemaImpl({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},vo,Ai);if(bo.astNode==null)for(const hc of bo.types)switch(hc.name){case"Query":bo.query=hc;break;case"Mutation":bo.mutation=hc;break;case"Subscription":bo.subscription=hc;break}const Ra=[...bo.directives,...specifiedDirectives.filter(hc=>bo.directives.every(pc=>pc.name!==hc.name))];return new GraphQLSchema({...bo,directives:Ra})}function buildSchema(vo,Ai){const bo=parse(vo,{noLocation:void 0,allowLegacyFragmentVariables:void 0});return buildASTSchema(bo,{assumeValidSDL:void 0,assumeValid:void 0})}function printSchema(vo){return printFilteredSchema(vo,Ai=>!isSpecifiedDirective(Ai),isDefinedType)}function isDefinedType(vo){return!isSpecifiedScalarType(vo)&&!isIntrospectionType(vo)}function printFilteredSchema(vo,Ai,bo){const Ra=vo.getDirectives().filter(Ai),hc=Object.values(vo.getTypeMap()).filter(bo);return[printSchemaDefinition(vo),...Ra.map(pc=>printDirective(pc)),...hc.map(pc=>printType(pc))].filter(Boolean).join(`
|
|
327
|
-
|
|
328
|
-
`)}function printSchemaDefinition(vo){if(vo.description==null&&isSchemaOfCommonNames(vo))return;const Ai=[],bo=vo.getQueryType();bo&&Ai.push(` query: ${bo.name}`);const Ra=vo.getMutationType();Ra&&Ai.push(` mutation: ${Ra.name}`);const hc=vo.getSubscriptionType();return hc&&Ai.push(` subscription: ${hc.name}`),printDescription(vo)+`schema {
|
|
329
|
-
${Ai.join(`
|
|
330
|
-
`)}
|
|
331
|
-
}`}function isSchemaOfCommonNames(vo){const Ai=vo.getQueryType();if(Ai&&Ai.name!=="Query")return!1;const bo=vo.getMutationType();if(bo&&bo.name!=="Mutation")return!1;const Ra=vo.getSubscriptionType();return!(Ra&&Ra.name!=="Subscription")}function printType(vo){if(isScalarType(vo))return printScalar(vo);if(isObjectType(vo))return printObject(vo);if(isInterfaceType(vo))return printInterface(vo);if(isUnionType(vo))return printUnion(vo);if(isEnumType(vo))return printEnum(vo);if(isInputObjectType(vo))return printInputObject(vo);invariant$1(!1,"Unexpected type: "+inspect(vo))}function printScalar(vo){return printDescription(vo)+`scalar ${vo.name}`+printSpecifiedByURL(vo)}function printImplementedInterfaces(vo){const Ai=vo.getInterfaces();return Ai.length?" implements "+Ai.map(bo=>bo.name).join(" & "):""}function printObject(vo){return printDescription(vo)+`type ${vo.name}`+printImplementedInterfaces(vo)+printFields(vo)}function printInterface(vo){return printDescription(vo)+`interface ${vo.name}`+printImplementedInterfaces(vo)+printFields(vo)}function printUnion(vo){const Ai=vo.getTypes(),bo=Ai.length?" = "+Ai.join(" | "):"";return printDescription(vo)+"union "+vo.name+bo}function printEnum(vo){const Ai=vo.getValues().map((bo,Ra)=>printDescription(bo," ",!Ra)+" "+bo.name+printDeprecated(bo.deprecationReason));return printDescription(vo)+`enum ${vo.name}`+printBlock(Ai)}function printInputObject(vo){const Ai=Object.values(vo.getFields()).map((bo,Ra)=>printDescription(bo," ",!Ra)+" "+printInputValue(bo));return printDescription(vo)+`input ${vo.name}`+(vo.isOneOf?" @oneOf":"")+printBlock(Ai)}function printFields(vo){const Ai=Object.values(vo.getFields()).map((bo,Ra)=>printDescription(bo," ",!Ra)+" "+bo.name+printArgs(bo.args," ")+": "+String(bo.type)+printDeprecated(bo.deprecationReason));return printBlock(Ai)}function printBlock(vo){return vo.length!==0?` {
|
|
332
|
-
`+vo.join(`
|
|
333
|
-
`)+`
|
|
334
|
-
}`:""}function printArgs(vo,Ai=""){return vo.length===0?"":vo.every(bo=>!bo.description)?"("+vo.map(printInputValue).join(", ")+")":`(
|
|
335
|
-
`+vo.map((bo,Ra)=>printDescription(bo," "+Ai,!Ra)+" "+Ai+printInputValue(bo)).join(`
|
|
336
|
-
`)+`
|
|
337
|
-
`+Ai+")"}function printInputValue(vo){const Ai=astFromValue(vo.defaultValue,vo.type);let bo=vo.name+": "+String(vo.type);return Ai&&(bo+=` = ${print(Ai)}`),bo+printDeprecated(vo.deprecationReason)}function printDirective(vo){return printDescription(vo)+"directive @"+vo.name+printArgs(vo.args)+(vo.isRepeatable?" repeatable":"")+" on "+vo.locations.join(" | ")}function printDeprecated(vo){return vo==null?"":vo!==DEFAULT_DEPRECATION_REASON?` @deprecated(reason: ${print({kind:Kind.STRING,value:vo})})`:" @deprecated"}function printSpecifiedByURL(vo){return vo.specifiedByURL==null?"":` @specifiedBy(url: ${print({kind:Kind.STRING,value:vo.specifiedByURL})})`}function printDescription(vo,Ai="",bo=!0){const{description:Ra}=vo;if(Ra==null)return"";const hc=print({kind:Kind.STRING,value:Ra,block:isPrintableAsBlockString(Ra)});return(Ai&&!bo?`
|
|
338
|
-
`+Ai:Ai)+hc.replace(/\n/g,`
|
|
339
|
-
`+Ai)+`
|
|
340
|
-
`}function makeStateObject(vo,Ai){const bo=makeStateObjectName(vo,Ai),Ra={kind:Kind.OBJECT_TYPE_DEFINITION,name:{kind:Kind.NAME,value:bo},fields:[{description:{kind:Kind.STRING,value:`Add your ${Ai} state fields here`,block:!1},kind:Kind.FIELD_DEFINITION,name:{kind:Kind.NAME,value:"_placeholder"},type:{kind:Kind.NAMED_TYPE,name:{kind:Kind.NAME,value:"String"}}}]};return print(Ra)}function makeEmptyInputObject(vo){const Ai={kind:Kind.INPUT_OBJECT_TYPE_DEFINITION,name:{kind:Kind.NAME,value:vo},fields:[{description:{kind:Kind.STRING,value:"Add your inputs here",block:!1},kind:Kind.INPUT_VALUE_DEFINITION,name:{kind:Kind.NAME,value:"_placeholder"},type:{kind:Kind.NAMED_TYPE,name:{kind:Kind.NAME,value:"String"}}}]};return print(Ai)}function makeOperationInputName(vo){return`${pascalCase(vo)}Input`}function makeStateObjectName(vo,Ai){return`${pascalCase(vo)}${Ai==="local"?"Local":""}State`}function makeOperationInitialDoc(vo){const Ai=makeOperationInputName(vo);return makeEmptyInputObject(Ai)}function makeInitialSchemaDoc(vo,Ai){return makeStateObject(vo,Ai)}function isValidScalarValue(vo,Ai){if(vo in customScalars){const bo=customScalars[vo];if(bo instanceof GraphQLScalarType)return bo.parseValue(Ai)!==void 0}switch(vo){case"Int":return Number.isInteger(Ai);case"Float":return typeof Ai=="number";case"Boolean":return typeof Ai=="boolean";case"DateTime":return typeof Ai=="string"&&!isNaN(Date.parse(Ai));case"ID":case"String":default:return typeof Ai=="string"}}function getMinimalValue(vo,Ai,bo){const Ra=getNullableType(vo);if(isScalarType(Ra)){const hc=Ra.name;if(bo!==void 0&&isValidScalarValue(hc,bo))return bo;switch(hc){case"Int":case"Float":return 0;case"Boolean":return!1;case"DateTime":return new Date().toISOString();case"ID":case"String":default:return""}}if(isEnumType(Ra)){const hc=Ra.getValues().map(pc=>pc.value);return bo!==void 0&&hc.includes(bo)?bo:hc[0]||null}if(isListType(Ra))return bo!==void 0&&Array.isArray(bo)?bo:[];if(isObjectType(Ra)){const hc={},pc=Ra.getFields(),mc=bo;for(const uf in pc){const df=pc[uf],ff=mc?mc[uf]:void 0;hc[uf]=getMinimalValue(df.type,Ai,ff)}return hc}return null}function makeMinimalObjectFromSDL(vo,Ai,bo){const Ra=buildASTSchema(parse(vo)),hc=parse(Ai),pc=[];if(hc.definitions.forEach(hf=>{(hf.kind===Kind.OBJECT_TYPE_DEFINITION||hf.kind===Kind.OBJECT_TYPE_EXTENSION)&&pc.push(hf.name.value)}),pc.length===0)throw new Error("No object type definition found in SDL.");const mc=pc[0];let uf=Ra.getType(mc),df=Ra;if((!uf||!isObjectType(uf))&&(df=extendSchema(Ra,hc),uf=df.getType(mc)),!uf||!isObjectType(uf))throw new Error(`Type "${mc}" is not a valid ObjectType.`);const ff=getMinimalValue(uf,df,bo);return JSON.stringify(ff,null,2)}function removeWhitespace(vo){return vo.replace(/\s+|\\n|\\t/g,"").toLowerCase()}function compareStringsWithoutWhitespace(vo,Ai){return removeWhitespace(vo)===removeWhitespace(Ai)}function renameSchemaType(vo,Ai,bo,Ra){const hc=Ra==="global"?"State":"LocalState",pc=`${pascalCase(Ai)}${hc}`,mc=`${pascalCase(bo)}${hc}`,uf=parse(vo),df=visit(uf,{ObjectTypeDefinition:ff=>{if(ff.name.value===pc)return{...ff,name:{...ff.name,value:mc}}}});return print(df)}function initializeModelSchema(vo){const{modelName:Ai,setStateSchema:bo}=vo,Ra=makeInitialSchemaDoc(Ai,"global");bo(Ra,"global")}function updateModelSchemaNames(vo){const{oldName:Ai,newName:bo,globalStateSchema:Ra,localStateSchema:hc,setStateSchema:pc}=vo,mc=renameSchemaType(Ra,Ai,bo,"global");if(pc(mc,"global"),hc){const uf=renameSchemaType(hc,Ai,bo,"local");pc(uf,"local")}}function handleModelNameChange(vo){const{oldName:Ai,newName:bo,globalStateSchema:Ra,setStateSchema:hc}=vo;if(!Ra){initializeModelSchema({modelName:bo,setStateSchema:hc});return}updateModelSchemaNames(vo)}const labelVariants=cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Label=y$2.forwardRef(({className:vo,...Ai},bo)=>jsx(Root,{ref:bo,className:cn(labelVariants(),vo),...Ai}));Label.displayName=Root.displayName;var validator$1={exports:{}},toDate={exports:{}},assertString={exports:{}},hasRequiredAssertString;function requireAssertString(){return hasRequiredAssertString||(hasRequiredAssertString=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=Ra;function bo(hc){"@babel/helpers - typeof";return bo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(pc){return typeof pc}:function(pc){return pc&&typeof Symbol=="function"&&pc.constructor===Symbol&&pc!==Symbol.prototype?"symbol":typeof pc},bo(hc)}function Ra(hc){var pc=typeof hc=="string"||hc instanceof String;if(!pc){var mc=bo(hc);throw hc===null?mc="null":mc==="object"&&(mc=hc.constructor.name),new TypeError("Expected a string but received a ".concat(mc))}}vo.exports=Ai.default,vo.exports.default=Ai.default}(assertString,assertString.exports)),assertString.exports}var hasRequiredToDate;function requireToDate(){return hasRequiredToDate||(hasRequiredToDate=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hc;var bo=Ra(requireAssertString());function Ra(pc){return pc&&pc.__esModule?pc:{default:pc}}function hc(pc){return(0,bo.default)(pc),pc=Date.parse(pc),isNaN(pc)?null:new Date(pc)}vo.exports=Ai.default,vo.exports.default=Ai.default}(toDate,toDate.exports)),toDate.exports}var toFloat={exports:{}},isFloat={},alpha={},hasRequiredAlpha;function requireAlpha(){if(hasRequiredAlpha)return alpha;hasRequiredAlpha=1,Object.defineProperty(alpha,"__esModule",{value:!0}),alpha.farsiLocales=alpha.englishLocales=alpha.dotDecimal=alpha.decimal=alpha.commaDecimal=alpha.bengaliLocales=alpha.arabicLocales=alpha.alphanumeric=alpha.alpha=void 0;for(var vo=alpha.alpha={"en-US":/^[A-Z]+$/i,"az-AZ":/^[A-VXYZÇƏĞİıÖŞÜ]+$/i,"bg-BG":/^[А-Я]+$/i,"cs-CZ":/^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[A-ZÆØÅ]+$/i,"de-DE":/^[A-ZÄÖÜß]+$/i,"el-GR":/^[Α-ώ]+$/i,"es-ES":/^[A-ZÁÉÍÑÓÚÜ]+$/i,"fa-IR":/^[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]+$/i,"fi-FI":/^[A-ZÅÄÖ]+$/i,"fr-FR":/^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[A-ZÀÉÈÌÎÓÒÙ]+$/i,"ja-JP":/^[ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,"nb-NO":/^[A-ZÆØÅ]+$/i,"nl-NL":/^[A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[A-ZÆØÅ]+$/i,"hu-HU":/^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"pl-PL":/^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,"ru-RU":/^[А-ЯЁ]+$/i,"kk-KZ":/^[А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,"sl-SI":/^[A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[A-ZÅÄÖ]+$/i,"th-TH":/^[ก-๐\s]+$/i,"tr-TR":/^[A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[А-ЩЬЮЯЄIЇҐі]+$/i,"vi-VN":/^[A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,"ko-KR":/^[ㄱ-ㅎㅏ-ㅣ가-힣]*$/,"ku-IQ":/^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,ar:/^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,he:/^[א-ת]+$/,fa:/^['آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی']+$/i,bn:/^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,eo:/^[ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,"hi-IN":/^[\u0900-\u0961]+[\u0972-\u097F]*$/i,"si-LK":/^[\u0D80-\u0DFF]+$/},Ai=alpha.alphanumeric={"en-US":/^[0-9A-Z]+$/i,"az-AZ":/^[0-9A-VXYZÇƏĞİıÖŞÜ]+$/i,"bg-BG":/^[0-9А-Я]+$/i,"cs-CZ":/^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[0-9A-ZÆØÅ]+$/i,"de-DE":/^[0-9A-ZÄÖÜß]+$/i,"el-GR":/^[0-9Α-ω]+$/i,"es-ES":/^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,"fi-FI":/^[0-9A-ZÅÄÖ]+$/i,"fr-FR":/^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i,"ja-JP":/^[0-90-9ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,"hu-HU":/^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"nb-NO":/^[0-9A-ZÆØÅ]+$/i,"nl-NL":/^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[0-9A-ZÆØÅ]+$/i,"pl-PL":/^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[0-9A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,"ru-RU":/^[0-9А-ЯЁ]+$/i,"kk-KZ":/^[0-9А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,"sl-SI":/^[0-9A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[0-9A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[0-9А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[0-9A-ZÅÄÖ]+$/i,"th-TH":/^[ก-๙\s]+$/i,"tr-TR":/^[0-9A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[0-9А-ЩЬЮЯЄIЇҐі]+$/i,"ko-KR":/^[0-9ㄱ-ㅎㅏ-ㅣ가-힣]*$/,"ku-IQ":/^[٠١٢٣٤٥٦٧٨٩0-9ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,"vi-VN":/^[0-9A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,ar:/^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,he:/^[0-9א-ת]+$/,fa:/^['0-9آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی۱۲۳۴۵۶۷۸۹۰']+$/i,bn:/^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣ০১২৩৪৫৬৭৮৯ৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,eo:/^[0-9ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,"hi-IN":/^[\u0900-\u0963]+[\u0966-\u097F]*$/i,"si-LK":/^[0-9\u0D80-\u0DFF]+$/},bo=alpha.decimal={"en-US":".",ar:"٫"},Ra=alpha.englishLocales=["AU","GB","HK","IN","NZ","ZA","ZM"],hc,pc=0;pc<Ra.length;pc++)hc="en-".concat(Ra[pc]),vo[hc]=vo["en-US"],Ai[hc]=Ai["en-US"],bo[hc]=bo["en-US"];for(var mc=alpha.arabicLocales=["AE","BH","DZ","EG","IQ","JO","KW","LB","LY","MA","QM","QA","SA","SD","SY","TN","YE"],uf,df=0;df<mc.length;df++)uf="ar-".concat(mc[df]),vo[uf]=vo.ar,Ai[uf]=Ai.ar,bo[uf]=bo.ar;for(var ff=alpha.farsiLocales=["IR","AF"],hf,pf=0;pf<ff.length;pf++)hf="fa-".concat(ff[pf]),Ai[hf]=Ai.fa,bo[hf]=bo.ar;for(var mf=alpha.bengaliLocales=["BD","IN"],gf,yf=0;yf<mf.length;yf++)gf="bn-".concat(mf[yf]),vo[gf]=vo.bn,Ai[gf]=Ai.bn,bo[gf]=bo["en-US"];for(var vf=alpha.dotDecimal=["ar-EG","ar-LB","ar-LY"],bf=alpha.commaDecimal=["bg-BG","cs-CZ","da-DK","de-DE","el-GR","en-ZM","eo","es-ES","fr-CA","fr-FR","id-ID","it-IT","ku-IQ","hi-IN","hu-HU","nb-NO","nn-NO","nl-NL","pl-PL","pt-PT","ru-RU","kk-KZ","si-LK","sl-SI","sr-RS@latin","sr-RS","sv-SE","tr-TR","uk-UA","vi-VN"],Sf=0;Sf<vf.length;Sf++)bo[vf[Sf]]=bo["en-US"];for(var xf=0;xf<bf.length;xf++)bo[bf[xf]]=",";return vo["fr-CA"]=vo["fr-FR"],Ai["fr-CA"]=Ai["fr-FR"],vo["pt-BR"]=vo["pt-PT"],Ai["pt-BR"]=Ai["pt-PT"],bo["pt-BR"]=bo["pt-PT"],vo["pl-Pl"]=vo["pl-PL"],Ai["pl-Pl"]=Ai["pl-PL"],bo["pl-Pl"]=bo["pl-PL"],vo["fa-AF"]=vo.fa,alpha}var hasRequiredIsFloat;function requireIsFloat(){if(hasRequiredIsFloat)return isFloat;hasRequiredIsFloat=1,Object.defineProperty(isFloat,"__esModule",{value:!0}),isFloat.default=Ra,isFloat.locales=void 0;var vo=bo(requireAssertString()),Ai=requireAlpha();function bo(hc){return hc&&hc.__esModule?hc:{default:hc}}function Ra(hc,pc){(0,vo.default)(hc),pc=pc||{};var mc=new RegExp("^(?:[-+])?(?:[0-9]+)?(?:\\".concat(pc.locale?Ai.decimal[pc.locale]:".","[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$"));if(hc===""||hc==="."||hc===","||hc==="-"||hc==="+")return!1;var uf=parseFloat(hc.replace(",","."));return mc.test(hc)&&(!pc.hasOwnProperty("min")||uf>=pc.min)&&(!pc.hasOwnProperty("max")||uf<=pc.max)&&(!pc.hasOwnProperty("lt")||uf<pc.lt)&&(!pc.hasOwnProperty("gt")||uf>pc.gt)}return isFloat.locales=Object.keys(Ai.decimal),isFloat}var hasRequiredToFloat;function requireToFloat(){return hasRequiredToFloat||(hasRequiredToFloat=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hc;var bo=Ra(requireIsFloat());function Ra(pc){return pc&&pc.__esModule?pc:{default:pc}}function hc(pc){return(0,bo.default)(pc)?parseFloat(pc):NaN}vo.exports=Ai.default,vo.exports.default=Ai.default}(toFloat,toFloat.exports)),toFloat.exports}var toInt={exports:{}},hasRequiredToInt;function requireToInt(){return hasRequiredToInt||(hasRequiredToInt=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hc;var bo=Ra(requireAssertString());function Ra(pc){return pc&&pc.__esModule?pc:{default:pc}}function hc(pc,mc){return(0,bo.default)(pc),parseInt(pc,mc||10)}vo.exports=Ai.default,vo.exports.default=Ai.default}(toInt,toInt.exports)),toInt.exports}var toBoolean={exports:{}},hasRequiredToBoolean;function requireToBoolean(){return hasRequiredToBoolean||(hasRequiredToBoolean=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hc;var bo=Ra(requireAssertString());function Ra(pc){return pc&&pc.__esModule?pc:{default:pc}}function hc(pc,mc){return(0,bo.default)(pc),mc?pc==="1"||/^true$/i.test(pc):pc!=="0"&&!/^false$/i.test(pc)&&pc!==""}vo.exports=Ai.default,vo.exports.default=Ai.default}(toBoolean,toBoolean.exports)),toBoolean.exports}var equals={exports:{}},hasRequiredEquals;function requireEquals(){return hasRequiredEquals||(hasRequiredEquals=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hc;var bo=Ra(requireAssertString());function Ra(pc){return pc&&pc.__esModule?pc:{default:pc}}function hc(pc,mc){return(0,bo.default)(pc),pc===mc}vo.exports=Ai.default,vo.exports.default=Ai.default}(equals,equals.exports)),equals.exports}var contains$1={exports:{}},toString$1={exports:{}},hasRequiredToString;function requireToString(){return hasRequiredToString||(hasRequiredToString=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=Ra;function bo(hc){"@babel/helpers - typeof";return bo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(pc){return typeof pc}:function(pc){return pc&&typeof Symbol=="function"&&pc.constructor===Symbol&&pc!==Symbol.prototype?"symbol":typeof pc},bo(hc)}function Ra(hc){return bo(hc)==="object"&&hc!==null?typeof hc.toString=="function"?hc=hc.toString():hc="[object Object]":(hc===null||typeof hc>"u"||isNaN(hc)&&!hc.length)&&(hc=""),String(hc)}vo.exports=Ai.default,vo.exports.default=Ai.default}(toString$1,toString$1.exports)),toString$1.exports}var merge={exports:{}},hasRequiredMerge;function requireMerge(){return hasRequiredMerge||(hasRequiredMerge=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=bo;function bo(){var Ra=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},hc=arguments.length>1?arguments[1]:void 0;for(var pc in hc)typeof Ra[pc]>"u"&&(Ra[pc]=hc[pc]);return Ra}vo.exports=Ai.default,vo.exports.default=Ai.default}(merge,merge.exports)),merge.exports}var hasRequiredContains;function requireContains(){return hasRequiredContains||(hasRequiredContains=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=uf;var bo=pc(requireAssertString()),Ra=pc(requireToString()),hc=pc(requireMerge());function pc(df){return df&&df.__esModule?df:{default:df}}var mc={ignoreCase:!1,minOccurrences:1};function uf(df,ff,hf){return(0,bo.default)(df),hf=(0,hc.default)(hf,mc),hf.ignoreCase?df.toLowerCase().split((0,Ra.default)(ff).toLowerCase()).length>hf.minOccurrences:df.split((0,Ra.default)(ff)).length>hf.minOccurrences}vo.exports=Ai.default,vo.exports.default=Ai.default}(contains$1,contains$1.exports)),contains$1.exports}var matches={exports:{}},hasRequiredMatches;function requireMatches(){return hasRequiredMatches||(hasRequiredMatches=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hc;var bo=Ra(requireAssertString());function Ra(pc){return pc&&pc.__esModule?pc:{default:pc}}function hc(pc,mc,uf){return(0,bo.default)(pc),Object.prototype.toString.call(mc)!=="[object RegExp]"&&(mc=new RegExp(mc,uf)),!!pc.match(mc)}vo.exports=Ai.default,vo.exports.default=Ai.default}(matches,matches.exports)),matches.exports}var isEmail={exports:{}},isByteLength={exports:{}},hasRequiredIsByteLength;function requireIsByteLength(){return hasRequiredIsByteLength||(hasRequiredIsByteLength=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}function hc(mc){"@babel/helpers - typeof";return hc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(uf){return typeof uf}:function(uf){return uf&&typeof Symbol=="function"&&uf.constructor===Symbol&&uf!==Symbol.prototype?"symbol":typeof uf},hc(mc)}function pc(mc,uf){(0,bo.default)(mc);var df,ff;hc(uf)==="object"?(df=uf.min||0,ff=uf.max):(df=arguments[1],ff=arguments[2]);var hf=encodeURI(mc).split(/%..|./).length-1;return hf>=df&&(typeof ff>"u"||hf<=ff)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isByteLength,isByteLength.exports)),isByteLength.exports}var isFQDN={exports:{}},hasRequiredIsFQDN;function requireIsFQDN(){return hasRequiredIsFQDN||(hasRequiredIsFQDN=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=hc(requireAssertString()),Ra=hc(requireMerge());function hc(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};function mc(uf,df){(0,bo.default)(uf),df=(0,Ra.default)(df,pc),df.allow_trailing_dot&&uf[uf.length-1]==="."&&(uf=uf.substring(0,uf.length-1)),df.allow_wildcard===!0&&uf.indexOf("*.")===0&&(uf=uf.substring(2));var ff=uf.split("."),hf=ff[ff.length-1];return df.require_tld&&(ff.length<2||!df.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(hf)||/\s/.test(hf))||!df.allow_numeric_tld&&/^\d+$/.test(hf)?!1:ff.every(function(pf){return!(pf.length>63&&!df.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(pf)||/[\uff01-\uff5e]/.test(pf)||/^-|-$/.test(pf)||!df.allow_underscores&&/_/.test(pf))})}vo.exports=Ai.default,vo.exports.default=Ai.default}(isFQDN,isFQDN.exports)),isFQDN.exports}var isIP={exports:{}},hasRequiredIsIP;function requireIsIP(){return hasRequiredIsIP||(hasRequiredIsIP=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=ff;var bo=Ra(requireAssertString());function Ra(hf){return hf&&hf.__esModule?hf:{default:hf}}var hc="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",pc="(".concat(hc,"[.]){3}").concat(hc),mc=new RegExp("^".concat(pc,"$")),uf="(?:[0-9a-fA-F]{1,4})",df=new RegExp("^("+"(?:".concat(uf,":){7}(?:").concat(uf,"|:)|")+"(?:".concat(uf,":){6}(?:").concat(pc,"|:").concat(uf,"|:)|")+"(?:".concat(uf,":){5}(?::").concat(pc,"|(:").concat(uf,"){1,2}|:)|")+"(?:".concat(uf,":){4}(?:(:").concat(uf,"){0,1}:").concat(pc,"|(:").concat(uf,"){1,3}|:)|")+"(?:".concat(uf,":){3}(?:(:").concat(uf,"){0,2}:").concat(pc,"|(:").concat(uf,"){1,4}|:)|")+"(?:".concat(uf,":){2}(?:(:").concat(uf,"){0,3}:").concat(pc,"|(:").concat(uf,"){1,5}|:)|")+"(?:".concat(uf,":){1}(?:(:").concat(uf,"){0,4}:").concat(pc,"|(:").concat(uf,"){1,6}|:)|")+"(?::((?::".concat(uf,"){0,5}:").concat(pc,"|(?::").concat(uf,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");function ff(hf){var pf=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(0,bo.default)(hf),pf=String(pf),pf?pf==="4"?mc.test(hf):pf==="6"?df.test(hf):!1:ff(hf,4)||ff(hf,6)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isIP,isIP.exports)),isIP.exports}var hasRequiredIsEmail;function requireIsEmail(){return hasRequiredIsEmail||(hasRequiredIsEmail=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=Sf;var bo=uf(requireAssertString()),Ra=uf(requireIsByteLength()),hc=uf(requireIsFQDN()),pc=uf(requireIsIP()),mc=uf(requireMerge());function uf(xf){return xf&&xf.__esModule?xf:{default:xf}}var df={allow_display_name:!1,allow_underscores:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},ff=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,hf=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,pf=/^[a-z\d]+$/,mf=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,gf=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,yf=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,vf=254;function bf(xf){var wf=xf.replace(/^"(.+)"$/,"$1");if(!wf.trim())return!1;var s1=/[\.";<>]/.test(wf);if(s1){if(wf===xf)return!1;var If=wf.split('"').length===wf.split('\\"').length;if(!If)return!1}return!0}function Sf(xf,wf){if((0,bo.default)(xf),wf=(0,mc.default)(wf,df),wf.require_display_name||wf.allow_display_name){var s1=xf.match(ff);if(s1){var If=s1[1];if(xf=xf.replace(If,"").replace(/(^<|>$)/g,""),If.endsWith(" ")&&(If=If.slice(0,-1)),!bf(If))return!1}else if(wf.require_display_name)return!1}if(!wf.ignore_max_length&&xf.length>vf)return!1;var l1=xf.split("@"),c1=l1.pop(),m1=c1.toLowerCase();if(wf.host_blacklist.includes(m1)||wf.host_whitelist.length>0&&!wf.host_whitelist.includes(m1))return!1;var k1=l1.join("@");if(wf.domain_specific_validation&&(m1==="gmail.com"||m1==="googlemail.com")){k1=k1.toLowerCase();var N1=k1.split("+")[0];if(!(0,Ra.default)(N1.replace(/\./g,""),{min:6,max:30}))return!1;for(var R1=N1.split("."),$1=0;$1<R1.length;$1++)if(!pf.test(R1[$1]))return!1}if(wf.ignore_max_length===!1&&(!(0,Ra.default)(k1,{max:64})||!(0,Ra.default)(c1,{max:254})))return!1;if(!(0,hc.default)(c1,{require_tld:wf.require_tld,ignore_max_length:wf.ignore_max_length,allow_underscores:wf.allow_underscores})){if(!wf.allow_ip_domain)return!1;if(!(0,pc.default)(c1)){if(!c1.startsWith("[")||!c1.endsWith("]"))return!1;var D1=c1.slice(1,-1);if(D1.length===0||!(0,pc.default)(D1))return!1}}if(k1[0]==='"')return k1=k1.slice(1,k1.length-1),wf.allow_utf8_local_part?yf.test(k1):mf.test(k1);for(var f1=wf.allow_utf8_local_part?gf:hf,T1=k1.split("."),A1=0;A1<T1.length;A1++)if(!f1.test(T1[A1]))return!1;return!(wf.blacklisted_chars&&k1.search(new RegExp("[".concat(wf.blacklisted_chars,"]+"),"g"))!==-1)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isEmail,isEmail.exports)),isEmail.exports}var isURL$1={exports:{}},hasRequiredIsURL;function requireIsURL(){return hasRequiredIsURL||(hasRequiredIsURL=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=Sf;var bo=mc(requireAssertString()),Ra=mc(requireIsFQDN()),hc=mc(requireIsIP()),pc=mc(requireMerge());function mc(xf){return xf&&xf.__esModule?xf:{default:xf}}function uf(xf,wf){return mf(xf)||pf(xf,wf)||ff(xf,wf)||df()}function df(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
341
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ff(xf,wf){if(xf){if(typeof xf=="string")return hf(xf,wf);var s1=Object.prototype.toString.call(xf).slice(8,-1);if(s1==="Object"&&xf.constructor&&(s1=xf.constructor.name),s1==="Map"||s1==="Set")return Array.from(xf);if(s1==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s1))return hf(xf,wf)}}function hf(xf,wf){(wf==null||wf>xf.length)&&(wf=xf.length);for(var s1=0,If=new Array(wf);s1<wf;s1++)If[s1]=xf[s1];return If}function pf(xf,wf){var s1=xf==null?null:typeof Symbol<"u"&&xf[Symbol.iterator]||xf["@@iterator"];if(s1!=null){var If,l1,c1,m1,k1=[],N1=!0,R1=!1;try{if(c1=(s1=s1.call(xf)).next,wf!==0)for(;!(N1=(If=c1.call(s1)).done)&&(k1.push(If.value),k1.length!==wf);N1=!0);}catch($1){R1=!0,l1=$1}finally{try{if(!N1&&s1.return!=null&&(m1=s1.return(),Object(m1)!==m1))return}finally{if(R1)throw l1}}return k1}}function mf(xf){if(Array.isArray(xf))return xf}var gf={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0},yf=/^\[([^\]]+)\](?::([0-9]+))?$/;function vf(xf){return Object.prototype.toString.call(xf)==="[object RegExp]"}function bf(xf,wf){for(var s1=0;s1<wf.length;s1++){var If=wf[s1];if(xf===If||vf(If)&&If.test(xf))return!0}return!1}function Sf(xf,wf){if((0,bo.default)(xf),!xf||/[\s<>]/.test(xf)||xf.indexOf("mailto:")===0||(wf=(0,pc.default)(wf,gf),wf.validate_length&&xf.length>=2083)||!wf.allow_fragments&&xf.includes("#")||!wf.allow_query_components&&(xf.includes("?")||xf.includes("&")))return!1;var s1,If,l1,c1,m1,k1,N1,R1;if(N1=xf.split("#"),xf=N1.shift(),N1=xf.split("?"),xf=N1.shift(),N1=xf.split("://"),N1.length>1){if(s1=N1.shift().toLowerCase(),wf.require_valid_protocol&&wf.protocols.indexOf(s1)===-1)return!1}else{if(wf.require_protocol)return!1;if(xf.slice(0,2)==="//"){if(!wf.allow_protocol_relative_urls)return!1;N1[0]=xf.slice(2)}}if(xf=N1.join("://"),xf==="")return!1;if(N1=xf.split("/"),xf=N1.shift(),xf===""&&!wf.require_host)return!0;if(N1=xf.split("@"),N1.length>1){if(wf.disallow_auth||N1[0]===""||(If=N1.shift(),If.indexOf(":")>=0&&If.split(":").length>2))return!1;var $1=If.split(":"),D1=uf($1,2),f1=D1[0],T1=D1[1];if(f1===""&&T1==="")return!1}c1=N1.join("@"),k1=null,R1=null;var A1=c1.match(yf);if(A1?(l1="",R1=A1[1],k1=A1[2]||null):(N1=c1.split(":"),l1=N1.shift(),N1.length&&(k1=N1.join(":"))),k1!==null&&k1.length>0){if(m1=parseInt(k1,10),!/^[0-9]+$/.test(k1)||m1<=0||m1>65535)return!1}else if(wf.require_port)return!1;return wf.host_whitelist?bf(l1,wf.host_whitelist):l1===""&&!wf.require_host?!0:!(!(0,hc.default)(l1)&&!(0,Ra.default)(l1,wf)&&(!R1||!(0,hc.default)(R1,6))||(l1=l1||R1,wf.host_blacklist&&bf(l1,wf.host_blacklist)))}vo.exports=Ai.default,vo.exports.default=Ai.default}(isURL$1,isURL$1.exports)),isURL$1.exports}var isMACAddress={exports:{}},hasRequiredIsMACAddress;function requireIsMACAddress(){return hasRequiredIsMACAddress||(hasRequiredIsMACAddress=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hf;var bo=Ra(requireAssertString());function Ra(pf){return pf&&pf.__esModule?pf:{default:pf}}var hc=/^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){4}([0-9a-fA-F]{2})$/,pc=/^([0-9a-fA-F]){12}$/,mc=/^([0-9a-fA-F]{4}\.){2}([0-9a-fA-F]{4})$/,uf=/^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){6}([0-9a-fA-F]{2})$/,df=/^([0-9a-fA-F]){16}$/,ff=/^([0-9a-fA-F]{4}\.){3}([0-9a-fA-F]{4})$/;function hf(pf,mf){return(0,bo.default)(pf),mf!=null&&mf.eui&&(mf.eui=String(mf.eui)),mf!=null&&mf.no_colons||mf!=null&&mf.no_separators?mf.eui==="48"?pc.test(pf):mf.eui==="64"?df.test(pf):pc.test(pf)||df.test(pf):(mf==null?void 0:mf.eui)==="48"?hc.test(pf)||mc.test(pf):(mf==null?void 0:mf.eui)==="64"?uf.test(pf)||ff.test(pf):hf(pf,{eui:"48"})||hf(pf,{eui:"64"})}vo.exports=Ai.default,vo.exports.default=Ai.default}(isMACAddress,isMACAddress.exports)),isMACAddress.exports}var isIPRange={exports:{}},hasRequiredIsIPRange;function requireIsIPRange(){return hasRequiredIsIPRange||(hasRequiredIsIPRange=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=df;var bo=hc(requireAssertString()),Ra=hc(requireIsIP());function hc(ff){return ff&&ff.__esModule?ff:{default:ff}}var pc=/^\d{1,3}$/,mc=32,uf=128;function df(ff){var hf=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(0,bo.default)(ff);var pf=ff.split("/");if(pf.length!==2||!pc.test(pf[1])||pf[1].length>1&&pf[1].startsWith("0"))return!1;var mf=(0,Ra.default)(pf[0],hf);if(!mf)return!1;var gf=null;switch(String(hf)){case"4":gf=mc;break;case"6":gf=uf;break;default:gf=(0,Ra.default)(pf[0],"6")?uf:mc}return pf[1]<=gf&&pf[1]>=0}vo.exports=Ai.default,vo.exports.default=Ai.default}(isIPRange,isIPRange.exports)),isIPRange.exports}var isDate={exports:{}},hasRequiredIsDate;function requireIsDate(){return hasRequiredIsDate||(hasRequiredIsDate=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=yf;var bo=Ra(requireMerge());function Ra(vf){return vf&&vf.__esModule?vf:{default:vf}}function hc(vf,bf){return uf(vf)||mc(vf,bf)||ff(vf,bf)||pc()}function pc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
342
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mc(vf,bf){var Sf=vf==null?null:typeof Symbol<"u"&&vf[Symbol.iterator]||vf["@@iterator"];if(Sf!=null){var xf,wf,s1,If,l1=[],c1=!0,m1=!1;try{if(s1=(Sf=Sf.call(vf)).next,bf!==0)for(;!(c1=(xf=s1.call(Sf)).done)&&(l1.push(xf.value),l1.length!==bf);c1=!0);}catch(k1){m1=!0,wf=k1}finally{try{if(!c1&&Sf.return!=null&&(If=Sf.return(),Object(If)!==If))return}finally{if(m1)throw wf}}return l1}}function uf(vf){if(Array.isArray(vf))return vf}function df(vf,bf){var Sf=typeof Symbol<"u"&&vf[Symbol.iterator]||vf["@@iterator"];if(!Sf){if(Array.isArray(vf)||(Sf=ff(vf))||bf){Sf&&(vf=Sf);var xf=0,wf=function(){};return{s:wf,n:function(){return xf>=vf.length?{done:!0}:{done:!1,value:vf[xf++]}},e:function(c1){throw c1},f:wf}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
343
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s1=!0,If=!1,l1;return{s:function(){Sf=Sf.call(vf)},n:function(){var c1=Sf.next();return s1=c1.done,c1},e:function(c1){If=!0,l1=c1},f:function(){try{!s1&&Sf.return!=null&&Sf.return()}finally{if(If)throw l1}}}}function ff(vf,bf){if(vf){if(typeof vf=="string")return hf(vf,bf);var Sf=Object.prototype.toString.call(vf).slice(8,-1);if(Sf==="Object"&&vf.constructor&&(Sf=vf.constructor.name),Sf==="Map"||Sf==="Set")return Array.from(vf);if(Sf==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Sf))return hf(vf,bf)}}function hf(vf,bf){(bf==null||bf>vf.length)&&(bf=vf.length);for(var Sf=0,xf=new Array(bf);Sf<bf;Sf++)xf[Sf]=vf[Sf];return xf}var pf={format:"YYYY/MM/DD",delimiters:["/","-"],strictMode:!1};function mf(vf){return/(^(y{4}|y{2})[.\/-](m{1,2})[.\/-](d{1,2})$)|(^(m{1,2})[.\/-](d{1,2})[.\/-]((y{4}|y{2})$))|(^(d{1,2})[.\/-](m{1,2})[.\/-]((y{4}|y{2})$))/gi.test(vf)}function gf(vf,bf){for(var Sf=[],xf=Math.min(vf.length,bf.length),wf=0;wf<xf;wf++)Sf.push([vf[wf],bf[wf]]);return Sf}function yf(vf,bf){if(typeof bf=="string"?bf=(0,bo.default)({format:bf},pf):bf=(0,bo.default)(bf,pf),typeof vf=="string"&&mf(bf.format)){var Sf=bf.delimiters.find(function(T1){return bf.format.indexOf(T1)!==-1}),xf=bf.strictMode?Sf:bf.delimiters.find(function(T1){return vf.indexOf(T1)!==-1}),wf=gf(vf.split(xf),bf.format.toLowerCase().split(Sf)),s1={},If=df(wf),l1;try{for(If.s();!(l1=If.n()).done;){var c1=hc(l1.value,2),m1=c1[0],k1=c1[1];if(m1.length!==k1.length)return!1;s1[k1.charAt(0)]=m1}}catch(T1){If.e(T1)}finally{If.f()}var N1=s1.y;if(N1.startsWith("-"))return!1;if(s1.y.length===2){var R1=parseInt(s1.y,10);if(isNaN(R1))return!1;var $1=new Date().getFullYear()%100;R1<$1?N1="20".concat(s1.y):N1="19".concat(s1.y)}var D1=s1.m;s1.m.length===1&&(D1="0".concat(s1.m));var f1=s1.d;return s1.d.length===1&&(f1="0".concat(s1.d)),new Date("".concat(N1,"-").concat(D1,"-").concat(f1,"T00:00:00.000Z")).getUTCDate()===+s1.d}return bf.strictMode?!1:Object.prototype.toString.call(vf)==="[object Date]"&&isFinite(vf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isDate,isDate.exports)),isDate.exports}var isTime={exports:{}},hasRequiredIsTime;function requireIsTime(){return hasRequiredIsTime||(hasRequiredIsTime=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireMerge());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var hc={hourFormat:"hour24",mode:"default"},pc={hour24:{default:/^([01]?[0-9]|2[0-3]):([0-5][0-9])$/,withSeconds:/^([01]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/},hour12:{default:/^(0?[1-9]|1[0-2]):([0-5][0-9]) (A|P)M$/,withSeconds:/^(0?[1-9]|1[0-2]):([0-5][0-9]):([0-5][0-9]) (A|P)M$/}};function mc(uf,df){return df=(0,bo.default)(df,hc),typeof uf!="string"?!1:pc[df.hourFormat][df.mode].test(uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isTime,isTime.exports)),isTime.exports}var isBoolean={exports:{}},hasRequiredIsBoolean;function requireIsBoolean(){return hasRequiredIsBoolean||(hasRequiredIsBoolean=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=uf;var bo=Ra(requireAssertString());function Ra(df){return df&&df.__esModule?df:{default:df}}var hc={loose:!1},pc=["true","false","1","0"],mc=[].concat(pc,["yes","no"]);function uf(df){var ff=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hc;return(0,bo.default)(df),ff.loose?mc.includes(df.toLowerCase()):pc.includes(df)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isBoolean,isBoolean.exports)),isBoolean.exports}var isLocale={exports:{}},hasRequiredIsLocale;function requireIsLocale(){return hasRequiredIsLocale||(hasRequiredIsLocale=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=xf;var bo=Ra(requireAssertString());function Ra(wf){return wf&&wf.__esModule?wf:{default:wf}}var hc="([A-Za-z]{3}(-[A-Za-z]{3}){0,2})",pc="(([a-zA-Z]{2,3}(-".concat(hc,")?)|([a-zA-Z]{5,8}))"),mc="([A-Za-z]{4})",uf="([A-Za-z]{2}|\\d{3})",df="([A-Za-z0-9]{5,8}|(\\d[A-Z-a-z0-9]{3}))",ff="(\\d|[A-W]|[Y-Z]|[a-w]|[y-z])",hf="(".concat(ff,"(-[A-Za-z0-9]{2,8})+)"),pf="(x(-[A-Za-z0-9]{1,8})+)",mf="((en-GB-oed)|(i-ami)|(i-bnn)|(i-default)|(i-enochian)|(i-hak)|(i-klingon)|(i-lux)|(i-mingo)|(i-navajo)|(i-pwn)|(i-tao)|(i-tay)|(i-tsu)|(sgn-BE-FR)|(sgn-BE-NL)|(sgn-CH-DE))",gf="((art-lojban)|(cel-gaulish)|(no-bok)|(no-nyn)|(zh-guoyu)|(zh-hakka)|(zh-min)|(zh-min-nan)|(zh-xiang))",yf="(".concat(mf,"|").concat(gf,")"),vf="(-|_)",bf="".concat(pc,"(").concat(vf).concat(mc,")?(").concat(vf).concat(uf,")?(").concat(vf).concat(df,")*(").concat(vf).concat(hf,")*(").concat(vf).concat(pf,")?"),Sf=new RegExp("(^".concat(pf,"$)|(^").concat(yf,"$)|(^").concat(bf,"$)"));function xf(wf){return(0,bo.default)(wf),Sf.test(wf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isLocale,isLocale.exports)),isLocale.exports}var isAbaRouting={exports:{}},hasRequiredIsAbaRouting;function requireIsAbaRouting(){return hasRequiredIsAbaRouting||(hasRequiredIsAbaRouting=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}var hc=/^(?!(1[3-9])|(20)|(3[3-9])|(4[0-9])|(5[0-9])|(60)|(7[3-9])|(8[1-9])|(9[0-2])|(9[3-9]))[0-9]{9}$/;function pc(mc){if((0,bo.default)(mc),!hc.test(mc))return!1;for(var uf=0,df=0;df<mc.length;df++)df%3===0?uf+=mc[df]*3:df%3===1?uf+=mc[df]*7:uf+=mc[df]*1;return uf%10===0}vo.exports=Ai.default,vo.exports.default=Ai.default}(isAbaRouting,isAbaRouting.exports)),isAbaRouting.exports}var isAlpha={},hasRequiredIsAlpha;function requireIsAlpha(){if(hasRequiredIsAlpha)return isAlpha;hasRequiredIsAlpha=1,Object.defineProperty(isAlpha,"__esModule",{value:!0}),isAlpha.default=Ra,isAlpha.locales=void 0;var vo=bo(requireAssertString()),Ai=requireAlpha();function bo(hc){return hc&&hc.__esModule?hc:{default:hc}}function Ra(hc){var pc=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US",mc=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};(0,vo.default)(hc);var uf=hc,df=mc.ignore;if(df)if(df instanceof RegExp)uf=uf.replace(df,"");else if(typeof df=="string")uf=uf.replace(new RegExp("[".concat(df.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"");else throw new Error("ignore should be instance of a String or RegExp");if(pc in Ai.alpha)return Ai.alpha[pc].test(uf);throw new Error("Invalid locale '".concat(pc,"'"))}return isAlpha.locales=Object.keys(Ai.alpha),isAlpha}var isAlphanumeric={},hasRequiredIsAlphanumeric;function requireIsAlphanumeric(){if(hasRequiredIsAlphanumeric)return isAlphanumeric;hasRequiredIsAlphanumeric=1,Object.defineProperty(isAlphanumeric,"__esModule",{value:!0}),isAlphanumeric.default=Ra,isAlphanumeric.locales=void 0;var vo=bo(requireAssertString()),Ai=requireAlpha();function bo(hc){return hc&&hc.__esModule?hc:{default:hc}}function Ra(hc){var pc=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US",mc=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};(0,vo.default)(hc);var uf=hc,df=mc.ignore;if(df)if(df instanceof RegExp)uf=uf.replace(df,"");else if(typeof df=="string")uf=uf.replace(new RegExp("[".concat(df.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"");else throw new Error("ignore should be instance of a String or RegExp");if(pc in Ai.alphanumeric)return Ai.alphanumeric[pc].test(uf);throw new Error("Invalid locale '".concat(pc,"'"))}return isAlphanumeric.locales=Object.keys(Ai.alphanumeric),isAlphanumeric}var isNumeric={exports:{}},hasRequiredIsNumeric;function requireIsNumeric(){return hasRequiredIsNumeric||(hasRequiredIsNumeric=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=hc(requireAssertString()),Ra=requireAlpha();function hc(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc=/^[0-9]+$/;function mc(uf,df){return(0,bo.default)(uf),df&&df.no_symbols?pc.test(uf):new RegExp("^[+-]?([0-9]*[".concat((df||{}).locale?Ra.decimal[df.locale]:".","])?[0-9]+$")).test(uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isNumeric,isNumeric.exports)),isNumeric.exports}var isPassportNumber={exports:{}},hasRequiredIsPassportNumber;function requireIsPassportNumber(){return hasRequiredIsPassportNumber||(hasRequiredIsPassportNumber=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}var hc={AM:/^[A-Z]{2}\d{7}$/,AR:/^[A-Z]{3}\d{6}$/,AT:/^[A-Z]\d{7}$/,AU:/^[A-Z]\d{7}$/,AZ:/^[A-Z]{1}\d{8}$/,BE:/^[A-Z]{2}\d{6}$/,BG:/^\d{9}$/,BR:/^[A-Z]{2}\d{6}$/,BY:/^[A-Z]{2}\d{7}$/,CA:/^[A-Z]{2}\d{6}$/,CH:/^[A-Z]\d{7}$/,CN:/^G\d{8}$|^E(?![IO])[A-Z0-9]\d{7}$/,CY:/^[A-Z](\d{6}|\d{8})$/,CZ:/^\d{8}$/,DE:/^[CFGHJKLMNPRTVWXYZ0-9]{9}$/,DK:/^\d{9}$/,DZ:/^\d{9}$/,EE:/^([A-Z]\d{7}|[A-Z]{2}\d{7})$/,ES:/^[A-Z0-9]{2}([A-Z0-9]?)\d{6}$/,FI:/^[A-Z]{2}\d{7}$/,FR:/^\d{2}[A-Z]{2}\d{5}$/,GB:/^\d{9}$/,GR:/^[A-Z]{2}\d{7}$/,HR:/^\d{9}$/,HU:/^[A-Z]{2}(\d{6}|\d{7})$/,IE:/^[A-Z0-9]{2}\d{7}$/,IN:/^[A-Z]{1}-?\d{7}$/,ID:/^[A-C]\d{7}$/,IR:/^[A-Z]\d{8}$/,IS:/^(A)\d{7}$/,IT:/^[A-Z0-9]{2}\d{7}$/,JM:/^[Aa]\d{7}$/,JP:/^[A-Z]{2}\d{7}$/,KR:/^[MS]\d{8}$/,KZ:/^[a-zA-Z]\d{7}$/,LI:/^[a-zA-Z]\d{5}$/,LT:/^[A-Z0-9]{8}$/,LU:/^[A-Z0-9]{8}$/,LV:/^[A-Z0-9]{2}\d{7}$/,LY:/^[A-Z0-9]{8}$/,MT:/^\d{7}$/,MZ:/^([A-Z]{2}\d{7})|(\d{2}[A-Z]{2}\d{5})$/,MY:/^[AHK]\d{8}$/,MX:/^\d{10,11}$/,NL:/^[A-Z]{2}[A-Z0-9]{6}\d$/,NZ:/^([Ll]([Aa]|[Dd]|[Ff]|[Hh])|[Ee]([Aa]|[Pp])|[Nn])\d{6}$/,PH:/^([A-Z](\d{6}|\d{7}[A-Z]))|([A-Z]{2}(\d{6}|\d{7}))$/,PK:/^[A-Z]{2}\d{7}$/,PL:/^[A-Z]{2}\d{7}$/,PT:/^[A-Z]\d{6}$/,RO:/^\d{8,9}$/,RU:/^\d{9}$/,SE:/^\d{8}$/,SL:/^(P)[A-Z]\d{7}$/,SK:/^[0-9A-Z]\d{7}$/,TH:/^[A-Z]{1,2}\d{6,7}$/,TR:/^[A-Z]\d{8}$/,UA:/^[A-Z]{2}\d{6}$/,US:/^\d{9}$/,ZA:/^[TAMD]\d{8}$/};function pc(mc,uf){(0,bo.default)(mc);var df=mc.replace(/\s/g,"").toUpperCase();return uf.toUpperCase()in hc&&hc[uf].test(df)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isPassportNumber,isPassportNumber.exports)),isPassportNumber.exports}var isPort={exports:{}},isInt={exports:{}},hasRequiredIsInt;function requireIsInt(){return hasRequiredIsInt||(hasRequiredIsInt=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var hc=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,pc=/^[-+]?[0-9]+$/;function mc(uf,df){(0,bo.default)(uf),df=df||{};var ff=df.allow_leading_zeroes===!1?hc:pc,hf=!df.hasOwnProperty("min")||uf>=df.min,pf=!df.hasOwnProperty("max")||uf<=df.max,mf=!df.hasOwnProperty("lt")||uf<df.lt,gf=!df.hasOwnProperty("gt")||uf>df.gt;return ff.test(uf)&&hf&&pf&&mf&&gf}vo.exports=Ai.default,vo.exports.default=Ai.default}(isInt,isInt.exports)),isInt.exports}var hasRequiredIsPort;function requireIsPort(){return hasRequiredIsPort||(hasRequiredIsPort=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hc;var bo=Ra(requireIsInt());function Ra(pc){return pc&&pc.__esModule?pc:{default:pc}}function hc(pc){return(0,bo.default)(pc,{allow_leading_zeroes:!1,min:0,max:65535})}vo.exports=Ai.default,vo.exports.default=Ai.default}(isPort,isPort.exports)),isPort.exports}var isLowercase={exports:{}},hasRequiredIsLowercase;function requireIsLowercase(){return hasRequiredIsLowercase||(hasRequiredIsLowercase=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hc;var bo=Ra(requireAssertString());function Ra(pc){return pc&&pc.__esModule?pc:{default:pc}}function hc(pc){return(0,bo.default)(pc),pc===pc.toLowerCase()}vo.exports=Ai.default,vo.exports.default=Ai.default}(isLowercase,isLowercase.exports)),isLowercase.exports}var isUppercase={exports:{}},hasRequiredIsUppercase;function requireIsUppercase(){return hasRequiredIsUppercase||(hasRequiredIsUppercase=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hc;var bo=Ra(requireAssertString());function Ra(pc){return pc&&pc.__esModule?pc:{default:pc}}function hc(pc){return(0,bo.default)(pc),pc===pc.toUpperCase()}vo.exports=Ai.default,vo.exports.default=Ai.default}(isUppercase,isUppercase.exports)),isUppercase.exports}var isIMEI={exports:{}},hasRequiredIsIMEI;function requireIsIMEI(){return hasRequiredIsIMEI||(hasRequiredIsIMEI=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var hc=/^[0-9]{15}$/,pc=/^\d{2}-\d{6}-\d{6}-\d{1}$/;function mc(uf,df){(0,bo.default)(uf),df=df||{};var ff=hc;if(df.allow_hyphens&&(ff=pc),!ff.test(uf))return!1;uf=uf.replace(/-/g,"");for(var hf=0,pf=2,mf=14,gf=0;gf<mf;gf++){var yf=uf.substring(mf-gf-1,mf-gf),vf=parseInt(yf,10)*pf;vf>=10?hf+=vf%10+1:hf+=vf,pf===1?pf+=1:pf-=1}var bf=(10-hf%10)%10;return bf===parseInt(uf.substring(14,15),10)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isIMEI,isIMEI.exports)),isIMEI.exports}var isAscii={exports:{}},hasRequiredIsAscii;function requireIsAscii(){return hasRequiredIsAscii||(hasRequiredIsAscii=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}var hc=/^[\x00-\x7F]+$/;function pc(mc){return(0,bo.default)(mc),hc.test(mc)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isAscii,isAscii.exports)),isAscii.exports}var isFullWidth={},hasRequiredIsFullWidth;function requireIsFullWidth(){if(hasRequiredIsFullWidth)return isFullWidth;hasRequiredIsFullWidth=1,Object.defineProperty(isFullWidth,"__esModule",{value:!0}),isFullWidth.default=Ra,isFullWidth.fullWidth=void 0;var vo=Ai(requireAssertString());function Ai(hc){return hc&&hc.__esModule?hc:{default:hc}}var bo=isFullWidth.fullWidth=/[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;function Ra(hc){return(0,vo.default)(hc),bo.test(hc)}return isFullWidth}var isHalfWidth={},hasRequiredIsHalfWidth;function requireIsHalfWidth(){if(hasRequiredIsHalfWidth)return isHalfWidth;hasRequiredIsHalfWidth=1,Object.defineProperty(isHalfWidth,"__esModule",{value:!0}),isHalfWidth.default=Ra,isHalfWidth.halfWidth=void 0;var vo=Ai(requireAssertString());function Ai(hc){return hc&&hc.__esModule?hc:{default:hc}}var bo=isHalfWidth.halfWidth=/[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;function Ra(hc){return(0,vo.default)(hc),bo.test(hc)}return isHalfWidth}var isVariableWidth={exports:{}},hasRequiredIsVariableWidth;function requireIsVariableWidth(){return hasRequiredIsVariableWidth||(hasRequiredIsVariableWidth=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=pc(requireAssertString()),Ra=requireIsFullWidth(),hc=requireIsHalfWidth();function pc(uf){return uf&&uf.__esModule?uf:{default:uf}}function mc(uf){return(0,bo.default)(uf),Ra.fullWidth.test(uf)&&hc.halfWidth.test(uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isVariableWidth,isVariableWidth.exports)),isVariableWidth.exports}var isMultibyte={exports:{}},hasRequiredIsMultibyte;function requireIsMultibyte(){return hasRequiredIsMultibyte||(hasRequiredIsMultibyte=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}var hc=/[^\x00-\x7F]/;function pc(mc){return(0,bo.default)(mc),hc.test(mc)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isMultibyte,isMultibyte.exports)),isMultibyte.exports}var isSemVer={exports:{}},multilineRegex={exports:{}},hasRequiredMultilineRegex;function requireMultilineRegex(){return hasRequiredMultilineRegex||(hasRequiredMultilineRegex=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=bo;function bo(Ra,hc){var pc=Ra.join("");return new RegExp(pc,hc)}vo.exports=Ai.default,vo.exports.default=Ai.default}(multilineRegex,multilineRegex.exports)),multilineRegex.exports}var hasRequiredIsSemVer;function requireIsSemVer(){return hasRequiredIsSemVer||(hasRequiredIsSemVer=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=hc(requireAssertString()),Ra=hc(requireMultilineRegex());function hc(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc=(0,Ra.default)(["^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)","(?:-((?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*))*))","?(?:\\+([0-9a-z-]+(?:\\.[0-9a-z-]+)*))?$"],"i");function mc(uf){return(0,bo.default)(uf),pc.test(uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isSemVer,isSemVer.exports)),isSemVer.exports}var isSurrogatePair={exports:{}},hasRequiredIsSurrogatePair;function requireIsSurrogatePair(){return hasRequiredIsSurrogatePair||(hasRequiredIsSurrogatePair=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}var hc=/[\uD800-\uDBFF][\uDC00-\uDFFF]/;function pc(mc){return(0,bo.default)(mc),hc.test(mc)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isSurrogatePair,isSurrogatePair.exports)),isSurrogatePair.exports}var isDecimal={exports:{}},includes={exports:{}},hasRequiredIncludes;function requireIncludes(){return hasRequiredIncludes||(hasRequiredIncludes=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=void 0;var bo=function(Ra,hc){return Ra.some(function(pc){return hc===pc})};Ai.default=bo,vo.exports=Ai.default,vo.exports.default=Ai.default}(includes,includes.exports)),includes.exports}var hasRequiredIsDecimal;function requireIsDecimal(){return hasRequiredIsDecimal||(hasRequiredIsDecimal=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hf;var bo=mc(requireMerge()),Ra=mc(requireAssertString()),hc=mc(requireIncludes()),pc=requireAlpha();function mc(pf){return pf&&pf.__esModule?pf:{default:pf}}function uf(pf){var mf=new RegExp("^[-+]?([0-9]+)?(\\".concat(pc.decimal[pf.locale],"[0-9]{").concat(pf.decimal_digits,"})").concat(pf.force_decimal?"":"?","$"));return mf}var df={force_decimal:!1,decimal_digits:"1,",locale:"en-US"},ff=["","-","+"];function hf(pf,mf){if((0,Ra.default)(pf),mf=(0,bo.default)(mf,df),mf.locale in pc.decimal)return!(0,hc.default)(ff,pf.replace(/ /g,""))&&uf(mf).test(pf);throw new Error("Invalid locale '".concat(mf.locale,"'"))}vo.exports=Ai.default,vo.exports.default=Ai.default}(isDecimal,isDecimal.exports)),isDecimal.exports}var isHexadecimal={exports:{}},hasRequiredIsHexadecimal;function requireIsHexadecimal(){return hasRequiredIsHexadecimal||(hasRequiredIsHexadecimal=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}var hc=/^(0x|0h)?[0-9A-F]+$/i;function pc(mc){return(0,bo.default)(mc),hc.test(mc)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isHexadecimal,isHexadecimal.exports)),isHexadecimal.exports}var isOctal={exports:{}},hasRequiredIsOctal;function requireIsOctal(){return hasRequiredIsOctal||(hasRequiredIsOctal=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}var hc=/^(0o)?[0-7]+$/i;function pc(mc){return(0,bo.default)(mc),hc.test(mc)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isOctal,isOctal.exports)),isOctal.exports}var isDivisibleBy={exports:{}},hasRequiredIsDivisibleBy;function requireIsDivisibleBy(){return hasRequiredIsDivisibleBy||(hasRequiredIsDivisibleBy=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=hc(requireAssertString()),Ra=hc(requireToFloat());function hc(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc,uf){return(0,bo.default)(mc),(0,Ra.default)(mc)%parseInt(uf,10)===0}vo.exports=Ai.default,vo.exports.default=Ai.default}(isDivisibleBy,isDivisibleBy.exports)),isDivisibleBy.exports}var isHexColor={exports:{}},hasRequiredIsHexColor;function requireIsHexColor(){return hasRequiredIsHexColor||(hasRequiredIsHexColor=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}var hc=/^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;function pc(mc){return(0,bo.default)(mc),hc.test(mc)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isHexColor,isHexColor.exports)),isHexColor.exports}var isRgbColor={exports:{}},hasRequiredIsRgbColor;function requireIsRgbColor(){return hasRequiredIsRgbColor||(hasRequiredIsRgbColor=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=df;var bo=Ra(requireAssertString());function Ra(ff){return ff&&ff.__esModule?ff:{default:ff}}var hc=/^rgb\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\)$/,pc=/^rgba\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/,mc=/^rgb\((([0-9]%|[1-9][0-9]%|100%),){2}([0-9]%|[1-9][0-9]%|100%)\)$/,uf=/^rgba\((([0-9]%|[1-9][0-9]%|100%),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/;function df(ff){var hf=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return(0,bo.default)(ff),hf?hc.test(ff)||pc.test(ff)||mc.test(ff)||uf.test(ff):hc.test(ff)||pc.test(ff)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isRgbColor,isRgbColor.exports)),isRgbColor.exports}var isHSL={exports:{}},hasRequiredIsHSL;function requireIsHSL(){return hasRequiredIsHSL||(hasRequiredIsHSL=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var hc=/^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(,(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}(,((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?))?\)$/i,pc=/^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(\s(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}\s?(\/\s((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?)\s?)?\)$/i;function mc(uf){(0,bo.default)(uf);var df=uf.replace(/\s+/g," ").replace(/\s?(hsla?\(|\)|,)\s?/ig,"$1");return df.indexOf(",")!==-1?hc.test(df):pc.test(df)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isHSL,isHSL.exports)),isHSL.exports}var isISRC={exports:{}},hasRequiredIsISRC;function requireIsISRC(){return hasRequiredIsISRC||(hasRequiredIsISRC=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}var hc=/^[A-Z]{2}[0-9A-Z]{3}\d{2}\d{5}$/;function pc(mc){return(0,bo.default)(mc),hc.test(mc)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isISRC,isISRC.exports)),isISRC.exports}var isIBAN={},hasRequiredIsIBAN;function requireIsIBAN(){if(hasRequiredIsIBAN)return isIBAN;hasRequiredIsIBAN=1,Object.defineProperty(isIBAN,"__esModule",{value:!0}),isIBAN.default=mc,isIBAN.locales=void 0;var vo=Ai(requireAssertString());function Ai(uf){return uf&&uf.__esModule?uf:{default:uf}}var bo={AD:/^(AD[0-9]{2})\d{8}[A-Z0-9]{12}$/,AE:/^(AE[0-9]{2})\d{3}\d{16}$/,AL:/^(AL[0-9]{2})\d{8}[A-Z0-9]{16}$/,AT:/^(AT[0-9]{2})\d{16}$/,AZ:/^(AZ[0-9]{2})[A-Z0-9]{4}\d{20}$/,BA:/^(BA[0-9]{2})\d{16}$/,BE:/^(BE[0-9]{2})\d{12}$/,BG:/^(BG[0-9]{2})[A-Z]{4}\d{6}[A-Z0-9]{8}$/,BH:/^(BH[0-9]{2})[A-Z]{4}[A-Z0-9]{14}$/,BR:/^(BR[0-9]{2})\d{23}[A-Z]{1}[A-Z0-9]{1}$/,BY:/^(BY[0-9]{2})[A-Z0-9]{4}\d{20}$/,CH:/^(CH[0-9]{2})\d{5}[A-Z0-9]{12}$/,CR:/^(CR[0-9]{2})\d{18}$/,CY:/^(CY[0-9]{2})\d{8}[A-Z0-9]{16}$/,CZ:/^(CZ[0-9]{2})\d{20}$/,DE:/^(DE[0-9]{2})\d{18}$/,DK:/^(DK[0-9]{2})\d{14}$/,DO:/^(DO[0-9]{2})[A-Z]{4}\d{20}$/,DZ:/^(DZ\d{24})$/,EE:/^(EE[0-9]{2})\d{16}$/,EG:/^(EG[0-9]{2})\d{25}$/,ES:/^(ES[0-9]{2})\d{20}$/,FI:/^(FI[0-9]{2})\d{14}$/,FO:/^(FO[0-9]{2})\d{14}$/,FR:/^(FR[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,GB:/^(GB[0-9]{2})[A-Z]{4}\d{14}$/,GE:/^(GE[0-9]{2})[A-Z0-9]{2}\d{16}$/,GI:/^(GI[0-9]{2})[A-Z]{4}[A-Z0-9]{15}$/,GL:/^(GL[0-9]{2})\d{14}$/,GR:/^(GR[0-9]{2})\d{7}[A-Z0-9]{16}$/,GT:/^(GT[0-9]{2})[A-Z0-9]{4}[A-Z0-9]{20}$/,HR:/^(HR[0-9]{2})\d{17}$/,HU:/^(HU[0-9]{2})\d{24}$/,IE:/^(IE[0-9]{2})[A-Z0-9]{4}\d{14}$/,IL:/^(IL[0-9]{2})\d{19}$/,IQ:/^(IQ[0-9]{2})[A-Z]{4}\d{15}$/,IR:/^(IR[0-9]{2})0\d{2}0\d{18}$/,IS:/^(IS[0-9]{2})\d{22}$/,IT:/^(IT[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,JO:/^(JO[0-9]{2})[A-Z]{4}\d{22}$/,KW:/^(KW[0-9]{2})[A-Z]{4}[A-Z0-9]{22}$/,KZ:/^(KZ[0-9]{2})\d{3}[A-Z0-9]{13}$/,LB:/^(LB[0-9]{2})\d{4}[A-Z0-9]{20}$/,LC:/^(LC[0-9]{2})[A-Z]{4}[A-Z0-9]{24}$/,LI:/^(LI[0-9]{2})\d{5}[A-Z0-9]{12}$/,LT:/^(LT[0-9]{2})\d{16}$/,LU:/^(LU[0-9]{2})\d{3}[A-Z0-9]{13}$/,LV:/^(LV[0-9]{2})[A-Z]{4}[A-Z0-9]{13}$/,MA:/^(MA[0-9]{26})$/,MC:/^(MC[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,MD:/^(MD[0-9]{2})[A-Z0-9]{20}$/,ME:/^(ME[0-9]{2})\d{18}$/,MK:/^(MK[0-9]{2})\d{3}[A-Z0-9]{10}\d{2}$/,MR:/^(MR[0-9]{2})\d{23}$/,MT:/^(MT[0-9]{2})[A-Z]{4}\d{5}[A-Z0-9]{18}$/,MU:/^(MU[0-9]{2})[A-Z]{4}\d{19}[A-Z]{3}$/,MZ:/^(MZ[0-9]{2})\d{21}$/,NL:/^(NL[0-9]{2})[A-Z]{4}\d{10}$/,NO:/^(NO[0-9]{2})\d{11}$/,PK:/^(PK[0-9]{2})[A-Z0-9]{4}\d{16}$/,PL:/^(PL[0-9]{2})\d{24}$/,PS:/^(PS[0-9]{2})[A-Z0-9]{4}\d{21}$/,PT:/^(PT[0-9]{2})\d{21}$/,QA:/^(QA[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/,RO:/^(RO[0-9]{2})[A-Z]{4}[A-Z0-9]{16}$/,RS:/^(RS[0-9]{2})\d{18}$/,SA:/^(SA[0-9]{2})\d{2}[A-Z0-9]{18}$/,SC:/^(SC[0-9]{2})[A-Z]{4}\d{20}[A-Z]{3}$/,SE:/^(SE[0-9]{2})\d{20}$/,SI:/^(SI[0-9]{2})\d{15}$/,SK:/^(SK[0-9]{2})\d{20}$/,SM:/^(SM[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,SV:/^(SV[0-9]{2})[A-Z0-9]{4}\d{20}$/,TL:/^(TL[0-9]{2})\d{19}$/,TN:/^(TN[0-9]{2})\d{20}$/,TR:/^(TR[0-9]{2})\d{5}[A-Z0-9]{17}$/,UA:/^(UA[0-9]{2})\d{6}[A-Z0-9]{19}$/,VA:/^(VA[0-9]{2})\d{18}$/,VG:/^(VG[0-9]{2})[A-Z0-9]{4}\d{16}$/,XK:/^(XK[0-9]{2})\d{16}$/};function Ra(uf){var df=uf.filter(function(ff){return!(ff in bo)});return!(df.length>0)}function hc(uf,df){var ff=uf.replace(/[\s\-]+/gi,"").toUpperCase(),hf=ff.slice(0,2).toUpperCase(),pf=hf in bo;if(df.whitelist){if(!Ra(df.whitelist))return!1;var mf=df.whitelist.includes(hf);if(!mf)return!1}if(df.blacklist){var gf=df.blacklist.includes(hf);if(gf)return!1}return pf&&bo[hf].test(ff)}function pc(uf){var df=uf.replace(/[^A-Z0-9]+/gi,"").toUpperCase(),ff=df.slice(4)+df.slice(0,4),hf=ff.replace(/[A-Z]/g,function(mf){return mf.charCodeAt(0)-55}),pf=hf.match(/\d{1,7}/g).reduce(function(mf,gf){return Number(mf+gf)%97},"");return pf===1}function mc(uf){var df=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(0,vo.default)(uf),hc(uf,df)&&pc(uf)}return isIBAN.locales=Object.keys(bo),isIBAN}var isBIC={exports:{}},isISO31661Alpha2={},hasRequiredIsISO31661Alpha2;function requireIsISO31661Alpha2(){if(hasRequiredIsISO31661Alpha2)return isISO31661Alpha2;hasRequiredIsISO31661Alpha2=1,Object.defineProperty(isISO31661Alpha2,"__esModule",{value:!0}),isISO31661Alpha2.CountryCodes=void 0,isISO31661Alpha2.default=Ra;var vo=Ai(requireAssertString());function Ai(hc){return hc&&hc.__esModule?hc:{default:hc}}var bo=new Set(["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"]);function Ra(hc){return(0,vo.default)(hc),bo.has(hc.toUpperCase())}return isISO31661Alpha2.CountryCodes=bo,isISO31661Alpha2}var hasRequiredIsBIC;function requireIsBIC(){return hasRequiredIsBIC||(hasRequiredIsBIC=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=hc(requireAssertString()),Ra=requireIsISO31661Alpha2();function hc(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc=/^[A-Za-z]{6}[A-Za-z0-9]{2}([A-Za-z0-9]{3})?$/;function mc(uf){(0,bo.default)(uf);var df=uf.slice(4,6).toUpperCase();return!Ra.CountryCodes.has(df)&&df!=="XK"?!1:pc.test(uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isBIC,isBIC.exports)),isBIC.exports}var isMD5={exports:{}},hasRequiredIsMD5;function requireIsMD5(){return hasRequiredIsMD5||(hasRequiredIsMD5=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}var hc=/^[a-f0-9]{32}$/;function pc(mc){return(0,bo.default)(mc),hc.test(mc)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isMD5,isMD5.exports)),isMD5.exports}var isHash={exports:{}},hasRequiredIsHash;function requireIsHash(){return hasRequiredIsHash||(hasRequiredIsHash=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}var hc={md5:32,md4:32,sha1:40,sha256:64,sha384:96,sha512:128,ripemd128:32,ripemd160:40,tiger128:32,tiger160:40,tiger192:48,crc32:8,crc32b:8};function pc(mc,uf){(0,bo.default)(mc);var df=new RegExp("^[a-fA-F0-9]{".concat(hc[uf],"}$"));return df.test(mc)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isHash,isHash.exports)),isHash.exports}var isJWT={exports:{}},isBase64={exports:{}},hasRequiredIsBase64;function requireIsBase64(){return hasRequiredIsBase64||(hasRequiredIsBase64=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=df;var bo=hc(requireAssertString()),Ra=hc(requireMerge());function hc(ff){return ff&&ff.__esModule?ff:{default:ff}}var pc=/[^A-Z0-9+\/=]/i,mc=/^[A-Z0-9_\-]*$/i,uf={urlSafe:!1};function df(ff,hf){(0,bo.default)(ff),hf=(0,Ra.default)(hf,uf);var pf=ff.length;if(hf.urlSafe)return mc.test(ff);if(pf%4!==0||pc.test(ff))return!1;var mf=ff.indexOf("=");return mf===-1||mf===pf-1||mf===pf-2&&ff[pf-1]==="="}vo.exports=Ai.default,vo.exports.default=Ai.default}(isBase64,isBase64.exports)),isBase64.exports}var hasRequiredIsJWT;function requireIsJWT(){return hasRequiredIsJWT||(hasRequiredIsJWT=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=hc(requireAssertString()),Ra=hc(requireIsBase64());function hc(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc){(0,bo.default)(mc);var uf=mc.split("."),df=uf.length;return df!==3?!1:uf.reduce(function(ff,hf){return ff&&(0,Ra.default)(hf,{urlSafe:!0})},!0)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isJWT,isJWT.exports)),isJWT.exports}var isJSON={exports:{}},hasRequiredIsJSON;function requireIsJSON(){return hasRequiredIsJSON||(hasRequiredIsJSON=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=uf;var bo=hc(requireAssertString()),Ra=hc(requireMerge());function hc(df){return df&&df.__esModule?df:{default:df}}function pc(df){"@babel/helpers - typeof";return pc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ff){return typeof ff}:function(ff){return ff&&typeof Symbol=="function"&&ff.constructor===Symbol&&ff!==Symbol.prototype?"symbol":typeof ff},pc(df)}var mc={allow_primitives:!1};function uf(df,ff){(0,bo.default)(df);try{ff=(0,Ra.default)(ff,mc);var hf=[];ff.allow_primitives&&(hf=[null,!1,!0]);var pf=JSON.parse(df);return hf.includes(pf)||!!pf&&pc(pf)==="object"}catch{}return!1}vo.exports=Ai.default,vo.exports.default=Ai.default}(isJSON,isJSON.exports)),isJSON.exports}var isEmpty={exports:{}},hasRequiredIsEmpty;function requireIsEmpty(){return hasRequiredIsEmpty||(hasRequiredIsEmpty=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=hc(requireAssertString()),Ra=hc(requireMerge());function hc(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc={ignore_whitespace:!1};function mc(uf,df){return(0,bo.default)(uf),df=(0,Ra.default)(df,pc),(df.ignore_whitespace?uf.trim().length:uf.length)===0}vo.exports=Ai.default,vo.exports.default=Ai.default}(isEmpty,isEmpty.exports)),isEmpty.exports}var isLength={exports:{}},hasRequiredIsLength;function requireIsLength(){return hasRequiredIsLength||(hasRequiredIsLength=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}function hc(mc){"@babel/helpers - typeof";return hc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(uf){return typeof uf}:function(uf){return uf&&typeof Symbol=="function"&&uf.constructor===Symbol&&uf!==Symbol.prototype?"symbol":typeof uf},hc(mc)}function pc(mc,uf){(0,bo.default)(mc);var df,ff;hc(uf)==="object"?(df=uf.min||0,ff=uf.max):(df=arguments[1]||0,ff=arguments[2]);var hf=mc.match(/(\uFE0F|\uFE0E)/g)||[],pf=mc.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g)||[],mf=mc.length-hf.length-pf.length;return mf>=df&&(typeof ff>"u"||mf<=ff)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isLength,isLength.exports)),isLength.exports}var isUUID={exports:{}},hasRequiredIsUUID;function requireIsUUID(){return hasRequiredIsUUID||(hasRequiredIsUUID=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}var hc={1:/^[0-9A-F]{8}-[0-9A-F]{4}-1[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,2:/^[0-9A-F]{8}-[0-9A-F]{4}-2[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,7:/^[0-9A-F]{8}-[0-9A-F]{4}-7[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i};function pc(mc,uf){(0,bo.default)(mc);var df=hc[[void 0,null].includes(uf)?"all":uf];return!!df&&df.test(mc)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isUUID,isUUID.exports)),isUUID.exports}var isMongoId={exports:{}},hasRequiredIsMongoId;function requireIsMongoId(){return hasRequiredIsMongoId||(hasRequiredIsMongoId=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=hc(requireAssertString()),Ra=hc(requireIsHexadecimal());function hc(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc){return(0,bo.default)(mc),(0,Ra.default)(mc)&&mc.length===24}vo.exports=Ai.default,vo.exports.default=Ai.default}(isMongoId,isMongoId.exports)),isMongoId.exports}var isAfter={exports:{}},hasRequiredIsAfter;function requireIsAfter(){return hasRequiredIsAfter||(hasRequiredIsAfter=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hc;var bo=Ra(requireToDate());function Ra(pc){return pc&&pc.__esModule?pc:{default:pc}}function hc(pc,mc){var uf=(mc==null?void 0:mc.comparisonDate)||mc||Date().toString(),df=(0,bo.default)(uf),ff=(0,bo.default)(pc);return!!(ff&&df&&ff>df)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isAfter,isAfter.exports)),isAfter.exports}var isBefore={exports:{}},hasRequiredIsBefore;function requireIsBefore(){return hasRequiredIsBefore||(hasRequiredIsBefore=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=hc(requireAssertString()),Ra=hc(requireToDate());function hc(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc){var uf=arguments.length>1&&arguments[1]!==void 0?arguments[1]:String(new Date);(0,bo.default)(mc);var df=(0,Ra.default)(uf),ff=(0,Ra.default)(mc);return!!(ff&&df&&ff<df)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isBefore,isBefore.exports)),isBefore.exports}var isIn={exports:{}},hasRequiredIsIn;function requireIsIn(){return hasRequiredIsIn||(hasRequiredIsIn=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=hc(requireAssertString()),Ra=hc(requireToString());function hc(uf){return uf&&uf.__esModule?uf:{default:uf}}function pc(uf){"@babel/helpers - typeof";return pc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(df){return typeof df}:function(df){return df&&typeof Symbol=="function"&&df.constructor===Symbol&&df!==Symbol.prototype?"symbol":typeof df},pc(uf)}function mc(uf,df){(0,bo.default)(uf);var ff;if(Object.prototype.toString.call(df)==="[object Array]"){var hf=[];for(ff in df)({}).hasOwnProperty.call(df,ff)&&(hf[ff]=(0,Ra.default)(df[ff]));return hf.indexOf(uf)>=0}else{if(pc(df)==="object")return df.hasOwnProperty(uf);if(df&&typeof df.indexOf=="function")return df.indexOf(uf)>=0}return!1}vo.exports=Ai.default,vo.exports.default=Ai.default}(isIn,isIn.exports)),isIn.exports}var isLuhnNumber={exports:{}},hasRequiredIsLuhnNumber;function requireIsLuhnNumber(){return hasRequiredIsLuhnNumber||(hasRequiredIsLuhnNumber=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hc;var bo=Ra(requireAssertString());function Ra(pc){return pc&&pc.__esModule?pc:{default:pc}}function hc(pc){(0,bo.default)(pc);for(var mc=pc.replace(/[- ]+/g,""),uf=0,df,ff,hf,pf=mc.length-1;pf>=0;pf--)df=mc.substring(pf,pf+1),ff=parseInt(df,10),hf?(ff*=2,ff>=10?uf+=ff%10+1:uf+=ff):uf+=ff,hf=!hf;return!!(uf%10===0&&mc)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isLuhnNumber,isLuhnNumber.exports)),isLuhnNumber.exports}var isCreditCard={exports:{}},hasRequiredIsCreditCard;function requireIsCreditCard(){return hasRequiredIsCreditCard||(hasRequiredIsCreditCard=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=uf;var bo=hc(requireAssertString()),Ra=hc(requireIsLuhnNumber());function hc(df){return df&&df.__esModule?df:{default:df}}var pc={amex:/^3[47][0-9]{13}$/,dinersclub:/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/,discover:/^6(?:011|5[0-9][0-9])[0-9]{12,15}$/,jcb:/^(?:2131|1800|35\d{3})\d{11}$/,mastercard:/^5[1-5][0-9]{2}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/,unionpay:/^(6[27][0-9]{14}|^(81[0-9]{14,17}))$/,visa:/^(?:4[0-9]{12})(?:[0-9]{3,6})?$/},mc=function(){var df=[];for(var ff in pc)pc.hasOwnProperty(ff)&&df.push(pc[ff]);return df}();function uf(df){var ff=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,bo.default)(df);var hf=ff.provider,pf=df.replace(/[- ]+/g,"");if(hf&&hf.toLowerCase()in pc){if(!pc[hf.toLowerCase()].test(pf))return!1}else{if(hf&&!(hf.toLowerCase()in pc))throw new Error("".concat(hf," is not a valid credit card provider."));if(!mc.some(function(mf){return mf.test(pf)}))return!1}return(0,Ra.default)(df)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isCreditCard,isCreditCard.exports)),isCreditCard.exports}var isIdentityCard={exports:{}},hasRequiredIsIdentityCard;function requireIsIdentityCard(){return hasRequiredIsIdentityCard||(hasRequiredIsIdentityCard=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=hc(requireAssertString()),Ra=hc(requireIsInt());function hc(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc={PL:function(uf){(0,bo.default)(uf);var df={1:1,2:3,3:7,4:9,5:1,6:3,7:7,8:9,9:1,10:3,11:0};if(uf!=null&&uf.length===11&&(0,Ra.default)(uf,{allow_leading_zeroes:!0})){var ff=uf.split("").slice(0,-1),hf=ff.reduce(function(gf,yf,vf){return gf+Number(yf)*df[vf+1]},0),pf=hf%10,mf=Number(uf.charAt(uf.length-1));if(pf===0&&mf===0||mf===10-pf)return!0}return!1},ES:function(uf){(0,bo.default)(uf);var df=/^[0-9X-Z][0-9]{7}[TRWAGMYFPDXBNJZSQVHLCKE]$/,ff={X:0,Y:1,Z:2},hf=["T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E"],pf=uf.trim().toUpperCase();if(!df.test(pf))return!1;var mf=pf.slice(0,-1).replace(/[X,Y,Z]/g,function(gf){return ff[gf]});return pf.endsWith(hf[mf%23])},FI:function(uf){if((0,bo.default)(uf),uf.length!==11||!uf.match(/^\d{6}[\-A\+]\d{3}[0-9ABCDEFHJKLMNPRSTUVWXY]{1}$/))return!1;var df="0123456789ABCDEFHJKLMNPRSTUVWXY",ff=parseInt(uf.slice(0,6),10)*1e3+parseInt(uf.slice(7,10),10),hf=ff%31,pf=df[hf];return pf===uf.slice(10,11)},IN:function(uf){var df=/^[1-9]\d{3}\s?\d{4}\s?\d{4}$/,ff=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],hf=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]],pf=uf.trim();if(!df.test(pf))return!1;var mf=0,gf=pf.replace(/\s/g,"").split("").map(Number).reverse();return gf.forEach(function(yf,vf){mf=ff[mf][hf[vf%8][yf]]}),mf===0},IR:function(uf){if(!uf.match(/^\d{10}$/)||(uf="0000".concat(uf).slice(uf.length-6),parseInt(uf.slice(3,9),10)===0))return!1;for(var df=parseInt(uf.slice(9,10),10),ff=0,hf=0;hf<9;hf++)ff+=parseInt(uf.slice(hf,hf+1),10)*(10-hf);return ff%=11,ff<2&&df===ff||ff>=2&&df===11-ff},IT:function(uf){return uf.length!==9||uf==="CA00000AA"?!1:uf.search(/C[A-Z]\d{5}[A-Z]{2}/i)>-1},NO:function(uf){var df=uf.trim();if(isNaN(Number(df))||df.length!==11||df==="00000000000")return!1;var ff=df.split("").map(Number),hf=(11-(3*ff[0]+7*ff[1]+6*ff[2]+1*ff[3]+8*ff[4]+9*ff[5]+4*ff[6]+5*ff[7]+2*ff[8])%11)%11,pf=(11-(5*ff[0]+4*ff[1]+3*ff[2]+2*ff[3]+7*ff[4]+6*ff[5]+5*ff[6]+4*ff[7]+3*ff[8]+2*hf)%11)%11;return!(hf!==ff[9]||pf!==ff[10])},TH:function(uf){if(!uf.match(/^[1-8]\d{12}$/))return!1;for(var df=0,ff=0;ff<12;ff++)df+=parseInt(uf[ff],10)*(13-ff);return uf[12]===((11-df%11)%10).toString()},LK:function(uf){var df=/^[1-9]\d{8}[vx]$/i,ff=/^[1-9]\d{11}$/i;return uf.length===10&&df.test(uf)?!0:!!(uf.length===12&&ff.test(uf))},"he-IL":function(uf){var df=/^\d{9}$/,ff=uf.trim();if(!df.test(ff))return!1;for(var hf=ff,pf=0,mf,gf=0;gf<hf.length;gf++)mf=Number(hf[gf])*(gf%2+1),pf+=mf>9?mf-9:mf;return pf%10===0},"ar-LY":function(uf){var df=/^(1|2)\d{11}$/,ff=uf.trim();return!!df.test(ff)},"ar-TN":function(uf){var df=/^\d{8}$/,ff=uf.trim();return!!df.test(ff)},"zh-CN":function(uf){var df=["11","12","13","14","15","21","22","23","31","32","33","34","35","36","37","41","42","43","44","45","46","50","51","52","53","54","61","62","63","64","65","71","81","82","91"],ff=["7","9","10","5","8","4","2","1","6","3","7","9","10","5","8","4","2"],hf=["1","0","X","9","8","7","6","5","4","3","2"],pf=function(xf){return df.includes(xf)},mf=function(xf){var wf=parseInt(xf.substring(0,4),10),s1=parseInt(xf.substring(4,6),10),If=parseInt(xf.substring(6),10),l1=new Date(wf,s1-1,If);return l1>new Date?!1:l1.getFullYear()===wf&&l1.getMonth()===s1-1&&l1.getDate()===If},gf=function(xf){for(var wf=xf.substring(0,17),s1=0,If=0;If<17;If++)s1+=parseInt(wf.charAt(If),10)*parseInt(ff[If],10);var l1=s1%11;return hf[l1]},yf=function(xf){return gf(xf)===xf.charAt(17).toUpperCase()},vf=function(xf){var wf=/^[1-9]\d{7}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}$/.test(xf);if(!wf)return!1;var s1=xf.substring(0,2);if(wf=pf(s1),!wf)return!1;var If="19".concat(xf.substring(6,12));return wf=mf(If),!!wf},bf=function(xf){var wf=/^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}(\d|x|X)$/.test(xf);if(!wf)return!1;var s1=xf.substring(0,2);if(wf=pf(s1),!wf)return!1;var If=xf.substring(6,14);return wf=mf(If),wf?yf(xf):!1},Sf=function(xf){var wf=/^\d{15}|(\d{17}(\d|x|X))$/.test(xf);return wf?xf.length===15?vf(xf):bf(xf):!1};return Sf(uf)},"zh-HK":function(uf){uf=uf.trim();var df=/^[A-Z]{1,2}[0-9]{6}((\([0-9A]\))|(\[[0-9A]\])|([0-9A]))$/,ff=/^[0-9]$/;if(uf=uf.toUpperCase(),!df.test(uf))return!1;uf=uf.replace(/\[|\]|\(|\)/g,""),uf.length===8&&(uf="3".concat(uf));for(var hf=0,pf=0;pf<=7;pf++){var mf=void 0;ff.test(uf[pf])?mf=uf[pf]:mf=(uf[pf].charCodeAt(0)-55)%11,hf+=mf*(9-pf)}hf%=11;var gf;return hf===0?gf="0":hf===1?gf="A":gf=String(11-hf),gf===uf[uf.length-1]},"zh-TW":function(uf){var df={A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,I:34,J:18,K:19,L:20,M:21,N:22,O:35,P:23,Q:24,R:25,S:26,T:27,U:28,V:29,W:32,X:30,Y:31,Z:33},ff=uf.trim().toUpperCase();return/^[A-Z][0-9]{9}$/.test(ff)?Array.from(ff).reduce(function(hf,pf,mf){if(mf===0){var gf=df[pf];return gf%10*9+Math.floor(gf/10)}return mf===9?(10-hf%10-Number(pf))%10===0:hf+Number(pf)*(9-mf)},0):!1}};function mc(uf,df){if((0,bo.default)(uf),df in pc)return pc[df](uf);if(df==="any"){for(var ff in pc)if(pc.hasOwnProperty(ff)){var hf=pc[ff];if(hf(uf))return!0}return!1}throw new Error("Invalid locale '".concat(df,"'"))}vo.exports=Ai.default,vo.exports.default=Ai.default}(isIdentityCard,isIdentityCard.exports)),isIdentityCard.exports}var isEAN={exports:{}},hasRequiredIsEAN;function requireIsEAN(){return hasRequiredIsEAN||(hasRequiredIsEAN=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=ff;var bo=Ra(requireAssertString());function Ra(hf){return hf&&hf.__esModule?hf:{default:hf}}var hc=8,pc=14,mc=/^(\d{8}|\d{13}|\d{14})$/;function uf(hf,pf){return hf===hc||hf===pc?pf%2===0?3:1:pf%2===0?1:3}function df(hf){var pf=hf.slice(0,-1).split("").map(function(gf,yf){return Number(gf)*uf(hf.length,yf)}).reduce(function(gf,yf){return gf+yf},0),mf=10-pf%10;return mf<10?mf:0}function ff(hf){(0,bo.default)(hf);var pf=Number(hf.slice(-1));return mc.test(hf)&&pf===df(hf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isEAN,isEAN.exports)),isEAN.exports}var isISIN={exports:{}},hasRequiredIsISIN;function requireIsISIN(){return hasRequiredIsISIN||(hasRequiredIsISIN=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}var hc=/^[A-Z]{2}[0-9A-Z]{9}[0-9]$/;function pc(mc){if((0,bo.default)(mc),!hc.test(mc))return!1;for(var uf=!0,df=0,ff=mc.length-2;ff>=0;ff--)if(mc[ff]>="A"&&mc[ff]<="Z")for(var hf=mc[ff].charCodeAt(0)-55,pf=hf%10,mf=Math.trunc(hf/10),gf=0,yf=[pf,mf];gf<yf.length;gf++){var vf=yf[gf];uf?vf>=5?df+=1+(vf-5)*2:df+=vf*2:df+=vf,uf=!uf}else{var bf=mc[ff].charCodeAt(0)-48;uf?bf>=5?df+=1+(bf-5)*2:df+=bf*2:df+=bf,uf=!uf}var Sf=Math.trunc((df+9)/10)*10-df;return+mc[mc.length-1]===Sf}vo.exports=Ai.default,vo.exports.default=Ai.default}(isISIN,isISIN.exports)),isISIN.exports}var isISBN={exports:{}},hasRequiredIsISBN;function requireIsISBN(){return hasRequiredIsISBN||(hasRequiredIsISBN=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=uf;var bo=Ra(requireAssertString());function Ra(df){return df&&df.__esModule?df:{default:df}}var hc=/^(?:[0-9]{9}X|[0-9]{10})$/,pc=/^(?:[0-9]{13})$/,mc=[1,3];function uf(df,ff){(0,bo.default)(df);var hf=String((ff==null?void 0:ff.version)||ff);if(!(ff!=null&&ff.version||ff))return uf(df,{version:10})||uf(df,{version:13});var pf=df.replace(/[\s-]+/g,""),mf=0;if(hf==="10"){if(!hc.test(pf))return!1;for(var gf=0;gf<hf-1;gf++)mf+=(gf+1)*pf.charAt(gf);if(pf.charAt(9)==="X"?mf+=10*10:mf+=10*pf.charAt(9),mf%11===0)return!0}else if(hf==="13"){if(!pc.test(pf))return!1;for(var yf=0;yf<12;yf++)mf+=mc[yf%2]*pf.charAt(yf);if(pf.charAt(12)-(10-mf%10)%10===0)return!0}return!1}vo.exports=Ai.default,vo.exports.default=Ai.default}(isISBN,isISBN.exports)),isISBN.exports}var isISSN={exports:{}},hasRequiredIsISSN;function requireIsISSN(){return hasRequiredIsISSN||(hasRequiredIsISSN=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}var hc="^\\d{4}-?\\d{3}[\\dX]$";function pc(mc){var uf=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,bo.default)(mc);var df=hc;if(df=uf.require_hyphen?df.replace("?",""):df,df=uf.case_sensitive?new RegExp(df):new RegExp(df,"i"),!df.test(mc))return!1;for(var ff=mc.replace("-","").toUpperCase(),hf=0,pf=0;pf<ff.length;pf++){var mf=ff[pf];hf+=(mf==="X"?10:+mf)*(8-pf)}return hf%11===0}vo.exports=Ai.default,vo.exports.default=Ai.default}(isISSN,isISSN.exports)),isISSN.exports}var isTaxID={exports:{}},algorithms={},hasRequiredAlgorithms;function requireAlgorithms(){if(hasRequiredAlgorithms)return algorithms;hasRequiredAlgorithms=1,Object.defineProperty(algorithms,"__esModule",{value:!0}),algorithms.iso7064Check=vo,algorithms.luhnCheck=Ai,algorithms.reverseMultiplyAndSum=bo,algorithms.verhoeffCheck=Ra;function vo(hc){for(var pc=10,mc=0;mc<hc.length-1;mc++)pc=(parseInt(hc[mc],10)+pc)%10===0?10*2%11:(parseInt(hc[mc],10)+pc)%10*2%11;return pc=pc===1?0:11-pc,pc===parseInt(hc[10],10)}function Ai(hc){for(var pc=0,mc=!1,uf=hc.length-1;uf>=0;uf--){if(mc){var df=parseInt(hc[uf],10)*2;df>9?pc+=df.toString().split("").map(function(ff){return parseInt(ff,10)}).reduce(function(ff,hf){return ff+hf},0):pc+=df}else pc+=parseInt(hc[uf],10);mc=!mc}return pc%10===0}function bo(hc,pc){for(var mc=0,uf=0;uf<hc.length;uf++)mc+=hc[uf]*(pc-uf);return mc}function Ra(hc){for(var pc=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],mc=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]],uf=hc.split("").reverse().join(""),df=0,ff=0;ff<uf.length;ff++)df=pc[df][mc[ff%8][parseInt(uf[ff],10)]];return df===0}return algorithms}var hasRequiredIsTaxID;function requireIsTaxID(){return hasRequiredIsTaxID||(hasRequiredIsTaxID=1,function(vo,Ai){function bo(u1){"@babel/helpers - typeof";return bo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d1){return typeof d1}:function(d1){return d1&&typeof Symbol=="function"&&d1.constructor===Symbol&&d1!==Symbol.prototype?"symbol":typeof d1},bo(u1)}Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=P1;var Ra=df(requireAssertString()),hc=uf(requireAlgorithms()),pc=df(requireIsDate());function mc(u1){if(typeof WeakMap!="function")return null;var d1=new WeakMap,O1=new WeakMap;return(mc=function(U1){return U1?O1:d1})(u1)}function uf(u1,d1){if(u1&&u1.__esModule)return u1;if(u1===null||bo(u1)!="object"&&typeof u1!="function")return{default:u1};var O1=mc(d1);if(O1&&O1.has(u1))return O1.get(u1);var U1={__proto__:null},Q1=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var G1 in u1)if(G1!=="default"&&{}.hasOwnProperty.call(u1,G1)){var X1=Q1?Object.getOwnPropertyDescriptor(u1,G1):null;X1&&(X1.get||X1.set)?Object.defineProperty(U1,G1,X1):U1[G1]=u1[G1]}return U1.default=u1,O1&&O1.set(u1,U1),U1}function df(u1){return u1&&u1.__esModule?u1:{default:u1}}function ff(u1){return gf(u1)||mf(u1)||pf(u1)||hf()}function hf(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
344
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pf(u1,d1){if(u1){if(typeof u1=="string")return yf(u1,d1);var O1=Object.prototype.toString.call(u1).slice(8,-1);if(O1==="Object"&&u1.constructor&&(O1=u1.constructor.name),O1==="Map"||O1==="Set")return Array.from(u1);if(O1==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(O1))return yf(u1,d1)}}function mf(u1){if(typeof Symbol<"u"&&u1[Symbol.iterator]!=null||u1["@@iterator"]!=null)return Array.from(u1)}function gf(u1){if(Array.isArray(u1))return yf(u1)}function yf(u1,d1){(d1==null||d1>u1.length)&&(d1=u1.length);for(var O1=0,U1=new Array(d1);O1<d1;O1++)U1[O1]=u1[O1];return U1}function vf(u1){var d1=u1.slice(0,2),O1=parseInt(u1.slice(2,4),10);O1>40?(O1-=40,d1="20".concat(d1)):O1>20?(O1-=20,d1="18".concat(d1)):d1="19".concat(d1),O1<10&&(O1="0".concat(O1));var U1="".concat(d1,"/").concat(O1,"/").concat(u1.slice(4,6));if(!(0,pc.default)(U1,"YYYY/MM/DD"))return!1;for(var Q1=u1.split("").map(function(tT){return parseInt(tT,10)}),G1=[2,4,8,5,10,9,7,3,6],X1=0,K1=0;K1<G1.length;K1++)X1+=Q1[K1]*G1[K1];return X1=X1%11===10?0:X1%11,X1===Q1[9]}function bf(u1){var d1=u1.split(""),O1=d1.filter(function(Q1,G1){return G1%2}).map(function(Q1){return Number(Q1)*2}).join("").split(""),U1=d1.filter(function(Q1,G1){return!(G1%2)}).concat(O1).map(function(Q1){return Number(Q1)}).reduce(function(Q1,G1){return Q1+G1});return U1%10===0}function Sf(u1){u1=u1.replace(/\W/,"");var d1=parseInt(u1.slice(0,2),10);if(u1.length===10)d1<54?d1="20".concat(d1):d1="19".concat(d1);else{if(u1.slice(6)==="000")return!1;if(d1<54)d1="19".concat(d1);else return!1}d1.length===3&&(d1=[d1.slice(0,2),"0",d1.slice(2)].join(""));var O1=parseInt(u1.slice(2,4),10);if(O1>50&&(O1-=50),O1>20){if(parseInt(d1,10)<2004)return!1;O1-=20}O1<10&&(O1="0".concat(O1));var U1="".concat(d1,"/").concat(O1,"/").concat(u1.slice(4,6));if(!(0,pc.default)(U1,"YYYY/MM/DD"))return!1;if(u1.length===10&&parseInt(u1,10)%11!==0){var Q1=parseInt(u1.slice(0,9),10)%11;if(parseInt(d1,10)<1986&&Q1===10){if(parseInt(u1.slice(9),10)!==0)return!1}else return!1}return!0}function xf(u1){return hc.luhnCheck(u1)}function wf(u1){for(var d1=u1.split("").map(function(tT){return parseInt(tT,10)}),O1=[],U1=0;U1<d1.length-1;U1++){O1.push("");for(var Q1=0;Q1<d1.length-1;Q1++)d1[U1]===d1[Q1]&&(O1[U1]+=Q1)}if(O1=O1.filter(function(tT){return tT.length>1}),O1.length!==2&&O1.length!==3)return!1;if(O1[0].length===3){for(var G1=O1[0].split("").map(function(tT){return parseInt(tT,10)}),X1=0,K1=0;K1<G1.length-1;K1++)G1[K1]+1===G1[K1+1]&&(X1+=1);if(X1===2)return!1}return hc.iso7064Check(u1)}function s1(u1){u1=u1.replace(/\W/,"");var d1=parseInt(u1.slice(4,6),10),O1=u1.slice(6,7);switch(O1){case"0":case"1":case"2":case"3":d1="19".concat(d1);break;case"4":case"9":d1<37?d1="20".concat(d1):d1="19".concat(d1);break;default:if(d1<37)d1="20".concat(d1);else if(d1>58)d1="18".concat(d1);else return!1;break}d1.length===3&&(d1=[d1.slice(0,2),"0",d1.slice(2)].join(""));var U1="".concat(d1,"/").concat(u1.slice(2,4),"/").concat(u1.slice(0,2));if(!(0,pc.default)(U1,"YYYY/MM/DD"))return!1;for(var Q1=u1.split("").map(function(tT){return parseInt(tT,10)}),G1=0,X1=4,K1=0;K1<9;K1++)G1+=Q1[K1]*X1,X1-=1,X1===1&&(X1=7);return G1%=11,G1===1?!1:G1===0?Q1[9]===0:Q1[9]===11-G1}function If(u1){for(var d1=u1.slice(0,8).split("").map(function(G1){return parseInt(G1,10)}),O1=0,U1=1;U1<d1.length;U1+=2)O1+=d1[U1];for(var Q1=0;Q1<d1.length;Q1+=2)d1[Q1]<2?O1+=1-d1[Q1]:(O1+=2*(d1[Q1]-2)+5,d1[Q1]>4&&(O1+=2));return String.fromCharCode(O1%26+65)===u1.charAt(8)}function l1(u1){for(var d1=u1.split("").map(function(Q1){return parseInt(Q1,10)}),O1=0,U1=0;U1<8;U1++)O1+=d1[U1]*Math.pow(2,8-U1);return O1%11%10===d1[8]}function c1(u1){var d1=hc.reverseMultiplyAndSum(u1.split("").slice(0,7).map(function(O1){return parseInt(O1,10)}),8);return u1.length===9&&u1[8]!=="W"&&(d1+=(u1[8].charCodeAt(0)-64)*9),d1%=23,d1===0?u1[7].toUpperCase()==="W":u1[7].toUpperCase()===String.fromCharCode(64+d1)}var m1={andover:["10","12"],atlanta:["60","67"],austin:["50","53"],brookhaven:["01","02","03","04","05","06","11","13","14","16","21","22","23","25","34","51","52","54","55","56","57","58","59","65"],cincinnati:["30","32","35","36","37","38","61"],fresno:["15","24"],internet:["20","26","27","45","46","47"],kansas:["40","44"],memphis:["94","95"],ogden:["80","90"],philadelphia:["33","39","41","42","43","46","48","62","63","64","66","68","71","72","73","74","75","76","77","81","82","83","84","85","86","87","88","91","92","93","98","99"],sba:["31"]};function k1(){var u1=[];for(var d1 in m1)m1.hasOwnProperty(d1)&&u1.push.apply(u1,ff(m1[d1]));return u1}function N1(u1){return k1().indexOf(u1.slice(0,2))!==-1}function R1(u1){for(var d1=0,O1=u1.split(""),U1=parseInt(O1.pop(),10),Q1=0;Q1<O1.length;Q1++)d1+=O1[9-Q1]*(2+Q1%6);var G1=11-d1%11;return G1===11?G1=0:G1===10&&(G1=9),U1===G1}function $1(u1){var d1=u1.toUpperCase().split("");if(isNaN(parseInt(d1[0],10))&&d1.length>1){var O1=0;switch(d1[0]){case"Y":O1=1;break;case"Z":O1=2;break}d1.splice(0,1,O1)}else for(;d1.length<9;)d1.unshift(0);var U1=["T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E"];d1=d1.join("");var Q1=parseInt(d1.slice(0,8),10)%23;return d1[8]===U1[Q1]}function D1(u1){var d1=u1.slice(1,3),O1=u1.slice(0,1);switch(O1){case"1":case"2":d1="18".concat(d1);break;case"3":case"4":d1="19".concat(d1);break;default:d1="20".concat(d1);break}var U1="".concat(d1,"/").concat(u1.slice(3,5),"/").concat(u1.slice(5,7));if(!(0,pc.default)(U1,"YYYY/MM/DD"))return!1;for(var Q1=u1.split("").map(function(oT){return parseInt(oT,10)}),G1=0,X1=1,K1=0;K1<10;K1++)G1+=Q1[K1]*X1,X1+=1,X1===10&&(X1=1);if(G1%11===10){G1=0,X1=3;for(var tT=0;tT<10;tT++)G1+=Q1[tT]*X1,X1+=1,X1===10&&(X1=1);if(G1%11===10)return Q1[10]===0}return G1%11===Q1[10]}function f1(u1){var d1=u1.slice(4,6),O1=u1.slice(6,7);switch(O1){case"+":d1="18".concat(d1);break;case"-":d1="19".concat(d1);break;default:d1="20".concat(d1);break}var U1="".concat(d1,"/").concat(u1.slice(2,4),"/").concat(u1.slice(0,2));if(!(0,pc.default)(U1,"YYYY/MM/DD"))return!1;var Q1=parseInt(u1.slice(0,6)+u1.slice(7,10),10)%31;if(Q1<10)return Q1===parseInt(u1.slice(10),10);Q1-=10;var G1=["A","B","C","D","E","F","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y"];return G1[Q1]===u1.slice(10)}function T1(u1){if(u1.slice(2,4)!=="00"||u1.slice(4,6)!=="00"){var d1="".concat(u1.slice(0,2),"/").concat(u1.slice(2,4),"/").concat(u1.slice(4,6));if(!(0,pc.default)(d1,"YY/MM/DD"))return!1}var O1=97-parseInt(u1.slice(0,9),10)%97,U1=parseInt(u1.slice(9,11),10);return!(O1!==U1&&(O1=97-parseInt("2".concat(u1.slice(0,9)),10)%97,O1!==U1))}function A1(u1){u1=u1.replace(/\s/g,"");var d1=parseInt(u1.slice(0,10),10)%511,O1=parseInt(u1.slice(10,13),10);return d1===O1}function L1(u1){var d1="".concat(u1.slice(0,4),"/").concat(u1.slice(4,6),"/").concat(u1.slice(6,8));return!(0,pc.default)(d1,"YYYY/MM/DD")||!hc.luhnCheck(u1.slice(0,12))?!1:hc.verhoeffCheck("".concat(u1.slice(0,11)).concat(u1[12]))}function B1(u1){return hc.iso7064Check(u1)}function V1(u1){for(var d1=u1.split("").map(function(Q1){return parseInt(Q1,10)}),O1=8,U1=1;U1<9;U1++)O1+=d1[U1]*(U1+1);return O1%11===d1[9]}function Z1(u1){for(var d1=!1,O1=!1,U1=0;U1<3;U1++)if(!d1&&/[AEIOU]/.test(u1[U1]))d1=!0;else if(!O1&&d1&&u1[U1]==="X")O1=!0;else if(U1>0&&(d1&&!O1&&!/[AEIOU]/.test(u1[U1])||O1&&!/X/.test(u1[U1])))return!1;return!0}function H1(u1){var d1=u1.toUpperCase().split("");if(!Z1(d1.slice(0,3))||!Z1(d1.slice(3,6)))return!1;for(var O1=[6,7,9,10,12,13,14],U1={L:"0",M:"1",N:"2",P:"3",Q:"4",R:"5",S:"6",T:"7",U:"8",V:"9"},Q1=0,G1=O1;Q1<G1.length;Q1++){var X1=G1[Q1];d1[X1]in U1&&d1.splice(X1,1,U1[d1[X1]])}var K1={A:"01",B:"02",C:"03",D:"04",E:"05",H:"06",L:"07",M:"08",P:"09",R:"10",S:"11",T:"12"},tT=K1[d1[8]],oT=parseInt(d1[9]+d1[10],10);oT>40&&(oT-=40),oT<10&&(oT="0".concat(oT));var uT="".concat(d1[6]).concat(d1[7],"/").concat(tT,"/").concat(oT);if(!(0,pc.default)(uT,"YY/MM/DD"))return!1;for(var dT=0,cT=1;cT<d1.length-1;cT+=2){var pT=parseInt(d1[cT],10);isNaN(pT)&&(pT=d1[cT].charCodeAt(0)-65),dT+=pT}for(var hT={A:1,B:0,C:5,D:7,E:9,F:13,G:15,H:17,I:19,J:21,K:2,L:4,M:18,N:20,O:11,P:3,Q:6,R:8,S:12,T:14,U:16,V:10,W:22,X:25,Y:24,Z:23,0:1,1:0},mT=0;mT<d1.length-1;mT+=2){var vT=0;if(d1[mT]in hT)vT=hT[d1[mT]];else{var TT=parseInt(d1[mT],10);vT=2*TT+1,TT>4&&(vT+=2)}dT+=vT}return String.fromCharCode(65+dT%26)===d1[15]}function E1(u1){u1=u1.replace(/\W/,"");var d1=u1.slice(0,2);if(d1!=="32"){var O1=u1.slice(2,4);if(O1!=="00"){var U1=u1.slice(4,6);switch(u1[6]){case"0":U1="18".concat(U1);break;case"1":U1="19".concat(U1);break;default:U1="20".concat(U1);break}var Q1="".concat(U1,"/").concat(u1.slice(2,4),"/").concat(d1);if(!(0,pc.default)(Q1,"YYYY/MM/DD"))return!1}for(var G1=1101,X1=[1,6,3,7,9,10,5,8,4,2],K1=0;K1<u1.length-1;K1++)G1-=parseInt(u1[K1],10)*X1[K1];return parseInt(u1[10],10)===G1%11}return!0}function F1(u1){if(u1.length!==9){for(var d1=u1.toUpperCase().split("");d1.length<8;)d1.unshift(0);switch(u1[7]){case"A":case"P":if(parseInt(d1[6],10)===0)return!1;break;default:{var O1=parseInt(d1.join("").slice(0,5),10);if(O1>32e3)return!1;var U1=parseInt(d1.join("").slice(5,7),10);if(O1===U1)return!1}}}return!0}function M1(u1){return hc.reverseMultiplyAndSum(u1.split("").slice(0,8).map(function(d1){return parseInt(d1,10)}),9)%11===parseInt(u1[8],10)}function q1(u1){if(u1.length===10){for(var d1=[6,5,7,2,3,4,5,6,7],O1=0,U1=0;U1<d1.length;U1++)O1+=parseInt(u1[U1],10)*d1[U1];return O1%=11,O1===10?!1:O1===parseInt(u1[9],10)}var Q1=u1.slice(0,2),G1=parseInt(u1.slice(2,4),10);G1>80?(Q1="18".concat(Q1),G1-=80):G1>60?(Q1="22".concat(Q1),G1-=60):G1>40?(Q1="21".concat(Q1),G1-=40):G1>20?(Q1="20".concat(Q1),G1-=20):Q1="19".concat(Q1),G1<10&&(G1="0".concat(G1));var X1="".concat(Q1,"/").concat(G1,"/").concat(u1.slice(4,6));if(!(0,pc.default)(X1,"YYYY/MM/DD"))return!1;for(var K1=0,tT=1,oT=0;oT<u1.length-1;oT++)K1+=parseInt(u1[oT],10)*tT%10,tT+=2,tT>10?tT=1:tT===5&&(tT+=2);return K1=10-K1%10,K1===parseInt(u1[10],10)}function z1(u1){if(u1.length===11){var d1,O1;if(d1=0,u1==="11111111111"||u1==="22222222222"||u1==="33333333333"||u1==="44444444444"||u1==="55555555555"||u1==="66666666666"||u1==="77777777777"||u1==="88888888888"||u1==="99999999999"||u1==="00000000000")return!1;for(var U1=1;U1<=9;U1++)d1+=parseInt(u1.substring(U1-1,U1),10)*(11-U1);if(O1=d1*10%11,O1===10&&(O1=0),O1!==parseInt(u1.substring(9,10),10))return!1;d1=0;for(var Q1=1;Q1<=10;Q1++)d1+=parseInt(u1.substring(Q1-1,Q1),10)*(12-Q1);return O1=d1*10%11,O1===10&&(O1=0),O1===parseInt(u1.substring(10,11),10)}if(u1==="00000000000000"||u1==="11111111111111"||u1==="22222222222222"||u1==="33333333333333"||u1==="44444444444444"||u1==="55555555555555"||u1==="66666666666666"||u1==="77777777777777"||u1==="88888888888888"||u1==="99999999999999")return!1;for(var G1=u1.length-2,X1=u1.substring(0,G1),K1=u1.substring(G1),tT=0,oT=G1-7,uT=G1;uT>=1;uT--)tT+=X1.charAt(G1-uT)*oT,oT-=1,oT<2&&(oT=9);var dT=tT%11<2?0:11-tT%11;if(dT!==parseInt(K1.charAt(0),10))return!1;G1+=1,X1=u1.substring(0,G1),tT=0,oT=G1-7;for(var cT=G1;cT>=1;cT--)tT+=X1.charAt(G1-cT)*oT,oT-=1,oT<2&&(oT=9);return dT=tT%11<2?0:11-tT%11,dT===parseInt(K1.charAt(1),10)}function W1(u1){var d1=11-hc.reverseMultiplyAndSum(u1.split("").slice(0,8).map(function(O1){return parseInt(O1,10)}),9)%11;return d1>9?parseInt(u1[8],10)===0:d1===parseInt(u1[8],10)}function J1(u1){if(u1.slice(0,4)!=="9000"){var d1=u1.slice(1,3);switch(u1[0]){case"1":case"2":d1="19".concat(d1);break;case"3":case"4":d1="18".concat(d1);break;case"5":case"6":d1="20".concat(d1);break}var O1="".concat(d1,"/").concat(u1.slice(3,5),"/").concat(u1.slice(5,7));if(O1.length===8){if(!(0,pc.default)(O1,"YY/MM/DD"))return!1}else if(!(0,pc.default)(O1,"YYYY/MM/DD"))return!1;for(var U1=u1.split("").map(function(K1){return parseInt(K1,10)}),Q1=[2,7,9,1,4,6,3,5,8,2,7,9],G1=0,X1=0;X1<Q1.length;X1++)G1+=U1[X1]*Q1[X1];return G1%11===10?U1[12]===1:U1[12]===G1%11}return!0}function eT(u1){if(u1.length===9){if(u1=u1.replace(/\W/,""),u1.slice(6)==="000")return!1;var d1=parseInt(u1.slice(0,2),10);if(d1>53)return!1;d1<10?d1="190".concat(d1):d1="19".concat(d1);var O1=parseInt(u1.slice(2,4),10);O1>50&&(O1-=50),O1<10&&(O1="0".concat(O1));var U1="".concat(d1,"/").concat(O1,"/").concat(u1.slice(4,6));if(!(0,pc.default)(U1,"YYYY/MM/DD"))return!1}return!0}function nT(u1){var d1=11-hc.reverseMultiplyAndSum(u1.split("").slice(0,7).map(function(O1){return parseInt(O1,10)}),8)%11;return d1===10?parseInt(u1[7],10)===0:d1===parseInt(u1[7],10)}function sT(u1){var d1=u1.slice(0);u1.length>11&&(d1=d1.slice(2));var O1="",U1=d1.slice(2,4),Q1=parseInt(d1.slice(4,6),10);if(u1.length>11)O1=u1.slice(0,4);else if(O1=u1.slice(0,2),u1.length===11&&Q1<60){var G1=new Date().getFullYear().toString(),X1=parseInt(G1.slice(0,2),10);if(G1=parseInt(G1,10),u1[6]==="-")parseInt("".concat(X1).concat(O1),10)>G1?O1="".concat(X1-1).concat(O1):O1="".concat(X1).concat(O1);else if(O1="".concat(X1-1).concat(O1),G1-parseInt(O1,10)<100)return!1}Q1>60&&(Q1-=60),Q1<10&&(Q1="0".concat(Q1));var K1="".concat(O1,"/").concat(U1,"/").concat(Q1);if(K1.length===8){if(!(0,pc.default)(K1,"YY/MM/DD"))return!1}else if(!(0,pc.default)(K1,"YYYY/MM/DD"))return!1;return hc.luhnCheck(u1.replace(/\W/,""))}function iT(u1){for(var d1=u1.split("").map(function(G1){return parseInt(G1,10)}),O1=[-1,5,7,9,4,6,10,5,7],U1=0,Q1=0;Q1<O1.length;Q1++)U1+=d1[Q1]*O1[Q1];return U1%11===10?d1[9]===0:d1[9]===U1%11}var rT={"bg-BG":/^\d{10}$/,"cs-CZ":/^\d{6}\/{0,1}\d{3,4}$/,"de-AT":/^\d{9}$/,"de-DE":/^[1-9]\d{10}$/,"dk-DK":/^\d{6}-{0,1}\d{4}$/,"el-CY":/^[09]\d{7}[A-Z]$/,"el-GR":/^([0-4]|[7-9])\d{8}$/,"en-CA":/^\d{9}$/,"en-GB":/^\d{10}$|^(?!GB|NK|TN|ZZ)(?![DFIQUV])[A-Z](?![DFIQUVO])[A-Z]\d{6}[ABCD ]$/i,"en-IE":/^\d{7}[A-W][A-IW]{0,1}$/i,"en-US":/^\d{2}[- ]{0,1}\d{7}$/,"es-AR":/(20|23|24|27|30|33|34)[0-9]{8}[0-9]/,"es-ES":/^(\d{0,8}|[XYZKLM]\d{7})[A-HJ-NP-TV-Z]$/i,"et-EE":/^[1-6]\d{6}(00[1-9]|0[1-9][0-9]|[1-6][0-9]{2}|70[0-9]|710)\d$/,"fi-FI":/^\d{6}[-+A]\d{3}[0-9A-FHJ-NPR-Y]$/i,"fr-BE":/^\d{11}$/,"fr-FR":/^[0-3]\d{12}$|^[0-3]\d\s\d{2}(\s\d{3}){3}$/,"fr-LU":/^\d{13}$/,"hr-HR":/^\d{11}$/,"hu-HU":/^8\d{9}$/,"it-IT":/^[A-Z]{6}[L-NP-V0-9]{2}[A-EHLMPRST][L-NP-V0-9]{2}[A-ILMZ][L-NP-V0-9]{3}[A-Z]$/i,"lv-LV":/^\d{6}-{0,1}\d{5}$/,"mt-MT":/^\d{3,7}[APMGLHBZ]$|^([1-8])\1\d{7}$/i,"nl-NL":/^\d{9}$/,"pl-PL":/^\d{10,11}$/,"pt-BR":/(?:^\d{11}$)|(?:^\d{14}$)/,"pt-PT":/^\d{9}$/,"ro-RO":/^\d{13}$/,"sk-SK":/^\d{6}\/{0,1}\d{3,4}$/,"sl-SI":/^[1-9]\d{7}$/,"sv-SE":/^(\d{6}[-+]{0,1}\d{4}|(18|19|20)\d{6}[-+]{0,1}\d{4})$/,"uk-UA":/^\d{10}$/};rT["lb-LU"]=rT["fr-LU"],rT["lt-LT"]=rT["et-EE"],rT["nl-BE"]=rT["fr-BE"],rT["fr-CA"]=rT["en-CA"];var lT={"bg-BG":vf,"cs-CZ":Sf,"de-AT":xf,"de-DE":wf,"dk-DK":s1,"el-CY":If,"el-GR":l1,"en-CA":bf,"en-IE":c1,"en-US":N1,"es-AR":R1,"es-ES":$1,"et-EE":D1,"fi-FI":f1,"fr-BE":T1,"fr-FR":A1,"fr-LU":L1,"hr-HR":B1,"hu-HU":V1,"it-IT":H1,"lv-LV":E1,"mt-MT":F1,"nl-NL":M1,"pl-PL":q1,"pt-BR":z1,"pt-PT":W1,"ro-RO":J1,"sk-SK":eT,"sl-SI":nT,"sv-SE":sT,"uk-UA":iT};lT["lb-LU"]=lT["fr-LU"],lT["lt-LT"]=lT["et-EE"],lT["nl-BE"]=lT["fr-BE"],lT["fr-CA"]=lT["en-CA"];var _1=/[-\\\/!@#$%\^&\*\(\)\+\=\[\]]+/g,j1={"de-AT":_1,"de-DE":/[\/\\]/g,"fr-BE":_1};j1["nl-BE"]=j1["fr-BE"];function P1(u1){var d1=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US";(0,Ra.default)(u1);var O1=u1.slice(0);if(d1 in rT)return d1 in j1&&(O1=O1.replace(j1[d1],"")),rT[d1].test(O1)?d1 in lT?lT[d1](O1):!0:!1;throw new Error("Invalid locale '".concat(d1,"'"))}vo.exports=Ai.default,vo.exports.default=Ai.default}(isTaxID,isTaxID.exports)),isTaxID.exports}var isMobilePhone={},hasRequiredIsMobilePhone;function requireIsMobilePhone(){if(hasRequiredIsMobilePhone)return isMobilePhone;hasRequiredIsMobilePhone=1,Object.defineProperty(isMobilePhone,"__esModule",{value:!0}),isMobilePhone.default=Ra,isMobilePhone.locales=void 0;var vo=Ai(requireAssertString());function Ai(hc){return hc&&hc.__esModule?hc:{default:hc}}var bo={"am-AM":/^(\+?374|0)(33|4[134]|55|77|88|9[13-689])\d{6}$/,"ar-AE":/^((\+?971)|0)?5[024568]\d{7}$/,"ar-BH":/^(\+?973)?(3|6)\d{7}$/,"ar-DZ":/^(\+?213|0)(5|6|7)\d{8}$/,"ar-LB":/^(\+?961)?((3|81)\d{6}|7\d{7})$/,"ar-EG":/^((\+?20)|0)?1[0125]\d{8}$/,"ar-IQ":/^(\+?964|0)?7[0-9]\d{8}$/,"ar-JO":/^(\+?962|0)?7[789]\d{7}$/,"ar-KW":/^(\+?965)([569]\d{7}|41\d{6})$/,"ar-LY":/^((\+?218)|0)?(9[1-6]\d{7}|[1-8]\d{7,9})$/,"ar-MA":/^(?:(?:\+|00)212|0)[5-7]\d{8}$/,"ar-OM":/^((\+|00)968)?(9[1-9])\d{6}$/,"ar-PS":/^(\+?970|0)5[6|9](\d{7})$/,"ar-SA":/^(!?(\+?966)|0)?5\d{8}$/,"ar-SD":/^((\+?249)|0)?(9[012369]|1[012])\d{7}$/,"ar-SY":/^(!?(\+?963)|0)?9\d{8}$/,"ar-TN":/^(\+?216)?[2459]\d{7}$/,"az-AZ":/^(\+994|0)(10|5[015]|7[07]|99)\d{7}$/,"bs-BA":/^((((\+|00)3876)|06))((([0-3]|[5-6])\d{6})|(4\d{7}))$/,"be-BY":/^(\+?375)?(24|25|29|33|44)\d{7}$/,"bg-BG":/^(\+?359|0)?8[789]\d{7}$/,"bn-BD":/^(\+?880|0)1[13456789][0-9]{8}$/,"ca-AD":/^(\+376)?[346]\d{5}$/,"cs-CZ":/^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"da-DK":/^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,"de-DE":/^((\+49|0)1)(5[0-25-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/,"de-AT":/^(\+43|0)\d{1,4}\d{3,12}$/,"de-CH":/^(\+41|0)([1-9])\d{1,9}$/,"de-LU":/^(\+352)?((6\d1)\d{6})$/,"dv-MV":/^(\+?960)?(7[2-9]|9[1-9])\d{5}$/,"el-GR":/^(\+?30|0)?6(8[5-9]|9(?![26])[0-9])\d{7}$/,"el-CY":/^(\+?357?)?(9(9|6)\d{6})$/,"en-AI":/^(\+?1|0)264(?:2(35|92)|4(?:6[1-2]|76|97)|5(?:3[6-9]|8[1-4])|7(?:2(4|9)|72))\d{4}$/,"en-AU":/^(\+?61|0)4\d{8}$/,"en-AG":/^(?:\+1|1)268(?:464|7(?:1[3-9]|[28]\d|3[0246]|64|7[0-689]))\d{4}$/,"en-BM":/^(\+?1)?441(((3|7)\d{6}$)|(5[0-3][0-9]\d{4}$)|(59\d{5}$))/,"en-BS":/^(\+?1[-\s]?|0)?\(?242\)?[-\s]?\d{3}[-\s]?\d{4}$/,"en-GB":/^(\+?44|0)7\d{9}$/,"en-GG":/^(\+?44|0)1481\d{6}$/,"en-GH":/^(\+233|0)(20|50|24|54|27|57|26|56|23|28|55|59)\d{7}$/,"en-GY":/^(\+592|0)6\d{6}$/,"en-HK":/^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/,"en-MO":/^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/,"en-IE":/^(\+?353|0)8[356789]\d{7}$/,"en-IN":/^(\+?91|0)?[6789]\d{9}$/,"en-JM":/^(\+?876)?\d{7}$/,"en-KE":/^(\+?254|0)(7|1)\d{8}$/,"fr-CF":/^(\+?236| ?)(70|75|77|72|21|22)\d{6}$/,"en-SS":/^(\+?211|0)(9[1257])\d{7}$/,"en-KI":/^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/,"en-KN":/^(?:\+1|1)869(?:46\d|48[89]|55[6-8]|66\d|76[02-7])\d{4}$/,"en-LS":/^(\+?266)(22|28|57|58|59|27|52)\d{6}$/,"en-MT":/^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/,"en-MU":/^(\+?230|0)?\d{8}$/,"en-MW":/^(\+?265|0)(((77|88|31|99|98|21)\d{7})|(((111)|1)\d{6})|(32000\d{4}))$/,"en-NA":/^(\+?264|0)(6|8)\d{7}$/,"en-NG":/^(\+?234|0)?[789]\d{9}$/,"en-NZ":/^(\+?64|0)[28]\d{7,9}$/,"en-PG":/^(\+?675|0)?(7\d|8[18])\d{6}$/,"en-PK":/^((00|\+)?92|0)3[0-6]\d{8}$/,"en-PH":/^(09|\+639)\d{9}$/,"en-RW":/^(\+?250|0)?[7]\d{8}$/,"en-SG":/^(\+65)?[3689]\d{7}$/,"en-SL":/^(\+?232|0)\d{8}$/,"en-TZ":/^(\+?255|0)?[67]\d{8}$/,"en-UG":/^(\+?256|0)?[7]\d{8}$/,"en-US":/^((\+1|1)?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/,"en-ZA":/^(\+?27|0)\d{9}$/,"en-ZM":/^(\+?26)?09[567]\d{7}$/,"en-ZW":/^(\+263)[0-9]{9}$/,"en-BW":/^(\+?267)?(7[1-8]{1})\d{6}$/,"es-AR":/^\+?549(11|[2368]\d)\d{8}$/,"es-BO":/^(\+?591)?(6|7)\d{7}$/,"es-CO":/^(\+?57)?3(0(0|1|2|4|5)|1\d|2[0-4]|5(0|1))\d{7}$/,"es-CL":/^(\+?56|0)[2-9]\d{1}\d{7}$/,"es-CR":/^(\+506)?[2-8]\d{7}$/,"es-CU":/^(\+53|0053)?5\d{7}$/,"es-DO":/^(\+?1)?8[024]9\d{7}$/,"es-HN":/^(\+?504)?[9|8|3|2]\d{7}$/,"es-EC":/^(\+?593|0)([2-7]|9[2-9])\d{7}$/,"es-ES":/^(\+?34)?[6|7]\d{8}$/,"es-PE":/^(\+?51)?9\d{8}$/,"es-MX":/^(\+?52)?(1|01)?\d{10,11}$/,"es-NI":/^(\+?505)\d{7,8}$/,"es-PA":/^(\+?507)\d{7,8}$/,"es-PY":/^(\+?595|0)9[9876]\d{7}$/,"es-SV":/^(\+?503)?[67]\d{7}$/,"es-UY":/^(\+598|0)9[1-9][\d]{6}$/,"es-VE":/^(\+?58)?(2|4)\d{9}$/,"et-EE":/^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,"fa-IR":/^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,"fi-FI":/^(\+?358|0)\s?(4[0-6]|50)\s?(\d\s?){4,8}$/,"fj-FJ":/^(\+?679)?\s?\d{3}\s?\d{4}$/,"fo-FO":/^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"fr-BF":/^(\+226|0)[67]\d{7}$/,"fr-BJ":/^(\+229)\d{8}$/,"fr-CD":/^(\+?243|0)?(8|9)\d{8}$/,"fr-CM":/^(\+?237)6[0-9]{8}$/,"fr-FR":/^(\+?33|0)[67]\d{8}$/,"fr-GF":/^(\+?594|0|00594)[67]\d{8}$/,"fr-GP":/^(\+?590|0|00590)[67]\d{8}$/,"fr-MQ":/^(\+?596|0|00596)[67]\d{8}$/,"fr-PF":/^(\+?689)?8[789]\d{6}$/,"fr-RE":/^(\+?262|0|00262)[67]\d{8}$/,"fr-WF":/^(\+681)?\d{6}$/,"he-IL":/^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,"hu-HU":/^(\+?36|06)(20|30|31|50|70)\d{7}$/,"id-ID":/^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,"ir-IR":/^(\+98|0)?9\d{9}$/,"it-IT":/^(\+?39)?\s?3\d{2} ?\d{6,7}$/,"it-SM":/^((\+378)|(0549)|(\+390549)|(\+3780549))?6\d{5,9}$/,"ja-JP":/^(\+81[ \-]?(\(0\))?|0)[6789]0[ \-]?\d{4}[ \-]?\d{4}$/,"ka-GE":/^(\+?995)?(79\d{7}|5\d{8})$/,"kk-KZ":/^(\+?7|8)?7\d{9}$/,"kl-GL":/^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"ko-KR":/^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,"ky-KG":/^(\+?7\s?\+?7|0)\s?\d{2}\s?\d{3}\s?\d{4}$/,"lt-LT":/^(\+370|8)\d{8}$/,"lv-LV":/^(\+?371)2\d{7}$/,"mg-MG":/^((\+?261|0)(2|3)\d)?\d{7}$/,"mn-MN":/^(\+|00|011)?976(77|81|88|91|94|95|96|99)\d{6}$/,"my-MM":/^(\+?959|09|9)(2[5-7]|3[1-2]|4[0-5]|6[6-9]|7[5-9]|9[6-9])[0-9]{7}$/,"ms-MY":/^(\+?60|0)1(([0145](-|\s)?\d{7,8})|([236-9](-|\s)?\d{7}))$/,"mz-MZ":/^(\+?258)?8[234567]\d{7}$/,"nb-NO":/^(\+?47)?[49]\d{7}$/,"ne-NP":/^(\+?977)?9[78]\d{8}$/,"nl-BE":/^(\+?32|0)4\d{8}$/,"nl-NL":/^(((\+|00)?31\(0\))|((\+|00)?31)|0)6{1}\d{8}$/,"nl-AW":/^(\+)?297(56|59|64|73|74|99)\d{5}$/,"nn-NO":/^(\+?47)?[49]\d{7}$/,"pl-PL":/^(\+?48)? ?([5-8]\d|45) ?\d{3} ?\d{2} ?\d{2}$/,"pt-BR":/^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[1-9]{1}\d{3}\-?\d{4}))$/,"pt-PT":/^(\+?351)?9[1236]\d{7}$/,"pt-AO":/^(\+244)\d{9}$/,"ro-MD":/^(\+?373|0)((6(0|1|2|6|7|8|9))|(7(6|7|8|9)))\d{6}$/,"ro-RO":/^(\+?40|0)\s?7\d{2}(\/|\s|\.|-)?\d{3}(\s|\.|-)?\d{3}$/,"ru-RU":/^(\+?7|8)?9\d{9}$/,"si-LK":/^(?:0|94|\+94)?(7(0|1|2|4|5|6|7|8)( |-)?)\d{7}$/,"sl-SI":/^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/,"sk-SK":/^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"so-SO":/^(\+?252|0)((6[0-9])\d{7}|(7[1-9])\d{7})$/,"sq-AL":/^(\+355|0)6[789]\d{6}$/,"sr-RS":/^(\+3816|06)[- \d]{5,9}$/,"sv-SE":/^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,"tg-TJ":/^(\+?992)?[5][5]\d{7}$/,"th-TH":/^(\+66|66|0)\d{9}$/,"tr-TR":/^(\+?90|0)?5\d{9}$/,"tk-TM":/^(\+993|993|8)\d{8}$/,"uk-UA":/^(\+?38|8)?0\d{9}$/,"uz-UZ":/^(\+?998)?(6[125-79]|7[1-69]|88|9\d)\d{7}$/,"vi-VN":/^((\+?84)|0)((3([2-9]))|(5([25689]))|(7([0|6-9]))|(8([1-9]))|(9([0-9])))([0-9]{7})$/,"zh-CN":/^((\+|00)86)?(1[3-9]|9[28])\d{9}$/,"zh-TW":/^(\+?886\-?|0)?9\d{8}$/,"dz-BT":/^(\+?975|0)?(17|16|77|02)\d{6}$/,"ar-YE":/^(((\+|00)9677|0?7)[0137]\d{7}|((\+|00)967|0)[1-7]\d{6})$/,"ar-EH":/^(\+?212|0)[\s\-]?(5288|5289)[\s\-]?\d{5}$/,"fa-AF":/^(\+93|0)?(2{1}[0-8]{1}|[3-5]{1}[0-4]{1})(\d{7})$/};bo["en-CA"]=bo["en-US"],bo["fr-CA"]=bo["en-CA"],bo["fr-BE"]=bo["nl-BE"],bo["zh-HK"]=bo["en-HK"],bo["zh-MO"]=bo["en-MO"],bo["ga-IE"]=bo["en-IE"],bo["fr-CH"]=bo["de-CH"],bo["it-CH"]=bo["fr-CH"];function Ra(hc,pc,mc){if((0,vo.default)(hc),mc&&mc.strictMode&&!hc.startsWith("+"))return!1;if(Array.isArray(pc))return pc.some(function(ff){if(bo.hasOwnProperty(ff)){var hf=bo[ff];if(hf.test(hc))return!0}return!1});if(pc in bo)return bo[pc].test(hc);if(!pc||pc==="any"){for(var uf in bo)if(bo.hasOwnProperty(uf)){var df=bo[uf];if(df.test(hc))return!0}return!1}throw new Error("Invalid locale '".concat(pc,"'"))}return isMobilePhone.locales=Object.keys(bo),isMobilePhone}var isEthereumAddress={exports:{}},hasRequiredIsEthereumAddress;function requireIsEthereumAddress(){return hasRequiredIsEthereumAddress||(hasRequiredIsEthereumAddress=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}var hc=/^(0x)[0-9a-f]{40}$/i;function pc(mc){return(0,bo.default)(mc),hc.test(mc)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isEthereumAddress,isEthereumAddress.exports)),isEthereumAddress.exports}var isCurrency={exports:{}},hasRequiredIsCurrency;function requireIsCurrency(){return hasRequiredIsCurrency||(hasRequiredIsCurrency=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=uf;var bo=hc(requireMerge()),Ra=hc(requireAssertString());function hc(df){return df&&df.__esModule?df:{default:df}}function pc(df){var ff="\\d{".concat(df.digits_after_decimal[0],"}");df.digits_after_decimal.forEach(function(xf,wf){wf!==0&&(ff="".concat(ff,"|\\d{").concat(xf,"}"))});var hf="(".concat(df.symbol.replace(/\W/,function(xf){return"\\".concat(xf)}),")").concat(df.require_symbol?"":"?"),pf="-?",mf="[1-9]\\d*",gf="[1-9]\\d{0,2}(\\".concat(df.thousands_separator,"\\d{3})*"),yf=["0",mf,gf],vf="(".concat(yf.join("|"),")?"),bf="(\\".concat(df.decimal_separator,"(").concat(ff,"))").concat(df.require_decimal?"":"?"),Sf=vf+(df.allow_decimal||df.require_decimal?bf:"");return df.allow_negatives&&!df.parens_for_negatives&&(df.negative_sign_after_digits?Sf+=pf:df.negative_sign_before_digits&&(Sf=pf+Sf)),df.allow_negative_sign_placeholder?Sf="( (?!\\-))?".concat(Sf):df.allow_space_after_symbol?Sf=" ?".concat(Sf):df.allow_space_after_digits&&(Sf+="( (?!$))?"),df.symbol_after_digits?Sf+=hf:Sf=hf+Sf,df.allow_negatives&&(df.parens_for_negatives?Sf="(\\(".concat(Sf,"\\)|").concat(Sf,")"):df.negative_sign_before_digits||df.negative_sign_after_digits||(Sf=pf+Sf)),new RegExp("^(?!-? )(?=.*\\d)".concat(Sf,"$"))}var mc={symbol:"$",require_symbol:!1,allow_space_after_symbol:!1,symbol_after_digits:!1,allow_negatives:!0,parens_for_negatives:!1,negative_sign_before_digits:!1,negative_sign_after_digits:!1,allow_negative_sign_placeholder:!1,thousands_separator:",",decimal_separator:".",allow_decimal:!0,require_decimal:!1,digits_after_decimal:[2],allow_space_after_digits:!1};function uf(df,ff){return(0,Ra.default)(df),ff=(0,bo.default)(ff,mc),pc(ff).test(df)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isCurrency,isCurrency.exports)),isCurrency.exports}var isBtcAddress={exports:{}},hasRequiredIsBtcAddress;function requireIsBtcAddress(){return hasRequiredIsBtcAddress||(hasRequiredIsBtcAddress=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var hc=/^(bc1)[a-z0-9]{25,39}$/,pc=/^(1|3)[A-HJ-NP-Za-km-z1-9]{25,39}$/;function mc(uf){return(0,bo.default)(uf),hc.test(uf)||pc.test(uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isBtcAddress,isBtcAddress.exports)),isBtcAddress.exports}var isISO6346={},hasRequiredIsISO6346;function requireIsISO6346(){if(hasRequiredIsISO6346)return isISO6346;hasRequiredIsISO6346=1,Object.defineProperty(isISO6346,"__esModule",{value:!0}),isISO6346.isFreightContainerID=void 0,isISO6346.isISO6346=hc;var vo=Ai(requireAssertString());function Ai(pc){return pc&&pc.__esModule?pc:{default:pc}}var bo=/^[A-Z]{3}(U[0-9]{7})|([J,Z][0-9]{6,7})$/,Ra=/^[0-9]$/;function hc(pc){if((0,vo.default)(pc),pc=pc.toUpperCase(),!bo.test(pc))return!1;if(pc.length===11){for(var mc=0,uf=0;uf<pc.length-1;uf++)if(Ra.test(pc[uf]))mc+=pc[uf]*Math.pow(2,uf);else{var df=void 0,ff=pc.charCodeAt(uf)-55;ff<11?df=ff:ff>=11&&ff<=20?df=12+ff%11:ff>=21&&ff<=30?df=23+ff%21:df=34+ff%31,mc+=df*Math.pow(2,uf)}var hf=mc%11;return Number(pc[pc.length-1])===hf}return!0}return isISO6346.isFreightContainerID=hc,isISO6346}var isISO6391={exports:{}},hasRequiredIsISO6391;function requireIsISO6391(){return hasRequiredIsISO6391||(hasRequiredIsISO6391=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}var hc=new Set(["aa","ab","ae","af","ak","am","an","ar","as","av","ay","az","az","ba","be","bg","bh","bi","bm","bn","bo","br","bs","ca","ce","ch","co","cr","cs","cu","cv","cy","da","de","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu","gv","ha","he","hi","ho","hr","ht","hu","hy","hz","ia","id","ie","ig","ii","ik","io","is","it","iu","ja","jv","ka","kg","ki","kj","kk","kl","km","kn","ko","kr","ks","ku","kv","kw","ky","la","lb","lg","li","ln","lo","lt","lu","lv","mg","mh","mi","mk","ml","mn","mr","ms","mt","my","na","nb","nd","ne","ng","nl","nn","no","nr","nv","ny","oc","oj","om","or","os","pa","pi","pl","ps","pt","qu","rm","rn","ro","ru","rw","sa","sc","sd","se","sg","si","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","wo","xh","yi","yo","za","zh","zu"]);function pc(mc){return(0,bo.default)(mc),hc.has(mc)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isISO6391,isISO6391.exports)),isISO6391.exports}var isISO8601={exports:{}},hasRequiredIsISO8601;function requireIsISO8601(){return hasRequiredIsISO8601||(hasRequiredIsISO8601=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=uf;var bo=Ra(requireAssertString());function Ra(df){return df&&df.__esModule?df:{default:df}}var hc=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,pc=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,mc=function(df){var ff=df.match(/^(\d{4})-?(\d{3})([ T]{1}\.*|$)/);if(ff){var hf=Number(ff[1]),pf=Number(ff[2]);return hf%4===0&&hf%100!==0||hf%400===0?pf<=366:pf<=365}var mf=df.match(/(\d{4})-?(\d{0,2})-?(\d*)/).map(Number),gf=mf[1],yf=mf[2],vf=mf[3],bf=yf&&"0".concat(yf).slice(-2),Sf=vf&&"0".concat(vf).slice(-2),xf=new Date("".concat(gf,"-").concat(bf||"01","-").concat(Sf||"01"));return yf&&vf?xf.getUTCFullYear()===gf&&xf.getUTCMonth()+1===yf&&xf.getUTCDate()===vf:!0};function uf(df){var ff=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,bo.default)(df);var hf=ff.strictSeparator?pc.test(df):hc.test(df);return hf&&ff.strict?mc(df):hf}vo.exports=Ai.default,vo.exports.default=Ai.default}(isISO8601,isISO8601.exports)),isISO8601.exports}var isRFC3339={exports:{}},hasRequiredIsRFC3339;function requireIsRFC3339(){return hasRequiredIsRFC3339||(hasRequiredIsRFC3339=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=Sf;var bo=Ra(requireAssertString());function Ra(xf){return xf&&xf.__esModule?xf:{default:xf}}var hc=/[0-9]{4}/,pc=/(0[1-9]|1[0-2])/,mc=/([12]\d|0[1-9]|3[01])/,uf=/([01][0-9]|2[0-3])/,df=/[0-5][0-9]/,ff=/([0-5][0-9]|60)/,hf=/(\.[0-9]+)?/,pf=new RegExp("[-+]".concat(uf.source,":").concat(df.source)),mf=new RegExp("([zZ]|".concat(pf.source,")")),gf=new RegExp("".concat(uf.source,":").concat(df.source,":").concat(ff.source).concat(hf.source)),yf=new RegExp("".concat(hc.source,"-").concat(pc.source,"-").concat(mc.source)),vf=new RegExp("".concat(gf.source).concat(mf.source)),bf=new RegExp("^".concat(yf.source,"[ tT]").concat(vf.source,"$"));function Sf(xf){return(0,bo.default)(xf),bf.test(xf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isRFC3339,isRFC3339.exports)),isRFC3339.exports}var isISO31661Alpha3={exports:{}},hasRequiredIsISO31661Alpha3;function requireIsISO31661Alpha3(){return hasRequiredIsISO31661Alpha3||(hasRequiredIsISO31661Alpha3=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}var hc=new Set(["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","VAT","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWZ","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","URY","UZB","VUT","VEN","VNM","VGB","VIR","WLF","ESH","YEM","ZMB","ZWE"]);function pc(mc){return(0,bo.default)(mc),hc.has(mc.toUpperCase())}vo.exports=Ai.default,vo.exports.default=Ai.default}(isISO31661Alpha3,isISO31661Alpha3.exports)),isISO31661Alpha3.exports}var isISO4217={},hasRequiredIsISO4217;function requireIsISO4217(){if(hasRequiredIsISO4217)return isISO4217;hasRequiredIsISO4217=1,Object.defineProperty(isISO4217,"__esModule",{value:!0}),isISO4217.CurrencyCodes=void 0,isISO4217.default=Ra;var vo=Ai(requireAssertString());function Ai(hc){return hc&&hc.__esModule?hc:{default:hc}}var bo=new Set(["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HRK","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SLL","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VES","VND","VUV","WST","XAF","XAG","XAU","XBA","XBB","XBC","XBD","XCD","XDR","XOF","XPD","XPF","XPT","XSU","XTS","XUA","XXX","YER","ZAR","ZMW","ZWL"]);function Ra(hc){return(0,vo.default)(hc),bo.has(hc.toUpperCase())}return isISO4217.CurrencyCodes=bo,isISO4217}var isBase32={exports:{}},hasRequiredIsBase32;function requireIsBase32(){return hasRequiredIsBase32||(hasRequiredIsBase32=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=df;var bo=hc(requireAssertString()),Ra=hc(requireMerge());function hc(ff){return ff&&ff.__esModule?ff:{default:ff}}var pc=/^[A-Z2-7]+=*$/,mc=/^[A-HJKMNP-TV-Z0-9]+$/,uf={crockford:!1};function df(ff,hf){if((0,bo.default)(ff),hf=(0,Ra.default)(hf,uf),hf.crockford)return mc.test(ff);var pf=ff.length;return!!(pf%8===0&&pc.test(ff))}vo.exports=Ai.default,vo.exports.default=Ai.default}(isBase32,isBase32.exports)),isBase32.exports}var isBase58={exports:{}},hasRequiredIsBase58;function requireIsBase58(){return hasRequiredIsBase58||(hasRequiredIsBase58=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}var hc=/^[A-HJ-NP-Za-km-z1-9]*$/;function pc(mc){return(0,bo.default)(mc),!!hc.test(mc)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isBase58,isBase58.exports)),isBase58.exports}var isDataURI={exports:{}},hasRequiredIsDataURI;function requireIsDataURI(){return hasRequiredIsDataURI||(hasRequiredIsDataURI=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=uf;var bo=Ra(requireAssertString());function Ra(df){return df&&df.__esModule?df:{default:df}}var hc=/^[a-z]+\/[a-z0-9\-\+\._]+$/i,pc=/^[a-z\-]+=[a-z0-9\-]+$/i,mc=/^[a-z0-9!\$&'\(\)\*\+,;=\-\._~:@\/\?%\s]*$/i;function uf(df){(0,bo.default)(df);var ff=df.split(",");if(ff.length<2)return!1;var hf=ff.shift().trim().split(";"),pf=hf.shift();if(pf.slice(0,5)!=="data:")return!1;var mf=pf.slice(5);if(mf!==""&&!hc.test(mf))return!1;for(var gf=0;gf<hf.length;gf++)if(!(gf===hf.length-1&&hf[gf].toLowerCase()==="base64")&&!pc.test(hf[gf]))return!1;for(var yf=0;yf<ff.length;yf++)if(!mc.test(ff[yf]))return!1;return!0}vo.exports=Ai.default,vo.exports.default=Ai.default}(isDataURI,isDataURI.exports)),isDataURI.exports}var isMagnetURI={exports:{}},hasRequiredIsMagnetURI;function requireIsMagnetURI(){return hasRequiredIsMagnetURI||(hasRequiredIsMagnetURI=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}var hc=/(?:^magnet:\?|[^?&]&)xt(?:\.1)?=urn:(?:(?:aich|bitprint|btih|ed2k|ed2khash|kzhash|md5|sha1|tree:tiger):[a-z0-9]{32}(?:[a-z0-9]{8})?|btmh:1220[a-z0-9]{64})(?:$|&)/i;function pc(mc){return(0,bo.default)(mc),mc.indexOf("magnet:?")!==0?!1:hc.test(mc)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isMagnetURI,isMagnetURI.exports)),isMagnetURI.exports}var isMailtoURI={exports:{}},trim={exports:{}},rtrim={exports:{}},hasRequiredRtrim;function requireRtrim(){return hasRequiredRtrim||(hasRequiredRtrim=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hc;var bo=Ra(requireAssertString());function Ra(pc){return pc&&pc.__esModule?pc:{default:pc}}function hc(pc,mc){if((0,bo.default)(pc),mc){var uf=new RegExp("[".concat(mc.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"]+$"),"g");return pc.replace(uf,"")}for(var df=pc.length-1;/\s/.test(pc.charAt(df));)df-=1;return pc.slice(0,df+1)}vo.exports=Ai.default,vo.exports.default=Ai.default}(rtrim,rtrim.exports)),rtrim.exports}var ltrim={exports:{}},hasRequiredLtrim;function requireLtrim(){return hasRequiredLtrim||(hasRequiredLtrim=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hc;var bo=Ra(requireAssertString());function Ra(pc){return pc&&pc.__esModule?pc:{default:pc}}function hc(pc,mc){(0,bo.default)(pc);var uf=mc?new RegExp("^[".concat(mc.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"]+"),"g"):/^\s+/g;return pc.replace(uf,"")}vo.exports=Ai.default,vo.exports.default=Ai.default}(ltrim,ltrim.exports)),ltrim.exports}var hasRequiredTrim;function requireTrim(){return hasRequiredTrim||(hasRequiredTrim=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=hc(requireRtrim()),Ra=hc(requireLtrim());function hc(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc,uf){return(0,bo.default)((0,Ra.default)(mc,uf),uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(trim,trim.exports)),trim.exports}var hasRequiredIsMailtoURI;function requireIsMailtoURI(){return hasRequiredIsMailtoURI||(hasRequiredIsMailtoURI=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=yf;var bo=pc(requireTrim()),Ra=pc(requireIsEmail()),hc=pc(requireAssertString());function pc(vf){return vf&&vf.__esModule?vf:{default:vf}}function mc(vf,bf){return ff(vf)||df(vf,bf)||pf(vf,bf)||uf()}function uf(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
345
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function df(vf,bf){var Sf=vf==null?null:typeof Symbol<"u"&&vf[Symbol.iterator]||vf["@@iterator"];if(Sf!=null){var xf,wf,s1,If,l1=[],c1=!0,m1=!1;try{if(s1=(Sf=Sf.call(vf)).next,bf!==0)for(;!(c1=(xf=s1.call(Sf)).done)&&(l1.push(xf.value),l1.length!==bf);c1=!0);}catch(k1){m1=!0,wf=k1}finally{try{if(!c1&&Sf.return!=null&&(If=Sf.return(),Object(If)!==If))return}finally{if(m1)throw wf}}return l1}}function ff(vf){if(Array.isArray(vf))return vf}function hf(vf,bf){var Sf=typeof Symbol<"u"&&vf[Symbol.iterator]||vf["@@iterator"];if(!Sf){if(Array.isArray(vf)||(Sf=pf(vf))||bf){Sf&&(vf=Sf);var xf=0,wf=function(){};return{s:wf,n:function(){return xf>=vf.length?{done:!0}:{done:!1,value:vf[xf++]}},e:function(c1){throw c1},f:wf}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
346
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s1=!0,If=!1,l1;return{s:function(){Sf=Sf.call(vf)},n:function(){var c1=Sf.next();return s1=c1.done,c1},e:function(c1){If=!0,l1=c1},f:function(){try{!s1&&Sf.return!=null&&Sf.return()}finally{if(If)throw l1}}}}function pf(vf,bf){if(vf){if(typeof vf=="string")return mf(vf,bf);var Sf=Object.prototype.toString.call(vf).slice(8,-1);if(Sf==="Object"&&vf.constructor&&(Sf=vf.constructor.name),Sf==="Map"||Sf==="Set")return Array.from(vf);if(Sf==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Sf))return mf(vf,bf)}}function mf(vf,bf){(bf==null||bf>vf.length)&&(bf=vf.length);for(var Sf=0,xf=new Array(bf);Sf<bf;Sf++)xf[Sf]=vf[Sf];return xf}function gf(vf){var bf=new Set(["subject","body","cc","bcc"]),Sf={cc:"",bcc:""},xf=!1,wf=vf.split("&");if(wf.length>4)return!1;var s1=hf(wf),If;try{for(s1.s();!(If=s1.n()).done;){var l1=If.value,c1=l1.split("="),m1=mc(c1,2),k1=m1[0],N1=m1[1];if(k1&&!bf.has(k1)){xf=!0;break}N1&&(k1==="cc"||k1==="bcc")&&(Sf[k1]=N1),k1&&bf.delete(k1)}}catch(R1){s1.e(R1)}finally{s1.f()}return xf?!1:Sf}function yf(vf,bf){if((0,hc.default)(vf),vf.indexOf("mailto:")!==0)return!1;var Sf=vf.replace("mailto:","").split("?"),xf=mc(Sf,2),wf=xf[0],s1=xf[1],If=s1===void 0?"":s1;if(!wf&&!If)return!0;var l1=gf(If);return l1?"".concat(wf,",").concat(l1.cc,",").concat(l1.bcc).split(",").every(function(c1){return c1=(0,bo.default)(c1," "),c1?(0,Ra.default)(c1,bf):!0}):!1}vo.exports=Ai.default,vo.exports.default=Ai.default}(isMailtoURI,isMailtoURI.exports)),isMailtoURI.exports}var isMimeType={exports:{}},hasRequiredIsMimeType;function requireIsMimeType(){return hasRequiredIsMimeType||(hasRequiredIsMimeType=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=uf;var bo=Ra(requireAssertString());function Ra(df){return df&&df.__esModule?df:{default:df}}var hc=/^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+_]{1,100}$/i,pc=/^text\/[a-zA-Z0-9\.\-\+]{1,100};\s?charset=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?$/i,mc=/^multipart\/[a-zA-Z0-9\.\-\+]{1,100}(;\s?(boundary|charset)=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?){0,2}$/i;function uf(df){return(0,bo.default)(df),hc.test(df)||pc.test(df)||mc.test(df)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isMimeType,isMimeType.exports)),isMimeType.exports}var isLatLong={exports:{}},hasRequiredIsLatLong;function requireIsLatLong(){return hasRequiredIsLatLong||(hasRequiredIsLatLong=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hf;var bo=hc(requireAssertString()),Ra=hc(requireMerge());function hc(pf){return pf&&pf.__esModule?pf:{default:pf}}var pc=/^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/,mc=/^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/,uf=/^(([1-8]?\d)\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|90\D+0\D+0)\D+[NSns]?$/i,df=/^\s*([1-7]?\d{1,2}\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|180\D+0\D+0)\D+[EWew]?$/i,ff={checkDMS:!1};function hf(pf,mf){if((0,bo.default)(pf),mf=(0,Ra.default)(mf,ff),!pf.includes(","))return!1;var gf=pf.split(",");return gf[0].startsWith("(")&&!gf[1].endsWith(")")||gf[1].endsWith(")")&&!gf[0].startsWith("(")?!1:mf.checkDMS?uf.test(gf[0])&&df.test(gf[1]):pc.test(gf[0])&&mc.test(gf[1])}vo.exports=Ai.default,vo.exports.default=Ai.default}(isLatLong,isLatLong.exports)),isLatLong.exports}var isPostalCode={},hasRequiredIsPostalCode;function requireIsPostalCode(){if(hasRequiredIsPostalCode)return isPostalCode;hasRequiredIsPostalCode=1,Object.defineProperty(isPostalCode,"__esModule",{value:!0}),isPostalCode.default=uf,isPostalCode.locales=void 0;var vo=Ai(requireAssertString());function Ai(df){return df&&df.__esModule?df:{default:df}}var bo=/^\d{3}$/,Ra=/^\d{4}$/,hc=/^\d{5}$/,pc=/^\d{6}$/,mc={AD:/^AD\d{3}$/,AT:Ra,AU:Ra,AZ:/^AZ\d{4}$/,BA:/^([7-8]\d{4}$)/,BE:Ra,BG:Ra,BR:/^\d{5}-\d{3}$/,BY:/^2[1-4]\d{4}$/,CA:/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,CH:Ra,CN:/^(0[1-7]|1[012356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[1-5]|8[1345]|9[09])\d{4}$/,CZ:/^\d{3}\s?\d{2}$/,DE:hc,DK:Ra,DO:hc,DZ:hc,EE:hc,ES:/^(5[0-2]{1}|[0-4]{1}\d{1})\d{3}$/,FI:hc,FR:/^\d{2}\s?\d{3}$/,GB:/^(gir\s?0aa|[a-z]{1,2}\d[\da-z]?\s?(\d[a-z]{2})?)$/i,GR:/^\d{3}\s?\d{2}$/,HR:/^([1-5]\d{4}$)/,HT:/^HT\d{4}$/,HU:Ra,ID:hc,IE:/^(?!.*(?:o))[A-Za-z]\d[\dw]\s\w{4}$/i,IL:/^(\d{5}|\d{7})$/,IN:/^((?!10|29|35|54|55|65|66|86|87|88|89)[1-9][0-9]{5})$/,IR:/^(?!(\d)\1{3})[13-9]{4}[1346-9][013-9]{5}$/,IS:bo,IT:hc,JP:/^\d{3}\-\d{4}$/,KE:hc,KR:/^(\d{5}|\d{6})$/,LI:/^(948[5-9]|949[0-7])$/,LT:/^LT\-\d{5}$/,LU:Ra,LV:/^LV\-\d{4}$/,LK:hc,MG:bo,MX:hc,MT:/^[A-Za-z]{3}\s{0,1}\d{4}$/,MY:hc,NL:/^[1-9]\d{3}\s?(?!sa|sd|ss)[a-z]{2}$/i,NO:Ra,NP:/^(10|21|22|32|33|34|44|45|56|57)\d{3}$|^(977)$/i,NZ:Ra,PL:/^\d{2}\-\d{3}$/,PR:/^00[679]\d{2}([ -]\d{4})?$/,PT:/^\d{4}\-\d{3}?$/,RO:pc,RU:pc,SA:hc,SE:/^[1-9]\d{2}\s?\d{2}$/,SG:pc,SI:Ra,SK:/^\d{3}\s?\d{2}$/,TH:hc,TN:Ra,TW:/^\d{3}(\d{2})?$/,UA:hc,US:/^\d{5}(-\d{4})?$/,ZA:Ra,ZM:hc};isPostalCode.locales=Object.keys(mc);function uf(df,ff){if((0,vo.default)(df),ff in mc)return mc[ff].test(df);if(ff==="any"){for(var hf in mc)if(mc.hasOwnProperty(hf)){var pf=mc[hf];if(pf.test(df))return!0}return!1}throw new Error("Invalid locale '".concat(ff,"'"))}return isPostalCode}var _escape={exports:{}},hasRequired_escape;function require_escape(){return hasRequired_escape||(hasRequired_escape=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hc;var bo=Ra(requireAssertString());function Ra(pc){return pc&&pc.__esModule?pc:{default:pc}}function hc(pc){return(0,bo.default)(pc),pc.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\//g,"/").replace(/\\/g,"\").replace(/`/g,"`")}vo.exports=Ai.default,vo.exports.default=Ai.default}(_escape,_escape.exports)),_escape.exports}var _unescape={exports:{}},hasRequired_unescape;function require_unescape(){return hasRequired_unescape||(hasRequired_unescape=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hc;var bo=Ra(requireAssertString());function Ra(pc){return pc&&pc.__esModule?pc:{default:pc}}function hc(pc){return(0,bo.default)(pc),pc.replace(/"/g,'"').replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(///g,"/").replace(/\/g,"\\").replace(/`/g,"`").replace(/&/g,"&")}vo.exports=Ai.default,vo.exports.default=Ai.default}(_unescape,_unescape.exports)),_unescape.exports}var stripLow={exports:{}},blacklist={exports:{}},hasRequiredBlacklist;function requireBlacklist(){return hasRequiredBlacklist||(hasRequiredBlacklist=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hc;var bo=Ra(requireAssertString());function Ra(pc){return pc&&pc.__esModule?pc:{default:pc}}function hc(pc,mc){return(0,bo.default)(pc),pc.replace(new RegExp("[".concat(mc,"]+"),"g"),"")}vo.exports=Ai.default,vo.exports.default=Ai.default}(blacklist,blacklist.exports)),blacklist.exports}var hasRequiredStripLow;function requireStripLow(){return hasRequiredStripLow||(hasRequiredStripLow=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=hc(requireAssertString()),Ra=hc(requireBlacklist());function hc(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc,uf){(0,bo.default)(mc);var df=uf?"\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F":"\\x00-\\x1F\\x7F";return(0,Ra.default)(mc,df)}vo.exports=Ai.default,vo.exports.default=Ai.default}(stripLow,stripLow.exports)),stripLow.exports}var whitelist={exports:{}},hasRequiredWhitelist;function requireWhitelist(){return hasRequiredWhitelist||(hasRequiredWhitelist=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hc;var bo=Ra(requireAssertString());function Ra(pc){return pc&&pc.__esModule?pc:{default:pc}}function hc(pc,mc){return(0,bo.default)(pc),pc.replace(new RegExp("[^".concat(mc,"]+"),"g"),"")}vo.exports=Ai.default,vo.exports.default=Ai.default}(whitelist,whitelist.exports)),whitelist.exports}var isWhitelisted={exports:{}},hasRequiredIsWhitelisted;function requireIsWhitelisted(){return hasRequiredIsWhitelisted||(hasRequiredIsWhitelisted=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hc;var bo=Ra(requireAssertString());function Ra(pc){return pc&&pc.__esModule?pc:{default:pc}}function hc(pc,mc){(0,bo.default)(pc);for(var uf=pc.length-1;uf>=0;uf--)if(mc.indexOf(pc[uf])===-1)return!1;return!0}vo.exports=Ai.default,vo.exports.default=Ai.default}(isWhitelisted,isWhitelisted.exports)),isWhitelisted.exports}var normalizeEmail={exports:{}},hasRequiredNormalizeEmail;function requireNormalizeEmail(){return hasRequiredNormalizeEmail||(hasRequiredNormalizeEmail=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hf;var bo=Ra(requireMerge());function Ra(pf){return pf&&pf.__esModule?pf:{default:pf}}var hc={all_lowercase:!0,gmail_lowercase:!0,gmail_remove_dots:!0,gmail_remove_subaddress:!0,gmail_convert_googlemaildotcom:!0,outlookdotcom_lowercase:!0,outlookdotcom_remove_subaddress:!0,yahoo_lowercase:!0,yahoo_remove_subaddress:!0,yandex_lowercase:!0,icloud_lowercase:!0,icloud_remove_subaddress:!0},pc=["icloud.com","me.com"],mc=["hotmail.at","hotmail.be","hotmail.ca","hotmail.cl","hotmail.co.il","hotmail.co.nz","hotmail.co.th","hotmail.co.uk","hotmail.com","hotmail.com.ar","hotmail.com.au","hotmail.com.br","hotmail.com.gr","hotmail.com.mx","hotmail.com.pe","hotmail.com.tr","hotmail.com.vn","hotmail.cz","hotmail.de","hotmail.dk","hotmail.es","hotmail.fr","hotmail.hu","hotmail.id","hotmail.ie","hotmail.in","hotmail.it","hotmail.jp","hotmail.kr","hotmail.lv","hotmail.my","hotmail.ph","hotmail.pt","hotmail.sa","hotmail.sg","hotmail.sk","live.be","live.co.uk","live.com","live.com.ar","live.com.mx","live.de","live.es","live.eu","live.fr","live.it","live.nl","msn.com","outlook.at","outlook.be","outlook.cl","outlook.co.il","outlook.co.nz","outlook.co.th","outlook.com","outlook.com.ar","outlook.com.au","outlook.com.br","outlook.com.gr","outlook.com.pe","outlook.com.tr","outlook.com.vn","outlook.cz","outlook.de","outlook.dk","outlook.es","outlook.fr","outlook.hu","outlook.id","outlook.ie","outlook.in","outlook.it","outlook.jp","outlook.kr","outlook.lv","outlook.my","outlook.ph","outlook.pt","outlook.sa","outlook.sg","outlook.sk","passport.com"],uf=["rocketmail.com","yahoo.ca","yahoo.co.uk","yahoo.com","yahoo.de","yahoo.fr","yahoo.in","yahoo.it","ymail.com"],df=["yandex.ru","yandex.ua","yandex.kz","yandex.com","yandex.by","ya.ru"];function ff(pf){return pf.length>1?pf:""}function hf(pf,mf){mf=(0,bo.default)(mf,hc);var gf=pf.split("@"),yf=gf.pop(),vf=gf.join("@"),bf=[vf,yf];if(bf[1]=bf[1].toLowerCase(),bf[1]==="gmail.com"||bf[1]==="googlemail.com"){if(mf.gmail_remove_subaddress&&(bf[0]=bf[0].split("+")[0]),mf.gmail_remove_dots&&(bf[0]=bf[0].replace(/\.+/g,ff)),!bf[0].length)return!1;(mf.all_lowercase||mf.gmail_lowercase)&&(bf[0]=bf[0].toLowerCase()),bf[1]=mf.gmail_convert_googlemaildotcom?"gmail.com":bf[1]}else if(pc.indexOf(bf[1])>=0){if(mf.icloud_remove_subaddress&&(bf[0]=bf[0].split("+")[0]),!bf[0].length)return!1;(mf.all_lowercase||mf.icloud_lowercase)&&(bf[0]=bf[0].toLowerCase())}else if(mc.indexOf(bf[1])>=0){if(mf.outlookdotcom_remove_subaddress&&(bf[0]=bf[0].split("+")[0]),!bf[0].length)return!1;(mf.all_lowercase||mf.outlookdotcom_lowercase)&&(bf[0]=bf[0].toLowerCase())}else if(uf.indexOf(bf[1])>=0){if(mf.yahoo_remove_subaddress){var Sf=bf[0].split("-");bf[0]=Sf.length>1?Sf.slice(0,-1).join("-"):Sf[0]}if(!bf[0].length)return!1;(mf.all_lowercase||mf.yahoo_lowercase)&&(bf[0]=bf[0].toLowerCase())}else df.indexOf(bf[1])>=0?((mf.all_lowercase||mf.yandex_lowercase)&&(bf[0]=bf[0].toLowerCase()),bf[1]="yandex.ru"):mf.all_lowercase&&(bf[0]=bf[0].toLowerCase());return bf.join("@")}vo.exports=Ai.default,vo.exports.default=Ai.default}(normalizeEmail,normalizeEmail.exports)),normalizeEmail.exports}var isSlug={exports:{}},hasRequiredIsSlug;function requireIsSlug(){return hasRequiredIsSlug||(hasRequiredIsSlug=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}var hc=/^[^\s-_](?!.*?[-_]{2,})[a-z0-9-\\][^\s]*[^-_\s]$/;function pc(mc){return(0,bo.default)(mc),hc.test(mc)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isSlug,isSlug.exports)),isSlug.exports}var isLicensePlate={exports:{}},hasRequiredIsLicensePlate;function requireIsLicensePlate(){return hasRequiredIsLicensePlate||(hasRequiredIsLicensePlate=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}var hc={"cs-CZ":function(mc){return/^(([ABCDEFHIJKLMNPRSTUVXYZ]|[0-9])-?){5,8}$/.test(mc)},"de-DE":function(mc){return/^((A|AA|AB|AC|AE|AH|AK|AM|AN|AÖ|AP|AS|AT|AU|AW|AZ|B|BA|BB|BC|BE|BF|BH|BI|BK|BL|BM|BN|BO|BÖ|BS|BT|BZ|C|CA|CB|CE|CO|CR|CW|D|DA|DD|DE|DH|DI|DL|DM|DN|DO|DU|DW|DZ|E|EA|EB|ED|EE|EF|EG|EH|EI|EL|EM|EN|ER|ES|EU|EW|F|FB|FD|FF|FG|FI|FL|FN|FO|FR|FS|FT|FÜ|FW|FZ|G|GA|GC|GD|GE|GF|GG|GI|GK|GL|GM|GN|GÖ|GP|GR|GS|GT|GÜ|GV|GW|GZ|H|HA|HB|HC|HD|HE|HF|HG|HH|HI|HK|HL|HM|HN|HO|HP|HR|HS|HU|HV|HX|HY|HZ|IK|IL|IN|IZ|J|JE|JL|K|KA|KB|KC|KE|KF|KG|KH|KI|KK|KL|KM|KN|KO|KR|KS|KT|KU|KW|KY|L|LA|LB|LC|LD|LF|LG|LH|LI|LL|LM|LN|LÖ|LP|LR|LU|M|MA|MB|MC|MD|ME|MG|MH|MI|MK|ML|MM|MN|MO|MQ|MR|MS|MÜ|MW|MY|MZ|N|NB|ND|NE|NF|NH|NI|NK|NM|NÖ|NP|NR|NT|NU|NW|NY|NZ|OA|OB|OC|OD|OE|OF|OG|OH|OK|OL|OP|OS|OZ|P|PA|PB|PE|PF|PI|PL|PM|PN|PR|PS|PW|PZ|R|RA|RC|RD|RE|RG|RH|RI|RL|RM|RN|RO|RP|RS|RT|RU|RV|RW|RZ|S|SB|SC|SE|SG|SI|SK|SL|SM|SN|SO|SP|SR|ST|SU|SW|SY|SZ|TE|TF|TG|TO|TP|TR|TS|TT|TÜ|ÜB|UE|UH|UL|UM|UN|V|VB|VG|VK|VR|VS|W|WA|WB|WE|WF|WI|WK|WL|WM|WN|WO|WR|WS|WT|WÜ|WW|WZ|Z|ZE|ZI|ZP|ZR|ZW|ZZ)[- ]?[A-Z]{1,2}[- ]?\d{1,4}|(ABG|ABI|AIB|AIC|ALF|ALZ|ANA|ANG|ANK|APD|ARN|ART|ASL|ASZ|AUR|AZE|BAD|BAR|BBG|BCH|BED|BER|BGD|BGL|BID|BIN|BIR|BIT|BIW|BKS|BLB|BLK|BNA|BOG|BOH|BOR|BOT|BRA|BRB|BRG|BRK|BRL|BRV|BSB|BSK|BTF|BÜD|BUL|BÜR|BÜS|BÜZ|CAS|CHA|CLP|CLZ|COC|COE|CUX|DAH|DAN|DAU|DBR|DEG|DEL|DGF|DIL|DIN|DIZ|DKB|DLG|DON|DUD|DÜW|EBE|EBN|EBS|ECK|EIC|EIL|EIN|EIS|EMD|EMS|ERB|ERH|ERK|ERZ|ESB|ESW|FDB|FDS|FEU|FFB|FKB|FLÖ|FOR|FRG|FRI|FRW|FTL|FÜS|GAN|GAP|GDB|GEL|GEO|GER|GHA|GHC|GLA|GMN|GNT|GOA|GOH|GRA|GRH|GRI|GRM|GRZ|GTH|GUB|GUN|GVM|HAB|HAL|HAM|HAS|HBN|HBS|HCH|HDH|HDL|HEB|HEF|HEI|HER|HET|HGN|HGW|HHM|HIG|HIP|HMÜ|HOG|HOH|HOL|HOM|HOR|HÖS|HOT|HRO|HSK|HST|HVL|HWI|IGB|ILL|JÜL|KEH|KEL|KEM|KIB|KLE|KLZ|KÖN|KÖT|KÖZ|KRU|KÜN|KUS|KYF|LAN|LAU|LBS|LBZ|LDK|LDS|LEO|LER|LEV|LIB|LIF|LIP|LÖB|LOS|LRO|LSZ|LÜN|LUP|LWL|MAB|MAI|MAK|MAL|MED|MEG|MEI|MEK|MEL|MER|MET|MGH|MGN|MHL|MIL|MKK|MOD|MOL|MON|MOS|MSE|MSH|MSP|MST|MTK|MTL|MÜB|MÜR|MYK|MZG|NAB|NAI|NAU|NDH|NEA|NEB|NEC|NEN|NES|NEW|NMB|NMS|NOH|NOL|NOM|NOR|NVP|NWM|OAL|OBB|OBG|OCH|OHA|ÖHR|OHV|OHZ|OPR|OSL|OVI|OVL|OVP|PAF|PAN|PAR|PCH|PEG|PIR|PLÖ|PRÜ|QFT|QLB|RDG|REG|REH|REI|RID|RIE|ROD|ROF|ROK|ROL|ROS|ROT|ROW|RSL|RÜD|RÜG|SAB|SAD|SAN|SAW|SBG|SBK|SCZ|SDH|SDL|SDT|SEB|SEE|SEF|SEL|SFB|SFT|SGH|SHA|SHG|SHK|SHL|SIG|SIM|SLE|SLF|SLK|SLN|SLS|SLÜ|SLZ|SMÜ|SOB|SOG|SOK|SÖM|SON|SPB|SPN|SRB|SRO|STA|STB|STD|STE|STL|SUL|SÜW|SWA|SZB|TBB|TDO|TET|TIR|TÖL|TUT|UEM|UER|UFF|USI|VAI|VEC|VER|VIB|VIE|VIT|VOH|WAF|WAK|WAN|WAR|WAT|WBS|WDA|WEL|WEN|WER|WES|WHV|WIL|WIS|WIT|WIZ|WLG|WMS|WND|WOB|WOH|WOL|WOR|WOS|WRN|WSF|WST|WSW|WTL|WTM|WUG|WÜM|WUN|WUR|WZL|ZEL|ZIG)[- ]?(([A-Z][- ]?\d{1,4})|([A-Z]{2}[- ]?\d{1,3})))[- ]?(E|H)?$/.test(mc)},"de-LI":function(mc){return/^FL[- ]?\d{1,5}[UZ]?$/.test(mc)},"en-IN":function(mc){return/^[A-Z]{2}[ -]?[0-9]{1,2}(?:[ -]?[A-Z])(?:[ -]?[A-Z]*)?[ -]?[0-9]{4}$/.test(mc)},"es-AR":function(mc){return/^(([A-Z]{2} ?[0-9]{3} ?[A-Z]{2})|([A-Z]{3} ?[0-9]{3}))$/.test(mc)},"fi-FI":function(mc){return/^(?=.{4,7})(([A-Z]{1,3}|[0-9]{1,3})[\s-]?([A-Z]{1,3}|[0-9]{1,5}))$/.test(mc)},"hu-HU":function(mc){return/^((((?!AAA)(([A-NPRSTVZWXY]{1})([A-PR-Z]{1})([A-HJ-NPR-Z]))|(A[ABC]I)|A[ABC]O|A[A-W]Q|BPI|BPO|UCO|UDO|XAO)-(?!000)\d{3})|(M\d{6})|((CK|DT|CD|HC|H[ABEFIKLMNPRSTVX]|MA|OT|R[A-Z]) \d{2}-\d{2})|(CD \d{3}-\d{3})|(C-(C|X) \d{4})|(X-(A|B|C) \d{4})|(([EPVZ]-\d{5}))|(S A[A-Z]{2} \d{2})|(SP \d{2}-\d{2}))$/.test(mc)},"pt-BR":function(mc){return/^[A-Z]{3}[ -]?[0-9][A-Z][0-9]{2}|[A-Z]{3}[ -]?[0-9]{4}$/.test(mc)},"pt-PT":function(mc){return/^([A-Z]{2}|[0-9]{2})[ -·]?([A-Z]{2}|[0-9]{2})[ -·]?([A-Z]{2}|[0-9]{2})$/.test(mc)},"sq-AL":function(mc){return/^[A-Z]{2}[- ]?((\d{3}[- ]?(([A-Z]{2})|T))|(R[- ]?\d{3}))$/.test(mc)},"sv-SE":function(mc){return/^[A-HJ-PR-UW-Z]{3} ?[\d]{2}[A-HJ-PR-UW-Z1-9]$|(^[A-ZÅÄÖ ]{2,7}$)/.test(mc.trim())},"en-PK":function(mc){return/(^[A-Z]{2}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]{3}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]{4}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]((\s|-){0,1})[0-9]{4}((\s|-)[0-9]{2}){0,1}$)/.test(mc.trim())}};function pc(mc,uf){if((0,bo.default)(mc),uf in hc)return hc[uf](mc);if(uf==="any"){for(var df in hc){var ff=hc[df];if(ff(mc))return!0}return!1}throw new Error("Invalid locale '".concat(uf,"'"))}vo.exports=Ai.default,vo.exports.default=Ai.default}(isLicensePlate,isLicensePlate.exports)),isLicensePlate.exports}var isStrongPassword={exports:{}},hasRequiredIsStrongPassword;function requireIsStrongPassword(){return hasRequiredIsStrongPassword||(hasRequiredIsStrongPassword=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=gf;var bo=hc(requireMerge()),Ra=hc(requireAssertString());function hc(yf){return yf&&yf.__esModule?yf:{default:yf}}var pc=/^[A-Z]$/,mc=/^[a-z]$/,uf=/^[0-9]$/,df=/^[-#!$@£%^&*()_+|~=`{}\[\]:";'<>?,.\/\\ ]$/,ff={minLength:8,minLowercase:1,minUppercase:1,minNumbers:1,minSymbols:1,returnScore:!1,pointsPerUnique:1,pointsPerRepeat:.5,pointsForContainingLower:10,pointsForContainingUpper:10,pointsForContainingNumber:10,pointsForContainingSymbol:10};function hf(yf){var vf={};return Array.from(yf).forEach(function(bf){var Sf=vf[bf];Sf?vf[bf]+=1:vf[bf]=1}),vf}function pf(yf){var vf=hf(yf),bf={length:yf.length,uniqueChars:Object.keys(vf).length,uppercaseCount:0,lowercaseCount:0,numberCount:0,symbolCount:0};return Object.keys(vf).forEach(function(Sf){pc.test(Sf)?bf.uppercaseCount+=vf[Sf]:mc.test(Sf)?bf.lowercaseCount+=vf[Sf]:uf.test(Sf)?bf.numberCount+=vf[Sf]:df.test(Sf)&&(bf.symbolCount+=vf[Sf])}),bf}function mf(yf,vf){var bf=0;return bf+=yf.uniqueChars*vf.pointsPerUnique,bf+=(yf.length-yf.uniqueChars)*vf.pointsPerRepeat,yf.lowercaseCount>0&&(bf+=vf.pointsForContainingLower),yf.uppercaseCount>0&&(bf+=vf.pointsForContainingUpper),yf.numberCount>0&&(bf+=vf.pointsForContainingNumber),yf.symbolCount>0&&(bf+=vf.pointsForContainingSymbol),bf}function gf(yf){var vf=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;(0,Ra.default)(yf);var bf=pf(yf);return vf=(0,bo.default)(vf||{},ff),vf.returnScore?mf(bf,vf):bf.length>=vf.minLength&&bf.lowercaseCount>=vf.minLowercase&&bf.uppercaseCount>=vf.minUppercase&&bf.numberCount>=vf.minNumbers&&bf.symbolCount>=vf.minSymbols}vo.exports=Ai.default,vo.exports.default=Ai.default}(isStrongPassword,isStrongPassword.exports)),isStrongPassword.exports}var isVAT={},hasRequiredIsVAT;function requireIsVAT(){if(hasRequiredIsVAT)return isVAT;hasRequiredIsVAT=1;function vo(pf){"@babel/helpers - typeof";return vo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(mf){return typeof mf}:function(mf){return mf&&typeof Symbol=="function"&&mf.constructor===Symbol&&mf!==Symbol.prototype?"symbol":typeof mf},vo(pf)}Object.defineProperty(isVAT,"__esModule",{value:!0}),isVAT.default=hf,isVAT.vatMatchers=void 0;var Ai=pc(requireAssertString()),bo=hc(requireAlgorithms());function Ra(pf){if(typeof WeakMap!="function")return null;var mf=new WeakMap,gf=new WeakMap;return(Ra=function(yf){return yf?gf:mf})(pf)}function hc(pf,mf){if(pf&&pf.__esModule)return pf;if(pf===null||vo(pf)!="object"&&typeof pf!="function")return{default:pf};var gf=Ra(mf);if(gf&&gf.has(pf))return gf.get(pf);var yf={__proto__:null},vf=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var bf in pf)if(bf!=="default"&&{}.hasOwnProperty.call(pf,bf)){var Sf=vf?Object.getOwnPropertyDescriptor(pf,bf):null;Sf&&(Sf.get||Sf.set)?Object.defineProperty(yf,bf,Sf):yf[bf]=pf[bf]}return yf.default=pf,gf&&gf.set(pf,yf),yf}function pc(pf){return pf&&pf.__esModule?pf:{default:pf}}var mc=function(pf){var mf=pf.match(/^(AU)?(\d{11})$/);if(!mf)return!1;var gf=[10,1,3,5,7,9,11,13,15,17,19];pf=pf.replace(/^AU/,"");for(var yf=(parseInt(pf.slice(0,1),10)-1).toString()+pf.slice(1),vf=0,bf=0;bf<11;bf++)vf+=gf[bf]*yf.charAt(bf);return vf!==0&&vf%89===0},uf=function(pf){var mf=function(gf){var yf=gf.pop(),vf=[5,4,3,2,7,6,5,4],bf=(11-gf.reduce(function(Sf,xf,wf){return Sf+xf*vf[wf]},0)%11)%11;return yf===bf};return/^(CHE[- ]?)?(\d{9}|(\d{3}\.\d{3}\.\d{3})|(\d{3} \d{3} \d{3})) ?(TVA|MWST|IVA)?$/.test(pf)&&mf(pf.match(/\d/g).map(function(gf){return+gf}))},df=function(pf){var mf=pf.match(/^(PT)?(\d{9})$/);if(!mf)return!1;var gf=mf[2],yf=11-bo.reverseMultiplyAndSum(gf.split("").slice(0,8).map(function(vf){return parseInt(vf,10)}),9)%11;return yf>9?parseInt(gf[8],10)===0:yf===parseInt(gf[8],10)},ff=isVAT.vatMatchers={AT:function(pf){return/^(AT)?U\d{8}$/.test(pf)},BE:function(pf){return/^(BE)?\d{10}$/.test(pf)},BG:function(pf){return/^(BG)?\d{9,10}$/.test(pf)},HR:function(pf){return/^(HR)?\d{11}$/.test(pf)},CY:function(pf){return/^(CY)?\w{9}$/.test(pf)},CZ:function(pf){return/^(CZ)?\d{8,10}$/.test(pf)},DK:function(pf){return/^(DK)?\d{8}$/.test(pf)},EE:function(pf){return/^(EE)?\d{9}$/.test(pf)},FI:function(pf){return/^(FI)?\d{8}$/.test(pf)},FR:function(pf){return/^(FR)?\w{2}\d{9}$/.test(pf)},DE:function(pf){return/^(DE)?\d{9}$/.test(pf)},EL:function(pf){return/^(EL)?\d{9}$/.test(pf)},HU:function(pf){return/^(HU)?\d{8}$/.test(pf)},IE:function(pf){return/^(IE)?\d{7}\w{1}(W)?$/.test(pf)},IT:function(pf){return/^(IT)?\d{11}$/.test(pf)},LV:function(pf){return/^(LV)?\d{11}$/.test(pf)},LT:function(pf){return/^(LT)?\d{9,12}$/.test(pf)},LU:function(pf){return/^(LU)?\d{8}$/.test(pf)},MT:function(pf){return/^(MT)?\d{8}$/.test(pf)},NL:function(pf){return/^(NL)?\d{9}B\d{2}$/.test(pf)},PL:function(pf){return/^(PL)?(\d{10}|(\d{3}-\d{3}-\d{2}-\d{2})|(\d{3}-\d{2}-\d{2}-\d{3}))$/.test(pf)},PT:df,RO:function(pf){return/^(RO)?\d{2,10}$/.test(pf)},SK:function(pf){return/^(SK)?\d{10}$/.test(pf)},SI:function(pf){return/^(SI)?\d{8}$/.test(pf)},ES:function(pf){return/^(ES)?\w\d{7}[A-Z]$/.test(pf)},SE:function(pf){return/^(SE)?\d{12}$/.test(pf)},AL:function(pf){return/^(AL)?\w{9}[A-Z]$/.test(pf)},MK:function(pf){return/^(MK)?\d{13}$/.test(pf)},AU:mc,BY:function(pf){return/^(УНП )?\d{9}$/.test(pf)},CA:function(pf){return/^(CA)?\d{9}$/.test(pf)},IS:function(pf){return/^(IS)?\d{5,6}$/.test(pf)},IN:function(pf){return/^(IN)?\d{15}$/.test(pf)},ID:function(pf){return/^(ID)?(\d{15}|(\d{2}.\d{3}.\d{3}.\d{1}-\d{3}.\d{3}))$/.test(pf)},IL:function(pf){return/^(IL)?\d{9}$/.test(pf)},KZ:function(pf){return/^(KZ)?\d{12}$/.test(pf)},NZ:function(pf){return/^(NZ)?\d{9}$/.test(pf)},NG:function(pf){return/^(NG)?(\d{12}|(\d{8}-\d{4}))$/.test(pf)},NO:function(pf){return/^(NO)?\d{9}MVA$/.test(pf)},PH:function(pf){return/^(PH)?(\d{12}|\d{3} \d{3} \d{3} \d{3})$/.test(pf)},RU:function(pf){return/^(RU)?(\d{10}|\d{12})$/.test(pf)},SM:function(pf){return/^(SM)?\d{5}$/.test(pf)},SA:function(pf){return/^(SA)?\d{15}$/.test(pf)},RS:function(pf){return/^(RS)?\d{9}$/.test(pf)},CH:uf,TR:function(pf){return/^(TR)?\d{10}$/.test(pf)},UA:function(pf){return/^(UA)?\d{12}$/.test(pf)},GB:function(pf){return/^GB((\d{3} \d{4} ([0-8][0-9]|9[0-6]))|(\d{9} \d{3})|(((GD[0-4])|(HA[5-9]))[0-9]{2}))$/.test(pf)},UZ:function(pf){return/^(UZ)?\d{9}$/.test(pf)},AR:function(pf){return/^(AR)?\d{11}$/.test(pf)},BO:function(pf){return/^(BO)?\d{7}$/.test(pf)},BR:function(pf){return/^(BR)?((\d{2}.\d{3}.\d{3}\/\d{4}-\d{2})|(\d{3}.\d{3}.\d{3}-\d{2}))$/.test(pf)},CL:function(pf){return/^(CL)?\d{8}-\d{1}$/.test(pf)},CO:function(pf){return/^(CO)?\d{10}$/.test(pf)},CR:function(pf){return/^(CR)?\d{9,12}$/.test(pf)},EC:function(pf){return/^(EC)?\d{13}$/.test(pf)},SV:function(pf){return/^(SV)?\d{4}-\d{6}-\d{3}-\d{1}$/.test(pf)},GT:function(pf){return/^(GT)?\d{7}-\d{1}$/.test(pf)},HN:function(pf){return/^(HN)?$/.test(pf)},MX:function(pf){return/^(MX)?\w{3,4}\d{6}\w{3}$/.test(pf)},NI:function(pf){return/^(NI)?\d{3}-\d{6}-\d{4}\w{1}$/.test(pf)},PA:function(pf){return/^(PA)?$/.test(pf)},PY:function(pf){return/^(PY)?\d{6,8}-\d{1}$/.test(pf)},PE:function(pf){return/^(PE)?\d{11}$/.test(pf)},DO:function(pf){return/^(DO)?(\d{11}|(\d{3}-\d{7}-\d{1})|[1,4,5]{1}\d{8}|([1,4,5]{1})-\d{2}-\d{5}-\d{1})$/.test(pf)},UY:function(pf){return/^(UY)?\d{12}$/.test(pf)},VE:function(pf){return/^(VE)?[J,G,V,E]{1}-(\d{9}|(\d{8}-\d{1}))$/.test(pf)}};function hf(pf,mf){if((0,Ai.default)(pf),(0,Ai.default)(mf),mf in ff)return ff[mf](pf);throw new Error("Invalid country code: '".concat(mf,"'"))}return isVAT}var hasRequiredValidator;function requireValidator(){return hasRequiredValidator||(hasRequiredValidator=1,function(vo,Ai){function bo(aT){"@babel/helpers - typeof";return bo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(fT){return typeof fT}:function(fT){return fT&&typeof Symbol=="function"&&fT.constructor===Symbol&&fT!==Symbol.prototype?"symbol":typeof fT},bo(aT)}Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=void 0;var Ra=Y1(requireToDate()),hc=Y1(requireToFloat()),pc=Y1(requireToInt()),mc=Y1(requireToBoolean()),uf=Y1(requireEquals()),df=Y1(requireContains()),ff=Y1(requireMatches()),hf=Y1(requireIsEmail()),pf=Y1(requireIsURL()),mf=Y1(requireIsMACAddress()),gf=Y1(requireIsIP()),yf=Y1(requireIsIPRange()),vf=Y1(requireIsFQDN()),bf=Y1(requireIsDate()),Sf=Y1(requireIsTime()),xf=Y1(requireIsBoolean()),wf=Y1(requireIsLocale()),s1=Y1(requireIsAbaRouting()),If=bT(requireIsAlpha()),l1=bT(requireIsAlphanumeric()),c1=Y1(requireIsNumeric()),m1=Y1(requireIsPassportNumber()),k1=Y1(requireIsPort()),N1=Y1(requireIsLowercase()),R1=Y1(requireIsUppercase()),$1=Y1(requireIsIMEI()),D1=Y1(requireIsAscii()),f1=Y1(requireIsFullWidth()),T1=Y1(requireIsHalfWidth()),A1=Y1(requireIsVariableWidth()),L1=Y1(requireIsMultibyte()),B1=Y1(requireIsSemVer()),V1=Y1(requireIsSurrogatePair()),Z1=Y1(requireIsInt()),H1=bT(requireIsFloat()),E1=Y1(requireIsDecimal()),F1=Y1(requireIsHexadecimal()),M1=Y1(requireIsOctal()),q1=Y1(requireIsDivisibleBy()),z1=Y1(requireIsHexColor()),W1=Y1(requireIsRgbColor()),J1=Y1(requireIsHSL()),eT=Y1(requireIsISRC()),nT=bT(requireIsIBAN()),sT=Y1(requireIsBIC()),iT=Y1(requireIsMD5()),rT=Y1(requireIsHash()),lT=Y1(requireIsJWT()),_1=Y1(requireIsJSON()),j1=Y1(requireIsEmpty()),P1=Y1(requireIsLength()),u1=Y1(requireIsByteLength()),d1=Y1(requireIsUUID()),O1=Y1(requireIsMongoId()),U1=Y1(requireIsAfter()),Q1=Y1(requireIsBefore()),G1=Y1(requireIsIn()),X1=Y1(requireIsLuhnNumber()),K1=Y1(requireIsCreditCard()),tT=Y1(requireIsIdentityCard()),oT=Y1(requireIsEAN()),uT=Y1(requireIsISIN()),dT=Y1(requireIsISBN()),cT=Y1(requireIsISSN()),pT=Y1(requireIsTaxID()),hT=bT(requireIsMobilePhone()),mT=Y1(requireIsEthereumAddress()),vT=Y1(requireIsCurrency()),TT=Y1(requireIsBtcAddress()),$T=requireIsISO6346(),kT=Y1(requireIsISO6391()),_T=Y1(requireIsISO8601()),NT=Y1(requireIsRFC3339()),RT=Y1(requireIsISO31661Alpha2()),PT=Y1(requireIsISO31661Alpha3()),DT=Y1(requireIsISO4217()),MT=Y1(requireIsBase32()),LT=Y1(requireIsBase58()),FT=Y1(requireIsBase64()),jT=Y1(requireIsDataURI()),VT=Y1(requireIsMagnetURI()),BT=Y1(requireIsMailtoURI()),UT=Y1(requireIsMimeType()),QT=Y1(requireIsLatLong()),ET=bT(requireIsPostalCode()),qT=Y1(requireLtrim()),GT=Y1(requireRtrim()),HT=Y1(requireTrim()),ZT=Y1(require_escape()),WT=Y1(require_unescape()),zT=Y1(requireStripLow()),YT=Y1(requireWhitelist()),XT=Y1(requireBlacklist()),JT=Y1(requireIsWhitelisted()),KT=Y1(requireNormalizeEmail()),e$=Y1(requireIsSlug()),t$=Y1(requireIsLicensePlate()),r$=Y1(requireIsStrongPassword()),n$=Y1(requireIsVAT());function OT(aT){if(typeof WeakMap!="function")return null;var fT=new WeakMap,gT=new WeakMap;return(OT=function(yT){return yT?gT:fT})(aT)}function bT(aT,fT){if(aT&&aT.__esModule)return aT;if(aT===null||bo(aT)!="object"&&typeof aT!="function")return{default:aT};var gT=OT(fT);if(gT&&gT.has(aT))return gT.get(aT);var yT={__proto__:null},s$=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var ST in aT)if(ST!=="default"&&{}.hasOwnProperty.call(aT,ST)){var xT=s$?Object.getOwnPropertyDescriptor(aT,ST):null;xT&&(xT.get||xT.set)?Object.defineProperty(yT,ST,xT):yT[ST]=aT[ST]}return yT.default=aT,gT&&gT.set(aT,yT),yT}function Y1(aT){return aT&&aT.__esModule?aT:{default:aT}}var i$="13.12.0",o$={version:i$,toDate:Ra.default,toFloat:hc.default,toInt:pc.default,toBoolean:mc.default,equals:uf.default,contains:df.default,matches:ff.default,isEmail:hf.default,isURL:pf.default,isMACAddress:mf.default,isIP:gf.default,isIPRange:yf.default,isFQDN:vf.default,isBoolean:xf.default,isIBAN:nT.default,isBIC:sT.default,isAbaRouting:s1.default,isAlpha:If.default,isAlphaLocales:If.locales,isAlphanumeric:l1.default,isAlphanumericLocales:l1.locales,isNumeric:c1.default,isPassportNumber:m1.default,isPort:k1.default,isLowercase:N1.default,isUppercase:R1.default,isAscii:D1.default,isFullWidth:f1.default,isHalfWidth:T1.default,isVariableWidth:A1.default,isMultibyte:L1.default,isSemVer:B1.default,isSurrogatePair:V1.default,isInt:Z1.default,isIMEI:$1.default,isFloat:H1.default,isFloatLocales:H1.locales,isDecimal:E1.default,isHexadecimal:F1.default,isOctal:M1.default,isDivisibleBy:q1.default,isHexColor:z1.default,isRgbColor:W1.default,isHSL:J1.default,isISRC:eT.default,isMD5:iT.default,isHash:rT.default,isJWT:lT.default,isJSON:_1.default,isEmpty:j1.default,isLength:P1.default,isLocale:wf.default,isByteLength:u1.default,isUUID:d1.default,isMongoId:O1.default,isAfter:U1.default,isBefore:Q1.default,isIn:G1.default,isLuhnNumber:X1.default,isCreditCard:K1.default,isIdentityCard:tT.default,isEAN:oT.default,isISIN:uT.default,isISBN:dT.default,isISSN:cT.default,isMobilePhone:hT.default,isMobilePhoneLocales:hT.locales,isPostalCode:ET.default,isPostalCodeLocales:ET.locales,isEthereumAddress:mT.default,isCurrency:vT.default,isBtcAddress:TT.default,isISO6346:$T.isISO6346,isFreightContainerID:$T.isFreightContainerID,isISO6391:kT.default,isISO8601:_T.default,isRFC3339:NT.default,isISO31661Alpha2:RT.default,isISO31661Alpha3:PT.default,isISO4217:DT.default,isBase32:MT.default,isBase58:LT.default,isBase64:FT.default,isDataURI:jT.default,isMagnetURI:VT.default,isMailtoURI:BT.default,isMimeType:UT.default,isLatLong:QT.default,ltrim:qT.default,rtrim:GT.default,trim:HT.default,escape:ZT.default,unescape:WT.default,stripLow:zT.default,whitelist:YT.default,blacklist:XT.default,isWhitelisted:JT.default,normalizeEmail:KT.default,toString,isSlug:e$.default,isStrongPassword:r$.default,isTaxID:pT.default,isDate:bf.default,isTime:Sf.default,isLicensePlate:t$.default,isVAT:n$.default,ibanLocales:nT.locales};Ai.default=o$,vo.exports=Ai.default,vo.exports.default=Ai.default}(validator$1,validator$1.exports)),validator$1.exports}var validatorExports=requireValidator();const validator=xo$2(validatorExports);function createNameSchema(vo={}){const{required:Ai=!1,allowEmpty:bo=!1,unique:Ra=[]}=vo,hc=bo?h$2.string():h$2.string().min(1),pc=hc.refine(mc=>!mc&&bo?!0:!Ra.map(uf=>uf.toLowerCase()).includes(mc.replace(/^\s+|\s+$/g,"_").toLowerCase()),{message:"Item with this name already exists"});return Ai?Ra.length>0?pc:hc:Ra.length>0?h$2.string().optional().refine(mc=>mc===void 0||!mc&&bo?!0:!Ra.map(uf=>uf.toLowerCase()).includes(mc.replace(/^\s+|\s+$/g,"_").toLowerCase()),{message:"Item with this name already exists"}):h$2.string().optional()}function createConstantCaseSchema(vo={}){return createNameSchema(vo).transform(Ai=>Ai&&Ai.toUpperCase()).refine(Ai=>!Ai||validator.isUppercase(Ai),{message:"Must be uppercase"})}function createLowercaseSnakeCaseSchema(vo={}){return createNameSchema(vo).transform(Ai=>Ai&&Ai.toLowerCase()).refine(Ai=>!Ai||validator.isLowercase(Ai),{message:"Must be lowercase"})}function toLowercaseSnakeCase(vo,Ai={}){return createLowercaseSnakeCaseSchema(Ai).parse(snakeCase(vo))}function toConstantCase(vo,Ai={}){return createConstantCaseSchema(Ai).parse(constantCase(vo))}h$2.object({name:createNameSchema({allowEmpty:!0}),website:h$2.union([h$2.string().url(),h$2.literal("")]).optional().default("")}).default({name:"",website:""});h$2.string().default("");const s=(vo,Ai,bo)=>{if(vo&&"reportValidity"in vo){const Ra=B$3(bo,Ai);vo.setCustomValidity(Ra&&Ra.message||""),vo.reportValidity()}},o=(vo,Ai)=>{for(const bo in Ai.fields){const Ra=Ai.fields[bo];Ra&&Ra.ref&&"reportValidity"in Ra.ref?s(Ra.ref,bo,vo):Ra.refs&&Ra.refs.forEach(hc=>s(hc,bo,vo))}},r=(vo,Ai)=>{Ai.shouldUseNativeValidation&&o(vo,Ai);const bo={};for(const Ra in vo){const hc=B$3(Ai.fields,Ra),pc=Object.assign(vo[Ra]||{},{ref:hc&&hc.ref});if(i$1(Ai.names||Object.keys(vo),Ra)){const mc=Object.assign({},B$3(bo,Ra));ge$2(mc,"root",pc),ge$2(bo,Ra,mc)}else ge$2(bo,Ra,pc)}return bo},i$1=(vo,Ai)=>vo.some(bo=>bo.startsWith(Ai+"."));var n=function(vo,Ai){for(var bo={};vo.length;){var Ra=vo[0],hc=Ra.code,pc=Ra.message,mc=Ra.path.join(".");if(!bo[mc])if("unionErrors"in Ra){var uf=Ra.unionErrors[0].errors[0];bo[mc]={message:uf.message,type:uf.code}}else bo[mc]={message:pc,type:hc};if("unionErrors"in Ra&&Ra.unionErrors.forEach(function(hf){return hf.errors.forEach(function(pf){return vo.push(pf)})}),Ai){var df=bo[mc].types,ff=df&&df[Ra.code];bo[mc]=Mf(mc,Ai,bo,hc,ff?[].concat(ff,Ra.message):Ra.message)}vo.shift()}return bo},t$2=function(vo,Ai,bo){return bo===void 0&&(bo={}),function(Ra,hc,pc){try{return Promise.resolve(function(mc,uf){try{var df=Promise.resolve(vo[bo.mode==="sync"?"parse":"parseAsync"](Ra,Ai)).then(function(ff){return pc.shouldUseNativeValidation&&o({},pc),{errors:{},values:bo.raw?Ra:ff}})}catch(ff){return uf(ff)}return df&&df.then?df.then(void 0,uf):df}(0,function(mc){if(function(uf){return Array.isArray(uf==null?void 0:uf.errors)}(mc))return{values:{},errors:r(n(mc.errors,!pc.shouldUseNativeValidation&&pc.criteriaMode==="all"),pc)};throw mc}))}catch(mc){return Promise.reject(mc)}}};const Textarea=forwardRef(({className:vo,...Ai},bo)=>{const Ra=useRef(null),hc=useCallback(mc=>{mc.style.height="auto";const uf=Math.max(mc.scrollHeight,mc.offsetHeight);mc.style.height=`${uf}px`},[]),pc=useCallback(mc=>{hc(mc.currentTarget)},[hc]);return y$2.useEffect(()=>{Ra.current&&hc(Ra.current)},[hc]),useImperativeHandle(bo,()=>({focus:()=>{var mc;return(mc=Ra.current)==null?void 0:mc.focus()},element:Ra.current})),jsx("textarea",{...Ai,className:cn("min-h-10 w-full resize-none rounded-md border border-gray-200 bg-gray-50 px-3 py-2 text-sm text-gray-800 placeholder:text-gray-600 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",vo),ref:Ra,onInput:pc})});Textarea.displayName="Textarea";const TextField=forwardRef(({name:vo,value:Ai,onSubmit:bo,label:Ra,placeholder:hc,unique:pc,className:mc="",rows:uf=1,focusOnMount:df=!1,required:ff=!1,allowEmpty:hf=!1,shouldReset:pf=!1,onChange:mf},gf)=>{const yf=useRef(null);useEffect(()=>{df&&yf.current&&yf.current.focus()},[df]);const vf=h$2.object({[vo]:createNameSchema({required:ff,allowEmpty:hf,unique:pc})}),bf=Wf({resolver:t$2(vf),defaultValues:{[vo]:Ai??""}}),Sf=useCallback(If=>{const l1=If[vo];l1===void 0||Ai===l1||(bo(l1),pf&&bf.reset({[vo]:""}))},[vo,Ai,bo,bf,pf]),xf=useCallback(async()=>{const If=bf.getValues()[vo]??"";if(!(Ai==null&&(!If||If.trim()===""))&&!compareStringsWithoutWhitespace(If,Ai??""))try{await bf.trigger(),bf.formState.isValid&&await bf.handleSubmit(Sf)()}catch{}},[bf,Sf,vo,Ai]),wf=useCallback(If=>{If.key==="Enter"&&(If.preventDefault(),If.target.blur())},[]),s1=useCallback(If=>{const l1=If.target.value;mf==null||mf(l1)},[mf]);return useImperativeHandle(gf,()=>({focus:()=>{var If;return(If=yf.current)==null?void 0:If.focus()}})),useEffect(()=>{bf.reset({[vo]:Ai??""})},[bf,vo,Ai]),jsx(Form,{...bf,children:jsx(FormField,{control:bf.control,name:vo,render:({field:If})=>jsxs(FormItem,{className:"grid h-full grid-rows-[auto,1fr] gap-2 overflow-visible",children:[!!Ra&&jsx(FormLabel,{htmlFor:vo,className:"text-sm font-medium text-gray-700",children:Ra}),jsx(FormControl,{children:jsx(Textarea,{...If,id:vo,ref:l1=>{l1&&(If.ref(l1.element),yf.current=l1)},placeholder:hc,onBlur:xf,onChange:l1=>{If.onChange(l1),s1(l1)},onKeyDown:wf,rows:uf,className:mc})}),jsx(FormMessage,{})]})})})});TextField.displayName="TextField";function ModuleForm({module:vo,onAddModule:Ai,updateModuleName:bo,modules:Ra=[]}){const hc=!!vo,pc=Ra.map(uf=>uf.name),mc=async uf=>{const df=toLowercaseSnakeCase(uf);df.length&&(hc?df!==vo.name&&bo(vo.id,df):await Ai(df))};return jsx(TextField,{name:"name",label:hc?"Module name":"Add module",value:vo==null?void 0:vo.name,onSubmit:mc,placeholder:"Add module",unique:pc,shouldReset:!hc,required:!0},(vo==null?void 0:vo.id)??"new")}const Input=y$2.forwardRef(({className:vo,type:Ai,...bo},Ra)=>jsx("input",{type:Ai,className:cn("flex h-9 w-full rounded-md border border-gray-400 bg-transparent px-3 py-1 text-sm transition-colors hover:bg-gray-100 focus-visible:bg-gray-200 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",vo),ref:Ra,...bo}));Input.displayName="Input";let rangeFrom=[],rangeTo=[];(()=>{let vo="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(Ai=>Ai?parseInt(Ai,36):1);for(let Ai=0,bo=0;Ai<vo.length;Ai++)(Ai%2?rangeTo:rangeFrom).push(bo=bo+vo[Ai])})();function isExtendingChar(vo){if(vo<768)return!1;for(let Ai=0,bo=rangeFrom.length;;){let Ra=Ai+bo>>1;if(vo<rangeFrom[Ra])bo=Ra;else if(vo>=rangeTo[Ra])Ai=Ra+1;else return!0;if(Ai==bo)return!1}}function isRegionalIndicator(vo){return vo>=127462&&vo<=127487}const ZWJ=8205;function findClusterBreak$1(vo,Ai,bo=!0,Ra=!0){return(bo?nextClusterBreak:prevClusterBreak)(vo,Ai,Ra)}function nextClusterBreak(vo,Ai,bo){if(Ai==vo.length)return Ai;Ai&&surrogateLow$1(vo.charCodeAt(Ai))&&surrogateHigh$1(vo.charCodeAt(Ai-1))&&Ai--;let Ra=codePointAt$1(vo,Ai);for(Ai+=codePointSize$1(Ra);Ai<vo.length;){let hc=codePointAt$1(vo,Ai);if(Ra==ZWJ||hc==ZWJ||bo&&isExtendingChar(hc))Ai+=codePointSize$1(hc),Ra=hc;else if(isRegionalIndicator(hc)){let pc=0,mc=Ai-2;for(;mc>=0&&isRegionalIndicator(codePointAt$1(vo,mc));)pc++,mc-=2;if(pc%2==0)break;Ai+=2}else break}return Ai}function prevClusterBreak(vo,Ai,bo){for(;Ai>0;){let Ra=nextClusterBreak(vo,Ai-2,bo);if(Ra<Ai)return Ra;Ai--}return 0}function codePointAt$1(vo,Ai){let bo=vo.charCodeAt(Ai);if(!surrogateHigh$1(bo)||Ai+1==vo.length)return bo;let Ra=vo.charCodeAt(Ai+1);return surrogateLow$1(Ra)?(bo-55296<<10)+(Ra-56320)+65536:bo}function surrogateLow$1(vo){return vo>=56320&&vo<57344}function surrogateHigh$1(vo){return vo>=55296&&vo<56320}function codePointSize$1(vo){return vo<65536?1:2}class Text{lineAt(Ai){if(Ai<0||Ai>this.length)throw new RangeError(`Invalid position ${Ai} in document of length ${this.length}`);return this.lineInner(Ai,!1,1,0)}line(Ai){if(Ai<1||Ai>this.lines)throw new RangeError(`Invalid line number ${Ai} in ${this.lines}-line document`);return this.lineInner(Ai,!0,1,0)}replace(Ai,bo,Ra){[Ai,bo]=clip(this,Ai,bo);let hc=[];return this.decompose(0,Ai,hc,2),Ra.length&&Ra.decompose(0,Ra.length,hc,3),this.decompose(bo,this.length,hc,1),TextNode.from(hc,this.length-(bo-Ai)+Ra.length)}append(Ai){return this.replace(this.length,this.length,Ai)}slice(Ai,bo=this.length){[Ai,bo]=clip(this,Ai,bo);let Ra=[];return this.decompose(Ai,bo,Ra,0),TextNode.from(Ra,bo-Ai)}eq(Ai){if(Ai==this)return!0;if(Ai.length!=this.length||Ai.lines!=this.lines)return!1;let bo=this.scanIdentical(Ai,1),Ra=this.length-this.scanIdentical(Ai,-1),hc=new RawTextCursor(this),pc=new RawTextCursor(Ai);for(let mc=bo,uf=bo;;){if(hc.next(mc),pc.next(mc),mc=0,hc.lineBreak!=pc.lineBreak||hc.done!=pc.done||hc.value!=pc.value)return!1;if(uf+=hc.value.length,hc.done||uf>=Ra)return!0}}iter(Ai=1){return new RawTextCursor(this,Ai)}iterRange(Ai,bo=this.length){return new PartialTextCursor(this,Ai,bo)}iterLines(Ai,bo){let Ra;if(Ai==null)Ra=this.iter();else{bo==null&&(bo=this.lines+1);let hc=this.line(Ai).from;Ra=this.iterRange(hc,Math.max(hc,bo==this.lines+1?this.length:bo<=1?0:this.line(bo-1).to))}return new LineCursor(Ra)}toString(){return this.sliceString(0)}toJSON(){let Ai=[];return this.flatten(Ai),Ai}constructor(){}static of(Ai){if(Ai.length==0)throw new RangeError("A document must have at least one line");return Ai.length==1&&!Ai[0]?Text.empty:Ai.length<=32?new TextLeaf(Ai):TextNode.from(TextLeaf.split(Ai,[]))}}class TextLeaf extends Text{constructor(Ai,bo=textLength(Ai)){super(),this.text=Ai,this.length=bo}get lines(){return this.text.length}get children(){return null}lineInner(Ai,bo,Ra,hc){for(let pc=0;;pc++){let mc=this.text[pc],uf=hc+mc.length;if((bo?Ra:uf)>=Ai)return new Line(hc,uf,Ra,mc);hc=uf+1,Ra++}}decompose(Ai,bo,Ra,hc){let pc=Ai<=0&&bo>=this.length?this:new TextLeaf(sliceText(this.text,Ai,bo),Math.min(bo,this.length)-Math.max(0,Ai));if(hc&1){let mc=Ra.pop(),uf=appendText(pc.text,mc.text.slice(),0,pc.length);if(uf.length<=32)Ra.push(new TextLeaf(uf,mc.length+pc.length));else{let df=uf.length>>1;Ra.push(new TextLeaf(uf.slice(0,df)),new TextLeaf(uf.slice(df)))}}else Ra.push(pc)}replace(Ai,bo,Ra){if(!(Ra instanceof TextLeaf))return super.replace(Ai,bo,Ra);[Ai,bo]=clip(this,Ai,bo);let hc=appendText(this.text,appendText(Ra.text,sliceText(this.text,0,Ai)),bo),pc=this.length+Ra.length-(bo-Ai);return hc.length<=32?new TextLeaf(hc,pc):TextNode.from(TextLeaf.split(hc,[]),pc)}sliceString(Ai,bo=this.length,Ra=`
|
|
347
|
-
`){[Ai,bo]=clip(this,Ai,bo);let hc="";for(let pc=0,mc=0;pc<=bo&&mc<this.text.length;mc++){let uf=this.text[mc],df=pc+uf.length;pc>Ai&&mc&&(hc+=Ra),Ai<df&&bo>pc&&(hc+=uf.slice(Math.max(0,Ai-pc),bo-pc)),pc=df+1}return hc}flatten(Ai){for(let bo of this.text)Ai.push(bo)}scanIdentical(){return 0}static split(Ai,bo){let Ra=[],hc=-1;for(let pc of Ai)Ra.push(pc),hc+=pc.length+1,Ra.length==32&&(bo.push(new TextLeaf(Ra,hc)),Ra=[],hc=-1);return hc>-1&&bo.push(new TextLeaf(Ra,hc)),bo}}class TextNode extends Text{constructor(Ai,bo){super(),this.children=Ai,this.length=bo,this.lines=0;for(let Ra of Ai)this.lines+=Ra.lines}lineInner(Ai,bo,Ra,hc){for(let pc=0;;pc++){let mc=this.children[pc],uf=hc+mc.length,df=Ra+mc.lines-1;if((bo?df:uf)>=Ai)return mc.lineInner(Ai,bo,Ra,hc);hc=uf+1,Ra=df+1}}decompose(Ai,bo,Ra,hc){for(let pc=0,mc=0;mc<=bo&&pc<this.children.length;pc++){let uf=this.children[pc],df=mc+uf.length;if(Ai<=df&&bo>=mc){let ff=hc&((mc<=Ai?1:0)|(df>=bo?2:0));mc>=Ai&&df<=bo&&!ff?Ra.push(uf):uf.decompose(Ai-mc,bo-mc,Ra,ff)}mc=df+1}}replace(Ai,bo,Ra){if([Ai,bo]=clip(this,Ai,bo),Ra.lines<this.lines)for(let hc=0,pc=0;hc<this.children.length;hc++){let mc=this.children[hc],uf=pc+mc.length;if(Ai>=pc&&bo<=uf){let df=mc.replace(Ai-pc,bo-pc,Ra),ff=this.lines-mc.lines+df.lines;if(df.lines<ff>>4&&df.lines>ff>>6){let hf=this.children.slice();return hf[hc]=df,new TextNode(hf,this.length-(bo-Ai)+Ra.length)}return super.replace(pc,uf,df)}pc=uf+1}return super.replace(Ai,bo,Ra)}sliceString(Ai,bo=this.length,Ra=`
|
|
348
|
-
`){[Ai,bo]=clip(this,Ai,bo);let hc="";for(let pc=0,mc=0;pc<this.children.length&&mc<=bo;pc++){let uf=this.children[pc],df=mc+uf.length;mc>Ai&&pc&&(hc+=Ra),Ai<df&&bo>mc&&(hc+=uf.sliceString(Ai-mc,bo-mc,Ra)),mc=df+1}return hc}flatten(Ai){for(let bo of this.children)bo.flatten(Ai)}scanIdentical(Ai,bo){if(!(Ai instanceof TextNode))return 0;let Ra=0,[hc,pc,mc,uf]=bo>0?[0,0,this.children.length,Ai.children.length]:[this.children.length-1,Ai.children.length-1,-1,-1];for(;;hc+=bo,pc+=bo){if(hc==mc||pc==uf)return Ra;let df=this.children[hc],ff=Ai.children[pc];if(df!=ff)return Ra+df.scanIdentical(ff,bo);Ra+=df.length+1}}static from(Ai,bo=Ai.reduce((Ra,hc)=>Ra+hc.length+1,-1)){let Ra=0;for(let gf of Ai)Ra+=gf.lines;if(Ra<32){let gf=[];for(let yf of Ai)yf.flatten(gf);return new TextLeaf(gf,bo)}let hc=Math.max(32,Ra>>5),pc=hc<<1,mc=hc>>1,uf=[],df=0,ff=-1,hf=[];function pf(gf){let yf;if(gf.lines>pc&&gf instanceof TextNode)for(let vf of gf.children)pf(vf);else gf.lines>mc&&(df>mc||!df)?(mf(),uf.push(gf)):gf instanceof TextLeaf&&df&&(yf=hf[hf.length-1])instanceof TextLeaf&&gf.lines+yf.lines<=32?(df+=gf.lines,ff+=gf.length+1,hf[hf.length-1]=new TextLeaf(yf.text.concat(gf.text),yf.length+1+gf.length)):(df+gf.lines>hc&&mf(),df+=gf.lines,ff+=gf.length+1,hf.push(gf))}function mf(){df!=0&&(uf.push(hf.length==1?hf[0]:TextNode.from(hf,ff)),ff=-1,df=hf.length=0)}for(let gf of Ai)pf(gf);return mf(),uf.length==1?uf[0]:new TextNode(uf,bo)}}Text.empty=new TextLeaf([""],0);function textLength(vo){let Ai=-1;for(let bo of vo)Ai+=bo.length+1;return Ai}function appendText(vo,Ai,bo=0,Ra=1e9){for(let hc=0,pc=0,mc=!0;pc<vo.length&&hc<=Ra;pc++){let uf=vo[pc],df=hc+uf.length;df>=bo&&(df>Ra&&(uf=uf.slice(0,Ra-hc)),hc<bo&&(uf=uf.slice(bo-hc)),mc?(Ai[Ai.length-1]+=uf,mc=!1):Ai.push(uf)),hc=df+1}return Ai}function sliceText(vo,Ai,bo){return appendText(vo,[""],Ai,bo)}class RawTextCursor{constructor(Ai,bo=1){this.dir=bo,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[Ai],this.offsets=[bo>0?1:(Ai instanceof TextLeaf?Ai.text.length:Ai.children.length)<<1]}nextInner(Ai,bo){for(this.done=this.lineBreak=!1;;){let Ra=this.nodes.length-1,hc=this.nodes[Ra],pc=this.offsets[Ra],mc=pc>>1,uf=hc instanceof TextLeaf?hc.text.length:hc.children.length;if(mc==(bo>0?uf:0)){if(Ra==0)return this.done=!0,this.value="",this;bo>0&&this.offsets[Ra-1]++,this.nodes.pop(),this.offsets.pop()}else if((pc&1)==(bo>0?0:1)){if(this.offsets[Ra]+=bo,Ai==0)return this.lineBreak=!0,this.value=`
|
|
349
|
-
`,this;Ai--}else if(hc instanceof TextLeaf){let df=hc.text[mc+(bo<0?-1:0)];if(this.offsets[Ra]+=bo,df.length>Math.max(0,Ai))return this.value=Ai==0?df:bo>0?df.slice(Ai):df.slice(0,df.length-Ai),this;Ai-=df.length}else{let df=hc.children[mc+(bo<0?-1:0)];Ai>df.length?(Ai-=df.length,this.offsets[Ra]+=bo):(bo<0&&this.offsets[Ra]--,this.nodes.push(df),this.offsets.push(bo>0?1:(df instanceof TextLeaf?df.text.length:df.children.length)<<1))}}}next(Ai=0){return Ai<0&&(this.nextInner(-Ai,-this.dir),Ai=this.value.length),this.nextInner(Ai,this.dir)}}class PartialTextCursor{constructor(Ai,bo,Ra){this.value="",this.done=!1,this.cursor=new RawTextCursor(Ai,bo>Ra?-1:1),this.pos=bo>Ra?Ai.length:0,this.from=Math.min(bo,Ra),this.to=Math.max(bo,Ra)}nextInner(Ai,bo){if(bo<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;Ai+=Math.max(0,bo<0?this.pos-this.to:this.from-this.pos);let Ra=bo<0?this.pos-this.from:this.to-this.pos;Ai>Ra&&(Ai=Ra),Ra-=Ai;let{value:hc}=this.cursor.next(Ai);return this.pos+=(hc.length+Ai)*bo,this.value=hc.length<=Ra?hc:bo<0?hc.slice(hc.length-Ra):hc.slice(0,Ra),this.done=!this.value,this}next(Ai=0){return Ai<0?Ai=Math.max(Ai,this.from-this.pos):Ai>0&&(Ai=Math.min(Ai,this.to-this.pos)),this.nextInner(Ai,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class LineCursor{constructor(Ai){this.inner=Ai,this.afterBreak=!0,this.value="",this.done=!1}next(Ai=0){let{done:bo,lineBreak:Ra,value:hc}=this.inner.next(Ai);return bo&&this.afterBreak?(this.value="",this.afterBreak=!1):bo?(this.done=!0,this.value=""):Ra?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=hc,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Text.prototype[Symbol.iterator]=function(){return this.iter()},RawTextCursor.prototype[Symbol.iterator]=PartialTextCursor.prototype[Symbol.iterator]=LineCursor.prototype[Symbol.iterator]=function(){return this});class Line{constructor(Ai,bo,Ra,hc){this.from=Ai,this.to=bo,this.number=Ra,this.text=hc}get length(){return this.to-this.from}}function clip(vo,Ai,bo){return Ai=Math.max(0,Math.min(vo.length,Ai)),[Ai,Math.max(Ai,Math.min(vo.length,bo))]}function findClusterBreak(vo,Ai,bo=!0,Ra=!0){return findClusterBreak$1(vo,Ai,bo,Ra)}function surrogateLow(vo){return vo>=56320&&vo<57344}function surrogateHigh(vo){return vo>=55296&&vo<56320}function codePointAt(vo,Ai){let bo=vo.charCodeAt(Ai);if(!surrogateHigh(bo)||Ai+1==vo.length)return bo;let Ra=vo.charCodeAt(Ai+1);return surrogateLow(Ra)?(bo-55296<<10)+(Ra-56320)+65536:bo}function fromCodePoint(vo){return vo<=65535?String.fromCharCode(vo):(vo-=65536,String.fromCharCode((vo>>10)+55296,(vo&1023)+56320))}function codePointSize(vo){return vo<65536?1:2}const DefaultSplit=/\r\n?|\n/;var MapMode=function(vo){return vo[vo.Simple=0]="Simple",vo[vo.TrackDel=1]="TrackDel",vo[vo.TrackBefore=2]="TrackBefore",vo[vo.TrackAfter=3]="TrackAfter",vo}(MapMode||(MapMode={}));class ChangeDesc{constructor(Ai){this.sections=Ai}get length(){let Ai=0;for(let bo=0;bo<this.sections.length;bo+=2)Ai+=this.sections[bo];return Ai}get newLength(){let Ai=0;for(let bo=0;bo<this.sections.length;bo+=2){let Ra=this.sections[bo+1];Ai+=Ra<0?this.sections[bo]:Ra}return Ai}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(Ai){for(let bo=0,Ra=0,hc=0;bo<this.sections.length;){let pc=this.sections[bo++],mc=this.sections[bo++];mc<0?(Ai(Ra,hc,pc),hc+=pc):hc+=mc,Ra+=pc}}iterChangedRanges(Ai,bo=!1){iterChanges(this,Ai,bo)}get invertedDesc(){let Ai=[];for(let bo=0;bo<this.sections.length;){let Ra=this.sections[bo++],hc=this.sections[bo++];hc<0?Ai.push(Ra,hc):Ai.push(hc,Ra)}return new ChangeDesc(Ai)}composeDesc(Ai){return this.empty?Ai:Ai.empty?this:composeSets(this,Ai)}mapDesc(Ai,bo=!1){return Ai.empty?this:mapSet(this,Ai,bo)}mapPos(Ai,bo=-1,Ra=MapMode.Simple){let hc=0,pc=0;for(let mc=0;mc<this.sections.length;){let uf=this.sections[mc++],df=this.sections[mc++],ff=hc+uf;if(df<0){if(ff>Ai)return pc+(Ai-hc);pc+=uf}else{if(Ra!=MapMode.Simple&&ff>=Ai&&(Ra==MapMode.TrackDel&&hc<Ai&&ff>Ai||Ra==MapMode.TrackBefore&&hc<Ai||Ra==MapMode.TrackAfter&&ff>Ai))return null;if(ff>Ai||ff==Ai&&bo<0&&!uf)return Ai==hc||bo<0?pc:pc+df;pc+=df}hc=ff}if(Ai>hc)throw new RangeError(`Position ${Ai} is out of range for changeset of length ${hc}`);return pc}touchesRange(Ai,bo=Ai){for(let Ra=0,hc=0;Ra<this.sections.length&&hc<=bo;){let pc=this.sections[Ra++],mc=this.sections[Ra++],uf=hc+pc;if(mc>=0&&hc<=bo&&uf>=Ai)return hc<Ai&&uf>bo?"cover":!0;hc=uf}return!1}toString(){let Ai="";for(let bo=0;bo<this.sections.length;){let Ra=this.sections[bo++],hc=this.sections[bo++];Ai+=(Ai?" ":"")+Ra+(hc>=0?":"+hc:"")}return Ai}toJSON(){return this.sections}static fromJSON(Ai){if(!Array.isArray(Ai)||Ai.length%2||Ai.some(bo=>typeof bo!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ChangeDesc(Ai)}static create(Ai){return new ChangeDesc(Ai)}}class ChangeSet extends ChangeDesc{constructor(Ai,bo){super(Ai),this.inserted=bo}apply(Ai){if(this.length!=Ai.length)throw new RangeError("Applying change set to a document with the wrong length");return iterChanges(this,(bo,Ra,hc,pc,mc)=>Ai=Ai.replace(hc,hc+(Ra-bo),mc),!1),Ai}mapDesc(Ai,bo=!1){return mapSet(this,Ai,bo,!0)}invert(Ai){let bo=this.sections.slice(),Ra=[];for(let hc=0,pc=0;hc<bo.length;hc+=2){let mc=bo[hc],uf=bo[hc+1];if(uf>=0){bo[hc]=uf,bo[hc+1]=mc;let df=hc>>1;for(;Ra.length<df;)Ra.push(Text.empty);Ra.push(mc?Ai.slice(pc,pc+mc):Text.empty)}pc+=mc}return new ChangeSet(bo,Ra)}compose(Ai){return this.empty?Ai:Ai.empty?this:composeSets(this,Ai,!0)}map(Ai,bo=!1){return Ai.empty?this:mapSet(this,Ai,bo,!0)}iterChanges(Ai,bo=!1){iterChanges(this,Ai,bo)}get desc(){return ChangeDesc.create(this.sections)}filter(Ai){let bo=[],Ra=[],hc=[],pc=new SectionIter(this);e:for(let mc=0,uf=0;;){let df=mc==Ai.length?1e9:Ai[mc++];for(;uf<df||uf==df&&pc.len==0;){if(pc.done)break e;let hf=Math.min(pc.len,df-uf);addSection(hc,hf,-1);let pf=pc.ins==-1?-1:pc.off==0?pc.ins:0;addSection(bo,hf,pf),pf>0&&addInsert(Ra,bo,pc.text),pc.forward(hf),uf+=hf}let ff=Ai[mc++];for(;uf<ff;){if(pc.done)break e;let hf=Math.min(pc.len,ff-uf);addSection(bo,hf,-1),addSection(hc,hf,pc.ins==-1?-1:pc.off==0?pc.ins:0),pc.forward(hf),uf+=hf}}return{changes:new ChangeSet(bo,Ra),filtered:ChangeDesc.create(hc)}}toJSON(){let Ai=[];for(let bo=0;bo<this.sections.length;bo+=2){let Ra=this.sections[bo],hc=this.sections[bo+1];hc<0?Ai.push(Ra):hc==0?Ai.push([Ra]):Ai.push([Ra].concat(this.inserted[bo>>1].toJSON()))}return Ai}static of(Ai,bo,Ra){let hc=[],pc=[],mc=0,uf=null;function df(hf=!1){if(!hf&&!hc.length)return;mc<bo&&addSection(hc,bo-mc,-1);let pf=new ChangeSet(hc,pc);uf=uf?uf.compose(pf.map(uf)):pf,hc=[],pc=[],mc=0}function ff(hf){if(Array.isArray(hf))for(let pf of hf)ff(pf);else if(hf instanceof ChangeSet){if(hf.length!=bo)throw new RangeError(`Mismatched change set length (got ${hf.length}, expected ${bo})`);df(),uf=uf?uf.compose(hf.map(uf)):hf}else{let{from:pf,to:mf=pf,insert:gf}=hf;if(pf>mf||pf<0||mf>bo)throw new RangeError(`Invalid change range ${pf} to ${mf} (in doc of length ${bo})`);let yf=gf?typeof gf=="string"?Text.of(gf.split(Ra||DefaultSplit)):gf:Text.empty,vf=yf.length;if(pf==mf&&vf==0)return;pf<mc&&df(),pf>mc&&addSection(hc,pf-mc,-1),addSection(hc,mf-pf,vf),addInsert(pc,hc,yf),mc=mf}}return ff(Ai),df(!uf),uf}static empty(Ai){return new ChangeSet(Ai?[Ai,-1]:[],[])}static fromJSON(Ai){if(!Array.isArray(Ai))throw new RangeError("Invalid JSON representation of ChangeSet");let bo=[],Ra=[];for(let hc=0;hc<Ai.length;hc++){let pc=Ai[hc];if(typeof pc=="number")bo.push(pc,-1);else{if(!Array.isArray(pc)||typeof pc[0]!="number"||pc.some((mc,uf)=>uf&&typeof mc!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(pc.length==1)bo.push(pc[0],0);else{for(;Ra.length<hc;)Ra.push(Text.empty);Ra[hc]=Text.of(pc.slice(1)),bo.push(pc[0],Ra[hc].length)}}}return new ChangeSet(bo,Ra)}static createSet(Ai,bo){return new ChangeSet(Ai,bo)}}function addSection(vo,Ai,bo,Ra=!1){if(Ai==0&&bo<=0)return;let hc=vo.length-2;hc>=0&&bo<=0&&bo==vo[hc+1]?vo[hc]+=Ai:hc>=0&&Ai==0&&vo[hc]==0?vo[hc+1]+=bo:Ra?(vo[hc]+=Ai,vo[hc+1]+=bo):vo.push(Ai,bo)}function addInsert(vo,Ai,bo){if(bo.length==0)return;let Ra=Ai.length-2>>1;if(Ra<vo.length)vo[vo.length-1]=vo[vo.length-1].append(bo);else{for(;vo.length<Ra;)vo.push(Text.empty);vo.push(bo)}}function iterChanges(vo,Ai,bo){let Ra=vo.inserted;for(let hc=0,pc=0,mc=0;mc<vo.sections.length;){let uf=vo.sections[mc++],df=vo.sections[mc++];if(df<0)hc+=uf,pc+=uf;else{let ff=hc,hf=pc,pf=Text.empty;for(;ff+=uf,hf+=df,df&&Ra&&(pf=pf.append(Ra[mc-2>>1])),!(bo||mc==vo.sections.length||vo.sections[mc+1]<0);)uf=vo.sections[mc++],df=vo.sections[mc++];Ai(hc,ff,pc,hf,pf),hc=ff,pc=hf}}}function mapSet(vo,Ai,bo,Ra=!1){let hc=[],pc=Ra?[]:null,mc=new SectionIter(vo),uf=new SectionIter(Ai);for(let df=-1;;){if(mc.done&&uf.len||uf.done&&mc.len)throw new Error("Mismatched change set lengths");if(mc.ins==-1&&uf.ins==-1){let ff=Math.min(mc.len,uf.len);addSection(hc,ff,-1),mc.forward(ff),uf.forward(ff)}else if(uf.ins>=0&&(mc.ins<0||df==mc.i||mc.off==0&&(uf.len<mc.len||uf.len==mc.len&&!bo))){let ff=uf.len;for(addSection(hc,uf.ins,-1);ff;){let hf=Math.min(mc.len,ff);mc.ins>=0&&df<mc.i&&mc.len<=hf&&(addSection(hc,0,mc.ins),pc&&addInsert(pc,hc,mc.text),df=mc.i),mc.forward(hf),ff-=hf}uf.next()}else if(mc.ins>=0){let ff=0,hf=mc.len;for(;hf;)if(uf.ins==-1){let pf=Math.min(hf,uf.len);ff+=pf,hf-=pf,uf.forward(pf)}else if(uf.ins==0&&uf.len<hf)hf-=uf.len,uf.next();else break;addSection(hc,ff,df<mc.i?mc.ins:0),pc&&df<mc.i&&addInsert(pc,hc,mc.text),df=mc.i,mc.forward(mc.len-hf)}else{if(mc.done&&uf.done)return pc?ChangeSet.createSet(hc,pc):ChangeDesc.create(hc);throw new Error("Mismatched change set lengths")}}}function composeSets(vo,Ai,bo=!1){let Ra=[],hc=bo?[]:null,pc=new SectionIter(vo),mc=new SectionIter(Ai);for(let uf=!1;;){if(pc.done&&mc.done)return hc?ChangeSet.createSet(Ra,hc):ChangeDesc.create(Ra);if(pc.ins==0)addSection(Ra,pc.len,0,uf),pc.next();else if(mc.len==0&&!mc.done)addSection(Ra,0,mc.ins,uf),hc&&addInsert(hc,Ra,mc.text),mc.next();else{if(pc.done||mc.done)throw new Error("Mismatched change set lengths");{let df=Math.min(pc.len2,mc.len),ff=Ra.length;if(pc.ins==-1){let hf=mc.ins==-1?-1:mc.off?0:mc.ins;addSection(Ra,df,hf,uf),hc&&hf&&addInsert(hc,Ra,mc.text)}else mc.ins==-1?(addSection(Ra,pc.off?0:pc.len,df,uf),hc&&addInsert(hc,Ra,pc.textBit(df))):(addSection(Ra,pc.off?0:pc.len,mc.off?0:mc.ins,uf),hc&&!mc.off&&addInsert(hc,Ra,mc.text));uf=(pc.ins>df||mc.ins>=0&&mc.len>df)&&(uf||Ra.length>ff),pc.forward2(df),mc.forward(df)}}}}class SectionIter{constructor(Ai){this.set=Ai,this.i=0,this.next()}next(){let{sections:Ai}=this.set;this.i<Ai.length?(this.len=Ai[this.i++],this.ins=Ai[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:Ai}=this.set,bo=this.i-2>>1;return bo>=Ai.length?Text.empty:Ai[bo]}textBit(Ai){let{inserted:bo}=this.set,Ra=this.i-2>>1;return Ra>=bo.length&&!Ai?Text.empty:bo[Ra].slice(this.off,Ai==null?void 0:this.off+Ai)}forward(Ai){Ai==this.len?this.next():(this.len-=Ai,this.off+=Ai)}forward2(Ai){this.ins==-1?this.forward(Ai):Ai==this.ins?this.next():(this.ins-=Ai,this.off+=Ai)}}let SelectionRange$1=class wT{constructor(Ai,bo,Ra){this.from=Ai,this.to=bo,this.flags=Ra}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let Ai=this.flags&7;return Ai==7?null:Ai}get goalColumn(){let Ai=this.flags>>6;return Ai==16777215?void 0:Ai}map(Ai,bo=-1){let Ra,hc;return this.empty?Ra=hc=Ai.mapPos(this.from,bo):(Ra=Ai.mapPos(this.from,1),hc=Ai.mapPos(this.to,-1)),Ra==this.from&&hc==this.to?this:new wT(Ra,hc,this.flags)}extend(Ai,bo=Ai){if(Ai<=this.anchor&&bo>=this.anchor)return EditorSelection.range(Ai,bo);let Ra=Math.abs(Ai-this.anchor)>Math.abs(bo-this.anchor)?Ai:bo;return EditorSelection.range(this.anchor,Ra)}eq(Ai,bo=!1){return this.anchor==Ai.anchor&&this.head==Ai.head&&(!bo||!this.empty||this.assoc==Ai.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(Ai){if(!Ai||typeof Ai.anchor!="number"||typeof Ai.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return EditorSelection.range(Ai.anchor,Ai.head)}static create(Ai,bo,Ra){return new wT(Ai,bo,Ra)}};class EditorSelection{constructor(Ai,bo){this.ranges=Ai,this.mainIndex=bo}map(Ai,bo=-1){return Ai.empty?this:EditorSelection.create(this.ranges.map(Ra=>Ra.map(Ai,bo)),this.mainIndex)}eq(Ai,bo=!1){if(this.ranges.length!=Ai.ranges.length||this.mainIndex!=Ai.mainIndex)return!1;for(let Ra=0;Ra<this.ranges.length;Ra++)if(!this.ranges[Ra].eq(Ai.ranges[Ra],bo))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new EditorSelection([this.main],0)}addRange(Ai,bo=!0){return EditorSelection.create([Ai].concat(this.ranges),bo?0:this.mainIndex+1)}replaceRange(Ai,bo=this.mainIndex){let Ra=this.ranges.slice();return Ra[bo]=Ai,EditorSelection.create(Ra,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(Ai=>Ai.toJSON()),main:this.mainIndex}}static fromJSON(Ai){if(!Ai||!Array.isArray(Ai.ranges)||typeof Ai.main!="number"||Ai.main>=Ai.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new EditorSelection(Ai.ranges.map(bo=>SelectionRange$1.fromJSON(bo)),Ai.main)}static single(Ai,bo=Ai){return new EditorSelection([EditorSelection.range(Ai,bo)],0)}static create(Ai,bo=0){if(Ai.length==0)throw new RangeError("A selection needs at least one range");for(let Ra=0,hc=0;hc<Ai.length;hc++){let pc=Ai[hc];if(pc.empty?pc.from<=Ra:pc.from<Ra)return EditorSelection.normalized(Ai.slice(),bo);Ra=pc.to}return new EditorSelection(Ai,bo)}static cursor(Ai,bo=0,Ra,hc){return SelectionRange$1.create(Ai,Ai,(bo==0?0:bo<0?8:16)|(Ra==null?7:Math.min(6,Ra))|(hc??16777215)<<6)}static range(Ai,bo,Ra,hc){let pc=(Ra??16777215)<<6|(hc==null?7:Math.min(6,hc));return bo<Ai?SelectionRange$1.create(bo,Ai,48|pc):SelectionRange$1.create(Ai,bo,(bo>Ai?8:0)|pc)}static normalized(Ai,bo=0){let Ra=Ai[bo];Ai.sort((hc,pc)=>hc.from-pc.from),bo=Ai.indexOf(Ra);for(let hc=1;hc<Ai.length;hc++){let pc=Ai[hc],mc=Ai[hc-1];if(pc.empty?pc.from<=mc.to:pc.from<mc.to){let uf=mc.from,df=Math.max(pc.to,mc.to);hc<=bo&&bo--,Ai.splice(--hc,2,pc.anchor>pc.head?EditorSelection.range(df,uf):EditorSelection.range(uf,df))}}return new EditorSelection(Ai,bo)}}function checkSelection(vo,Ai){for(let bo of vo.ranges)if(bo.to>Ai)throw new RangeError("Selection points outside of document")}let nextID=0;class Facet{constructor(Ai,bo,Ra,hc,pc){this.combine=Ai,this.compareInput=bo,this.compare=Ra,this.isStatic=hc,this.id=nextID++,this.default=Ai([]),this.extensions=typeof pc=="function"?pc(this):pc}get reader(){return this}static define(Ai={}){return new Facet(Ai.combine||(bo=>bo),Ai.compareInput||((bo,Ra)=>bo===Ra),Ai.compare||(Ai.combine?(bo,Ra)=>bo===Ra:sameArray$1),!!Ai.static,Ai.enables)}of(Ai){return new FacetProvider([],this,0,Ai)}compute(Ai,bo){if(this.isStatic)throw new Error("Can't compute a static facet");return new FacetProvider(Ai,this,1,bo)}computeN(Ai,bo){if(this.isStatic)throw new Error("Can't compute a static facet");return new FacetProvider(Ai,this,2,bo)}from(Ai,bo){return bo||(bo=Ra=>Ra),this.compute([Ai],Ra=>bo(Ra.field(Ai)))}}function sameArray$1(vo,Ai){return vo==Ai||vo.length==Ai.length&&vo.every((bo,Ra)=>bo===Ai[Ra])}class FacetProvider{constructor(Ai,bo,Ra,hc){this.dependencies=Ai,this.facet=bo,this.type=Ra,this.value=hc,this.id=nextID++}dynamicSlot(Ai){var bo;let Ra=this.value,hc=this.facet.compareInput,pc=this.id,mc=Ai[pc]>>1,uf=this.type==2,df=!1,ff=!1,hf=[];for(let pf of this.dependencies)pf=="doc"?df=!0:pf=="selection"?ff=!0:((bo=Ai[pf.id])!==null&&bo!==void 0?bo:1)&1||hf.push(Ai[pf.id]);return{create(pf){return pf.values[mc]=Ra(pf),1},update(pf,mf){if(df&&mf.docChanged||ff&&(mf.docChanged||mf.selection)||ensureAll(pf,hf)){let gf=Ra(pf);if(uf?!compareArray(gf,pf.values[mc],hc):!hc(gf,pf.values[mc]))return pf.values[mc]=gf,1}return 0},reconfigure:(pf,mf)=>{let gf,yf=mf.config.address[pc];if(yf!=null){let vf=getAddr(mf,yf);if(this.dependencies.every(bf=>bf instanceof Facet?mf.facet(bf)===pf.facet(bf):bf instanceof StateField?mf.field(bf,!1)==pf.field(bf,!1):!0)||(uf?compareArray(gf=Ra(pf),vf,hc):hc(gf=Ra(pf),vf)))return pf.values[mc]=vf,0}else gf=Ra(pf);return pf.values[mc]=gf,1}}}}function compareArray(vo,Ai,bo){if(vo.length!=Ai.length)return!1;for(let Ra=0;Ra<vo.length;Ra++)if(!bo(vo[Ra],Ai[Ra]))return!1;return!0}function ensureAll(vo,Ai){let bo=!1;for(let Ra of Ai)ensureAddr(vo,Ra)&1&&(bo=!0);return bo}function dynamicFacetSlot(vo,Ai,bo){let Ra=bo.map(df=>vo[df.id]),hc=bo.map(df=>df.type),pc=Ra.filter(df=>!(df&1)),mc=vo[Ai.id]>>1;function uf(df){let ff=[];for(let hf=0;hf<Ra.length;hf++){let pf=getAddr(df,Ra[hf]);if(hc[hf]==2)for(let mf of pf)ff.push(mf);else ff.push(pf)}return Ai.combine(ff)}return{create(df){for(let ff of Ra)ensureAddr(df,ff);return df.values[mc]=uf(df),1},update(df,ff){if(!ensureAll(df,pc))return 0;let hf=uf(df);return Ai.compare(hf,df.values[mc])?0:(df.values[mc]=hf,1)},reconfigure(df,ff){let hf=ensureAll(df,Ra),pf=ff.config.facets[Ai.id],mf=ff.facet(Ai);if(pf&&!hf&&sameArray$1(bo,pf))return df.values[mc]=mf,0;let gf=uf(df);return Ai.compare(gf,mf)?(df.values[mc]=mf,0):(df.values[mc]=gf,1)}}}const initField=Facet.define({static:!0});class StateField{constructor(Ai,bo,Ra,hc,pc){this.id=Ai,this.createF=bo,this.updateF=Ra,this.compareF=hc,this.spec=pc,this.provides=void 0}static define(Ai){let bo=new StateField(nextID++,Ai.create,Ai.update,Ai.compare||((Ra,hc)=>Ra===hc),Ai);return Ai.provide&&(bo.provides=Ai.provide(bo)),bo}create(Ai){let bo=Ai.facet(initField).find(Ra=>Ra.field==this);return((bo==null?void 0:bo.create)||this.createF)(Ai)}slot(Ai){let bo=Ai[this.id]>>1;return{create:Ra=>(Ra.values[bo]=this.create(Ra),1),update:(Ra,hc)=>{let pc=Ra.values[bo],mc=this.updateF(pc,hc);return this.compareF(pc,mc)?0:(Ra.values[bo]=mc,1)},reconfigure:(Ra,hc)=>hc.config.address[this.id]!=null?(Ra.values[bo]=hc.field(this),0):(Ra.values[bo]=this.create(Ra),1)}}init(Ai){return[this,initField.of({field:this,create:Ai})]}get extension(){return this}}const Prec_={lowest:4,low:3,default:2,high:1,highest:0};function prec(vo){return Ai=>new PrecExtension(Ai,vo)}const Prec={highest:prec(Prec_.highest),high:prec(Prec_.high),default:prec(Prec_.default),low:prec(Prec_.low),lowest:prec(Prec_.lowest)};class PrecExtension{constructor(Ai,bo){this.inner=Ai,this.prec=bo}}class Compartment{of(Ai){return new CompartmentInstance(this,Ai)}reconfigure(Ai){return Compartment.reconfigure.of({compartment:this,extension:Ai})}get(Ai){return Ai.config.compartments.get(this)}}class CompartmentInstance{constructor(Ai,bo){this.compartment=Ai,this.inner=bo}}class Configuration{constructor(Ai,bo,Ra,hc,pc,mc){for(this.base=Ai,this.compartments=bo,this.dynamicSlots=Ra,this.address=hc,this.staticValues=pc,this.facets=mc,this.statusTemplate=[];this.statusTemplate.length<Ra.length;)this.statusTemplate.push(0)}staticFacet(Ai){let bo=this.address[Ai.id];return bo==null?Ai.default:this.staticValues[bo>>1]}static resolve(Ai,bo,Ra){let hc=[],pc=Object.create(null),mc=new Map;for(let mf of flatten(Ai,bo,mc))mf instanceof StateField?hc.push(mf):(pc[mf.facet.id]||(pc[mf.facet.id]=[])).push(mf);let uf=Object.create(null),df=[],ff=[];for(let mf of hc)uf[mf.id]=ff.length<<1,ff.push(gf=>mf.slot(gf));let hf=Ra==null?void 0:Ra.config.facets;for(let mf in pc){let gf=pc[mf],yf=gf[0].facet,vf=hf&&hf[mf]||[];if(gf.every(bf=>bf.type==0))if(uf[yf.id]=df.length<<1|1,sameArray$1(vf,gf))df.push(Ra.facet(yf));else{let bf=yf.combine(gf.map(Sf=>Sf.value));df.push(Ra&&yf.compare(bf,Ra.facet(yf))?Ra.facet(yf):bf)}else{for(let bf of gf)bf.type==0?(uf[bf.id]=df.length<<1|1,df.push(bf.value)):(uf[bf.id]=ff.length<<1,ff.push(Sf=>bf.dynamicSlot(Sf)));uf[yf.id]=ff.length<<1,ff.push(bf=>dynamicFacetSlot(bf,yf,gf))}}let pf=ff.map(mf=>mf(uf));return new Configuration(Ai,mc,pf,uf,df,pc)}}function flatten(vo,Ai,bo){let Ra=[[],[],[],[],[]],hc=new Map;function pc(mc,uf){let df=hc.get(mc);if(df!=null){if(df<=uf)return;let ff=Ra[df].indexOf(mc);ff>-1&&Ra[df].splice(ff,1),mc instanceof CompartmentInstance&&bo.delete(mc.compartment)}if(hc.set(mc,uf),Array.isArray(mc))for(let ff of mc)pc(ff,uf);else if(mc instanceof CompartmentInstance){if(bo.has(mc.compartment))throw new RangeError("Duplicate use of compartment in extensions");let ff=Ai.get(mc.compartment)||mc.inner;bo.set(mc.compartment,ff),pc(ff,uf)}else if(mc instanceof PrecExtension)pc(mc.inner,mc.prec);else if(mc instanceof StateField)Ra[uf].push(mc),mc.provides&&pc(mc.provides,uf);else if(mc instanceof FacetProvider)Ra[uf].push(mc),mc.facet.extensions&&pc(mc.facet.extensions,Prec_.default);else{let ff=mc.extension;if(!ff)throw new Error(`Unrecognized extension value in extension set (${mc}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);pc(ff,uf)}}return pc(vo,Prec_.default),Ra.reduce((mc,uf)=>mc.concat(uf))}function ensureAddr(vo,Ai){if(Ai&1)return 2;let bo=Ai>>1,Ra=vo.status[bo];if(Ra==4)throw new Error("Cyclic dependency between fields and/or facets");if(Ra&2)return Ra;vo.status[bo]=4;let hc=vo.computeSlot(vo,vo.config.dynamicSlots[bo]);return vo.status[bo]=2|hc}function getAddr(vo,Ai){return Ai&1?vo.config.staticValues[Ai>>1]:vo.values[Ai>>1]}const languageData=Facet.define(),allowMultipleSelections=Facet.define({combine:vo=>vo.some(Ai=>Ai),static:!0}),lineSeparator=Facet.define({combine:vo=>vo.length?vo[0]:void 0,static:!0}),changeFilter=Facet.define(),transactionFilter=Facet.define(),transactionExtender=Facet.define(),readOnly=Facet.define({combine:vo=>vo.length?vo[0]:!1});class Annotation{constructor(Ai,bo){this.type=Ai,this.value=bo}static define(){return new AnnotationType}}class AnnotationType{of(Ai){return new Annotation(this,Ai)}}class StateEffectType{constructor(Ai){this.map=Ai}of(Ai){return new StateEffect(this,Ai)}}class StateEffect{constructor(Ai,bo){this.type=Ai,this.value=bo}map(Ai){let bo=this.type.map(this.value,Ai);return bo===void 0?void 0:bo==this.value?this:new StateEffect(this.type,bo)}is(Ai){return this.type==Ai}static define(Ai={}){return new StateEffectType(Ai.map||(bo=>bo))}static mapEffects(Ai,bo){if(!Ai.length)return Ai;let Ra=[];for(let hc of Ai){let pc=hc.map(bo);pc&&Ra.push(pc)}return Ra}}StateEffect.reconfigure=StateEffect.define();StateEffect.appendConfig=StateEffect.define();class Transaction{constructor(Ai,bo,Ra,hc,pc,mc){this.startState=Ai,this.changes=bo,this.selection=Ra,this.effects=hc,this.annotations=pc,this.scrollIntoView=mc,this._doc=null,this._state=null,Ra&&checkSelection(Ra,bo.newLength),pc.some(uf=>uf.type==Transaction.time)||(this.annotations=pc.concat(Transaction.time.of(Date.now())))}static create(Ai,bo,Ra,hc,pc,mc){return new Transaction(Ai,bo,Ra,hc,pc,mc)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(Ai){for(let bo of this.annotations)if(bo.type==Ai)return bo.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(Ai){let bo=this.annotation(Transaction.userEvent);return!!(bo&&(bo==Ai||bo.length>Ai.length&&bo.slice(0,Ai.length)==Ai&&bo[Ai.length]=="."))}}Transaction.time=Annotation.define();Transaction.userEvent=Annotation.define();Transaction.addToHistory=Annotation.define();Transaction.remote=Annotation.define();function joinRanges(vo,Ai){let bo=[];for(let Ra=0,hc=0;;){let pc,mc;if(Ra<vo.length&&(hc==Ai.length||Ai[hc]>=vo[Ra]))pc=vo[Ra++],mc=vo[Ra++];else if(hc<Ai.length)pc=Ai[hc++],mc=Ai[hc++];else return bo;!bo.length||bo[bo.length-1]<pc?bo.push(pc,mc):bo[bo.length-1]<mc&&(bo[bo.length-1]=mc)}}function mergeTransaction(vo,Ai,bo){var Ra;let hc,pc,mc;return bo?(hc=Ai.changes,pc=ChangeSet.empty(Ai.changes.length),mc=vo.changes.compose(Ai.changes)):(hc=Ai.changes.map(vo.changes),pc=vo.changes.mapDesc(Ai.changes,!0),mc=vo.changes.compose(hc)),{changes:mc,selection:Ai.selection?Ai.selection.map(pc):(Ra=vo.selection)===null||Ra===void 0?void 0:Ra.map(hc),effects:StateEffect.mapEffects(vo.effects,hc).concat(StateEffect.mapEffects(Ai.effects,pc)),annotations:vo.annotations.length?vo.annotations.concat(Ai.annotations):Ai.annotations,scrollIntoView:vo.scrollIntoView||Ai.scrollIntoView}}function resolveTransactionInner(vo,Ai,bo){let Ra=Ai.selection,hc=asArray$2(Ai.annotations);return Ai.userEvent&&(hc=hc.concat(Transaction.userEvent.of(Ai.userEvent))),{changes:Ai.changes instanceof ChangeSet?Ai.changes:ChangeSet.of(Ai.changes||[],bo,vo.facet(lineSeparator)),selection:Ra&&(Ra instanceof EditorSelection?Ra:EditorSelection.single(Ra.anchor,Ra.head)),effects:asArray$2(Ai.effects),annotations:hc,scrollIntoView:!!Ai.scrollIntoView}}function resolveTransaction(vo,Ai,bo){let Ra=resolveTransactionInner(vo,Ai.length?Ai[0]:{},vo.doc.length);Ai.length&&Ai[0].filter===!1&&(bo=!1);for(let pc=1;pc<Ai.length;pc++){Ai[pc].filter===!1&&(bo=!1);let mc=!!Ai[pc].sequential;Ra=mergeTransaction(Ra,resolveTransactionInner(vo,Ai[pc],mc?Ra.changes.newLength:vo.doc.length),mc)}let hc=Transaction.create(vo,Ra.changes,Ra.selection,Ra.effects,Ra.annotations,Ra.scrollIntoView);return extendTransaction(bo?filterTransaction(hc):hc)}function filterTransaction(vo){let Ai=vo.startState,bo=!0;for(let hc of Ai.facet(changeFilter)){let pc=hc(vo);if(pc===!1){bo=!1;break}Array.isArray(pc)&&(bo=bo===!0?pc:joinRanges(bo,pc))}if(bo!==!0){let hc,pc;if(bo===!1)pc=vo.changes.invertedDesc,hc=ChangeSet.empty(Ai.doc.length);else{let mc=vo.changes.filter(bo);hc=mc.changes,pc=mc.filtered.mapDesc(mc.changes).invertedDesc}vo=Transaction.create(Ai,hc,vo.selection&&vo.selection.map(pc),StateEffect.mapEffects(vo.effects,pc),vo.annotations,vo.scrollIntoView)}let Ra=Ai.facet(transactionFilter);for(let hc=Ra.length-1;hc>=0;hc--){let pc=Ra[hc](vo);pc instanceof Transaction?vo=pc:Array.isArray(pc)&&pc.length==1&&pc[0]instanceof Transaction?vo=pc[0]:vo=resolveTransaction(Ai,asArray$2(pc),!1)}return vo}function extendTransaction(vo){let Ai=vo.startState,bo=Ai.facet(transactionExtender),Ra=vo;for(let hc=bo.length-1;hc>=0;hc--){let pc=bo[hc](vo);pc&&Object.keys(pc).length&&(Ra=mergeTransaction(Ra,resolveTransactionInner(Ai,pc,vo.changes.newLength),!0))}return Ra==vo?vo:Transaction.create(Ai,vo.changes,vo.selection,Ra.effects,Ra.annotations,Ra.scrollIntoView)}const none$2=[];function asArray$2(vo){return vo==null?none$2:Array.isArray(vo)?vo:[vo]}var CharCategory=function(vo){return vo[vo.Word=0]="Word",vo[vo.Space=1]="Space",vo[vo.Other=2]="Other",vo}(CharCategory||(CharCategory={}));const nonASCIISingleCaseWordChar=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let wordChar;try{wordChar=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(vo){}function hasWordChar(vo){if(wordChar)return wordChar.test(vo);for(let Ai=0;Ai<vo.length;Ai++){let bo=vo[Ai];if(/\w/.test(bo)||bo>""&&(bo.toUpperCase()!=bo.toLowerCase()||nonASCIISingleCaseWordChar.test(bo)))return!0}return!1}function makeCategorizer(vo){return Ai=>{if(!/\S/.test(Ai))return CharCategory.Space;if(hasWordChar(Ai))return CharCategory.Word;for(let bo=0;bo<vo.length;bo++)if(Ai.indexOf(vo[bo])>-1)return CharCategory.Word;return CharCategory.Other}}class EditorState{constructor(Ai,bo,Ra,hc,pc,mc){this.config=Ai,this.doc=bo,this.selection=Ra,this.values=hc,this.status=Ai.statusTemplate.slice(),this.computeSlot=pc,mc&&(mc._state=this);for(let uf=0;uf<this.config.dynamicSlots.length;uf++)ensureAddr(this,uf<<1);this.computeSlot=null}field(Ai,bo=!0){let Ra=this.config.address[Ai.id];if(Ra==null){if(bo)throw new RangeError("Field is not present in this state");return}return ensureAddr(this,Ra),getAddr(this,Ra)}update(...Ai){return resolveTransaction(this,Ai,!0)}applyTransaction(Ai){let bo=this.config,{base:Ra,compartments:hc}=bo;for(let uf of Ai.effects)uf.is(Compartment.reconfigure)?(bo&&(hc=new Map,bo.compartments.forEach((df,ff)=>hc.set(ff,df)),bo=null),hc.set(uf.value.compartment,uf.value.extension)):uf.is(StateEffect.reconfigure)?(bo=null,Ra=uf.value):uf.is(StateEffect.appendConfig)&&(bo=null,Ra=asArray$2(Ra).concat(uf.value));let pc;bo?pc=Ai.startState.values.slice():(bo=Configuration.resolve(Ra,hc,this),pc=new EditorState(bo,this.doc,this.selection,bo.dynamicSlots.map(()=>null),(uf,df)=>df.reconfigure(uf,this),null).values);let mc=Ai.startState.facet(allowMultipleSelections)?Ai.newSelection:Ai.newSelection.asSingle();new EditorState(bo,Ai.newDoc,mc,pc,(uf,df)=>df.update(uf,Ai),Ai)}replaceSelection(Ai){return typeof Ai=="string"&&(Ai=this.toText(Ai)),this.changeByRange(bo=>({changes:{from:bo.from,to:bo.to,insert:Ai},range:EditorSelection.cursor(bo.from+Ai.length)}))}changeByRange(Ai){let bo=this.selection,Ra=Ai(bo.ranges[0]),hc=this.changes(Ra.changes),pc=[Ra.range],mc=asArray$2(Ra.effects);for(let uf=1;uf<bo.ranges.length;uf++){let df=Ai(bo.ranges[uf]),ff=this.changes(df.changes),hf=ff.map(hc);for(let mf=0;mf<uf;mf++)pc[mf]=pc[mf].map(hf);let pf=hc.mapDesc(ff,!0);pc.push(df.range.map(pf)),hc=hc.compose(hf),mc=StateEffect.mapEffects(mc,hf).concat(StateEffect.mapEffects(asArray$2(df.effects),pf))}return{changes:hc,selection:EditorSelection.create(pc,bo.mainIndex),effects:mc}}changes(Ai=[]){return Ai instanceof ChangeSet?Ai:ChangeSet.of(Ai,this.doc.length,this.facet(EditorState.lineSeparator))}toText(Ai){return Text.of(Ai.split(this.facet(EditorState.lineSeparator)||DefaultSplit))}sliceDoc(Ai=0,bo=this.doc.length){return this.doc.sliceString(Ai,bo,this.lineBreak)}facet(Ai){let bo=this.config.address[Ai.id];return bo==null?Ai.default:(ensureAddr(this,bo),getAddr(this,bo))}toJSON(Ai){let bo={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(Ai)for(let Ra in Ai){let hc=Ai[Ra];hc instanceof StateField&&this.config.address[hc.id]!=null&&(bo[Ra]=hc.spec.toJSON(this.field(Ai[Ra]),this))}return bo}static fromJSON(Ai,bo={},Ra){if(!Ai||typeof Ai.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let hc=[];if(Ra){for(let pc in Ra)if(Object.prototype.hasOwnProperty.call(Ai,pc)){let mc=Ra[pc],uf=Ai[pc];hc.push(mc.init(df=>mc.spec.fromJSON(uf,df)))}}return EditorState.create({doc:Ai.doc,selection:EditorSelection.fromJSON(Ai.selection),extensions:bo.extensions?hc.concat([bo.extensions]):hc})}static create(Ai={}){let bo=Configuration.resolve(Ai.extensions||[],new Map),Ra=Ai.doc instanceof Text?Ai.doc:Text.of((Ai.doc||"").split(bo.staticFacet(EditorState.lineSeparator)||DefaultSplit)),hc=Ai.selection?Ai.selection instanceof EditorSelection?Ai.selection:EditorSelection.single(Ai.selection.anchor,Ai.selection.head):EditorSelection.single(0);return checkSelection(hc,Ra.length),bo.staticFacet(allowMultipleSelections)||(hc=hc.asSingle()),new EditorState(bo,Ra,hc,bo.dynamicSlots.map(()=>null),(pc,mc)=>mc.create(pc),null)}get tabSize(){return this.facet(EditorState.tabSize)}get lineBreak(){return this.facet(EditorState.lineSeparator)||`
|
|
350
|
-
`}get readOnly(){return this.facet(readOnly)}phrase(Ai,...bo){for(let Ra of this.facet(EditorState.phrases))if(Object.prototype.hasOwnProperty.call(Ra,Ai)){Ai=Ra[Ai];break}return bo.length&&(Ai=Ai.replace(/\$(\$|\d*)/g,(Ra,hc)=>{if(hc=="$")return"$";let pc=+(hc||1);return!pc||pc>bo.length?Ra:bo[pc-1]})),Ai}languageDataAt(Ai,bo,Ra=-1){let hc=[];for(let pc of this.facet(languageData))for(let mc of pc(this,bo,Ra))Object.prototype.hasOwnProperty.call(mc,Ai)&&hc.push(mc[Ai]);return hc}charCategorizer(Ai){return makeCategorizer(this.languageDataAt("wordChars",Ai).join(""))}wordAt(Ai){let{text:bo,from:Ra,length:hc}=this.doc.lineAt(Ai),pc=this.charCategorizer(Ai),mc=Ai-Ra,uf=Ai-Ra;for(;mc>0;){let df=findClusterBreak(bo,mc,!1);if(pc(bo.slice(df,mc))!=CharCategory.Word)break;mc=df}for(;uf<hc;){let df=findClusterBreak(bo,uf);if(pc(bo.slice(uf,df))!=CharCategory.Word)break;uf=df}return mc==uf?null:EditorSelection.range(mc+Ra,uf+Ra)}}EditorState.allowMultipleSelections=allowMultipleSelections;EditorState.tabSize=Facet.define({combine:vo=>vo.length?vo[0]:4});EditorState.lineSeparator=lineSeparator;EditorState.readOnly=readOnly;EditorState.phrases=Facet.define({compare(vo,Ai){let bo=Object.keys(vo),Ra=Object.keys(Ai);return bo.length==Ra.length&&bo.every(hc=>vo[hc]==Ai[hc])}});EditorState.languageData=languageData;EditorState.changeFilter=changeFilter;EditorState.transactionFilter=transactionFilter;EditorState.transactionExtender=transactionExtender;Compartment.reconfigure=StateEffect.define();function combineConfig(vo,Ai,bo={}){let Ra={};for(let hc of vo)for(let pc of Object.keys(hc)){let mc=hc[pc],uf=Ra[pc];if(uf===void 0)Ra[pc]=mc;else if(!(uf===mc||mc===void 0))if(Object.hasOwnProperty.call(bo,pc))Ra[pc]=bo[pc](uf,mc);else throw new Error("Config merge conflict for field "+pc)}for(let hc in Ai)Ra[hc]===void 0&&(Ra[hc]=Ai[hc]);return Ra}class RangeValue{eq(Ai){return this==Ai}range(Ai,bo=Ai){return Range$3.create(Ai,bo,this)}}RangeValue.prototype.startSide=RangeValue.prototype.endSide=0;RangeValue.prototype.point=!1;RangeValue.prototype.mapMode=MapMode.TrackDel;let Range$3=class AT{constructor(Ai,bo,Ra){this.from=Ai,this.to=bo,this.value=Ra}static create(Ai,bo,Ra){return new AT(Ai,bo,Ra)}};function cmpRange(vo,Ai){return vo.from-Ai.from||vo.value.startSide-Ai.value.startSide}class Chunk{constructor(Ai,bo,Ra,hc){this.from=Ai,this.to=bo,this.value=Ra,this.maxPoint=hc}get length(){return this.to[this.to.length-1]}findIndex(Ai,bo,Ra,hc=0){let pc=Ra?this.to:this.from;for(let mc=hc,uf=pc.length;;){if(mc==uf)return mc;let df=mc+uf>>1,ff=pc[df]-Ai||(Ra?this.value[df].endSide:this.value[df].startSide)-bo;if(df==mc)return ff>=0?mc:uf;ff>=0?uf=df:mc=df+1}}between(Ai,bo,Ra,hc){for(let pc=this.findIndex(bo,-1e9,!0),mc=this.findIndex(Ra,1e9,!1,pc);pc<mc;pc++)if(hc(this.from[pc]+Ai,this.to[pc]+Ai,this.value[pc])===!1)return!1}map(Ai,bo){let Ra=[],hc=[],pc=[],mc=-1,uf=-1;for(let df=0;df<this.value.length;df++){let ff=this.value[df],hf=this.from[df]+Ai,pf=this.to[df]+Ai,mf,gf;if(hf==pf){let yf=bo.mapPos(hf,ff.startSide,ff.mapMode);if(yf==null||(mf=gf=yf,ff.startSide!=ff.endSide&&(gf=bo.mapPos(hf,ff.endSide),gf<mf)))continue}else if(mf=bo.mapPos(hf,ff.startSide),gf=bo.mapPos(pf,ff.endSide),mf>gf||mf==gf&&ff.startSide>0&&ff.endSide<=0)continue;(gf-mf||ff.endSide-ff.startSide)<0||(mc<0&&(mc=mf),ff.point&&(uf=Math.max(uf,gf-mf)),Ra.push(ff),hc.push(mf-mc),pc.push(gf-mc))}return{mapped:Ra.length?new Chunk(hc,pc,Ra,uf):null,pos:mc}}}class RangeSet{constructor(Ai,bo,Ra,hc){this.chunkPos=Ai,this.chunk=bo,this.nextLayer=Ra,this.maxPoint=hc}static create(Ai,bo,Ra,hc){return new RangeSet(Ai,bo,Ra,hc)}get length(){let Ai=this.chunk.length-1;return Ai<0?0:Math.max(this.chunkEnd(Ai),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let Ai=this.nextLayer.size;for(let bo of this.chunk)Ai+=bo.value.length;return Ai}chunkEnd(Ai){return this.chunkPos[Ai]+this.chunk[Ai].length}update(Ai){let{add:bo=[],sort:Ra=!1,filterFrom:hc=0,filterTo:pc=this.length}=Ai,mc=Ai.filter;if(bo.length==0&&!mc)return this;if(Ra&&(bo=bo.slice().sort(cmpRange)),this.isEmpty)return bo.length?RangeSet.of(bo):this;let uf=new LayerCursor(this,null,-1).goto(0),df=0,ff=[],hf=new RangeSetBuilder;for(;uf.value||df<bo.length;)if(df<bo.length&&(uf.from-bo[df].from||uf.startSide-bo[df].value.startSide)>=0){let pf=bo[df++];hf.addInner(pf.from,pf.to,pf.value)||ff.push(pf)}else uf.rangeIndex==1&&uf.chunkIndex<this.chunk.length&&(df==bo.length||this.chunkEnd(uf.chunkIndex)<bo[df].from)&&(!mc||hc>this.chunkEnd(uf.chunkIndex)||pc<this.chunkPos[uf.chunkIndex])&&hf.addChunk(this.chunkPos[uf.chunkIndex],this.chunk[uf.chunkIndex])?uf.nextChunk():((!mc||hc>uf.to||pc<uf.from||mc(uf.from,uf.to,uf.value))&&(hf.addInner(uf.from,uf.to,uf.value)||ff.push(Range$3.create(uf.from,uf.to,uf.value))),uf.next());return hf.finishInner(this.nextLayer.isEmpty&&!ff.length?RangeSet.empty:this.nextLayer.update({add:ff,filter:mc,filterFrom:hc,filterTo:pc}))}map(Ai){if(Ai.empty||this.isEmpty)return this;let bo=[],Ra=[],hc=-1;for(let mc=0;mc<this.chunk.length;mc++){let uf=this.chunkPos[mc],df=this.chunk[mc],ff=Ai.touchesRange(uf,uf+df.length);if(ff===!1)hc=Math.max(hc,df.maxPoint),bo.push(df),Ra.push(Ai.mapPos(uf));else if(ff===!0){let{mapped:hf,pos:pf}=df.map(uf,Ai);hf&&(hc=Math.max(hc,hf.maxPoint),bo.push(hf),Ra.push(pf))}}let pc=this.nextLayer.map(Ai);return bo.length==0?pc:new RangeSet(Ra,bo,pc||RangeSet.empty,hc)}between(Ai,bo,Ra){if(!this.isEmpty){for(let hc=0;hc<this.chunk.length;hc++){let pc=this.chunkPos[hc],mc=this.chunk[hc];if(bo>=pc&&Ai<=pc+mc.length&&mc.between(pc,Ai-pc,bo-pc,Ra)===!1)return}this.nextLayer.between(Ai,bo,Ra)}}iter(Ai=0){return HeapCursor.from([this]).goto(Ai)}get isEmpty(){return this.nextLayer==this}static iter(Ai,bo=0){return HeapCursor.from(Ai).goto(bo)}static compare(Ai,bo,Ra,hc,pc=-1){let mc=Ai.filter(pf=>pf.maxPoint>0||!pf.isEmpty&&pf.maxPoint>=pc),uf=bo.filter(pf=>pf.maxPoint>0||!pf.isEmpty&&pf.maxPoint>=pc),df=findSharedChunks(mc,uf,Ra),ff=new SpanCursor(mc,df,pc),hf=new SpanCursor(uf,df,pc);Ra.iterGaps((pf,mf,gf)=>compare(ff,pf,hf,mf,gf,hc)),Ra.empty&&Ra.length==0&&compare(ff,0,hf,0,0,hc)}static eq(Ai,bo,Ra=0,hc){hc==null&&(hc=999999999);let pc=Ai.filter(hf=>!hf.isEmpty&&bo.indexOf(hf)<0),mc=bo.filter(hf=>!hf.isEmpty&&Ai.indexOf(hf)<0);if(pc.length!=mc.length)return!1;if(!pc.length)return!0;let uf=findSharedChunks(pc,mc),df=new SpanCursor(pc,uf,0).goto(Ra),ff=new SpanCursor(mc,uf,0).goto(Ra);for(;;){if(df.to!=ff.to||!sameValues(df.active,ff.active)||df.point&&(!ff.point||!df.point.eq(ff.point)))return!1;if(df.to>hc)return!0;df.next(),ff.next()}}static spans(Ai,bo,Ra,hc,pc=-1){let mc=new SpanCursor(Ai,null,pc).goto(bo),uf=bo,df=mc.openStart;for(;;){let ff=Math.min(mc.to,Ra);if(mc.point){let hf=mc.activeForPoint(mc.to),pf=mc.pointFrom<bo?hf.length+1:mc.point.startSide<0?hf.length:Math.min(hf.length,df);hc.point(uf,ff,mc.point,hf,pf,mc.pointRank),df=Math.min(mc.openEnd(ff),hf.length)}else ff>uf&&(hc.span(uf,ff,mc.active,df),df=mc.openEnd(ff));if(mc.to>Ra)return df+(mc.point&&mc.to>Ra?1:0);uf=mc.to,mc.next()}}static of(Ai,bo=!1){let Ra=new RangeSetBuilder;for(let hc of Ai instanceof Range$3?[Ai]:bo?lazySort(Ai):Ai)Ra.add(hc.from,hc.to,hc.value);return Ra.finish()}static join(Ai){if(!Ai.length)return RangeSet.empty;let bo=Ai[Ai.length-1];for(let Ra=Ai.length-2;Ra>=0;Ra--)for(let hc=Ai[Ra];hc!=RangeSet.empty;hc=hc.nextLayer)bo=new RangeSet(hc.chunkPos,hc.chunk,bo,Math.max(hc.maxPoint,bo.maxPoint));return bo}}RangeSet.empty=new RangeSet([],[],null,-1);function lazySort(vo){if(vo.length>1)for(let Ai=vo[0],bo=1;bo<vo.length;bo++){let Ra=vo[bo];if(cmpRange(Ai,Ra)>0)return vo.slice().sort(cmpRange);Ai=Ra}return vo}RangeSet.empty.nextLayer=RangeSet.empty;class RangeSetBuilder{finishChunk(Ai){this.chunks.push(new Chunk(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,Ai&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(Ai,bo,Ra){this.addInner(Ai,bo,Ra)||(this.nextLayer||(this.nextLayer=new RangeSetBuilder)).add(Ai,bo,Ra)}addInner(Ai,bo,Ra){let hc=Ai-this.lastTo||Ra.startSide-this.last.endSide;if(hc<=0&&(Ai-this.lastFrom||Ra.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return hc<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=Ai),this.from.push(Ai-this.chunkStart),this.to.push(bo-this.chunkStart),this.last=Ra,this.lastFrom=Ai,this.lastTo=bo,this.value.push(Ra),Ra.point&&(this.maxPoint=Math.max(this.maxPoint,bo-Ai)),!0)}addChunk(Ai,bo){if((Ai-this.lastTo||bo.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,bo.maxPoint),this.chunks.push(bo),this.chunkPos.push(Ai);let Ra=bo.value.length-1;return this.last=bo.value[Ra],this.lastFrom=bo.from[Ra]+Ai,this.lastTo=bo.to[Ra]+Ai,!0}finish(){return this.finishInner(RangeSet.empty)}finishInner(Ai){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return Ai;let bo=RangeSet.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(Ai):Ai,this.setMaxPoint);return this.from=null,bo}}function findSharedChunks(vo,Ai,bo){let Ra=new Map;for(let pc of vo)for(let mc=0;mc<pc.chunk.length;mc++)pc.chunk[mc].maxPoint<=0&&Ra.set(pc.chunk[mc],pc.chunkPos[mc]);let hc=new Set;for(let pc of Ai)for(let mc=0;mc<pc.chunk.length;mc++){let uf=Ra.get(pc.chunk[mc]);uf!=null&&(bo?bo.mapPos(uf):uf)==pc.chunkPos[mc]&&!(bo!=null&&bo.touchesRange(uf,uf+pc.chunk[mc].length))&&hc.add(pc.chunk[mc])}return hc}class LayerCursor{constructor(Ai,bo,Ra,hc=0){this.layer=Ai,this.skip=bo,this.minPoint=Ra,this.rank=hc}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(Ai,bo=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(Ai,bo,!1),this}gotoInner(Ai,bo,Ra){for(;this.chunkIndex<this.layer.chunk.length;){let hc=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(hc)||this.layer.chunkEnd(this.chunkIndex)<Ai||hc.maxPoint<this.minPoint))break;this.chunkIndex++,Ra=!1}if(this.chunkIndex<this.layer.chunk.length){let hc=this.layer.chunk[this.chunkIndex].findIndex(Ai-this.layer.chunkPos[this.chunkIndex],bo,!0);(!Ra||this.rangeIndex<hc)&&this.setRangeIndex(hc)}this.next()}forward(Ai,bo){(this.to-Ai||this.endSide-bo)<0&&this.gotoInner(Ai,bo,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let Ai=this.layer.chunkPos[this.chunkIndex],bo=this.layer.chunk[this.chunkIndex],Ra=Ai+bo.from[this.rangeIndex];if(this.from=Ra,this.to=Ai+bo.to[this.rangeIndex],this.value=bo.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(Ai){if(Ai==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=Ai}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(Ai){return this.from-Ai.from||this.startSide-Ai.startSide||this.rank-Ai.rank||this.to-Ai.to||this.endSide-Ai.endSide}}class HeapCursor{constructor(Ai){this.heap=Ai}static from(Ai,bo=null,Ra=-1){let hc=[];for(let pc=0;pc<Ai.length;pc++)for(let mc=Ai[pc];!mc.isEmpty;mc=mc.nextLayer)mc.maxPoint>=Ra&&hc.push(new LayerCursor(mc,bo,Ra,pc));return hc.length==1?hc[0]:new HeapCursor(hc)}get startSide(){return this.value?this.value.startSide:0}goto(Ai,bo=-1e9){for(let Ra of this.heap)Ra.goto(Ai,bo);for(let Ra=this.heap.length>>1;Ra>=0;Ra--)heapBubble(this.heap,Ra);return this.next(),this}forward(Ai,bo){for(let Ra of this.heap)Ra.forward(Ai,bo);for(let Ra=this.heap.length>>1;Ra>=0;Ra--)heapBubble(this.heap,Ra);(this.to-Ai||this.value.endSide-bo)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let Ai=this.heap[0];this.from=Ai.from,this.to=Ai.to,this.value=Ai.value,this.rank=Ai.rank,Ai.value&&Ai.next(),heapBubble(this.heap,0)}}}function heapBubble(vo,Ai){for(let bo=vo[Ai];;){let Ra=(Ai<<1)+1;if(Ra>=vo.length)break;let hc=vo[Ra];if(Ra+1<vo.length&&hc.compare(vo[Ra+1])>=0&&(hc=vo[Ra+1],Ra++),bo.compare(hc)<0)break;vo[Ra]=bo,vo[Ai]=hc,Ai=Ra}}class SpanCursor{constructor(Ai,bo,Ra){this.minPoint=Ra,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=HeapCursor.from(Ai,bo,Ra)}goto(Ai,bo=-1e9){return this.cursor.goto(Ai,bo),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=Ai,this.endSide=bo,this.openStart=-1,this.next(),this}forward(Ai,bo){for(;this.minActive>-1&&(this.activeTo[this.minActive]-Ai||this.active[this.minActive].endSide-bo)<0;)this.removeActive(this.minActive);this.cursor.forward(Ai,bo)}removeActive(Ai){remove(this.active,Ai),remove(this.activeTo,Ai),remove(this.activeRank,Ai),this.minActive=findMinIndex(this.active,this.activeTo)}addActive(Ai){let bo=0,{value:Ra,to:hc,rank:pc}=this.cursor;for(;bo<this.activeRank.length&&(pc-this.activeRank[bo]||hc-this.activeTo[bo])>0;)bo++;insert(this.active,bo,Ra),insert(this.activeTo,bo,hc),insert(this.activeRank,bo,pc),Ai&&insert(Ai,bo,this.cursor.from),this.minActive=findMinIndex(this.active,this.activeTo)}next(){let Ai=this.to,bo=this.point;this.point=null;let Ra=this.openStart<0?[]:null;for(;;){let hc=this.minActive;if(hc>-1&&(this.activeTo[hc]-this.cursor.from||this.active[hc].endSide-this.cursor.startSide)<0){if(this.activeTo[hc]>Ai){this.to=this.activeTo[hc],this.endSide=this.active[hc].endSide;break}this.removeActive(hc),Ra&&remove(Ra,hc)}else if(this.cursor.value)if(this.cursor.from>Ai){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let pc=this.cursor.value;if(!pc.point)this.addActive(Ra),this.cursor.next();else if(bo&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=pc,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=pc.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(Ra){this.openStart=0;for(let hc=Ra.length-1;hc>=0&&Ra[hc]<Ai;hc--)this.openStart++}}activeForPoint(Ai){if(!this.active.length)return this.active;let bo=[];for(let Ra=this.active.length-1;Ra>=0&&!(this.activeRank[Ra]<this.pointRank);Ra--)(this.activeTo[Ra]>Ai||this.activeTo[Ra]==Ai&&this.active[Ra].endSide>=this.point.endSide)&&bo.push(this.active[Ra]);return bo.reverse()}openEnd(Ai){let bo=0;for(let Ra=this.activeTo.length-1;Ra>=0&&this.activeTo[Ra]>Ai;Ra--)bo++;return bo}}function compare(vo,Ai,bo,Ra,hc,pc){vo.goto(Ai),bo.goto(Ra);let mc=Ra+hc,uf=Ra,df=Ra-Ai;for(;;){let ff=vo.to+df-bo.to,hf=ff||vo.endSide-bo.endSide,pf=hf<0?vo.to+df:bo.to,mf=Math.min(pf,mc);if(vo.point||bo.point?vo.point&&bo.point&&(vo.point==bo.point||vo.point.eq(bo.point))&&sameValues(vo.activeForPoint(vo.to),bo.activeForPoint(bo.to))||pc.comparePoint(uf,mf,vo.point,bo.point):mf>uf&&!sameValues(vo.active,bo.active)&&pc.compareRange(uf,mf,vo.active,bo.active),pf>mc)break;(ff||vo.openEnd!=bo.openEnd)&&pc.boundChange&&pc.boundChange(pf),uf=pf,hf<=0&&vo.next(),hf>=0&&bo.next()}}function sameValues(vo,Ai){if(vo.length!=Ai.length)return!1;for(let bo=0;bo<vo.length;bo++)if(vo[bo]!=Ai[bo]&&!vo[bo].eq(Ai[bo]))return!1;return!0}function remove(vo,Ai){for(let bo=Ai,Ra=vo.length-1;bo<Ra;bo++)vo[bo]=vo[bo+1];vo.pop()}function insert(vo,Ai,bo){for(let Ra=vo.length-1;Ra>=Ai;Ra--)vo[Ra+1]=vo[Ra];vo[Ai]=bo}function findMinIndex(vo,Ai){let bo=-1,Ra=1e9;for(let hc=0;hc<Ai.length;hc++)(Ai[hc]-Ra||vo[hc].endSide-vo[bo].endSide)<0&&(bo=hc,Ra=Ai[hc]);return bo}function countColumn(vo,Ai,bo=vo.length){let Ra=0;for(let hc=0;hc<bo;)vo.charCodeAt(hc)==9?(Ra+=Ai-Ra%Ai,hc++):(Ra++,hc=findClusterBreak(vo,hc));return Ra}function findColumn(vo,Ai,bo,Ra){for(let hc=0,pc=0;;){if(pc>=Ai)return hc;if(hc==vo.length)break;pc+=vo.charCodeAt(hc)==9?bo-pc%bo:1,hc=findClusterBreak(vo,hc)}return Ra===!0?-1:vo.length}const C="ͼ",COUNT=typeof Symbol>"u"?"__"+C:Symbol.for(C),SET=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),top=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class StyleModule{constructor(Ai,bo){this.rules=[];let{finish:Ra}=bo||{};function hc(mc){return/^@/.test(mc)?[mc]:mc.split(/,\s*/)}function pc(mc,uf,df,ff){let hf=[],pf=/^@(\w+)\b/.exec(mc[0]),mf=pf&&pf[1]=="keyframes";if(pf&&uf==null)return df.push(mc[0]+";");for(let gf in uf){let yf=uf[gf];if(/&/.test(gf))pc(gf.split(/,\s*/).map(vf=>mc.map(bf=>vf.replace(/&/,bf))).reduce((vf,bf)=>vf.concat(bf)),yf,df);else if(yf&&typeof yf=="object"){if(!pf)throw new RangeError("The value of a property ("+gf+") should be a primitive value.");pc(hc(gf),yf,hf,mf)}else yf!=null&&hf.push(gf.replace(/_.*/,"").replace(/[A-Z]/g,vf=>"-"+vf.toLowerCase())+": "+yf+";")}(hf.length||mf)&&df.push((Ra&&!pf&&!ff?mc.map(Ra):mc).join(", ")+" {"+hf.join(" ")+"}")}for(let mc in Ai)pc(hc(mc),Ai[mc],this.rules)}getRules(){return this.rules.join(`
|
|
351
|
-
`)}static newName(){let Ai=top[COUNT]||1;return top[COUNT]=Ai+1,C+Ai.toString(36)}static mount(Ai,bo,Ra){let hc=Ai[SET],pc=Ra&&Ra.nonce;hc?pc&&hc.setNonce(pc):hc=new StyleSet(Ai,pc),hc.mount(Array.isArray(bo)?bo:[bo],Ai)}}let adoptedSet=new Map;class StyleSet{constructor(Ai,bo){let Ra=Ai.ownerDocument||Ai,hc=Ra.defaultView;if(!Ai.head&&Ai.adoptedStyleSheets&&hc.CSSStyleSheet){let pc=adoptedSet.get(Ra);if(pc)return Ai[SET]=pc;this.sheet=new hc.CSSStyleSheet,adoptedSet.set(Ra,this)}else this.styleTag=Ra.createElement("style"),bo&&this.styleTag.setAttribute("nonce",bo);this.modules=[],Ai[SET]=this}mount(Ai,bo){let Ra=this.sheet,hc=0,pc=0;for(let mc=0;mc<Ai.length;mc++){let uf=Ai[mc],df=this.modules.indexOf(uf);if(df<pc&&df>-1&&(this.modules.splice(df,1),pc--,df=-1),df==-1){if(this.modules.splice(pc++,0,uf),Ra)for(let ff=0;ff<uf.rules.length;ff++)Ra.insertRule(uf.rules[ff],hc++)}else{for(;pc<df;)hc+=this.modules[pc++].rules.length;hc+=uf.rules.length,pc++}}if(Ra)bo.adoptedStyleSheets.indexOf(this.sheet)<0&&(bo.adoptedStyleSheets=[this.sheet,...bo.adoptedStyleSheets]);else{let mc="";for(let df=0;df<this.modules.length;df++)mc+=this.modules[df].getRules()+`
|
|
352
|
-
`;this.styleTag.textContent=mc;let uf=bo.head||bo;this.styleTag.parentNode!=uf&&uf.insertBefore(this.styleTag,uf.firstChild)}}setNonce(Ai){this.styleTag&&this.styleTag.getAttribute("nonce")!=Ai&&this.styleTag.setAttribute("nonce",Ai)}}var base={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},shift={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},mac=typeof navigator<"u"&&/Mac/.test(navigator.platform),ie$1=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var i$5=0;i$5<10;i$5++)base[48+i$5]=base[96+i$5]=String(i$5);for(var i$5=1;i$5<=24;i$5++)base[i$5+111]="F"+i$5;for(var i$5=65;i$5<=90;i$5++)base[i$5]=String.fromCharCode(i$5+32),shift[i$5]=String.fromCharCode(i$5);for(var code in base)shift.hasOwnProperty(code)||(shift[code]=base[code]);function keyName(vo){var Ai=mac&&vo.metaKey&&vo.shiftKey&&!vo.ctrlKey&&!vo.altKey||ie$1&&vo.shiftKey&&vo.key&&vo.key.length==1||vo.key=="Unidentified",bo=!Ai&&vo.key||(vo.shiftKey?shift:base)[vo.keyCode]||vo.key||"Unidentified";return bo=="Esc"&&(bo="Escape"),bo=="Del"&&(bo="Delete"),bo=="Left"&&(bo="ArrowLeft"),bo=="Up"&&(bo="ArrowUp"),bo=="Right"&&(bo="ArrowRight"),bo=="Down"&&(bo="ArrowDown"),bo}function getSelection(vo){let Ai;return vo.nodeType==11?Ai=vo.getSelection?vo:vo.ownerDocument:Ai=vo,Ai.getSelection()}function contains(vo,Ai){return Ai?vo==Ai||vo.contains(Ai.nodeType!=1?Ai.parentNode:Ai):!1}function hasSelection(vo,Ai){if(!Ai.anchorNode)return!1;try{return contains(vo,Ai.anchorNode)}catch{return!1}}function clientRectsFor(vo){return vo.nodeType==3?textRange(vo,0,vo.nodeValue.length).getClientRects():vo.nodeType==1?vo.getClientRects():[]}function isEquivalentPosition(vo,Ai,bo,Ra){return bo?scanFor(vo,Ai,bo,Ra,-1)||scanFor(vo,Ai,bo,Ra,1):!1}function domIndex(vo){for(var Ai=0;;Ai++)if(vo=vo.previousSibling,!vo)return Ai}function isBlockElement(vo){return vo.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(vo.nodeName)}function scanFor(vo,Ai,bo,Ra,hc){for(;;){if(vo==bo&&Ai==Ra)return!0;if(Ai==(hc<0?0:maxOffset(vo))){if(vo.nodeName=="DIV")return!1;let pc=vo.parentNode;if(!pc||pc.nodeType!=1)return!1;Ai=domIndex(vo)+(hc<0?0:1),vo=pc}else if(vo.nodeType==1){if(vo=vo.childNodes[Ai+(hc<0?-1:0)],vo.nodeType==1&&vo.contentEditable=="false")return!1;Ai=hc<0?maxOffset(vo):0}else return!1}}function maxOffset(vo){return vo.nodeType==3?vo.nodeValue.length:vo.childNodes.length}function flattenRect(vo,Ai){let bo=Ai?vo.left:vo.right;return{left:bo,right:bo,top:vo.top,bottom:vo.bottom}}function windowRect(vo){let Ai=vo.visualViewport;return Ai?{left:0,right:Ai.width,top:0,bottom:Ai.height}:{left:0,right:vo.innerWidth,top:0,bottom:vo.innerHeight}}function getScale(vo,Ai){let bo=Ai.width/vo.offsetWidth,Ra=Ai.height/vo.offsetHeight;return(bo>.995&&bo<1.005||!isFinite(bo)||Math.abs(Ai.width-vo.offsetWidth)<1)&&(bo=1),(Ra>.995&&Ra<1.005||!isFinite(Ra)||Math.abs(Ai.height-vo.offsetHeight)<1)&&(Ra=1),{scaleX:bo,scaleY:Ra}}function scrollRectIntoView(vo,Ai,bo,Ra,hc,pc,mc,uf){let df=vo.ownerDocument,ff=df.defaultView||window;for(let hf=vo,pf=!1;hf&&!pf;)if(hf.nodeType==1){let mf,gf=hf==df.body,yf=1,vf=1;if(gf)mf=windowRect(ff);else{if(/^(fixed|sticky)$/.test(getComputedStyle(hf).position)&&(pf=!0),hf.scrollHeight<=hf.clientHeight&&hf.scrollWidth<=hf.clientWidth){hf=hf.assignedSlot||hf.parentNode;continue}let xf=hf.getBoundingClientRect();({scaleX:yf,scaleY:vf}=getScale(hf,xf)),mf={left:xf.left,right:xf.left+hf.clientWidth*yf,top:xf.top,bottom:xf.top+hf.clientHeight*vf}}let bf=0,Sf=0;if(hc=="nearest")Ai.top<mf.top?(Sf=-(mf.top-Ai.top+mc),bo>0&&Ai.bottom>mf.bottom+Sf&&(Sf=Ai.bottom-mf.bottom+Sf+mc)):Ai.bottom>mf.bottom&&(Sf=Ai.bottom-mf.bottom+mc,bo<0&&Ai.top-Sf<mf.top&&(Sf=-(mf.top+Sf-Ai.top+mc)));else{let xf=Ai.bottom-Ai.top,wf=mf.bottom-mf.top;Sf=(hc=="center"&&xf<=wf?Ai.top+xf/2-wf/2:hc=="start"||hc=="center"&&bo<0?Ai.top-mc:Ai.bottom-wf+mc)-mf.top}if(Ra=="nearest"?Ai.left<mf.left?(bf=-(mf.left-Ai.left+pc),bo>0&&Ai.right>mf.right+bf&&(bf=Ai.right-mf.right+bf+pc)):Ai.right>mf.right&&(bf=Ai.right-mf.right+pc,bo<0&&Ai.left<mf.left+bf&&(bf=-(mf.left+bf-Ai.left+pc))):bf=(Ra=="center"?Ai.left+(Ai.right-Ai.left)/2-(mf.right-mf.left)/2:Ra=="start"==uf?Ai.left-pc:Ai.right-(mf.right-mf.left)+pc)-mf.left,bf||Sf)if(gf)ff.scrollBy(bf,Sf);else{let xf=0,wf=0;if(Sf){let s1=hf.scrollTop;hf.scrollTop+=Sf/vf,wf=(hf.scrollTop-s1)*vf}if(bf){let s1=hf.scrollLeft;hf.scrollLeft+=bf/yf,xf=(hf.scrollLeft-s1)*yf}Ai={left:Ai.left-xf,top:Ai.top-wf,right:Ai.right-xf,bottom:Ai.bottom-wf},xf&&Math.abs(xf-bf)<1&&(Ra="nearest"),wf&&Math.abs(wf-Sf)<1&&(hc="nearest")}if(gf)break;hf=hf.assignedSlot||hf.parentNode}else if(hf.nodeType==11)hf=hf.host;else break}function scrollableParents(vo){let Ai=vo.ownerDocument,bo,Ra;for(let hc=vo.parentNode;hc&&!(hc==Ai.body||bo&&Ra);)if(hc.nodeType==1)!Ra&&hc.scrollHeight>hc.clientHeight&&(Ra=hc),!bo&&hc.scrollWidth>hc.clientWidth&&(bo=hc),hc=hc.assignedSlot||hc.parentNode;else if(hc.nodeType==11)hc=hc.host;else break;return{x:bo,y:Ra}}class DOMSelectionState{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(Ai){return this.anchorNode==Ai.anchorNode&&this.anchorOffset==Ai.anchorOffset&&this.focusNode==Ai.focusNode&&this.focusOffset==Ai.focusOffset}setRange(Ai){let{anchorNode:bo,focusNode:Ra}=Ai;this.set(bo,Math.min(Ai.anchorOffset,bo?maxOffset(bo):0),Ra,Math.min(Ai.focusOffset,Ra?maxOffset(Ra):0))}set(Ai,bo,Ra,hc){this.anchorNode=Ai,this.anchorOffset=bo,this.focusNode=Ra,this.focusOffset=hc}}let preventScrollSupported=null;function focusPreventScroll(vo){if(vo.setActive)return vo.setActive();if(preventScrollSupported)return vo.focus(preventScrollSupported);let Ai=[];for(let bo=vo;bo&&(Ai.push(bo,bo.scrollTop,bo.scrollLeft),bo!=bo.ownerDocument);bo=bo.parentNode);if(vo.focus(preventScrollSupported==null?{get preventScroll(){return preventScrollSupported={preventScroll:!0},!0}}:void 0),!preventScrollSupported){preventScrollSupported=!1;for(let bo=0;bo<Ai.length;){let Ra=Ai[bo++],hc=Ai[bo++],pc=Ai[bo++];Ra.scrollTop!=hc&&(Ra.scrollTop=hc),Ra.scrollLeft!=pc&&(Ra.scrollLeft=pc)}}}let scratchRange;function textRange(vo,Ai,bo=Ai){let Ra=scratchRange||(scratchRange=document.createRange());return Ra.setEnd(vo,bo),Ra.setStart(vo,Ai),Ra}function dispatchKey(vo,Ai,bo,Ra){let hc={key:Ai,code:Ai,keyCode:bo,which:bo,cancelable:!0};Ra&&({altKey:hc.altKey,ctrlKey:hc.ctrlKey,shiftKey:hc.shiftKey,metaKey:hc.metaKey}=Ra);let pc=new KeyboardEvent("keydown",hc);pc.synthetic=!0,vo.dispatchEvent(pc);let mc=new KeyboardEvent("keyup",hc);return mc.synthetic=!0,vo.dispatchEvent(mc),pc.defaultPrevented||mc.defaultPrevented}function getRoot(vo){for(;vo;){if(vo&&(vo.nodeType==9||vo.nodeType==11&&vo.host))return vo;vo=vo.assignedSlot||vo.parentNode}return null}function clearAttributes(vo){for(;vo.attributes.length;)vo.removeAttributeNode(vo.attributes[0])}function atElementStart(vo,Ai){let bo=Ai.focusNode,Ra=Ai.focusOffset;if(!bo||Ai.anchorNode!=bo||Ai.anchorOffset!=Ra)return!1;for(Ra=Math.min(Ra,maxOffset(bo));;)if(Ra){if(bo.nodeType!=1)return!1;let hc=bo.childNodes[Ra-1];hc.contentEditable=="false"?Ra--:(bo=hc,Ra=maxOffset(bo))}else{if(bo==vo)return!0;Ra=domIndex(bo),bo=bo.parentNode}}function isScrolledToBottom(vo){return vo.scrollTop>Math.max(1,vo.scrollHeight-vo.clientHeight-4)}function textNodeBefore(vo,Ai){for(let bo=vo,Ra=Ai;;){if(bo.nodeType==3&&Ra>0)return{node:bo,offset:Ra};if(bo.nodeType==1&&Ra>0){if(bo.contentEditable=="false")return null;bo=bo.childNodes[Ra-1],Ra=maxOffset(bo)}else if(bo.parentNode&&!isBlockElement(bo))Ra=domIndex(bo),bo=bo.parentNode;else return null}}function textNodeAfter(vo,Ai){for(let bo=vo,Ra=Ai;;){if(bo.nodeType==3&&Ra<bo.nodeValue.length)return{node:bo,offset:Ra};if(bo.nodeType==1&&Ra<bo.childNodes.length){if(bo.contentEditable=="false")return null;bo=bo.childNodes[Ra],Ra=0}else if(bo.parentNode&&!isBlockElement(bo))Ra=domIndex(bo)+1,bo=bo.parentNode;else return null}}class DOMPos{constructor(Ai,bo,Ra=!0){this.node=Ai,this.offset=bo,this.precise=Ra}static before(Ai,bo){return new DOMPos(Ai.parentNode,domIndex(Ai),bo)}static after(Ai,bo){return new DOMPos(Ai.parentNode,domIndex(Ai)+1,bo)}}const noChildren=[];class ContentView{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(Ai){let bo=this.posAtStart;for(let Ra of this.children){if(Ra==Ai)return bo;bo+=Ra.length+Ra.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(Ai){return this.posBefore(Ai)+Ai.length}sync(Ai,bo){if(this.flags&2){let Ra=this.dom,hc=null,pc;for(let mc of this.children){if(mc.flags&7){if(!mc.dom&&(pc=hc?hc.nextSibling:Ra.firstChild)){let uf=ContentView.get(pc);(!uf||!uf.parent&&uf.canReuseDOM(mc))&&mc.reuseDOM(pc)}mc.sync(Ai,bo),mc.flags&=-8}if(pc=hc?hc.nextSibling:Ra.firstChild,bo&&!bo.written&&bo.node==Ra&&pc!=mc.dom&&(bo.written=!0),mc.dom.parentNode==Ra)for(;pc&&pc!=mc.dom;)pc=rm$1(pc);else Ra.insertBefore(mc.dom,pc);hc=mc.dom}for(pc=hc?hc.nextSibling:Ra.firstChild,pc&&bo&&bo.node==Ra&&(bo.written=!0);pc;)pc=rm$1(pc)}else if(this.flags&1)for(let Ra of this.children)Ra.flags&7&&(Ra.sync(Ai,bo),Ra.flags&=-8)}reuseDOM(Ai){}localPosFromDOM(Ai,bo){let Ra;if(Ai==this.dom)Ra=this.dom.childNodes[bo];else{let hc=maxOffset(Ai)==0?0:bo==0?-1:1;for(;;){let pc=Ai.parentNode;if(pc==this.dom)break;hc==0&&pc.firstChild!=pc.lastChild&&(Ai==pc.firstChild?hc=-1:hc=1),Ai=pc}hc<0?Ra=Ai:Ra=Ai.nextSibling}if(Ra==this.dom.firstChild)return 0;for(;Ra&&!ContentView.get(Ra);)Ra=Ra.nextSibling;if(!Ra)return this.length;for(let hc=0,pc=0;;hc++){let mc=this.children[hc];if(mc.dom==Ra)return pc;pc+=mc.length+mc.breakAfter}}domBoundsAround(Ai,bo,Ra=0){let hc=-1,pc=-1,mc=-1,uf=-1;for(let df=0,ff=Ra,hf=Ra;df<this.children.length;df++){let pf=this.children[df],mf=ff+pf.length;if(ff<Ai&&mf>bo)return pf.domBoundsAround(Ai,bo,ff);if(mf>=Ai&&hc==-1&&(hc=df,pc=ff),ff>bo&&pf.dom.parentNode==this.dom){mc=df,uf=hf;break}hf=mf,ff=mf+pf.breakAfter}return{from:pc,to:uf<0?Ra+this.length:uf,startDOM:(hc?this.children[hc-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:mc<this.children.length&&mc>=0?this.children[mc].dom:null}}markDirty(Ai=!1){this.flags|=2,this.markParentsDirty(Ai)}markParentsDirty(Ai){for(let bo=this.parent;bo;bo=bo.parent){if(Ai&&(bo.flags|=2),bo.flags&1)return;bo.flags|=1,Ai=!1}}setParent(Ai){this.parent!=Ai&&(this.parent=Ai,this.flags&7&&this.markParentsDirty(!0))}setDOM(Ai){this.dom!=Ai&&(this.dom&&(this.dom.cmView=null),this.dom=Ai,Ai.cmView=this)}get rootView(){for(let Ai=this;;){let bo=Ai.parent;if(!bo)return Ai;Ai=bo}}replaceChildren(Ai,bo,Ra=noChildren){this.markDirty();for(let hc=Ai;hc<bo;hc++){let pc=this.children[hc];pc.parent==this&&Ra.indexOf(pc)<0&&pc.destroy()}Ra.length<250?this.children.splice(Ai,bo-Ai,...Ra):this.children=[].concat(this.children.slice(0,Ai),Ra,this.children.slice(bo));for(let hc=0;hc<Ra.length;hc++)Ra[hc].setParent(this)}ignoreMutation(Ai){return!1}ignoreEvent(Ai){return!1}childCursor(Ai=this.length){return new ChildCursor(this.children,Ai,this.children.length)}childPos(Ai,bo=1){return this.childCursor().findPos(Ai,bo)}toString(){let Ai=this.constructor.name.replace("View","");return Ai+(this.children.length?"("+this.children.join()+")":this.length?"["+(Ai=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(Ai){return Ai.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(Ai,bo,Ra,hc,pc,mc){return!1}become(Ai){return!1}canReuseDOM(Ai){return Ai.constructor==this.constructor&&!((this.flags|Ai.flags)&8)}getSide(){return 0}destroy(){for(let Ai of this.children)Ai.parent==this&&Ai.destroy();this.parent=null}}ContentView.prototype.breakAfter=0;function rm$1(vo){let Ai=vo.nextSibling;return vo.parentNode.removeChild(vo),Ai}class ChildCursor{constructor(Ai,bo,Ra){this.children=Ai,this.pos=bo,this.i=Ra,this.off=0}findPos(Ai,bo=1){for(;;){if(Ai>this.pos||Ai==this.pos&&(bo>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=Ai-this.pos,this;let Ra=this.children[--this.i];this.pos-=Ra.length+Ra.breakAfter}}}function replaceRange(vo,Ai,bo,Ra,hc,pc,mc,uf,df){let{children:ff}=vo,hf=ff.length?ff[Ai]:null,pf=pc.length?pc[pc.length-1]:null,mf=pf?pf.breakAfter:mc;if(!(Ai==Ra&&hf&&!mc&&!mf&&pc.length<2&&hf.merge(bo,hc,pc.length?pf:null,bo==0,uf,df))){if(Ra<ff.length){let gf=ff[Ra];gf&&(hc<gf.length||gf.breakAfter&&pf!=null&&pf.breakAfter)?(Ai==Ra&&(gf=gf.split(hc),hc=0),!mf&&pf&&gf.merge(0,hc,pf,!0,0,df)?pc[pc.length-1]=gf:((hc||gf.children.length&&!gf.children[0].length)&&gf.merge(0,hc,null,!1,0,df),pc.push(gf))):gf!=null&&gf.breakAfter&&(pf?pf.breakAfter=1:mc=1),Ra++}for(hf&&(hf.breakAfter=mc,bo>0&&(!mc&&pc.length&&hf.merge(bo,hf.length,pc[0],!1,uf,0)?hf.breakAfter=pc.shift().breakAfter:(bo<hf.length||hf.children.length&&hf.children[hf.children.length-1].length==0)&&hf.merge(bo,hf.length,null,!1,uf,0),Ai++));Ai<Ra&&pc.length;)if(ff[Ra-1].become(pc[pc.length-1]))Ra--,pc.pop(),df=pc.length?0:uf;else if(ff[Ai].become(pc[0]))Ai++,pc.shift(),uf=pc.length?0:df;else break;!pc.length&&Ai&&Ra<ff.length&&!ff[Ai-1].breakAfter&&ff[Ra].merge(0,0,ff[Ai-1],!1,uf,df)&&Ai--,(Ai<Ra||pc.length)&&vo.replaceChildren(Ai,Ra,pc)}}function mergeChildrenInto(vo,Ai,bo,Ra,hc,pc){let mc=vo.childCursor(),{i:uf,off:df}=mc.findPos(bo,1),{i:ff,off:hf}=mc.findPos(Ai,-1),pf=Ai-bo;for(let mf of Ra)pf+=mf.length;vo.length+=pf,replaceRange(vo,ff,hf,uf,df,Ra,0,hc,pc)}let nav=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},doc=typeof document<"u"?document:{documentElement:{style:{}}};const ie_edge=/Edge\/(\d+)/.exec(nav.userAgent),ie_upto10=/MSIE \d/.test(nav.userAgent),ie_11up=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(nav.userAgent),ie=!!(ie_upto10||ie_11up||ie_edge),gecko=!ie&&/gecko\/(\d+)/i.test(nav.userAgent),chrome=!ie&&/Chrome\/(\d+)/.exec(nav.userAgent),webkit="webkitFontSmoothing"in doc.documentElement.style,safari=!ie&&/Apple Computer/.test(nav.vendor),ios=safari&&(/Mobile\/\w+/.test(nav.userAgent)||nav.maxTouchPoints>2);var browser={mac:ios||/Mac/.test(nav.platform),windows:/Win/.test(nav.platform),linux:/Linux|X11/.test(nav.platform),ie,ie_version:ie_upto10?doc.documentMode||6:ie_11up?+ie_11up[1]:ie_edge?+ie_edge[1]:0,gecko,gecko_version:gecko?+(/Firefox\/(\d+)/.exec(nav.userAgent)||[0,0])[1]:0,chrome:!!chrome,chrome_version:chrome?+chrome[1]:0,ios,android:/Android\b/.test(nav.userAgent),webkit,safari,webkit_version:webkit?+(/\bAppleWebKit\/(\d+)/.exec(nav.userAgent)||[0,0])[1]:0,tabSize:doc.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const MaxJoinLen=256;class TextView extends ContentView{constructor(Ai){super(),this.text=Ai}get length(){return this.text.length}createDOM(Ai){this.setDOM(Ai||document.createTextNode(this.text))}sync(Ai,bo){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(bo&&bo.node==this.dom&&(bo.written=!0),this.dom.nodeValue=this.text)}reuseDOM(Ai){Ai.nodeType==3&&this.createDOM(Ai)}merge(Ai,bo,Ra){return this.flags&8||Ra&&(!(Ra instanceof TextView)||this.length-(bo-Ai)+Ra.length>MaxJoinLen||Ra.flags&8)?!1:(this.text=this.text.slice(0,Ai)+(Ra?Ra.text:"")+this.text.slice(bo),this.markDirty(),!0)}split(Ai){let bo=new TextView(this.text.slice(Ai));return this.text=this.text.slice(0,Ai),this.markDirty(),bo.flags|=this.flags&8,bo}localPosFromDOM(Ai,bo){return Ai==this.dom?bo:bo?this.text.length:0}domAtPos(Ai){return new DOMPos(this.dom,Ai)}domBoundsAround(Ai,bo,Ra){return{from:Ra,to:Ra+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(Ai,bo){return textCoords(this.dom,Ai,bo)}}class MarkView extends ContentView{constructor(Ai,bo=[],Ra=0){super(),this.mark=Ai,this.children=bo,this.length=Ra;for(let hc of bo)hc.setParent(this)}setAttrs(Ai){if(clearAttributes(Ai),this.mark.class&&(Ai.className=this.mark.class),this.mark.attrs)for(let bo in this.mark.attrs)Ai.setAttribute(bo,this.mark.attrs[bo]);return Ai}canReuseDOM(Ai){return super.canReuseDOM(Ai)&&!((this.flags|Ai.flags)&8)}reuseDOM(Ai){Ai.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(Ai),this.flags|=6)}sync(Ai,bo){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(Ai,bo)}merge(Ai,bo,Ra,hc,pc,mc){return Ra&&(!(Ra instanceof MarkView&&Ra.mark.eq(this.mark))||Ai&&pc<=0||bo<this.length&&mc<=0)?!1:(mergeChildrenInto(this,Ai,bo,Ra?Ra.children.slice():[],pc-1,mc-1),this.markDirty(),!0)}split(Ai){let bo=[],Ra=0,hc=-1,pc=0;for(let uf of this.children){let df=Ra+uf.length;df>Ai&&bo.push(Ra<Ai?uf.split(Ai-Ra):uf),hc<0&&Ra>=Ai&&(hc=pc),Ra=df,pc++}let mc=this.length-Ai;return this.length=Ai,hc>-1&&(this.children.length=hc,this.markDirty()),new MarkView(this.mark,bo,mc)}domAtPos(Ai){return inlineDOMAtPos(this,Ai)}coordsAt(Ai,bo){return coordsInChildren(this,Ai,bo)}}function textCoords(vo,Ai,bo){let Ra=vo.nodeValue.length;Ai>Ra&&(Ai=Ra);let hc=Ai,pc=Ai,mc=0;Ai==0&&bo<0||Ai==Ra&&bo>=0?browser.chrome||browser.gecko||(Ai?(hc--,mc=1):pc<Ra&&(pc++,mc=-1)):bo<0?hc--:pc<Ra&&pc++;let uf=textRange(vo,hc,pc).getClientRects();if(!uf.length)return null;let df=uf[(mc?mc<0:bo>=0)?0:uf.length-1];return browser.safari&&!mc&&df.width==0&&(df=Array.prototype.find.call(uf,ff=>ff.width)||df),mc?flattenRect(df,mc<0):df||null}class WidgetView extends ContentView{static create(Ai,bo,Ra){return new WidgetView(Ai,bo,Ra)}constructor(Ai,bo,Ra){super(),this.widget=Ai,this.length=bo,this.side=Ra,this.prevWidget=null}split(Ai){let bo=WidgetView.create(this.widget,this.length-Ai,this.side);return this.length-=Ai,bo}sync(Ai){(!this.dom||!this.widget.updateDOM(this.dom,Ai))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(Ai)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(Ai,bo,Ra,hc,pc,mc){return Ra&&(!(Ra instanceof WidgetView)||!this.widget.compare(Ra.widget)||Ai>0&&pc<=0||bo<this.length&&mc<=0)?!1:(this.length=Ai+(Ra?Ra.length:0)+(this.length-bo),!0)}become(Ai){return Ai instanceof WidgetView&&Ai.side==this.side&&this.widget.constructor==Ai.widget.constructor?(this.widget.compare(Ai.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=Ai.widget,this.length=Ai.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(Ai){return this.widget.ignoreEvent(Ai)}get overrideDOMText(){if(this.length==0)return Text.empty;let Ai=this;for(;Ai.parent;)Ai=Ai.parent;let{view:bo}=Ai,Ra=bo&&bo.state.doc,hc=this.posAtStart;return Ra?Ra.slice(hc,hc+this.length):Text.empty}domAtPos(Ai){return(this.length?Ai==0:this.side>0)?DOMPos.before(this.dom):DOMPos.after(this.dom,Ai==this.length)}domBoundsAround(){return null}coordsAt(Ai,bo){let Ra=this.widget.coordsAt(this.dom,Ai,bo);if(Ra)return Ra;let hc=this.dom.getClientRects(),pc=null;if(!hc.length)return null;let mc=this.side?this.side<0:Ai>0;for(let uf=mc?hc.length-1:0;pc=hc[uf],!(Ai>0?uf==0:uf==hc.length-1||pc.top<pc.bottom);uf+=mc?-1:1);return flattenRect(pc,!mc)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class WidgetBufferView extends ContentView{constructor(Ai){super(),this.side=Ai}get length(){return 0}merge(){return!1}become(Ai){return Ai instanceof WidgetBufferView&&Ai.side==this.side}split(){return new WidgetBufferView(this.side)}sync(){if(!this.dom){let Ai=document.createElement("img");Ai.className="cm-widgetBuffer",Ai.setAttribute("aria-hidden","true"),this.setDOM(Ai)}}getSide(){return this.side}domAtPos(Ai){return this.side>0?DOMPos.before(this.dom):DOMPos.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(Ai){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Text.empty}get isHidden(){return!0}}TextView.prototype.children=WidgetView.prototype.children=WidgetBufferView.prototype.children=noChildren;function inlineDOMAtPos(vo,Ai){let bo=vo.dom,{children:Ra}=vo,hc=0;for(let pc=0;hc<Ra.length;hc++){let mc=Ra[hc],uf=pc+mc.length;if(!(uf==pc&&mc.getSide()<=0)){if(Ai>pc&&Ai<uf&&mc.dom.parentNode==bo)return mc.domAtPos(Ai-pc);if(Ai<=pc)break;pc=uf}}for(let pc=hc;pc>0;pc--){let mc=Ra[pc-1];if(mc.dom.parentNode==bo)return mc.domAtPos(mc.length)}for(let pc=hc;pc<Ra.length;pc++){let mc=Ra[pc];if(mc.dom.parentNode==bo)return mc.domAtPos(0)}return new DOMPos(bo,0)}function joinInlineInto(vo,Ai,bo){let Ra,{children:hc}=vo;bo>0&&Ai instanceof MarkView&&hc.length&&(Ra=hc[hc.length-1])instanceof MarkView&&Ra.mark.eq(Ai.mark)?joinInlineInto(Ra,Ai.children[0],bo-1):(hc.push(Ai),Ai.setParent(vo)),vo.length+=Ai.length}function coordsInChildren(vo,Ai,bo){let Ra=null,hc=-1,pc=null,mc=-1;function uf(ff,hf){for(let pf=0,mf=0;pf<ff.children.length&&mf<=hf;pf++){let gf=ff.children[pf],yf=mf+gf.length;yf>=hf&&(gf.children.length?uf(gf,hf-mf):(!pc||pc.isHidden&&bo>0)&&(yf>hf||mf==yf&&gf.getSide()>0)?(pc=gf,mc=hf-mf):(mf<hf||mf==yf&&gf.getSide()<0&&!gf.isHidden)&&(Ra=gf,hc=hf-mf)),mf=yf}}uf(vo,Ai);let df=(bo<0?Ra:pc)||Ra||pc;return df?df.coordsAt(Math.max(0,df==Ra?hc:mc),bo):fallbackRect(vo)}function fallbackRect(vo){let Ai=vo.dom.lastChild;if(!Ai)return vo.dom.getBoundingClientRect();let bo=clientRectsFor(Ai);return bo[bo.length-1]||null}function combineAttrs(vo,Ai){for(let bo in vo)bo=="class"&&Ai.class?Ai.class+=" "+vo.class:bo=="style"&&Ai.style?Ai.style+=";"+vo.style:Ai[bo]=vo[bo];return Ai}const noAttrs$1=Object.create(null);function attrsEq(vo,Ai,bo){if(vo==Ai)return!0;vo||(vo=noAttrs$1),Ai||(Ai=noAttrs$1);let Ra=Object.keys(vo),hc=Object.keys(Ai);if(Ra.length-(bo&&Ra.indexOf(bo)>-1?1:0)!=hc.length-(bo&&hc.indexOf(bo)>-1?1:0))return!1;for(let pc of Ra)if(pc!=bo&&(hc.indexOf(pc)==-1||vo[pc]!==Ai[pc]))return!1;return!0}function updateAttrs(vo,Ai,bo){let Ra=!1;if(Ai)for(let hc in Ai)bo&&hc in bo||(Ra=!0,hc=="style"?vo.style.cssText="":vo.removeAttribute(hc));if(bo)for(let hc in bo)Ai&&Ai[hc]==bo[hc]||(Ra=!0,hc=="style"?vo.style.cssText=bo[hc]:vo.setAttribute(hc,bo[hc]));return Ra}function getAttrs(vo){let Ai=Object.create(null);for(let bo=0;bo<vo.attributes.length;bo++){let Ra=vo.attributes[bo];Ai[Ra.name]=Ra.value}return Ai}class WidgetType{eq(Ai){return!1}updateDOM(Ai,bo){return!1}compare(Ai){return this==Ai||this.constructor==Ai.constructor&&this.eq(Ai)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(Ai){return!0}coordsAt(Ai,bo,Ra){return null}get isHidden(){return!1}get editable(){return!1}destroy(Ai){}}var BlockType=function(vo){return vo[vo.Text=0]="Text",vo[vo.WidgetBefore=1]="WidgetBefore",vo[vo.WidgetAfter=2]="WidgetAfter",vo[vo.WidgetRange=3]="WidgetRange",vo}(BlockType||(BlockType={}));class Decoration extends RangeValue{constructor(Ai,bo,Ra,hc){super(),this.startSide=Ai,this.endSide=bo,this.widget=Ra,this.spec=hc}get heightRelevant(){return!1}static mark(Ai){return new MarkDecoration(Ai)}static widget(Ai){let bo=Math.max(-1e4,Math.min(1e4,Ai.side||0)),Ra=!!Ai.block;return bo+=Ra&&!Ai.inlineOrder?bo>0?3e8:-4e8:bo>0?1e8:-1e8,new PointDecoration(Ai,bo,bo,Ra,Ai.widget||null,!1)}static replace(Ai){let bo=!!Ai.block,Ra,hc;if(Ai.isBlockGap)Ra=-5e8,hc=4e8;else{let{start:pc,end:mc}=getInclusive(Ai,bo);Ra=(pc?bo?-3e8:-1:5e8)-1,hc=(mc?bo?2e8:1:-6e8)+1}return new PointDecoration(Ai,Ra,hc,bo,Ai.widget||null,!0)}static line(Ai){return new LineDecoration(Ai)}static set(Ai,bo=!1){return RangeSet.of(Ai,bo)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Decoration.none=RangeSet.empty;class MarkDecoration extends Decoration{constructor(Ai){let{start:bo,end:Ra}=getInclusive(Ai);super(bo?-1:5e8,Ra?1:-6e8,null,Ai),this.tagName=Ai.tagName||"span",this.class=Ai.class||"",this.attrs=Ai.attributes||null}eq(Ai){var bo,Ra;return this==Ai||Ai instanceof MarkDecoration&&this.tagName==Ai.tagName&&(this.class||((bo=this.attrs)===null||bo===void 0?void 0:bo.class))==(Ai.class||((Ra=Ai.attrs)===null||Ra===void 0?void 0:Ra.class))&&attrsEq(this.attrs,Ai.attrs,"class")}range(Ai,bo=Ai){if(Ai>=bo)throw new RangeError("Mark decorations may not be empty");return super.range(Ai,bo)}}MarkDecoration.prototype.point=!1;class LineDecoration extends Decoration{constructor(Ai){super(-2e8,-2e8,null,Ai)}eq(Ai){return Ai instanceof LineDecoration&&this.spec.class==Ai.spec.class&&attrsEq(this.spec.attributes,Ai.spec.attributes)}range(Ai,bo=Ai){if(bo!=Ai)throw new RangeError("Line decoration ranges must be zero-length");return super.range(Ai,bo)}}LineDecoration.prototype.mapMode=MapMode.TrackBefore;LineDecoration.prototype.point=!0;class PointDecoration extends Decoration{constructor(Ai,bo,Ra,hc,pc,mc){super(bo,Ra,pc,Ai),this.block=hc,this.isReplace=mc,this.mapMode=hc?bo<=0?MapMode.TrackBefore:MapMode.TrackAfter:MapMode.TrackDel}get type(){return this.startSide!=this.endSide?BlockType.WidgetRange:this.startSide<=0?BlockType.WidgetBefore:BlockType.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(Ai){return Ai instanceof PointDecoration&&widgetsEq(this.widget,Ai.widget)&&this.block==Ai.block&&this.startSide==Ai.startSide&&this.endSide==Ai.endSide}range(Ai,bo=Ai){if(this.isReplace&&(Ai>bo||Ai==bo&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&bo!=Ai)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(Ai,bo)}}PointDecoration.prototype.point=!0;function getInclusive(vo,Ai=!1){let{inclusiveStart:bo,inclusiveEnd:Ra}=vo;return bo==null&&(bo=vo.inclusive),Ra==null&&(Ra=vo.inclusive),{start:bo??Ai,end:Ra??Ai}}function widgetsEq(vo,Ai){return vo==Ai||!!(vo&&Ai&&vo.compare(Ai))}function addRange(vo,Ai,bo,Ra=0){let hc=bo.length-1;hc>=0&&bo[hc]+Ra>=vo?bo[hc]=Math.max(bo[hc],Ai):bo.push(vo,Ai)}class LineView extends ContentView{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(Ai,bo,Ra,hc,pc,mc){if(Ra){if(!(Ra instanceof LineView))return!1;this.dom||Ra.transferDOM(this)}return hc&&this.setDeco(Ra?Ra.attrs:null),mergeChildrenInto(this,Ai,bo,Ra?Ra.children.slice():[],pc,mc),!0}split(Ai){let bo=new LineView;if(bo.breakAfter=this.breakAfter,this.length==0)return bo;let{i:Ra,off:hc}=this.childPos(Ai);hc&&(bo.append(this.children[Ra].split(hc),0),this.children[Ra].merge(hc,this.children[Ra].length,null,!1,0,0),Ra++);for(let pc=Ra;pc<this.children.length;pc++)bo.append(this.children[pc],0);for(;Ra>0&&this.children[Ra-1].length==0;)this.children[--Ra].destroy();return this.children.length=Ra,this.markDirty(),this.length=Ai,bo}transferDOM(Ai){this.dom&&(this.markDirty(),Ai.setDOM(this.dom),Ai.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(Ai){attrsEq(this.attrs,Ai)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=Ai)}append(Ai,bo){joinInlineInto(this,Ai,bo)}addLineDeco(Ai){let bo=Ai.spec.attributes,Ra=Ai.spec.class;bo&&(this.attrs=combineAttrs(bo,this.attrs||{})),Ra&&(this.attrs=combineAttrs({class:Ra},this.attrs||{}))}domAtPos(Ai){return inlineDOMAtPos(this,Ai)}reuseDOM(Ai){Ai.nodeName=="DIV"&&(this.setDOM(Ai),this.flags|=6)}sync(Ai,bo){var Ra;this.dom?this.flags&4&&(clearAttributes(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(updateAttrs(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(Ai,bo);let hc=this.dom.lastChild;for(;hc&&ContentView.get(hc)instanceof MarkView;)hc=hc.lastChild;if(!hc||!this.length||hc.nodeName!="BR"&&((Ra=ContentView.get(hc))===null||Ra===void 0?void 0:Ra.isEditable)==!1&&(!browser.ios||!this.children.some(pc=>pc instanceof TextView))){let pc=document.createElement("BR");pc.cmIgnore=!0,this.dom.appendChild(pc)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let Ai=0,bo;for(let Ra of this.children){if(!(Ra instanceof TextView)||/[^ -~]/.test(Ra.text))return null;let hc=clientRectsFor(Ra.dom);if(hc.length!=1)return null;Ai+=hc[0].width,bo=hc[0].height}return Ai?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:Ai/this.length,textHeight:bo}:null}coordsAt(Ai,bo){let Ra=coordsInChildren(this,Ai,bo);if(!this.children.length&&Ra&&this.parent){let{heightOracle:hc}=this.parent.view.viewState,pc=Ra.bottom-Ra.top;if(Math.abs(pc-hc.lineHeight)<2&&hc.textHeight<pc){let mc=(pc-hc.textHeight)/2;return{top:Ra.top+mc,bottom:Ra.bottom-mc,left:Ra.left,right:Ra.left}}}return Ra}become(Ai){return Ai instanceof LineView&&this.children.length==0&&Ai.children.length==0&&attrsEq(this.attrs,Ai.attrs)&&this.breakAfter==Ai.breakAfter}covers(){return!0}static find(Ai,bo){for(let Ra=0,hc=0;Ra<Ai.children.length;Ra++){let pc=Ai.children[Ra],mc=hc+pc.length;if(mc>=bo){if(pc instanceof LineView)return pc;if(mc>bo)break}hc=mc+pc.breakAfter}return null}}class BlockWidgetView extends ContentView{constructor(Ai,bo,Ra){super(),this.widget=Ai,this.length=bo,this.deco=Ra,this.breakAfter=0,this.prevWidget=null}merge(Ai,bo,Ra,hc,pc,mc){return Ra&&(!(Ra instanceof BlockWidgetView)||!this.widget.compare(Ra.widget)||Ai>0&&pc<=0||bo<this.length&&mc<=0)?!1:(this.length=Ai+(Ra?Ra.length:0)+(this.length-bo),!0)}domAtPos(Ai){return Ai==0?DOMPos.before(this.dom):DOMPos.after(this.dom,Ai==this.length)}split(Ai){let bo=this.length-Ai;this.length=Ai;let Ra=new BlockWidgetView(this.widget,bo,this.deco);return Ra.breakAfter=this.breakAfter,Ra}get children(){return noChildren}sync(Ai){(!this.dom||!this.widget.updateDOM(this.dom,Ai))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(Ai)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):Text.empty}domBoundsAround(){return null}become(Ai){return Ai instanceof BlockWidgetView&&Ai.widget.constructor==this.widget.constructor?(Ai.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=Ai.widget,this.length=Ai.length,this.deco=Ai.deco,this.breakAfter=Ai.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(Ai){return this.widget.ignoreEvent(Ai)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(Ai,bo){return this.widget.coordsAt(this.dom,Ai,bo)||(this.widget instanceof BlockGapWidget?null:flattenRect(this.dom.getBoundingClientRect(),this.length?Ai==0:bo<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(Ai){let{startSide:bo,endSide:Ra}=this.deco;return bo==Ra?!1:Ai<0?bo<0:Ra>0}}class BlockGapWidget extends WidgetType{constructor(Ai){super(),this.height=Ai}toDOM(){let Ai=document.createElement("div");return Ai.className="cm-gap",this.updateDOM(Ai),Ai}eq(Ai){return Ai.height==this.height}updateDOM(Ai){return Ai.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class ContentBuilder{constructor(Ai,bo,Ra,hc){this.doc=Ai,this.pos=bo,this.end=Ra,this.disallowBlockEffectsFor=hc,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=Ai.iter(),this.skip=bo}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let Ai=this.content[this.content.length-1];return!(Ai.breakAfter||Ai instanceof BlockWidgetView&&Ai.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new LineView),this.atCursorPos=!0),this.curLine}flushBuffer(Ai=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(wrapMarks(new WidgetBufferView(-1),Ai),Ai.length),this.pendingBuffer=0)}addBlockWidget(Ai){this.flushBuffer(),this.curLine=null,this.content.push(Ai)}finish(Ai){this.pendingBuffer&&Ai<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(Ai&&this.content.length&&this.content[this.content.length-1]instanceof BlockWidgetView)&&this.getLine()}buildText(Ai,bo,Ra){for(;Ai>0;){if(this.textOff==this.text.length){let{value:pc,lineBreak:mc,done:uf}=this.cursor.next(this.skip);if(this.skip=0,uf)throw new Error("Ran out of text content when drawing inline views");if(mc){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,Ai--;continue}else this.text=pc,this.textOff=0}let hc=Math.min(this.text.length-this.textOff,Ai,512);this.flushBuffer(bo.slice(bo.length-Ra)),this.getLine().append(wrapMarks(new TextView(this.text.slice(this.textOff,this.textOff+hc)),bo),Ra),this.atCursorPos=!0,this.textOff+=hc,Ai-=hc,Ra=0}}span(Ai,bo,Ra,hc){this.buildText(bo-Ai,Ra,hc),this.pos=bo,this.openStart<0&&(this.openStart=hc)}point(Ai,bo,Ra,hc,pc,mc){if(this.disallowBlockEffectsFor[mc]&&Ra instanceof PointDecoration){if(Ra.block)throw new RangeError("Block decorations may not be specified via plugins");if(bo>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let uf=bo-Ai;if(Ra instanceof PointDecoration)if(Ra.block)Ra.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new BlockWidgetView(Ra.widget||NullWidget.block,uf,Ra));else{let df=WidgetView.create(Ra.widget||NullWidget.inline,uf,uf?0:Ra.startSide),ff=this.atCursorPos&&!df.isEditable&&pc<=hc.length&&(Ai<bo||Ra.startSide>0),hf=!df.isEditable&&(Ai<bo||pc>hc.length||Ra.startSide<=0),pf=this.getLine();this.pendingBuffer==2&&!ff&&!df.isEditable&&(this.pendingBuffer=0),this.flushBuffer(hc),ff&&(pf.append(wrapMarks(new WidgetBufferView(1),hc),pc),pc=hc.length+Math.max(0,pc-hc.length)),pf.append(wrapMarks(df,hc),pc),this.atCursorPos=hf,this.pendingBuffer=hf?Ai<bo||pc>hc.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=hc.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(Ra);uf&&(this.textOff+uf<=this.text.length?this.textOff+=uf:(this.skip+=uf-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=bo),this.openStart<0&&(this.openStart=pc)}static build(Ai,bo,Ra,hc,pc){let mc=new ContentBuilder(Ai,bo,Ra,pc);return mc.openEnd=RangeSet.spans(hc,bo,Ra,mc),mc.openStart<0&&(mc.openStart=mc.openEnd),mc.finish(mc.openEnd),mc}}function wrapMarks(vo,Ai){for(let bo of Ai)vo=new MarkView(bo,[vo],vo.length);return vo}class NullWidget extends WidgetType{constructor(Ai){super(),this.tag=Ai}eq(Ai){return Ai.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(Ai){return Ai.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}NullWidget.inline=new NullWidget("span");NullWidget.block=new NullWidget("div");var Direction=function(vo){return vo[vo.LTR=0]="LTR",vo[vo.RTL=1]="RTL",vo}(Direction||(Direction={}));const LTR=Direction.LTR,RTL=Direction.RTL;function dec(vo){let Ai=[];for(let bo=0;bo<vo.length;bo++)Ai.push(1<<+vo[bo]);return Ai}const LowTypes=dec("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),ArabicTypes=dec("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Brackets=Object.create(null),BracketStack=[];for(let vo of["()","[]","{}"]){let Ai=vo.charCodeAt(0),bo=vo.charCodeAt(1);Brackets[Ai]=bo,Brackets[bo]=-Ai}function charType(vo){return vo<=247?LowTypes[vo]:1424<=vo&&vo<=1524?2:1536<=vo&&vo<=1785?ArabicTypes[vo-1536]:1774<=vo&&vo<=2220?4:8192<=vo&&vo<=8204?256:64336<=vo&&vo<=65023?4:1}const BidiRE=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class BidiSpan{get dir(){return this.level%2?RTL:LTR}constructor(Ai,bo,Ra){this.from=Ai,this.to=bo,this.level=Ra}side(Ai,bo){return this.dir==bo==Ai?this.to:this.from}forward(Ai,bo){return Ai==(this.dir==bo)}static find(Ai,bo,Ra,hc){let pc=-1;for(let mc=0;mc<Ai.length;mc++){let uf=Ai[mc];if(uf.from<=bo&&uf.to>=bo){if(uf.level==Ra)return mc;(pc<0||(hc!=0?hc<0?uf.from<bo:uf.to>bo:Ai[pc].level>uf.level))&&(pc=mc)}}if(pc<0)throw new RangeError("Index out of range");return pc}}function isolatesEq(vo,Ai){if(vo.length!=Ai.length)return!1;for(let bo=0;bo<vo.length;bo++){let Ra=vo[bo],hc=Ai[bo];if(Ra.from!=hc.from||Ra.to!=hc.to||Ra.direction!=hc.direction||!isolatesEq(Ra.inner,hc.inner))return!1}return!0}const types=[];function computeCharTypes(vo,Ai,bo,Ra,hc){for(let pc=0;pc<=Ra.length;pc++){let mc=pc?Ra[pc-1].to:Ai,uf=pc<Ra.length?Ra[pc].from:bo,df=pc?256:hc;for(let ff=mc,hf=df,pf=df;ff<uf;ff++){let mf=charType(vo.charCodeAt(ff));mf==512?mf=hf:mf==8&&pf==4&&(mf=16),types[ff]=mf==4?2:mf,mf&7&&(pf=mf),hf=mf}for(let ff=mc,hf=df,pf=df;ff<uf;ff++){let mf=types[ff];if(mf==128)ff<uf-1&&hf==types[ff+1]&&hf&24?mf=types[ff]=hf:types[ff]=256;else if(mf==64){let gf=ff+1;for(;gf<uf&&types[gf]==64;)gf++;let yf=ff&&hf==8||gf<bo&&types[gf]==8?pf==1?1:8:256;for(let vf=ff;vf<gf;vf++)types[vf]=yf;ff=gf-1}else mf==8&&pf==1&&(types[ff]=1);hf=mf,mf&7&&(pf=mf)}}}function processBracketPairs(vo,Ai,bo,Ra,hc){let pc=hc==1?2:1;for(let mc=0,uf=0,df=0;mc<=Ra.length;mc++){let ff=mc?Ra[mc-1].to:Ai,hf=mc<Ra.length?Ra[mc].from:bo;for(let pf=ff,mf,gf,yf;pf<hf;pf++)if(gf=Brackets[mf=vo.charCodeAt(pf)])if(gf<0){for(let vf=uf-3;vf>=0;vf-=3)if(BracketStack[vf+1]==-gf){let bf=BracketStack[vf+2],Sf=bf&2?hc:bf&4?bf&1?pc:hc:0;Sf&&(types[pf]=types[BracketStack[vf]]=Sf),uf=vf;break}}else{if(BracketStack.length==189)break;BracketStack[uf++]=pf,BracketStack[uf++]=mf,BracketStack[uf++]=df}else if((yf=types[pf])==2||yf==1){let vf=yf==hc;df=vf?0:1;for(let bf=uf-3;bf>=0;bf-=3){let Sf=BracketStack[bf+2];if(Sf&2)break;if(vf)BracketStack[bf+2]|=2;else{if(Sf&4)break;BracketStack[bf+2]|=4}}}}}function processNeutrals(vo,Ai,bo,Ra){for(let hc=0,pc=Ra;hc<=bo.length;hc++){let mc=hc?bo[hc-1].to:vo,uf=hc<bo.length?bo[hc].from:Ai;for(let df=mc;df<uf;){let ff=types[df];if(ff==256){let hf=df+1;for(;;)if(hf==uf){if(hc==bo.length)break;hf=bo[hc++].to,uf=hc<bo.length?bo[hc].from:Ai}else if(types[hf]==256)hf++;else break;let pf=pc==1,mf=(hf<Ai?types[hf]:Ra)==1,gf=pf==mf?pf?1:2:Ra;for(let yf=hf,vf=hc,bf=vf?bo[vf-1].to:vo;yf>df;)yf==bf&&(yf=bo[--vf].from,bf=vf?bo[vf-1].to:vo),types[--yf]=gf;df=hf}else pc=ff,df++}}}function emitSpans(vo,Ai,bo,Ra,hc,pc,mc){let uf=Ra%2?2:1;if(Ra%2==hc%2)for(let df=Ai,ff=0;df<bo;){let hf=!0,pf=!1;if(ff==pc.length||df<pc[ff].from){let vf=types[df];vf!=uf&&(hf=!1,pf=vf==16)}let mf=!hf&&uf==1?[]:null,gf=hf?Ra:Ra+1,yf=df;e:for(;;)if(ff<pc.length&&yf==pc[ff].from){if(pf)break e;let vf=pc[ff];if(!hf)for(let bf=vf.to,Sf=ff+1;;){if(bf==bo)break e;if(Sf<pc.length&&pc[Sf].from==bf)bf=pc[Sf++].to;else{if(types[bf]==uf)break e;break}}if(ff++,mf)mf.push(vf);else{vf.from>df&&mc.push(new BidiSpan(df,vf.from,gf));let bf=vf.direction==LTR!=!(gf%2);computeSectionOrder(vo,bf?Ra+1:Ra,hc,vf.inner,vf.from,vf.to,mc),df=vf.to}yf=vf.to}else{if(yf==bo||(hf?types[yf]!=uf:types[yf]==uf))break;yf++}mf?emitSpans(vo,df,yf,Ra+1,hc,mf,mc):df<yf&&mc.push(new BidiSpan(df,yf,gf)),df=yf}else for(let df=bo,ff=pc.length;df>Ai;){let hf=!0,pf=!1;if(!ff||df>pc[ff-1].to){let vf=types[df-1];vf!=uf&&(hf=!1,pf=vf==16)}let mf=!hf&&uf==1?[]:null,gf=hf?Ra:Ra+1,yf=df;e:for(;;)if(ff&&yf==pc[ff-1].to){if(pf)break e;let vf=pc[--ff];if(!hf)for(let bf=vf.from,Sf=ff;;){if(bf==Ai)break e;if(Sf&&pc[Sf-1].to==bf)bf=pc[--Sf].from;else{if(types[bf-1]==uf)break e;break}}if(mf)mf.push(vf);else{vf.to<df&&mc.push(new BidiSpan(vf.to,df,gf));let bf=vf.direction==LTR!=!(gf%2);computeSectionOrder(vo,bf?Ra+1:Ra,hc,vf.inner,vf.from,vf.to,mc),df=vf.from}yf=vf.from}else{if(yf==Ai||(hf?types[yf-1]!=uf:types[yf-1]==uf))break;yf--}mf?emitSpans(vo,yf,df,Ra+1,hc,mf,mc):yf<df&&mc.push(new BidiSpan(yf,df,gf)),df=yf}}function computeSectionOrder(vo,Ai,bo,Ra,hc,pc,mc){let uf=Ai%2?2:1;computeCharTypes(vo,hc,pc,Ra,uf),processBracketPairs(vo,hc,pc,Ra,uf),processNeutrals(hc,pc,Ra,uf),emitSpans(vo,hc,pc,Ai,bo,Ra,mc)}function computeOrder(vo,Ai,bo){if(!vo)return[new BidiSpan(0,0,Ai==RTL?1:0)];if(Ai==LTR&&!bo.length&&!BidiRE.test(vo))return trivialOrder(vo.length);if(bo.length)for(;vo.length>types.length;)types[types.length]=256;let Ra=[],hc=Ai==LTR?0:1;return computeSectionOrder(vo,hc,hc,bo,0,vo.length,Ra),Ra}function trivialOrder(vo){return[new BidiSpan(0,vo,0)]}let movedOver="";function moveVisually(vo,Ai,bo,Ra,hc){var pc;let mc=Ra.head-vo.from,uf=BidiSpan.find(Ai,mc,(pc=Ra.bidiLevel)!==null&&pc!==void 0?pc:-1,Ra.assoc),df=Ai[uf],ff=df.side(hc,bo);if(mc==ff){let mf=uf+=hc?1:-1;if(mf<0||mf>=Ai.length)return null;df=Ai[uf=mf],mc=df.side(!hc,bo),ff=df.side(hc,bo)}let hf=findClusterBreak(vo.text,mc,df.forward(hc,bo));(hf<df.from||hf>df.to)&&(hf=ff),movedOver=vo.text.slice(Math.min(mc,hf),Math.max(mc,hf));let pf=uf==(hc?Ai.length-1:0)?null:Ai[uf+(hc?1:-1)];return pf&&hf==ff&&pf.level+(hc?0:1)<df.level?EditorSelection.cursor(pf.side(!hc,bo)+vo.from,pf.forward(hc,bo)?1:-1,pf.level):EditorSelection.cursor(hf+vo.from,df.forward(hc,bo)?-1:1,df.level)}function autoDirection(vo,Ai,bo){for(let Ra=Ai;Ra<bo;Ra++){let hc=charType(vo.charCodeAt(Ra));if(hc==1)return LTR;if(hc==2||hc==4)return RTL}return LTR}const clickAddsSelectionRange=Facet.define(),dragMovesSelection$1=Facet.define(),mouseSelectionStyle=Facet.define(),exceptionSink=Facet.define(),updateListener=Facet.define(),inputHandler$1=Facet.define(),focusChangeEffect=Facet.define(),clipboardInputFilter=Facet.define(),clipboardOutputFilter=Facet.define(),perLineTextDirection=Facet.define({combine:vo=>vo.some(Ai=>Ai)}),nativeSelectionHidden=Facet.define({combine:vo=>vo.some(Ai=>Ai)}),scrollHandler=Facet.define();class ScrollTarget{constructor(Ai,bo="nearest",Ra="nearest",hc=5,pc=5,mc=!1){this.range=Ai,this.y=bo,this.x=Ra,this.yMargin=hc,this.xMargin=pc,this.isSnapshot=mc}map(Ai){return Ai.empty?this:new ScrollTarget(this.range.map(Ai),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(Ai){return this.range.to<=Ai.doc.length?this:new ScrollTarget(EditorSelection.cursor(Ai.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const scrollIntoView$1=StateEffect.define({map:(vo,Ai)=>vo.map(Ai)}),setEditContextFormatting=StateEffect.define();function logException(vo,Ai,bo){let Ra=vo.facet(exceptionSink);Ra.length?Ra[0](Ai):window.onerror?window.onerror(String(Ai),bo,void 0,void 0,Ai):bo?console.error(bo+":",Ai):console.error(Ai)}const editable=Facet.define({combine:vo=>vo.length?vo[0]:!0});let nextPluginID=0;const viewPlugin=Facet.define();class ViewPlugin{constructor(Ai,bo,Ra,hc,pc){this.id=Ai,this.create=bo,this.domEventHandlers=Ra,this.domEventObservers=hc,this.extension=pc(this)}static define(Ai,bo){const{eventHandlers:Ra,eventObservers:hc,provide:pc,decorations:mc}=bo||{};return new ViewPlugin(nextPluginID++,Ai,Ra,hc,uf=>{let df=[viewPlugin.of(uf)];return mc&&df.push(decorations.of(ff=>{let hf=ff.plugin(uf);return hf?mc(hf):Decoration.none})),pc&&df.push(pc(uf)),df})}static fromClass(Ai,bo){return ViewPlugin.define(Ra=>new Ai(Ra),bo)}}class PluginInstance{constructor(Ai){this.spec=Ai,this.mustUpdate=null,this.value=null}update(Ai){if(this.value){if(this.mustUpdate){let bo=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(bo)}catch(Ra){if(logException(bo.state,Ra,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(Ai)}catch(bo){logException(Ai.state,bo,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(Ai){var bo;if(!((bo=this.value)===null||bo===void 0)&&bo.destroy)try{this.value.destroy()}catch(Ra){logException(Ai.state,Ra,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const editorAttributes=Facet.define(),contentAttributes=Facet.define(),decorations=Facet.define(),outerDecorations=Facet.define(),atomicRanges=Facet.define(),bidiIsolatedRanges=Facet.define();function getIsolatedRanges(vo,Ai){let bo=vo.state.facet(bidiIsolatedRanges);if(!bo.length)return bo;let Ra=bo.map(pc=>pc instanceof Function?pc(vo):pc),hc=[];return RangeSet.spans(Ra,Ai.from,Ai.to,{point(){},span(pc,mc,uf,df){let ff=pc-Ai.from,hf=mc-Ai.from,pf=hc;for(let mf=uf.length-1;mf>=0;mf--,df--){let gf=uf[mf].spec.bidiIsolate,yf;if(gf==null&&(gf=autoDirection(Ai.text,ff,hf)),df>0&&pf.length&&(yf=pf[pf.length-1]).to==ff&&yf.direction==gf)yf.to=hf,pf=yf.inner;else{let vf={from:ff,to:hf,direction:gf,inner:[]};pf.push(vf),pf=vf.inner}}}}),hc}const scrollMargins=Facet.define();function getScrollMargins(vo){let Ai=0,bo=0,Ra=0,hc=0;for(let pc of vo.state.facet(scrollMargins)){let mc=pc(vo);mc&&(mc.left!=null&&(Ai=Math.max(Ai,mc.left)),mc.right!=null&&(bo=Math.max(bo,mc.right)),mc.top!=null&&(Ra=Math.max(Ra,mc.top)),mc.bottom!=null&&(hc=Math.max(hc,mc.bottom)))}return{left:Ai,right:bo,top:Ra,bottom:hc}}const styleModule=Facet.define();class ChangedRange{constructor(Ai,bo,Ra,hc){this.fromA=Ai,this.toA=bo,this.fromB=Ra,this.toB=hc}join(Ai){return new ChangedRange(Math.min(this.fromA,Ai.fromA),Math.max(this.toA,Ai.toA),Math.min(this.fromB,Ai.fromB),Math.max(this.toB,Ai.toB))}addToSet(Ai){let bo=Ai.length,Ra=this;for(;bo>0;bo--){let hc=Ai[bo-1];if(!(hc.fromA>Ra.toA)){if(hc.toA<Ra.fromA)break;Ra=Ra.join(hc),Ai.splice(bo-1,1)}}return Ai.splice(bo,0,Ra),Ai}static extendWithRanges(Ai,bo){if(bo.length==0)return Ai;let Ra=[];for(let hc=0,pc=0,mc=0,uf=0;;hc++){let df=hc==Ai.length?null:Ai[hc],ff=mc-uf,hf=df?df.fromB:1e9;for(;pc<bo.length&&bo[pc]<hf;){let pf=bo[pc],mf=bo[pc+1],gf=Math.max(uf,pf),yf=Math.min(hf,mf);if(gf<=yf&&new ChangedRange(gf+ff,yf+ff,gf,yf).addToSet(Ra),mf>hf)break;pc+=2}if(!df)return Ra;new ChangedRange(df.fromA,df.toA,df.fromB,df.toB).addToSet(Ra),mc=df.toA,uf=df.toB}}}class ViewUpdate{constructor(Ai,bo,Ra){this.view=Ai,this.state=bo,this.transactions=Ra,this.flags=0,this.startState=Ai.state,this.changes=ChangeSet.empty(this.startState.doc.length);for(let pc of Ra)this.changes=this.changes.compose(pc.changes);let hc=[];this.changes.iterChangedRanges((pc,mc,uf,df)=>hc.push(new ChangedRange(pc,mc,uf,df))),this.changedRanges=hc}static create(Ai,bo,Ra){return new ViewUpdate(Ai,bo,Ra)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(Ai=>Ai.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class DocView extends ContentView{get length(){return this.view.state.doc.length}constructor(Ai){super(),this.view=Ai,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=Decoration.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(Ai.contentDOM),this.children=[new LineView],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new ChangedRange(0,0,0,Ai.state.doc.length)],0,null)}update(Ai){var bo;let Ra=Ai.changedRanges;this.minWidth>0&&Ra.length&&(Ra.every(({fromA:ff,toA:hf})=>hf<this.minWidthFrom||ff>this.minWidthTo)?(this.minWidthFrom=Ai.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=Ai.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(Ai);let hc=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((bo=this.domChanged)===null||bo===void 0)&&bo.newSel?hc=this.domChanged.newSel.head:!touchesComposition(Ai.changes,this.hasComposition)&&!Ai.selectionSet&&(hc=Ai.state.selection.main.head));let pc=hc>-1?findCompositionRange(this.view,Ai.changes,hc):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:ff,to:hf}=this.hasComposition;Ra=new ChangedRange(ff,hf,Ai.changes.mapPos(ff,-1),Ai.changes.mapPos(hf,1)).addToSet(Ra.slice())}this.hasComposition=pc?{from:pc.range.fromB,to:pc.range.toB}:null,(browser.ie||browser.chrome)&&!pc&&Ai&&Ai.state.doc.lines!=Ai.startState.doc.lines&&(this.forceSelection=!0);let mc=this.decorations,uf=this.updateDeco(),df=findChangedDeco(mc,uf,Ai.changes);return Ra=ChangedRange.extendWithRanges(Ra,df),!(this.flags&7)&&Ra.length==0?!1:(this.updateInner(Ra,Ai.startState.doc.length,pc),Ai.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(Ai,bo,Ra){this.view.viewState.mustMeasureContent=!0,this.updateChildren(Ai,bo,Ra);let{observer:hc}=this.view;hc.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let mc=browser.chrome||browser.ios?{node:hc.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,mc),this.flags&=-8,mc&&(mc.written||hc.selectionRange.focusNode!=mc.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(mc=>mc.flags&=-9);let pc=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let mc of this.children)mc instanceof BlockWidgetView&&mc.widget instanceof BlockGapWidget&&pc.push(mc.dom);hc.updateGaps(pc)}updateChildren(Ai,bo,Ra){let hc=Ra?Ra.range.addToSet(Ai.slice()):Ai,pc=this.childCursor(bo);for(let mc=hc.length-1;;mc--){let uf=mc>=0?hc[mc]:null;if(!uf)break;let{fromA:df,toA:ff,fromB:hf,toB:pf}=uf,mf,gf,yf,vf;if(Ra&&Ra.range.fromB<pf&&Ra.range.toB>hf){let s1=ContentBuilder.build(this.view.state.doc,hf,Ra.range.fromB,this.decorations,this.dynamicDecorationMap),If=ContentBuilder.build(this.view.state.doc,Ra.range.toB,pf,this.decorations,this.dynamicDecorationMap);gf=s1.breakAtStart,yf=s1.openStart,vf=If.openEnd;let l1=this.compositionView(Ra);If.breakAtStart?l1.breakAfter=1:If.content.length&&l1.merge(l1.length,l1.length,If.content[0],!1,If.openStart,0)&&(l1.breakAfter=If.content[0].breakAfter,If.content.shift()),s1.content.length&&l1.merge(0,0,s1.content[s1.content.length-1],!0,0,s1.openEnd)&&s1.content.pop(),mf=s1.content.concat(l1).concat(If.content)}else({content:mf,breakAtStart:gf,openStart:yf,openEnd:vf}=ContentBuilder.build(this.view.state.doc,hf,pf,this.decorations,this.dynamicDecorationMap));let{i:bf,off:Sf}=pc.findPos(ff,1),{i:xf,off:wf}=pc.findPos(df,-1);replaceRange(this,xf,wf,bf,Sf,mf,gf,yf,vf)}Ra&&this.fixCompositionDOM(Ra)}updateEditContextFormatting(Ai){this.editContextFormatting=this.editContextFormatting.map(Ai.changes);for(let bo of Ai.transactions)for(let Ra of bo.effects)Ra.is(setEditContextFormatting)&&(this.editContextFormatting=Ra.value)}compositionView(Ai){let bo=new TextView(Ai.text.nodeValue);bo.flags|=8;for(let{deco:hc}of Ai.marks)bo=new MarkView(hc,[bo],bo.length);let Ra=new LineView;return Ra.append(bo,0),Ra}fixCompositionDOM(Ai){let bo=(pc,mc)=>{mc.flags|=8|(mc.children.some(df=>df.flags&7)?1:0),this.markedForComposition.add(mc);let uf=ContentView.get(pc);uf&&uf!=mc&&(uf.dom=null),mc.setDOM(pc)},Ra=this.childPos(Ai.range.fromB,1),hc=this.children[Ra.i];bo(Ai.line,hc);for(let pc=Ai.marks.length-1;pc>=-1;pc--)Ra=hc.childPos(Ra.off,1),hc=hc.children[Ra.i],bo(pc>=0?Ai.marks[pc].node:Ai.text,hc)}updateSelection(Ai=!1,bo=!1){(Ai||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let Ra=this.view.root.activeElement,hc=Ra==this.dom,pc=!hc&&!(this.view.state.facet(editable)||this.dom.tabIndex>-1)&&hasSelection(this.dom,this.view.observer.selectionRange)&&!(Ra&&this.dom.contains(Ra));if(!(hc||bo||pc))return;let mc=this.forceSelection;this.forceSelection=!1;let uf=this.view.state.selection.main,df=this.moveToLine(this.domAtPos(uf.anchor)),ff=uf.empty?df:this.moveToLine(this.domAtPos(uf.head));if(browser.gecko&&uf.empty&&!this.hasComposition&&betweenUneditable(df)){let pf=document.createTextNode("");this.view.observer.ignore(()=>df.node.insertBefore(pf,df.node.childNodes[df.offset]||null)),df=ff=new DOMPos(pf,0),mc=!0}let hf=this.view.observer.selectionRange;(mc||!hf.focusNode||(!isEquivalentPosition(df.node,df.offset,hf.anchorNode,hf.anchorOffset)||!isEquivalentPosition(ff.node,ff.offset,hf.focusNode,hf.focusOffset))&&!this.suppressWidgetCursorChange(hf,uf))&&(this.view.observer.ignore(()=>{browser.android&&browser.chrome&&this.dom.contains(hf.focusNode)&&inUneditable(hf.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let pf=getSelection(this.view.root);if(pf)if(uf.empty){if(browser.gecko){let mf=nextToUneditable(df.node,df.offset);if(mf&&mf!=3){let gf=(mf==1?textNodeBefore:textNodeAfter)(df.node,df.offset);gf&&(df=new DOMPos(gf.node,gf.offset))}}pf.collapse(df.node,df.offset),uf.bidiLevel!=null&&pf.caretBidiLevel!==void 0&&(pf.caretBidiLevel=uf.bidiLevel)}else if(pf.extend){pf.collapse(df.node,df.offset);try{pf.extend(ff.node,ff.offset)}catch{}}else{let mf=document.createRange();uf.anchor>uf.head&&([df,ff]=[ff,df]),mf.setEnd(ff.node,ff.offset),mf.setStart(df.node,df.offset),pf.removeAllRanges(),pf.addRange(mf)}pc&&this.view.root.activeElement==this.dom&&(this.dom.blur(),Ra&&Ra.focus())}),this.view.observer.setSelectionRange(df,ff)),this.impreciseAnchor=df.precise?null:new DOMPos(hf.anchorNode,hf.anchorOffset),this.impreciseHead=ff.precise?null:new DOMPos(hf.focusNode,hf.focusOffset)}suppressWidgetCursorChange(Ai,bo){return this.hasComposition&&bo.empty&&isEquivalentPosition(Ai.focusNode,Ai.focusOffset,Ai.anchorNode,Ai.anchorOffset)&&this.posFromDOM(Ai.focusNode,Ai.focusOffset)==bo.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:Ai}=this,bo=Ai.state.selection.main,Ra=getSelection(Ai.root),{anchorNode:hc,anchorOffset:pc}=Ai.observer.selectionRange;if(!Ra||!bo.empty||!bo.assoc||!Ra.modify)return;let mc=LineView.find(this,bo.head);if(!mc)return;let uf=mc.posAtStart;if(bo.head==uf||bo.head==uf+mc.length)return;let df=this.coordsAt(bo.head,-1),ff=this.coordsAt(bo.head,1);if(!df||!ff||df.bottom>ff.top)return;let hf=this.domAtPos(bo.head+bo.assoc);Ra.collapse(hf.node,hf.offset),Ra.modify("move",bo.assoc<0?"forward":"backward","lineboundary"),Ai.observer.readSelectionRange();let pf=Ai.observer.selectionRange;Ai.docView.posFromDOM(pf.anchorNode,pf.anchorOffset)!=bo.from&&Ra.collapse(hc,pc)}moveToLine(Ai){let bo=this.dom,Ra;if(Ai.node!=bo)return Ai;for(let hc=Ai.offset;!Ra&&hc<bo.childNodes.length;hc++){let pc=ContentView.get(bo.childNodes[hc]);pc instanceof LineView&&(Ra=pc.domAtPos(0))}for(let hc=Ai.offset-1;!Ra&&hc>=0;hc--){let pc=ContentView.get(bo.childNodes[hc]);pc instanceof LineView&&(Ra=pc.domAtPos(pc.length))}return Ra?new DOMPos(Ra.node,Ra.offset,!0):Ai}nearest(Ai){for(let bo=Ai;bo;){let Ra=ContentView.get(bo);if(Ra&&Ra.rootView==this)return Ra;bo=bo.parentNode}return null}posFromDOM(Ai,bo){let Ra=this.nearest(Ai);if(!Ra)throw new RangeError("Trying to find position for a DOM position outside of the document");return Ra.localPosFromDOM(Ai,bo)+Ra.posAtStart}domAtPos(Ai){let{i:bo,off:Ra}=this.childCursor().findPos(Ai,-1);for(;bo<this.children.length-1;){let hc=this.children[bo];if(Ra<hc.length||hc instanceof LineView)break;bo++,Ra=0}return this.children[bo].domAtPos(Ra)}coordsAt(Ai,bo){let Ra=null,hc=0;for(let pc=this.length,mc=this.children.length-1;mc>=0;mc--){let uf=this.children[mc],df=pc-uf.breakAfter,ff=df-uf.length;if(df<Ai)break;if(ff<=Ai&&(ff<Ai||uf.covers(-1))&&(df>Ai||uf.covers(1))&&(!Ra||uf instanceof LineView&&!(Ra instanceof LineView&&bo>=0)))Ra=uf,hc=ff;else if(Ra&&ff==Ai&&df==Ai&&uf instanceof BlockWidgetView&&Math.abs(bo)<2){if(uf.deco.startSide<0)break;mc&&(Ra=null)}pc=ff}return Ra?Ra.coordsAt(Ai-hc,bo):null}coordsForChar(Ai){let{i:bo,off:Ra}=this.childPos(Ai,1),hc=this.children[bo];if(!(hc instanceof LineView))return null;for(;hc.children.length;){let{i:uf,off:df}=hc.childPos(Ra,1);for(;;uf++){if(uf==hc.children.length)return null;if((hc=hc.children[uf]).length)break}Ra=df}if(!(hc instanceof TextView))return null;let pc=findClusterBreak(hc.text,Ra);if(pc==Ra)return null;let mc=textRange(hc.dom,Ra,pc).getClientRects();for(let uf=0;uf<mc.length;uf++){let df=mc[uf];if(uf==mc.length-1||df.top<df.bottom&&df.left<df.right)return df}return null}measureVisibleLineHeights(Ai){let bo=[],{from:Ra,to:hc}=Ai,pc=this.view.contentDOM.clientWidth,mc=pc>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,uf=-1,df=this.view.textDirection==Direction.LTR;for(let ff=0,hf=0;hf<this.children.length;hf++){let pf=this.children[hf],mf=ff+pf.length;if(mf>hc)break;if(ff>=Ra){let gf=pf.dom.getBoundingClientRect();if(bo.push(gf.height),mc){let yf=pf.dom.lastChild,vf=yf?clientRectsFor(yf):[];if(vf.length){let bf=vf[vf.length-1],Sf=df?bf.right-gf.left:gf.right-bf.left;Sf>uf&&(uf=Sf,this.minWidth=pc,this.minWidthFrom=ff,this.minWidthTo=mf)}}}ff=mf+pf.breakAfter}return bo}textDirectionAt(Ai){let{i:bo}=this.childPos(Ai,1);return getComputedStyle(this.children[bo].dom).direction=="rtl"?Direction.RTL:Direction.LTR}measureTextSize(){for(let pc of this.children)if(pc instanceof LineView){let mc=pc.measureTextSize();if(mc)return mc}let Ai=document.createElement("div"),bo,Ra,hc;return Ai.className="cm-line",Ai.style.width="99999px",Ai.style.position="absolute",Ai.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(Ai);let pc=clientRectsFor(Ai.firstChild)[0];bo=Ai.getBoundingClientRect().height,Ra=pc?pc.width/27:7,hc=pc?pc.height:bo,Ai.remove()}),{lineHeight:bo,charWidth:Ra,textHeight:hc}}childCursor(Ai=this.length){let bo=this.children.length;return bo&&(Ai-=this.children[--bo].length),new ChildCursor(this.children,Ai,bo)}computeBlockGapDeco(){let Ai=[],bo=this.view.viewState;for(let Ra=0,hc=0;;hc++){let pc=hc==bo.viewports.length?null:bo.viewports[hc],mc=pc?pc.from-1:this.length;if(mc>Ra){let uf=(bo.lineBlockAt(mc).bottom-bo.lineBlockAt(Ra).top)/this.view.scaleY;Ai.push(Decoration.replace({widget:new BlockGapWidget(uf),block:!0,inclusive:!0,isBlockGap:!0}).range(Ra,mc))}if(!pc)break;Ra=pc.to+1}return Decoration.set(Ai)}updateDeco(){let Ai=1,bo=this.view.state.facet(decorations).map(pc=>(this.dynamicDecorationMap[Ai++]=typeof pc=="function")?pc(this.view):pc),Ra=!1,hc=this.view.state.facet(outerDecorations).map((pc,mc)=>{let uf=typeof pc=="function";return uf&&(Ra=!0),uf?pc(this.view):pc});for(hc.length&&(this.dynamicDecorationMap[Ai++]=Ra,bo.push(RangeSet.join(hc))),this.decorations=[this.editContextFormatting,...bo,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];Ai<this.decorations.length;)this.dynamicDecorationMap[Ai++]=!1;return this.decorations}scrollIntoView(Ai){if(Ai.isSnapshot){let ff=this.view.viewState.lineBlockAt(Ai.range.head);this.view.scrollDOM.scrollTop=ff.top-Ai.yMargin,this.view.scrollDOM.scrollLeft=Ai.xMargin;return}for(let ff of this.view.state.facet(scrollHandler))try{if(ff(this.view,Ai.range,Ai))return!0}catch(hf){logException(this.view.state,hf,"scroll handler")}let{range:bo}=Ai,Ra=this.coordsAt(bo.head,bo.empty?bo.assoc:bo.head>bo.anchor?-1:1),hc;if(!Ra)return;!bo.empty&&(hc=this.coordsAt(bo.anchor,bo.anchor>bo.head?-1:1))&&(Ra={left:Math.min(Ra.left,hc.left),top:Math.min(Ra.top,hc.top),right:Math.max(Ra.right,hc.right),bottom:Math.max(Ra.bottom,hc.bottom)});let pc=getScrollMargins(this.view),mc={left:Ra.left-pc.left,top:Ra.top-pc.top,right:Ra.right+pc.right,bottom:Ra.bottom+pc.bottom},{offsetWidth:uf,offsetHeight:df}=this.view.scrollDOM;scrollRectIntoView(this.view.scrollDOM,mc,bo.head<bo.anchor?-1:1,Ai.x,Ai.y,Math.max(Math.min(Ai.xMargin,uf),-uf),Math.max(Math.min(Ai.yMargin,df),-df),this.view.textDirection==Direction.LTR)}}function betweenUneditable(vo){return vo.node.nodeType==1&&vo.node.firstChild&&(vo.offset==0||vo.node.childNodes[vo.offset-1].contentEditable=="false")&&(vo.offset==vo.node.childNodes.length||vo.node.childNodes[vo.offset].contentEditable=="false")}function findCompositionNode(vo,Ai){let bo=vo.observer.selectionRange;if(!bo.focusNode)return null;let Ra=textNodeBefore(bo.focusNode,bo.focusOffset),hc=textNodeAfter(bo.focusNode,bo.focusOffset),pc=Ra||hc;if(hc&&Ra&&hc.node!=Ra.node){let uf=ContentView.get(hc.node);if(!uf||uf instanceof TextView&&uf.text!=hc.node.nodeValue)pc=hc;else if(vo.docView.lastCompositionAfterCursor){let df=ContentView.get(Ra.node);!df||df instanceof TextView&&df.text!=Ra.node.nodeValue||(pc=hc)}}if(vo.docView.lastCompositionAfterCursor=pc!=Ra,!pc)return null;let mc=Ai-pc.offset;return{from:mc,to:mc+pc.node.nodeValue.length,node:pc.node}}function findCompositionRange(vo,Ai,bo){let Ra=findCompositionNode(vo,bo);if(!Ra)return null;let{node:hc,from:pc,to:mc}=Ra,uf=hc.nodeValue;if(/[\n\r]/.test(uf)||vo.state.doc.sliceString(Ra.from,Ra.to)!=uf)return null;let df=Ai.invertedDesc,ff=new ChangedRange(df.mapPos(pc),df.mapPos(mc),pc,mc),hf=[];for(let pf=hc.parentNode;;pf=pf.parentNode){let mf=ContentView.get(pf);if(mf instanceof MarkView)hf.push({node:pf,deco:mf.mark});else{if(mf instanceof LineView||pf.nodeName=="DIV"&&pf.parentNode==vo.contentDOM)return{range:ff,text:hc,marks:hf,line:pf};if(pf!=vo.contentDOM)hf.push({node:pf,deco:new MarkDecoration({inclusive:!0,attributes:getAttrs(pf),tagName:pf.tagName.toLowerCase()})});else return null}}}function nextToUneditable(vo,Ai){return vo.nodeType!=1?0:(Ai&&vo.childNodes[Ai-1].contentEditable=="false"?1:0)|(Ai<vo.childNodes.length&&vo.childNodes[Ai].contentEditable=="false"?2:0)}let DecorationComparator$1=class{constructor(){this.changes=[]}compareRange(vo,Ai){addRange(vo,Ai,this.changes)}comparePoint(vo,Ai){addRange(vo,Ai,this.changes)}boundChange(vo){addRange(vo,vo,this.changes)}};function findChangedDeco(vo,Ai,bo){let Ra=new DecorationComparator$1;return RangeSet.compare(vo,Ai,bo,Ra),Ra.changes}function inUneditable(vo,Ai){for(let bo=vo;bo&&bo!=Ai;bo=bo.assignedSlot||bo.parentNode)if(bo.nodeType==1&&bo.contentEditable=="false")return!0;return!1}function touchesComposition(vo,Ai){let bo=!1;return Ai&&vo.iterChangedRanges((Ra,hc)=>{Ra<Ai.to&&hc>Ai.from&&(bo=!0)}),bo}function groupAt(vo,Ai,bo=1){let Ra=vo.charCategorizer(Ai),hc=vo.doc.lineAt(Ai),pc=Ai-hc.from;if(hc.length==0)return EditorSelection.cursor(Ai);pc==0?bo=1:pc==hc.length&&(bo=-1);let mc=pc,uf=pc;bo<0?mc=findClusterBreak(hc.text,pc,!1):uf=findClusterBreak(hc.text,pc);let df=Ra(hc.text.slice(mc,uf));for(;mc>0;){let ff=findClusterBreak(hc.text,mc,!1);if(Ra(hc.text.slice(ff,mc))!=df)break;mc=ff}for(;uf<hc.length;){let ff=findClusterBreak(hc.text,uf);if(Ra(hc.text.slice(uf,ff))!=df)break;uf=ff}return EditorSelection.range(mc+hc.from,uf+hc.from)}function getdx(vo,Ai){return Ai.left>vo?Ai.left-vo:Math.max(0,vo-Ai.right)}function getdy(vo,Ai){return Ai.top>vo?Ai.top-vo:Math.max(0,vo-Ai.bottom)}function yOverlap(vo,Ai){return vo.top<Ai.bottom-1&&vo.bottom>Ai.top+1}function upTop(vo,Ai){return Ai<vo.top?{top:Ai,left:vo.left,right:vo.right,bottom:vo.bottom}:vo}function upBot(vo,Ai){return Ai>vo.bottom?{top:vo.top,left:vo.left,right:vo.right,bottom:Ai}:vo}function domPosAtCoords(vo,Ai,bo){let Ra,hc,pc,mc,uf=!1,df,ff,hf,pf;for(let yf=vo.firstChild;yf;yf=yf.nextSibling){let vf=clientRectsFor(yf);for(let bf=0;bf<vf.length;bf++){let Sf=vf[bf];hc&&yOverlap(hc,Sf)&&(Sf=upTop(upBot(Sf,hc.bottom),hc.top));let xf=getdx(Ai,Sf),wf=getdy(bo,Sf);if(xf==0&&wf==0)return yf.nodeType==3?domPosInText(yf,Ai,bo):domPosAtCoords(yf,Ai,bo);if(!Ra||mc>wf||mc==wf&&pc>xf){Ra=yf,hc=Sf,pc=xf,mc=wf;let s1=wf?bo<Sf.top?-1:1:xf?Ai<Sf.left?-1:1:0;uf=!s1||(s1>0?bf<vf.length-1:bf>0)}xf==0?bo>Sf.bottom&&(!hf||hf.bottom<Sf.bottom)?(df=yf,hf=Sf):bo<Sf.top&&(!pf||pf.top>Sf.top)&&(ff=yf,pf=Sf):hf&&yOverlap(hf,Sf)?hf=upBot(hf,Sf.bottom):pf&&yOverlap(pf,Sf)&&(pf=upTop(pf,Sf.top))}}if(hf&&hf.bottom>=bo?(Ra=df,hc=hf):pf&&pf.top<=bo&&(Ra=ff,hc=pf),!Ra)return{node:vo,offset:0};let mf=Math.max(hc.left,Math.min(hc.right,Ai));if(Ra.nodeType==3)return domPosInText(Ra,mf,bo);if(uf&&Ra.contentEditable!="false")return domPosAtCoords(Ra,mf,bo);let gf=Array.prototype.indexOf.call(vo.childNodes,Ra)+(Ai>=(hc.left+hc.right)/2?1:0);return{node:vo,offset:gf}}function domPosInText(vo,Ai,bo){let Ra=vo.nodeValue.length,hc=-1,pc=1e9,mc=0;for(let uf=0;uf<Ra;uf++){let df=textRange(vo,uf,uf+1).getClientRects();for(let ff=0;ff<df.length;ff++){let hf=df[ff];if(hf.top==hf.bottom)continue;mc||(mc=Ai-hf.left);let pf=(hf.top>bo?hf.top-bo:bo-hf.bottom)-1;if(hf.left-1<=Ai&&hf.right+1>=Ai&&pf<pc){let mf=Ai>=(hf.left+hf.right)/2,gf=mf;if((browser.chrome||browser.gecko)&&textRange(vo,uf).getBoundingClientRect().left==hf.right&&(gf=!mf),pf<=0)return{node:vo,offset:uf+(gf?1:0)};hc=uf+(gf?1:0),pc=pf}}}return{node:vo,offset:hc>-1?hc:mc>0?vo.nodeValue.length:0}}function posAtCoords(vo,Ai,bo,Ra=-1){var hc,pc;let mc=vo.contentDOM.getBoundingClientRect(),uf=mc.top+vo.viewState.paddingTop,df,{docHeight:ff}=vo.viewState,{x:hf,y:pf}=Ai,mf=pf-uf;if(mf<0)return 0;if(mf>ff)return vo.state.doc.length;for(let s1=vo.viewState.heightOracle.textHeight/2,If=!1;df=vo.elementAtHeight(mf),df.type!=BlockType.Text;)for(;mf=Ra>0?df.bottom+s1:df.top-s1,!(mf>=0&&mf<=ff);){if(If)return bo?null:0;If=!0,Ra=-Ra}pf=uf+mf;let gf=df.from;if(gf<vo.viewport.from)return vo.viewport.from==0?0:bo?null:posAtCoordsImprecise(vo,mc,df,hf,pf);if(gf>vo.viewport.to)return vo.viewport.to==vo.state.doc.length?vo.state.doc.length:bo?null:posAtCoordsImprecise(vo,mc,df,hf,pf);let yf=vo.dom.ownerDocument,vf=vo.root.elementFromPoint?vo.root:yf,bf=vf.elementFromPoint(hf,pf);bf&&!vo.contentDOM.contains(bf)&&(bf=null),bf||(hf=Math.max(mc.left+1,Math.min(mc.right-1,hf)),bf=vf.elementFromPoint(hf,pf),bf&&!vo.contentDOM.contains(bf)&&(bf=null));let Sf,xf=-1;if(bf&&((hc=vo.docView.nearest(bf))===null||hc===void 0?void 0:hc.isEditable)!=!1){if(yf.caretPositionFromPoint){let s1=yf.caretPositionFromPoint(hf,pf);s1&&({offsetNode:Sf,offset:xf}=s1)}else if(yf.caretRangeFromPoint){let s1=yf.caretRangeFromPoint(hf,pf);s1&&({startContainer:Sf,startOffset:xf}=s1,(!vo.contentDOM.contains(Sf)||browser.safari&&isSuspiciousSafariCaretResult(Sf,xf,hf)||browser.chrome&&isSuspiciousChromeCaretResult(Sf,xf,hf))&&(Sf=void 0))}Sf&&(xf=Math.min(maxOffset(Sf),xf))}if(!Sf||!vo.docView.dom.contains(Sf)){let s1=LineView.find(vo.docView,gf);if(!s1)return mf>df.top+df.height/2?df.to:df.from;({node:Sf,offset:xf}=domPosAtCoords(s1.dom,hf,pf))}let wf=vo.docView.nearest(Sf);if(!wf)return null;if(wf.isWidget&&((pc=wf.dom)===null||pc===void 0?void 0:pc.nodeType)==1){let s1=wf.dom.getBoundingClientRect();return Ai.y<s1.top||Ai.y<=s1.bottom&&Ai.x<=(s1.left+s1.right)/2?wf.posAtStart:wf.posAtEnd}else return wf.localPosFromDOM(Sf,xf)+wf.posAtStart}function posAtCoordsImprecise(vo,Ai,bo,Ra,hc){let pc=Math.round((Ra-Ai.left)*vo.defaultCharacterWidth);if(vo.lineWrapping&&bo.height>vo.defaultLineHeight*1.5){let uf=vo.viewState.heightOracle.textHeight,df=Math.floor((hc-bo.top-(vo.defaultLineHeight-uf)*.5)/uf);pc+=df*vo.viewState.heightOracle.lineLength}let mc=vo.state.sliceDoc(bo.from,bo.to);return bo.from+findColumn(mc,pc,vo.state.tabSize)}function isSuspiciousSafariCaretResult(vo,Ai,bo){let Ra;if(vo.nodeType!=3||Ai!=(Ra=vo.nodeValue.length))return!1;for(let hc=vo.nextSibling;hc;hc=hc.nextSibling)if(hc.nodeType!=1||hc.nodeName!="BR")return!1;return textRange(vo,Ra-1,Ra).getBoundingClientRect().left>bo}function isSuspiciousChromeCaretResult(vo,Ai,bo){if(Ai!=0)return!1;for(let hc=vo;;){let pc=hc.parentNode;if(!pc||pc.nodeType!=1||pc.firstChild!=hc)return!1;if(pc.classList.contains("cm-line"))break;hc=pc}let Ra=vo.nodeType==1?vo.getBoundingClientRect():textRange(vo,0,Math.max(vo.nodeValue.length,1)).getBoundingClientRect();return bo-Ra.left>5}function blockAt(vo,Ai){let bo=vo.lineBlockAt(Ai);if(Array.isArray(bo.type)){for(let Ra of bo.type)if(Ra.to>Ai||Ra.to==Ai&&(Ra.to==bo.to||Ra.type==BlockType.Text))return Ra}return bo}function moveToLineBoundary(vo,Ai,bo,Ra){let hc=blockAt(vo,Ai.head),pc=!Ra||hc.type!=BlockType.Text||!(vo.lineWrapping||hc.widgetLineBreaks)?null:vo.coordsAtPos(Ai.assoc<0&&Ai.head>hc.from?Ai.head-1:Ai.head);if(pc){let mc=vo.dom.getBoundingClientRect(),uf=vo.textDirectionAt(hc.from),df=vo.posAtCoords({x:bo==(uf==Direction.LTR)?mc.right-1:mc.left+1,y:(pc.top+pc.bottom)/2});if(df!=null)return EditorSelection.cursor(df,bo?-1:1)}return EditorSelection.cursor(bo?hc.to:hc.from,bo?-1:1)}function moveByChar(vo,Ai,bo,Ra){let hc=vo.state.doc.lineAt(Ai.head),pc=vo.bidiSpans(hc),mc=vo.textDirectionAt(hc.from);for(let uf=Ai,df=null;;){let ff=moveVisually(hc,pc,mc,uf,bo),hf=movedOver;if(!ff){if(hc.number==(bo?vo.state.doc.lines:1))return uf;hf=`
|
|
353
|
-
`,hc=vo.state.doc.line(hc.number+(bo?1:-1)),pc=vo.bidiSpans(hc),ff=vo.visualLineSide(hc,!bo)}if(df){if(!df(hf))return uf}else{if(!Ra)return ff;df=Ra(hf)}uf=ff}}function byGroup(vo,Ai,bo){let Ra=vo.state.charCategorizer(Ai),hc=Ra(bo);return pc=>{let mc=Ra(pc);return hc==CharCategory.Space&&(hc=mc),hc==mc}}function moveVertically(vo,Ai,bo,Ra){let hc=Ai.head,pc=bo?1:-1;if(hc==(bo?vo.state.doc.length:0))return EditorSelection.cursor(hc,Ai.assoc);let mc=Ai.goalColumn,uf,df=vo.contentDOM.getBoundingClientRect(),ff=vo.coordsAtPos(hc,Ai.assoc||-1),hf=vo.documentTop;if(ff)mc==null&&(mc=ff.left-df.left),uf=pc<0?ff.top:ff.bottom;else{let gf=vo.viewState.lineBlockAt(hc);mc==null&&(mc=Math.min(df.right-df.left,vo.defaultCharacterWidth*(hc-gf.from))),uf=(pc<0?gf.top:gf.bottom)+hf}let pf=df.left+mc,mf=Ra??vo.viewState.heightOracle.textHeight>>1;for(let gf=0;;gf+=10){let yf=uf+(mf+gf)*pc,vf=posAtCoords(vo,{x:pf,y:yf},!1,pc);if(yf<df.top||yf>df.bottom||(pc<0?vf<hc:vf>hc)){let bf=vo.docView.coordsForChar(vf),Sf=!bf||yf<bf.top?-1:1;return EditorSelection.cursor(vf,Sf,void 0,mc)}}}function skipAtomicRanges(vo,Ai,bo){for(;;){let Ra=0;for(let hc of vo)hc.between(Ai-1,Ai+1,(pc,mc,uf)=>{if(Ai>pc&&Ai<mc){let df=Ra||bo||(Ai-pc<mc-Ai?-1:1);Ai=df<0?pc:mc,Ra=df}});if(!Ra)return Ai}}function skipAtoms(vo,Ai,bo){let Ra=skipAtomicRanges(vo.state.facet(atomicRanges).map(hc=>hc(vo)),bo.from,Ai.head>bo.from?-1:1);return Ra==bo.from?bo:EditorSelection.cursor(Ra,Ra<bo.from?1:-1)}const LineBreakPlaceholder="";class DOMReader{constructor(Ai,bo){this.points=Ai,this.text="",this.lineSeparator=bo.facet(EditorState.lineSeparator)}append(Ai){this.text+=Ai}lineBreak(){this.text+=LineBreakPlaceholder}readRange(Ai,bo){if(!Ai)return this;let Ra=Ai.parentNode;for(let hc=Ai;;){this.findPointBefore(Ra,hc);let pc=this.text.length;this.readNode(hc);let mc=hc.nextSibling;if(mc==bo)break;let uf=ContentView.get(hc),df=ContentView.get(mc);(uf&&df?uf.breakAfter:(uf?uf.breakAfter:isBlockElement(hc))||isBlockElement(mc)&&(hc.nodeName!="BR"||hc.cmIgnore)&&this.text.length>pc)&&this.lineBreak(),hc=mc}return this.findPointBefore(Ra,bo),this}readTextNode(Ai){let bo=Ai.nodeValue;for(let Ra of this.points)Ra.node==Ai&&(Ra.pos=this.text.length+Math.min(Ra.offset,bo.length));for(let Ra=0,hc=this.lineSeparator?null:/\r\n?|\n/g;;){let pc=-1,mc=1,uf;if(this.lineSeparator?(pc=bo.indexOf(this.lineSeparator,Ra),mc=this.lineSeparator.length):(uf=hc.exec(bo))&&(pc=uf.index,mc=uf[0].length),this.append(bo.slice(Ra,pc<0?bo.length:pc)),pc<0)break;if(this.lineBreak(),mc>1)for(let df of this.points)df.node==Ai&&df.pos>this.text.length&&(df.pos-=mc-1);Ra=pc+mc}}readNode(Ai){if(Ai.cmIgnore)return;let bo=ContentView.get(Ai),Ra=bo&&bo.overrideDOMText;if(Ra!=null){this.findPointInside(Ai,Ra.length);for(let hc=Ra.iter();!hc.next().done;)hc.lineBreak?this.lineBreak():this.append(hc.value)}else Ai.nodeType==3?this.readTextNode(Ai):Ai.nodeName=="BR"?Ai.nextSibling&&this.lineBreak():Ai.nodeType==1&&this.readRange(Ai.firstChild,null)}findPointBefore(Ai,bo){for(let Ra of this.points)Ra.node==Ai&&Ai.childNodes[Ra.offset]==bo&&(Ra.pos=this.text.length)}findPointInside(Ai,bo){for(let Ra of this.points)(Ai.nodeType==3?Ra.node==Ai:Ai.contains(Ra.node))&&(Ra.pos=this.text.length+(isAtEnd(Ai,Ra.node,Ra.offset)?bo:0))}}function isAtEnd(vo,Ai,bo){for(;;){if(!Ai||bo<maxOffset(Ai))return!1;if(Ai==vo)return!0;bo=domIndex(Ai)+1,Ai=Ai.parentNode}}class DOMPoint{constructor(Ai,bo){this.node=Ai,this.offset=bo,this.pos=-1}}class DOMChange{constructor(Ai,bo,Ra,hc){this.typeOver=hc,this.bounds=null,this.text="",this.domChanged=bo>-1;let{impreciseHead:pc,impreciseAnchor:mc}=Ai.docView;if(Ai.state.readOnly&&bo>-1)this.newSel=null;else if(bo>-1&&(this.bounds=Ai.docView.domBoundsAround(bo,Ra,0))){let uf=pc||mc?[]:selectionPoints(Ai),df=new DOMReader(uf,Ai.state);df.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=df.text,this.newSel=selectionFromPoints(uf,this.bounds.from)}else{let uf=Ai.observer.selectionRange,df=pc&&pc.node==uf.focusNode&&pc.offset==uf.focusOffset||!contains(Ai.contentDOM,uf.focusNode)?Ai.state.selection.main.head:Ai.docView.posFromDOM(uf.focusNode,uf.focusOffset),ff=mc&&mc.node==uf.anchorNode&&mc.offset==uf.anchorOffset||!contains(Ai.contentDOM,uf.anchorNode)?Ai.state.selection.main.anchor:Ai.docView.posFromDOM(uf.anchorNode,uf.anchorOffset),hf=Ai.viewport;if((browser.ios||browser.chrome)&&Ai.state.selection.main.empty&&df!=ff&&(hf.from>0||hf.to<Ai.state.doc.length)){let pf=Math.min(df,ff),mf=Math.max(df,ff),gf=hf.from-pf,yf=hf.to-mf;(gf==0||gf==1||pf==0)&&(yf==0||yf==-1||mf==Ai.state.doc.length)&&(df=0,ff=Ai.state.doc.length)}this.newSel=EditorSelection.single(ff,df)}}}function applyDOMChange(vo,Ai){let bo,{newSel:Ra}=Ai,hc=vo.state.selection.main,pc=vo.inputState.lastKeyTime>Date.now()-100?vo.inputState.lastKeyCode:-1;if(Ai.bounds){let{from:mc,to:uf}=Ai.bounds,df=hc.from,ff=null;(pc===8||browser.android&&Ai.text.length<uf-mc)&&(df=hc.to,ff="end");let hf=findDiff(vo.state.doc.sliceString(mc,uf,LineBreakPlaceholder),Ai.text,df-mc,ff);hf&&(browser.chrome&&pc==13&&hf.toB==hf.from+2&&Ai.text.slice(hf.from,hf.toB)==LineBreakPlaceholder+LineBreakPlaceholder&&hf.toB--,bo={from:mc+hf.from,to:mc+hf.toA,insert:Text.of(Ai.text.slice(hf.from,hf.toB).split(LineBreakPlaceholder))})}else Ra&&(!vo.hasFocus&&vo.state.facet(editable)||Ra.main.eq(hc))&&(Ra=null);if(!bo&&!Ra)return!1;if(!bo&&Ai.typeOver&&!hc.empty&&Ra&&Ra.main.empty?bo={from:hc.from,to:hc.to,insert:vo.state.doc.slice(hc.from,hc.to)}:bo&&bo.from>=hc.from&&bo.to<=hc.to&&(bo.from!=hc.from||bo.to!=hc.to)&&hc.to-hc.from-(bo.to-bo.from)<=4?bo={from:hc.from,to:hc.to,insert:vo.state.doc.slice(hc.from,bo.from).append(bo.insert).append(vo.state.doc.slice(bo.to,hc.to))}:(browser.mac||browser.android)&&bo&&bo.from==bo.to&&bo.from==hc.head-1&&/^\. ?$/.test(bo.insert.toString())&&vo.contentDOM.getAttribute("autocorrect")=="off"?(Ra&&bo.insert.length==2&&(Ra=EditorSelection.single(Ra.main.anchor-1,Ra.main.head-1)),bo={from:hc.from,to:hc.to,insert:Text.of([" "])}):browser.chrome&&bo&&bo.from==bo.to&&bo.from==hc.head&&bo.insert.toString()==`
|
|
354
|
-
`&&vo.lineWrapping&&(Ra&&(Ra=EditorSelection.single(Ra.main.anchor-1,Ra.main.head-1)),bo={from:hc.from,to:hc.to,insert:Text.of([" "])}),bo)return applyDOMChangeInner(vo,bo,Ra,pc);if(Ra&&!Ra.main.eq(hc)){let mc=!1,uf="select";return vo.inputState.lastSelectionTime>Date.now()-50&&(vo.inputState.lastSelectionOrigin=="select"&&(mc=!0),uf=vo.inputState.lastSelectionOrigin),vo.dispatch({selection:Ra,scrollIntoView:mc,userEvent:uf}),!0}else return!1}function applyDOMChangeInner(vo,Ai,bo,Ra=-1){if(browser.ios&&vo.inputState.flushIOSKey(Ai))return!0;let hc=vo.state.selection.main;if(browser.android&&(Ai.to==hc.to&&(Ai.from==hc.from||Ai.from==hc.from-1&&vo.state.sliceDoc(Ai.from,hc.from)==" ")&&Ai.insert.length==1&&Ai.insert.lines==2&&dispatchKey(vo.contentDOM,"Enter",13)||(Ai.from==hc.from-1&&Ai.to==hc.to&&Ai.insert.length==0||Ra==8&&Ai.insert.length<Ai.to-Ai.from&&Ai.to>hc.head)&&dispatchKey(vo.contentDOM,"Backspace",8)||Ai.from==hc.from&&Ai.to==hc.to+1&&Ai.insert.length==0&&dispatchKey(vo.contentDOM,"Delete",46)))return!0;let pc=Ai.insert.toString();vo.inputState.composing>=0&&vo.inputState.composing++;let mc,uf=()=>mc||(mc=applyDefaultInsert(vo,Ai,bo));return vo.state.facet(inputHandler$1).some(df=>df(vo,Ai.from,Ai.to,pc,uf))||vo.dispatch(uf()),!0}function applyDefaultInsert(vo,Ai,bo){let Ra,hc=vo.state,pc=hc.selection.main;if(Ai.from>=pc.from&&Ai.to<=pc.to&&Ai.to-Ai.from>=(pc.to-pc.from)/3&&(!bo||bo.main.empty&&bo.main.from==Ai.from+Ai.insert.length)&&vo.inputState.composing<0){let uf=pc.from<Ai.from?hc.sliceDoc(pc.from,Ai.from):"",df=pc.to>Ai.to?hc.sliceDoc(Ai.to,pc.to):"";Ra=hc.replaceSelection(vo.state.toText(uf+Ai.insert.sliceString(0,void 0,vo.state.lineBreak)+df))}else{let uf=hc.changes(Ai),df=bo&&bo.main.to<=uf.newLength?bo.main:void 0;if(hc.selection.ranges.length>1&&vo.inputState.composing>=0&&Ai.to<=pc.to&&Ai.to>=pc.to-10){let ff=vo.state.sliceDoc(Ai.from,Ai.to),hf,pf=bo&&findCompositionNode(vo,bo.main.head);if(pf){let yf=Ai.insert.length-(Ai.to-Ai.from);hf={from:pf.from,to:pf.to-yf}}else hf=vo.state.doc.lineAt(pc.head);let mf=pc.to-Ai.to,gf=pc.to-pc.from;Ra=hc.changeByRange(yf=>{if(yf.from==pc.from&&yf.to==pc.to)return{changes:uf,range:df||yf.map(uf)};let vf=yf.to-mf,bf=vf-ff.length;if(yf.to-yf.from!=gf||vo.state.sliceDoc(bf,vf)!=ff||yf.to>=hf.from&&yf.from<=hf.to)return{range:yf};let Sf=hc.changes({from:bf,to:vf,insert:Ai.insert}),xf=yf.to-pc.to;return{changes:Sf,range:df?EditorSelection.range(Math.max(0,df.anchor+xf),Math.max(0,df.head+xf)):yf.map(Sf)}})}else Ra={changes:uf,selection:df&&hc.selection.replaceRange(df)}}let mc="input.type";return(vo.composing||vo.inputState.compositionPendingChange&&vo.inputState.compositionEndedAt>Date.now()-50)&&(vo.inputState.compositionPendingChange=!1,mc+=".compose",vo.inputState.compositionFirstChange&&(mc+=".start",vo.inputState.compositionFirstChange=!1)),hc.update(Ra,{userEvent:mc,scrollIntoView:!0})}function findDiff(vo,Ai,bo,Ra){let hc=Math.min(vo.length,Ai.length),pc=0;for(;pc<hc&&vo.charCodeAt(pc)==Ai.charCodeAt(pc);)pc++;if(pc==hc&&vo.length==Ai.length)return null;let mc=vo.length,uf=Ai.length;for(;mc>0&&uf>0&&vo.charCodeAt(mc-1)==Ai.charCodeAt(uf-1);)mc--,uf--;if(Ra=="end"){let df=Math.max(0,pc-Math.min(mc,uf));bo-=mc+df-pc}if(mc<pc&&vo.length<Ai.length){let df=bo<=pc&&bo>=mc?pc-bo:0;pc-=df,uf=pc+(uf-mc),mc=pc}else if(uf<pc){let df=bo<=pc&&bo>=uf?pc-bo:0;pc-=df,mc=pc+(mc-uf),uf=pc}return{from:pc,toA:mc,toB:uf}}function selectionPoints(vo){let Ai=[];if(vo.root.activeElement!=vo.contentDOM)return Ai;let{anchorNode:bo,anchorOffset:Ra,focusNode:hc,focusOffset:pc}=vo.observer.selectionRange;return bo&&(Ai.push(new DOMPoint(bo,Ra)),(hc!=bo||pc!=Ra)&&Ai.push(new DOMPoint(hc,pc))),Ai}function selectionFromPoints(vo,Ai){if(vo.length==0)return null;let bo=vo[0].pos,Ra=vo.length==2?vo[1].pos:bo;return bo>-1&&Ra>-1?EditorSelection.single(bo+Ai,Ra+Ai):null}class InputState{setSelectionOrigin(Ai){this.lastSelectionOrigin=Ai,this.lastSelectionTime=Date.now()}constructor(Ai){this.view=Ai,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=Ai.hasFocus,browser.safari&&Ai.contentDOM.addEventListener("input",()=>null),browser.gecko&&firefoxCopyCutHack(Ai.contentDOM.ownerDocument)}handleEvent(Ai){!eventBelongsToEditor(this.view,Ai)||this.ignoreDuringComposition(Ai)||Ai.type=="keydown"&&this.keydown(Ai)||this.runHandlers(Ai.type,Ai)}runHandlers(Ai,bo){let Ra=this.handlers[Ai];if(Ra){for(let hc of Ra.observers)hc(this.view,bo);for(let hc of Ra.handlers){if(bo.defaultPrevented)break;if(hc(this.view,bo)){bo.preventDefault();break}}}}ensureHandlers(Ai){let bo=computeHandlers(Ai),Ra=this.handlers,hc=this.view.contentDOM;for(let pc in bo)if(pc!="scroll"){let mc=!bo[pc].handlers.length,uf=Ra[pc];uf&&mc!=!uf.handlers.length&&(hc.removeEventListener(pc,this.handleEvent),uf=null),uf||hc.addEventListener(pc,this.handleEvent,{passive:mc})}for(let pc in Ra)pc!="scroll"&&!bo[pc]&&hc.removeEventListener(pc,this.handleEvent);this.handlers=bo}keydown(Ai){if(this.lastKeyCode=Ai.keyCode,this.lastKeyTime=Date.now(),Ai.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&Ai.keyCode!=27&&modifierCodes.indexOf(Ai.keyCode)<0&&(this.tabFocusMode=-1),browser.android&&browser.chrome&&!Ai.synthetic&&(Ai.keyCode==13||Ai.keyCode==8))return this.view.observer.delayAndroidKey(Ai.key,Ai.keyCode),!0;let bo;return browser.ios&&!Ai.synthetic&&!Ai.altKey&&!Ai.metaKey&&((bo=PendingKeys.find(Ra=>Ra.keyCode==Ai.keyCode))&&!Ai.ctrlKey||EmacsyPendingKeys.indexOf(Ai.key)>-1&&Ai.ctrlKey&&!Ai.shiftKey)?(this.pendingIOSKey=bo||Ai,setTimeout(()=>this.flushIOSKey(),250),!0):(Ai.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(Ai){let bo=this.pendingIOSKey;return!bo||bo.key=="Enter"&&Ai&&Ai.from<Ai.to&&/^\S+$/.test(Ai.insert.toString())?!1:(this.pendingIOSKey=void 0,dispatchKey(this.view.contentDOM,bo.key,bo.keyCode,bo instanceof KeyboardEvent?bo:void 0))}ignoreDuringComposition(Ai){return/^key/.test(Ai.type)?this.composing>0?!0:browser.safari&&!browser.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(Ai){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=Ai}update(Ai){this.view.observer.update(Ai),this.mouseSelection&&this.mouseSelection.update(Ai),this.draggedContent&&Ai.docChanged&&(this.draggedContent=this.draggedContent.map(Ai.changes)),Ai.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function bindHandler(vo,Ai){return(bo,Ra)=>{try{return Ai.call(vo,Ra,bo)}catch(hc){logException(bo.state,hc)}}}function computeHandlers(vo){let Ai=Object.create(null);function bo(Ra){return Ai[Ra]||(Ai[Ra]={observers:[],handlers:[]})}for(let Ra of vo){let hc=Ra.spec;if(hc&&hc.domEventHandlers)for(let pc in hc.domEventHandlers){let mc=hc.domEventHandlers[pc];mc&&bo(pc).handlers.push(bindHandler(Ra.value,mc))}if(hc&&hc.domEventObservers)for(let pc in hc.domEventObservers){let mc=hc.domEventObservers[pc];mc&&bo(pc).observers.push(bindHandler(Ra.value,mc))}}for(let Ra in handlers)bo(Ra).handlers.push(handlers[Ra]);for(let Ra in observers)bo(Ra).observers.push(observers[Ra]);return Ai}const PendingKeys=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],EmacsyPendingKeys="dthko",modifierCodes=[16,17,18,20,91,92,224,225],dragScrollMargin=6;function dragScrollSpeed(vo){return Math.max(0,vo)*.7+8}function dist(vo,Ai){return Math.max(Math.abs(vo.clientX-Ai.clientX),Math.abs(vo.clientY-Ai.clientY))}class MouseSelection{constructor(Ai,bo,Ra,hc){this.view=Ai,this.startEvent=bo,this.style=Ra,this.mustSelect=hc,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=bo,this.scrollParents=scrollableParents(Ai.contentDOM),this.atoms=Ai.state.facet(atomicRanges).map(mc=>mc(Ai));let pc=Ai.contentDOM.ownerDocument;pc.addEventListener("mousemove",this.move=this.move.bind(this)),pc.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=bo.shiftKey,this.multiple=Ai.state.facet(EditorState.allowMultipleSelections)&&addsSelectionRange(Ai,bo),this.dragging=isInPrimarySelection(Ai,bo)&&getClickType(bo)==1?null:!1}start(Ai){this.dragging===!1&&this.select(Ai)}move(Ai){if(Ai.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&dist(this.startEvent,Ai)<10)return;this.select(this.lastEvent=Ai);let bo=0,Ra=0,hc=0,pc=0,mc=this.view.win.innerWidth,uf=this.view.win.innerHeight;this.scrollParents.x&&({left:hc,right:mc}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:pc,bottom:uf}=this.scrollParents.y.getBoundingClientRect());let df=getScrollMargins(this.view);Ai.clientX-df.left<=hc+dragScrollMargin?bo=-dragScrollSpeed(hc-Ai.clientX):Ai.clientX+df.right>=mc-dragScrollMargin&&(bo=dragScrollSpeed(Ai.clientX-mc)),Ai.clientY-df.top<=pc+dragScrollMargin?Ra=-dragScrollSpeed(pc-Ai.clientY):Ai.clientY+df.bottom>=uf-dragScrollMargin&&(Ra=dragScrollSpeed(Ai.clientY-uf)),this.setScrollSpeed(bo,Ra)}up(Ai){this.dragging==null&&this.select(this.lastEvent),this.dragging||Ai.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let Ai=this.view.contentDOM.ownerDocument;Ai.removeEventListener("mousemove",this.move),Ai.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(Ai,bo){this.scrollSpeed={x:Ai,y:bo},Ai||bo?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:Ai,y:bo}=this.scrollSpeed;Ai&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=Ai,Ai=0),bo&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=bo,bo=0),(Ai||bo)&&this.view.win.scrollBy(Ai,bo),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(Ai){let bo=null;for(let Ra=0;Ra<Ai.ranges.length;Ra++){let hc=Ai.ranges[Ra],pc=null;if(hc.empty){let mc=skipAtomicRanges(this.atoms,hc.from,0);mc!=hc.from&&(pc=EditorSelection.cursor(mc,-1))}else{let mc=skipAtomicRanges(this.atoms,hc.from,-1),uf=skipAtomicRanges(this.atoms,hc.to,1);(mc!=hc.from||uf!=hc.to)&&(pc=EditorSelection.range(hc.from==hc.anchor?mc:uf,hc.from==hc.head?mc:uf))}pc&&(bo||(bo=Ai.ranges.slice()),bo[Ra]=pc)}return bo?EditorSelection.create(bo,Ai.mainIndex):Ai}select(Ai){let{view:bo}=this,Ra=this.skipAtoms(this.style.get(Ai,this.extend,this.multiple));(this.mustSelect||!Ra.eq(bo.state.selection,this.dragging===!1))&&this.view.dispatch({selection:Ra,userEvent:"select.pointer"}),this.mustSelect=!1}update(Ai){Ai.transactions.some(bo=>bo.isUserEvent("input.type"))?this.destroy():this.style.update(Ai)&&setTimeout(()=>this.select(this.lastEvent),20)}}function addsSelectionRange(vo,Ai){let bo=vo.state.facet(clickAddsSelectionRange);return bo.length?bo[0](Ai):browser.mac?Ai.metaKey:Ai.ctrlKey}function dragMovesSelection(vo,Ai){let bo=vo.state.facet(dragMovesSelection$1);return bo.length?bo[0](Ai):browser.mac?!Ai.altKey:!Ai.ctrlKey}function isInPrimarySelection(vo,Ai){let{main:bo}=vo.state.selection;if(bo.empty)return!1;let Ra=getSelection(vo.root);if(!Ra||Ra.rangeCount==0)return!0;let hc=Ra.getRangeAt(0).getClientRects();for(let pc=0;pc<hc.length;pc++){let mc=hc[pc];if(mc.left<=Ai.clientX&&mc.right>=Ai.clientX&&mc.top<=Ai.clientY&&mc.bottom>=Ai.clientY)return!0}return!1}function eventBelongsToEditor(vo,Ai){if(!Ai.bubbles)return!0;if(Ai.defaultPrevented)return!1;for(let bo=Ai.target,Ra;bo!=vo.contentDOM;bo=bo.parentNode)if(!bo||bo.nodeType==11||(Ra=ContentView.get(bo))&&Ra.ignoreEvent(Ai))return!1;return!0}const handlers=Object.create(null),observers=Object.create(null),brokenClipboardAPI=browser.ie&&browser.ie_version<15||browser.ios&&browser.webkit_version<604;function capturePaste(vo){let Ai=vo.dom.parentNode;if(!Ai)return;let bo=Ai.appendChild(document.createElement("textarea"));bo.style.cssText="position: fixed; left: -10000px; top: 10px",bo.focus(),setTimeout(()=>{vo.focus(),bo.remove(),doPaste(vo,bo.value)},50)}function textFilter(vo,Ai,bo){for(let Ra of vo.facet(Ai))bo=Ra(bo,vo);return bo}function doPaste(vo,Ai){Ai=textFilter(vo.state,clipboardInputFilter,Ai);let{state:bo}=vo,Ra,hc=1,pc=bo.toText(Ai),mc=pc.lines==bo.selection.ranges.length;if(lastLinewiseCopy!=null&&bo.selection.ranges.every(uf=>uf.empty)&&lastLinewiseCopy==pc.toString()){let uf=-1;Ra=bo.changeByRange(df=>{let ff=bo.doc.lineAt(df.from);if(ff.from==uf)return{range:df};uf=ff.from;let hf=bo.toText((mc?pc.line(hc++).text:Ai)+bo.lineBreak);return{changes:{from:ff.from,insert:hf},range:EditorSelection.cursor(df.from+hf.length)}})}else mc?Ra=bo.changeByRange(uf=>{let df=pc.line(hc++);return{changes:{from:uf.from,to:uf.to,insert:df.text},range:EditorSelection.cursor(uf.from+df.length)}}):Ra=bo.replaceSelection(pc);vo.dispatch(Ra,{userEvent:"input.paste",scrollIntoView:!0})}observers.scroll=vo=>{vo.inputState.lastScrollTop=vo.scrollDOM.scrollTop,vo.inputState.lastScrollLeft=vo.scrollDOM.scrollLeft};handlers.keydown=(vo,Ai)=>(vo.inputState.setSelectionOrigin("select"),Ai.keyCode==27&&vo.inputState.tabFocusMode!=0&&(vo.inputState.tabFocusMode=Date.now()+2e3),!1);observers.touchstart=(vo,Ai)=>{vo.inputState.lastTouchTime=Date.now(),vo.inputState.setSelectionOrigin("select.pointer")};observers.touchmove=vo=>{vo.inputState.setSelectionOrigin("select.pointer")};handlers.mousedown=(vo,Ai)=>{if(vo.observer.flush(),vo.inputState.lastTouchTime>Date.now()-2e3)return!1;let bo=null;for(let Ra of vo.state.facet(mouseSelectionStyle))if(bo=Ra(vo,Ai),bo)break;if(!bo&&Ai.button==0&&(bo=basicMouseSelection(vo,Ai)),bo){let Ra=!vo.hasFocus;vo.inputState.startMouseSelection(new MouseSelection(vo,Ai,bo,Ra)),Ra&&vo.observer.ignore(()=>{focusPreventScroll(vo.contentDOM);let pc=vo.root.activeElement;pc&&!pc.contains(vo.contentDOM)&&pc.blur()});let hc=vo.inputState.mouseSelection;if(hc)return hc.start(Ai),hc.dragging===!1}return!1};function rangeForClick(vo,Ai,bo,Ra){if(Ra==1)return EditorSelection.cursor(Ai,bo);if(Ra==2)return groupAt(vo.state,Ai,bo);{let hc=LineView.find(vo.docView,Ai),pc=vo.state.doc.lineAt(hc?hc.posAtEnd:Ai),mc=hc?hc.posAtStart:pc.from,uf=hc?hc.posAtEnd:pc.to;return uf<vo.state.doc.length&&uf==pc.to&&uf++,EditorSelection.range(mc,uf)}}let inside=(vo,Ai,bo)=>Ai>=bo.top&&Ai<=bo.bottom&&vo>=bo.left&&vo<=bo.right;function findPositionSide(vo,Ai,bo,Ra){let hc=LineView.find(vo.docView,Ai);if(!hc)return 1;let pc=Ai-hc.posAtStart;if(pc==0)return 1;if(pc==hc.length)return-1;let mc=hc.coordsAt(pc,-1);if(mc&&inside(bo,Ra,mc))return-1;let uf=hc.coordsAt(pc,1);return uf&&inside(bo,Ra,uf)?1:mc&&mc.bottom>=Ra?-1:1}function queryPos(vo,Ai){let bo=vo.posAtCoords({x:Ai.clientX,y:Ai.clientY},!1);return{pos:bo,bias:findPositionSide(vo,bo,Ai.clientX,Ai.clientY)}}const BadMouseDetail=browser.ie&&browser.ie_version<=11;let lastMouseDown=null,lastMouseDownCount=0,lastMouseDownTime=0;function getClickType(vo){if(!BadMouseDetail)return vo.detail;let Ai=lastMouseDown,bo=lastMouseDownTime;return lastMouseDown=vo,lastMouseDownTime=Date.now(),lastMouseDownCount=!Ai||bo>Date.now()-400&&Math.abs(Ai.clientX-vo.clientX)<2&&Math.abs(Ai.clientY-vo.clientY)<2?(lastMouseDownCount+1)%3:1}function basicMouseSelection(vo,Ai){let bo=queryPos(vo,Ai),Ra=getClickType(Ai),hc=vo.state.selection;return{update(pc){pc.docChanged&&(bo.pos=pc.changes.mapPos(bo.pos),hc=hc.map(pc.changes))},get(pc,mc,uf){let df=queryPos(vo,pc),ff,hf=rangeForClick(vo,df.pos,df.bias,Ra);if(bo.pos!=df.pos&&!mc){let pf=rangeForClick(vo,bo.pos,bo.bias,Ra),mf=Math.min(pf.from,hf.from),gf=Math.max(pf.to,hf.to);hf=mf<hf.from?EditorSelection.range(mf,gf):EditorSelection.range(gf,mf)}return mc?hc.replaceRange(hc.main.extend(hf.from,hf.to)):uf&&Ra==1&&hc.ranges.length>1&&(ff=removeRangeAround(hc,df.pos))?ff:uf?hc.addRange(hf):EditorSelection.create([hf])}}}function removeRangeAround(vo,Ai){for(let bo=0;bo<vo.ranges.length;bo++){let{from:Ra,to:hc}=vo.ranges[bo];if(Ra<=Ai&&hc>=Ai)return EditorSelection.create(vo.ranges.slice(0,bo).concat(vo.ranges.slice(bo+1)),vo.mainIndex==bo?0:vo.mainIndex-(vo.mainIndex>bo?1:0))}return null}handlers.dragstart=(vo,Ai)=>{let{selection:{main:bo}}=vo.state;if(Ai.target.draggable){let hc=vo.docView.nearest(Ai.target);if(hc&&hc.isWidget){let pc=hc.posAtStart,mc=pc+hc.length;(pc>=bo.to||mc<=bo.from)&&(bo=EditorSelection.range(pc,mc))}}let{inputState:Ra}=vo;return Ra.mouseSelection&&(Ra.mouseSelection.dragging=!0),Ra.draggedContent=bo,Ai.dataTransfer&&(Ai.dataTransfer.setData("Text",textFilter(vo.state,clipboardOutputFilter,vo.state.sliceDoc(bo.from,bo.to))),Ai.dataTransfer.effectAllowed="copyMove"),!1};handlers.dragend=vo=>(vo.inputState.draggedContent=null,!1);function dropText(vo,Ai,bo,Ra){if(bo=textFilter(vo.state,clipboardInputFilter,bo),!bo)return;let hc=vo.posAtCoords({x:Ai.clientX,y:Ai.clientY},!1),{draggedContent:pc}=vo.inputState,mc=Ra&&pc&&dragMovesSelection(vo,Ai)?{from:pc.from,to:pc.to}:null,uf={from:hc,insert:bo},df=vo.state.changes(mc?[mc,uf]:uf);vo.focus(),vo.dispatch({changes:df,selection:{anchor:df.mapPos(hc,-1),head:df.mapPos(hc,1)},userEvent:mc?"move.drop":"input.drop"}),vo.inputState.draggedContent=null}handlers.drop=(vo,Ai)=>{if(!Ai.dataTransfer)return!1;if(vo.state.readOnly)return!0;let bo=Ai.dataTransfer.files;if(bo&&bo.length){let Ra=Array(bo.length),hc=0,pc=()=>{++hc==bo.length&&dropText(vo,Ai,Ra.filter(mc=>mc!=null).join(vo.state.lineBreak),!1)};for(let mc=0;mc<bo.length;mc++){let uf=new FileReader;uf.onerror=pc,uf.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(uf.result)||(Ra[mc]=uf.result),pc()},uf.readAsText(bo[mc])}return!0}else{let Ra=Ai.dataTransfer.getData("Text");if(Ra)return dropText(vo,Ai,Ra,!0),!0}return!1};handlers.paste=(vo,Ai)=>{if(vo.state.readOnly)return!0;vo.observer.flush();let bo=brokenClipboardAPI?null:Ai.clipboardData;return bo?(doPaste(vo,bo.getData("text/plain")||bo.getData("text/uri-list")),!0):(capturePaste(vo),!1)};function captureCopy(vo,Ai){let bo=vo.dom.parentNode;if(!bo)return;let Ra=bo.appendChild(document.createElement("textarea"));Ra.style.cssText="position: fixed; left: -10000px; top: 10px",Ra.value=Ai,Ra.focus(),Ra.selectionEnd=Ai.length,Ra.selectionStart=0,setTimeout(()=>{Ra.remove(),vo.focus()},50)}function copiedRange(vo){let Ai=[],bo=[],Ra=!1;for(let hc of vo.selection.ranges)hc.empty||(Ai.push(vo.sliceDoc(hc.from,hc.to)),bo.push(hc));if(!Ai.length){let hc=-1;for(let{from:pc}of vo.selection.ranges){let mc=vo.doc.lineAt(pc);mc.number>hc&&(Ai.push(mc.text),bo.push({from:mc.from,to:Math.min(vo.doc.length,mc.to+1)})),hc=mc.number}Ra=!0}return{text:textFilter(vo,clipboardOutputFilter,Ai.join(vo.lineBreak)),ranges:bo,linewise:Ra}}let lastLinewiseCopy=null;handlers.copy=handlers.cut=(vo,Ai)=>{let{text:bo,ranges:Ra,linewise:hc}=copiedRange(vo.state);if(!bo&&!hc)return!1;lastLinewiseCopy=hc?bo:null,Ai.type=="cut"&&!vo.state.readOnly&&vo.dispatch({changes:Ra,scrollIntoView:!0,userEvent:"delete.cut"});let pc=brokenClipboardAPI?null:Ai.clipboardData;return pc?(pc.clearData(),pc.setData("text/plain",bo),!0):(captureCopy(vo,bo),!1)};const isFocusChange=Annotation.define();function focusChangeTransaction(vo,Ai){let bo=[];for(let Ra of vo.facet(focusChangeEffect)){let hc=Ra(vo,Ai);hc&&bo.push(hc)}return bo?vo.update({effects:bo,annotations:isFocusChange.of(!0)}):null}function updateForFocusChange(vo){setTimeout(()=>{let Ai=vo.hasFocus;if(Ai!=vo.inputState.notifiedFocused){let bo=focusChangeTransaction(vo.state,Ai);bo?vo.dispatch(bo):vo.update([])}},10)}observers.focus=vo=>{vo.inputState.lastFocusTime=Date.now(),!vo.scrollDOM.scrollTop&&(vo.inputState.lastScrollTop||vo.inputState.lastScrollLeft)&&(vo.scrollDOM.scrollTop=vo.inputState.lastScrollTop,vo.scrollDOM.scrollLeft=vo.inputState.lastScrollLeft),updateForFocusChange(vo)};observers.blur=vo=>{vo.observer.clearSelectionRange(),updateForFocusChange(vo)};observers.compositionstart=observers.compositionupdate=vo=>{vo.observer.editContext||(vo.inputState.compositionFirstChange==null&&(vo.inputState.compositionFirstChange=!0),vo.inputState.composing<0&&(vo.inputState.composing=0))};observers.compositionend=vo=>{vo.observer.editContext||(vo.inputState.composing=-1,vo.inputState.compositionEndedAt=Date.now(),vo.inputState.compositionPendingKey=!0,vo.inputState.compositionPendingChange=vo.observer.pendingRecords().length>0,vo.inputState.compositionFirstChange=null,browser.chrome&&browser.android?vo.observer.flushSoon():vo.inputState.compositionPendingChange?Promise.resolve().then(()=>vo.observer.flush()):setTimeout(()=>{vo.inputState.composing<0&&vo.docView.hasComposition&&vo.update([])},50))};observers.contextmenu=vo=>{vo.inputState.lastContextMenu=Date.now()};handlers.beforeinput=(vo,Ai)=>{var bo,Ra;if(Ai.inputType=="insertReplacementText"&&vo.observer.editContext){let pc=(bo=Ai.dataTransfer)===null||bo===void 0?void 0:bo.getData("text/plain"),mc=Ai.getTargetRanges();if(pc&&mc.length){let uf=mc[0],df=vo.posAtDOM(uf.startContainer,uf.startOffset),ff=vo.posAtDOM(uf.endContainer,uf.endOffset);return applyDOMChangeInner(vo,{from:df,to:ff,insert:vo.state.toText(pc)},null),!0}}let hc;if(browser.chrome&&browser.android&&(hc=PendingKeys.find(pc=>pc.inputType==Ai.inputType))&&(vo.observer.delayAndroidKey(hc.key,hc.keyCode),hc.key=="Backspace"||hc.key=="Delete")){let pc=((Ra=window.visualViewport)===null||Ra===void 0?void 0:Ra.height)||0;setTimeout(()=>{var mc;(((mc=window.visualViewport)===null||mc===void 0?void 0:mc.height)||0)>pc+10&&vo.hasFocus&&(vo.contentDOM.blur(),vo.focus())},100)}return browser.ios&&Ai.inputType=="deleteContentForward"&&vo.observer.flushSoon(),browser.safari&&Ai.inputType=="insertText"&&vo.inputState.composing>=0&&setTimeout(()=>observers.compositionend(vo,Ai),20),!1};const appliedFirefoxHack=new Set;function firefoxCopyCutHack(vo){appliedFirefoxHack.has(vo)||(appliedFirefoxHack.add(vo),vo.addEventListener("copy",()=>{}),vo.addEventListener("cut",()=>{}))}const wrappingWhiteSpace=["pre-wrap","normal","pre-line","break-spaces"];let heightChangeFlag=!1;function clearHeightChangeFlag(){heightChangeFlag=!1}class HeightOracle{constructor(Ai){this.lineWrapping=Ai,this.doc=Text.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(Ai,bo){let Ra=this.doc.lineAt(bo).number-this.doc.lineAt(Ai).number+1;return this.lineWrapping&&(Ra+=Math.max(0,Math.ceil((bo-Ai-Ra*this.lineLength*.5)/this.lineLength))),this.lineHeight*Ra}heightForLine(Ai){return this.lineWrapping?(1+Math.max(0,Math.ceil((Ai-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(Ai){return this.doc=Ai,this}mustRefreshForWrapping(Ai){return wrappingWhiteSpace.indexOf(Ai)>-1!=this.lineWrapping}mustRefreshForHeights(Ai){let bo=!1;for(let Ra=0;Ra<Ai.length;Ra++){let hc=Ai[Ra];hc<0?Ra++:this.heightSamples[Math.floor(hc*10)]||(bo=!0,this.heightSamples[Math.floor(hc*10)]=!0)}return bo}refresh(Ai,bo,Ra,hc,pc,mc){let uf=wrappingWhiteSpace.indexOf(Ai)>-1,df=Math.round(bo)!=Math.round(this.lineHeight)||this.lineWrapping!=uf;if(this.lineWrapping=uf,this.lineHeight=bo,this.charWidth=Ra,this.textHeight=hc,this.lineLength=pc,df){this.heightSamples={};for(let ff=0;ff<mc.length;ff++){let hf=mc[ff];hf<0?ff++:this.heightSamples[Math.floor(hf*10)]=!0}}return df}}class MeasuredHeights{constructor(Ai,bo){this.from=Ai,this.heights=bo,this.index=0}get more(){return this.index<this.heights.length}}class BlockInfo{constructor(Ai,bo,Ra,hc,pc){this.from=Ai,this.length=bo,this.top=Ra,this.height=hc,this._content=pc}get type(){return typeof this._content=="number"?BlockType.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof PointDecoration?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(Ai){let bo=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(Ai._content)?Ai._content:[Ai]);return new BlockInfo(this.from,this.length+Ai.length,this.top,this.height+Ai.height,bo)}}var QueryType$1=function(vo){return vo[vo.ByPos=0]="ByPos",vo[vo.ByHeight=1]="ByHeight",vo[vo.ByPosNoHeight=2]="ByPosNoHeight",vo}(QueryType$1||(QueryType$1={}));const Epsilon=.001;class HeightMap{constructor(Ai,bo,Ra=2){this.length=Ai,this.height=bo,this.flags=Ra}get outdated(){return(this.flags&2)>0}set outdated(Ai){this.flags=(Ai?2:0)|this.flags&-3}setHeight(Ai){this.height!=Ai&&(Math.abs(this.height-Ai)>Epsilon&&(heightChangeFlag=!0),this.height=Ai)}replace(Ai,bo,Ra){return HeightMap.of(Ra)}decomposeLeft(Ai,bo){bo.push(this)}decomposeRight(Ai,bo){bo.push(this)}applyChanges(Ai,bo,Ra,hc){let pc=this,mc=Ra.doc;for(let uf=hc.length-1;uf>=0;uf--){let{fromA:df,toA:ff,fromB:hf,toB:pf}=hc[uf],mf=pc.lineAt(df,QueryType$1.ByPosNoHeight,Ra.setDoc(bo),0,0),gf=mf.to>=ff?mf:pc.lineAt(ff,QueryType$1.ByPosNoHeight,Ra,0,0);for(pf+=gf.to-ff,ff=gf.to;uf>0&&mf.from<=hc[uf-1].toA;)df=hc[uf-1].fromA,hf=hc[uf-1].fromB,uf--,df<mf.from&&(mf=pc.lineAt(df,QueryType$1.ByPosNoHeight,Ra,0,0));hf+=mf.from-df,df=mf.from;let yf=NodeBuilder.build(Ra.setDoc(mc),Ai,hf,pf);pc=replace(pc,pc.replace(df,ff,yf))}return pc.updateHeight(Ra,0)}static empty(){return new HeightMapText(0,0)}static of(Ai){if(Ai.length==1)return Ai[0];let bo=0,Ra=Ai.length,hc=0,pc=0;for(;;)if(bo==Ra)if(hc>pc*2){let uf=Ai[bo-1];uf.break?Ai.splice(--bo,1,uf.left,null,uf.right):Ai.splice(--bo,1,uf.left,uf.right),Ra+=1+uf.break,hc-=uf.size}else if(pc>hc*2){let uf=Ai[Ra];uf.break?Ai.splice(Ra,1,uf.left,null,uf.right):Ai.splice(Ra,1,uf.left,uf.right),Ra+=2+uf.break,pc-=uf.size}else break;else if(hc<pc){let uf=Ai[bo++];uf&&(hc+=uf.size)}else{let uf=Ai[--Ra];uf&&(pc+=uf.size)}let mc=0;return Ai[bo-1]==null?(mc=1,bo--):Ai[bo]==null&&(mc=1,Ra++),new HeightMapBranch(HeightMap.of(Ai.slice(0,bo)),mc,HeightMap.of(Ai.slice(Ra)))}}function replace(vo,Ai){return vo==Ai?vo:(vo.constructor!=Ai.constructor&&(heightChangeFlag=!0),Ai)}HeightMap.prototype.size=1;class HeightMapBlock extends HeightMap{constructor(Ai,bo,Ra){super(Ai,bo),this.deco=Ra}blockAt(Ai,bo,Ra,hc){return new BlockInfo(hc,this.length,Ra,this.height,this.deco||0)}lineAt(Ai,bo,Ra,hc,pc){return this.blockAt(0,Ra,hc,pc)}forEachLine(Ai,bo,Ra,hc,pc,mc){Ai<=pc+this.length&&bo>=pc&&mc(this.blockAt(0,Ra,hc,pc))}updateHeight(Ai,bo=0,Ra=!1,hc){return hc&&hc.from<=bo&&hc.more&&this.setHeight(hc.heights[hc.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class HeightMapText extends HeightMapBlock{constructor(Ai,bo){super(Ai,bo,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(Ai,bo,Ra,hc){return new BlockInfo(hc,this.length,Ra,this.height,this.breaks)}replace(Ai,bo,Ra){let hc=Ra[0];return Ra.length==1&&(hc instanceof HeightMapText||hc instanceof HeightMapGap&&hc.flags&4)&&Math.abs(this.length-hc.length)<10?(hc instanceof HeightMapGap?hc=new HeightMapText(hc.length,this.height):hc.height=this.height,this.outdated||(hc.outdated=!1),hc):HeightMap.of(Ra)}updateHeight(Ai,bo=0,Ra=!1,hc){return hc&&hc.from<=bo&&hc.more?this.setHeight(hc.heights[hc.index++]):(Ra||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,Ai.heightForLine(this.length-this.collapsed))+this.breaks*Ai.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class HeightMapGap extends HeightMap{constructor(Ai){super(Ai,0)}heightMetrics(Ai,bo){let Ra=Ai.doc.lineAt(bo).number,hc=Ai.doc.lineAt(bo+this.length).number,pc=hc-Ra+1,mc,uf=0;if(Ai.lineWrapping){let df=Math.min(this.height,Ai.lineHeight*pc);mc=df/pc,this.length>pc+1&&(uf=(this.height-df)/(this.length-pc-1))}else mc=this.height/pc;return{firstLine:Ra,lastLine:hc,perLine:mc,perChar:uf}}blockAt(Ai,bo,Ra,hc){let{firstLine:pc,lastLine:mc,perLine:uf,perChar:df}=this.heightMetrics(bo,hc);if(bo.lineWrapping){let ff=hc+(Ai<bo.lineHeight?0:Math.round(Math.max(0,Math.min(1,(Ai-Ra)/this.height))*this.length)),hf=bo.doc.lineAt(ff),pf=uf+hf.length*df,mf=Math.max(Ra,Ai-pf/2);return new BlockInfo(hf.from,hf.length,mf,pf,0)}else{let ff=Math.max(0,Math.min(mc-pc,Math.floor((Ai-Ra)/uf))),{from:hf,length:pf}=bo.doc.line(pc+ff);return new BlockInfo(hf,pf,Ra+uf*ff,uf,0)}}lineAt(Ai,bo,Ra,hc,pc){if(bo==QueryType$1.ByHeight)return this.blockAt(Ai,Ra,hc,pc);if(bo==QueryType$1.ByPosNoHeight){let{from:gf,to:yf}=Ra.doc.lineAt(Ai);return new BlockInfo(gf,yf-gf,0,0,0)}let{firstLine:mc,perLine:uf,perChar:df}=this.heightMetrics(Ra,pc),ff=Ra.doc.lineAt(Ai),hf=uf+ff.length*df,pf=ff.number-mc,mf=hc+uf*pf+df*(ff.from-pc-pf);return new BlockInfo(ff.from,ff.length,Math.max(hc,Math.min(mf,hc+this.height-hf)),hf,0)}forEachLine(Ai,bo,Ra,hc,pc,mc){Ai=Math.max(Ai,pc),bo=Math.min(bo,pc+this.length);let{firstLine:uf,perLine:df,perChar:ff}=this.heightMetrics(Ra,pc);for(let hf=Ai,pf=hc;hf<=bo;){let mf=Ra.doc.lineAt(hf);if(hf==Ai){let yf=mf.number-uf;pf+=df*yf+ff*(Ai-pc-yf)}let gf=df+ff*mf.length;mc(new BlockInfo(mf.from,mf.length,pf,gf,0)),pf+=gf,hf=mf.to+1}}replace(Ai,bo,Ra){let hc=this.length-bo;if(hc>0){let pc=Ra[Ra.length-1];pc instanceof HeightMapGap?Ra[Ra.length-1]=new HeightMapGap(pc.length+hc):Ra.push(null,new HeightMapGap(hc-1))}if(Ai>0){let pc=Ra[0];pc instanceof HeightMapGap?Ra[0]=new HeightMapGap(Ai+pc.length):Ra.unshift(new HeightMapGap(Ai-1),null)}return HeightMap.of(Ra)}decomposeLeft(Ai,bo){bo.push(new HeightMapGap(Ai-1),null)}decomposeRight(Ai,bo){bo.push(null,new HeightMapGap(this.length-Ai-1))}updateHeight(Ai,bo=0,Ra=!1,hc){let pc=bo+this.length;if(hc&&hc.from<=bo+this.length&&hc.more){let mc=[],uf=Math.max(bo,hc.from),df=-1;for(hc.from>bo&&mc.push(new HeightMapGap(hc.from-bo-1).updateHeight(Ai,bo));uf<=pc&&hc.more;){let hf=Ai.doc.lineAt(uf).length;mc.length&&mc.push(null);let pf=hc.heights[hc.index++];df==-1?df=pf:Math.abs(pf-df)>=Epsilon&&(df=-2);let mf=new HeightMapText(hf,pf);mf.outdated=!1,mc.push(mf),uf+=hf+1}uf<=pc&&mc.push(null,new HeightMapGap(pc-uf).updateHeight(Ai,uf));let ff=HeightMap.of(mc);return(df<0||Math.abs(ff.height-this.height)>=Epsilon||Math.abs(df-this.heightMetrics(Ai,bo).perLine)>=Epsilon)&&(heightChangeFlag=!0),replace(this,ff)}else(Ra||this.outdated)&&(this.setHeight(Ai.heightForGap(bo,bo+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class HeightMapBranch extends HeightMap{constructor(Ai,bo,Ra){super(Ai.length+bo+Ra.length,Ai.height+Ra.height,bo|(Ai.outdated||Ra.outdated?2:0)),this.left=Ai,this.right=Ra,this.size=Ai.size+Ra.size}get break(){return this.flags&1}blockAt(Ai,bo,Ra,hc){let pc=Ra+this.left.height;return Ai<pc?this.left.blockAt(Ai,bo,Ra,hc):this.right.blockAt(Ai,bo,pc,hc+this.left.length+this.break)}lineAt(Ai,bo,Ra,hc,pc){let mc=hc+this.left.height,uf=pc+this.left.length+this.break,df=bo==QueryType$1.ByHeight?Ai<mc:Ai<uf,ff=df?this.left.lineAt(Ai,bo,Ra,hc,pc):this.right.lineAt(Ai,bo,Ra,mc,uf);if(this.break||(df?ff.to<uf:ff.from>uf))return ff;let hf=bo==QueryType$1.ByPosNoHeight?QueryType$1.ByPosNoHeight:QueryType$1.ByPos;return df?ff.join(this.right.lineAt(uf,hf,Ra,mc,uf)):this.left.lineAt(uf,hf,Ra,hc,pc).join(ff)}forEachLine(Ai,bo,Ra,hc,pc,mc){let uf=hc+this.left.height,df=pc+this.left.length+this.break;if(this.break)Ai<df&&this.left.forEachLine(Ai,bo,Ra,hc,pc,mc),bo>=df&&this.right.forEachLine(Ai,bo,Ra,uf,df,mc);else{let ff=this.lineAt(df,QueryType$1.ByPos,Ra,hc,pc);Ai<ff.from&&this.left.forEachLine(Ai,ff.from-1,Ra,hc,pc,mc),ff.to>=Ai&&ff.from<=bo&&mc(ff),bo>ff.to&&this.right.forEachLine(ff.to+1,bo,Ra,uf,df,mc)}}replace(Ai,bo,Ra){let hc=this.left.length+this.break;if(bo<hc)return this.balanced(this.left.replace(Ai,bo,Ra),this.right);if(Ai>this.left.length)return this.balanced(this.left,this.right.replace(Ai-hc,bo-hc,Ra));let pc=[];Ai>0&&this.decomposeLeft(Ai,pc);let mc=pc.length;for(let uf of Ra)pc.push(uf);if(Ai>0&&mergeGaps(pc,mc-1),bo<this.length){let uf=pc.length;this.decomposeRight(bo,pc),mergeGaps(pc,uf)}return HeightMap.of(pc)}decomposeLeft(Ai,bo){let Ra=this.left.length;if(Ai<=Ra)return this.left.decomposeLeft(Ai,bo);bo.push(this.left),this.break&&(Ra++,Ai>=Ra&&bo.push(null)),Ai>Ra&&this.right.decomposeLeft(Ai-Ra,bo)}decomposeRight(Ai,bo){let Ra=this.left.length,hc=Ra+this.break;if(Ai>=hc)return this.right.decomposeRight(Ai-hc,bo);Ai<Ra&&this.left.decomposeRight(Ai,bo),this.break&&Ai<hc&&bo.push(null),bo.push(this.right)}balanced(Ai,bo){return Ai.size>2*bo.size||bo.size>2*Ai.size?HeightMap.of(this.break?[Ai,null,bo]:[Ai,bo]):(this.left=replace(this.left,Ai),this.right=replace(this.right,bo),this.setHeight(Ai.height+bo.height),this.outdated=Ai.outdated||bo.outdated,this.size=Ai.size+bo.size,this.length=Ai.length+this.break+bo.length,this)}updateHeight(Ai,bo=0,Ra=!1,hc){let{left:pc,right:mc}=this,uf=bo+pc.length+this.break,df=null;return hc&&hc.from<=bo+pc.length&&hc.more?df=pc=pc.updateHeight(Ai,bo,Ra,hc):pc.updateHeight(Ai,bo,Ra),hc&&hc.from<=uf+mc.length&&hc.more?df=mc=mc.updateHeight(Ai,uf,Ra,hc):mc.updateHeight(Ai,uf,Ra),df?this.balanced(pc,mc):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function mergeGaps(vo,Ai){let bo,Ra;vo[Ai]==null&&(bo=vo[Ai-1])instanceof HeightMapGap&&(Ra=vo[Ai+1])instanceof HeightMapGap&&vo.splice(Ai-1,3,new HeightMapGap(bo.length+1+Ra.length))}const relevantWidgetHeight=5;class NodeBuilder{constructor(Ai,bo){this.pos=Ai,this.oracle=bo,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=Ai}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(Ai,bo){if(this.lineStart>-1){let Ra=Math.min(bo,this.lineEnd),hc=this.nodes[this.nodes.length-1];hc instanceof HeightMapText?hc.length+=Ra-this.pos:(Ra>this.pos||!this.isCovered)&&this.nodes.push(new HeightMapText(Ra-this.pos,-1)),this.writtenTo=Ra,bo>Ra&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=bo}point(Ai,bo,Ra){if(Ai<bo||Ra.heightRelevant){let hc=Ra.widget?Ra.widget.estimatedHeight:0,pc=Ra.widget?Ra.widget.lineBreaks:0;hc<0&&(hc=this.oracle.lineHeight);let mc=bo-Ai;Ra.block?this.addBlock(new HeightMapBlock(mc,hc,Ra)):(mc||pc||hc>=relevantWidgetHeight)&&this.addLineDeco(hc,pc,mc)}else bo>Ai&&this.span(Ai,bo);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:Ai,to:bo}=this.oracle.doc.lineAt(this.pos);this.lineStart=Ai,this.lineEnd=bo,this.writtenTo<Ai&&((this.writtenTo<Ai-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,Ai-1)),this.nodes.push(null)),this.pos>Ai&&this.nodes.push(new HeightMapText(this.pos-Ai,-1)),this.writtenTo=this.pos}blankContent(Ai,bo){let Ra=new HeightMapGap(bo-Ai);return this.oracle.doc.lineAt(Ai).to==bo&&(Ra.flags|=4),Ra}ensureLine(){this.enterLine();let Ai=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(Ai instanceof HeightMapText)return Ai;let bo=new HeightMapText(0,-1);return this.nodes.push(bo),bo}addBlock(Ai){this.enterLine();let bo=Ai.deco;bo&&bo.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(Ai),this.writtenTo=this.pos=this.pos+Ai.length,bo&&bo.endSide>0&&(this.covering=Ai)}addLineDeco(Ai,bo,Ra){let hc=this.ensureLine();hc.length+=Ra,hc.collapsed+=Ra,hc.widgetHeight=Math.max(hc.widgetHeight,Ai),hc.breaks+=bo,this.writtenTo=this.pos=this.pos+Ra}finish(Ai){let bo=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(bo instanceof HeightMapText)&&!this.isCovered?this.nodes.push(new HeightMapText(0,-1)):(this.writtenTo<this.pos||bo==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let Ra=Ai;for(let hc of this.nodes)hc instanceof HeightMapText&&hc.updateHeight(this.oracle,Ra),Ra+=hc?hc.length:1;return this.nodes}static build(Ai,bo,Ra,hc){let pc=new NodeBuilder(Ra,Ai);return RangeSet.spans(bo,Ra,hc,pc,0),pc.finish(Ra)}}function heightRelevantDecoChanges(vo,Ai,bo){let Ra=new DecorationComparator;return RangeSet.compare(vo,Ai,bo,Ra,0),Ra.changes}class DecorationComparator{constructor(){this.changes=[]}compareRange(){}comparePoint(Ai,bo,Ra,hc){(Ai<bo||Ra&&Ra.heightRelevant||hc&&hc.heightRelevant)&&addRange(Ai,bo,this.changes,5)}}function visiblePixelRange(vo,Ai){let bo=vo.getBoundingClientRect(),Ra=vo.ownerDocument,hc=Ra.defaultView||window,pc=Math.max(0,bo.left),mc=Math.min(hc.innerWidth,bo.right),uf=Math.max(0,bo.top),df=Math.min(hc.innerHeight,bo.bottom);for(let ff=vo.parentNode;ff&&ff!=Ra.body;)if(ff.nodeType==1){let hf=ff,pf=window.getComputedStyle(hf);if((hf.scrollHeight>hf.clientHeight||hf.scrollWidth>hf.clientWidth)&&pf.overflow!="visible"){let mf=hf.getBoundingClientRect();pc=Math.max(pc,mf.left),mc=Math.min(mc,mf.right),uf=Math.max(uf,mf.top),df=Math.min(ff==vo.parentNode?hc.innerHeight:df,mf.bottom)}ff=pf.position=="absolute"||pf.position=="fixed"?hf.offsetParent:hf.parentNode}else if(ff.nodeType==11)ff=ff.host;else break;return{left:pc-bo.left,right:Math.max(pc,mc)-bo.left,top:uf-(bo.top+Ai),bottom:Math.max(uf,df)-(bo.top+Ai)}}function fullPixelRange(vo,Ai){let bo=vo.getBoundingClientRect();return{left:0,right:bo.right-bo.left,top:Ai,bottom:bo.bottom-(bo.top+Ai)}}class LineGap{constructor(Ai,bo,Ra,hc){this.from=Ai,this.to=bo,this.size=Ra,this.displaySize=hc}static same(Ai,bo){if(Ai.length!=bo.length)return!1;for(let Ra=0;Ra<Ai.length;Ra++){let hc=Ai[Ra],pc=bo[Ra];if(hc.from!=pc.from||hc.to!=pc.to||hc.size!=pc.size)return!1}return!0}draw(Ai,bo){return Decoration.replace({widget:new LineGapWidget(this.displaySize*(bo?Ai.scaleY:Ai.scaleX),bo)}).range(this.from,this.to)}}class LineGapWidget extends WidgetType{constructor(Ai,bo){super(),this.size=Ai,this.vertical=bo}eq(Ai){return Ai.size==this.size&&Ai.vertical==this.vertical}toDOM(){let Ai=document.createElement("div");return this.vertical?Ai.style.height=this.size+"px":(Ai.style.width=this.size+"px",Ai.style.height="2px",Ai.style.display="inline-block"),Ai}get estimatedHeight(){return this.vertical?this.size:-1}}class ViewState{constructor(Ai){this.state=Ai,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=IdScaler,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Direction.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let bo=Ai.facet(contentAttributes).some(Ra=>typeof Ra!="function"&&Ra.class=="cm-lineWrapping");this.heightOracle=new HeightOracle(bo),this.stateDeco=Ai.facet(decorations).filter(Ra=>typeof Ra!="function"),this.heightMap=HeightMap.empty().applyChanges(this.stateDeco,Text.empty,this.heightOracle.setDoc(Ai.doc),[new ChangedRange(0,0,0,Ai.doc.length)]);for(let Ra=0;Ra<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());Ra++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Decoration.set(this.lineGaps.map(Ra=>Ra.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let Ai=[this.viewport],{main:bo}=this.state.selection;for(let Ra=0;Ra<=1;Ra++){let hc=Ra?bo.head:bo.anchor;if(!Ai.some(({from:pc,to:mc})=>hc>=pc&&hc<=mc)){let{from:pc,to:mc}=this.lineBlockAt(hc);Ai.push(new Viewport(pc,mc))}}return this.viewports=Ai.sort((Ra,hc)=>Ra.from-hc.from),this.updateScaler()}updateScaler(){let Ai=this.scaler;return this.scaler=this.heightMap.height<=7e6?IdScaler:new BigScaler(this.heightOracle,this.heightMap,this.viewports),Ai.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,Ai=>{this.viewportLines.push(scaleBlock(Ai,this.scaler))})}update(Ai,bo=null){this.state=Ai.state;let Ra=this.stateDeco;this.stateDeco=this.state.facet(decorations).filter(hf=>typeof hf!="function");let hc=Ai.changedRanges,pc=ChangedRange.extendWithRanges(hc,heightRelevantDecoChanges(Ra,this.stateDeco,Ai?Ai.changes:ChangeSet.empty(this.state.doc.length))),mc=this.heightMap.height,uf=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);clearHeightChangeFlag(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,Ai.startState.doc,this.heightOracle.setDoc(this.state.doc),pc),(this.heightMap.height!=mc||heightChangeFlag)&&(Ai.flags|=2),uf?(this.scrollAnchorPos=Ai.changes.mapPos(uf.from,-1),this.scrollAnchorHeight=uf.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let df=pc.length?this.mapViewport(this.viewport,Ai.changes):this.viewport;(bo&&(bo.range.head<df.from||bo.range.head>df.to)||!this.viewportIsAppropriate(df))&&(df=this.getViewport(0,bo));let ff=df.from!=this.viewport.from||df.to!=this.viewport.to;this.viewport=df,Ai.flags|=this.updateForViewport(),(ff||!Ai.changes.empty||Ai.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,Ai.changes))),Ai.flags|=this.computeVisibleRanges(Ai.changes),bo&&(this.scrollTarget=bo),!this.mustEnforceCursorAssoc&&Ai.selectionSet&&Ai.view.lineWrapping&&Ai.state.selection.main.empty&&Ai.state.selection.main.assoc&&!Ai.state.facet(nativeSelectionHidden)&&(this.mustEnforceCursorAssoc=!0)}measure(Ai){let bo=Ai.contentDOM,Ra=window.getComputedStyle(bo),hc=this.heightOracle,pc=Ra.whiteSpace;this.defaultTextDirection=Ra.direction=="rtl"?Direction.RTL:Direction.LTR;let mc=this.heightOracle.mustRefreshForWrapping(pc),uf=bo.getBoundingClientRect(),df=mc||this.mustMeasureContent||this.contentDOMHeight!=uf.height;this.contentDOMHeight=uf.height,this.mustMeasureContent=!1;let ff=0,hf=0;if(uf.width&&uf.height){let{scaleX:s1,scaleY:If}=getScale(bo,uf);(s1>.005&&Math.abs(this.scaleX-s1)>.005||If>.005&&Math.abs(this.scaleY-If)>.005)&&(this.scaleX=s1,this.scaleY=If,ff|=16,mc=df=!0)}let pf=(parseInt(Ra.paddingTop)||0)*this.scaleY,mf=(parseInt(Ra.paddingBottom)||0)*this.scaleY;(this.paddingTop!=pf||this.paddingBottom!=mf)&&(this.paddingTop=pf,this.paddingBottom=mf,ff|=18),this.editorWidth!=Ai.scrollDOM.clientWidth&&(hc.lineWrapping&&(df=!0),this.editorWidth=Ai.scrollDOM.clientWidth,ff|=16);let gf=Ai.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=gf&&(this.scrollAnchorHeight=-1,this.scrollTop=gf),this.scrolledToBottom=isScrolledToBottom(Ai.scrollDOM);let yf=(this.printing?fullPixelRange:visiblePixelRange)(bo,this.paddingTop),vf=yf.top-this.pixelViewport.top,bf=yf.bottom-this.pixelViewport.bottom;this.pixelViewport=yf;let Sf=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(Sf!=this.inView&&(this.inView=Sf,Sf&&(df=!0)),!this.inView&&!this.scrollTarget)return 0;let xf=uf.width;if((this.contentDOMWidth!=xf||this.editorHeight!=Ai.scrollDOM.clientHeight)&&(this.contentDOMWidth=uf.width,this.editorHeight=Ai.scrollDOM.clientHeight,ff|=16),df){let s1=Ai.docView.measureVisibleLineHeights(this.viewport);if(hc.mustRefreshForHeights(s1)&&(mc=!0),mc||hc.lineWrapping&&Math.abs(xf-this.contentDOMWidth)>hc.charWidth){let{lineHeight:If,charWidth:l1,textHeight:c1}=Ai.docView.measureTextSize();mc=If>0&&hc.refresh(pc,If,l1,c1,xf/l1,s1),mc&&(Ai.docView.minWidth=0,ff|=16)}vf>0&&bf>0?hf=Math.max(vf,bf):vf<0&&bf<0&&(hf=Math.min(vf,bf)),clearHeightChangeFlag();for(let If of this.viewports){let l1=If.from==this.viewport.from?s1:Ai.docView.measureVisibleLineHeights(If);this.heightMap=(mc?HeightMap.empty().applyChanges(this.stateDeco,Text.empty,this.heightOracle,[new ChangedRange(0,0,0,Ai.state.doc.length)]):this.heightMap).updateHeight(hc,0,mc,new MeasuredHeights(If.from,l1))}heightChangeFlag&&(ff|=2)}let wf=!this.viewportIsAppropriate(this.viewport,hf)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return wf&&(ff&2&&(ff|=this.updateScaler()),this.viewport=this.getViewport(hf,this.scrollTarget),ff|=this.updateForViewport()),(ff&2||wf)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(mc?[]:this.lineGaps,Ai)),ff|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,Ai.docView.enforceCursorAssoc()),ff}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(Ai,bo){let Ra=.5-Math.max(-.5,Math.min(.5,Ai/1e3/2)),hc=this.heightMap,pc=this.heightOracle,{visibleTop:mc,visibleBottom:uf}=this,df=new Viewport(hc.lineAt(mc-Ra*1e3,QueryType$1.ByHeight,pc,0,0).from,hc.lineAt(uf+(1-Ra)*1e3,QueryType$1.ByHeight,pc,0,0).to);if(bo){let{head:ff}=bo.range;if(ff<df.from||ff>df.to){let hf=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),pf=hc.lineAt(ff,QueryType$1.ByPos,pc,0,0),mf;bo.y=="center"?mf=(pf.top+pf.bottom)/2-hf/2:bo.y=="start"||bo.y=="nearest"&&ff<df.from?mf=pf.top:mf=pf.bottom-hf,df=new Viewport(hc.lineAt(mf-1e3/2,QueryType$1.ByHeight,pc,0,0).from,hc.lineAt(mf+hf+1e3/2,QueryType$1.ByHeight,pc,0,0).to)}}return df}mapViewport(Ai,bo){let Ra=bo.mapPos(Ai.from,-1),hc=bo.mapPos(Ai.to,1);return new Viewport(this.heightMap.lineAt(Ra,QueryType$1.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(hc,QueryType$1.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:Ai,to:bo},Ra=0){if(!this.inView)return!0;let{top:hc}=this.heightMap.lineAt(Ai,QueryType$1.ByPos,this.heightOracle,0,0),{bottom:pc}=this.heightMap.lineAt(bo,QueryType$1.ByPos,this.heightOracle,0,0),{visibleTop:mc,visibleBottom:uf}=this;return(Ai==0||hc<=mc-Math.max(10,Math.min(-Ra,250)))&&(bo==this.state.doc.length||pc>=uf+Math.max(10,Math.min(Ra,250)))&&hc>mc-2*1e3&&pc<uf+2*1e3}mapLineGaps(Ai,bo){if(!Ai.length||bo.empty)return Ai;let Ra=[];for(let hc of Ai)bo.touchesRange(hc.from,hc.to)||Ra.push(new LineGap(bo.mapPos(hc.from),bo.mapPos(hc.to),hc.size,hc.displaySize));return Ra}ensureLineGaps(Ai,bo){let Ra=this.heightOracle.lineWrapping,hc=Ra?1e4:2e3,pc=hc>>1,mc=hc<<1;if(this.defaultTextDirection!=Direction.LTR&&!Ra)return[];let uf=[],df=(hf,pf,mf,gf)=>{if(pf-hf<pc)return;let yf=this.state.selection.main,vf=[yf.from];yf.empty||vf.push(yf.to);for(let Sf of vf)if(Sf>hf&&Sf<pf){df(hf,Sf-10,mf,gf),df(Sf+10,pf,mf,gf);return}let bf=find(Ai,Sf=>Sf.from>=mf.from&&Sf.to<=mf.to&&Math.abs(Sf.from-hf)<pc&&Math.abs(Sf.to-pf)<pc&&!vf.some(xf=>Sf.from<xf&&Sf.to>xf));if(!bf){if(pf<mf.to&&bo&&Ra&&bo.visibleRanges.some(wf=>wf.from<=pf&&wf.to>=pf)){let wf=bo.moveToLineBoundary(EditorSelection.cursor(pf),!1,!0).head;wf>hf&&(pf=wf)}let Sf=this.gapSize(mf,hf,pf,gf),xf=Ra||Sf<2e6?Sf:2e6;bf=new LineGap(hf,pf,Sf,xf)}uf.push(bf)},ff=hf=>{if(hf.length<mc||hf.type!=BlockType.Text)return;let pf=lineStructure(hf.from,hf.to,this.stateDeco);if(pf.total<mc)return;let mf=this.scrollTarget?this.scrollTarget.range.head:null,gf,yf;if(Ra){let vf=hc/this.heightOracle.lineLength*this.heightOracle.lineHeight,bf,Sf;if(mf!=null){let xf=findFraction(pf,mf),wf=((this.visibleBottom-this.visibleTop)/2+vf)/hf.height;bf=xf-wf,Sf=xf+wf}else bf=(this.visibleTop-hf.top-vf)/hf.height,Sf=(this.visibleBottom-hf.top+vf)/hf.height;gf=findPosition(pf,bf),yf=findPosition(pf,Sf)}else{let vf=pf.total*this.heightOracle.charWidth,bf=hc*this.heightOracle.charWidth,Sf=0;if(vf>2e6)for(let l1 of Ai)l1.from>=hf.from&&l1.from<hf.to&&l1.size!=l1.displaySize&&l1.from*this.heightOracle.charWidth+Sf<this.pixelViewport.left&&(Sf=l1.size-l1.displaySize);let xf=this.pixelViewport.left+Sf,wf=this.pixelViewport.right+Sf,s1,If;if(mf!=null){let l1=findFraction(pf,mf),c1=((wf-xf)/2+bf)/vf;s1=l1-c1,If=l1+c1}else s1=(xf-bf)/vf,If=(wf+bf)/vf;gf=findPosition(pf,s1),yf=findPosition(pf,If)}gf>hf.from&&df(hf.from,gf,hf,pf),yf<hf.to&&df(yf,hf.to,hf,pf)};for(let hf of this.viewportLines)Array.isArray(hf.type)?hf.type.forEach(ff):ff(hf);return uf}gapSize(Ai,bo,Ra,hc){let pc=findFraction(hc,Ra)-findFraction(hc,bo);return this.heightOracle.lineWrapping?Ai.height*pc:hc.total*this.heightOracle.charWidth*pc}updateLineGaps(Ai){LineGap.same(Ai,this.lineGaps)||(this.lineGaps=Ai,this.lineGapDeco=Decoration.set(Ai.map(bo=>bo.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(Ai){let bo=this.stateDeco;this.lineGaps.length&&(bo=bo.concat(this.lineGapDeco));let Ra=[];RangeSet.spans(bo,this.viewport.from,this.viewport.to,{span(pc,mc){Ra.push({from:pc,to:mc})},point(){}},20);let hc=0;if(Ra.length!=this.visibleRanges.length)hc=12;else for(let pc=0;pc<Ra.length&&!(hc&8);pc++){let mc=this.visibleRanges[pc],uf=Ra[pc];(mc.from!=uf.from||mc.to!=uf.to)&&(hc|=4,Ai&&Ai.mapPos(mc.from,-1)==uf.from&&Ai.mapPos(mc.to,1)==uf.to||(hc|=8))}return this.visibleRanges=Ra,hc}lineBlockAt(Ai){return Ai>=this.viewport.from&&Ai<=this.viewport.to&&this.viewportLines.find(bo=>bo.from<=Ai&&bo.to>=Ai)||scaleBlock(this.heightMap.lineAt(Ai,QueryType$1.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(Ai){return Ai>=this.viewportLines[0].top&&Ai<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(bo=>bo.top<=Ai&&bo.bottom>=Ai)||scaleBlock(this.heightMap.lineAt(this.scaler.fromDOM(Ai),QueryType$1.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(Ai){let bo=this.lineBlockAtHeight(Ai+8);return bo.from>=this.viewport.from||this.viewportLines[0].top-Ai>200?bo:this.viewportLines[0]}elementAtHeight(Ai){return scaleBlock(this.heightMap.blockAt(this.scaler.fromDOM(Ai),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Viewport{constructor(Ai,bo){this.from=Ai,this.to=bo}}function lineStructure(vo,Ai,bo){let Ra=[],hc=vo,pc=0;return RangeSet.spans(bo,vo,Ai,{span(){},point(mc,uf){mc>hc&&(Ra.push({from:hc,to:mc}),pc+=mc-hc),hc=uf}},20),hc<Ai&&(Ra.push({from:hc,to:Ai}),pc+=Ai-hc),{total:pc,ranges:Ra}}function findPosition({total:vo,ranges:Ai},bo){if(bo<=0)return Ai[0].from;if(bo>=1)return Ai[Ai.length-1].to;let Ra=Math.floor(vo*bo);for(let hc=0;;hc++){let{from:pc,to:mc}=Ai[hc],uf=mc-pc;if(Ra<=uf)return pc+Ra;Ra-=uf}}function findFraction(vo,Ai){let bo=0;for(let{from:Ra,to:hc}of vo.ranges){if(Ai<=hc){bo+=Ai-Ra;break}bo+=hc-Ra}return bo/vo.total}function find(vo,Ai){for(let bo of vo)if(Ai(bo))return bo}const IdScaler={toDOM(vo){return vo},fromDOM(vo){return vo},scale:1,eq(vo){return vo==this}};class BigScaler{constructor(Ai,bo,Ra){let hc=0,pc=0,mc=0;this.viewports=Ra.map(({from:uf,to:df})=>{let ff=bo.lineAt(uf,QueryType$1.ByPos,Ai,0,0).top,hf=bo.lineAt(df,QueryType$1.ByPos,Ai,0,0).bottom;return hc+=hf-ff,{from:uf,to:df,top:ff,bottom:hf,domTop:0,domBottom:0}}),this.scale=(7e6-hc)/(bo.height-hc);for(let uf of this.viewports)uf.domTop=mc+(uf.top-pc)*this.scale,mc=uf.domBottom=uf.domTop+(uf.bottom-uf.top),pc=uf.bottom}toDOM(Ai){for(let bo=0,Ra=0,hc=0;;bo++){let pc=bo<this.viewports.length?this.viewports[bo]:null;if(!pc||Ai<pc.top)return hc+(Ai-Ra)*this.scale;if(Ai<=pc.bottom)return pc.domTop+(Ai-pc.top);Ra=pc.bottom,hc=pc.domBottom}}fromDOM(Ai){for(let bo=0,Ra=0,hc=0;;bo++){let pc=bo<this.viewports.length?this.viewports[bo]:null;if(!pc||Ai<pc.domTop)return Ra+(Ai-hc)/this.scale;if(Ai<=pc.domBottom)return pc.top+(Ai-pc.domTop);Ra=pc.bottom,hc=pc.domBottom}}eq(Ai){return Ai instanceof BigScaler?this.scale==Ai.scale&&this.viewports.length==Ai.viewports.length&&this.viewports.every((bo,Ra)=>bo.from==Ai.viewports[Ra].from&&bo.to==Ai.viewports[Ra].to):!1}}function scaleBlock(vo,Ai){if(Ai.scale==1)return vo;let bo=Ai.toDOM(vo.top),Ra=Ai.toDOM(vo.bottom);return new BlockInfo(vo.from,vo.length,bo,Ra-bo,Array.isArray(vo._content)?vo._content.map(hc=>scaleBlock(hc,Ai)):vo._content)}const theme=Facet.define({combine:vo=>vo.join(" ")}),darkTheme=Facet.define({combine:vo=>vo.indexOf(!0)>-1}),baseThemeID=StyleModule.newName(),baseLightID=StyleModule.newName(),baseDarkID=StyleModule.newName(),lightDarkIDs={"&light":"."+baseLightID,"&dark":"."+baseDarkID};function buildTheme(vo,Ai,bo){return new StyleModule(Ai,{finish(Ra){return/&/.test(Ra)?Ra.replace(/&\w*/,hc=>{if(hc=="&")return vo;if(!bo||!bo[hc])throw new RangeError(`Unsupported selector: ${hc}`);return bo[hc]}):vo+" "+Ra}})}const baseTheme$1$2=buildTheme("."+baseThemeID,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},lightDarkIDs),observeOptions={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},useCharData=browser.ie&&browser.ie_version<=11;class DOMObserver{constructor(Ai){this.view=Ai,this.active=!1,this.editContext=null,this.selectionRange=new DOMSelectionState,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=Ai.contentDOM,this.observer=new MutationObserver(bo=>{for(let Ra of bo)this.queue.push(Ra);(browser.ie&&browser.ie_version<=11||browser.ios&&Ai.composing)&&bo.some(Ra=>Ra.type=="childList"&&Ra.removedNodes.length||Ra.type=="characterData"&&Ra.oldValue.length>Ra.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Ai.constructor.EDIT_CONTEXT!==!1&&!(browser.chrome&&browser.chrome_version<126)&&(this.editContext=new EditContextManager(Ai),Ai.state.facet(editable)&&(Ai.contentDOM.editContext=this.editContext.editContext)),useCharData&&(this.onCharData=bo=>{this.queue.push({target:bo.target,type:"characterData",oldValue:bo.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var bo;((bo=this.view.docView)===null||bo===void 0?void 0:bo.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(Ai.scrollDOM)),this.addWindowListeners(this.win=Ai.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(bo=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),bo.length>0&&bo[bo.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(bo=>{bo.length>0&&bo[bo.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(Ai){this.view.inputState.runHandlers("scroll",Ai),this.intersecting&&this.view.measure()}onScroll(Ai){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(Ai)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(Ai){(Ai.type=="change"||!Ai.type)&&!Ai.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(Ai){if(this.gapIntersection&&(Ai.length!=this.gaps.length||this.gaps.some((bo,Ra)=>bo!=Ai[Ra]))){this.gapIntersection.disconnect();for(let bo of Ai)this.gapIntersection.observe(bo);this.gaps=Ai}}onSelectionChange(Ai){let bo=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:Ra}=this,hc=this.selectionRange;if(Ra.state.facet(editable)?Ra.root.activeElement!=this.dom:!hasSelection(this.dom,hc))return;let pc=hc.anchorNode&&Ra.docView.nearest(hc.anchorNode);if(pc&&pc.ignoreEvent(Ai)){bo||(this.selectionChanged=!1);return}(browser.ie&&browser.ie_version<=11||browser.android&&browser.chrome)&&!Ra.state.selection.main.empty&&hc.focusNode&&isEquivalentPosition(hc.focusNode,hc.focusOffset,hc.anchorNode,hc.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:Ai}=this,bo=getSelection(Ai.root);if(!bo)return!1;let Ra=browser.safari&&Ai.root.nodeType==11&&Ai.root.activeElement==this.dom&&safariSelectionRangeHack(this.view,bo)||bo;if(!Ra||this.selectionRange.eq(Ra))return!1;let hc=hasSelection(this.dom,Ra);return hc&&!this.selectionChanged&&Ai.inputState.lastFocusTime>Date.now()-200&&Ai.inputState.lastTouchTime<Date.now()-300&&atElementStart(this.dom,Ra)?(this.view.inputState.lastFocusTime=0,Ai.docView.updateSelection(),!1):(this.selectionRange.setRange(Ra),hc&&(this.selectionChanged=!0),!0)}setSelectionRange(Ai,bo){this.selectionRange.set(Ai.node,Ai.offset,bo.node,bo.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let Ai=0,bo=null;for(let Ra=this.dom;Ra;)if(Ra.nodeType==1)!bo&&Ai<this.scrollTargets.length&&this.scrollTargets[Ai]==Ra?Ai++:bo||(bo=this.scrollTargets.slice(0,Ai)),bo&&bo.push(Ra),Ra=Ra.assignedSlot||Ra.parentNode;else if(Ra.nodeType==11)Ra=Ra.host;else break;if(Ai<this.scrollTargets.length&&!bo&&(bo=this.scrollTargets.slice(0,Ai)),bo){for(let Ra of this.scrollTargets)Ra.removeEventListener("scroll",this.onScroll);for(let Ra of this.scrollTargets=bo)Ra.addEventListener("scroll",this.onScroll)}}ignore(Ai){if(!this.active)return Ai();try{return this.stop(),Ai()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,observeOptions),useCharData&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),useCharData&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(Ai,bo){var Ra;if(!this.delayedAndroidKey){let hc=()=>{let pc=this.delayedAndroidKey;pc&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=pc.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&pc.force&&dispatchKey(this.dom,pc.key,pc.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(hc)}(!this.delayedAndroidKey||Ai=="Enter")&&(this.delayedAndroidKey={key:Ai,keyCode:bo,force:this.lastChange<Date.now()-50||!!(!((Ra=this.delayedAndroidKey)===null||Ra===void 0)&&Ra.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let Ai of this.observer.takeRecords())this.queue.push(Ai);return this.queue}processRecords(){let Ai=this.pendingRecords();Ai.length&&(this.queue=[]);let bo=-1,Ra=-1,hc=!1;for(let pc of Ai){let mc=this.readMutation(pc);mc&&(mc.typeOver&&(hc=!0),bo==-1?{from:bo,to:Ra}=mc:(bo=Math.min(mc.from,bo),Ra=Math.max(mc.to,Ra)))}return{from:bo,to:Ra,typeOver:hc}}readChange(){let{from:Ai,to:bo,typeOver:Ra}=this.processRecords(),hc=this.selectionChanged&&hasSelection(this.dom,this.selectionRange);if(Ai<0&&!hc)return null;Ai>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let pc=new DOMChange(this.view,Ai,bo,Ra);return this.view.docView.domChanged={newSel:pc.newSel?pc.newSel.main:null},pc}flush(Ai=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;Ai&&this.readSelectionRange();let bo=this.readChange();if(!bo)return this.view.requestMeasure(),!1;let Ra=this.view.state,hc=applyDOMChange(this.view,bo);return this.view.state==Ra&&(bo.domChanged||bo.newSel&&!bo.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),hc}readMutation(Ai){let bo=this.view.docView.nearest(Ai.target);if(!bo||bo.ignoreMutation(Ai))return null;if(bo.markDirty(Ai.type=="attributes"),Ai.type=="attributes"&&(bo.flags|=4),Ai.type=="childList"){let Ra=findChild(bo,Ai.previousSibling||Ai.target.previousSibling,-1),hc=findChild(bo,Ai.nextSibling||Ai.target.nextSibling,1);return{from:Ra?bo.posAfter(Ra):bo.posAtStart,to:hc?bo.posBefore(hc):bo.posAtEnd,typeOver:!1}}else return Ai.type=="characterData"?{from:bo.posAtStart,to:bo.posAtEnd,typeOver:Ai.target.nodeValue==Ai.oldValue}:null}setWindow(Ai){Ai!=this.win&&(this.removeWindowListeners(this.win),this.win=Ai,this.addWindowListeners(this.win))}addWindowListeners(Ai){Ai.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):Ai.addEventListener("beforeprint",this.onPrint),Ai.addEventListener("scroll",this.onScroll),Ai.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(Ai){Ai.removeEventListener("scroll",this.onScroll),Ai.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):Ai.removeEventListener("beforeprint",this.onPrint),Ai.document.removeEventListener("selectionchange",this.onSelectionChange)}update(Ai){this.editContext&&(this.editContext.update(Ai),Ai.startState.facet(editable)!=Ai.state.facet(editable)&&(Ai.view.contentDOM.editContext=Ai.state.facet(editable)?this.editContext.editContext:null))}destroy(){var Ai,bo,Ra;this.stop(),(Ai=this.intersection)===null||Ai===void 0||Ai.disconnect(),(bo=this.gapIntersection)===null||bo===void 0||bo.disconnect(),(Ra=this.resizeScroll)===null||Ra===void 0||Ra.disconnect();for(let hc of this.scrollTargets)hc.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function findChild(vo,Ai,bo){for(;Ai;){let Ra=ContentView.get(Ai);if(Ra&&Ra.parent==vo)return Ra;let hc=Ai.parentNode;Ai=hc!=vo.dom?hc:bo>0?Ai.nextSibling:Ai.previousSibling}return null}function buildSelectionRangeFromRange(vo,Ai){let bo=Ai.startContainer,Ra=Ai.startOffset,hc=Ai.endContainer,pc=Ai.endOffset,mc=vo.docView.domAtPos(vo.state.selection.main.anchor);return isEquivalentPosition(mc.node,mc.offset,hc,pc)&&([bo,Ra,hc,pc]=[hc,pc,bo,Ra]),{anchorNode:bo,anchorOffset:Ra,focusNode:hc,focusOffset:pc}}function safariSelectionRangeHack(vo,Ai){if(Ai.getComposedRanges){let hc=Ai.getComposedRanges(vo.root)[0];if(hc)return buildSelectionRangeFromRange(vo,hc)}let bo=null;function Ra(hc){hc.preventDefault(),hc.stopImmediatePropagation(),bo=hc.getTargetRanges()[0]}return vo.contentDOM.addEventListener("beforeinput",Ra,!0),vo.dom.ownerDocument.execCommand("indent"),vo.contentDOM.removeEventListener("beforeinput",Ra,!0),bo?buildSelectionRangeFromRange(vo,bo):null}class EditContextManager{constructor(Ai){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(Ai.state);let bo=this.editContext=new window.EditContext({text:Ai.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,Ai.state.selection.main.anchor))),selectionEnd:this.toContextPos(Ai.state.selection.main.head)});this.handlers.textupdate=Ra=>{let{anchor:hc}=Ai.state.selection.main,pc=this.toEditorPos(Ra.updateRangeStart),mc=this.toEditorPos(Ra.updateRangeEnd);Ai.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:Ra.updateRangeStart,editorBase:pc,drifted:!1});let uf={from:pc,to:mc,insert:Text.of(Ra.text.split(`
|
|
355
|
-
`))};if(uf.from==this.from&&hc<this.from?uf.from=hc:uf.to==this.to&&hc>this.to&&(uf.to=hc),!(uf.from==uf.to&&!uf.insert.length)){if(this.pendingContextChange=uf,!Ai.state.readOnly){let df=this.to-this.from+(uf.to-uf.from+uf.insert.length);applyDOMChangeInner(Ai,uf,EditorSelection.single(this.toEditorPos(Ra.selectionStart,df),this.toEditorPos(Ra.selectionEnd,df)))}this.pendingContextChange&&(this.revertPending(Ai.state),this.setSelection(Ai.state))}},this.handlers.characterboundsupdate=Ra=>{let hc=[],pc=null;for(let mc=this.toEditorPos(Ra.rangeStart),uf=this.toEditorPos(Ra.rangeEnd);mc<uf;mc++){let df=Ai.coordsForChar(mc);pc=df&&new DOMRect(df.left,df.top,df.right-df.left,df.bottom-df.top)||pc||new DOMRect,hc.push(pc)}bo.updateCharacterBounds(Ra.rangeStart,hc)},this.handlers.textformatupdate=Ra=>{let hc=[];for(let pc of Ra.getTextFormats()){let mc=pc.underlineStyle,uf=pc.underlineThickness;if(mc!="None"&&uf!="None"){let df=this.toEditorPos(pc.rangeStart),ff=this.toEditorPos(pc.rangeEnd);if(df<ff){let hf=`text-decoration: underline ${mc=="Dashed"?"dashed ":mc=="Squiggle"?"wavy ":""}${uf=="Thin"?1:2}px`;hc.push(Decoration.mark({attributes:{style:hf}}).range(df,ff))}}}Ai.dispatch({effects:setEditContextFormatting.of(Decoration.set(hc))})},this.handlers.compositionstart=()=>{Ai.inputState.composing<0&&(Ai.inputState.composing=0,Ai.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(Ai.inputState.composing=-1,Ai.inputState.compositionFirstChange=null,this.composing){let{drifted:Ra}=this.composing;this.composing=null,Ra&&this.reset(Ai.state)}};for(let Ra in this.handlers)bo.addEventListener(Ra,this.handlers[Ra]);this.measureReq={read:Ra=>{this.editContext.updateControlBounds(Ra.contentDOM.getBoundingClientRect());let hc=getSelection(Ra.root);hc&&hc.rangeCount&&this.editContext.updateSelectionBounds(hc.getRangeAt(0).getBoundingClientRect())}}}applyEdits(Ai){let bo=0,Ra=!1,hc=this.pendingContextChange;return Ai.changes.iterChanges((pc,mc,uf,df,ff)=>{if(Ra)return;let hf=ff.length-(mc-pc);if(hc&&mc>=hc.to)if(hc.from==pc&&hc.to==mc&&hc.insert.eq(ff)){hc=this.pendingContextChange=null,bo+=hf,this.to+=hf;return}else hc=null,this.revertPending(Ai.state);if(pc+=bo,mc+=bo,mc<=this.from)this.from+=hf,this.to+=hf;else if(pc<this.to){if(pc<this.from||mc>this.to||this.to-this.from+ff.length>3e4){Ra=!0;return}this.editContext.updateText(this.toContextPos(pc),this.toContextPos(mc),ff.toString()),this.to+=hf}bo+=hf}),hc&&!Ra&&this.revertPending(Ai.state),!Ra}update(Ai){let bo=this.pendingContextChange;this.composing&&(this.composing.drifted||Ai.transactions.some(Ra=>!Ra.isUserEvent("input.type")&&Ra.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=Ai.changes.mapPos(this.composing.editorBase)):!this.applyEdits(Ai)||!this.rangeIsValid(Ai.state)?(this.pendingContextChange=null,this.reset(Ai.state)):(Ai.docChanged||Ai.selectionSet||bo)&&this.setSelection(Ai.state),(Ai.geometryChanged||Ai.docChanged||Ai.selectionSet)&&Ai.view.requestMeasure(this.measureReq)}resetRange(Ai){let{head:bo}=Ai.selection.main;this.from=Math.max(0,bo-1e4),this.to=Math.min(Ai.doc.length,bo+1e4)}reset(Ai){this.resetRange(Ai),this.editContext.updateText(0,this.editContext.text.length,Ai.doc.sliceString(this.from,this.to)),this.setSelection(Ai)}revertPending(Ai){let bo=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(bo.from),this.toContextPos(bo.from+bo.insert.length),Ai.doc.sliceString(bo.from,bo.to))}setSelection(Ai){let{main:bo}=Ai.selection,Ra=this.toContextPos(Math.max(this.from,Math.min(this.to,bo.anchor))),hc=this.toContextPos(bo.head);(this.editContext.selectionStart!=Ra||this.editContext.selectionEnd!=hc)&&this.editContext.updateSelection(Ra,hc)}rangeIsValid(Ai){let{head:bo}=Ai.selection.main;return!(this.from>0&&bo-this.from<500||this.to<Ai.doc.length&&this.to-bo<500||this.to-this.from>1e4*3)}toEditorPos(Ai,bo=this.to-this.from){Ai=Math.min(Ai,bo);let Ra=this.composing;return Ra&&Ra.drifted?Ra.editorBase+(Ai-Ra.contextBase):Ai+this.from}toContextPos(Ai){let bo=this.composing;return bo&&bo.drifted?bo.contextBase+(Ai-bo.editorBase):Ai-this.from}destroy(){for(let Ai in this.handlers)this.editContext.removeEventListener(Ai,this.handlers[Ai])}}class EditorView{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(Ai={}){var bo;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),Ai.parent&&Ai.parent.appendChild(this.dom);let{dispatch:Ra}=Ai;this.dispatchTransactions=Ai.dispatchTransactions||Ra&&(hc=>hc.forEach(pc=>Ra(pc,this)))||(hc=>this.update(hc)),this.dispatch=this.dispatch.bind(this),this._root=Ai.root||getRoot(Ai.parent)||document,this.viewState=new ViewState(Ai.state||EditorState.create(Ai)),Ai.scrollTo&&Ai.scrollTo.is(scrollIntoView$1)&&(this.viewState.scrollTarget=Ai.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(viewPlugin).map(hc=>new PluginInstance(hc));for(let hc of this.plugins)hc.update(this);this.observer=new DOMObserver(this),this.inputState=new InputState(this),this.inputState.ensureHandlers(this.plugins),this.docView=new DocView(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((bo=document.fonts)===null||bo===void 0)&&bo.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...Ai){let bo=Ai.length==1&&Ai[0]instanceof Transaction?Ai:Ai.length==1&&Array.isArray(Ai[0])?Ai[0]:[this.state.update(...Ai)];this.dispatchTransactions(bo,this)}update(Ai){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let bo=!1,Ra=!1,hc,pc=this.state;for(let mf of Ai){if(mf.startState!=pc)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");pc=mf.state}if(this.destroyed){this.viewState.state=pc;return}let mc=this.hasFocus,uf=0,df=null;Ai.some(mf=>mf.annotation(isFocusChange))?(this.inputState.notifiedFocused=mc,uf=1):mc!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=mc,df=focusChangeTransaction(pc,mc),df||(uf=1));let ff=this.observer.delayedAndroidKey,hf=null;if(ff?(this.observer.clearDelayedAndroidKey(),hf=this.observer.readChange(),(hf&&!this.state.doc.eq(pc.doc)||!this.state.selection.eq(pc.selection))&&(hf=null)):this.observer.clear(),pc.facet(EditorState.phrases)!=this.state.facet(EditorState.phrases))return this.setState(pc);hc=ViewUpdate.create(this,pc,Ai),hc.flags|=uf;let pf=this.viewState.scrollTarget;try{this.updateState=2;for(let mf of Ai){if(pf&&(pf=pf.map(mf.changes)),mf.scrollIntoView){let{main:gf}=mf.state.selection;pf=new ScrollTarget(gf.empty?gf:EditorSelection.cursor(gf.head,gf.head>gf.anchor?-1:1))}for(let gf of mf.effects)gf.is(scrollIntoView$1)&&(pf=gf.value.clip(this.state))}this.viewState.update(hc,pf),this.bidiCache=CachedOrder.update(this.bidiCache,hc.changes),hc.empty||(this.updatePlugins(hc),this.inputState.update(hc)),bo=this.docView.update(hc),this.state.facet(styleModule)!=this.styleModules&&this.mountStyles(),Ra=this.updateAttrs(),this.showAnnouncements(Ai),this.docView.updateSelection(bo,Ai.some(mf=>mf.isUserEvent("select.pointer")))}finally{this.updateState=0}if(hc.startState.facet(theme)!=hc.state.facet(theme)&&(this.viewState.mustMeasureContent=!0),(bo||Ra||pf||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),bo&&this.docViewUpdate(),!hc.empty)for(let mf of this.state.facet(updateListener))try{mf(hc)}catch(gf){logException(this.state,gf,"update listener")}(df||hf)&&Promise.resolve().then(()=>{df&&this.state==df.startState&&this.dispatch(df),hf&&!applyDOMChange(this,hf)&&ff.force&&dispatchKey(this.contentDOM,ff.key,ff.keyCode)})}setState(Ai){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=Ai;return}this.updateState=2;let bo=this.hasFocus;try{for(let Ra of this.plugins)Ra.destroy(this);this.viewState=new ViewState(Ai),this.plugins=Ai.facet(viewPlugin).map(Ra=>new PluginInstance(Ra)),this.pluginMap.clear();for(let Ra of this.plugins)Ra.update(this);this.docView.destroy(),this.docView=new DocView(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}bo&&this.focus(),this.requestMeasure()}updatePlugins(Ai){let bo=Ai.startState.facet(viewPlugin),Ra=Ai.state.facet(viewPlugin);if(bo!=Ra){let hc=[];for(let pc of Ra){let mc=bo.indexOf(pc);if(mc<0)hc.push(new PluginInstance(pc));else{let uf=this.plugins[mc];uf.mustUpdate=Ai,hc.push(uf)}}for(let pc of this.plugins)pc.mustUpdate!=Ai&&pc.destroy(this);this.plugins=hc,this.pluginMap.clear()}else for(let hc of this.plugins)hc.mustUpdate=Ai;for(let hc=0;hc<this.plugins.length;hc++)this.plugins[hc].update(this);bo!=Ra&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let Ai of this.plugins){let bo=Ai.value;if(bo&&bo.docViewUpdate)try{bo.docViewUpdate(this)}catch(Ra){logException(this.state,Ra,"doc view update listener")}}}measure(Ai=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,Ai&&this.observer.forceFlush();let bo=null,Ra=this.scrollDOM,hc=Ra.scrollTop*this.scaleY,{scrollAnchorPos:pc,scrollAnchorHeight:mc}=this.viewState;Math.abs(hc-this.viewState.scrollTop)>1&&(mc=-1),this.viewState.scrollAnchorHeight=-1;try{for(let uf=0;;uf++){if(mc<0)if(isScrolledToBottom(Ra))pc=-1,mc=this.viewState.heightMap.height;else{let gf=this.viewState.scrollAnchorAt(hc);pc=gf.from,mc=gf.top}this.updateState=1;let df=this.viewState.measure(this);if(!df&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(uf>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let ff=[];df&4||([this.measureRequests,ff]=[ff,this.measureRequests]);let hf=ff.map(gf=>{try{return gf.read(this)}catch(yf){return logException(this.state,yf),BadMeasure}}),pf=ViewUpdate.create(this,this.state,[]),mf=!1;pf.flags|=df,bo?bo.flags|=df:bo=pf,this.updateState=2,pf.empty||(this.updatePlugins(pf),this.inputState.update(pf),this.updateAttrs(),mf=this.docView.update(pf),mf&&this.docViewUpdate());for(let gf=0;gf<ff.length;gf++)if(hf[gf]!=BadMeasure)try{let yf=ff[gf];yf.write&&yf.write(hf[gf],this)}catch(yf){logException(this.state,yf)}if(mf&&this.docView.updateSelection(!0),!pf.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,mc=-1;continue}else{let gf=(pc<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(pc).top)-mc;if(gf>1||gf<-1){hc=hc+gf,Ra.scrollTop=hc/this.scaleY,mc=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(bo&&!bo.empty)for(let uf of this.state.facet(updateListener))uf(bo)}get themeClasses(){return baseThemeID+" "+(this.state.facet(darkTheme)?baseDarkID:baseLightID)+" "+this.state.facet(theme)}updateAttrs(){let Ai=attrsFromFacet(this,editorAttributes,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),bo={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(editable)?"true":"false",class:"cm-content",style:`${browser.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(bo["aria-readonly"]="true"),attrsFromFacet(this,contentAttributes,bo);let Ra=this.observer.ignore(()=>{let hc=updateAttrs(this.contentDOM,this.contentAttrs,bo),pc=updateAttrs(this.dom,this.editorAttrs,Ai);return hc||pc});return this.editorAttrs=Ai,this.contentAttrs=bo,Ra}showAnnouncements(Ai){let bo=!0;for(let Ra of Ai)for(let hc of Ra.effects)if(hc.is(EditorView.announce)){bo&&(this.announceDOM.textContent=""),bo=!1;let pc=this.announceDOM.appendChild(document.createElement("div"));pc.textContent=hc.value}}mountStyles(){this.styleModules=this.state.facet(styleModule);let Ai=this.state.facet(EditorView.cspNonce);StyleModule.mount(this.root,this.styleModules.concat(baseTheme$1$2).reverse(),Ai?{nonce:Ai}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(Ai){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),Ai){if(this.measureRequests.indexOf(Ai)>-1)return;if(Ai.key!=null){for(let bo=0;bo<this.measureRequests.length;bo++)if(this.measureRequests[bo].key===Ai.key){this.measureRequests[bo]=Ai;return}}this.measureRequests.push(Ai)}}plugin(Ai){let bo=this.pluginMap.get(Ai);return(bo===void 0||bo&&bo.spec!=Ai)&&this.pluginMap.set(Ai,bo=this.plugins.find(Ra=>Ra.spec==Ai)||null),bo&&bo.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(Ai){return this.readMeasured(),this.viewState.elementAtHeight(Ai)}lineBlockAtHeight(Ai){return this.readMeasured(),this.viewState.lineBlockAtHeight(Ai)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(Ai){return this.viewState.lineBlockAt(Ai)}get contentHeight(){return this.viewState.contentHeight}moveByChar(Ai,bo,Ra){return skipAtoms(this,Ai,moveByChar(this,Ai,bo,Ra))}moveByGroup(Ai,bo){return skipAtoms(this,Ai,moveByChar(this,Ai,bo,Ra=>byGroup(this,Ai.head,Ra)))}visualLineSide(Ai,bo){let Ra=this.bidiSpans(Ai),hc=this.textDirectionAt(Ai.from),pc=Ra[bo?Ra.length-1:0];return EditorSelection.cursor(pc.side(bo,hc)+Ai.from,pc.forward(!bo,hc)?1:-1)}moveToLineBoundary(Ai,bo,Ra=!0){return moveToLineBoundary(this,Ai,bo,Ra)}moveVertically(Ai,bo,Ra){return skipAtoms(this,Ai,moveVertically(this,Ai,bo,Ra))}domAtPos(Ai){return this.docView.domAtPos(Ai)}posAtDOM(Ai,bo=0){return this.docView.posFromDOM(Ai,bo)}posAtCoords(Ai,bo=!0){return this.readMeasured(),posAtCoords(this,Ai,bo)}coordsAtPos(Ai,bo=1){this.readMeasured();let Ra=this.docView.coordsAt(Ai,bo);if(!Ra||Ra.left==Ra.right)return Ra;let hc=this.state.doc.lineAt(Ai),pc=this.bidiSpans(hc),mc=pc[BidiSpan.find(pc,Ai-hc.from,-1,bo)];return flattenRect(Ra,mc.dir==Direction.LTR==bo>0)}coordsForChar(Ai){return this.readMeasured(),this.docView.coordsForChar(Ai)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(Ai){return!this.state.facet(perLineTextDirection)||Ai<this.viewport.from||Ai>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(Ai))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(Ai){if(Ai.length>MaxBidiLine)return trivialOrder(Ai.length);let bo=this.textDirectionAt(Ai.from),Ra;for(let pc of this.bidiCache)if(pc.from==Ai.from&&pc.dir==bo&&(pc.fresh||isolatesEq(pc.isolates,Ra=getIsolatedRanges(this,Ai))))return pc.order;Ra||(Ra=getIsolatedRanges(this,Ai));let hc=computeOrder(Ai.text,bo,Ra);return this.bidiCache.push(new CachedOrder(Ai.from,Ai.to,bo,Ra,!0,hc)),hc}get hasFocus(){var Ai;return(this.dom.ownerDocument.hasFocus()||browser.safari&&((Ai=this.inputState)===null||Ai===void 0?void 0:Ai.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{focusPreventScroll(this.contentDOM),this.docView.updateSelection()})}setRoot(Ai){this._root!=Ai&&(this._root=Ai,this.observer.setWindow((Ai.nodeType==9?Ai:Ai.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let Ai of this.plugins)Ai.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(Ai,bo={}){return scrollIntoView$1.of(new ScrollTarget(typeof Ai=="number"?EditorSelection.cursor(Ai):Ai,bo.y,bo.x,bo.yMargin,bo.xMargin))}scrollSnapshot(){let{scrollTop:Ai,scrollLeft:bo}=this.scrollDOM,Ra=this.viewState.scrollAnchorAt(Ai);return scrollIntoView$1.of(new ScrollTarget(EditorSelection.cursor(Ra.from),"start","start",Ra.top-Ai,bo,!0))}setTabFocusMode(Ai){Ai==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof Ai=="boolean"?this.inputState.tabFocusMode=Ai?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+Ai)}static domEventHandlers(Ai){return ViewPlugin.define(()=>({}),{eventHandlers:Ai})}static domEventObservers(Ai){return ViewPlugin.define(()=>({}),{eventObservers:Ai})}static theme(Ai,bo){let Ra=StyleModule.newName(),hc=[theme.of(Ra),styleModule.of(buildTheme(`.${Ra}`,Ai))];return bo&&bo.dark&&hc.push(darkTheme.of(!0)),hc}static baseTheme(Ai){return Prec.lowest(styleModule.of(buildTheme("."+baseThemeID,Ai,lightDarkIDs)))}static findFromDOM(Ai){var bo;let Ra=Ai.querySelector(".cm-content"),hc=Ra&&ContentView.get(Ra)||ContentView.get(Ai);return((bo=hc==null?void 0:hc.rootView)===null||bo===void 0?void 0:bo.view)||null}}EditorView.styleModule=styleModule;EditorView.inputHandler=inputHandler$1;EditorView.clipboardInputFilter=clipboardInputFilter;EditorView.clipboardOutputFilter=clipboardOutputFilter;EditorView.scrollHandler=scrollHandler;EditorView.focusChangeEffect=focusChangeEffect;EditorView.perLineTextDirection=perLineTextDirection;EditorView.exceptionSink=exceptionSink;EditorView.updateListener=updateListener;EditorView.editable=editable;EditorView.mouseSelectionStyle=mouseSelectionStyle;EditorView.dragMovesSelection=dragMovesSelection$1;EditorView.clickAddsSelectionRange=clickAddsSelectionRange;EditorView.decorations=decorations;EditorView.outerDecorations=outerDecorations;EditorView.atomicRanges=atomicRanges;EditorView.bidiIsolatedRanges=bidiIsolatedRanges;EditorView.scrollMargins=scrollMargins;EditorView.darkTheme=darkTheme;EditorView.cspNonce=Facet.define({combine:vo=>vo.length?vo[0]:""});EditorView.contentAttributes=contentAttributes;EditorView.editorAttributes=editorAttributes;EditorView.lineWrapping=EditorView.contentAttributes.of({class:"cm-lineWrapping"});EditorView.announce=StateEffect.define();const MaxBidiLine=4096,BadMeasure={};class CachedOrder{constructor(Ai,bo,Ra,hc,pc,mc){this.from=Ai,this.to=bo,this.dir=Ra,this.isolates=hc,this.fresh=pc,this.order=mc}static update(Ai,bo){if(bo.empty&&!Ai.some(pc=>pc.fresh))return Ai;let Ra=[],hc=Ai.length?Ai[Ai.length-1].dir:Direction.LTR;for(let pc=Math.max(0,Ai.length-10);pc<Ai.length;pc++){let mc=Ai[pc];mc.dir==hc&&!bo.touchesRange(mc.from,mc.to)&&Ra.push(new CachedOrder(bo.mapPos(mc.from,1),bo.mapPos(mc.to,-1),mc.dir,mc.isolates,!1,mc.order))}return Ra}}function attrsFromFacet(vo,Ai,bo){for(let Ra=vo.state.facet(Ai),hc=Ra.length-1;hc>=0;hc--){let pc=Ra[hc],mc=typeof pc=="function"?pc(vo):pc;mc&&combineAttrs(mc,bo)}return bo}const currentPlatform=browser.mac?"mac":browser.windows?"win":browser.linux?"linux":"key";function normalizeKeyName(vo,Ai){const bo=vo.split(/-(?!$)/);let Ra=bo[bo.length-1];Ra=="Space"&&(Ra=" ");let hc,pc,mc,uf;for(let df=0;df<bo.length-1;++df){const ff=bo[df];if(/^(cmd|meta|m)$/i.test(ff))uf=!0;else if(/^a(lt)?$/i.test(ff))hc=!0;else if(/^(c|ctrl|control)$/i.test(ff))pc=!0;else if(/^s(hift)?$/i.test(ff))mc=!0;else if(/^mod$/i.test(ff))Ai=="mac"?uf=!0:pc=!0;else throw new Error("Unrecognized modifier name: "+ff)}return hc&&(Ra="Alt-"+Ra),pc&&(Ra="Ctrl-"+Ra),uf&&(Ra="Meta-"+Ra),mc&&(Ra="Shift-"+Ra),Ra}function modifiers(vo,Ai,bo){return Ai.altKey&&(vo="Alt-"+vo),Ai.ctrlKey&&(vo="Ctrl-"+vo),Ai.metaKey&&(vo="Meta-"+vo),bo!==!1&&Ai.shiftKey&&(vo="Shift-"+vo),vo}const handleKeyEvents=Prec.default(EditorView.domEventHandlers({keydown(vo,Ai){return runHandlers(getKeymap(Ai.state),vo,Ai,"editor")}})),keymap=Facet.define({enables:handleKeyEvents}),Keymaps=new WeakMap;function getKeymap(vo){let Ai=vo.facet(keymap),bo=Keymaps.get(Ai);return bo||Keymaps.set(Ai,bo=buildKeymap(Ai.reduce((Ra,hc)=>Ra.concat(hc),[]))),bo}function runScopeHandlers(vo,Ai,bo){return runHandlers(getKeymap(vo.state),Ai,vo,bo)}let storedPrefix=null;const PrefixTimeout=4e3;function buildKeymap(vo,Ai=currentPlatform){let bo=Object.create(null),Ra=Object.create(null),hc=(mc,uf)=>{let df=Ra[mc];if(df==null)Ra[mc]=uf;else if(df!=uf)throw new Error("Key binding "+mc+" is used both as a regular binding and as a multi-stroke prefix")},pc=(mc,uf,df,ff,hf)=>{var pf,mf;let gf=bo[mc]||(bo[mc]=Object.create(null)),yf=uf.split(/ (?!$)/).map(Sf=>normalizeKeyName(Sf,Ai));for(let Sf=1;Sf<yf.length;Sf++){let xf=yf.slice(0,Sf).join(" ");hc(xf,!0),gf[xf]||(gf[xf]={preventDefault:!0,stopPropagation:!1,run:[wf=>{let s1=storedPrefix={view:wf,prefix:xf,scope:mc};return setTimeout(()=>{storedPrefix==s1&&(storedPrefix=null)},PrefixTimeout),!0}]})}let vf=yf.join(" ");hc(vf,!1);let bf=gf[vf]||(gf[vf]={preventDefault:!1,stopPropagation:!1,run:((mf=(pf=gf._any)===null||pf===void 0?void 0:pf.run)===null||mf===void 0?void 0:mf.slice())||[]});df&&bf.run.push(df),ff&&(bf.preventDefault=!0),hf&&(bf.stopPropagation=!0)};for(let mc of vo){let uf=mc.scope?mc.scope.split(" "):["editor"];if(mc.any)for(let ff of uf){let hf=bo[ff]||(bo[ff]=Object.create(null));hf._any||(hf._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:pf}=mc;for(let mf in hf)hf[mf].run.push(gf=>pf(gf,currentKeyEvent))}let df=mc[Ai]||mc.key;if(df)for(let ff of uf)pc(ff,df,mc.run,mc.preventDefault,mc.stopPropagation),mc.shift&&pc(ff,"Shift-"+df,mc.shift,mc.preventDefault,mc.stopPropagation)}return bo}let currentKeyEvent=null;function runHandlers(vo,Ai,bo,Ra){currentKeyEvent=Ai;let hc=keyName(Ai),pc=codePointAt(hc,0),mc=codePointSize(pc)==hc.length&&hc!=" ",uf="",df=!1,ff=!1,hf=!1;storedPrefix&&storedPrefix.view==bo&&storedPrefix.scope==Ra&&(uf=storedPrefix.prefix+" ",modifierCodes.indexOf(Ai.keyCode)<0&&(ff=!0,storedPrefix=null));let pf=new Set,mf=bf=>{if(bf){for(let Sf of bf.run)if(!pf.has(Sf)&&(pf.add(Sf),Sf(bo)))return bf.stopPropagation&&(hf=!0),!0;bf.preventDefault&&(bf.stopPropagation&&(hf=!0),ff=!0)}return!1},gf=vo[Ra],yf,vf;return gf&&(mf(gf[uf+modifiers(hc,Ai,!mc)])?df=!0:mc&&(Ai.altKey||Ai.metaKey||Ai.ctrlKey)&&!(browser.windows&&Ai.ctrlKey&&Ai.altKey)&&(yf=base[Ai.keyCode])&&yf!=hc?(mf(gf[uf+modifiers(yf,Ai,!0)])||Ai.shiftKey&&(vf=shift[Ai.keyCode])!=hc&&vf!=yf&&mf(gf[uf+modifiers(vf,Ai,!1)]))&&(df=!0):mc&&Ai.shiftKey&&mf(gf[uf+modifiers(hc,Ai,!0)])&&(df=!0),!df&&mf(gf._any)&&(df=!0)),ff&&(df=!0),df&&hf&&Ai.stopPropagation(),currentKeyEvent=null,df}class RectangleMarker{constructor(Ai,bo,Ra,hc,pc){this.className=Ai,this.left=bo,this.top=Ra,this.width=hc,this.height=pc}draw(){let Ai=document.createElement("div");return Ai.className=this.className,this.adjust(Ai),Ai}update(Ai,bo){return bo.className!=this.className?!1:(this.adjust(Ai),!0)}adjust(Ai){Ai.style.left=this.left+"px",Ai.style.top=this.top+"px",this.width!=null&&(Ai.style.width=this.width+"px"),Ai.style.height=this.height+"px"}eq(Ai){return this.left==Ai.left&&this.top==Ai.top&&this.width==Ai.width&&this.height==Ai.height&&this.className==Ai.className}static forRange(Ai,bo,Ra){if(Ra.empty){let hc=Ai.coordsAtPos(Ra.head,Ra.assoc||1);if(!hc)return[];let pc=getBase(Ai);return[new RectangleMarker(bo,hc.left-pc.left,hc.top-pc.top,null,hc.bottom-hc.top)]}else return rectanglesForRange(Ai,bo,Ra)}}function getBase(vo){let Ai=vo.scrollDOM.getBoundingClientRect();return{left:(vo.textDirection==Direction.LTR?Ai.left:Ai.right-vo.scrollDOM.clientWidth*vo.scaleX)-vo.scrollDOM.scrollLeft*vo.scaleX,top:Ai.top-vo.scrollDOM.scrollTop*vo.scaleY}}function wrappedLine(vo,Ai,bo,Ra){let hc=vo.coordsAtPos(Ai,bo*2);if(!hc)return Ra;let pc=vo.dom.getBoundingClientRect(),mc=(hc.top+hc.bottom)/2,uf=vo.posAtCoords({x:pc.left+1,y:mc}),df=vo.posAtCoords({x:pc.right-1,y:mc});return uf==null||df==null?Ra:{from:Math.max(Ra.from,Math.min(uf,df)),to:Math.min(Ra.to,Math.max(uf,df))}}function rectanglesForRange(vo,Ai,bo){if(bo.to<=vo.viewport.from||bo.from>=vo.viewport.to)return[];let Ra=Math.max(bo.from,vo.viewport.from),hc=Math.min(bo.to,vo.viewport.to),pc=vo.textDirection==Direction.LTR,mc=vo.contentDOM,uf=mc.getBoundingClientRect(),df=getBase(vo),ff=mc.querySelector(".cm-line"),hf=ff&&window.getComputedStyle(ff),pf=uf.left+(hf?parseInt(hf.paddingLeft)+Math.min(0,parseInt(hf.textIndent)):0),mf=uf.right-(hf?parseInt(hf.paddingRight):0),gf=blockAt(vo,Ra),yf=blockAt(vo,hc),vf=gf.type==BlockType.Text?gf:null,bf=yf.type==BlockType.Text?yf:null;if(vf&&(vo.lineWrapping||gf.widgetLineBreaks)&&(vf=wrappedLine(vo,Ra,1,vf)),bf&&(vo.lineWrapping||yf.widgetLineBreaks)&&(bf=wrappedLine(vo,hc,-1,bf)),vf&&bf&&vf.from==bf.from&&vf.to==bf.to)return xf(wf(bo.from,bo.to,vf));{let If=vf?wf(bo.from,null,vf):s1(gf,!1),l1=bf?wf(null,bo.to,bf):s1(yf,!0),c1=[];return(vf||gf).to<(bf||yf).from-(vf&&bf?1:0)||gf.widgetLineBreaks>1&&If.bottom+vo.defaultLineHeight/2<l1.top?c1.push(Sf(pf,If.bottom,mf,l1.top)):If.bottom<l1.top&&vo.elementAtHeight((If.bottom+l1.top)/2).type==BlockType.Text&&(If.bottom=l1.top=(If.bottom+l1.top)/2),xf(If).concat(c1).concat(xf(l1))}function Sf(If,l1,c1,m1){return new RectangleMarker(Ai,If-df.left,l1-df.top,c1-If,m1-l1)}function xf({top:If,bottom:l1,horizontal:c1}){let m1=[];for(let k1=0;k1<c1.length;k1+=2)m1.push(Sf(c1[k1],If,c1[k1+1],l1));return m1}function wf(If,l1,c1){let m1=1e9,k1=-1e9,N1=[];function R1(f1,T1,A1,L1,B1){let V1=vo.coordsAtPos(f1,f1==c1.to?-2:2),Z1=vo.coordsAtPos(A1,A1==c1.from?2:-2);!V1||!Z1||(m1=Math.min(V1.top,Z1.top,m1),k1=Math.max(V1.bottom,Z1.bottom,k1),B1==Direction.LTR?N1.push(pc&&T1?pf:V1.left,pc&&L1?mf:Z1.right):N1.push(!pc&&L1?pf:Z1.left,!pc&&T1?mf:V1.right))}let $1=If??c1.from,D1=l1??c1.to;for(let f1 of vo.visibleRanges)if(f1.to>$1&&f1.from<D1)for(let T1=Math.max(f1.from,$1),A1=Math.min(f1.to,D1);;){let L1=vo.state.doc.lineAt(T1);for(let B1 of vo.bidiSpans(L1)){let V1=B1.from+L1.from,Z1=B1.to+L1.from;if(V1>=A1)break;Z1>T1&&R1(Math.max(V1,T1),If==null&&V1<=$1,Math.min(Z1,A1),l1==null&&Z1>=D1,B1.dir)}if(T1=L1.to+1,T1>=A1)break}return N1.length==0&&R1($1,If==null,D1,l1==null,vo.textDirection),{top:m1,bottom:k1,horizontal:N1}}function s1(If,l1){let c1=uf.top+(l1?If.top:If.bottom);return{top:c1,bottom:c1,horizontal:[]}}}function sameMarker(vo,Ai){return vo.constructor==Ai.constructor&&vo.eq(Ai)}class LayerView{constructor(Ai,bo){this.view=Ai,this.layer=bo,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=Ai.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),bo.above&&this.dom.classList.add("cm-layer-above"),bo.class&&this.dom.classList.add(bo.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(Ai.state),Ai.requestMeasure(this.measureReq),bo.mount&&bo.mount(this.dom,Ai)}update(Ai){Ai.startState.facet(layerOrder)!=Ai.state.facet(layerOrder)&&this.setOrder(Ai.state),(this.layer.update(Ai,this.dom)||Ai.geometryChanged)&&(this.scale(),Ai.view.requestMeasure(this.measureReq))}docViewUpdate(Ai){this.layer.updateOnDocViewUpdate!==!1&&Ai.requestMeasure(this.measureReq)}setOrder(Ai){let bo=0,Ra=Ai.facet(layerOrder);for(;bo<Ra.length&&Ra[bo]!=this.layer;)bo++;this.dom.style.zIndex=String((this.layer.above?150:-1)-bo)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:Ai,scaleY:bo}=this.view;(Ai!=this.scaleX||bo!=this.scaleY)&&(this.scaleX=Ai,this.scaleY=bo,this.dom.style.transform=`scale(${1/Ai}, ${1/bo})`)}draw(Ai){if(Ai.length!=this.drawn.length||Ai.some((bo,Ra)=>!sameMarker(bo,this.drawn[Ra]))){let bo=this.dom.firstChild,Ra=0;for(let hc of Ai)hc.update&&bo&&hc.constructor&&this.drawn[Ra].constructor&&hc.update(bo,this.drawn[Ra])?(bo=bo.nextSibling,Ra++):this.dom.insertBefore(hc.draw(),bo);for(;bo;){let hc=bo.nextSibling;bo.remove(),bo=hc}this.drawn=Ai}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const layerOrder=Facet.define();function layer(vo){return[ViewPlugin.define(Ai=>new LayerView(Ai,vo)),layerOrder.of(vo)]}const CanHidePrimary=!(browser.ios&&browser.webkit&&browser.webkit_version<534),selectionConfig=Facet.define({combine(vo){return combineConfig(vo,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(Ai,bo)=>Math.min(Ai,bo),drawRangeCursor:(Ai,bo)=>Ai||bo})}});function drawSelection(vo={}){return[selectionConfig.of(vo),cursorLayer,selectionLayer,hideNativeSelection,nativeSelectionHidden.of(!0)]}function configChanged(vo){return vo.startState.facet(selectionConfig)!=vo.state.facet(selectionConfig)}const cursorLayer=layer({above:!0,markers(vo){let{state:Ai}=vo,bo=Ai.facet(selectionConfig),Ra=[];for(let hc of Ai.selection.ranges){let pc=hc==Ai.selection.main;if(hc.empty?!pc||CanHidePrimary:bo.drawRangeCursor){let mc=pc?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",uf=hc.empty?hc:EditorSelection.cursor(hc.head,hc.head>hc.anchor?-1:1);for(let df of RectangleMarker.forRange(vo,mc,uf))Ra.push(df)}}return Ra},update(vo,Ai){vo.transactions.some(Ra=>Ra.selection)&&(Ai.style.animationName=Ai.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let bo=configChanged(vo);return bo&&setBlinkRate(vo.state,Ai),vo.docChanged||vo.selectionSet||bo},mount(vo,Ai){setBlinkRate(Ai.state,vo)},class:"cm-cursorLayer"});function setBlinkRate(vo,Ai){Ai.style.animationDuration=vo.facet(selectionConfig).cursorBlinkRate+"ms"}const selectionLayer=layer({above:!1,markers(vo){return vo.state.selection.ranges.map(Ai=>Ai.empty?[]:RectangleMarker.forRange(vo,"cm-selectionBackground",Ai)).reduce((Ai,bo)=>Ai.concat(bo))},update(vo,Ai){return vo.docChanged||vo.selectionSet||vo.viewportChanged||configChanged(vo)},class:"cm-selectionLayer"}),themeSpec={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};CanHidePrimary&&(themeSpec[".cm-line"].caretColor=themeSpec[".cm-content"].caretColor="transparent !important");const hideNativeSelection=Prec.highest(EditorView.theme(themeSpec)),setDropCursorPos=StateEffect.define({map(vo,Ai){return vo==null?null:Ai.mapPos(vo)}}),dropCursorPos=StateField.define({create(){return null},update(vo,Ai){return vo!=null&&(vo=Ai.changes.mapPos(vo)),Ai.effects.reduce((bo,Ra)=>Ra.is(setDropCursorPos)?Ra.value:bo,vo)}}),drawDropCursor=ViewPlugin.fromClass(class{constructor(vo){this.view=vo,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(vo){var Ai;let bo=vo.state.field(dropCursorPos);bo==null?this.cursor!=null&&((Ai=this.cursor)===null||Ai===void 0||Ai.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(vo.startState.field(dropCursorPos)!=bo||vo.docChanged||vo.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:vo}=this,Ai=vo.state.field(dropCursorPos),bo=Ai!=null&&vo.coordsAtPos(Ai);if(!bo)return null;let Ra=vo.scrollDOM.getBoundingClientRect();return{left:bo.left-Ra.left+vo.scrollDOM.scrollLeft*vo.scaleX,top:bo.top-Ra.top+vo.scrollDOM.scrollTop*vo.scaleY,height:bo.bottom-bo.top}}drawCursor(vo){if(this.cursor){let{scaleX:Ai,scaleY:bo}=this.view;vo?(this.cursor.style.left=vo.left/Ai+"px",this.cursor.style.top=vo.top/bo+"px",this.cursor.style.height=vo.height/bo+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(vo){this.view.state.field(dropCursorPos)!=vo&&this.view.dispatch({effects:setDropCursorPos.of(vo)})}},{eventObservers:{dragover(vo){this.setDropPos(this.view.posAtCoords({x:vo.clientX,y:vo.clientY}))},dragleave(vo){(vo.target==this.view.contentDOM||!this.view.contentDOM.contains(vo.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function dropCursor(){return[dropCursorPos,drawDropCursor]}function iterMatches(vo,Ai,bo,Ra,hc){Ai.lastIndex=0;for(let pc=vo.iterRange(bo,Ra),mc=bo,uf;!pc.next().done;mc+=pc.value.length)if(!pc.lineBreak)for(;uf=Ai.exec(pc.value);)hc(mc+uf.index,uf)}function matchRanges(vo,Ai){let bo=vo.visibleRanges;if(bo.length==1&&bo[0].from==vo.viewport.from&&bo[0].to==vo.viewport.to)return bo;let Ra=[];for(let{from:hc,to:pc}of bo)hc=Math.max(vo.state.doc.lineAt(hc).from,hc-Ai),pc=Math.min(vo.state.doc.lineAt(pc).to,pc+Ai),Ra.length&&Ra[Ra.length-1].to>=hc?Ra[Ra.length-1].to=pc:Ra.push({from:hc,to:pc});return Ra}class MatchDecorator{constructor(Ai){const{regexp:bo,decoration:Ra,decorate:hc,boundary:pc,maxLength:mc=1e3}=Ai;if(!bo.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=bo,hc)this.addMatch=(uf,df,ff,hf)=>hc(hf,ff,ff+uf[0].length,uf,df);else if(typeof Ra=="function")this.addMatch=(uf,df,ff,hf)=>{let pf=Ra(uf,df,ff);pf&&hf(ff,ff+uf[0].length,pf)};else if(Ra)this.addMatch=(uf,df,ff,hf)=>hf(ff,ff+uf[0].length,Ra);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=pc,this.maxLength=mc}createDeco(Ai){let bo=new RangeSetBuilder,Ra=bo.add.bind(bo);for(let{from:hc,to:pc}of matchRanges(Ai,this.maxLength))iterMatches(Ai.state.doc,this.regexp,hc,pc,(mc,uf)=>this.addMatch(uf,Ai,mc,Ra));return bo.finish()}updateDeco(Ai,bo){let Ra=1e9,hc=-1;return Ai.docChanged&&Ai.changes.iterChanges((pc,mc,uf,df)=>{df>=Ai.view.viewport.from&&uf<=Ai.view.viewport.to&&(Ra=Math.min(uf,Ra),hc=Math.max(df,hc))}),Ai.viewportMoved||hc-Ra>1e3?this.createDeco(Ai.view):hc>-1?this.updateRange(Ai.view,bo.map(Ai.changes),Ra,hc):bo}updateRange(Ai,bo,Ra,hc){for(let pc of Ai.visibleRanges){let mc=Math.max(pc.from,Ra),uf=Math.min(pc.to,hc);if(uf>mc){let df=Ai.state.doc.lineAt(mc),ff=df.to<uf?Ai.state.doc.lineAt(uf):df,hf=Math.max(pc.from,df.from),pf=Math.min(pc.to,ff.to);if(this.boundary){for(;mc>df.from;mc--)if(this.boundary.test(df.text[mc-1-df.from])){hf=mc;break}for(;uf<ff.to;uf++)if(this.boundary.test(ff.text[uf-ff.from])){pf=uf;break}}let mf=[],gf,yf=(vf,bf,Sf)=>mf.push(Sf.range(vf,bf));if(df==ff)for(this.regexp.lastIndex=hf-df.from;(gf=this.regexp.exec(df.text))&&gf.index<pf-df.from;)this.addMatch(gf,Ai,gf.index+df.from,yf);else iterMatches(Ai.state.doc,this.regexp,hf,pf,(vf,bf)=>this.addMatch(bf,Ai,vf,yf));bo=bo.update({filterFrom:hf,filterTo:pf,filter:(vf,bf)=>vf<hf||bf>pf,add:mf})}}return bo}}const UnicodeRegexpSupport=/x/.unicode!=null?"gu":"g",Specials=new RegExp(`[\0-\b
|
|
356
|
-
--\u2028\u2029\uFEFF-]`,UnicodeRegexpSupport),Names={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let _supportsTabSize=null;function supportsTabSize(){var vo;if(_supportsTabSize==null&&typeof document<"u"&&document.body){let Ai=document.body.style;_supportsTabSize=((vo=Ai.tabSize)!==null&&vo!==void 0?vo:Ai.MozTabSize)!=null}return _supportsTabSize||!1}const specialCharConfig=Facet.define({combine(vo){let Ai=combineConfig(vo,{render:null,specialChars:Specials,addSpecialChars:null});return(Ai.replaceTabs=!supportsTabSize())&&(Ai.specialChars=new RegExp(" |"+Ai.specialChars.source,UnicodeRegexpSupport)),Ai.addSpecialChars&&(Ai.specialChars=new RegExp(Ai.specialChars.source+"|"+Ai.addSpecialChars.source,UnicodeRegexpSupport)),Ai}});function highlightSpecialChars(vo={}){return[specialCharConfig.of(vo),specialCharPlugin()]}let _plugin=null;function specialCharPlugin(){return _plugin||(_plugin=ViewPlugin.fromClass(class{constructor(vo){this.view=vo,this.decorations=Decoration.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(vo.state.facet(specialCharConfig)),this.decorations=this.decorator.createDeco(vo)}makeDecorator(vo){return new MatchDecorator({regexp:vo.specialChars,decoration:(Ai,bo,Ra)=>{let{doc:hc}=bo.state,pc=codePointAt(Ai[0],0);if(pc==9){let mc=hc.lineAt(Ra),uf=bo.state.tabSize,df=countColumn(mc.text,uf,Ra-mc.from);return Decoration.replace({widget:new TabWidget((uf-df%uf)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[pc]||(this.decorationCache[pc]=Decoration.replace({widget:new SpecialCharWidget(vo,pc)}))},boundary:vo.replaceTabs?void 0:/[^]/})}update(vo){let Ai=vo.state.facet(specialCharConfig);vo.startState.facet(specialCharConfig)!=Ai?(this.decorator=this.makeDecorator(Ai),this.decorations=this.decorator.createDeco(vo.view)):this.decorations=this.decorator.updateDeco(vo,this.decorations)}},{decorations:vo=>vo.decorations}))}const DefaultPlaceholder="•";function placeholder$1(vo){return vo>=32?DefaultPlaceholder:vo==10?"":String.fromCharCode(9216+vo)}class SpecialCharWidget extends WidgetType{constructor(Ai,bo){super(),this.options=Ai,this.code=bo}eq(Ai){return Ai.code==this.code}toDOM(Ai){let bo=placeholder$1(this.code),Ra=Ai.state.phrase("Control character")+" "+(Names[this.code]||"0x"+this.code.toString(16)),hc=this.options.render&&this.options.render(this.code,Ra,bo);if(hc)return hc;let pc=document.createElement("span");return pc.textContent=bo,pc.title=Ra,pc.setAttribute("aria-label",Ra),pc.className="cm-specialChar",pc}ignoreEvent(){return!1}}class TabWidget extends WidgetType{constructor(Ai){super(),this.width=Ai}eq(Ai){return Ai.width==this.width}toDOM(){let Ai=document.createElement("span");return Ai.textContent=" ",Ai.className="cm-tab",Ai.style.width=this.width+"px",Ai}ignoreEvent(){return!1}}function highlightActiveLine(){return activeLineHighlighter}const lineDeco=Decoration.line({class:"cm-activeLine"}),activeLineHighlighter=ViewPlugin.fromClass(class{constructor(vo){this.decorations=this.getDeco(vo)}update(vo){(vo.docChanged||vo.selectionSet)&&(this.decorations=this.getDeco(vo.view))}getDeco(vo){let Ai=-1,bo=[];for(let Ra of vo.state.selection.ranges){let hc=vo.lineBlockAt(Ra.head);hc.from>Ai&&(bo.push(lineDeco.range(hc.from)),Ai=hc.from)}return Decoration.set(bo)}},{decorations:vo=>vo.decorations}),MaxOff=2e3;function rectangleFor(vo,Ai,bo){let Ra=Math.min(Ai.line,bo.line),hc=Math.max(Ai.line,bo.line),pc=[];if(Ai.off>MaxOff||bo.off>MaxOff||Ai.col<0||bo.col<0){let mc=Math.min(Ai.off,bo.off),uf=Math.max(Ai.off,bo.off);for(let df=Ra;df<=hc;df++){let ff=vo.doc.line(df);ff.length<=uf&&pc.push(EditorSelection.range(ff.from+mc,ff.to+uf))}}else{let mc=Math.min(Ai.col,bo.col),uf=Math.max(Ai.col,bo.col);for(let df=Ra;df<=hc;df++){let ff=vo.doc.line(df),hf=findColumn(ff.text,mc,vo.tabSize,!0);if(hf<0)pc.push(EditorSelection.cursor(ff.to));else{let pf=findColumn(ff.text,uf,vo.tabSize);pc.push(EditorSelection.range(ff.from+hf,ff.from+pf))}}}return pc}function absoluteColumn(vo,Ai){let bo=vo.coordsAtPos(vo.viewport.from);return bo?Math.round(Math.abs((bo.left-Ai)/vo.defaultCharacterWidth)):-1}function getPos(vo,Ai){let bo=vo.posAtCoords({x:Ai.clientX,y:Ai.clientY},!1),Ra=vo.state.doc.lineAt(bo),hc=bo-Ra.from,pc=hc>MaxOff?-1:hc==Ra.length?absoluteColumn(vo,Ai.clientX):countColumn(Ra.text,vo.state.tabSize,bo-Ra.from);return{line:Ra.number,col:pc,off:hc}}function rectangleSelectionStyle(vo,Ai){let bo=getPos(vo,Ai),Ra=vo.state.selection;return bo?{update(hc){if(hc.docChanged){let pc=hc.changes.mapPos(hc.startState.doc.line(bo.line).from),mc=hc.state.doc.lineAt(pc);bo={line:mc.number,col:bo.col,off:Math.min(bo.off,mc.length)},Ra=Ra.map(hc.changes)}},get(hc,pc,mc){let uf=getPos(vo,hc);if(!uf)return Ra;let df=rectangleFor(vo.state,bo,uf);return df.length?mc?EditorSelection.create(df.concat(Ra.ranges)):EditorSelection.create(df):Ra}}:null}function rectangularSelection(vo){let Ai=bo=>bo.altKey&&bo.button==0;return EditorView.mouseSelectionStyle.of((bo,Ra)=>Ai(Ra)?rectangleSelectionStyle(bo,Ra):null)}const keys={Alt:[18,vo=>!!vo.altKey],Control:[17,vo=>!!vo.ctrlKey],Shift:[16,vo=>!!vo.shiftKey],Meta:[91,vo=>!!vo.metaKey]},showCrosshair={style:"cursor: crosshair"};function crosshairCursor(vo={}){let[Ai,bo]=keys[vo.key||"Alt"],Ra=ViewPlugin.fromClass(class{constructor(hc){this.view=hc,this.isDown=!1}set(hc){this.isDown!=hc&&(this.isDown=hc,this.view.update([]))}},{eventObservers:{keydown(hc){this.set(hc.keyCode==Ai||bo(hc))},keyup(hc){(hc.keyCode==Ai||!bo(hc))&&this.set(!1)},mousemove(hc){this.set(bo(hc))}}});return[Ra,EditorView.contentAttributes.of(hc=>{var pc;return!((pc=hc.plugin(Ra))===null||pc===void 0)&&pc.isDown?showCrosshair:null})]}const Outside="-10000px";class TooltipViewManager{constructor(Ai,bo,Ra,hc){this.facet=bo,this.createTooltipView=Ra,this.removeTooltipView=hc,this.input=Ai.state.facet(bo),this.tooltips=this.input.filter(mc=>mc);let pc=null;this.tooltipViews=this.tooltips.map(mc=>pc=Ra(mc,pc))}update(Ai,bo){var Ra;let hc=Ai.state.facet(this.facet),pc=hc.filter(df=>df);if(hc===this.input){for(let df of this.tooltipViews)df.update&&df.update(Ai);return!1}let mc=[],uf=bo?[]:null;for(let df=0;df<pc.length;df++){let ff=pc[df],hf=-1;if(ff){for(let pf=0;pf<this.tooltips.length;pf++){let mf=this.tooltips[pf];mf&&mf.create==ff.create&&(hf=pf)}if(hf<0)mc[df]=this.createTooltipView(ff,df?mc[df-1]:null),uf&&(uf[df]=!!ff.above);else{let pf=mc[df]=this.tooltipViews[hf];uf&&(uf[df]=bo[hf]),pf.update&&pf.update(Ai)}}}for(let df of this.tooltipViews)mc.indexOf(df)<0&&(this.removeTooltipView(df),(Ra=df.destroy)===null||Ra===void 0||Ra.call(df));return bo&&(uf.forEach((df,ff)=>bo[ff]=df),bo.length=uf.length),this.input=hc,this.tooltips=pc,this.tooltipViews=mc,!0}}function windowSpace(vo){let{win:Ai}=vo;return{top:0,left:0,bottom:Ai.innerHeight,right:Ai.innerWidth}}const tooltipConfig=Facet.define({combine:vo=>{var Ai,bo,Ra;return{position:browser.ios?"absolute":((Ai=vo.find(hc=>hc.position))===null||Ai===void 0?void 0:Ai.position)||"fixed",parent:((bo=vo.find(hc=>hc.parent))===null||bo===void 0?void 0:bo.parent)||null,tooltipSpace:((Ra=vo.find(hc=>hc.tooltipSpace))===null||Ra===void 0?void 0:Ra.tooltipSpace)||windowSpace}}}),knownHeight=new WeakMap,tooltipPlugin=ViewPlugin.fromClass(class{constructor(vo){this.view=vo,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let Ai=vo.state.facet(tooltipConfig);this.position=Ai.position,this.parent=Ai.parent,this.classes=vo.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new TooltipViewManager(vo,showTooltip,(bo,Ra)=>this.createTooltip(bo,Ra),bo=>{this.resizeObserver&&this.resizeObserver.unobserve(bo.dom),bo.dom.remove()}),this.above=this.manager.tooltips.map(bo=>!!bo.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(bo=>{Date.now()>this.lastTransaction-50&&bo.length>0&&bo[bo.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),vo.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let vo of this.manager.tooltipViews)this.intersectionObserver.observe(vo.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(vo){vo.transactions.length&&(this.lastTransaction=Date.now());let Ai=this.manager.update(vo,this.above);Ai&&this.observeIntersection();let bo=Ai||vo.geometryChanged,Ra=vo.state.facet(tooltipConfig);if(Ra.position!=this.position&&!this.madeAbsolute){this.position=Ra.position;for(let hc of this.manager.tooltipViews)hc.dom.style.position=this.position;bo=!0}if(Ra.parent!=this.parent){this.parent&&this.container.remove(),this.parent=Ra.parent,this.createContainer();for(let hc of this.manager.tooltipViews)this.container.appendChild(hc.dom);bo=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);bo&&this.maybeMeasure()}createTooltip(vo,Ai){let bo=vo.create(this.view),Ra=Ai?Ai.dom:null;if(bo.dom.classList.add("cm-tooltip"),vo.arrow&&!bo.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let hc=document.createElement("div");hc.className="cm-tooltip-arrow",bo.dom.appendChild(hc)}return bo.dom.style.position=this.position,bo.dom.style.top=Outside,bo.dom.style.left="0px",this.container.insertBefore(bo.dom,Ra),bo.mount&&bo.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(bo.dom),bo}destroy(){var vo,Ai,bo;this.view.win.removeEventListener("resize",this.measureSoon);for(let Ra of this.manager.tooltipViews)Ra.dom.remove(),(vo=Ra.destroy)===null||vo===void 0||vo.call(Ra);this.parent&&this.container.remove(),(Ai=this.resizeObserver)===null||Ai===void 0||Ai.disconnect(),(bo=this.intersectionObserver)===null||bo===void 0||bo.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let vo=1,Ai=1,bo=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:pc}=this.manager.tooltipViews[0];if(browser.gecko)bo=pc.offsetParent!=this.container.ownerDocument.body;else if(pc.style.top==Outside&&pc.style.left=="0px"){let mc=pc.getBoundingClientRect();bo=Math.abs(mc.top+1e4)>1||Math.abs(mc.left)>1}}if(bo||this.position=="absolute")if(this.parent){let pc=this.parent.getBoundingClientRect();pc.width&&pc.height&&(vo=pc.width/this.parent.offsetWidth,Ai=pc.height/this.parent.offsetHeight)}else({scaleX:vo,scaleY:Ai}=this.view.viewState);let Ra=this.view.scrollDOM.getBoundingClientRect(),hc=getScrollMargins(this.view);return{visible:{left:Ra.left+hc.left,top:Ra.top+hc.top,right:Ra.right-hc.right,bottom:Ra.bottom-hc.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((pc,mc)=>{let uf=this.manager.tooltipViews[mc];return uf.getCoords?uf.getCoords(pc.pos):this.view.coordsAtPos(pc.pos)}),size:this.manager.tooltipViews.map(({dom:pc})=>pc.getBoundingClientRect()),space:this.view.state.facet(tooltipConfig).tooltipSpace(this.view),scaleX:vo,scaleY:Ai,makeAbsolute:bo}}writeMeasure(vo){var Ai;if(vo.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let uf of this.manager.tooltipViews)uf.dom.style.position="absolute"}let{visible:bo,space:Ra,scaleX:hc,scaleY:pc}=vo,mc=[];for(let uf=0;uf<this.manager.tooltips.length;uf++){let df=this.manager.tooltips[uf],ff=this.manager.tooltipViews[uf],{dom:hf}=ff,pf=vo.pos[uf],mf=vo.size[uf];if(!pf||df.clip!==!1&&(pf.bottom<=Math.max(bo.top,Ra.top)||pf.top>=Math.min(bo.bottom,Ra.bottom)||pf.right<Math.max(bo.left,Ra.left)-.1||pf.left>Math.min(bo.right,Ra.right)+.1)){hf.style.top=Outside;continue}let gf=df.arrow?ff.dom.querySelector(".cm-tooltip-arrow"):null,yf=gf?7:0,vf=mf.right-mf.left,bf=(Ai=knownHeight.get(ff))!==null&&Ai!==void 0?Ai:mf.bottom-mf.top,Sf=ff.offset||noOffset,xf=this.view.textDirection==Direction.LTR,wf=mf.width>Ra.right-Ra.left?xf?Ra.left:Ra.right-mf.width:xf?Math.max(Ra.left,Math.min(pf.left-(gf?14:0)+Sf.x,Ra.right-vf)):Math.min(Math.max(Ra.left,pf.left-vf+(gf?14:0)-Sf.x),Ra.right-vf),s1=this.above[uf];!df.strictSide&&(s1?pf.top-bf-yf-Sf.y<Ra.top:pf.bottom+bf+yf+Sf.y>Ra.bottom)&&s1==Ra.bottom-pf.bottom>pf.top-Ra.top&&(s1=this.above[uf]=!s1);let If=(s1?pf.top-Ra.top:Ra.bottom-pf.bottom)-yf;if(If<bf&&ff.resize!==!1){if(If<this.view.defaultLineHeight){hf.style.top=Outside;continue}knownHeight.set(ff,bf),hf.style.height=(bf=If)/pc+"px"}else hf.style.height&&(hf.style.height="");let l1=s1?pf.top-bf-yf-Sf.y:pf.bottom+yf+Sf.y,c1=wf+vf;if(ff.overlap!==!0)for(let m1 of mc)m1.left<c1&&m1.right>wf&&m1.top<l1+bf&&m1.bottom>l1&&(l1=s1?m1.top-bf-2-yf:m1.bottom+yf+2);if(this.position=="absolute"?(hf.style.top=(l1-vo.parent.top)/pc+"px",setLeftStyle(hf,(wf-vo.parent.left)/hc)):(hf.style.top=l1/pc+"px",setLeftStyle(hf,wf/hc)),gf){let m1=pf.left+(xf?Sf.x:-Sf.x)-(wf+14-7);gf.style.left=m1/hc+"px"}ff.overlap!==!0&&mc.push({left:wf,top:l1,right:c1,bottom:l1+bf}),hf.classList.toggle("cm-tooltip-above",s1),hf.classList.toggle("cm-tooltip-below",!s1),ff.positioned&&ff.positioned(vo.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let vo of this.manager.tooltipViews)vo.dom.style.top=Outside}},{eventObservers:{scroll(){this.maybeMeasure()}}});function setLeftStyle(vo,Ai){let bo=parseInt(vo.style.left,10);(isNaN(bo)||Math.abs(Ai-bo)>1)&&(vo.style.left=Ai+"px")}const baseTheme$5=EditorView.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),noOffset={x:0,y:0},showTooltip=Facet.define({enables:[tooltipPlugin,baseTheme$5]}),showHoverTooltip=Facet.define({combine:vo=>vo.reduce((Ai,bo)=>Ai.concat(bo),[])});class HoverTooltipHost{static create(Ai){return new HoverTooltipHost(Ai)}constructor(Ai){this.view=Ai,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new TooltipViewManager(Ai,showHoverTooltip,(bo,Ra)=>this.createHostedView(bo,Ra),bo=>bo.dom.remove())}createHostedView(Ai,bo){let Ra=Ai.create(this.view);return Ra.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(Ra.dom,bo?bo.dom.nextSibling:this.dom.firstChild),this.mounted&&Ra.mount&&Ra.mount(this.view),Ra}mount(Ai){for(let bo of this.manager.tooltipViews)bo.mount&&bo.mount(Ai);this.mounted=!0}positioned(Ai){for(let bo of this.manager.tooltipViews)bo.positioned&&bo.positioned(Ai)}update(Ai){this.manager.update(Ai)}destroy(){var Ai;for(let bo of this.manager.tooltipViews)(Ai=bo.destroy)===null||Ai===void 0||Ai.call(bo)}passProp(Ai){let bo;for(let Ra of this.manager.tooltipViews){let hc=Ra[Ai];if(hc!==void 0){if(bo===void 0)bo=hc;else if(bo!==hc)return}}return bo}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const showHoverTooltipHost=showTooltip.compute([showHoverTooltip],vo=>{let Ai=vo.facet(showHoverTooltip);return Ai.length===0?null:{pos:Math.min(...Ai.map(bo=>bo.pos)),end:Math.max(...Ai.map(bo=>{var Ra;return(Ra=bo.end)!==null&&Ra!==void 0?Ra:bo.pos})),create:HoverTooltipHost.create,above:Ai[0].above,arrow:Ai.some(bo=>bo.arrow)}});class HoverPlugin{constructor(Ai,bo,Ra,hc,pc){this.view=Ai,this.source=bo,this.field=Ra,this.setHover=hc,this.hoverTime=pc,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:Ai.dom,time:0},this.checkHover=this.checkHover.bind(this),Ai.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),Ai.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let Ai=Date.now()-this.lastMove.time;Ai<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-Ai):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:Ai,lastMove:bo}=this,Ra=Ai.docView.nearest(bo.target);if(!Ra)return;let hc,pc=1;if(Ra instanceof WidgetView)hc=Ra.posAtStart;else{if(hc=Ai.posAtCoords(bo),hc==null)return;let uf=Ai.coordsAtPos(hc);if(!uf||bo.y<uf.top||bo.y>uf.bottom||bo.x<uf.left-Ai.defaultCharacterWidth||bo.x>uf.right+Ai.defaultCharacterWidth)return;let df=Ai.bidiSpans(Ai.state.doc.lineAt(hc)).find(hf=>hf.from<=hc&&hf.to>=hc),ff=df&&df.dir==Direction.RTL?-1:1;pc=bo.x<uf.left?-ff:ff}let mc=this.source(Ai,hc,pc);if(mc!=null&&mc.then){let uf=this.pending={pos:hc};mc.then(df=>{this.pending==uf&&(this.pending=null,df&&!(Array.isArray(df)&&!df.length)&&Ai.dispatch({effects:this.setHover.of(Array.isArray(df)?df:[df])}))},df=>logException(Ai.state,df,"hover tooltip"))}else mc&&!(Array.isArray(mc)&&!mc.length)&&Ai.dispatch({effects:this.setHover.of(Array.isArray(mc)?mc:[mc])})}get tooltip(){let Ai=this.view.plugin(tooltipPlugin),bo=Ai?Ai.manager.tooltips.findIndex(Ra=>Ra.create==HoverTooltipHost.create):-1;return bo>-1?Ai.manager.tooltipViews[bo]:null}mousemove(Ai){var bo,Ra;this.lastMove={x:Ai.clientX,y:Ai.clientY,target:Ai.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:hc,tooltip:pc}=this;if(hc.length&&pc&&!isInTooltip(pc.dom,Ai)||this.pending){let{pos:mc}=hc[0]||this.pending,uf=(Ra=(bo=hc[0])===null||bo===void 0?void 0:bo.end)!==null&&Ra!==void 0?Ra:mc;(mc==uf?this.view.posAtCoords(this.lastMove)!=mc:!isOverRange(this.view,mc,uf,Ai.clientX,Ai.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(Ai){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:bo}=this;if(bo.length){let{tooltip:Ra}=this;Ra&&Ra.dom.contains(Ai.relatedTarget)?this.watchTooltipLeave(Ra.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(Ai){let bo=Ra=>{Ai.removeEventListener("mouseleave",bo),this.active.length&&!this.view.dom.contains(Ra.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};Ai.addEventListener("mouseleave",bo)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const tooltipMargin=4;function isInTooltip(vo,Ai){let{left:bo,right:Ra,top:hc,bottom:pc}=vo.getBoundingClientRect(),mc;if(mc=vo.querySelector(".cm-tooltip-arrow")){let uf=mc.getBoundingClientRect();hc=Math.min(uf.top,hc),pc=Math.max(uf.bottom,pc)}return Ai.clientX>=bo-tooltipMargin&&Ai.clientX<=Ra+tooltipMargin&&Ai.clientY>=hc-tooltipMargin&&Ai.clientY<=pc+tooltipMargin}function isOverRange(vo,Ai,bo,Ra,hc,pc){let mc=vo.scrollDOM.getBoundingClientRect(),uf=vo.documentTop+vo.documentPadding.top+vo.contentHeight;if(mc.left>Ra||mc.right<Ra||mc.top>hc||Math.min(mc.bottom,uf)<hc)return!1;let df=vo.posAtCoords({x:Ra,y:hc},!1);return df>=Ai&&df<=bo}function hoverTooltip(vo,Ai={}){let bo=StateEffect.define(),Ra=StateField.define({create(){return[]},update(hc,pc){if(hc.length&&(Ai.hideOnChange&&(pc.docChanged||pc.selection)?hc=[]:Ai.hideOn&&(hc=hc.filter(mc=>!Ai.hideOn(pc,mc))),pc.docChanged)){let mc=[];for(let uf of hc){let df=pc.changes.mapPos(uf.pos,-1,MapMode.TrackDel);if(df!=null){let ff=Object.assign(Object.create(null),uf);ff.pos=df,ff.end!=null&&(ff.end=pc.changes.mapPos(ff.end)),mc.push(ff)}}hc=mc}for(let mc of pc.effects)mc.is(bo)&&(hc=mc.value),mc.is(closeHoverTooltipEffect)&&(hc=[]);return hc},provide:hc=>showHoverTooltip.from(hc)});return{active:Ra,extension:[Ra,ViewPlugin.define(hc=>new HoverPlugin(hc,vo,Ra,bo,Ai.hoverTime||300)),showHoverTooltipHost]}}function getTooltip(vo,Ai){let bo=vo.plugin(tooltipPlugin);if(!bo)return null;let Ra=bo.manager.tooltips.indexOf(Ai);return Ra<0?null:bo.manager.tooltipViews[Ra]}const closeHoverTooltipEffect=StateEffect.define(),panelConfig=Facet.define({combine(vo){let Ai,bo;for(let Ra of vo)Ai=Ai||Ra.topContainer,bo=bo||Ra.bottomContainer;return{topContainer:Ai,bottomContainer:bo}}});function getPanel(vo,Ai){let bo=vo.plugin(panelPlugin),Ra=bo?bo.specs.indexOf(Ai):-1;return Ra>-1?bo.panels[Ra]:null}const panelPlugin=ViewPlugin.fromClass(class{constructor(vo){this.input=vo.state.facet(showPanel),this.specs=this.input.filter(bo=>bo),this.panels=this.specs.map(bo=>bo(vo));let Ai=vo.state.facet(panelConfig);this.top=new PanelGroup(vo,!0,Ai.topContainer),this.bottom=new PanelGroup(vo,!1,Ai.bottomContainer),this.top.sync(this.panels.filter(bo=>bo.top)),this.bottom.sync(this.panels.filter(bo=>!bo.top));for(let bo of this.panels)bo.dom.classList.add("cm-panel"),bo.mount&&bo.mount()}update(vo){let Ai=vo.state.facet(panelConfig);this.top.container!=Ai.topContainer&&(this.top.sync([]),this.top=new PanelGroup(vo.view,!0,Ai.topContainer)),this.bottom.container!=Ai.bottomContainer&&(this.bottom.sync([]),this.bottom=new PanelGroup(vo.view,!1,Ai.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let bo=vo.state.facet(showPanel);if(bo!=this.input){let Ra=bo.filter(df=>df),hc=[],pc=[],mc=[],uf=[];for(let df of Ra){let ff=this.specs.indexOf(df),hf;ff<0?(hf=df(vo.view),uf.push(hf)):(hf=this.panels[ff],hf.update&&hf.update(vo)),hc.push(hf),(hf.top?pc:mc).push(hf)}this.specs=Ra,this.panels=hc,this.top.sync(pc),this.bottom.sync(mc);for(let df of uf)df.dom.classList.add("cm-panel"),df.mount&&df.mount()}else for(let Ra of this.panels)Ra.update&&Ra.update(vo)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:vo=>EditorView.scrollMargins.of(Ai=>{let bo=Ai.plugin(vo);return bo&&{top:bo.top.scrollMargin(),bottom:bo.bottom.scrollMargin()}})});class PanelGroup{constructor(Ai,bo,Ra){this.view=Ai,this.top=bo,this.container=Ra,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(Ai){for(let bo of this.panels)bo.destroy&&Ai.indexOf(bo)<0&&bo.destroy();this.panels=Ai,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let bo=this.container||this.view.dom;bo.insertBefore(this.dom,this.top?bo.firstChild:null)}let Ai=this.dom.firstChild;for(let bo of this.panels)if(bo.dom.parentNode==this.dom){for(;Ai!=bo.dom;)Ai=rm(Ai);Ai=Ai.nextSibling}else this.dom.insertBefore(bo.dom,Ai);for(;Ai;)Ai=rm(Ai)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let Ai of this.classes.split(" "))Ai&&this.container.classList.remove(Ai);for(let Ai of(this.classes=this.view.themeClasses).split(" "))Ai&&this.container.classList.add(Ai)}}}function rm(vo){let Ai=vo.nextSibling;return vo.remove(),Ai}const showPanel=Facet.define({enables:panelPlugin});class GutterMarker extends RangeValue{compare(Ai){return this==Ai||this.constructor==Ai.constructor&&this.eq(Ai)}eq(Ai){return!1}destroy(Ai){}}GutterMarker.prototype.elementClass="";GutterMarker.prototype.toDOM=void 0;GutterMarker.prototype.mapMode=MapMode.TrackBefore;GutterMarker.prototype.startSide=GutterMarker.prototype.endSide=-1;GutterMarker.prototype.point=!0;const gutterLineClass=Facet.define(),gutterWidgetClass=Facet.define(),defaults$1={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>RangeSet.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},activeGutters=Facet.define();function gutter(vo){return[gutters(),activeGutters.of(Object.assign(Object.assign({},defaults$1),vo))]}const unfixGutters=Facet.define({combine:vo=>vo.some(Ai=>Ai)});function gutters(vo){return[gutterView]}const gutterView=ViewPlugin.fromClass(class{constructor(vo){this.view=vo,this.prevViewport=vo.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=vo.state.facet(activeGutters).map(Ai=>new SingleGutterView(vo,Ai));for(let Ai of this.gutters)this.dom.appendChild(Ai.dom);this.fixed=!vo.state.facet(unfixGutters),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),vo.scrollDOM.insertBefore(this.dom,vo.contentDOM)}update(vo){if(this.updateGutters(vo)){let Ai=this.prevViewport,bo=vo.view.viewport,Ra=Math.min(Ai.to,bo.to)-Math.max(Ai.from,bo.from);this.syncGutters(Ra<(bo.to-bo.from)*.8)}vo.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(unfixGutters)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=vo.view.viewport}syncGutters(vo){let Ai=this.dom.nextSibling;vo&&this.dom.remove();let bo=RangeSet.iter(this.view.state.facet(gutterLineClass),this.view.viewport.from),Ra=[],hc=this.gutters.map(pc=>new UpdateContext(pc,this.view.viewport,-this.view.documentPadding.top));for(let pc of this.view.viewportLineBlocks)if(Ra.length&&(Ra=[]),Array.isArray(pc.type)){let mc=!0;for(let uf of pc.type)if(uf.type==BlockType.Text&&mc){advanceCursor(bo,Ra,uf.from);for(let df of hc)df.line(this.view,uf,Ra);mc=!1}else if(uf.widget)for(let df of hc)df.widget(this.view,uf)}else if(pc.type==BlockType.Text){advanceCursor(bo,Ra,pc.from);for(let mc of hc)mc.line(this.view,pc,Ra)}else if(pc.widget)for(let mc of hc)mc.widget(this.view,pc);for(let pc of hc)pc.finish();vo&&this.view.scrollDOM.insertBefore(this.dom,Ai)}updateGutters(vo){let Ai=vo.startState.facet(activeGutters),bo=vo.state.facet(activeGutters),Ra=vo.docChanged||vo.heightChanged||vo.viewportChanged||!RangeSet.eq(vo.startState.facet(gutterLineClass),vo.state.facet(gutterLineClass),vo.view.viewport.from,vo.view.viewport.to);if(Ai==bo)for(let hc of this.gutters)hc.update(vo)&&(Ra=!0);else{Ra=!0;let hc=[];for(let pc of bo){let mc=Ai.indexOf(pc);mc<0?hc.push(new SingleGutterView(this.view,pc)):(this.gutters[mc].update(vo),hc.push(this.gutters[mc]))}for(let pc of this.gutters)pc.dom.remove(),hc.indexOf(pc)<0&&pc.destroy();for(let pc of hc)this.dom.appendChild(pc.dom);this.gutters=hc}return Ra}destroy(){for(let vo of this.gutters)vo.destroy();this.dom.remove()}},{provide:vo=>EditorView.scrollMargins.of(Ai=>{let bo=Ai.plugin(vo);return!bo||bo.gutters.length==0||!bo.fixed?null:Ai.textDirection==Direction.LTR?{left:bo.dom.offsetWidth*Ai.scaleX}:{right:bo.dom.offsetWidth*Ai.scaleX}})});function asArray$1(vo){return Array.isArray(vo)?vo:[vo]}function advanceCursor(vo,Ai,bo){for(;vo.value&&vo.from<=bo;)vo.from==bo&&Ai.push(vo.value),vo.next()}class UpdateContext{constructor(Ai,bo,Ra){this.gutter=Ai,this.height=Ra,this.i=0,this.cursor=RangeSet.iter(Ai.markers,bo.from)}addElement(Ai,bo,Ra){let{gutter:hc}=this,pc=(bo.top-this.height)/Ai.scaleY,mc=bo.height/Ai.scaleY;if(this.i==hc.elements.length){let uf=new GutterElement(Ai,mc,pc,Ra);hc.elements.push(uf),hc.dom.appendChild(uf.dom)}else hc.elements[this.i].update(Ai,mc,pc,Ra);this.height=bo.bottom,this.i++}line(Ai,bo,Ra){let hc=[];advanceCursor(this.cursor,hc,bo.from),Ra.length&&(hc=hc.concat(Ra));let pc=this.gutter.config.lineMarker(Ai,bo,hc);pc&&hc.unshift(pc);let mc=this.gutter;hc.length==0&&!mc.config.renderEmptyElements||this.addElement(Ai,bo,hc)}widget(Ai,bo){let Ra=this.gutter.config.widgetMarker(Ai,bo.widget,bo),hc=Ra?[Ra]:null;for(let pc of Ai.state.facet(gutterWidgetClass)){let mc=pc(Ai,bo.widget,bo);mc&&(hc||(hc=[])).push(mc)}hc&&this.addElement(Ai,bo,hc)}finish(){let Ai=this.gutter;for(;Ai.elements.length>this.i;){let bo=Ai.elements.pop();Ai.dom.removeChild(bo.dom),bo.destroy()}}}class SingleGutterView{constructor(Ai,bo){this.view=Ai,this.config=bo,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let Ra in bo.domEventHandlers)this.dom.addEventListener(Ra,hc=>{let pc=hc.target,mc;if(pc!=this.dom&&this.dom.contains(pc)){for(;pc.parentNode!=this.dom;)pc=pc.parentNode;let df=pc.getBoundingClientRect();mc=(df.top+df.bottom)/2}else mc=hc.clientY;let uf=Ai.lineBlockAtHeight(mc-Ai.documentTop);bo.domEventHandlers[Ra](Ai,uf,hc)&&hc.preventDefault()});this.markers=asArray$1(bo.markers(Ai)),bo.initialSpacer&&(this.spacer=new GutterElement(Ai,0,0,[bo.initialSpacer(Ai)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(Ai){let bo=this.markers;if(this.markers=asArray$1(this.config.markers(Ai.view)),this.spacer&&this.config.updateSpacer){let hc=this.config.updateSpacer(this.spacer.markers[0],Ai);hc!=this.spacer.markers[0]&&this.spacer.update(Ai.view,0,0,[hc])}let Ra=Ai.view.viewport;return!RangeSet.eq(this.markers,bo,Ra.from,Ra.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(Ai):!1)}destroy(){for(let Ai of this.elements)Ai.destroy()}}class GutterElement{constructor(Ai,bo,Ra,hc){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(Ai,bo,Ra,hc)}update(Ai,bo,Ra,hc){this.height!=bo&&(this.height=bo,this.dom.style.height=bo+"px"),this.above!=Ra&&(this.dom.style.marginTop=(this.above=Ra)?Ra+"px":""),sameMarkers(this.markers,hc)||this.setMarkers(Ai,hc)}setMarkers(Ai,bo){let Ra="cm-gutterElement",hc=this.dom.firstChild;for(let pc=0,mc=0;;){let uf=mc,df=pc<bo.length?bo[pc++]:null,ff=!1;if(df){let hf=df.elementClass;hf&&(Ra+=" "+hf);for(let pf=mc;pf<this.markers.length;pf++)if(this.markers[pf].compare(df)){uf=pf,ff=!0;break}}else uf=this.markers.length;for(;mc<uf;){let hf=this.markers[mc++];if(hf.toDOM){hf.destroy(hc);let pf=hc.nextSibling;hc.remove(),hc=pf}}if(!df)break;df.toDOM&&(ff?hc=hc.nextSibling:this.dom.insertBefore(df.toDOM(Ai),hc)),ff&&mc++}this.dom.className=Ra,this.markers=bo}destroy(){this.setMarkers(null,[])}}function sameMarkers(vo,Ai){if(vo.length!=Ai.length)return!1;for(let bo=0;bo<vo.length;bo++)if(!vo[bo].compare(Ai[bo]))return!1;return!0}const lineNumberMarkers=Facet.define(),lineNumberWidgetMarker=Facet.define(),lineNumberConfig=Facet.define({combine(vo){return combineConfig(vo,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(Ai,bo){let Ra=Object.assign({},Ai);for(let hc in bo){let pc=Ra[hc],mc=bo[hc];Ra[hc]=pc?(uf,df,ff)=>pc(uf,df,ff)||mc(uf,df,ff):mc}return Ra}})}});class NumberMarker extends GutterMarker{constructor(Ai){super(),this.number=Ai}eq(Ai){return this.number==Ai.number}toDOM(){return document.createTextNode(this.number)}}function formatNumber(vo,Ai){return vo.state.facet(lineNumberConfig).formatNumber(Ai,vo.state)}const lineNumberGutter=activeGutters.compute([lineNumberConfig],vo=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(Ai){return Ai.state.facet(lineNumberMarkers)},lineMarker(Ai,bo,Ra){return Ra.some(hc=>hc.toDOM)?null:new NumberMarker(formatNumber(Ai,Ai.state.doc.lineAt(bo.from).number))},widgetMarker:(Ai,bo,Ra)=>{for(let hc of Ai.state.facet(lineNumberWidgetMarker)){let pc=hc(Ai,bo,Ra);if(pc)return pc}return null},lineMarkerChange:Ai=>Ai.startState.facet(lineNumberConfig)!=Ai.state.facet(lineNumberConfig),initialSpacer(Ai){return new NumberMarker(formatNumber(Ai,maxLineNumber(Ai.state.doc.lines)))},updateSpacer(Ai,bo){let Ra=formatNumber(bo.view,maxLineNumber(bo.view.state.doc.lines));return Ra==Ai.number?Ai:new NumberMarker(Ra)},domEventHandlers:vo.facet(lineNumberConfig).domEventHandlers}));function lineNumbers(vo={}){return[lineNumberConfig.of(vo),gutters(),lineNumberGutter]}function maxLineNumber(vo){let Ai=9;for(;Ai<vo;)Ai=Ai*10+9;return Ai}const activeLineGutterMarker=new class extends GutterMarker{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},activeLineGutterHighlighter=gutterLineClass.compute(["selection"],vo=>{let Ai=[],bo=-1;for(let Ra of vo.selection.ranges){let hc=vo.doc.lineAt(Ra.head).from;hc>bo&&(bo=hc,Ai.push(activeLineGutterMarker.range(hc)))}return RangeSet.of(Ai)});function highlightActiveLineGutter(){return activeLineGutterHighlighter}const DefaultBufferLength=1024;let nextPropID=0,Range$2=class{constructor(vo,Ai){this.from=vo,this.to=Ai}};class NodeProp{constructor(Ai={}){this.id=nextPropID++,this.perNode=!!Ai.perNode,this.deserialize=Ai.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(Ai){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof Ai!="function"&&(Ai=NodeType.match(Ai)),bo=>{let Ra=Ai(bo);return Ra===void 0?null:[this,Ra]}}}NodeProp.closedBy=new NodeProp({deserialize:vo=>vo.split(" ")});NodeProp.openedBy=new NodeProp({deserialize:vo=>vo.split(" ")});NodeProp.group=new NodeProp({deserialize:vo=>vo.split(" ")});NodeProp.isolate=new NodeProp({deserialize:vo=>{if(vo&&vo!="rtl"&&vo!="ltr"&&vo!="auto")throw new RangeError("Invalid value for isolate: "+vo);return vo||"auto"}});NodeProp.contextHash=new NodeProp({perNode:!0});NodeProp.lookAhead=new NodeProp({perNode:!0});NodeProp.mounted=new NodeProp({perNode:!0});class MountedTree{constructor(Ai,bo,Ra){this.tree=Ai,this.overlay=bo,this.parser=Ra}static get(Ai){return Ai&&Ai.props&&Ai.props[NodeProp.mounted.id]}}const noProps=Object.create(null);class NodeType{constructor(Ai,bo,Ra,hc=0){this.name=Ai,this.props=bo,this.id=Ra,this.flags=hc}static define(Ai){let bo=Ai.props&&Ai.props.length?Object.create(null):noProps,Ra=(Ai.top?1:0)|(Ai.skipped?2:0)|(Ai.error?4:0)|(Ai.name==null?8:0),hc=new NodeType(Ai.name||"",bo,Ai.id,Ra);if(Ai.props){for(let pc of Ai.props)if(Array.isArray(pc)||(pc=pc(hc)),pc){if(pc[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");bo[pc[0].id]=pc[1]}}return hc}prop(Ai){return this.props[Ai.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(Ai){if(typeof Ai=="string"){if(this.name==Ai)return!0;let bo=this.prop(NodeProp.group);return bo?bo.indexOf(Ai)>-1:!1}return this.id==Ai}static match(Ai){let bo=Object.create(null);for(let Ra in Ai)for(let hc of Ra.split(" "))bo[hc]=Ai[Ra];return Ra=>{for(let hc=Ra.prop(NodeProp.group),pc=-1;pc<(hc?hc.length:0);pc++){let mc=bo[pc<0?Ra.name:hc[pc]];if(mc)return mc}}}}NodeType.none=new NodeType("",Object.create(null),0,8);class NodeSet{constructor(Ai){this.types=Ai;for(let bo=0;bo<Ai.length;bo++)if(Ai[bo].id!=bo)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...Ai){let bo=[];for(let Ra of this.types){let hc=null;for(let pc of Ai){let mc=pc(Ra);mc&&(hc||(hc=Object.assign({},Ra.props)),hc[mc[0].id]=mc[1])}bo.push(hc?new NodeType(Ra.name,hc,Ra.id,Ra.flags):Ra)}return new NodeSet(bo)}}const CachedNode=new WeakMap,CachedInnerNode=new WeakMap;var IterMode;(function(vo){vo[vo.ExcludeBuffers=1]="ExcludeBuffers",vo[vo.IncludeAnonymous=2]="IncludeAnonymous",vo[vo.IgnoreMounts=4]="IgnoreMounts",vo[vo.IgnoreOverlays=8]="IgnoreOverlays"})(IterMode||(IterMode={}));class Tree{constructor(Ai,bo,Ra,hc,pc){if(this.type=Ai,this.children=bo,this.positions=Ra,this.length=hc,this.props=null,pc&&pc.length){this.props=Object.create(null);for(let[mc,uf]of pc)this.props[typeof mc=="number"?mc:mc.id]=uf}}toString(){let Ai=MountedTree.get(this);if(Ai&&!Ai.overlay)return Ai.tree.toString();let bo="";for(let Ra of this.children){let hc=Ra.toString();hc&&(bo&&(bo+=","),bo+=hc)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(bo.length?"("+bo+")":""):bo}cursor(Ai=0){return new TreeCursor(this.topNode,Ai)}cursorAt(Ai,bo=0,Ra=0){let hc=CachedNode.get(this)||this.topNode,pc=new TreeCursor(hc);return pc.moveTo(Ai,bo),CachedNode.set(this,pc._tree),pc}get topNode(){return new TreeNode(this,0,0,null)}resolve(Ai,bo=0){let Ra=resolveNode(CachedNode.get(this)||this.topNode,Ai,bo,!1);return CachedNode.set(this,Ra),Ra}resolveInner(Ai,bo=0){let Ra=resolveNode(CachedInnerNode.get(this)||this.topNode,Ai,bo,!0);return CachedInnerNode.set(this,Ra),Ra}resolveStack(Ai,bo=0){return stackIterator(this,Ai,bo)}iterate(Ai){let{enter:bo,leave:Ra,from:hc=0,to:pc=this.length}=Ai,mc=Ai.mode||0,uf=(mc&IterMode.IncludeAnonymous)>0;for(let df=this.cursor(mc|IterMode.IncludeAnonymous);;){let ff=!1;if(df.from<=pc&&df.to>=hc&&(!uf&&df.type.isAnonymous||bo(df)!==!1)){if(df.firstChild())continue;ff=!0}for(;ff&&Ra&&(uf||!df.type.isAnonymous)&&Ra(df),!df.nextSibling();){if(!df.parent())return;ff=!0}}}prop(Ai){return Ai.perNode?this.props?this.props[Ai.id]:void 0:this.type.prop(Ai)}get propValues(){let Ai=[];if(this.props)for(let bo in this.props)Ai.push([+bo,this.props[bo]]);return Ai}balance(Ai={}){return this.children.length<=8?this:balanceRange(NodeType.none,this.children,this.positions,0,this.children.length,0,this.length,(bo,Ra,hc)=>new Tree(this.type,bo,Ra,hc,this.propValues),Ai.makeTree||((bo,Ra,hc)=>new Tree(NodeType.none,bo,Ra,hc)))}static build(Ai){return buildTree(Ai)}}Tree.empty=new Tree(NodeType.none,[],[],0);class FlatBufferCursor{constructor(Ai,bo){this.buffer=Ai,this.index=bo}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new FlatBufferCursor(this.buffer,this.index)}}class TreeBuffer{constructor(Ai,bo,Ra){this.buffer=Ai,this.length=bo,this.set=Ra}get type(){return NodeType.none}toString(){let Ai=[];for(let bo=0;bo<this.buffer.length;)Ai.push(this.childString(bo)),bo=this.buffer[bo+3];return Ai.join(",")}childString(Ai){let bo=this.buffer[Ai],Ra=this.buffer[Ai+3],hc=this.set.types[bo],pc=hc.name;if(/\W/.test(pc)&&!hc.isError&&(pc=JSON.stringify(pc)),Ai+=4,Ra==Ai)return pc;let mc=[];for(;Ai<Ra;)mc.push(this.childString(Ai)),Ai=this.buffer[Ai+3];return pc+"("+mc.join(",")+")"}findChild(Ai,bo,Ra,hc,pc){let{buffer:mc}=this,uf=-1;for(let df=Ai;df!=bo&&!(checkSide(pc,hc,mc[df+1],mc[df+2])&&(uf=df,Ra>0));df=mc[df+3]);return uf}slice(Ai,bo,Ra){let hc=this.buffer,pc=new Uint16Array(bo-Ai),mc=0;for(let uf=Ai,df=0;uf<bo;){pc[df++]=hc[uf++],pc[df++]=hc[uf++]-Ra;let ff=pc[df++]=hc[uf++]-Ra;pc[df++]=hc[uf++]-Ai,mc=Math.max(mc,ff)}return new TreeBuffer(pc,mc,this.set)}}function checkSide(vo,Ai,bo,Ra){switch(vo){case-2:return bo<Ai;case-1:return Ra>=Ai&&bo<Ai;case 0:return bo<Ai&&Ra>Ai;case 1:return bo<=Ai&&Ra>Ai;case 2:return Ra>Ai;case 4:return!0}}function resolveNode(vo,Ai,bo,Ra){for(var hc;vo.from==vo.to||(bo<1?vo.from>=Ai:vo.from>Ai)||(bo>-1?vo.to<=Ai:vo.to<Ai);){let mc=!Ra&&vo instanceof TreeNode&&vo.index<0?null:vo.parent;if(!mc)return vo;vo=mc}let pc=Ra?0:IterMode.IgnoreOverlays;if(Ra)for(let mc=vo,uf=mc.parent;uf;mc=uf,uf=mc.parent)mc instanceof TreeNode&&mc.index<0&&((hc=uf.enter(Ai,bo,pc))===null||hc===void 0?void 0:hc.from)!=mc.from&&(vo=uf);for(;;){let mc=vo.enter(Ai,bo,pc);if(!mc)return vo;vo=mc}}class BaseNode{cursor(Ai=0){return new TreeCursor(this,Ai)}getChild(Ai,bo=null,Ra=null){let hc=getChildren(this,Ai,bo,Ra);return hc.length?hc[0]:null}getChildren(Ai,bo=null,Ra=null){return getChildren(this,Ai,bo,Ra)}resolve(Ai,bo=0){return resolveNode(this,Ai,bo,!1)}resolveInner(Ai,bo=0){return resolveNode(this,Ai,bo,!0)}matchContext(Ai){return matchNodeContext(this.parent,Ai)}enterUnfinishedNodesBefore(Ai){let bo=this.childBefore(Ai),Ra=this;for(;bo;){let hc=bo.lastChild;if(!hc||hc.to!=bo.to)break;hc.type.isError&&hc.from==hc.to?(Ra=bo,bo=hc.prevSibling):bo=hc}return Ra}get node(){return this}get next(){return this.parent}}class TreeNode extends BaseNode{constructor(Ai,bo,Ra,hc){super(),this._tree=Ai,this.from=bo,this.index=Ra,this._parent=hc}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(Ai,bo,Ra,hc,pc=0){for(let mc=this;;){for(let{children:uf,positions:df}=mc._tree,ff=bo>0?uf.length:-1;Ai!=ff;Ai+=bo){let hf=uf[Ai],pf=df[Ai]+mc.from;if(checkSide(hc,Ra,pf,pf+hf.length)){if(hf instanceof TreeBuffer){if(pc&IterMode.ExcludeBuffers)continue;let mf=hf.findChild(0,hf.buffer.length,bo,Ra-pf,hc);if(mf>-1)return new BufferNode(new BufferContext(mc,hf,Ai,pf),null,mf)}else if(pc&IterMode.IncludeAnonymous||!hf.type.isAnonymous||hasChild(hf)){let mf;if(!(pc&IterMode.IgnoreMounts)&&(mf=MountedTree.get(hf))&&!mf.overlay)return new TreeNode(mf.tree,pf,Ai,mc);let gf=new TreeNode(hf,pf,Ai,mc);return pc&IterMode.IncludeAnonymous||!gf.type.isAnonymous?gf:gf.nextChild(bo<0?hf.children.length-1:0,bo,Ra,hc)}}}if(pc&IterMode.IncludeAnonymous||!mc.type.isAnonymous||(mc.index>=0?Ai=mc.index+bo:Ai=bo<0?-1:mc._parent._tree.children.length,mc=mc._parent,!mc))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(Ai){return this.nextChild(0,1,Ai,2)}childBefore(Ai){return this.nextChild(this._tree.children.length-1,-1,Ai,-2)}enter(Ai,bo,Ra=0){let hc;if(!(Ra&IterMode.IgnoreOverlays)&&(hc=MountedTree.get(this._tree))&&hc.overlay){let pc=Ai-this.from;for(let{from:mc,to:uf}of hc.overlay)if((bo>0?mc<=pc:mc<pc)&&(bo<0?uf>=pc:uf>pc))return new TreeNode(hc.tree,hc.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,Ai,bo,Ra)}nextSignificantParent(){let Ai=this;for(;Ai.type.isAnonymous&&Ai._parent;)Ai=Ai._parent;return Ai}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function getChildren(vo,Ai,bo,Ra){let hc=vo.cursor(),pc=[];if(!hc.firstChild())return pc;if(bo!=null){for(let mc=!1;!mc;)if(mc=hc.type.is(bo),!hc.nextSibling())return pc}for(;;){if(Ra!=null&&hc.type.is(Ra))return pc;if(hc.type.is(Ai)&&pc.push(hc.node),!hc.nextSibling())return Ra==null?pc:[]}}function matchNodeContext(vo,Ai,bo=Ai.length-1){for(let Ra=vo;bo>=0;Ra=Ra.parent){if(!Ra)return!1;if(!Ra.type.isAnonymous){if(Ai[bo]&&Ai[bo]!=Ra.name)return!1;bo--}}return!0}class BufferContext{constructor(Ai,bo,Ra,hc){this.parent=Ai,this.buffer=bo,this.index=Ra,this.start=hc}}class BufferNode extends BaseNode{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(Ai,bo,Ra){super(),this.context=Ai,this._parent=bo,this.index=Ra,this.type=Ai.buffer.set.types[Ai.buffer.buffer[Ra]]}child(Ai,bo,Ra){let{buffer:hc}=this.context,pc=hc.findChild(this.index+4,hc.buffer[this.index+3],Ai,bo-this.context.start,Ra);return pc<0?null:new BufferNode(this.context,this,pc)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(Ai){return this.child(1,Ai,2)}childBefore(Ai){return this.child(-1,Ai,-2)}enter(Ai,bo,Ra=0){if(Ra&IterMode.ExcludeBuffers)return null;let{buffer:hc}=this.context,pc=hc.findChild(this.index+4,hc.buffer[this.index+3],bo>0?1:-1,Ai-this.context.start,bo);return pc<0?null:new BufferNode(this.context,this,pc)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(Ai){return this._parent?null:this.context.parent.nextChild(this.context.index+Ai,Ai,0,4)}get nextSibling(){let{buffer:Ai}=this.context,bo=Ai.buffer[this.index+3];return bo<(this._parent?Ai.buffer[this._parent.index+3]:Ai.buffer.length)?new BufferNode(this.context,this._parent,bo):this.externalSibling(1)}get prevSibling(){let{buffer:Ai}=this.context,bo=this._parent?this._parent.index+4:0;return this.index==bo?this.externalSibling(-1):new BufferNode(this.context,this._parent,Ai.findChild(bo,this.index,-1,0,4))}get tree(){return null}toTree(){let Ai=[],bo=[],{buffer:Ra}=this.context,hc=this.index+4,pc=Ra.buffer[this.index+3];if(pc>hc){let mc=Ra.buffer[this.index+1];Ai.push(Ra.slice(hc,pc,mc)),bo.push(0)}return new Tree(this.type,Ai,bo,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function iterStack(vo){if(!vo.length)return null;let Ai=0,bo=vo[0];for(let pc=1;pc<vo.length;pc++){let mc=vo[pc];(mc.from>bo.from||mc.to<bo.to)&&(bo=mc,Ai=pc)}let Ra=bo instanceof TreeNode&&bo.index<0?null:bo.parent,hc=vo.slice();return Ra?hc[Ai]=Ra:hc.splice(Ai,1),new StackIterator(hc,bo)}class StackIterator{constructor(Ai,bo){this.heads=Ai,this.node=bo}get next(){return iterStack(this.heads)}}function stackIterator(vo,Ai,bo){let Ra=vo.resolveInner(Ai,bo),hc=null;for(let pc=Ra instanceof TreeNode?Ra:Ra.context.parent;pc;pc=pc.parent)if(pc.index<0){let mc=pc.parent;(hc||(hc=[Ra])).push(mc.resolve(Ai,bo)),pc=mc}else{let mc=MountedTree.get(pc.tree);if(mc&&mc.overlay&&mc.overlay[0].from<=Ai&&mc.overlay[mc.overlay.length-1].to>=Ai){let uf=new TreeNode(mc.tree,mc.overlay[0].from+pc.from,-1,pc);(hc||(hc=[Ra])).push(resolveNode(uf,Ai,bo,!1))}}return hc?iterStack(hc):Ra}class TreeCursor{get name(){return this.type.name}constructor(Ai,bo=0){if(this.mode=bo,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,Ai instanceof TreeNode)this.yieldNode(Ai);else{this._tree=Ai.context.parent,this.buffer=Ai.context;for(let Ra=Ai._parent;Ra;Ra=Ra._parent)this.stack.unshift(Ra.index);this.bufferNode=Ai,this.yieldBuf(Ai.index)}}yieldNode(Ai){return Ai?(this._tree=Ai,this.type=Ai.type,this.from=Ai.from,this.to=Ai.to,!0):!1}yieldBuf(Ai,bo){this.index=Ai;let{start:Ra,buffer:hc}=this.buffer;return this.type=bo||hc.set.types[hc.buffer[Ai]],this.from=Ra+hc.buffer[Ai+1],this.to=Ra+hc.buffer[Ai+2],!0}yield(Ai){return Ai?Ai instanceof TreeNode?(this.buffer=null,this.yieldNode(Ai)):(this.buffer=Ai.context,this.yieldBuf(Ai.index,Ai.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(Ai,bo,Ra){if(!this.buffer)return this.yield(this._tree.nextChild(Ai<0?this._tree._tree.children.length-1:0,Ai,bo,Ra,this.mode));let{buffer:hc}=this.buffer,pc=hc.findChild(this.index+4,hc.buffer[this.index+3],Ai,bo-this.buffer.start,Ra);return pc<0?!1:(this.stack.push(this.index),this.yieldBuf(pc))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(Ai){return this.enterChild(1,Ai,2)}childBefore(Ai){return this.enterChild(-1,Ai,-2)}enter(Ai,bo,Ra=this.mode){return this.buffer?Ra&IterMode.ExcludeBuffers?!1:this.enterChild(1,Ai,bo):this.yield(this._tree.enter(Ai,bo,Ra))}parent(){if(!this.buffer)return this.yieldNode(this.mode&IterMode.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let Ai=this.mode&IterMode.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(Ai)}sibling(Ai){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+Ai,Ai,0,4,this.mode)):!1;let{buffer:bo}=this.buffer,Ra=this.stack.length-1;if(Ai<0){let hc=Ra<0?0:this.stack[Ra]+4;if(this.index!=hc)return this.yieldBuf(bo.findChild(hc,this.index,-1,0,4))}else{let hc=bo.buffer[this.index+3];if(hc<(Ra<0?bo.buffer.length:bo.buffer[this.stack[Ra]+3]))return this.yieldBuf(hc)}return Ra<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+Ai,Ai,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(Ai){let bo,Ra,{buffer:hc}=this;if(hc){if(Ai>0){if(this.index<hc.buffer.buffer.length)return!1}else for(let pc=0;pc<this.index;pc++)if(hc.buffer.buffer[pc+3]<this.index)return!1;({index:bo,parent:Ra}=hc)}else({index:bo,_parent:Ra}=this._tree);for(;Ra;{index:bo,_parent:Ra}=Ra)if(bo>-1)for(let pc=bo+Ai,mc=Ai<0?-1:Ra._tree.children.length;pc!=mc;pc+=Ai){let uf=Ra._tree.children[pc];if(this.mode&IterMode.IncludeAnonymous||uf instanceof TreeBuffer||!uf.type.isAnonymous||hasChild(uf))return!1}return!0}move(Ai,bo){if(bo&&this.enterChild(Ai,0,4))return!0;for(;;){if(this.sibling(Ai))return!0;if(this.atLastNode(Ai)||!this.parent())return!1}}next(Ai=!0){return this.move(1,Ai)}prev(Ai=!0){return this.move(-1,Ai)}moveTo(Ai,bo=0){for(;(this.from==this.to||(bo<1?this.from>=Ai:this.from>Ai)||(bo>-1?this.to<=Ai:this.to<Ai))&&this.parent(););for(;this.enterChild(1,Ai,bo););return this}get node(){if(!this.buffer)return this._tree;let Ai=this.bufferNode,bo=null,Ra=0;if(Ai&&Ai.context==this.buffer)e:for(let hc=this.index,pc=this.stack.length;pc>=0;){for(let mc=Ai;mc;mc=mc._parent)if(mc.index==hc){if(hc==this.index)return mc;bo=mc,Ra=pc+1;break e}hc=this.stack[--pc]}for(let hc=Ra;hc<this.stack.length;hc++)bo=new BufferNode(this.buffer,bo,this.stack[hc]);return this.bufferNode=new BufferNode(this.buffer,bo,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(Ai,bo){for(let Ra=0;;){let hc=!1;if(this.type.isAnonymous||Ai(this)!==!1){if(this.firstChild()){Ra++;continue}this.type.isAnonymous||(hc=!0)}for(;;){if(hc&&bo&&bo(this),hc=this.type.isAnonymous,!Ra)return;if(this.nextSibling())break;this.parent(),Ra--,hc=!0}}}matchContext(Ai){if(!this.buffer)return matchNodeContext(this.node.parent,Ai);let{buffer:bo}=this.buffer,{types:Ra}=bo.set;for(let hc=Ai.length-1,pc=this.stack.length-1;hc>=0;pc--){if(pc<0)return matchNodeContext(this._tree,Ai,hc);let mc=Ra[bo.buffer[this.stack[pc]]];if(!mc.isAnonymous){if(Ai[hc]&&Ai[hc]!=mc.name)return!1;hc--}}return!0}}function hasChild(vo){return vo.children.some(Ai=>Ai instanceof TreeBuffer||!Ai.type.isAnonymous||hasChild(Ai))}function buildTree(vo){var Ai;let{buffer:bo,nodeSet:Ra,maxBufferLength:hc=DefaultBufferLength,reused:pc=[],minRepeatType:mc=Ra.types.length}=vo,uf=Array.isArray(bo)?new FlatBufferCursor(bo,bo.length):bo,df=Ra.types,ff=0,hf=0;function pf(If,l1,c1,m1,k1,N1){let{id:R1,start:$1,end:D1,size:f1}=uf,T1=hf,A1=ff;for(;f1<0;)if(uf.next(),f1==-1){let H1=pc[R1];c1.push(H1),m1.push($1-If);return}else if(f1==-3){ff=R1;return}else if(f1==-4){hf=R1;return}else throw new RangeError(`Unrecognized record size: ${f1}`);let L1=df[R1],B1,V1,Z1=$1-If;if(D1-$1<=hc&&(V1=bf(uf.pos-l1,k1))){let H1=new Uint16Array(V1.size-V1.skip),E1=uf.pos-V1.size,F1=H1.length;for(;uf.pos>E1;)F1=Sf(V1.start,H1,F1);B1=new TreeBuffer(H1,D1-V1.start,Ra),Z1=V1.start-If}else{let H1=uf.pos-f1;uf.next();let E1=[],F1=[],M1=R1>=mc?R1:-1,q1=0,z1=D1;for(;uf.pos>H1;)M1>=0&&uf.id==M1&&uf.size>=0?(uf.end<=z1-hc&&(yf(E1,F1,$1,q1,uf.end,z1,M1,T1,A1),q1=E1.length,z1=uf.end),uf.next()):N1>2500?mf($1,H1,E1,F1):pf($1,H1,E1,F1,M1,N1+1);if(M1>=0&&q1>0&&q1<E1.length&&yf(E1,F1,$1,q1,$1,z1,M1,T1,A1),E1.reverse(),F1.reverse(),M1>-1&&q1>0){let W1=gf(L1,A1);B1=balanceRange(L1,E1,F1,0,E1.length,0,D1-$1,W1,W1)}else B1=vf(L1,E1,F1,D1-$1,T1-D1,A1)}c1.push(B1),m1.push(Z1)}function mf(If,l1,c1,m1){let k1=[],N1=0,R1=-1;for(;uf.pos>l1;){let{id:$1,start:D1,end:f1,size:T1}=uf;if(T1>4)uf.next();else{if(R1>-1&&D1<R1)break;R1<0&&(R1=f1-hc),k1.push($1,D1,f1),N1++,uf.next()}}if(N1){let $1=new Uint16Array(N1*4),D1=k1[k1.length-2];for(let f1=k1.length-3,T1=0;f1>=0;f1-=3)$1[T1++]=k1[f1],$1[T1++]=k1[f1+1]-D1,$1[T1++]=k1[f1+2]-D1,$1[T1++]=T1;c1.push(new TreeBuffer($1,k1[2]-D1,Ra)),m1.push(D1-If)}}function gf(If,l1){return(c1,m1,k1)=>{let N1=0,R1=c1.length-1,$1,D1;if(R1>=0&&($1=c1[R1])instanceof Tree){if(!R1&&$1.type==If&&$1.length==k1)return $1;(D1=$1.prop(NodeProp.lookAhead))&&(N1=m1[R1]+$1.length+D1)}return vf(If,c1,m1,k1,N1,l1)}}function yf(If,l1,c1,m1,k1,N1,R1,$1,D1){let f1=[],T1=[];for(;If.length>m1;)f1.push(If.pop()),T1.push(l1.pop()+c1-k1);If.push(vf(Ra.types[R1],f1,T1,N1-k1,$1-N1,D1)),l1.push(k1-c1)}function vf(If,l1,c1,m1,k1,N1,R1){if(N1){let $1=[NodeProp.contextHash,N1];R1=R1?[$1].concat(R1):[$1]}if(k1>25){let $1=[NodeProp.lookAhead,k1];R1=R1?[$1].concat(R1):[$1]}return new Tree(If,l1,c1,m1,R1)}function bf(If,l1){let c1=uf.fork(),m1=0,k1=0,N1=0,R1=c1.end-hc,$1={size:0,start:0,skip:0};e:for(let D1=c1.pos-If;c1.pos>D1;){let f1=c1.size;if(c1.id==l1&&f1>=0){$1.size=m1,$1.start=k1,$1.skip=N1,N1+=4,m1+=4,c1.next();continue}let T1=c1.pos-f1;if(f1<0||T1<D1||c1.start<R1)break;let A1=c1.id>=mc?4:0,L1=c1.start;for(c1.next();c1.pos>T1;){if(c1.size<0)if(c1.size==-3)A1+=4;else break e;else c1.id>=mc&&(A1+=4);c1.next()}k1=L1,m1+=f1,N1+=A1}return(l1<0||m1==If)&&($1.size=m1,$1.start=k1,$1.skip=N1),$1.size>4?$1:void 0}function Sf(If,l1,c1){let{id:m1,start:k1,end:N1,size:R1}=uf;if(uf.next(),R1>=0&&m1<mc){let $1=c1;if(R1>4){let D1=uf.pos-(R1-4);for(;uf.pos>D1;)c1=Sf(If,l1,c1)}l1[--c1]=$1,l1[--c1]=N1-If,l1[--c1]=k1-If,l1[--c1]=m1}else R1==-3?ff=m1:R1==-4&&(hf=m1);return c1}let xf=[],wf=[];for(;uf.pos>0;)pf(vo.start||0,vo.bufferStart||0,xf,wf,-1,0);let s1=(Ai=vo.length)!==null&&Ai!==void 0?Ai:xf.length?wf[0]+xf[0].length:0;return new Tree(df[vo.topID],xf.reverse(),wf.reverse(),s1)}const nodeSizeCache=new WeakMap;function nodeSize(vo,Ai){if(!vo.isAnonymous||Ai instanceof TreeBuffer||Ai.type!=vo)return 1;let bo=nodeSizeCache.get(Ai);if(bo==null){bo=1;for(let Ra of Ai.children){if(Ra.type!=vo||!(Ra instanceof Tree)){bo=1;break}bo+=nodeSize(vo,Ra)}nodeSizeCache.set(Ai,bo)}return bo}function balanceRange(vo,Ai,bo,Ra,hc,pc,mc,uf,df){let ff=0;for(let yf=Ra;yf<hc;yf++)ff+=nodeSize(vo,Ai[yf]);let hf=Math.ceil(ff*1.5/8),pf=[],mf=[];function gf(yf,vf,bf,Sf,xf){for(let wf=bf;wf<Sf;){let s1=wf,If=vf[wf],l1=nodeSize(vo,yf[wf]);for(wf++;wf<Sf;wf++){let c1=nodeSize(vo,yf[wf]);if(l1+c1>=hf)break;l1+=c1}if(wf==s1+1){if(l1>hf){let c1=yf[s1];gf(c1.children,c1.positions,0,c1.children.length,vf[s1]+xf);continue}pf.push(yf[s1])}else{let c1=vf[wf-1]+yf[wf-1].length-If;pf.push(balanceRange(vo,yf,vf,s1,wf,If,c1,null,df))}mf.push(If+xf-pc)}}return gf(Ai,bo,Ra,hc,0),(uf||df)(pf,mf,mc)}class TreeFragment{constructor(Ai,bo,Ra,hc,pc=!1,mc=!1){this.from=Ai,this.to=bo,this.tree=Ra,this.offset=hc,this.open=(pc?1:0)|(mc?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(Ai,bo=[],Ra=!1){let hc=[new TreeFragment(0,Ai.length,Ai,0,!1,Ra)];for(let pc of bo)pc.to>Ai.length&&hc.push(pc);return hc}static applyChanges(Ai,bo,Ra=128){if(!bo.length)return Ai;let hc=[],pc=1,mc=Ai.length?Ai[0]:null;for(let uf=0,df=0,ff=0;;uf++){let hf=uf<bo.length?bo[uf]:null,pf=hf?hf.fromA:1e9;if(pf-df>=Ra)for(;mc&&mc.from<pf;){let mf=mc;if(df>=mf.from||pf<=mf.to||ff){let gf=Math.max(mf.from,df)-ff,yf=Math.min(mf.to,pf)-ff;mf=gf>=yf?null:new TreeFragment(gf,yf,mf.tree,mf.offset+ff,uf>0,!!hf)}if(mf&&hc.push(mf),mc.to>pf)break;mc=pc<Ai.length?Ai[pc++]:null}if(!hf)break;df=hf.toA,ff=hf.toA-hf.toB}return hc}}class Parser{startParse(Ai,bo,Ra){return typeof Ai=="string"&&(Ai=new StringInput(Ai)),Ra=Ra?Ra.length?Ra.map(hc=>new Range$2(hc.from,hc.to)):[new Range$2(0,0)]:[new Range$2(0,Ai.length)],this.createParse(Ai,bo||[],Ra)}parse(Ai,bo,Ra){let hc=this.startParse(Ai,bo,Ra);for(;;){let pc=hc.advance();if(pc)return pc}}}class StringInput{constructor(Ai){this.string=Ai}get length(){return this.string.length}chunk(Ai){return this.string.slice(Ai)}get lineChunks(){return!1}read(Ai,bo){return this.string.slice(Ai,bo)}}new NodeProp({perNode:!0});let nextTagID=0;class Tag{constructor(Ai,bo,Ra,hc){this.name=Ai,this.set=bo,this.base=Ra,this.modified=hc,this.id=nextTagID++}toString(){let{name:Ai}=this;for(let bo of this.modified)bo.name&&(Ai=`${bo.name}(${Ai})`);return Ai}static define(Ai,bo){let Ra=typeof Ai=="string"?Ai:"?";if(Ai instanceof Tag&&(bo=Ai),bo!=null&&bo.base)throw new Error("Can not derive from a modified tag");let hc=new Tag(Ra,[],null,[]);if(hc.set.push(hc),bo)for(let pc of bo.set)hc.set.push(pc);return hc}static defineModifier(Ai){let bo=new Modifier(Ai);return Ra=>Ra.modified.indexOf(bo)>-1?Ra:Modifier.get(Ra.base||Ra,Ra.modified.concat(bo).sort((hc,pc)=>hc.id-pc.id))}}let nextModifierID=0;class Modifier{constructor(Ai){this.name=Ai,this.instances=[],this.id=nextModifierID++}static get(Ai,bo){if(!bo.length)return Ai;let Ra=bo[0].instances.find(uf=>uf.base==Ai&&sameArray(bo,uf.modified));if(Ra)return Ra;let hc=[],pc=new Tag(Ai.name,hc,Ai,bo);for(let uf of bo)uf.instances.push(pc);let mc=powerSet(bo);for(let uf of Ai.set)if(!uf.modified.length)for(let df of mc)hc.push(Modifier.get(uf,df));return pc}}function sameArray(vo,Ai){return vo.length==Ai.length&&vo.every((bo,Ra)=>bo==Ai[Ra])}function powerSet(vo){let Ai=[[]];for(let bo=0;bo<vo.length;bo++)for(let Ra=0,hc=Ai.length;Ra<hc;Ra++)Ai.push(Ai[Ra].concat(vo[bo]));return Ai.sort((bo,Ra)=>Ra.length-bo.length)}function styleTags(vo){let Ai=Object.create(null);for(let bo in vo){let Ra=vo[bo];Array.isArray(Ra)||(Ra=[Ra]);for(let hc of bo.split(" "))if(hc){let pc=[],mc=2,uf=hc;for(let pf=0;;){if(uf=="..."&&pf>0&&pf+3==hc.length){mc=1;break}let mf=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(uf);if(!mf)throw new RangeError("Invalid path: "+hc);if(pc.push(mf[0]=="*"?"":mf[0][0]=='"'?JSON.parse(mf[0]):mf[0]),pf+=mf[0].length,pf==hc.length)break;let gf=hc[pf++];if(pf==hc.length&&gf=="!"){mc=0;break}if(gf!="/")throw new RangeError("Invalid path: "+hc);uf=hc.slice(pf)}let df=pc.length-1,ff=pc[df];if(!ff)throw new RangeError("Invalid path: "+hc);let hf=new Rule(Ra,mc,df>0?pc.slice(0,df):null);Ai[ff]=hf.sort(Ai[ff])}}return ruleNodeProp.add(Ai)}const ruleNodeProp=new NodeProp;class Rule{constructor(Ai,bo,Ra,hc){this.tags=Ai,this.mode=bo,this.context=Ra,this.next=hc}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(Ai){return!Ai||Ai.depth<this.depth?(this.next=Ai,this):(Ai.next=this.sort(Ai.next),Ai)}get depth(){return this.context?this.context.length:0}}Rule.empty=new Rule([],2,null);function tagHighlighter(vo,Ai){let bo=Object.create(null);for(let pc of vo)if(!Array.isArray(pc.tag))bo[pc.tag.id]=pc.class;else for(let mc of pc.tag)bo[mc.id]=pc.class;let{scope:Ra,all:hc=null}=Ai||{};return{style:pc=>{let mc=hc;for(let uf of pc)for(let df of uf.set){let ff=bo[df.id];if(ff){mc=mc?mc+" "+ff:ff;break}}return mc},scope:Ra}}function highlightTags(vo,Ai){let bo=null;for(let Ra of vo){let hc=Ra.style(Ai);hc&&(bo=bo?bo+" "+hc:hc)}return bo}function highlightTree(vo,Ai,bo,Ra=0,hc=vo.length){let pc=new HighlightBuilder(Ra,Array.isArray(Ai)?Ai:[Ai],bo);pc.highlightRange(vo.cursor(),Ra,hc,"",pc.highlighters),pc.flush(hc)}class HighlightBuilder{constructor(Ai,bo,Ra){this.at=Ai,this.highlighters=bo,this.span=Ra,this.class=""}startSpan(Ai,bo){bo!=this.class&&(this.flush(Ai),Ai>this.at&&(this.at=Ai),this.class=bo)}flush(Ai){Ai>this.at&&this.class&&this.span(this.at,Ai,this.class)}highlightRange(Ai,bo,Ra,hc,pc){let{type:mc,from:uf,to:df}=Ai;if(uf>=Ra||df<=bo)return;mc.isTop&&(pc=this.highlighters.filter(gf=>!gf.scope||gf.scope(mc)));let ff=hc,hf=getStyleTags(Ai)||Rule.empty,pf=highlightTags(pc,hf.tags);if(pf&&(ff&&(ff+=" "),ff+=pf,hf.mode==1&&(hc+=(hc?" ":"")+pf)),this.startSpan(Math.max(bo,uf),ff),hf.opaque)return;let mf=Ai.tree&&Ai.tree.prop(NodeProp.mounted);if(mf&&mf.overlay){let gf=Ai.node.enter(mf.overlay[0].from+uf,1),yf=this.highlighters.filter(bf=>!bf.scope||bf.scope(mf.tree.type)),vf=Ai.firstChild();for(let bf=0,Sf=uf;;bf++){let xf=bf<mf.overlay.length?mf.overlay[bf]:null,wf=xf?xf.from+uf:df,s1=Math.max(bo,Sf),If=Math.min(Ra,wf);if(s1<If&&vf)for(;Ai.from<If&&(this.highlightRange(Ai,s1,If,hc,pc),this.startSpan(Math.min(If,Ai.to),ff),!(Ai.to>=wf||!Ai.nextSibling())););if(!xf||wf>Ra)break;Sf=xf.to+uf,Sf>bo&&(this.highlightRange(gf.cursor(),Math.max(bo,xf.from+uf),Math.min(Ra,Sf),"",yf),this.startSpan(Math.min(Ra,Sf),ff))}vf&&Ai.parent()}else if(Ai.firstChild()){mf&&(hc="");do if(!(Ai.to<=bo)){if(Ai.from>=Ra)break;this.highlightRange(Ai,bo,Ra,hc,pc),this.startSpan(Math.min(Ra,Ai.to),ff)}while(Ai.nextSibling());Ai.parent()}}}function getStyleTags(vo){let Ai=vo.type.prop(ruleNodeProp);for(;Ai&&Ai.context&&!vo.matchContext(Ai.context);)Ai=Ai.next;return Ai||null}const t$1=Tag.define,comment=t$1(),name$1=t$1(),typeName=t$1(name$1),propertyName=t$1(name$1),literal=t$1(),string=t$1(literal),number=t$1(literal),content=t$1(),heading=t$1(content),keyword=t$1(),operator=t$1(),punctuation=t$1(),bracket=t$1(punctuation),meta=t$1(),tags={comment,lineComment:t$1(comment),blockComment:t$1(comment),docComment:t$1(comment),name:name$1,variableName:t$1(name$1),typeName,tagName:t$1(typeName),propertyName,attributeName:t$1(propertyName),className:t$1(name$1),labelName:t$1(name$1),namespace:t$1(name$1),macroName:t$1(name$1),literal,string,docString:t$1(string),character:t$1(string),attributeValue:t$1(string),number,integer:t$1(number),float:t$1(number),bool:t$1(literal),regexp:t$1(literal),escape:t$1(literal),color:t$1(literal),url:t$1(literal),keyword,self:t$1(keyword),null:t$1(keyword),atom:t$1(keyword),unit:t$1(keyword),modifier:t$1(keyword),operatorKeyword:t$1(keyword),controlKeyword:t$1(keyword),definitionKeyword:t$1(keyword),moduleKeyword:t$1(keyword),operator,derefOperator:t$1(operator),arithmeticOperator:t$1(operator),logicOperator:t$1(operator),bitwiseOperator:t$1(operator),compareOperator:t$1(operator),updateOperator:t$1(operator),definitionOperator:t$1(operator),typeOperator:t$1(operator),controlOperator:t$1(operator),punctuation,separator:t$1(punctuation),bracket,angleBracket:t$1(bracket),squareBracket:t$1(bracket),paren:t$1(bracket),brace:t$1(bracket),content,heading,heading1:t$1(heading),heading2:t$1(heading),heading3:t$1(heading),heading4:t$1(heading),heading5:t$1(heading),heading6:t$1(heading),contentSeparator:t$1(content),list:t$1(content),quote:t$1(content),emphasis:t$1(content),strong:t$1(content),link:t$1(content),monospace:t$1(content),strikethrough:t$1(content),inserted:t$1(),deleted:t$1(),changed:t$1(),invalid:t$1(),meta,documentMeta:t$1(meta),annotation:t$1(meta),processingInstruction:t$1(meta),definition:Tag.defineModifier("definition"),constant:Tag.defineModifier("constant"),function:Tag.defineModifier("function"),standard:Tag.defineModifier("standard"),local:Tag.defineModifier("local"),special:Tag.defineModifier("special")};for(let vo in tags){let Ai=tags[vo];Ai instanceof Tag&&(Ai.name=vo)}tagHighlighter([{tag:tags.link,class:"tok-link"},{tag:tags.heading,class:"tok-heading"},{tag:tags.emphasis,class:"tok-emphasis"},{tag:tags.strong,class:"tok-strong"},{tag:tags.keyword,class:"tok-keyword"},{tag:tags.atom,class:"tok-atom"},{tag:tags.bool,class:"tok-bool"},{tag:tags.url,class:"tok-url"},{tag:tags.labelName,class:"tok-labelName"},{tag:tags.inserted,class:"tok-inserted"},{tag:tags.deleted,class:"tok-deleted"},{tag:tags.literal,class:"tok-literal"},{tag:tags.string,class:"tok-string"},{tag:tags.number,class:"tok-number"},{tag:[tags.regexp,tags.escape,tags.special(tags.string)],class:"tok-string2"},{tag:tags.variableName,class:"tok-variableName"},{tag:tags.local(tags.variableName),class:"tok-variableName tok-local"},{tag:tags.definition(tags.variableName),class:"tok-variableName tok-definition"},{tag:tags.special(tags.variableName),class:"tok-variableName2"},{tag:tags.definition(tags.propertyName),class:"tok-propertyName tok-definition"},{tag:tags.typeName,class:"tok-typeName"},{tag:tags.namespace,class:"tok-namespace"},{tag:tags.className,class:"tok-className"},{tag:tags.macroName,class:"tok-macroName"},{tag:tags.propertyName,class:"tok-propertyName"},{tag:tags.operator,class:"tok-operator"},{tag:tags.comment,class:"tok-comment"},{tag:tags.meta,class:"tok-meta"},{tag:tags.invalid,class:"tok-invalid"},{tag:tags.punctuation,class:"tok-punctuation"}]);var _a;const languageDataProp=new NodeProp;function defineLanguageFacet(vo){return Facet.define({combine:vo?Ai=>Ai.concat(vo):void 0})}const sublanguageProp=new NodeProp;class Language{constructor(Ai,bo,Ra=[],hc=""){this.data=Ai,this.name=hc,EditorState.prototype.hasOwnProperty("tree")||Object.defineProperty(EditorState.prototype,"tree",{get(){return syntaxTree(this)}}),this.parser=bo,this.extension=[language.of(this),EditorState.languageData.of((pc,mc,uf)=>{let df=topNodeAt(pc,mc,uf),ff=df.type.prop(languageDataProp);if(!ff)return[];let hf=pc.facet(ff),pf=df.type.prop(sublanguageProp);if(pf){let mf=df.resolve(mc-df.from,uf);for(let gf of pf)if(gf.test(mf,pc)){let yf=pc.facet(gf.facet);return gf.type=="replace"?yf:yf.concat(hf)}}return hf})].concat(Ra)}isActiveAt(Ai,bo,Ra=-1){return topNodeAt(Ai,bo,Ra).type.prop(languageDataProp)==this.data}findRegions(Ai){let bo=Ai.facet(language);if((bo==null?void 0:bo.data)==this.data)return[{from:0,to:Ai.doc.length}];if(!bo||!bo.allowsNesting)return[];let Ra=[],hc=(pc,mc)=>{if(pc.prop(languageDataProp)==this.data){Ra.push({from:mc,to:mc+pc.length});return}let uf=pc.prop(NodeProp.mounted);if(uf){if(uf.tree.prop(languageDataProp)==this.data){if(uf.overlay)for(let df of uf.overlay)Ra.push({from:df.from+mc,to:df.to+mc});else Ra.push({from:mc,to:mc+pc.length});return}else if(uf.overlay){let df=Ra.length;if(hc(uf.tree,uf.overlay[0].from+mc),Ra.length>df)return}}for(let df=0;df<pc.children.length;df++){let ff=pc.children[df];ff instanceof Tree&&hc(ff,pc.positions[df]+mc)}};return hc(syntaxTree(Ai),0),Ra}get allowsNesting(){return!0}}Language.setState=StateEffect.define();function topNodeAt(vo,Ai,bo){let Ra=vo.facet(language),hc=syntaxTree(vo).topNode;if(!Ra||Ra.allowsNesting)for(let pc=hc;pc;pc=pc.enter(Ai,bo,IterMode.ExcludeBuffers))pc.type.isTop&&(hc=pc);return hc}class LRLanguage extends Language{constructor(Ai,bo,Ra){super(Ai,bo,[],Ra),this.parser=bo}static define(Ai){let bo=defineLanguageFacet(Ai.languageData);return new LRLanguage(bo,Ai.parser.configure({props:[languageDataProp.add(Ra=>Ra.isTop?bo:void 0)]}),Ai.name)}configure(Ai,bo){return new LRLanguage(this.data,this.parser.configure(Ai),bo||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function syntaxTree(vo){let Ai=vo.field(Language.state,!1);return Ai?Ai.tree:Tree.empty}class DocInput{constructor(Ai){this.doc=Ai,this.cursorPos=0,this.string="",this.cursor=Ai.iter()}get length(){return this.doc.length}syncTo(Ai){return this.string=this.cursor.next(Ai-this.cursorPos).value,this.cursorPos=Ai+this.string.length,this.cursorPos-this.string.length}chunk(Ai){return this.syncTo(Ai),this.string}get lineChunks(){return!0}read(Ai,bo){let Ra=this.cursorPos-this.string.length;return Ai<Ra||bo>=this.cursorPos?this.doc.sliceString(Ai,bo):this.string.slice(Ai-Ra,bo-Ra)}}let currentContext=null;class ParseContext{constructor(Ai,bo,Ra=[],hc,pc,mc,uf,df){this.parser=Ai,this.state=bo,this.fragments=Ra,this.tree=hc,this.treeLen=pc,this.viewport=mc,this.skipped=uf,this.scheduleOn=df,this.parse=null,this.tempSkipped=[]}static create(Ai,bo,Ra){return new ParseContext(Ai,bo,[],Tree.empty,0,Ra,[],null)}startParse(){return this.parser.startParse(new DocInput(this.state.doc),this.fragments)}work(Ai,bo){return bo!=null&&bo>=this.state.doc.length&&(bo=void 0),this.tree!=Tree.empty&&this.isDone(bo??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var Ra;if(typeof Ai=="number"){let hc=Date.now()+Ai;Ai=()=>Date.now()>hc}for(this.parse||(this.parse=this.startParse()),bo!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>bo)&&bo<this.state.doc.length&&this.parse.stopAt(bo);;){let hc=this.parse.advance();if(hc)if(this.fragments=this.withoutTempSkipped(TreeFragment.addTree(hc,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(Ra=this.parse.stoppedAt)!==null&&Ra!==void 0?Ra:this.state.doc.length,this.tree=hc,this.parse=null,this.treeLen<(bo??this.state.doc.length))this.parse=this.startParse();else return!0;if(Ai())return!1}})}takeTree(){let Ai,bo;this.parse&&(Ai=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>Ai)&&this.parse.stopAt(Ai),this.withContext(()=>{for(;!(bo=this.parse.advance()););}),this.treeLen=Ai,this.tree=bo,this.fragments=this.withoutTempSkipped(TreeFragment.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(Ai){let bo=currentContext;currentContext=this;try{return Ai()}finally{currentContext=bo}}withoutTempSkipped(Ai){for(let bo;bo=this.tempSkipped.pop();)Ai=cutFragments(Ai,bo.from,bo.to);return Ai}changes(Ai,bo){let{fragments:Ra,tree:hc,treeLen:pc,viewport:mc,skipped:uf}=this;if(this.takeTree(),!Ai.empty){let df=[];if(Ai.iterChangedRanges((ff,hf,pf,mf)=>df.push({fromA:ff,toA:hf,fromB:pf,toB:mf})),Ra=TreeFragment.applyChanges(Ra,df),hc=Tree.empty,pc=0,mc={from:Ai.mapPos(mc.from,-1),to:Ai.mapPos(mc.to,1)},this.skipped.length){uf=[];for(let ff of this.skipped){let hf=Ai.mapPos(ff.from,1),pf=Ai.mapPos(ff.to,-1);hf<pf&&uf.push({from:hf,to:pf})}}}return new ParseContext(this.parser,bo,Ra,hc,pc,mc,uf,this.scheduleOn)}updateViewport(Ai){if(this.viewport.from==Ai.from&&this.viewport.to==Ai.to)return!1;this.viewport=Ai;let bo=this.skipped.length;for(let Ra=0;Ra<this.skipped.length;Ra++){let{from:hc,to:pc}=this.skipped[Ra];hc<Ai.to&&pc>Ai.from&&(this.fragments=cutFragments(this.fragments,hc,pc),this.skipped.splice(Ra--,1))}return this.skipped.length>=bo?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(Ai,bo){this.skipped.push({from:Ai,to:bo})}static getSkippingParser(Ai){return new class extends Parser{createParse(bo,Ra,hc){let pc=hc[0].from,mc=hc[hc.length-1].to;return{parsedPos:pc,advance(){let uf=currentContext;if(uf){for(let df of hc)uf.tempSkipped.push(df);Ai&&(uf.scheduleOn=uf.scheduleOn?Promise.all([uf.scheduleOn,Ai]):Ai)}return this.parsedPos=mc,new Tree(NodeType.none,[],[],mc-pc)},stoppedAt:null,stopAt(){}}}}}isDone(Ai){Ai=Math.min(Ai,this.state.doc.length);let bo=this.fragments;return this.treeLen>=Ai&&bo.length&&bo[0].from==0&&bo[0].to>=Ai}static get(){return currentContext}}function cutFragments(vo,Ai,bo){return TreeFragment.applyChanges(vo,[{fromA:Ai,toA:bo,fromB:Ai,toB:bo}])}class LanguageState{constructor(Ai){this.context=Ai,this.tree=Ai.tree}apply(Ai){if(!Ai.docChanged&&this.tree==this.context.tree)return this;let bo=this.context.changes(Ai.changes,Ai.state),Ra=this.context.treeLen==Ai.startState.doc.length?void 0:Math.max(Ai.changes.mapPos(this.context.treeLen),bo.viewport.to);return bo.work(20,Ra)||bo.takeTree(),new LanguageState(bo)}static init(Ai){let bo=Math.min(3e3,Ai.doc.length),Ra=ParseContext.create(Ai.facet(language).parser,Ai,{from:0,to:bo});return Ra.work(20,bo)||Ra.takeTree(),new LanguageState(Ra)}}Language.state=StateField.define({create:LanguageState.init,update(vo,Ai){for(let bo of Ai.effects)if(bo.is(Language.setState))return bo.value;return Ai.startState.facet(language)!=Ai.state.facet(language)?LanguageState.init(Ai.state):vo.apply(Ai)}});let requestIdle=vo=>{let Ai=setTimeout(()=>vo(),500);return()=>clearTimeout(Ai)};typeof requestIdleCallback<"u"&&(requestIdle=vo=>{let Ai=-1,bo=setTimeout(()=>{Ai=requestIdleCallback(vo,{timeout:400})},100);return()=>Ai<0?clearTimeout(bo):cancelIdleCallback(Ai)});const isInputPending=typeof navigator<"u"&&!((_a=navigator.scheduling)===null||_a===void 0)&&_a.isInputPending?()=>navigator.scheduling.isInputPending():null,parseWorker=ViewPlugin.fromClass(class{constructor(vo){this.view=vo,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(vo){let Ai=this.view.state.field(Language.state).context;(Ai.updateViewport(vo.view.viewport)||this.view.viewport.to>Ai.treeLen)&&this.scheduleWork(),(vo.docChanged||vo.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(Ai)}scheduleWork(){if(this.working)return;let{state:vo}=this.view,Ai=vo.field(Language.state);(Ai.tree!=Ai.context.tree||!Ai.context.isDone(vo.doc.length))&&(this.working=requestIdle(this.work))}work(vo){this.working=null;let Ai=Date.now();if(this.chunkEnd<Ai&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=Ai+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:bo,viewport:{to:Ra}}=this.view,hc=bo.field(Language.state);if(hc.tree==hc.context.tree&&hc.context.isDone(Ra+1e5))return;let pc=Date.now()+Math.min(this.chunkBudget,100,vo&&!isInputPending?Math.max(25,vo.timeRemaining()-5):1e9),mc=hc.context.treeLen<Ra&&bo.doc.length>Ra+1e3,uf=hc.context.work(()=>isInputPending&&isInputPending()||Date.now()>pc,Ra+(mc?0:1e5));this.chunkBudget-=Date.now()-Ai,(uf||this.chunkBudget<=0)&&(hc.context.takeTree(),this.view.dispatch({effects:Language.setState.of(new LanguageState(hc.context))})),this.chunkBudget>0&&!(uf&&!mc)&&this.scheduleWork(),this.checkAsyncSchedule(hc.context)}checkAsyncSchedule(vo){vo.scheduleOn&&(this.workScheduled++,vo.scheduleOn.then(()=>this.scheduleWork()).catch(Ai=>logException(this.view.state,Ai)).then(()=>this.workScheduled--),vo.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),language=Facet.define({combine(vo){return vo.length?vo[0]:null},enables:vo=>[Language.state,parseWorker,EditorView.contentAttributes.compute([vo],Ai=>{let bo=Ai.facet(vo);return bo&&bo.name?{"data-language":bo.name}:{}})]});class LanguageSupport{constructor(Ai,bo=[]){this.language=Ai,this.support=bo,this.extension=[Ai,bo]}}const indentService=Facet.define(),indentUnit=Facet.define({combine:vo=>{if(!vo.length)return" ";let Ai=vo[0];if(!Ai||/\S/.test(Ai)||Array.from(Ai).some(bo=>bo!=Ai[0]))throw new Error("Invalid indent unit: "+JSON.stringify(vo[0]));return Ai}});function getIndentUnit(vo){let Ai=vo.facet(indentUnit);return Ai.charCodeAt(0)==9?vo.tabSize*Ai.length:Ai.length}function indentString(vo,Ai){let bo="",Ra=vo.tabSize,hc=vo.facet(indentUnit)[0];if(hc==" "){for(;Ai>=Ra;)bo+=" ",Ai-=Ra;hc=" "}for(let pc=0;pc<Ai;pc++)bo+=hc;return bo}function getIndentation(vo,Ai){vo instanceof EditorState&&(vo=new IndentContext(vo));for(let Ra of vo.state.facet(indentService)){let hc=Ra(vo,Ai);if(hc!==void 0)return hc}let bo=syntaxTree(vo.state);return bo.length>=Ai?syntaxIndentation(vo,bo,Ai):null}class IndentContext{constructor(Ai,bo={}){this.state=Ai,this.options=bo,this.unit=getIndentUnit(Ai)}lineAt(Ai,bo=1){let Ra=this.state.doc.lineAt(Ai),{simulateBreak:hc,simulateDoubleBreak:pc}=this.options;return hc!=null&&hc>=Ra.from&&hc<=Ra.to?pc&&hc==Ai?{text:"",from:Ai}:(bo<0?hc<Ai:hc<=Ai)?{text:Ra.text.slice(hc-Ra.from),from:hc}:{text:Ra.text.slice(0,hc-Ra.from),from:Ra.from}:Ra}textAfterPos(Ai,bo=1){if(this.options.simulateDoubleBreak&&Ai==this.options.simulateBreak)return"";let{text:Ra,from:hc}=this.lineAt(Ai,bo);return Ra.slice(Ai-hc,Math.min(Ra.length,Ai+100-hc))}column(Ai,bo=1){let{text:Ra,from:hc}=this.lineAt(Ai,bo),pc=this.countColumn(Ra,Ai-hc),mc=this.options.overrideIndentation?this.options.overrideIndentation(hc):-1;return mc>-1&&(pc+=mc-this.countColumn(Ra,Ra.search(/\S|$/))),pc}countColumn(Ai,bo=Ai.length){return countColumn(Ai,this.state.tabSize,bo)}lineIndent(Ai,bo=1){let{text:Ra,from:hc}=this.lineAt(Ai,bo),pc=this.options.overrideIndentation;if(pc){let mc=pc(hc);if(mc>-1)return mc}return this.countColumn(Ra,Ra.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const indentNodeProp=new NodeProp;function syntaxIndentation(vo,Ai,bo){let Ra=Ai.resolveStack(bo),hc=Ai.resolveInner(bo,-1).resolve(bo,0).enterUnfinishedNodesBefore(bo);if(hc!=Ra.node){let pc=[];for(let mc=hc;mc&&!(mc.from==Ra.node.from&&mc.type==Ra.node.type);mc=mc.parent)pc.push(mc);for(let mc=pc.length-1;mc>=0;mc--)Ra={node:pc[mc],next:Ra}}return indentFor(Ra,vo,bo)}function indentFor(vo,Ai,bo){for(let Ra=vo;Ra;Ra=Ra.next){let hc=indentStrategy(Ra.node);if(hc)return hc(TreeIndentContext.create(Ai,bo,Ra))}return 0}function ignoreClosed(vo){return vo.pos==vo.options.simulateBreak&&vo.options.simulateDoubleBreak}function indentStrategy(vo){let Ai=vo.type.prop(indentNodeProp);if(Ai)return Ai;let bo=vo.firstChild,Ra;if(bo&&(Ra=bo.type.prop(NodeProp.closedBy))){let hc=vo.lastChild,pc=hc&&Ra.indexOf(hc.name)>-1;return mc=>delimitedStrategy(mc,!0,1,void 0,pc&&!ignoreClosed(mc)?hc.from:void 0)}return vo.parent==null?topIndent:null}function topIndent(){return 0}class TreeIndentContext extends IndentContext{constructor(Ai,bo,Ra){super(Ai.state,Ai.options),this.base=Ai,this.pos=bo,this.context=Ra}get node(){return this.context.node}static create(Ai,bo,Ra){return new TreeIndentContext(Ai,bo,Ra)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(Ai){let bo=this.state.doc.lineAt(Ai.from);for(;;){let Ra=Ai.resolve(bo.from);for(;Ra.parent&&Ra.parent.from==Ra.from;)Ra=Ra.parent;if(isParent(Ra,Ai))break;bo=this.state.doc.lineAt(Ra.from)}return this.lineIndent(bo.from)}continue(){return indentFor(this.context.next,this.base,this.pos)}}function isParent(vo,Ai){for(let bo=Ai;bo;bo=bo.parent)if(vo==bo)return!0;return!1}function bracketedAligned(vo){let Ai=vo.node,bo=Ai.childAfter(Ai.from),Ra=Ai.lastChild;if(!bo)return null;let hc=vo.options.simulateBreak,pc=vo.state.doc.lineAt(bo.from),mc=hc==null||hc<=pc.from?pc.to:Math.min(pc.to,hc);for(let uf=bo.to;;){let df=Ai.childAfter(uf);if(!df||df==Ra)return null;if(!df.type.isSkipped){if(df.from>=mc)return null;let ff=/^ */.exec(pc.text.slice(bo.to-pc.from))[0].length;return{from:bo.from,to:bo.to+ff}}uf=df.to}}function delimitedIndent({closing:vo,align:Ai=!0,units:bo=1}){return Ra=>delimitedStrategy(Ra,Ai,bo,vo)}function delimitedStrategy(vo,Ai,bo,Ra,hc){let pc=vo.textAfter,mc=pc.match(/^\s*/)[0].length,uf=Ra&&pc.slice(mc,mc+Ra.length)==Ra||hc==vo.pos+mc,df=Ai?bracketedAligned(vo):null;return df?uf?vo.column(df.from):vo.column(df.to):vo.baseIndent+(uf?0:vo.unit*bo)}function continuedIndent({except:vo,units:Ai=1}={}){return bo=>{let Ra=vo&&vo.test(bo.textAfter);return bo.baseIndent+(Ra?0:Ai*bo.unit)}}const DontIndentBeyond=200;function indentOnInput(){return EditorState.transactionFilter.of(vo=>{if(!vo.docChanged||!vo.isUserEvent("input.type")&&!vo.isUserEvent("input.complete"))return vo;let Ai=vo.startState.languageDataAt("indentOnInput",vo.startState.selection.main.head);if(!Ai.length)return vo;let bo=vo.newDoc,{head:Ra}=vo.newSelection.main,hc=bo.lineAt(Ra);if(Ra>hc.from+DontIndentBeyond)return vo;let pc=bo.sliceString(hc.from,Ra);if(!Ai.some(ff=>ff.test(pc)))return vo;let{state:mc}=vo,uf=-1,df=[];for(let{head:ff}of mc.selection.ranges){let hf=mc.doc.lineAt(ff);if(hf.from==uf)continue;uf=hf.from;let pf=getIndentation(mc,hf.from);if(pf==null)continue;let mf=/^\s*/.exec(hf.text)[0],gf=indentString(mc,pf);mf!=gf&&df.push({from:hf.from,to:hf.from+mf.length,insert:gf})}return df.length?[vo,{changes:df,sequential:!0}]:vo})}const foldService=Facet.define(),foldNodeProp=new NodeProp;function foldInside(vo){let Ai=vo.firstChild,bo=vo.lastChild;return Ai&&Ai.to<bo.from?{from:Ai.to,to:bo.type.isError?vo.to:bo.from}:null}function syntaxFolding(vo,Ai,bo){let Ra=syntaxTree(vo);if(Ra.length<bo)return null;let hc=Ra.resolveStack(bo,1),pc=null;for(let mc=hc;mc;mc=mc.next){let uf=mc.node;if(uf.to<=bo||uf.from>bo)continue;if(pc&&uf.from<Ai)break;let df=uf.type.prop(foldNodeProp);if(df&&(uf.to<Ra.length-50||Ra.length==vo.doc.length||!isUnfinished(uf))){let ff=df(uf,vo);ff&&ff.from<=bo&&ff.from>=Ai&&ff.to>bo&&(pc=ff)}}return pc}function isUnfinished(vo){let Ai=vo.lastChild;return Ai&&Ai.to==vo.to&&Ai.type.isError}function foldable(vo,Ai,bo){for(let Ra of vo.facet(foldService)){let hc=Ra(vo,Ai,bo);if(hc)return hc}return syntaxFolding(vo,Ai,bo)}function mapRange(vo,Ai){let bo=Ai.mapPos(vo.from,1),Ra=Ai.mapPos(vo.to,-1);return bo>=Ra?void 0:{from:bo,to:Ra}}const foldEffect=StateEffect.define({map:mapRange}),unfoldEffect=StateEffect.define({map:mapRange});function selectedLines(vo){let Ai=[];for(let{head:bo}of vo.state.selection.ranges)Ai.some(Ra=>Ra.from<=bo&&Ra.to>=bo)||Ai.push(vo.lineBlockAt(bo));return Ai}const foldState=StateField.define({create(){return Decoration.none},update(vo,Ai){vo=vo.map(Ai.changes);for(let bo of Ai.effects)if(bo.is(foldEffect)&&!foldExists(vo,bo.value.from,bo.value.to)){let{preparePlaceholder:Ra}=Ai.state.facet(foldConfig),hc=Ra?Decoration.replace({widget:new PreparedFoldWidget(Ra(Ai.state,bo.value))}):foldWidget;vo=vo.update({add:[hc.range(bo.value.from,bo.value.to)]})}else bo.is(unfoldEffect)&&(vo=vo.update({filter:(Ra,hc)=>bo.value.from!=Ra||bo.value.to!=hc,filterFrom:bo.value.from,filterTo:bo.value.to}));if(Ai.selection){let bo=!1,{head:Ra}=Ai.selection.main;vo.between(Ra,Ra,(hc,pc)=>{hc<Ra&&pc>Ra&&(bo=!0)}),bo&&(vo=vo.update({filterFrom:Ra,filterTo:Ra,filter:(hc,pc)=>pc<=Ra||hc>=Ra}))}return vo},provide:vo=>EditorView.decorations.from(vo),toJSON(vo,Ai){let bo=[];return vo.between(0,Ai.doc.length,(Ra,hc)=>{bo.push(Ra,hc)}),bo},fromJSON(vo){if(!Array.isArray(vo)||vo.length%2)throw new RangeError("Invalid JSON for fold state");let Ai=[];for(let bo=0;bo<vo.length;){let Ra=vo[bo++],hc=vo[bo++];if(typeof Ra!="number"||typeof hc!="number")throw new RangeError("Invalid JSON for fold state");Ai.push(foldWidget.range(Ra,hc))}return Decoration.set(Ai,!0)}});function findFold(vo,Ai,bo){var Ra;let hc=null;return(Ra=vo.field(foldState,!1))===null||Ra===void 0||Ra.between(Ai,bo,(pc,mc)=>{(!hc||hc.from>pc)&&(hc={from:pc,to:mc})}),hc}function foldExists(vo,Ai,bo){let Ra=!1;return vo.between(Ai,Ai,(hc,pc)=>{hc==Ai&&pc==bo&&(Ra=!0)}),Ra}function maybeEnable(vo,Ai){return vo.field(foldState,!1)?Ai:Ai.concat(StateEffect.appendConfig.of(codeFolding()))}const foldCode=vo=>{for(let Ai of selectedLines(vo)){let bo=foldable(vo.state,Ai.from,Ai.to);if(bo)return vo.dispatch({effects:maybeEnable(vo.state,[foldEffect.of(bo),announceFold(vo,bo)])}),!0}return!1},unfoldCode=vo=>{if(!vo.state.field(foldState,!1))return!1;let Ai=[];for(let bo of selectedLines(vo)){let Ra=findFold(vo.state,bo.from,bo.to);Ra&&Ai.push(unfoldEffect.of(Ra),announceFold(vo,Ra,!1))}return Ai.length&&vo.dispatch({effects:Ai}),Ai.length>0};function announceFold(vo,Ai,bo=!0){let Ra=vo.state.doc.lineAt(Ai.from).number,hc=vo.state.doc.lineAt(Ai.to).number;return EditorView.announce.of(`${vo.state.phrase(bo?"Folded lines":"Unfolded lines")} ${Ra} ${vo.state.phrase("to")} ${hc}.`)}const foldAll=vo=>{let{state:Ai}=vo,bo=[];for(let Ra=0;Ra<Ai.doc.length;){let hc=vo.lineBlockAt(Ra),pc=foldable(Ai,hc.from,hc.to);pc&&bo.push(foldEffect.of(pc)),Ra=(pc?vo.lineBlockAt(pc.to):hc).to+1}return bo.length&&vo.dispatch({effects:maybeEnable(vo.state,bo)}),!!bo.length},unfoldAll=vo=>{let Ai=vo.state.field(foldState,!1);if(!Ai||!Ai.size)return!1;let bo=[];return Ai.between(0,vo.state.doc.length,(Ra,hc)=>{bo.push(unfoldEffect.of({from:Ra,to:hc}))}),vo.dispatch({effects:bo}),!0},foldKeymap=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:foldCode},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:unfoldCode},{key:"Ctrl-Alt-[",run:foldAll},{key:"Ctrl-Alt-]",run:unfoldAll}],defaultConfig={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},foldConfig=Facet.define({combine(vo){return combineConfig(vo,defaultConfig)}});function codeFolding(vo){return[foldState,baseTheme$1$1]}function widgetToDOM(vo,Ai){let{state:bo}=vo,Ra=bo.facet(foldConfig),hc=mc=>{let uf=vo.lineBlockAt(vo.posAtDOM(mc.target)),df=findFold(vo.state,uf.from,uf.to);df&&vo.dispatch({effects:unfoldEffect.of(df)}),mc.preventDefault()};if(Ra.placeholderDOM)return Ra.placeholderDOM(vo,hc,Ai);let pc=document.createElement("span");return pc.textContent=Ra.placeholderText,pc.setAttribute("aria-label",bo.phrase("folded code")),pc.title=bo.phrase("unfold"),pc.className="cm-foldPlaceholder",pc.onclick=hc,pc}const foldWidget=Decoration.replace({widget:new class extends WidgetType{toDOM(vo){return widgetToDOM(vo,null)}}});class PreparedFoldWidget extends WidgetType{constructor(Ai){super(),this.value=Ai}eq(Ai){return this.value==Ai.value}toDOM(Ai){return widgetToDOM(Ai,this.value)}}const foldGutterDefaults={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class FoldMarker extends GutterMarker{constructor(Ai,bo){super(),this.config=Ai,this.open=bo}eq(Ai){return this.config==Ai.config&&this.open==Ai.open}toDOM(Ai){if(this.config.markerDOM)return this.config.markerDOM(this.open);let bo=document.createElement("span");return bo.textContent=this.open?this.config.openText:this.config.closedText,bo.title=Ai.state.phrase(this.open?"Fold line":"Unfold line"),bo}}function foldGutter(vo={}){let Ai=Object.assign(Object.assign({},foldGutterDefaults),vo),bo=new FoldMarker(Ai,!0),Ra=new FoldMarker(Ai,!1),hc=ViewPlugin.fromClass(class{constructor(mc){this.from=mc.viewport.from,this.markers=this.buildMarkers(mc)}update(mc){(mc.docChanged||mc.viewportChanged||mc.startState.facet(language)!=mc.state.facet(language)||mc.startState.field(foldState,!1)!=mc.state.field(foldState,!1)||syntaxTree(mc.startState)!=syntaxTree(mc.state)||Ai.foldingChanged(mc))&&(this.markers=this.buildMarkers(mc.view))}buildMarkers(mc){let uf=new RangeSetBuilder;for(let df of mc.viewportLineBlocks){let ff=findFold(mc.state,df.from,df.to)?Ra:foldable(mc.state,df.from,df.to)?bo:null;ff&&uf.add(df.from,df.from,ff)}return uf.finish()}}),{domEventHandlers:pc}=Ai;return[hc,gutter({class:"cm-foldGutter",markers(mc){var uf;return((uf=mc.plugin(hc))===null||uf===void 0?void 0:uf.markers)||RangeSet.empty},initialSpacer(){return new FoldMarker(Ai,!1)},domEventHandlers:Object.assign(Object.assign({},pc),{click:(mc,uf,df)=>{if(pc.click&&pc.click(mc,uf,df))return!0;let ff=findFold(mc.state,uf.from,uf.to);if(ff)return mc.dispatch({effects:unfoldEffect.of(ff)}),!0;let hf=foldable(mc.state,uf.from,uf.to);return hf?(mc.dispatch({effects:foldEffect.of(hf)}),!0):!1}})}),codeFolding()]}const baseTheme$1$1=EditorView.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class HighlightStyle{constructor(Ai,bo){this.specs=Ai;let Ra;function hc(uf){let df=StyleModule.newName();return(Ra||(Ra=Object.create(null)))["."+df]=uf,df}const pc=typeof bo.all=="string"?bo.all:bo.all?hc(bo.all):void 0,mc=bo.scope;this.scope=mc instanceof Language?uf=>uf.prop(languageDataProp)==mc.data:mc?uf=>uf==mc:void 0,this.style=tagHighlighter(Ai.map(uf=>({tag:uf.tag,class:uf.class||hc(Object.assign({},uf,{tag:null}))})),{all:pc}).style,this.module=Ra?new StyleModule(Ra):null,this.themeType=bo.themeType}static define(Ai,bo){return new HighlightStyle(Ai,bo||{})}}const highlighterFacet=Facet.define(),fallbackHighlighter=Facet.define({combine(vo){return vo.length?[vo[0]]:null}});function getHighlighters(vo){let Ai=vo.facet(highlighterFacet);return Ai.length?Ai:vo.facet(fallbackHighlighter)}function syntaxHighlighting(vo,Ai){let bo=[treeHighlighter],Ra;return vo instanceof HighlightStyle&&(vo.module&&bo.push(EditorView.styleModule.of(vo.module)),Ra=vo.themeType),Ai!=null&&Ai.fallback?bo.push(fallbackHighlighter.of(vo)):Ra?bo.push(highlighterFacet.computeN([EditorView.darkTheme],hc=>hc.facet(EditorView.darkTheme)==(Ra=="dark")?[vo]:[])):bo.push(highlighterFacet.of(vo)),bo}class TreeHighlighter{constructor(Ai){this.markCache=Object.create(null),this.tree=syntaxTree(Ai.state),this.decorations=this.buildDeco(Ai,getHighlighters(Ai.state)),this.decoratedTo=Ai.viewport.to}update(Ai){let bo=syntaxTree(Ai.state),Ra=getHighlighters(Ai.state),hc=Ra!=getHighlighters(Ai.startState),{viewport:pc}=Ai.view,mc=Ai.changes.mapPos(this.decoratedTo,1);bo.length<pc.to&&!hc&&bo.type==this.tree.type&&mc>=pc.to?(this.decorations=this.decorations.map(Ai.changes),this.decoratedTo=mc):(bo!=this.tree||Ai.viewportChanged||hc)&&(this.tree=bo,this.decorations=this.buildDeco(Ai.view,Ra),this.decoratedTo=pc.to)}buildDeco(Ai,bo){if(!bo||!this.tree.length)return Decoration.none;let Ra=new RangeSetBuilder;for(let{from:hc,to:pc}of Ai.visibleRanges)highlightTree(this.tree,bo,(mc,uf,df)=>{Ra.add(mc,uf,this.markCache[df]||(this.markCache[df]=Decoration.mark({class:df})))},hc,pc);return Ra.finish()}}const treeHighlighter=Prec.high(ViewPlugin.fromClass(TreeHighlighter,{decorations:vo=>vo.decorations})),defaultHighlightStyle=HighlightStyle.define([{tag:tags.meta,color:"#404740"},{tag:tags.link,textDecoration:"underline"},{tag:tags.heading,textDecoration:"underline",fontWeight:"bold"},{tag:tags.emphasis,fontStyle:"italic"},{tag:tags.strong,fontWeight:"bold"},{tag:tags.strikethrough,textDecoration:"line-through"},{tag:tags.keyword,color:"#708"},{tag:[tags.atom,tags.bool,tags.url,tags.contentSeparator,tags.labelName],color:"#219"},{tag:[tags.literal,tags.inserted],color:"#164"},{tag:[tags.string,tags.deleted],color:"#a11"},{tag:[tags.regexp,tags.escape,tags.special(tags.string)],color:"#e40"},{tag:tags.definition(tags.variableName),color:"#00f"},{tag:tags.local(tags.variableName),color:"#30a"},{tag:[tags.typeName,tags.namespace],color:"#085"},{tag:tags.className,color:"#167"},{tag:[tags.special(tags.variableName),tags.macroName],color:"#256"},{tag:tags.definition(tags.propertyName),color:"#00c"},{tag:tags.comment,color:"#940"},{tag:tags.invalid,color:"#f00"}]),baseTheme$4=EditorView.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),DefaultScanDist=1e4,DefaultBrackets="()[]{}",bracketMatchingConfig=Facet.define({combine(vo){return combineConfig(vo,{afterCursor:!0,brackets:DefaultBrackets,maxScanDistance:DefaultScanDist,renderMatch:defaultRenderMatch})}}),matchingMark=Decoration.mark({class:"cm-matchingBracket"}),nonmatchingMark=Decoration.mark({class:"cm-nonmatchingBracket"});function defaultRenderMatch(vo){let Ai=[],bo=vo.matched?matchingMark:nonmatchingMark;return Ai.push(bo.range(vo.start.from,vo.start.to)),vo.end&&Ai.push(bo.range(vo.end.from,vo.end.to)),Ai}const bracketMatchingState=StateField.define({create(){return Decoration.none},update(vo,Ai){if(!Ai.docChanged&&!Ai.selection)return vo;let bo=[],Ra=Ai.state.facet(bracketMatchingConfig);for(let hc of Ai.state.selection.ranges){if(!hc.empty)continue;let pc=matchBrackets(Ai.state,hc.head,-1,Ra)||hc.head>0&&matchBrackets(Ai.state,hc.head-1,1,Ra)||Ra.afterCursor&&(matchBrackets(Ai.state,hc.head,1,Ra)||hc.head<Ai.state.doc.length&&matchBrackets(Ai.state,hc.head+1,-1,Ra));pc&&(bo=bo.concat(Ra.renderMatch(pc,Ai.state)))}return Decoration.set(bo,!0)},provide:vo=>EditorView.decorations.from(vo)}),bracketMatchingUnique=[bracketMatchingState,baseTheme$4];function bracketMatching(vo={}){return[bracketMatchingConfig.of(vo),bracketMatchingUnique]}const bracketMatchingHandle=new NodeProp;function matchingNodes(vo,Ai,bo){let Ra=vo.prop(Ai<0?NodeProp.openedBy:NodeProp.closedBy);if(Ra)return Ra;if(vo.name.length==1){let hc=bo.indexOf(vo.name);if(hc>-1&&hc%2==(Ai<0?1:0))return[bo[hc+Ai]]}return null}function findHandle(vo){let Ai=vo.type.prop(bracketMatchingHandle);return Ai?Ai(vo.node):vo}function matchBrackets(vo,Ai,bo,Ra={}){let hc=Ra.maxScanDistance||DefaultScanDist,pc=Ra.brackets||DefaultBrackets,mc=syntaxTree(vo),uf=mc.resolveInner(Ai,bo);for(let df=uf;df;df=df.parent){let ff=matchingNodes(df.type,bo,pc);if(ff&&df.from<df.to){let hf=findHandle(df);if(hf&&(bo>0?Ai>=hf.from&&Ai<hf.to:Ai>hf.from&&Ai<=hf.to))return matchMarkedBrackets(vo,Ai,bo,df,hf,ff,pc)}}return matchPlainBrackets(vo,Ai,bo,mc,uf.type,hc,pc)}function matchMarkedBrackets(vo,Ai,bo,Ra,hc,pc,mc){let uf=Ra.parent,df={from:hc.from,to:hc.to},ff=0,hf=uf==null?void 0:uf.cursor();if(hf&&(bo<0?hf.childBefore(Ra.from):hf.childAfter(Ra.to)))do if(bo<0?hf.to<=Ra.from:hf.from>=Ra.to){if(ff==0&&pc.indexOf(hf.type.name)>-1&&hf.from<hf.to){let pf=findHandle(hf);return{start:df,end:pf?{from:pf.from,to:pf.to}:void 0,matched:!0}}else if(matchingNodes(hf.type,bo,mc))ff++;else if(matchingNodes(hf.type,-bo,mc)){if(ff==0){let pf=findHandle(hf);return{start:df,end:pf&&pf.from<pf.to?{from:pf.from,to:pf.to}:void 0,matched:!1}}ff--}}while(bo<0?hf.prevSibling():hf.nextSibling());return{start:df,matched:!1}}function matchPlainBrackets(vo,Ai,bo,Ra,hc,pc,mc){let uf=bo<0?vo.sliceDoc(Ai-1,Ai):vo.sliceDoc(Ai,Ai+1),df=mc.indexOf(uf);if(df<0||df%2==0!=bo>0)return null;let ff={from:bo<0?Ai-1:Ai,to:bo>0?Ai+1:Ai},hf=vo.doc.iterRange(Ai,bo>0?vo.doc.length:0),pf=0;for(let mf=0;!hf.next().done&&mf<=pc;){let gf=hf.value;bo<0&&(mf+=gf.length);let yf=Ai+mf*bo;for(let vf=bo>0?0:gf.length-1,bf=bo>0?gf.length:-1;vf!=bf;vf+=bo){let Sf=mc.indexOf(gf[vf]);if(!(Sf<0||Ra.resolveInner(yf+vf,1).type!=hc))if(Sf%2==0==bo>0)pf++;else{if(pf==1)return{start:ff,end:{from:yf+vf,to:yf+vf+1},matched:Sf>>1==df>>1};pf--}}bo>0&&(mf+=gf.length)}return hf.done?{start:ff,matched:!1}:null}const noTokens=Object.create(null),typeArray=[NodeType.none],warned=[],byTag=Object.create(null),defaultTable=Object.create(null);for(let[vo,Ai]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])defaultTable[vo]=createTokenType(noTokens,Ai);function warnForPart(vo,Ai){warned.indexOf(vo)>-1||(warned.push(vo),console.warn(Ai))}function createTokenType(vo,Ai){let bo=[];for(let uf of Ai.split(" ")){let df=[];for(let ff of uf.split(".")){let hf=vo[ff]||tags[ff];hf?typeof hf=="function"?df.length?df=df.map(hf):warnForPart(ff,`Modifier ${ff} used at start of tag`):df.length?warnForPart(ff,`Tag ${ff} used as modifier`):df=Array.isArray(hf)?hf:[hf]:warnForPart(ff,`Unknown highlighting tag ${ff}`)}for(let ff of df)bo.push(ff)}if(!bo.length)return 0;let Ra=Ai.replace(/ /g,"_"),hc=Ra+" "+bo.map(uf=>uf.id),pc=byTag[hc];if(pc)return pc.id;let mc=byTag[hc]=NodeType.define({id:typeArray.length,name:Ra,props:[styleTags({[Ra]:bo})]});return typeArray.push(mc),mc.id}Direction.RTL,Direction.LTR;const createTheme=({variant:vo,settings:Ai,styles:bo})=>{const Ra=EditorView.theme({"&":{backgroundColor:Ai.background,color:Ai.foreground},".cm-content":{caretColor:Ai.caret},".cm-cursor, .cm-dropCursor":{borderLeftColor:Ai.caret},"&.cm-focused .cm-selectionBackgroundm .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Ai.selection},".cm-activeLine":{backgroundColor:Ai.lineHighlight},".cm-gutters":{backgroundColor:Ai.gutterBackground,color:Ai.gutterForeground},".cm-activeLineGutter":{backgroundColor:Ai.lineHighlight}},{dark:vo==="dark"}),hc=HighlightStyle.define(bo);return[Ra,syntaxHighlighting(hc)]};createTheme({variant:"dark",settings:{background:"#200020",foreground:"#D0D0FF",caret:"#7070FF",selection:"#80000080",gutterBackground:"#200020",gutterForeground:"#C080C0",lineHighlight:"#80000040"},styles:[{tag:tags.comment,color:"#404080"},{tag:[tags.string,tags.regexp],color:"#999999"},{tag:tags.number,color:"#7090B0"},{tag:[tags.bool,tags.null],color:"#8080A0"},{tag:[tags.punctuation,tags.derefOperator],color:"#805080"},{tag:tags.keyword,color:"#60B0FF"},{tag:tags.definitionKeyword,color:"#B0FFF0"},{tag:tags.moduleKeyword,color:"#60B0FF"},{tag:tags.operator,color:"#A0A0FF"},{tag:[tags.variableName,tags.self],color:"#008080"},{tag:tags.operatorKeyword,color:"#A0A0FF"},{tag:tags.controlKeyword,color:"#80A0FF"},{tag:tags.className,color:"#70E080"},{tag:[tags.function(tags.propertyName),tags.propertyName],color:"#50A0A0"},{tag:tags.tagName,color:"#009090"},{tag:tags.modifier,color:"#B0FFF0"},{tag:[tags.squareBracket,tags.attributeName],color:"#D0D0FF"}]});const ayuLight=createTheme({variant:"light",settings:{background:"#fcfcfc",foreground:"#5c6166",caret:"#ffaa33",selection:"#036dd626",gutterBackground:"#fcfcfc",gutterForeground:"#8a919966",lineHighlight:"#8a91991a"},styles:[{tag:tags.comment,color:"#787b8099"},{tag:tags.string,color:"#86b300"},{tag:tags.regexp,color:"#4cbf99"},{tag:[tags.number,tags.bool,tags.null],color:"#ffaa33"},{tag:tags.variableName,color:"#5c6166"},{tag:[tags.definitionKeyword,tags.modifier],color:"#fa8d3e"},{tag:[tags.keyword,tags.special(tags.brace)],color:"#fa8d3e"},{tag:tags.operator,color:"#ed9366"},{tag:tags.separator,color:"#5c6166b3"},{tag:tags.punctuation,color:"#5c6166"},{tag:[tags.definition(tags.propertyName),tags.function(tags.variableName)],color:"#f2ae49"},{tag:[tags.className,tags.definition(tags.typeName)],color:"#22a4e6"},{tag:[tags.tagName,tags.typeName,tags.self,tags.labelName],color:"#55b4d4"},{tag:tags.angleBracket,color:"#55b4d480"},{tag:tags.attributeName,color:"#f2ae49"}]});createTheme({variant:"dark",settings:{background:"#15191EFA",foreground:"#EEF2F7",caret:"#C4C4C4",selection:"#90B2D557",gutterBackground:"#15191EFA",gutterForeground:"#aaaaaa95",lineHighlight:"#57575712"},styles:[{tag:tags.comment,color:"#6E6E6E"},{tag:[tags.string,tags.regexp,tags.special(tags.brace)],color:"#5C81B3"},{tag:tags.number,color:"#C1E1B8"},{tag:tags.bool,color:"#53667D"},{tag:[tags.definitionKeyword,tags.modifier,tags.function(tags.propertyName)],color:"#A3D295",fontWeight:"bold"},{tag:[tags.keyword,tags.moduleKeyword,tags.operatorKeyword,tags.operator],color:"#697A8E",fontWeight:"bold"},{tag:[tags.variableName,tags.attributeName],color:"#708E67"},{tag:[tags.function(tags.variableName),tags.definition(tags.propertyName),tags.derefOperator],color:"#fff"},{tag:tags.tagName,color:"#A3D295"}]});createTheme({variant:"dark",settings:{background:"#2e241d",foreground:"#BAAE9E",caret:"#A7A7A7",selection:"#DDF0FF33",gutterBackground:"#28211C",gutterForeground:"#BAAE9E90",lineHighlight:"#FFFFFF08"},styles:[{tag:tags.comment,color:"#666666"},{tag:[tags.string,tags.special(tags.brace)],color:"#54BE0D"},{tag:tags.regexp,color:"#E9C062"},{tag:tags.number,color:"#CF6A4C"},{tag:[tags.keyword,tags.operator],color:"#5EA6EA"},{tag:tags.variableName,color:"#7587A6"},{tag:[tags.definitionKeyword,tags.modifier],color:"#F9EE98"},{tag:[tags.propertyName,tags.function(tags.variableName)],color:"#937121"},{tag:[tags.typeName,tags.angleBracket,tags.tagName],color:"#9B859D"}]});createTheme({variant:"dark",settings:{background:"#3b2627",foreground:"#E6E1C4",caret:"#E6E1C4",selection:"#16120E",gutterBackground:"#3b2627",gutterForeground:"#E6E1C490",lineHighlight:"#1F1611"},styles:[{tag:tags.comment,color:"#6B4E32"},{tag:[tags.keyword,tags.operator,tags.derefOperator],color:"#EF5D32"},{tag:tags.className,color:"#EFAC32",fontWeight:"bold"},{tag:[tags.typeName,tags.propertyName,tags.function(tags.variableName),tags.definition(tags.variableName)],color:"#EFAC32"},{tag:tags.definition(tags.typeName),color:"#EFAC32",fontWeight:"bold"},{tag:tags.labelName,color:"#EFAC32",fontWeight:"bold"},{tag:[tags.number,tags.bool],color:"#6C99BB"},{tag:[tags.variableName,tags.self],color:"#7DAF9C"},{tag:[tags.string,tags.special(tags.brace),tags.regexp],color:"#D9D762"},{tag:[tags.angleBracket,tags.tagName,tags.attributeName],color:"#EFCB43"}]});createTheme({variant:"dark",settings:{background:"#000205",foreground:"#FFFFFF",caret:"#E60065",selection:"#E60C6559",gutterBackground:"#000205",gutterForeground:"#ffffff90",lineHighlight:"#4DD7FC1A"},styles:[{tag:tags.comment,color:"#404040"},{tag:[tags.string,tags.special(tags.brace),tags.regexp],color:"#00D8FF"},{tag:tags.number,color:"#E62286"},{tag:[tags.variableName,tags.attributeName,tags.self],color:"#E62286",fontWeight:"bold"},{tag:tags.function(tags.variableName),color:"#fff",fontWeight:"bold"}]});createTheme({variant:"light",settings:{background:"#fff",foreground:"#000",caret:"#000",selection:"#BDD5FC",gutterBackground:"#fff",gutterForeground:"#00000070",lineHighlight:"#FFFBD1"},styles:[{tag:tags.comment,color:"#BCC8BA"},{tag:[tags.string,tags.special(tags.brace),tags.regexp],color:"#5D90CD"},{tag:[tags.number,tags.bool,tags.null],color:"#46A609"},{tag:tags.keyword,color:"#AF956F"},{tag:[tags.definitionKeyword,tags.modifier],color:"#C52727"},{tag:[tags.angleBracket,tags.tagName,tags.attributeName],color:"#606060"},{tag:tags.self,color:"#000"}]});createTheme({variant:"dark",settings:{background:"#00254b",foreground:"#FFFFFF",caret:"#FFFFFF",selection:"#B36539BF",gutterBackground:"#00254b",gutterForeground:"#FFFFFF70",lineHighlight:"#00000059"},styles:[{tag:tags.comment,color:"#0088FF"},{tag:tags.string,color:"#3AD900"},{tag:tags.regexp,color:"#80FFC2"},{tag:[tags.number,tags.bool,tags.null],color:"#FF628C"},{tag:[tags.definitionKeyword,tags.modifier],color:"#FFEE80"},{tag:tags.variableName,color:"#CCCCCC"},{tag:tags.self,color:"#FF80E1"},{tag:[tags.className,tags.definition(tags.propertyName),tags.function(tags.variableName),tags.definition(tags.typeName),tags.labelName],color:"#FFDD00"},{tag:[tags.keyword,tags.operator],color:"#FF9D00"},{tag:[tags.propertyName,tags.typeName],color:"#80FFBB"},{tag:tags.special(tags.brace),color:"#EDEF7D"},{tag:tags.attributeName,color:"#9EFFFF"},{tag:tags.derefOperator,color:"#fff"}]});createTheme({variant:"dark",settings:{background:"#060521",foreground:"#E0E0E0",caret:"#FFFFFFA6",selection:"#122BBB",gutterBackground:"#060521",gutterForeground:"#E0E0E090",lineHighlight:"#FFFFFF0F"},styles:[{tag:tags.comment,color:"#AEAEAE"},{tag:[tags.string,tags.special(tags.brace),tags.regexp],color:"#8DFF8E"},{tag:[tags.className,tags.definition(tags.propertyName),tags.function(tags.variableName),tags.function(tags.definition(tags.variableName)),tags.definition(tags.typeName)],color:"#A3EBFF"},{tag:[tags.number,tags.bool,tags.null],color:"#62E9BD"},{tag:[tags.keyword,tags.operator],color:"#2BF1DC"},{tag:[tags.definitionKeyword,tags.modifier],color:"#F8FBB1"},{tag:[tags.variableName,tags.self],color:"#B683CA"},{tag:[tags.angleBracket,tags.tagName,tags.typeName,tags.propertyName],color:"#60A4F1"},{tag:tags.derefOperator,color:"#E0E0E0"},{tag:tags.attributeName,color:"#7BACCA"}]});createTheme({variant:"dark",settings:{background:"#2d2f3f",foreground:"#f8f8f2",caret:"#f8f8f0",selection:"#44475a",gutterBackground:"#282a36",gutterForeground:"rgb(144, 145, 148)",lineHighlight:"#44475a"},styles:[{tag:tags.comment,color:"#6272a4"},{tag:[tags.string,tags.special(tags.brace)],color:"#f1fa8c"},{tag:[tags.number,tags.self,tags.bool,tags.null],color:"#bd93f9"},{tag:[tags.keyword,tags.operator],color:"#ff79c6"},{tag:[tags.definitionKeyword,tags.typeName],color:"#8be9fd"},{tag:tags.definition(tags.typeName),color:"#f8f8f2"},{tag:[tags.className,tags.definition(tags.propertyName),tags.function(tags.variableName),tags.attributeName],color:"#50fa7b"}]});createTheme({variant:"light",settings:{background:"#FFFFFF",foreground:"#000000",caret:"#000000",selection:"#80C7FF",gutterBackground:"#FFFFFF",gutterForeground:"#00000070",lineHighlight:"#C1E2F8"},styles:[{tag:tags.comment,color:"#AAAAAA"},{tag:[tags.keyword,tags.operator,tags.typeName,tags.tagName,tags.propertyName],color:"#2F6F9F",fontWeight:"bold"},{tag:[tags.attributeName,tags.definition(tags.propertyName)],color:"#4F9FD0"},{tag:[tags.className,tags.string,tags.special(tags.brace)],color:"#CF4F5F"},{tag:tags.number,color:"#CF4F5F",fontWeight:"bold"},{tag:tags.variableName,fontWeight:"bold"}]});createTheme({variant:"light",settings:{background:"#f2f1f8",foreground:"#0c006b",caret:"#5c49e9",selection:"#d5d1f2",gutterBackground:"#f2f1f8",gutterForeground:"#0c006b70",lineHighlight:"#e1def3"},styles:[{tag:tags.comment,color:"#9995b7"},{tag:tags.keyword,color:"#ff5792",fontWeight:"bold"},{tag:[tags.definitionKeyword,tags.modifier],color:"#ff5792"},{tag:[tags.className,tags.tagName,tags.definition(tags.typeName)],color:"#0094f0"},{tag:[tags.number,tags.bool,tags.null,tags.special(tags.brace)],color:"#5842ff"},{tag:[tags.definition(tags.propertyName),tags.function(tags.variableName)],color:"#0095a8"},{tag:tags.typeName,color:"#b3694d"},{tag:[tags.propertyName,tags.variableName],color:"#fa8900"},{tag:tags.operator,color:"#ff5792"},{tag:tags.self,color:"#e64100"},{tag:[tags.string,tags.regexp],color:"#00b368"},{tag:[tags.paren,tags.bracket],color:"#0431fa"},{tag:tags.labelName,color:"#00bdd6"},{tag:tags.attributeName,color:"#e64100"},{tag:tags.angleBracket,color:"#9995b7"}]});createTheme({variant:"light",settings:{background:"#faf4ed",foreground:"#575279",caret:"#575279",selection:"#6e6a8614",gutterBackground:"#faf4ed",gutterForeground:"#57527970",lineHighlight:"#6e6a860d"},styles:[{tag:tags.comment,color:"#9893a5"},{tag:[tags.bool,tags.null],color:"#286983"},{tag:tags.number,color:"#d7827e"},{tag:tags.className,color:"#d7827e"},{tag:[tags.angleBracket,tags.tagName,tags.typeName],color:"#56949f"},{tag:tags.attributeName,color:"#907aa9"},{tag:tags.punctuation,color:"#797593"},{tag:[tags.keyword,tags.modifier],color:"#286983"},{tag:[tags.string,tags.regexp],color:"#ea9d34"},{tag:tags.variableName,color:"#d7827e"}]});createTheme({variant:"light",settings:{background:"#FFFFFF",foreground:"#000000",caret:"#000000",selection:"#FFFD0054",gutterBackground:"#FFFFFF",gutterForeground:"#00000070",lineHighlight:"#00000008"},styles:[{tag:tags.comment,color:"#CFCFCF"},{tag:[tags.number,tags.bool,tags.null],color:"#E66C29"},{tag:[tags.className,tags.definition(tags.propertyName),tags.function(tags.variableName),tags.labelName,tags.definition(tags.typeName)],color:"#2EB43B"},{tag:tags.keyword,color:"#D8B229"},{tag:tags.operator,color:"#4EA44E",fontWeight:"bold"},{tag:[tags.definitionKeyword,tags.modifier],color:"#925A47"},{tag:tags.string,color:"#704D3D"},{tag:tags.typeName,color:"#2F8996"},{tag:[tags.variableName,tags.propertyName],color:"#77ACB0"},{tag:tags.self,color:"#77ACB0",fontWeight:"bold"},{tag:tags.regexp,color:"#E3965E"},{tag:[tags.tagName,tags.angleBracket],color:"#BAA827"},{tag:tags.attributeName,color:"#B06520"},{tag:tags.derefOperator,color:"#000"}]});createTheme({variant:"light",settings:{background:"#fef7e5",foreground:"#586E75",caret:"#000000",selection:"#073642",gutterBackground:"#fef7e5",gutterForeground:"#586E7580",lineHighlight:"#EEE8D5"},styles:[{tag:tags.comment,color:"#93A1A1"},{tag:tags.string,color:"#2AA198"},{tag:tags.regexp,color:"#D30102"},{tag:tags.number,color:"#D33682"},{tag:tags.variableName,color:"#268BD2"},{tag:[tags.keyword,tags.operator,tags.punctuation],color:"#859900"},{tag:[tags.definitionKeyword,tags.modifier],color:"#073642",fontWeight:"bold"},{tag:[tags.className,tags.self,tags.definition(tags.propertyName)],color:"#268BD2"},{tag:tags.function(tags.variableName),color:"#268BD2"},{tag:[tags.bool,tags.null],color:"#B58900"},{tag:tags.tagName,color:"#268BD2",fontWeight:"bold"},{tag:tags.angleBracket,color:"#93A1A1"},{tag:tags.attributeName,color:"#93A1A1"},{tag:tags.typeName,color:"#859900"}]});createTheme({variant:"light",settings:{background:"#FFFFFF",foreground:"#4D4D4C",caret:"#AEAFAD",selection:"#D6D6D6",gutterBackground:"#FFFFFF",gutterForeground:"#4D4D4C80",lineHighlight:"#EFEFEF"},styles:[{tag:tags.comment,color:"#8E908C"},{tag:[tags.variableName,tags.self,tags.propertyName,tags.attributeName,tags.regexp],color:"#C82829"},{tag:[tags.number,tags.bool,tags.null],color:"#F5871F"},{tag:[tags.className,tags.typeName,tags.definition(tags.typeName)],color:"#C99E00"},{tag:[tags.string,tags.special(tags.brace)],color:"#718C00"},{tag:tags.operator,color:"#3E999F"},{tag:[tags.definition(tags.propertyName),tags.function(tags.variableName)],color:"#4271AE"},{tag:tags.keyword,color:"#8959A8"},{tag:tags.derefOperator,color:"#4D4D4C"}]});function objectValues(vo){const Ai=Object.keys(vo),bo=Ai.length,Ra=new Array(bo);for(let hc=0;hc<bo;++hc)Ra[hc]=vo[Ai[hc]];return Ra}function hintList(vo,Ai){return filterAndSortList(Ai,normalizeText(vo.string))}function filterAndSortList(vo,Ai){if(!Ai||Ai.trim()===""||Ai.trim()===":"||Ai.trim()==="{")return filterNonEmpty(vo,Ra=>!Ra.isDeprecated);const bo=vo.map(Ra=>({proximity:getProximity(normalizeText(Ra.label),Ai),entry:Ra}));return filterNonEmpty(filterNonEmpty(bo,Ra=>Ra.proximity<=2),Ra=>!Ra.entry.isDeprecated).sort((Ra,hc)=>(Ra.entry.isDeprecated?1:0)-(hc.entry.isDeprecated?1:0)||Ra.proximity-hc.proximity||Ra.entry.label.length-hc.entry.label.length).map(Ra=>Ra.entry)}function filterNonEmpty(vo,Ai){const bo=vo.filter(Ai);return bo.length===0?vo:bo}function normalizeText(vo){return vo.toLowerCase().replaceAll(/\W/g,"")}function getProximity(vo,Ai){let bo=lexicalDistance(Ai,vo);return vo.length>Ai.length&&(bo-=vo.length-Ai.length-1,bo+=vo.indexOf(Ai)===0?0:.5),bo}function lexicalDistance(vo,Ai){let bo,Ra;const hc=[],pc=vo.length,mc=Ai.length;for(bo=0;bo<=pc;bo++)hc[bo]=[bo];for(Ra=1;Ra<=mc;Ra++)hc[0][Ra]=Ra;for(bo=1;bo<=pc;bo++)for(Ra=1;Ra<=mc;Ra++){const uf=vo[bo-1]===Ai[Ra-1]?0:1;hc[bo][Ra]=Math.min(hc[bo-1][Ra]+1,hc[bo][Ra-1]+1,hc[bo-1][Ra-1]+uf),bo>1&&Ra>1&&vo[bo-1]===Ai[Ra-2]&&vo[bo-2]===Ai[Ra-1]&&(hc[bo][Ra]=Math.min(hc[bo][Ra],hc[bo-2][Ra-2]+uf))}return hc[pc][mc]}const insertSuffix=vo=>` {
|
|
357
|
-
$1
|
|
358
|
-
}`,getInsertText=(vo,Ai,bo)=>{if(!Ai)return bo??vo;const Ra=getNamedType(Ai);return isObjectType(Ra)||isInputObjectType(Ra)||isListType(Ra)||isAbstractType(Ra)?vo+insertSuffix():bo??vo},getInputInsertText=(vo,Ai,bo)=>{if(isListType(Ai)){const Ra=getNamedType(Ai.ofType);return vo+`[${getInsertText("",Ra,"$1")}]`}return getInsertText(vo,Ai,bo)},getFieldInsertText=vo=>{const Ai=vo.args.filter(bo=>bo.type.toString().endsWith("!"));if(Ai.length)return vo.name+`(${Ai.map((bo,Ra)=>`${bo.name}: $${Ra+1}`)}) ${getInsertText("",vo.type,`
|
|
359
|
-
`)}`};var DocumentUri;(function(vo){function Ai(bo){return typeof bo=="string"}vo.is=Ai})(DocumentUri||(DocumentUri={}));var URI;(function(vo){function Ai(bo){return typeof bo=="string"}vo.is=Ai})(URI||(URI={}));var integer;(function(vo){vo.MIN_VALUE=-2147483648,vo.MAX_VALUE=2147483647;function Ai(bo){return typeof bo=="number"&&vo.MIN_VALUE<=bo&&bo<=vo.MAX_VALUE}vo.is=Ai})(integer||(integer={}));var uinteger;(function(vo){vo.MIN_VALUE=0,vo.MAX_VALUE=2147483647;function Ai(bo){return typeof bo=="number"&&vo.MIN_VALUE<=bo&&bo<=vo.MAX_VALUE}vo.is=Ai})(uinteger||(uinteger={}));var Position$2;(function(vo){function Ai(Ra,hc){return Ra===Number.MAX_VALUE&&(Ra=uinteger.MAX_VALUE),hc===Number.MAX_VALUE&&(hc=uinteger.MAX_VALUE),{line:Ra,character:hc}}vo.create=Ai;function bo(Ra){let hc=Ra;return Is.objectLiteral(hc)&&Is.uinteger(hc.line)&&Is.uinteger(hc.character)}vo.is=bo})(Position$2||(Position$2={}));var Range$1;(function(vo){function Ai(Ra,hc,pc,mc){if(Is.uinteger(Ra)&&Is.uinteger(hc)&&Is.uinteger(pc)&&Is.uinteger(mc))return{start:Position$2.create(Ra,hc),end:Position$2.create(pc,mc)};if(Position$2.is(Ra)&&Position$2.is(hc))return{start:Ra,end:hc};throw new Error(`Range#create called with invalid arguments[${Ra}, ${hc}, ${pc}, ${mc}]`)}vo.create=Ai;function bo(Ra){let hc=Ra;return Is.objectLiteral(hc)&&Position$2.is(hc.start)&&Position$2.is(hc.end)}vo.is=bo})(Range$1||(Range$1={}));var Location;(function(vo){function Ai(Ra,hc){return{uri:Ra,range:hc}}vo.create=Ai;function bo(Ra){let hc=Ra;return Is.objectLiteral(hc)&&Range$1.is(hc.range)&&(Is.string(hc.uri)||Is.undefined(hc.uri))}vo.is=bo})(Location||(Location={}));var LocationLink;(function(vo){function Ai(Ra,hc,pc,mc){return{targetUri:Ra,targetRange:hc,targetSelectionRange:pc,originSelectionRange:mc}}vo.create=Ai;function bo(Ra){let hc=Ra;return Is.objectLiteral(hc)&&Range$1.is(hc.targetRange)&&Is.string(hc.targetUri)&&Range$1.is(hc.targetSelectionRange)&&(Range$1.is(hc.originSelectionRange)||Is.undefined(hc.originSelectionRange))}vo.is=bo})(LocationLink||(LocationLink={}));var Color;(function(vo){function Ai(Ra,hc,pc,mc){return{red:Ra,green:hc,blue:pc,alpha:mc}}vo.create=Ai;function bo(Ra){const hc=Ra;return Is.objectLiteral(hc)&&Is.numberRange(hc.red,0,1)&&Is.numberRange(hc.green,0,1)&&Is.numberRange(hc.blue,0,1)&&Is.numberRange(hc.alpha,0,1)}vo.is=bo})(Color||(Color={}));var ColorInformation;(function(vo){function Ai(Ra,hc){return{range:Ra,color:hc}}vo.create=Ai;function bo(Ra){const hc=Ra;return Is.objectLiteral(hc)&&Range$1.is(hc.range)&&Color.is(hc.color)}vo.is=bo})(ColorInformation||(ColorInformation={}));var ColorPresentation;(function(vo){function Ai(Ra,hc,pc){return{label:Ra,textEdit:hc,additionalTextEdits:pc}}vo.create=Ai;function bo(Ra){const hc=Ra;return Is.objectLiteral(hc)&&Is.string(hc.label)&&(Is.undefined(hc.textEdit)||TextEdit.is(hc))&&(Is.undefined(hc.additionalTextEdits)||Is.typedArray(hc.additionalTextEdits,TextEdit.is))}vo.is=bo})(ColorPresentation||(ColorPresentation={}));var FoldingRangeKind;(function(vo){vo.Comment="comment",vo.Imports="imports",vo.Region="region"})(FoldingRangeKind||(FoldingRangeKind={}));var FoldingRange;(function(vo){function Ai(Ra,hc,pc,mc,uf,df){const ff={startLine:Ra,endLine:hc};return Is.defined(pc)&&(ff.startCharacter=pc),Is.defined(mc)&&(ff.endCharacter=mc),Is.defined(uf)&&(ff.kind=uf),Is.defined(df)&&(ff.collapsedText=df),ff}vo.create=Ai;function bo(Ra){const hc=Ra;return Is.objectLiteral(hc)&&Is.uinteger(hc.startLine)&&Is.uinteger(hc.startLine)&&(Is.undefined(hc.startCharacter)||Is.uinteger(hc.startCharacter))&&(Is.undefined(hc.endCharacter)||Is.uinteger(hc.endCharacter))&&(Is.undefined(hc.kind)||Is.string(hc.kind))}vo.is=bo})(FoldingRange||(FoldingRange={}));var DiagnosticRelatedInformation;(function(vo){function Ai(Ra,hc){return{location:Ra,message:hc}}vo.create=Ai;function bo(Ra){let hc=Ra;return Is.defined(hc)&&Location.is(hc.location)&&Is.string(hc.message)}vo.is=bo})(DiagnosticRelatedInformation||(DiagnosticRelatedInformation={}));var DiagnosticSeverity;(function(vo){vo.Error=1,vo.Warning=2,vo.Information=3,vo.Hint=4})(DiagnosticSeverity||(DiagnosticSeverity={}));var DiagnosticTag;(function(vo){vo.Unnecessary=1,vo.Deprecated=2})(DiagnosticTag||(DiagnosticTag={}));var CodeDescription;(function(vo){function Ai(bo){const Ra=bo;return Is.objectLiteral(Ra)&&Is.string(Ra.href)}vo.is=Ai})(CodeDescription||(CodeDescription={}));var Diagnostic;(function(vo){function Ai(Ra,hc,pc,mc,uf,df){let ff={range:Ra,message:hc};return Is.defined(pc)&&(ff.severity=pc),Is.defined(mc)&&(ff.code=mc),Is.defined(uf)&&(ff.source=uf),Is.defined(df)&&(ff.relatedInformation=df),ff}vo.create=Ai;function bo(Ra){var hc;let pc=Ra;return Is.defined(pc)&&Range$1.is(pc.range)&&Is.string(pc.message)&&(Is.number(pc.severity)||Is.undefined(pc.severity))&&(Is.integer(pc.code)||Is.string(pc.code)||Is.undefined(pc.code))&&(Is.undefined(pc.codeDescription)||Is.string((hc=pc.codeDescription)===null||hc===void 0?void 0:hc.href))&&(Is.string(pc.source)||Is.undefined(pc.source))&&(Is.undefined(pc.relatedInformation)||Is.typedArray(pc.relatedInformation,DiagnosticRelatedInformation.is))}vo.is=bo})(Diagnostic||(Diagnostic={}));var Command;(function(vo){function Ai(Ra,hc,...pc){let mc={title:Ra,command:hc};return Is.defined(pc)&&pc.length>0&&(mc.arguments=pc),mc}vo.create=Ai;function bo(Ra){let hc=Ra;return Is.defined(hc)&&Is.string(hc.title)&&Is.string(hc.command)}vo.is=bo})(Command||(Command={}));var TextEdit;(function(vo){function Ai(pc,mc){return{range:pc,newText:mc}}vo.replace=Ai;function bo(pc,mc){return{range:{start:pc,end:pc},newText:mc}}vo.insert=bo;function Ra(pc){return{range:pc,newText:""}}vo.del=Ra;function hc(pc){const mc=pc;return Is.objectLiteral(mc)&&Is.string(mc.newText)&&Range$1.is(mc.range)}vo.is=hc})(TextEdit||(TextEdit={}));var ChangeAnnotation;(function(vo){function Ai(Ra,hc,pc){const mc={label:Ra};return hc!==void 0&&(mc.needsConfirmation=hc),pc!==void 0&&(mc.description=pc),mc}vo.create=Ai;function bo(Ra){const hc=Ra;return Is.objectLiteral(hc)&&Is.string(hc.label)&&(Is.boolean(hc.needsConfirmation)||hc.needsConfirmation===void 0)&&(Is.string(hc.description)||hc.description===void 0)}vo.is=bo})(ChangeAnnotation||(ChangeAnnotation={}));var ChangeAnnotationIdentifier;(function(vo){function Ai(bo){const Ra=bo;return Is.string(Ra)}vo.is=Ai})(ChangeAnnotationIdentifier||(ChangeAnnotationIdentifier={}));var AnnotatedTextEdit;(function(vo){function Ai(pc,mc,uf){return{range:pc,newText:mc,annotationId:uf}}vo.replace=Ai;function bo(pc,mc,uf){return{range:{start:pc,end:pc},newText:mc,annotationId:uf}}vo.insert=bo;function Ra(pc,mc){return{range:pc,newText:"",annotationId:mc}}vo.del=Ra;function hc(pc){const mc=pc;return TextEdit.is(mc)&&(ChangeAnnotation.is(mc.annotationId)||ChangeAnnotationIdentifier.is(mc.annotationId))}vo.is=hc})(AnnotatedTextEdit||(AnnotatedTextEdit={}));var TextDocumentEdit;(function(vo){function Ai(Ra,hc){return{textDocument:Ra,edits:hc}}vo.create=Ai;function bo(Ra){let hc=Ra;return Is.defined(hc)&&OptionalVersionedTextDocumentIdentifier.is(hc.textDocument)&&Array.isArray(hc.edits)}vo.is=bo})(TextDocumentEdit||(TextDocumentEdit={}));var CreateFile;(function(vo){function Ai(Ra,hc,pc){let mc={kind:"create",uri:Ra};return hc!==void 0&&(hc.overwrite!==void 0||hc.ignoreIfExists!==void 0)&&(mc.options=hc),pc!==void 0&&(mc.annotationId=pc),mc}vo.create=Ai;function bo(Ra){let hc=Ra;return hc&&hc.kind==="create"&&Is.string(hc.uri)&&(hc.options===void 0||(hc.options.overwrite===void 0||Is.boolean(hc.options.overwrite))&&(hc.options.ignoreIfExists===void 0||Is.boolean(hc.options.ignoreIfExists)))&&(hc.annotationId===void 0||ChangeAnnotationIdentifier.is(hc.annotationId))}vo.is=bo})(CreateFile||(CreateFile={}));var RenameFile;(function(vo){function Ai(Ra,hc,pc,mc){let uf={kind:"rename",oldUri:Ra,newUri:hc};return pc!==void 0&&(pc.overwrite!==void 0||pc.ignoreIfExists!==void 0)&&(uf.options=pc),mc!==void 0&&(uf.annotationId=mc),uf}vo.create=Ai;function bo(Ra){let hc=Ra;return hc&&hc.kind==="rename"&&Is.string(hc.oldUri)&&Is.string(hc.newUri)&&(hc.options===void 0||(hc.options.overwrite===void 0||Is.boolean(hc.options.overwrite))&&(hc.options.ignoreIfExists===void 0||Is.boolean(hc.options.ignoreIfExists)))&&(hc.annotationId===void 0||ChangeAnnotationIdentifier.is(hc.annotationId))}vo.is=bo})(RenameFile||(RenameFile={}));var DeleteFile;(function(vo){function Ai(Ra,hc,pc){let mc={kind:"delete",uri:Ra};return hc!==void 0&&(hc.recursive!==void 0||hc.ignoreIfNotExists!==void 0)&&(mc.options=hc),pc!==void 0&&(mc.annotationId=pc),mc}vo.create=Ai;function bo(Ra){let hc=Ra;return hc&&hc.kind==="delete"&&Is.string(hc.uri)&&(hc.options===void 0||(hc.options.recursive===void 0||Is.boolean(hc.options.recursive))&&(hc.options.ignoreIfNotExists===void 0||Is.boolean(hc.options.ignoreIfNotExists)))&&(hc.annotationId===void 0||ChangeAnnotationIdentifier.is(hc.annotationId))}vo.is=bo})(DeleteFile||(DeleteFile={}));var WorkspaceEdit;(function(vo){function Ai(bo){let Ra=bo;return Ra&&(Ra.changes!==void 0||Ra.documentChanges!==void 0)&&(Ra.documentChanges===void 0||Ra.documentChanges.every(hc=>Is.string(hc.kind)?CreateFile.is(hc)||RenameFile.is(hc)||DeleteFile.is(hc):TextDocumentEdit.is(hc)))}vo.is=Ai})(WorkspaceEdit||(WorkspaceEdit={}));var TextDocumentIdentifier;(function(vo){function Ai(Ra){return{uri:Ra}}vo.create=Ai;function bo(Ra){let hc=Ra;return Is.defined(hc)&&Is.string(hc.uri)}vo.is=bo})(TextDocumentIdentifier||(TextDocumentIdentifier={}));var VersionedTextDocumentIdentifier;(function(vo){function Ai(Ra,hc){return{uri:Ra,version:hc}}vo.create=Ai;function bo(Ra){let hc=Ra;return Is.defined(hc)&&Is.string(hc.uri)&&Is.integer(hc.version)}vo.is=bo})(VersionedTextDocumentIdentifier||(VersionedTextDocumentIdentifier={}));var OptionalVersionedTextDocumentIdentifier;(function(vo){function Ai(Ra,hc){return{uri:Ra,version:hc}}vo.create=Ai;function bo(Ra){let hc=Ra;return Is.defined(hc)&&Is.string(hc.uri)&&(hc.version===null||Is.integer(hc.version))}vo.is=bo})(OptionalVersionedTextDocumentIdentifier||(OptionalVersionedTextDocumentIdentifier={}));var TextDocumentItem;(function(vo){function Ai(Ra,hc,pc,mc){return{uri:Ra,languageId:hc,version:pc,text:mc}}vo.create=Ai;function bo(Ra){let hc=Ra;return Is.defined(hc)&&Is.string(hc.uri)&&Is.string(hc.languageId)&&Is.integer(hc.version)&&Is.string(hc.text)}vo.is=bo})(TextDocumentItem||(TextDocumentItem={}));var MarkupKind;(function(vo){vo.PlainText="plaintext",vo.Markdown="markdown";function Ai(bo){const Ra=bo;return Ra===vo.PlainText||Ra===vo.Markdown}vo.is=Ai})(MarkupKind||(MarkupKind={}));var MarkupContent;(function(vo){function Ai(bo){const Ra=bo;return Is.objectLiteral(bo)&&MarkupKind.is(Ra.kind)&&Is.string(Ra.value)}vo.is=Ai})(MarkupContent||(MarkupContent={}));var CompletionItemKind$1;(function(vo){vo.Text=1,vo.Method=2,vo.Function=3,vo.Constructor=4,vo.Field=5,vo.Variable=6,vo.Class=7,vo.Interface=8,vo.Module=9,vo.Property=10,vo.Unit=11,vo.Value=12,vo.Enum=13,vo.Keyword=14,vo.Snippet=15,vo.Color=16,vo.File=17,vo.Reference=18,vo.Folder=19,vo.EnumMember=20,vo.Constant=21,vo.Struct=22,vo.Event=23,vo.Operator=24,vo.TypeParameter=25})(CompletionItemKind$1||(CompletionItemKind$1={}));var InsertTextFormat;(function(vo){vo.PlainText=1,vo.Snippet=2})(InsertTextFormat||(InsertTextFormat={}));var CompletionItemTag;(function(vo){vo.Deprecated=1})(CompletionItemTag||(CompletionItemTag={}));var InsertReplaceEdit;(function(vo){function Ai(Ra,hc,pc){return{newText:Ra,insert:hc,replace:pc}}vo.create=Ai;function bo(Ra){const hc=Ra;return hc&&Is.string(hc.newText)&&Range$1.is(hc.insert)&&Range$1.is(hc.replace)}vo.is=bo})(InsertReplaceEdit||(InsertReplaceEdit={}));var InsertTextMode;(function(vo){vo.asIs=1,vo.adjustIndentation=2})(InsertTextMode||(InsertTextMode={}));var CompletionItemLabelDetails;(function(vo){function Ai(bo){const Ra=bo;return Ra&&(Is.string(Ra.detail)||Ra.detail===void 0)&&(Is.string(Ra.description)||Ra.description===void 0)}vo.is=Ai})(CompletionItemLabelDetails||(CompletionItemLabelDetails={}));var CompletionItem;(function(vo){function Ai(bo){return{label:bo}}vo.create=Ai})(CompletionItem||(CompletionItem={}));var CompletionList;(function(vo){function Ai(bo,Ra){return{items:bo||[],isIncomplete:!!Ra}}vo.create=Ai})(CompletionList||(CompletionList={}));var MarkedString;(function(vo){function Ai(Ra){return Ra.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}vo.fromPlainText=Ai;function bo(Ra){const hc=Ra;return Is.string(hc)||Is.objectLiteral(hc)&&Is.string(hc.language)&&Is.string(hc.value)}vo.is=bo})(MarkedString||(MarkedString={}));var Hover;(function(vo){function Ai(bo){let Ra=bo;return!!Ra&&Is.objectLiteral(Ra)&&(MarkupContent.is(Ra.contents)||MarkedString.is(Ra.contents)||Is.typedArray(Ra.contents,MarkedString.is))&&(bo.range===void 0||Range$1.is(bo.range))}vo.is=Ai})(Hover||(Hover={}));var ParameterInformation;(function(vo){function Ai(bo,Ra){return Ra?{label:bo,documentation:Ra}:{label:bo}}vo.create=Ai})(ParameterInformation||(ParameterInformation={}));var SignatureInformation;(function(vo){function Ai(bo,Ra,...hc){let pc={label:bo};return Is.defined(Ra)&&(pc.documentation=Ra),Is.defined(hc)?pc.parameters=hc:pc.parameters=[],pc}vo.create=Ai})(SignatureInformation||(SignatureInformation={}));var DocumentHighlightKind;(function(vo){vo.Text=1,vo.Read=2,vo.Write=3})(DocumentHighlightKind||(DocumentHighlightKind={}));var DocumentHighlight;(function(vo){function Ai(bo,Ra){let hc={range:bo};return Is.number(Ra)&&(hc.kind=Ra),hc}vo.create=Ai})(DocumentHighlight||(DocumentHighlight={}));var SymbolKind;(function(vo){vo.File=1,vo.Module=2,vo.Namespace=3,vo.Package=4,vo.Class=5,vo.Method=6,vo.Property=7,vo.Field=8,vo.Constructor=9,vo.Enum=10,vo.Interface=11,vo.Function=12,vo.Variable=13,vo.Constant=14,vo.String=15,vo.Number=16,vo.Boolean=17,vo.Array=18,vo.Object=19,vo.Key=20,vo.Null=21,vo.EnumMember=22,vo.Struct=23,vo.Event=24,vo.Operator=25,vo.TypeParameter=26})(SymbolKind||(SymbolKind={}));var SymbolTag;(function(vo){vo.Deprecated=1})(SymbolTag||(SymbolTag={}));var SymbolInformation;(function(vo){function Ai(bo,Ra,hc,pc,mc){let uf={name:bo,kind:Ra,location:{uri:pc,range:hc}};return mc&&(uf.containerName=mc),uf}vo.create=Ai})(SymbolInformation||(SymbolInformation={}));var WorkspaceSymbol;(function(vo){function Ai(bo,Ra,hc,pc){return pc!==void 0?{name:bo,kind:Ra,location:{uri:hc,range:pc}}:{name:bo,kind:Ra,location:{uri:hc}}}vo.create=Ai})(WorkspaceSymbol||(WorkspaceSymbol={}));var DocumentSymbol;(function(vo){function Ai(Ra,hc,pc,mc,uf,df){let ff={name:Ra,detail:hc,kind:pc,range:mc,selectionRange:uf};return df!==void 0&&(ff.children=df),ff}vo.create=Ai;function bo(Ra){let hc=Ra;return hc&&Is.string(hc.name)&&Is.number(hc.kind)&&Range$1.is(hc.range)&&Range$1.is(hc.selectionRange)&&(hc.detail===void 0||Is.string(hc.detail))&&(hc.deprecated===void 0||Is.boolean(hc.deprecated))&&(hc.children===void 0||Array.isArray(hc.children))&&(hc.tags===void 0||Array.isArray(hc.tags))}vo.is=bo})(DocumentSymbol||(DocumentSymbol={}));var CodeActionKind;(function(vo){vo.Empty="",vo.QuickFix="quickfix",vo.Refactor="refactor",vo.RefactorExtract="refactor.extract",vo.RefactorInline="refactor.inline",vo.RefactorRewrite="refactor.rewrite",vo.Source="source",vo.SourceOrganizeImports="source.organizeImports",vo.SourceFixAll="source.fixAll"})(CodeActionKind||(CodeActionKind={}));var CodeActionTriggerKind;(function(vo){vo.Invoked=1,vo.Automatic=2})(CodeActionTriggerKind||(CodeActionTriggerKind={}));var CodeActionContext;(function(vo){function Ai(Ra,hc,pc){let mc={diagnostics:Ra};return hc!=null&&(mc.only=hc),pc!=null&&(mc.triggerKind=pc),mc}vo.create=Ai;function bo(Ra){let hc=Ra;return Is.defined(hc)&&Is.typedArray(hc.diagnostics,Diagnostic.is)&&(hc.only===void 0||Is.typedArray(hc.only,Is.string))&&(hc.triggerKind===void 0||hc.triggerKind===CodeActionTriggerKind.Invoked||hc.triggerKind===CodeActionTriggerKind.Automatic)}vo.is=bo})(CodeActionContext||(CodeActionContext={}));var CodeAction;(function(vo){function Ai(Ra,hc,pc){let mc={title:Ra},uf=!0;return typeof hc=="string"?(uf=!1,mc.kind=hc):Command.is(hc)?mc.command=hc:mc.edit=hc,uf&&pc!==void 0&&(mc.kind=pc),mc}vo.create=Ai;function bo(Ra){let hc=Ra;return hc&&Is.string(hc.title)&&(hc.diagnostics===void 0||Is.typedArray(hc.diagnostics,Diagnostic.is))&&(hc.kind===void 0||Is.string(hc.kind))&&(hc.edit!==void 0||hc.command!==void 0)&&(hc.command===void 0||Command.is(hc.command))&&(hc.isPreferred===void 0||Is.boolean(hc.isPreferred))&&(hc.edit===void 0||WorkspaceEdit.is(hc.edit))}vo.is=bo})(CodeAction||(CodeAction={}));var CodeLens;(function(vo){function Ai(Ra,hc){let pc={range:Ra};return Is.defined(hc)&&(pc.data=hc),pc}vo.create=Ai;function bo(Ra){let hc=Ra;return Is.defined(hc)&&Range$1.is(hc.range)&&(Is.undefined(hc.command)||Command.is(hc.command))}vo.is=bo})(CodeLens||(CodeLens={}));var FormattingOptions;(function(vo){function Ai(Ra,hc){return{tabSize:Ra,insertSpaces:hc}}vo.create=Ai;function bo(Ra){let hc=Ra;return Is.defined(hc)&&Is.uinteger(hc.tabSize)&&Is.boolean(hc.insertSpaces)}vo.is=bo})(FormattingOptions||(FormattingOptions={}));var DocumentLink;(function(vo){function Ai(Ra,hc,pc){return{range:Ra,target:hc,data:pc}}vo.create=Ai;function bo(Ra){let hc=Ra;return Is.defined(hc)&&Range$1.is(hc.range)&&(Is.undefined(hc.target)||Is.string(hc.target))}vo.is=bo})(DocumentLink||(DocumentLink={}));var SelectionRange;(function(vo){function Ai(Ra,hc){return{range:Ra,parent:hc}}vo.create=Ai;function bo(Ra){let hc=Ra;return Is.objectLiteral(hc)&&Range$1.is(hc.range)&&(hc.parent===void 0||vo.is(hc.parent))}vo.is=bo})(SelectionRange||(SelectionRange={}));var SemanticTokenTypes;(function(vo){vo.namespace="namespace",vo.type="type",vo.class="class",vo.enum="enum",vo.interface="interface",vo.struct="struct",vo.typeParameter="typeParameter",vo.parameter="parameter",vo.variable="variable",vo.property="property",vo.enumMember="enumMember",vo.event="event",vo.function="function",vo.method="method",vo.macro="macro",vo.keyword="keyword",vo.modifier="modifier",vo.comment="comment",vo.string="string",vo.number="number",vo.regexp="regexp",vo.operator="operator",vo.decorator="decorator"})(SemanticTokenTypes||(SemanticTokenTypes={}));var SemanticTokenModifiers;(function(vo){vo.declaration="declaration",vo.definition="definition",vo.readonly="readonly",vo.static="static",vo.deprecated="deprecated",vo.abstract="abstract",vo.async="async",vo.modification="modification",vo.documentation="documentation",vo.defaultLibrary="defaultLibrary"})(SemanticTokenModifiers||(SemanticTokenModifiers={}));var SemanticTokens;(function(vo){function Ai(bo){const Ra=bo;return Is.objectLiteral(Ra)&&(Ra.resultId===void 0||typeof Ra.resultId=="string")&&Array.isArray(Ra.data)&&(Ra.data.length===0||typeof Ra.data[0]=="number")}vo.is=Ai})(SemanticTokens||(SemanticTokens={}));var InlineValueText;(function(vo){function Ai(Ra,hc){return{range:Ra,text:hc}}vo.create=Ai;function bo(Ra){const hc=Ra;return hc!=null&&Range$1.is(hc.range)&&Is.string(hc.text)}vo.is=bo})(InlineValueText||(InlineValueText={}));var InlineValueVariableLookup;(function(vo){function Ai(Ra,hc,pc){return{range:Ra,variableName:hc,caseSensitiveLookup:pc}}vo.create=Ai;function bo(Ra){const hc=Ra;return hc!=null&&Range$1.is(hc.range)&&Is.boolean(hc.caseSensitiveLookup)&&(Is.string(hc.variableName)||hc.variableName===void 0)}vo.is=bo})(InlineValueVariableLookup||(InlineValueVariableLookup={}));var InlineValueEvaluatableExpression;(function(vo){function Ai(Ra,hc){return{range:Ra,expression:hc}}vo.create=Ai;function bo(Ra){const hc=Ra;return hc!=null&&Range$1.is(hc.range)&&(Is.string(hc.expression)||hc.expression===void 0)}vo.is=bo})(InlineValueEvaluatableExpression||(InlineValueEvaluatableExpression={}));var InlineValueContext;(function(vo){function Ai(Ra,hc){return{frameId:Ra,stoppedLocation:hc}}vo.create=Ai;function bo(Ra){const hc=Ra;return Is.defined(hc)&&Range$1.is(Ra.stoppedLocation)}vo.is=bo})(InlineValueContext||(InlineValueContext={}));var InlayHintKind;(function(vo){vo.Type=1,vo.Parameter=2;function Ai(bo){return bo===1||bo===2}vo.is=Ai})(InlayHintKind||(InlayHintKind={}));var InlayHintLabelPart;(function(vo){function Ai(Ra){return{value:Ra}}vo.create=Ai;function bo(Ra){const hc=Ra;return Is.objectLiteral(hc)&&(hc.tooltip===void 0||Is.string(hc.tooltip)||MarkupContent.is(hc.tooltip))&&(hc.location===void 0||Location.is(hc.location))&&(hc.command===void 0||Command.is(hc.command))}vo.is=bo})(InlayHintLabelPart||(InlayHintLabelPart={}));var InlayHint;(function(vo){function Ai(Ra,hc,pc){const mc={position:Ra,label:hc};return pc!==void 0&&(mc.kind=pc),mc}vo.create=Ai;function bo(Ra){const hc=Ra;return Is.objectLiteral(hc)&&Position$2.is(hc.position)&&(Is.string(hc.label)||Is.typedArray(hc.label,InlayHintLabelPart.is))&&(hc.kind===void 0||InlayHintKind.is(hc.kind))&&hc.textEdits===void 0||Is.typedArray(hc.textEdits,TextEdit.is)&&(hc.tooltip===void 0||Is.string(hc.tooltip)||MarkupContent.is(hc.tooltip))&&(hc.paddingLeft===void 0||Is.boolean(hc.paddingLeft))&&(hc.paddingRight===void 0||Is.boolean(hc.paddingRight))}vo.is=bo})(InlayHint||(InlayHint={}));var StringValue;(function(vo){function Ai(bo){return{kind:"snippet",value:bo}}vo.createSnippet=Ai})(StringValue||(StringValue={}));var InlineCompletionItem;(function(vo){function Ai(bo,Ra,hc,pc){return{insertText:bo,filterText:Ra,range:hc,command:pc}}vo.create=Ai})(InlineCompletionItem||(InlineCompletionItem={}));var InlineCompletionList;(function(vo){function Ai(bo){return{items:bo}}vo.create=Ai})(InlineCompletionList||(InlineCompletionList={}));var InlineCompletionTriggerKind;(function(vo){vo.Invoked=0,vo.Automatic=1})(InlineCompletionTriggerKind||(InlineCompletionTriggerKind={}));var SelectedCompletionInfo;(function(vo){function Ai(bo,Ra){return{range:bo,text:Ra}}vo.create=Ai})(SelectedCompletionInfo||(SelectedCompletionInfo={}));var InlineCompletionContext;(function(vo){function Ai(bo,Ra){return{triggerKind:bo,selectedCompletionInfo:Ra}}vo.create=Ai})(InlineCompletionContext||(InlineCompletionContext={}));var WorkspaceFolder;(function(vo){function Ai(bo){const Ra=bo;return Is.objectLiteral(Ra)&&URI.is(Ra.uri)&&Is.string(Ra.name)}vo.is=Ai})(WorkspaceFolder||(WorkspaceFolder={}));var TextDocument;(function(vo){function Ai(pc,mc,uf,df){return new FullTextDocument(pc,mc,uf,df)}vo.create=Ai;function bo(pc){let mc=pc;return!!(Is.defined(mc)&&Is.string(mc.uri)&&(Is.undefined(mc.languageId)||Is.string(mc.languageId))&&Is.uinteger(mc.lineCount)&&Is.func(mc.getText)&&Is.func(mc.positionAt)&&Is.func(mc.offsetAt))}vo.is=bo;function Ra(pc,mc){let uf=pc.getText(),df=hc(mc,(hf,pf)=>{let mf=hf.range.start.line-pf.range.start.line;return mf===0?hf.range.start.character-pf.range.start.character:mf}),ff=uf.length;for(let hf=df.length-1;hf>=0;hf--){let pf=df[hf],mf=pc.offsetAt(pf.range.start),gf=pc.offsetAt(pf.range.end);if(gf<=ff)uf=uf.substring(0,mf)+pf.newText+uf.substring(gf,uf.length);else throw new Error("Overlapping edit");ff=mf}return uf}vo.applyEdits=Ra;function hc(pc,mc){if(pc.length<=1)return pc;const uf=pc.length/2|0,df=pc.slice(0,uf),ff=pc.slice(uf);hc(df,mc),hc(ff,mc);let hf=0,pf=0,mf=0;for(;hf<df.length&&pf<ff.length;)mc(df[hf],ff[pf])<=0?pc[mf++]=df[hf++]:pc[mf++]=ff[pf++];for(;hf<df.length;)pc[mf++]=df[hf++];for(;pf<ff.length;)pc[mf++]=ff[pf++];return pc}})(TextDocument||(TextDocument={}));class FullTextDocument{constructor(Ai,bo,Ra,hc){this._uri=Ai,this._languageId=bo,this._version=Ra,this._content=hc,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(Ai){if(Ai){let bo=this.offsetAt(Ai.start),Ra=this.offsetAt(Ai.end);return this._content.substring(bo,Ra)}return this._content}update(Ai,bo){this._content=Ai.text,this._version=bo,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let Ai=[],bo=this._content,Ra=!0;for(let hc=0;hc<bo.length;hc++){Ra&&(Ai.push(hc),Ra=!1);let pc=bo.charAt(hc);Ra=pc==="\r"||pc===`
|
|
360
|
-
`,pc==="\r"&&hc+1<bo.length&&bo.charAt(hc+1)===`
|
|
361
|
-
`&&hc++}Ra&&bo.length>0&&Ai.push(bo.length),this._lineOffsets=Ai}return this._lineOffsets}positionAt(Ai){Ai=Math.max(Math.min(Ai,this._content.length),0);let bo=this.getLineOffsets(),Ra=0,hc=bo.length;if(hc===0)return Position$2.create(0,Ai);for(;Ra<hc;){let mc=Math.floor((Ra+hc)/2);bo[mc]>Ai?hc=mc:Ra=mc+1}let pc=Ra-1;return Position$2.create(pc,Ai-bo[pc])}offsetAt(Ai){let bo=this.getLineOffsets();if(Ai.line>=bo.length)return this._content.length;if(Ai.line<0)return 0;let Ra=bo[Ai.line],hc=Ai.line+1<bo.length?bo[Ai.line+1]:this._content.length;return Math.max(Math.min(Ra+Ai.character,hc),Ra)}get lineCount(){return this.getLineOffsets().length}}var Is;(function(vo){const Ai=Object.prototype.toString;function bo(gf){return typeof gf<"u"}vo.defined=bo;function Ra(gf){return typeof gf>"u"}vo.undefined=Ra;function hc(gf){return gf===!0||gf===!1}vo.boolean=hc;function pc(gf){return Ai.call(gf)==="[object String]"}vo.string=pc;function mc(gf){return Ai.call(gf)==="[object Number]"}vo.number=mc;function uf(gf,yf,vf){return Ai.call(gf)==="[object Number]"&&yf<=gf&&gf<=vf}vo.numberRange=uf;function df(gf){return Ai.call(gf)==="[object Number]"&&-2147483648<=gf&&gf<=2147483647}vo.integer=df;function ff(gf){return Ai.call(gf)==="[object Number]"&&0<=gf&&gf<=2147483647}vo.uinteger=ff;function hf(gf){return Ai.call(gf)==="[object Function]"}vo.func=hf;function pf(gf){return gf!==null&&typeof gf=="object"}vo.objectLiteral=pf;function mf(gf,yf){return Array.isArray(gf)&&gf.every(yf)}vo.typedArray=mf})(Is||(Is={}));class CharacterStream{constructor(Ai){this._start=0,this._pos=0,this.getStartOfToken=()=>this._start,this.getCurrentPosition=()=>this._pos,this.eol=()=>this._sourceText.length===this._pos,this.sol=()=>this._pos===0,this.peek=()=>this._sourceText.charAt(this._pos)||null,this.next=()=>{const bo=this._sourceText.charAt(this._pos);return this._pos++,bo},this.eat=bo=>{if(this._testNextCharacter(bo))return this._start=this._pos,this._pos++,this._sourceText.charAt(this._pos-1)},this.eatWhile=bo=>{let Ra=this._testNextCharacter(bo),hc=!1;for(Ra&&(hc=Ra,this._start=this._pos);Ra;)this._pos++,Ra=this._testNextCharacter(bo),hc=!0;return hc},this.eatSpace=()=>this.eatWhile(/[\s\u00a0]/),this.skipToEnd=()=>{this._pos=this._sourceText.length},this.skipTo=bo=>{this._pos=bo},this.match=(bo,Ra=!0,hc=!1)=>{let pc=null,mc=null;return typeof bo=="string"?(mc=new RegExp(bo,hc?"i":"g").test(this._sourceText.slice(this._pos,this._pos+bo.length)),pc=bo):bo instanceof RegExp&&(mc=this._sourceText.slice(this._pos).match(bo),pc=mc==null?void 0:mc[0]),mc!=null&&(typeof bo=="string"||mc instanceof Array&&this._sourceText.startsWith(mc[0],this._pos))?(Ra&&(this._start=this._pos,pc&&pc.length&&(this._pos+=pc.length)),mc):!1},this.backUp=bo=>{this._pos-=bo},this.column=()=>this._pos,this.indentation=()=>{const bo=this._sourceText.match(/\s*/);let Ra=0;if(bo&&bo.length!==0){const hc=bo[0];let pc=0;for(;hc.length>pc;)hc.charCodeAt(pc)===9?Ra+=2:Ra++,pc++}return Ra},this.current=()=>this._sourceText.slice(this._start,this._pos),this._sourceText=Ai}_testNextCharacter(Ai){const bo=this._sourceText.charAt(this._pos);let Ra=!1;return typeof Ai=="string"?Ra=bo===Ai:Ra=Ai instanceof RegExp?Ai.test(bo):Ai(bo),Ra}}function opt(vo){return{ofRule:vo}}function list(vo,Ai){return{ofRule:vo,isList:!0,separator:Ai}}function butNot(vo,Ai){const bo=vo.match;return vo.match=Ra=>{let hc=!1;return bo&&(hc=bo(Ra)),hc&&Ai.every(pc=>pc.match&&!pc.match(Ra))},vo}function t(vo,Ai){return{style:Ai,match:bo=>bo.kind===vo}}function p$3(vo,Ai){return{style:Ai||"punctuation",match:bo=>bo.kind==="Punctuation"&&bo.value===vo}}const isIgnored=vo=>vo===" "||vo===" "||vo===","||vo===`
|
|
362
|
-
`||vo==="\r"||vo==="\uFEFF"||vo===" ",LexRules={Name:/^[_A-Za-z][_0-9A-Za-z]*/,Punctuation:/^(?:!|\$|\(|\)|\.\.\.|:|=|&|@|\[|]|\{|\||\})/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^(?:"""(?:\\"""|[^"]|"[^"]|""[^"])*(?:""")?|"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?)/,Comment:/^#.*/},ParseRules={Document:[list("Definition")],Definition(vo){switch(vo.value){case"{":return"ShortQuery";case"query":return"Query";case"mutation":return"Mutation";case"subscription":return"Subscription";case"fragment":return Kind.FRAGMENT_DEFINITION;case"schema":return"SchemaDef";case"scalar":return"ScalarDef";case"type":return"ObjectTypeDef";case"interface":return"InterfaceDef";case"union":return"UnionDef";case"enum":return"EnumDef";case"input":return"InputDef";case"extend":return"ExtendDef";case"directive":return"DirectiveDef"}},ShortQuery:["SelectionSet"],Query:[word("query"),opt(name("def")),opt("VariableDefinitions"),list("Directive"),"SelectionSet"],Mutation:[word("mutation"),opt(name("def")),opt("VariableDefinitions"),list("Directive"),"SelectionSet"],Subscription:[word("subscription"),opt(name("def")),opt("VariableDefinitions"),list("Directive"),"SelectionSet"],VariableDefinitions:[p$3("("),list("VariableDefinition"),p$3(")")],VariableDefinition:["Variable",p$3(":"),"Type",opt("DefaultValue")],Variable:[p$3("$","variable"),name("variable")],DefaultValue:[p$3("="),"Value"],SelectionSet:[p$3("{"),list("Selection"),p$3("}")],Selection(vo,Ai){return vo.value==="..."?Ai.match(/[\s\u00a0,]*(on\b|@|{)/,!1)?"InlineFragment":"FragmentSpread":Ai.match(/[\s\u00a0,]*:/,!1)?"AliasedField":"Field"},AliasedField:[name("property"),p$3(":"),name("qualifier"),opt("Arguments"),list("Directive"),opt("SelectionSet")],Field:[name("property"),opt("Arguments"),list("Directive"),opt("SelectionSet")],Arguments:[p$3("("),list("Argument"),p$3(")")],Argument:[name("attribute"),p$3(":"),"Value"],FragmentSpread:[p$3("..."),name("def"),list("Directive")],InlineFragment:[p$3("..."),opt("TypeCondition"),list("Directive"),"SelectionSet"],FragmentDefinition:[word("fragment"),opt(butNot(name("def"),[word("on")])),"TypeCondition",list("Directive"),"SelectionSet"],TypeCondition:[word("on"),"NamedType"],Value(vo){switch(vo.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(vo.value){case"[":return"ListValue";case"{":return"ObjectValue";case"$":return"Variable";case"&":return"NamedType"}return null;case"Name":switch(vo.value){case"true":case"false":return"BooleanValue"}return vo.value==="null"?"NullValue":"EnumValue"}},NumberValue:[t("Number","number")],StringValue:[{style:"string",match:vo=>vo.kind==="String",update(vo,Ai){Ai.value.startsWith('"""')&&(vo.inBlockstring=!Ai.value.slice(3).endsWith('"""'))}}],BooleanValue:[t("Name","builtin")],NullValue:[t("Name","keyword")],EnumValue:[name("string-2")],ListValue:[p$3("["),list("Value"),p$3("]")],ObjectValue:[p$3("{"),list("ObjectField"),p$3("}")],ObjectField:[name("attribute"),p$3(":"),"Value"],Type(vo){return vo.value==="["?"ListType":"NonNullType"},ListType:[p$3("["),"Type",p$3("]"),opt(p$3("!"))],NonNullType:["NamedType",opt(p$3("!"))],NamedType:[type("atom")],Directive:[p$3("@","meta"),name("meta"),opt("Arguments")],DirectiveDef:[word("directive"),p$3("@","meta"),name("meta"),opt("ArgumentsDef"),word("on"),list("DirectiveLocation",p$3("|"))],InterfaceDef:[word("interface"),name("atom"),opt("Implements"),list("Directive"),p$3("{"),list("FieldDef"),p$3("}")],Implements:[word("implements"),list("NamedType",p$3("&"))],DirectiveLocation:[name("string-2")],SchemaDef:[word("schema"),list("Directive"),p$3("{"),list("OperationTypeDef"),p$3("}")],OperationTypeDef:[name("keyword"),p$3(":"),name("atom")],ScalarDef:[word("scalar"),name("atom"),list("Directive")],ObjectTypeDef:[word("type"),name("atom"),opt("Implements"),list("Directive"),p$3("{"),list("FieldDef"),p$3("}")],FieldDef:[name("property"),opt("ArgumentsDef"),p$3(":"),"Type",list("Directive")],ArgumentsDef:[p$3("("),list("InputValueDef"),p$3(")")],InputValueDef:[name("attribute"),p$3(":"),"Type",opt("DefaultValue"),list("Directive")],UnionDef:[word("union"),name("atom"),list("Directive"),p$3("="),list("UnionMember",p$3("|"))],UnionMember:["NamedType"],EnumDef:[word("enum"),name("atom"),list("Directive"),p$3("{"),list("EnumValueDef"),p$3("}")],EnumValueDef:[name("string-2"),list("Directive")],InputDef:[word("input"),name("atom"),list("Directive"),p$3("{"),list("InputValueDef"),p$3("}")],ExtendDef:[word("extend"),"ExtensionDefinition"],ExtensionDefinition(vo){switch(vo.value){case"schema":return Kind.SCHEMA_EXTENSION;case"scalar":return Kind.SCALAR_TYPE_EXTENSION;case"type":return Kind.OBJECT_TYPE_EXTENSION;case"interface":return Kind.INTERFACE_TYPE_EXTENSION;case"union":return Kind.UNION_TYPE_EXTENSION;case"enum":return Kind.ENUM_TYPE_EXTENSION;case"input":return Kind.INPUT_OBJECT_TYPE_EXTENSION}},[Kind.SCHEMA_EXTENSION]:["SchemaDef"],[Kind.SCALAR_TYPE_EXTENSION]:["ScalarDef"],[Kind.OBJECT_TYPE_EXTENSION]:["ObjectTypeDef"],[Kind.INTERFACE_TYPE_EXTENSION]:["InterfaceDef"],[Kind.UNION_TYPE_EXTENSION]:["UnionDef"],[Kind.ENUM_TYPE_EXTENSION]:["EnumDef"],[Kind.INPUT_OBJECT_TYPE_EXTENSION]:["InputDef"]};function word(vo){return{style:"keyword",match:Ai=>Ai.kind==="Name"&&Ai.value===vo}}function name(vo){return{style:vo,match:Ai=>Ai.kind==="Name",update(Ai,bo){Ai.name=bo.value}}}function type(vo){return{style:vo,match:Ai=>Ai.kind==="Name",update(Ai,bo){var Ra;!((Ra=Ai.prevState)===null||Ra===void 0)&&Ra.prevState&&(Ai.name=bo.value,Ai.prevState.prevState.type=bo.value)}}}function onlineParser(vo={eatWhitespace:Ai=>Ai.eatWhile(isIgnored),lexRules:LexRules,parseRules:ParseRules,editorConfig:{}}){return{startState(){const Ai={level:0,step:0,name:null,kind:null,type:null,rule:null,needsSeparator:!1,prevState:null};return pushRule(vo.parseRules,Ai,Kind.DOCUMENT),Ai},token(Ai,bo){return getToken(Ai,bo,vo)}}}function getToken(vo,Ai,bo){var Ra;if(Ai.inBlockstring)return vo.match(/.*"""/)?(Ai.inBlockstring=!1,"string"):(vo.skipToEnd(),"string");const{lexRules:hc,parseRules:pc,eatWhitespace:mc,editorConfig:uf}=bo;if(Ai.rule&&Ai.rule.length===0?popRule(Ai):Ai.needsAdvance&&(Ai.needsAdvance=!1,advanceRule(Ai,!0)),vo.sol()){const hf=(uf==null?void 0:uf.tabSize)||2;Ai.indentLevel=Math.floor(vo.indentation()/hf)}if(mc(vo))return"ws";const df=lex(hc,vo);if(!df)return vo.match(/\S+/)||vo.match(/\s/),pushRule(SpecialParseRules,Ai,"Invalid"),"invalidchar";if(df.kind==="Comment")return pushRule(SpecialParseRules,Ai,"Comment"),"comment";const ff=assign({},Ai);if(df.kind==="Punctuation"){if(/^[{([]/.test(df.value))Ai.indentLevel!==void 0&&(Ai.levels=(Ai.levels||[]).concat(Ai.indentLevel+1));else if(/^[})\]]/.test(df.value)){const hf=Ai.levels=(Ai.levels||[]).slice(0,-1);Ai.indentLevel&&hf.length>0&&hf.at(-1)<Ai.indentLevel&&(Ai.indentLevel=hf.at(-1))}}for(;Ai.rule;){let hf=typeof Ai.rule=="function"?Ai.step===0?Ai.rule(df,vo):null:Ai.rule[Ai.step];if(Ai.needsSeparator&&(hf=hf==null?void 0:hf.separator),hf){if(hf.ofRule&&(hf=hf.ofRule),typeof hf=="string"){pushRule(pc,Ai,hf);continue}if(!((Ra=hf.match)===null||Ra===void 0)&&Ra.call(hf,df))return hf.update&&hf.update(Ai,df),df.kind==="Punctuation"?advanceRule(Ai,!0):Ai.needsAdvance=!0,hf.style}unsuccessful(Ai)}return assign(Ai,ff),pushRule(SpecialParseRules,Ai,"Invalid"),"invalidchar"}function assign(vo,Ai){const bo=Object.keys(Ai);for(let Ra=0;Ra<bo.length;Ra++)vo[bo[Ra]]=Ai[bo[Ra]];return vo}const SpecialParseRules={Invalid:[],Comment:[]};function pushRule(vo,Ai,bo){if(!vo[bo])throw new TypeError("Unknown rule: "+bo);Ai.prevState=Object.assign({},Ai),Ai.kind=bo,Ai.name=null,Ai.type=null,Ai.rule=vo[bo],Ai.step=0,Ai.needsSeparator=!1}function popRule(vo){vo.prevState&&(vo.kind=vo.prevState.kind,vo.name=vo.prevState.name,vo.type=vo.prevState.type,vo.rule=vo.prevState.rule,vo.step=vo.prevState.step,vo.needsSeparator=vo.prevState.needsSeparator,vo.prevState=vo.prevState.prevState)}function advanceRule(vo,Ai){var bo;if(isList(vo)&&vo.rule){const Ra=vo.rule[vo.step];if(Ra.separator){const{separator:hc}=Ra;if(vo.needsSeparator=!vo.needsSeparator,!vo.needsSeparator&&hc.ofRule)return}if(Ai)return}for(vo.needsSeparator=!1,vo.step++;vo.rule&&!(Array.isArray(vo.rule)&&vo.step<vo.rule.length);)popRule(vo),vo.rule&&(isList(vo)?!((bo=vo.rule)===null||bo===void 0)&&bo[vo.step].separator&&(vo.needsSeparator=!vo.needsSeparator):(vo.needsSeparator=!1,vo.step++))}function isList(vo){const Ai=Array.isArray(vo.rule)&&typeof vo.rule[vo.step]!="string"&&vo.rule[vo.step];return Ai&&Ai.isList}function unsuccessful(vo){for(;vo.rule&&!(Array.isArray(vo.rule)&&vo.rule[vo.step].ofRule);)popRule(vo);vo.rule&&advanceRule(vo,!1)}function lex(vo,Ai){const bo=Object.keys(vo);for(let Ra=0;Ra<bo.length;Ra++){const hc=Ai.match(vo[bo[Ra]]);if(hc&&hc instanceof Array)return{kind:bo[Ra],value:hc[0]}}}function runOnlineParser(vo,Ai){const bo=vo.split(`
|
|
363
|
-
`),Ra=onlineParser();let hc=Ra.startState(),pc="",mc=new CharacterStream("");for(let uf=0;uf<bo.length;uf++){for(mc=new CharacterStream(bo[uf]);!mc.eol()&&(pc=Ra.token(mc,hc),Ai(mc,hc,pc,uf)!=="BREAK"););Ai(mc,hc,pc,uf),hc.kind||(hc=Ra.startState())}return{start:mc.getStartOfToken(),end:mc.getCurrentPosition(),string:mc.current(),state:hc,style:pc}}var GraphQLDocumentMode;(function(vo){vo.TYPE_SYSTEM="TYPE_SYSTEM",vo.EXECUTABLE="EXECUTABLE",vo.UNKNOWN="UNKNOWN"})(GraphQLDocumentMode||(GraphQLDocumentMode={}));const TYPE_SYSTEM_KINDS=[Kind.SCHEMA_DEFINITION,Kind.OPERATION_TYPE_DEFINITION,Kind.SCALAR_TYPE_DEFINITION,Kind.OBJECT_TYPE_DEFINITION,Kind.INTERFACE_TYPE_DEFINITION,Kind.UNION_TYPE_DEFINITION,Kind.ENUM_TYPE_DEFINITION,Kind.INPUT_OBJECT_TYPE_DEFINITION,Kind.DIRECTIVE_DEFINITION,Kind.SCHEMA_EXTENSION,Kind.SCALAR_TYPE_EXTENSION,Kind.OBJECT_TYPE_EXTENSION,Kind.INTERFACE_TYPE_EXTENSION,Kind.UNION_TYPE_EXTENSION,Kind.ENUM_TYPE_EXTENSION,Kind.INPUT_OBJECT_TYPE_EXTENSION],getParsedMode=vo=>{let Ai=GraphQLDocumentMode.UNKNOWN;if(vo)try{visit(parse(vo),{enter(bo){if(bo.kind==="Document"){Ai=GraphQLDocumentMode.EXECUTABLE;return}return TYPE_SYSTEM_KINDS.includes(bo.kind)?(Ai=GraphQLDocumentMode.TYPE_SYSTEM,BREAK):!1}})}catch{return Ai}return Ai};function getDocumentMode(vo,Ai){return Ai!=null&&Ai.endsWith(".graphqls")?GraphQLDocumentMode.TYPE_SYSTEM:getParsedMode(vo)}function getTokenAtPosition(vo,Ai,bo=0){let Ra=null,hc=null,pc=null;const mc=runOnlineParser(vo,(uf,df,ff,hf)=>{if(!(hf!==Ai.line||uf.getCurrentPosition()+bo<Ai.character+1))return Ra=ff,hc=Object.assign({},df),pc=uf.current(),"BREAK"});return{start:mc.start,end:mc.end,string:pc||mc.string,state:hc||mc.state,style:Ra||mc.style}}function getContextAtPosition(vo,Ai,bo,Ra,hc){const pc=getTokenAtPosition(vo,Ai,1);if(!pc)return null;const mc=pc.state.kind==="Invalid"?pc.state.prevState:pc.state;if(!mc)return null;const uf=getTypeInfo(bo,pc.state),df=(hc==null?void 0:hc.mode)||getDocumentMode(vo,hc==null?void 0:hc.uri);return{token:pc,state:mc,typeInfo:uf,mode:df}}function getFieldDef(vo,Ai,bo){return bo===SchemaMetaFieldDef.name&&vo.getQueryType()===Ai?SchemaMetaFieldDef:bo===TypeMetaFieldDef.name&&vo.getQueryType()===Ai?TypeMetaFieldDef:bo===TypeNameMetaFieldDef.name&&isCompositeType(Ai)?TypeNameMetaFieldDef:"getFields"in Ai?Ai.getFields()[bo]:null}function forEachState(vo,Ai){const bo=[];let Ra=vo;for(;Ra!=null&&Ra.kind;)bo.push(Ra),Ra=Ra.prevState;for(let hc=bo.length-1;hc>=0;hc--)Ai(bo[hc])}function getDefinitionState(vo){let Ai;return forEachState(vo,bo=>{switch(bo.kind){case"Query":case"ShortQuery":case"Mutation":case"Subscription":case"FragmentDefinition":Ai=bo;break}}),Ai}function getTypeInfo(vo,Ai){let bo,Ra,hc,pc,mc,uf,df,ff,hf,pf,mf;return forEachState(Ai,gf=>{var yf;switch(gf.kind){case RuleKinds.QUERY:case"ShortQuery":pf=vo.getQueryType();break;case RuleKinds.MUTATION:pf=vo.getMutationType();break;case RuleKinds.SUBSCRIPTION:pf=vo.getSubscriptionType();break;case RuleKinds.INLINE_FRAGMENT:case RuleKinds.FRAGMENT_DEFINITION:gf.type&&(pf=vo.getType(gf.type));break;case RuleKinds.FIELD:case RuleKinds.ALIASED_FIELD:{!pf||!gf.name?mc=null:(mc=hf?getFieldDef(vo,hf,gf.name):null,pf=mc?mc.type:null);break}case RuleKinds.SELECTION_SET:hf=getNamedType(pf);break;case RuleKinds.DIRECTIVE:hc=gf.name?vo.getDirective(gf.name):null;break;case RuleKinds.INTERFACE_DEF:gf.name&&(df=null,mf=new GraphQLInterfaceType({name:gf.name,interfaces:[],fields:{}}));break;case RuleKinds.OBJECT_TYPE_DEF:gf.name&&(mf=null,df=new GraphQLObjectType({name:gf.name,interfaces:[],fields:{}}));break;case RuleKinds.ARGUMENTS:{if(gf.prevState)switch(gf.prevState.kind){case RuleKinds.FIELD:Ra=mc&&mc.args;break;case RuleKinds.DIRECTIVE:Ra=hc&&hc.args;break;case RuleKinds.ALIASED_FIELD:{const wf=(yf=gf.prevState)===null||yf===void 0?void 0:yf.name;if(!wf){Ra=null;break}const s1=hf?getFieldDef(vo,hf,wf):null;if(!s1){Ra=null;break}Ra=s1.args;break}default:Ra=null;break}else Ra=null;break}case RuleKinds.ARGUMENT:if(Ra){for(let wf=0;wf<Ra.length;wf++)if(Ra[wf].name===gf.name){bo=Ra[wf];break}}uf=bo==null?void 0:bo.type;break;case RuleKinds.VARIABLE_DEFINITION:case RuleKinds.VARIABLE:pf=uf;break;case RuleKinds.ENUM_VALUE:const vf=getNamedType(uf);pc=vf instanceof GraphQLEnumType?vf.getValues().find(wf=>wf.value===gf.name):null;break;case RuleKinds.LIST_VALUE:const bf=getNullableType(uf);uf=bf instanceof GraphQLList?bf.ofType:null;break;case RuleKinds.OBJECT_VALUE:const Sf=getNamedType(uf);ff=Sf instanceof GraphQLInputObjectType?Sf.getFields():null;break;case RuleKinds.OBJECT_FIELD:const xf=gf.name&&ff?ff[gf.name]:null;uf=xf==null?void 0:xf.type,mc=xf,pf=mc?mc.type:null;break;case RuleKinds.NAMED_TYPE:gf.name&&(pf=vo.getType(gf.name));break}}),{argDef:bo,argDefs:Ra,directiveDef:hc,enumValue:pc,fieldDef:mc,inputType:uf,objectFieldDefs:ff,parentType:hf,type:pf,interfaceDef:mf,objectTypeDef:df}}const AdditionalRuleKinds={ALIASED_FIELD:"AliasedField",ARGUMENTS:"Arguments",SHORT_QUERY:"ShortQuery",QUERY:"Query",MUTATION:"Mutation",SUBSCRIPTION:"Subscription",TYPE_CONDITION:"TypeCondition",INVALID:"Invalid",COMMENT:"Comment",SCHEMA_DEF:"SchemaDef",SCALAR_DEF:"ScalarDef",OBJECT_TYPE_DEF:"ObjectTypeDef",OBJECT_VALUE:"ObjectValue",LIST_VALUE:"ListValue",INTERFACE_DEF:"InterfaceDef",UNION_DEF:"UnionDef",ENUM_DEF:"EnumDef",ENUM_VALUE:"EnumValue",FIELD_DEF:"FieldDef",INPUT_DEF:"InputDef",INPUT_VALUE_DEF:"InputValueDef",ARGUMENTS_DEF:"ArgumentsDef",EXTEND_DEF:"ExtendDef",EXTENSION_DEFINITION:"ExtensionDefinition",DIRECTIVE_DEF:"DirectiveDef",IMPLEMENTS:"Implements",VARIABLE_DEFINITIONS:"VariableDefinitions",TYPE:"Type",VARIABLE:"Variable"},RuleKinds=Object.assign(Object.assign({},Kind),AdditionalRuleKinds);var CompletionItemKind;(function(vo){vo.Text=1,vo.Method=2,vo.Function=3,vo.Constructor=4,vo.Field=5,vo.Variable=6,vo.Class=7,vo.Interface=8,vo.Module=9,vo.Property=10,vo.Unit=11,vo.Value=12,vo.Enum=13,vo.Keyword=14,vo.Snippet=15,vo.Color=16,vo.File=17,vo.Reference=18,vo.Folder=19,vo.EnumMember=20,vo.Constant=21,vo.Struct=22,vo.Event=23,vo.Operator=24,vo.TypeParameter=25})(CompletionItemKind||(CompletionItemKind={}));const SuggestionCommand={command:"editor.action.triggerSuggest",title:"Suggestions"},collectFragmentDefs=vo=>[];function getAutocompleteSuggestions(vo,Ai,bo,Ra,hc,pc){var mc;const uf=Object.assign(Object.assign({},pc),{schema:vo}),df=getContextAtPosition(Ai,bo,vo,Ra,pc);if(!df)return[];const{state:ff,typeInfo:hf,mode:pf,token:mf}=df,{kind:gf,step:yf,prevState:vf}=ff;if(gf===RuleKinds.DOCUMENT)return pf===GraphQLDocumentMode.TYPE_SYSTEM?getSuggestionsForTypeSystemDefinitions(mf):pf===GraphQLDocumentMode.EXECUTABLE?getSuggestionsForExecutableDefinitions(mf):getSuggestionsForUnknownDocumentMode(mf);if(gf===RuleKinds.EXTEND_DEF)return getSuggestionsForExtensionDefinitions(mf);if(((mc=vf==null?void 0:vf.prevState)===null||mc===void 0?void 0:mc.kind)===RuleKinds.EXTENSION_DEFINITION&&ff.name)return hintList(mf,[]);if((vf==null?void 0:vf.kind)===Kind.SCALAR_TYPE_EXTENSION)return hintList(mf,Object.values(vo.getTypeMap()).filter(isScalarType).map(Sf=>({label:Sf.name,kind:CompletionItemKind.Function})));if((vf==null?void 0:vf.kind)===Kind.OBJECT_TYPE_EXTENSION)return hintList(mf,Object.values(vo.getTypeMap()).filter(Sf=>isObjectType(Sf)&&!Sf.name.startsWith("__")).map(Sf=>({label:Sf.name,kind:CompletionItemKind.Function})));if((vf==null?void 0:vf.kind)===Kind.INTERFACE_TYPE_EXTENSION)return hintList(mf,Object.values(vo.getTypeMap()).filter(isInterfaceType).map(Sf=>({label:Sf.name,kind:CompletionItemKind.Function})));if((vf==null?void 0:vf.kind)===Kind.UNION_TYPE_EXTENSION)return hintList(mf,Object.values(vo.getTypeMap()).filter(isUnionType).map(Sf=>({label:Sf.name,kind:CompletionItemKind.Function})));if((vf==null?void 0:vf.kind)===Kind.ENUM_TYPE_EXTENSION)return hintList(mf,Object.values(vo.getTypeMap()).filter(Sf=>isEnumType(Sf)&&!Sf.name.startsWith("__")).map(Sf=>({label:Sf.name,kind:CompletionItemKind.Function})));if((vf==null?void 0:vf.kind)===Kind.INPUT_OBJECT_TYPE_EXTENSION)return hintList(mf,Object.values(vo.getTypeMap()).filter(isInputObjectType).map(Sf=>({label:Sf.name,kind:CompletionItemKind.Function})));if(gf===RuleKinds.IMPLEMENTS||gf===RuleKinds.NAMED_TYPE&&(vf==null?void 0:vf.kind)===RuleKinds.IMPLEMENTS)return getSuggestionsForImplements(mf,ff,vo,Ai,hf);if(gf===RuleKinds.SELECTION_SET||gf===RuleKinds.FIELD||gf===RuleKinds.ALIASED_FIELD)return getSuggestionsForFieldNames(mf,hf,uf);if(gf===RuleKinds.ARGUMENTS||gf===RuleKinds.ARGUMENT&&yf===0){const{argDefs:Sf}=hf;if(Sf)return hintList(mf,Sf.map(xf=>{var wf;return{label:xf.name,insertText:getInputInsertText(xf.name+": ",xf.type),insertTextMode:InsertTextMode.adjustIndentation,insertTextFormat:InsertTextFormat.Snippet,command:SuggestionCommand,labelDetails:{detail:" "+String(xf.type)},documentation:(wf=xf.description)!==null&&wf!==void 0?wf:void 0,kind:CompletionItemKind.Variable,type:xf.type}}))}if((gf===RuleKinds.OBJECT_VALUE||gf===RuleKinds.OBJECT_FIELD&&yf===0)&&hf.objectFieldDefs){const Sf=objectValues(hf.objectFieldDefs),xf=gf===RuleKinds.OBJECT_VALUE?CompletionItemKind.Value:CompletionItemKind.Field;return hintList(mf,Sf.map(wf=>{var s1;return{label:wf.name,detail:String(wf.type),documentation:(s1=wf==null?void 0:wf.description)!==null&&s1!==void 0?s1:void 0,kind:xf,type:wf.type,insertText:getInputInsertText(wf.name+": ",wf.type),insertTextMode:InsertTextMode.adjustIndentation,insertTextFormat:InsertTextFormat.Snippet,command:SuggestionCommand}}))}if(gf===RuleKinds.ENUM_VALUE||gf===RuleKinds.LIST_VALUE&&yf===1||gf===RuleKinds.OBJECT_FIELD&&yf===2||gf===RuleKinds.ARGUMENT&&yf===2)return getSuggestionsForInputValues(mf,hf,Ai,vo);if(gf===RuleKinds.VARIABLE&&yf===1){const Sf=getNamedType(hf.inputType),xf=getVariableCompletions(Ai,vo,mf);return hintList(mf,xf.filter(wf=>wf.detail===(Sf==null?void 0:Sf.name)))}if(gf===RuleKinds.TYPE_CONDITION&&yf===1||gf===RuleKinds.NAMED_TYPE&&vf!=null&&vf.kind===RuleKinds.TYPE_CONDITION)return getSuggestionsForFragmentTypeConditions(mf,hf,vo);if(gf===RuleKinds.FRAGMENT_SPREAD&&yf===1)return getSuggestionsForFragmentSpread(mf,hf,vo,Ai,Array.isArray(hc)?hc:collectFragmentDefs());const bf=unwrapType(ff);return bf.kind===RuleKinds.FIELD_DEF?hintList(mf,Object.values(vo.getTypeMap()).filter(Sf=>isOutputType(Sf)&&!Sf.name.startsWith("__")).map(Sf=>({label:Sf.name,kind:CompletionItemKind.Function,insertText:pc!=null&&pc.fillLeafsOnComplete?Sf.name+`
|
|
364
|
-
`:Sf.name,insertTextMode:InsertTextMode.adjustIndentation}))):bf.kind===RuleKinds.INPUT_VALUE_DEF&&yf===2?hintList(mf,Object.values(vo.getTypeMap()).filter(Sf=>isInputType(Sf)&&!Sf.name.startsWith("__")).map(Sf=>({label:Sf.name,kind:CompletionItemKind.Function,insertText:pc!=null&&pc.fillLeafsOnComplete?Sf.name+`
|
|
365
|
-
$1`:Sf.name,insertTextMode:InsertTextMode.adjustIndentation,insertTextFormat:InsertTextFormat.Snippet}))):gf===RuleKinds.VARIABLE_DEFINITION&&yf===2||gf===RuleKinds.LIST_TYPE&&yf===1||gf===RuleKinds.NAMED_TYPE&&vf&&(vf.kind===RuleKinds.VARIABLE_DEFINITION||vf.kind===RuleKinds.LIST_TYPE||vf.kind===RuleKinds.NON_NULL_TYPE)?getSuggestionsForVariableDefinition(mf,vo):gf===RuleKinds.DIRECTIVE?getSuggestionsForDirective(mf,ff,vo):gf===RuleKinds.DIRECTIVE_DEF?getSuggestionsForDirectiveArguments(mf,ff,vo):[]}const typeSystemCompletionItems=[{label:"type",kind:CompletionItemKind.Function},{label:"interface",kind:CompletionItemKind.Function},{label:"union",kind:CompletionItemKind.Function},{label:"input",kind:CompletionItemKind.Function},{label:"scalar",kind:CompletionItemKind.Function},{label:"schema",kind:CompletionItemKind.Function}],executableCompletionItems=[{label:"query",kind:CompletionItemKind.Function},{label:"mutation",kind:CompletionItemKind.Function},{label:"subscription",kind:CompletionItemKind.Function},{label:"fragment",kind:CompletionItemKind.Function},{label:"{",kind:CompletionItemKind.Constructor}];function getSuggestionsForTypeSystemDefinitions(vo){return hintList(vo,[{label:"extend",kind:CompletionItemKind.Function},...typeSystemCompletionItems])}function getSuggestionsForExecutableDefinitions(vo){return hintList(vo,executableCompletionItems)}function getSuggestionsForUnknownDocumentMode(vo){return hintList(vo,[{label:"extend",kind:CompletionItemKind.Function},...executableCompletionItems,...typeSystemCompletionItems])}function getSuggestionsForExtensionDefinitions(vo){return hintList(vo,typeSystemCompletionItems)}function getSuggestionsForFieldNames(vo,Ai,bo){var Ra;if(Ai.parentType){const{parentType:hc}=Ai;let pc=[];return"getFields"in hc&&(pc=objectValues(hc.getFields())),isCompositeType(hc)&&pc.push(TypeNameMetaFieldDef),hc===((Ra=bo==null?void 0:bo.schema)===null||Ra===void 0?void 0:Ra.getQueryType())&&pc.push(SchemaMetaFieldDef,TypeMetaFieldDef),hintList(vo,pc.map((mc,uf)=>{var df;const ff={sortText:String(uf)+mc.name,label:mc.name,detail:String(mc.type),documentation:(df=mc.description)!==null&&df!==void 0?df:void 0,deprecated:!!mc.deprecationReason,isDeprecated:!!mc.deprecationReason,deprecationReason:mc.deprecationReason,kind:CompletionItemKind.Field,labelDetails:{detail:" "+mc.type.toString()},type:mc.type};return bo!=null&&bo.fillLeafsOnComplete&&(ff.insertText=getFieldInsertText(mc),ff.insertText||(ff.insertText=getInsertText(mc.name,mc.type,mc.name+(vo.state.needsAdvance?"":`
|
|
366
|
-
`))),ff.insertText&&(ff.insertTextFormat=InsertTextFormat.Snippet,ff.insertTextMode=InsertTextMode.adjustIndentation,ff.command=SuggestionCommand)),ff}))}return[]}function getSuggestionsForInputValues(vo,Ai,bo,Ra){const hc=getNamedType(Ai.inputType),pc=getVariableCompletions(bo,Ra,vo).filter(mc=>mc.detail===(hc==null?void 0:hc.name));if(hc instanceof GraphQLEnumType){const mc=hc.getValues();return hintList(vo,mc.map(uf=>{var df;return{label:uf.name,detail:String(hc),documentation:(df=uf.description)!==null&&df!==void 0?df:void 0,deprecated:!!uf.deprecationReason,isDeprecated:!!uf.deprecationReason,deprecationReason:uf.deprecationReason,kind:CompletionItemKind.EnumMember,type:hc}}).concat(pc))}return hc===GraphQLBoolean?hintList(vo,pc.concat([{label:"true",detail:String(GraphQLBoolean),documentation:"Not false.",kind:CompletionItemKind.Variable,type:GraphQLBoolean},{label:"false",detail:String(GraphQLBoolean),documentation:"Not true.",kind:CompletionItemKind.Variable,type:GraphQLBoolean}])):pc}function getSuggestionsForImplements(vo,Ai,bo,Ra,hc){if(Ai.needsSeparator)return[];const pc=bo.getTypeMap(),mc=objectValues(pc).filter(isInterfaceType),uf=mc.map(({name:mf})=>mf),df=new Set;runOnlineParser(Ra,(mf,gf)=>{var yf,vf,bf,Sf,xf;if(gf.name&&(gf.kind===RuleKinds.INTERFACE_DEF&&!uf.includes(gf.name)&&df.add(gf.name),gf.kind===RuleKinds.NAMED_TYPE&&((yf=gf.prevState)===null||yf===void 0?void 0:yf.kind)===RuleKinds.IMPLEMENTS)){if(hc.interfaceDef){if(!((vf=hc.interfaceDef)===null||vf===void 0)&&vf.getInterfaces().find(({name:If})=>If===gf.name))return;const wf=bo.getType(gf.name),s1=(bf=hc.interfaceDef)===null||bf===void 0?void 0:bf.toConfig();hc.interfaceDef=new GraphQLInterfaceType(Object.assign(Object.assign({},s1),{interfaces:[...s1.interfaces,wf||new GraphQLInterfaceType({name:gf.name,fields:{}})]}))}else if(hc.objectTypeDef){if(!((Sf=hc.objectTypeDef)===null||Sf===void 0)&&Sf.getInterfaces().find(({name:If})=>If===gf.name))return;const wf=bo.getType(gf.name),s1=(xf=hc.objectTypeDef)===null||xf===void 0?void 0:xf.toConfig();hc.objectTypeDef=new GraphQLObjectType(Object.assign(Object.assign({},s1),{interfaces:[...s1.interfaces,wf||new GraphQLInterfaceType({name:gf.name,fields:{}})]}))}}});const ff=hc.interfaceDef||hc.objectTypeDef,hf=((ff==null?void 0:ff.getInterfaces())||[]).map(({name:mf})=>mf),pf=mc.concat([...df].map(mf=>({name:mf}))).filter(({name:mf})=>mf!==(ff==null?void 0:ff.name)&&!hf.includes(mf));return hintList(vo,pf.map(mf=>{const gf={label:mf.name,kind:CompletionItemKind.Interface,type:mf};return mf!=null&&mf.description&&(gf.documentation=mf.description),gf}))}function getSuggestionsForFragmentTypeConditions(vo,Ai,bo,Ra){let hc;if(Ai.parentType)if(isAbstractType(Ai.parentType)){const pc=assertAbstractType(Ai.parentType),mc=bo.getPossibleTypes(pc),uf=Object.create(null);for(const df of mc)for(const ff of df.getInterfaces())uf[ff.name]=ff;hc=mc.concat(objectValues(uf))}else hc=[Ai.parentType];else{const pc=bo.getTypeMap();hc=objectValues(pc).filter(mc=>isCompositeType(mc)&&!mc.name.startsWith("__"))}return hintList(vo,hc.map(pc=>{const mc=getNamedType(pc);return{label:String(pc),documentation:(mc==null?void 0:mc.description)||"",kind:CompletionItemKind.Field}}))}function getSuggestionsForFragmentSpread(vo,Ai,bo,Ra,hc){if(!Ra)return[];const pc=bo.getTypeMap(),mc=getDefinitionState(vo.state),uf=getFragmentDefinitions(Ra);hc&&hc.length>0&&uf.push(...hc);const df=uf.filter(ff=>pc[ff.typeCondition.name.value]&&!(mc&&mc.kind===RuleKinds.FRAGMENT_DEFINITION&&mc.name===ff.name.value)&&isCompositeType(Ai.parentType)&&isCompositeType(pc[ff.typeCondition.name.value])&&doTypesOverlap(bo,Ai.parentType,pc[ff.typeCondition.name.value]));return hintList(vo,df.map(ff=>({label:ff.name.value,detail:String(pc[ff.typeCondition.name.value]),documentation:`fragment ${ff.name.value} on ${ff.typeCondition.name.value}`,labelDetails:{detail:`fragment ${ff.name.value} on ${ff.typeCondition.name.value}`},kind:CompletionItemKind.Field,type:pc[ff.typeCondition.name.value]})))}const getParentDefinition=(vo,Ai)=>{var bo,Ra,hc,pc,mc,uf,df,ff,hf,pf;if(((bo=vo.prevState)===null||bo===void 0?void 0:bo.kind)===Ai)return vo.prevState;if(((hc=(Ra=vo.prevState)===null||Ra===void 0?void 0:Ra.prevState)===null||hc===void 0?void 0:hc.kind)===Ai)return vo.prevState.prevState;if(((uf=(mc=(pc=vo.prevState)===null||pc===void 0?void 0:pc.prevState)===null||mc===void 0?void 0:mc.prevState)===null||uf===void 0?void 0:uf.kind)===Ai)return vo.prevState.prevState.prevState;if(((pf=(hf=(ff=(df=vo.prevState)===null||df===void 0?void 0:df.prevState)===null||ff===void 0?void 0:ff.prevState)===null||hf===void 0?void 0:hf.prevState)===null||pf===void 0?void 0:pf.kind)===Ai)return vo.prevState.prevState.prevState.prevState};function getVariableCompletions(vo,Ai,bo){let Ra=null,hc;const pc=Object.create({});return runOnlineParser(vo,(mc,uf)=>{var df;if((uf==null?void 0:uf.kind)===RuleKinds.VARIABLE&&uf.name&&(Ra=uf.name),(uf==null?void 0:uf.kind)===RuleKinds.NAMED_TYPE&&Ra){const ff=getParentDefinition(uf,RuleKinds.TYPE);ff!=null&&ff.type&&(hc=Ai.getType(ff==null?void 0:ff.type))}if(Ra&&hc&&!pc[Ra]){const ff=bo.string==="$"||((df=bo==null?void 0:bo.state)===null||df===void 0?void 0:df.kind)==="Variable"?Ra:"$"+Ra;pc[Ra]={detail:hc.toString(),insertText:ff,label:"$"+Ra,rawInsert:ff,type:hc,kind:CompletionItemKind.Variable},Ra=null,hc=null}}),objectValues(pc)}function getFragmentDefinitions(vo){const Ai=[];return runOnlineParser(vo,(bo,Ra)=>{Ra.kind===RuleKinds.FRAGMENT_DEFINITION&&Ra.name&&Ra.type&&Ai.push({kind:RuleKinds.FRAGMENT_DEFINITION,name:{kind:Kind.NAME,value:Ra.name},selectionSet:{kind:RuleKinds.SELECTION_SET,selections:[]},typeCondition:{kind:RuleKinds.NAMED_TYPE,name:{kind:Kind.NAME,value:Ra.type}}})}),Ai}function getSuggestionsForVariableDefinition(vo,Ai,bo){const Ra=Ai.getTypeMap(),hc=objectValues(Ra).filter(isInputType);return hintList(vo,hc.map(pc=>({label:pc.name,documentation:(pc==null?void 0:pc.description)||"",kind:CompletionItemKind.Variable})))}function getSuggestionsForDirective(vo,Ai,bo,Ra){var hc;if(!((hc=Ai.prevState)===null||hc===void 0)&&hc.kind){const pc=bo.getDirectives().filter(mc=>canUseDirective(Ai.prevState,mc));return hintList(vo,pc.map(mc=>({label:mc.name,documentation:(mc==null?void 0:mc.description)||"",kind:CompletionItemKind.Function})))}return[]}function getSuggestionsForDirectiveArguments(vo,Ai,bo,Ra){const hc=bo.getDirectives().find(pc=>pc.name===Ai.name);return hintList(vo,(hc==null?void 0:hc.args.map(pc=>({label:pc.name,documentation:pc.description||"",kind:CompletionItemKind.Field})))||[])}function canUseDirective(vo,Ai){if(!(vo!=null&&vo.kind))return!1;const{kind:bo,prevState:Ra}=vo,{locations:hc}=Ai;switch(bo){case RuleKinds.QUERY:return hc.includes(DirectiveLocation.QUERY);case RuleKinds.MUTATION:return hc.includes(DirectiveLocation.MUTATION);case RuleKinds.SUBSCRIPTION:return hc.includes(DirectiveLocation.SUBSCRIPTION);case RuleKinds.FIELD:case RuleKinds.ALIASED_FIELD:return hc.includes(DirectiveLocation.FIELD);case RuleKinds.FRAGMENT_DEFINITION:return hc.includes(DirectiveLocation.FRAGMENT_DEFINITION);case RuleKinds.FRAGMENT_SPREAD:return hc.includes(DirectiveLocation.FRAGMENT_SPREAD);case RuleKinds.INLINE_FRAGMENT:return hc.includes(DirectiveLocation.INLINE_FRAGMENT);case RuleKinds.SCHEMA_DEF:return hc.includes(DirectiveLocation.SCHEMA);case RuleKinds.SCALAR_DEF:return hc.includes(DirectiveLocation.SCALAR);case RuleKinds.OBJECT_TYPE_DEF:return hc.includes(DirectiveLocation.OBJECT);case RuleKinds.FIELD_DEF:return hc.includes(DirectiveLocation.FIELD_DEFINITION);case RuleKinds.INTERFACE_DEF:return hc.includes(DirectiveLocation.INTERFACE);case RuleKinds.UNION_DEF:return hc.includes(DirectiveLocation.UNION);case RuleKinds.ENUM_DEF:return hc.includes(DirectiveLocation.ENUM);case RuleKinds.ENUM_VALUE:return hc.includes(DirectiveLocation.ENUM_VALUE);case RuleKinds.INPUT_DEF:return hc.includes(DirectiveLocation.INPUT_OBJECT);case RuleKinds.INPUT_VALUE_DEF:switch(Ra==null?void 0:Ra.kind){case RuleKinds.ARGUMENTS_DEF:return hc.includes(DirectiveLocation.ARGUMENT_DEFINITION);case RuleKinds.INPUT_DEF:return hc.includes(DirectiveLocation.INPUT_FIELD_DEFINITION)}}return!1}function unwrapType(vo){return vo.prevState&&vo.kind&&[RuleKinds.NAMED_TYPE,RuleKinds.LIST_TYPE,RuleKinds.TYPE,RuleKinds.NON_NULL_TYPE].includes(vo.kind)?unwrapType(vo.prevState):vo}var nullthrows={exports:{}},hasRequiredNullthrows;function requireNullthrows(){if(hasRequiredNullthrows)return nullthrows.exports;hasRequiredNullthrows=1;function vo(Ai,bo){if(Ai!=null)return Ai;var Ra=new Error(bo!==void 0?bo:"Got unexpected "+Ai);throw Ra.framesToPop=1,Ra}return nullthrows.exports=vo,nullthrows.exports.default=vo,Object.defineProperty(nullthrows.exports,"__esModule",{value:!0}),nullthrows.exports}requireNullthrows();class Range{constructor(Ai,bo){this.containsPosition=Ra=>this.start.line===Ra.line?this.start.character<=Ra.character:this.end.line===Ra.line?this.end.character>=Ra.character:this.start.line<=Ra.line&&this.end.line>=Ra.line,this.start=Ai,this.end=bo}setStart(Ai,bo){this.start=new Position$1(Ai,bo)}setEnd(Ai,bo){this.end=new Position$1(Ai,bo)}}let Position$1=class{constructor(vo,Ai){this.lessThanOrEqualTo=bo=>this.line<bo.line||this.line===bo.line&&this.character<=bo.character,this.line=vo,this.character=Ai}setLine(vo){this.line=vo}setCharacter(vo){this.character=vo}};function validateWithCustomRules(vo,Ai,bo,Ra,hc){const pc=specifiedRules.filter(mc=>!(mc===NoUnusedFragmentsRule||mc===ExecutableDefinitionsRule));return validate(vo,Ai,pc).filter(mc=>{if(mc.message.includes("Unknown directive")&&mc.nodes){const uf=mc.nodes[0];if(uf&&uf.kind===Kind.DIRECTIVE){const df=uf.name.value;if(df==="arguments"||df==="argumentDefinitions")return!1}}return!0})}const SEVERITY$1={Error:"Error",Warning:"Warning",Information:"Information",Hint:"Hint"},DIAGNOSTIC_SEVERITY={[SEVERITY$1.Error]:1,[SEVERITY$1.Warning]:2,[SEVERITY$1.Information]:3,[SEVERITY$1.Hint]:4},invariant=(vo,Ai)=>{if(!vo)throw new Error(Ai)};function getDiagnostics(vo,Ai=null,bo,Ra,hc){var pc,mc;let uf=null;const df=vo;try{uf=parse(df)}catch(ff){if(ff instanceof GraphQLError){const hf=getRange((mc=(pc=ff.locations)===null||pc===void 0?void 0:pc[0])!==null&&mc!==void 0?mc:{line:0,column:0},df);return[{severity:DIAGNOSTIC_SEVERITY.Error,message:ff.message,source:"GraphQL: Syntax",range:hf}]}throw ff}return validateQuery(uf,Ai)}function validateQuery(vo,Ai=null,bo,Ra){if(!Ai)return[];const hc=validateWithCustomRules(Ai,vo).flatMap(mc=>annotations(mc,DIAGNOSTIC_SEVERITY.Error,"Validation")),pc=validate(Ai,vo,[NoDeprecatedCustomRule]).flatMap(mc=>annotations(mc,DIAGNOSTIC_SEVERITY.Warning,"Deprecation"));return hc.concat(pc)}function annotations(vo,Ai,bo){if(!vo.nodes)return[];const Ra=[];for(const[hc,pc]of vo.nodes.entries()){const mc=pc.kind!=="Variable"&&"name"in pc&&pc.name!==void 0?pc.name:"variable"in pc&&pc.variable!==void 0?pc.variable:pc;if(mc){invariant(vo.locations,"GraphQL validation error requires locations.");const uf=vo.locations[hc],df=getLocation(mc),ff=uf.column+(df.end-df.start);Ra.push({source:`GraphQL: ${bo}`,message:vo.message,severity:Ai,range:new Range(new Position$1(uf.line-1,uf.column-1),new Position$1(uf.line-1,ff))})}}return Ra}function getRange(vo,Ai){const bo=onlineParser(),Ra=bo.startState(),hc=Ai.split(`
|
|
367
|
-
`);invariant(hc.length>=vo.line,"Query text must have more lines than where the error happened");let pc=null;for(let ff=0;ff<vo.line;ff++)for(pc=new CharacterStream(hc[ff]);!pc.eol()&&bo.token(pc,Ra)!=="invalidchar";);invariant(pc,"Expected Parser stream to be available.");const mc=vo.line-1,uf=pc.getStartOfToken(),df=pc.getCurrentPosition();return new Range(new Position$1(mc,uf),new Position$1(mc,df))}function getLocation(vo){const Ai=vo.loc;return invariant(Ai,"Expected ASTNode to have a location."),Ai}class Stack{constructor(Ai,bo,Ra,hc,pc,mc,uf,df,ff,hf=0,pf){this.p=Ai,this.stack=bo,this.state=Ra,this.reducePos=hc,this.pos=pc,this.score=mc,this.buffer=uf,this.bufferBase=df,this.curContext=ff,this.lookAhead=hf,this.parent=pf}toString(){return`[${this.stack.filter((Ai,bo)=>bo%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(Ai,bo,Ra=0){let hc=Ai.parser.context;return new Stack(Ai,[],bo,Ra,Ra,0,[],0,hc?new StackContext(hc,hc.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(Ai,bo){this.stack.push(this.state,bo,this.bufferBase+this.buffer.length),this.state=Ai}reduce(Ai){var bo;let Ra=Ai>>19,hc=Ai&65535,{parser:pc}=this.p,mc=this.reducePos<this.pos-25;mc&&this.setLookAhead(this.pos);let uf=pc.dynamicPrecedence(hc);if(uf&&(this.score+=uf),Ra==0){this.pushState(pc.getGoto(this.state,hc,!0),this.reducePos),hc<pc.minRepeatTerm&&this.storeNode(hc,this.reducePos,this.reducePos,mc?8:4,!0),this.reduceContext(hc,this.reducePos);return}let df=this.stack.length-(Ra-1)*3-(Ai&262144?6:0),ff=df?this.stack[df-2]:this.p.ranges[0].from,hf=this.reducePos-ff;hf>=2e3&&!(!((bo=this.p.parser.nodeSet.types[hc])===null||bo===void 0)&&bo.isAnonymous)&&(ff==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=hf):this.p.lastBigReductionSize<hf&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=ff,this.p.lastBigReductionSize=hf));let pf=df?this.stack[df-1]:0,mf=this.bufferBase+this.buffer.length-pf;if(hc<pc.minRepeatTerm||Ai&131072){let gf=pc.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(hc,ff,gf,mf+4,!0)}if(Ai&262144)this.state=this.stack[df];else{let gf=this.stack[df-3];this.state=pc.getGoto(gf,hc,!0)}for(;this.stack.length>df;)this.stack.pop();this.reduceContext(hc,ff)}storeNode(Ai,bo,Ra,hc=4,pc=!1){if(Ai==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let mc=this,uf=this.buffer.length;if(uf==0&&mc.parent&&(uf=mc.bufferBase-mc.parent.bufferBase,mc=mc.parent),uf>0&&mc.buffer[uf-4]==0&&mc.buffer[uf-1]>-1){if(bo==Ra)return;if(mc.buffer[uf-2]>=bo){mc.buffer[uf-2]=Ra;return}}}if(!pc||this.pos==Ra)this.buffer.push(Ai,bo,Ra,hc);else{let mc=this.buffer.length;if(mc>0&&this.buffer[mc-4]!=0){let uf=!1;for(let df=mc;df>0&&this.buffer[df-2]>Ra;df-=4)if(this.buffer[df-1]>=0){uf=!0;break}if(uf)for(;mc>0&&this.buffer[mc-2]>Ra;)this.buffer[mc]=this.buffer[mc-4],this.buffer[mc+1]=this.buffer[mc-3],this.buffer[mc+2]=this.buffer[mc-2],this.buffer[mc+3]=this.buffer[mc-1],mc-=4,hc>4&&(hc-=4)}this.buffer[mc]=Ai,this.buffer[mc+1]=bo,this.buffer[mc+2]=Ra,this.buffer[mc+3]=hc}}shift(Ai,bo,Ra,hc){if(Ai&131072)this.pushState(Ai&65535,this.pos);else if(Ai&262144)this.pos=hc,this.shiftContext(bo,Ra),bo<=this.p.parser.maxNode&&this.buffer.push(bo,Ra,hc,4);else{let pc=Ai,{parser:mc}=this.p;(hc>this.pos||bo<=mc.maxNode)&&(this.pos=hc,mc.stateFlag(pc,1)||(this.reducePos=hc)),this.pushState(pc,Ra),this.shiftContext(bo,Ra),bo<=mc.maxNode&&this.buffer.push(bo,Ra,hc,4)}}apply(Ai,bo,Ra,hc){Ai&65536?this.reduce(Ai):this.shift(Ai,bo,Ra,hc)}useNode(Ai,bo){let Ra=this.p.reused.length-1;(Ra<0||this.p.reused[Ra]!=Ai)&&(this.p.reused.push(Ai),Ra++);let hc=this.pos;this.reducePos=this.pos=hc+Ai.length,this.pushState(bo,hc),this.buffer.push(Ra,hc,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,Ai,this,this.p.stream.reset(this.pos-Ai.length)))}split(){let Ai=this,bo=Ai.buffer.length;for(;bo>0&&Ai.buffer[bo-2]>Ai.reducePos;)bo-=4;let Ra=Ai.buffer.slice(bo),hc=Ai.bufferBase+bo;for(;Ai&&hc==Ai.bufferBase;)Ai=Ai.parent;return new Stack(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,Ra,hc,this.curContext,this.lookAhead,Ai)}recoverByDelete(Ai,bo){let Ra=Ai<=this.p.parser.maxNode;Ra&&this.storeNode(Ai,this.pos,bo,4),this.storeNode(0,this.pos,bo,Ra?8:4),this.pos=this.reducePos=bo,this.score-=190}canShift(Ai){for(let bo=new SimulatedStack(this);;){let Ra=this.p.parser.stateSlot(bo.state,4)||this.p.parser.hasAction(bo.state,Ai);if(Ra==0)return!1;if(!(Ra&65536))return!0;bo.reduce(Ra)}}recoverByInsert(Ai){if(this.stack.length>=300)return[];let bo=this.p.parser.nextStates(this.state);if(bo.length>8||this.stack.length>=120){let hc=[];for(let pc=0,mc;pc<bo.length;pc+=2)(mc=bo[pc+1])!=this.state&&this.p.parser.hasAction(mc,Ai)&&hc.push(bo[pc],mc);if(this.stack.length<120)for(let pc=0;hc.length<8&&pc<bo.length;pc+=2){let mc=bo[pc+1];hc.some((uf,df)=>df&1&&uf==mc)||hc.push(bo[pc],mc)}bo=hc}let Ra=[];for(let hc=0;hc<bo.length&&Ra.length<4;hc+=2){let pc=bo[hc+1];if(pc==this.state)continue;let mc=this.split();mc.pushState(pc,this.pos),mc.storeNode(0,mc.pos,mc.pos,4,!0),mc.shiftContext(bo[hc],this.pos),mc.reducePos=this.pos,mc.score-=200,Ra.push(mc)}return Ra}forceReduce(){let{parser:Ai}=this.p,bo=Ai.stateSlot(this.state,5);if(!(bo&65536))return!1;if(!Ai.validAction(this.state,bo)){let Ra=bo>>19,hc=bo&65535,pc=this.stack.length-Ra*3;if(pc<0||Ai.getGoto(this.stack[pc],hc,!1)<0){let mc=this.findForcedReduction();if(mc==null)return!1;bo=mc}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(bo),!0}findForcedReduction(){let{parser:Ai}=this.p,bo=[],Ra=(hc,pc)=>{if(!bo.includes(hc))return bo.push(hc),Ai.allActions(hc,mc=>{if(!(mc&393216))if(mc&65536){let uf=(mc>>19)-pc;if(uf>1){let df=mc&65535,ff=this.stack.length-uf*3;if(ff>=0&&Ai.getGoto(this.stack[ff],df,!1)>=0)return uf<<19|65536|df}}else{let uf=Ra(mc,pc+1);if(uf!=null)return uf}})};return Ra(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:Ai}=this.p;return Ai.data[Ai.stateSlot(this.state,1)]==65535&&!Ai.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(Ai){if(this.state!=Ai.state||this.stack.length!=Ai.stack.length)return!1;for(let bo=0;bo<this.stack.length;bo+=3)if(this.stack[bo]!=Ai.stack[bo])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(Ai){return this.p.parser.dialect.flags[Ai]}shiftContext(Ai,bo){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,Ai,this,this.p.stream.reset(bo)))}reduceContext(Ai,bo){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,Ai,this,this.p.stream.reset(bo)))}emitContext(){let Ai=this.buffer.length-1;(Ai<0||this.buffer[Ai]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let Ai=this.buffer.length-1;(Ai<0||this.buffer[Ai]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(Ai){if(Ai!=this.curContext.context){let bo=new StackContext(this.curContext.tracker,Ai);bo.hash!=this.curContext.hash&&this.emitContext(),this.curContext=bo}}setLookAhead(Ai){Ai>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=Ai)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class StackContext{constructor(Ai,bo){this.tracker=Ai,this.context=bo,this.hash=Ai.strict?Ai.hash(bo):0}}class SimulatedStack{constructor(Ai){this.start=Ai,this.state=Ai.state,this.stack=Ai.stack,this.base=this.stack.length}reduce(Ai){let bo=Ai&65535,Ra=Ai>>19;Ra==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(Ra-1)*3;let hc=this.start.p.parser.getGoto(this.stack[this.base-3],bo,!0);this.state=hc}}class StackBufferCursor{constructor(Ai,bo,Ra){this.stack=Ai,this.pos=bo,this.index=Ra,this.buffer=Ai.buffer,this.index==0&&this.maybeNext()}static create(Ai,bo=Ai.bufferBase+Ai.buffer.length){return new StackBufferCursor(Ai,bo,bo-Ai.bufferBase)}maybeNext(){let Ai=this.stack.parent;Ai!=null&&(this.index=this.stack.bufferBase-Ai.bufferBase,this.stack=Ai,this.buffer=Ai.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new StackBufferCursor(this.stack,this.pos,this.index)}}function decodeArray(vo,Ai=Uint16Array){if(typeof vo!="string")return vo;let bo=null;for(let Ra=0,hc=0;Ra<vo.length;){let pc=0;for(;;){let mc=vo.charCodeAt(Ra++),uf=!1;if(mc==126){pc=65535;break}mc>=92&&mc--,mc>=34&&mc--;let df=mc-32;if(df>=46&&(df-=46,uf=!0),pc+=df,uf)break;pc*=46}bo?bo[hc++]=pc:bo=new Ai(pc)}return bo}class CachedToken{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const nullToken=new CachedToken;class InputStream{constructor(Ai,bo){this.input=Ai,this.ranges=bo,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=nullToken,this.rangeIndex=0,this.pos=this.chunkPos=bo[0].from,this.range=bo[0],this.end=bo[bo.length-1].to,this.readNext()}resolveOffset(Ai,bo){let Ra=this.range,hc=this.rangeIndex,pc=this.pos+Ai;for(;pc<Ra.from;){if(!hc)return null;let mc=this.ranges[--hc];pc-=Ra.from-mc.to,Ra=mc}for(;bo<0?pc>Ra.to:pc>=Ra.to;){if(hc==this.ranges.length-1)return null;let mc=this.ranges[++hc];pc+=mc.from-Ra.to,Ra=mc}return pc}clipPos(Ai){if(Ai>=this.range.from&&Ai<this.range.to)return Ai;for(let bo of this.ranges)if(bo.to>Ai)return Math.max(Ai,bo.from);return this.end}peek(Ai){let bo=this.chunkOff+Ai,Ra,hc;if(bo>=0&&bo<this.chunk.length)Ra=this.pos+Ai,hc=this.chunk.charCodeAt(bo);else{let pc=this.resolveOffset(Ai,1);if(pc==null)return-1;if(Ra=pc,Ra>=this.chunk2Pos&&Ra<this.chunk2Pos+this.chunk2.length)hc=this.chunk2.charCodeAt(Ra-this.chunk2Pos);else{let mc=this.rangeIndex,uf=this.range;for(;uf.to<=Ra;)uf=this.ranges[++mc];this.chunk2=this.input.chunk(this.chunk2Pos=Ra),Ra+this.chunk2.length>uf.to&&(this.chunk2=this.chunk2.slice(0,uf.to-Ra)),hc=this.chunk2.charCodeAt(0)}}return Ra>=this.token.lookAhead&&(this.token.lookAhead=Ra+1),hc}acceptToken(Ai,bo=0){let Ra=bo?this.resolveOffset(bo,-1):this.pos;if(Ra==null||Ra<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=Ai,this.token.end=Ra}acceptTokenTo(Ai,bo){this.token.value=Ai,this.token.end=bo}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:Ai,chunkPos:bo}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=Ai,this.chunk2Pos=bo,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let Ai=this.input.chunk(this.pos),bo=this.pos+Ai.length;this.chunk=bo>this.range.to?Ai.slice(0,this.range.to-this.pos):Ai,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(Ai=1){for(this.chunkOff+=Ai;this.pos+Ai>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();Ai-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=Ai,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(Ai,bo){if(bo?(this.token=bo,bo.start=Ai,bo.lookAhead=Ai+1,bo.value=bo.extended=-1):this.token=nullToken,this.pos!=Ai){if(this.pos=Ai,Ai==this.end)return this.setDone(),this;for(;Ai<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;Ai>=this.range.to;)this.range=this.ranges[++this.rangeIndex];Ai>=this.chunkPos&&Ai<this.chunkPos+this.chunk.length?this.chunkOff=Ai-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(Ai,bo){if(Ai>=this.chunkPos&&bo<=this.chunkPos+this.chunk.length)return this.chunk.slice(Ai-this.chunkPos,bo-this.chunkPos);if(Ai>=this.chunk2Pos&&bo<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(Ai-this.chunk2Pos,bo-this.chunk2Pos);if(Ai>=this.range.from&&bo<=this.range.to)return this.input.read(Ai,bo);let Ra="";for(let hc of this.ranges){if(hc.from>=bo)break;hc.to>Ai&&(Ra+=this.input.read(Math.max(hc.from,Ai),Math.min(hc.to,bo)))}return Ra}}class TokenGroup{constructor(Ai,bo){this.data=Ai,this.id=bo}token(Ai,bo){let{parser:Ra}=bo.p;readToken(this.data,Ai,bo,this.id,Ra.data,Ra.tokenPrecTable)}}TokenGroup.prototype.contextual=TokenGroup.prototype.fallback=TokenGroup.prototype.extend=!1;TokenGroup.prototype.fallback=TokenGroup.prototype.extend=!1;function readToken(vo,Ai,bo,Ra,hc,pc){let mc=0,uf=1<<Ra,{dialect:df}=bo.p.parser;e:for(;uf&vo[mc];){let ff=vo[mc+1];for(let gf=mc+3;gf<ff;gf+=2)if((vo[gf+1]&uf)>0){let yf=vo[gf];if(df.allows(yf)&&(Ai.token.value==-1||Ai.token.value==yf||overrides(yf,Ai.token.value,hc,pc))){Ai.acceptToken(yf);break}}let hf=Ai.next,pf=0,mf=vo[mc+2];if(Ai.next<0&&mf>pf&&vo[ff+mf*3-3]==65535){mc=vo[ff+mf*3-1];continue e}for(;pf<mf;){let gf=pf+mf>>1,yf=ff+gf+(gf<<1),vf=vo[yf],bf=vo[yf+1]||65536;if(hf<vf)mf=gf;else if(hf>=bf)pf=gf+1;else{mc=vo[yf+2],Ai.advance();continue e}}break}}function findOffset(vo,Ai,bo){for(let Ra=Ai,hc;(hc=vo[Ra])!=65535;Ra++)if(hc==bo)return Ra-Ai;return-1}function overrides(vo,Ai,bo,Ra){let hc=findOffset(bo,Ra,Ai);return hc<0||findOffset(bo,Ra,vo)<hc}const verbose=typeof process<"u"&&define_process_env_default&&/\bparse\b/.test(define_process_env_default.LOG);let stackIDs=null;function cutAt(vo,Ai,bo){let Ra=vo.cursor(IterMode.IncludeAnonymous);for(Ra.moveTo(Ai);;)if(!(bo<0?Ra.childBefore(Ai):Ra.childAfter(Ai)))for(;;){if((bo<0?Ra.to<Ai:Ra.from>Ai)&&!Ra.type.isError)return bo<0?Math.max(0,Math.min(Ra.to-1,Ai-25)):Math.min(vo.length,Math.max(Ra.from+1,Ai+25));if(bo<0?Ra.prevSibling():Ra.nextSibling())break;if(!Ra.parent())return bo<0?0:vo.length}}class FragmentCursor{constructor(Ai,bo){this.fragments=Ai,this.nodeSet=bo,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let Ai=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(Ai){for(this.safeFrom=Ai.openStart?cutAt(Ai.tree,Ai.from+Ai.offset,1)-Ai.offset:Ai.from,this.safeTo=Ai.openEnd?cutAt(Ai.tree,Ai.to+Ai.offset,-1)-Ai.offset:Ai.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(Ai.tree),this.start.push(-Ai.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(Ai){if(Ai<this.nextStart)return null;for(;this.fragment&&this.safeTo<=Ai;)this.nextFragment();if(!this.fragment)return null;for(;;){let bo=this.trees.length-1;if(bo<0)return this.nextFragment(),null;let Ra=this.trees[bo],hc=this.index[bo];if(hc==Ra.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let pc=Ra.children[hc],mc=this.start[bo]+Ra.positions[hc];if(mc>Ai)return this.nextStart=mc,null;if(pc instanceof Tree){if(mc==Ai){if(mc<this.safeFrom)return null;let uf=mc+pc.length;if(uf<=this.safeTo){let df=pc.prop(NodeProp.lookAhead);if(!df||uf+df<this.fragment.to)return pc}}this.index[bo]++,mc+pc.length>=Math.max(this.safeFrom,Ai)&&(this.trees.push(pc),this.start.push(mc),this.index.push(0))}else this.index[bo]++,this.nextStart=mc+pc.length}}}class TokenCache{constructor(Ai,bo){this.stream=bo,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=Ai.tokenizers.map(Ra=>new CachedToken)}getActions(Ai){let bo=0,Ra=null,{parser:hc}=Ai.p,{tokenizers:pc}=hc,mc=hc.stateSlot(Ai.state,3),uf=Ai.curContext?Ai.curContext.hash:0,df=0;for(let ff=0;ff<pc.length;ff++){if(!(1<<ff&mc))continue;let hf=pc[ff],pf=this.tokens[ff];if(!(Ra&&!hf.fallback)&&((hf.contextual||pf.start!=Ai.pos||pf.mask!=mc||pf.context!=uf)&&(this.updateCachedToken(pf,hf,Ai),pf.mask=mc,pf.context=uf),pf.lookAhead>pf.end+25&&(df=Math.max(pf.lookAhead,df)),pf.value!=0)){let mf=bo;if(pf.extended>-1&&(bo=this.addActions(Ai,pf.extended,pf.end,bo)),bo=this.addActions(Ai,pf.value,pf.end,bo),!hf.extend&&(Ra=pf,bo>mf))break}}for(;this.actions.length>bo;)this.actions.pop();return df&&Ai.setLookAhead(df),!Ra&&Ai.pos==this.stream.end&&(Ra=new CachedToken,Ra.value=Ai.p.parser.eofTerm,Ra.start=Ra.end=Ai.pos,bo=this.addActions(Ai,Ra.value,Ra.end,bo)),this.mainToken=Ra,this.actions}getMainToken(Ai){if(this.mainToken)return this.mainToken;let bo=new CachedToken,{pos:Ra,p:hc}=Ai;return bo.start=Ra,bo.end=Math.min(Ra+1,hc.stream.end),bo.value=Ra==hc.stream.end?hc.parser.eofTerm:0,bo}updateCachedToken(Ai,bo,Ra){let hc=this.stream.clipPos(Ra.pos);if(bo.token(this.stream.reset(hc,Ai),Ra),Ai.value>-1){let{parser:pc}=Ra.p;for(let mc=0;mc<pc.specialized.length;mc++)if(pc.specialized[mc]==Ai.value){let uf=pc.specializers[mc](this.stream.read(Ai.start,Ai.end),Ra);if(uf>=0&&Ra.p.parser.dialect.allows(uf>>1)){uf&1?Ai.extended=uf>>1:Ai.value=uf>>1;break}}}else Ai.value=0,Ai.end=this.stream.clipPos(hc+1)}putAction(Ai,bo,Ra,hc){for(let pc=0;pc<hc;pc+=3)if(this.actions[pc]==Ai)return hc;return this.actions[hc++]=Ai,this.actions[hc++]=bo,this.actions[hc++]=Ra,hc}addActions(Ai,bo,Ra,hc){let{state:pc}=Ai,{parser:mc}=Ai.p,{data:uf}=mc;for(let df=0;df<2;df++)for(let ff=mc.stateSlot(pc,df?2:1);;ff+=3){if(uf[ff]==65535)if(uf[ff+1]==1)ff=pair(uf,ff+2);else{hc==0&&uf[ff+1]==2&&(hc=this.putAction(pair(uf,ff+2),bo,Ra,hc));break}uf[ff]==bo&&(hc=this.putAction(pair(uf,ff+1),bo,Ra,hc))}return hc}}class Parse{constructor(Ai,bo,Ra,hc){this.parser=Ai,this.input=bo,this.ranges=hc,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new InputStream(bo,hc),this.tokens=new TokenCache(Ai,this.stream),this.topTerm=Ai.top[1];let{from:pc}=hc[0];this.stacks=[Stack.start(this,Ai.top[0],pc)],this.fragments=Ra.length&&this.stream.end-pc>Ai.bufferLength*4?new FragmentCursor(Ra,Ai.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let Ai=this.stacks,bo=this.minStackPos,Ra=this.stacks=[],hc,pc;if(this.bigReductionCount>300&&Ai.length==1){let[mc]=Ai;for(;mc.forceReduce()&&mc.stack.length&&mc.stack[mc.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let mc=0;mc<Ai.length;mc++){let uf=Ai[mc];for(;;){if(this.tokens.mainToken=null,uf.pos>bo)Ra.push(uf);else{if(this.advanceStack(uf,Ra,Ai))continue;{hc||(hc=[],pc=[]),hc.push(uf);let df=this.tokens.getMainToken(uf);pc.push(df.value,df.end)}}break}}if(!Ra.length){let mc=hc&&findFinished(hc);if(mc)return verbose&&console.log("Finish with "+this.stackID(mc)),this.stackToTree(mc);if(this.parser.strict)throw verbose&&hc&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+bo);this.recovering||(this.recovering=5)}if(this.recovering&&hc){let mc=this.stoppedAt!=null&&hc[0].pos>this.stoppedAt?hc[0]:this.runRecovery(hc,pc,Ra);if(mc)return verbose&&console.log("Force-finish "+this.stackID(mc)),this.stackToTree(mc.forceAll())}if(this.recovering){let mc=this.recovering==1?1:this.recovering*3;if(Ra.length>mc)for(Ra.sort((uf,df)=>df.score-uf.score);Ra.length>mc;)Ra.pop();Ra.some(uf=>uf.reducePos>bo)&&this.recovering--}else if(Ra.length>1){e:for(let mc=0;mc<Ra.length-1;mc++){let uf=Ra[mc];for(let df=mc+1;df<Ra.length;df++){let ff=Ra[df];if(uf.sameState(ff)||uf.buffer.length>500&&ff.buffer.length>500)if((uf.score-ff.score||uf.buffer.length-ff.buffer.length)>0)Ra.splice(df--,1);else{Ra.splice(mc--,1);continue e}}}Ra.length>12&&Ra.splice(12,Ra.length-12)}this.minStackPos=Ra[0].pos;for(let mc=1;mc<Ra.length;mc++)Ra[mc].pos<this.minStackPos&&(this.minStackPos=Ra[mc].pos);return null}stopAt(Ai){if(this.stoppedAt!=null&&this.stoppedAt<Ai)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=Ai}advanceStack(Ai,bo,Ra){let hc=Ai.pos,{parser:pc}=this,mc=verbose?this.stackID(Ai)+" -> ":"";if(this.stoppedAt!=null&&hc>this.stoppedAt)return Ai.forceReduce()?Ai:null;if(this.fragments){let ff=Ai.curContext&&Ai.curContext.tracker.strict,hf=ff?Ai.curContext.hash:0;for(let pf=this.fragments.nodeAt(hc);pf;){let mf=this.parser.nodeSet.types[pf.type.id]==pf.type?pc.getGoto(Ai.state,pf.type.id):-1;if(mf>-1&&pf.length&&(!ff||(pf.prop(NodeProp.contextHash)||0)==hf))return Ai.useNode(pf,mf),verbose&&console.log(mc+this.stackID(Ai)+` (via reuse of ${pc.getName(pf.type.id)})`),!0;if(!(pf instanceof Tree)||pf.children.length==0||pf.positions[0]>0)break;let gf=pf.children[0];if(gf instanceof Tree&&pf.positions[0]==0)pf=gf;else break}}let uf=pc.stateSlot(Ai.state,4);if(uf>0)return Ai.reduce(uf),verbose&&console.log(mc+this.stackID(Ai)+` (via always-reduce ${pc.getName(uf&65535)})`),!0;if(Ai.stack.length>=8400)for(;Ai.stack.length>6e3&&Ai.forceReduce(););let df=this.tokens.getActions(Ai);for(let ff=0;ff<df.length;){let hf=df[ff++],pf=df[ff++],mf=df[ff++],gf=ff==df.length||!Ra,yf=gf?Ai:Ai.split(),vf=this.tokens.mainToken;if(yf.apply(hf,pf,vf?vf.start:yf.pos,mf),verbose&&console.log(mc+this.stackID(yf)+` (via ${hf&65536?`reduce of ${pc.getName(hf&65535)}`:"shift"} for ${pc.getName(pf)} @ ${hc}${yf==Ai?"":", split"})`),gf)return!0;yf.pos>hc?bo.push(yf):Ra.push(yf)}return!1}advanceFully(Ai,bo){let Ra=Ai.pos;for(;;){if(!this.advanceStack(Ai,null,null))return!1;if(Ai.pos>Ra)return pushStackDedup(Ai,bo),!0}}runRecovery(Ai,bo,Ra){let hc=null,pc=!1;for(let mc=0;mc<Ai.length;mc++){let uf=Ai[mc],df=bo[mc<<1],ff=bo[(mc<<1)+1],hf=verbose?this.stackID(uf)+" -> ":"";if(uf.deadEnd&&(pc||(pc=!0,uf.restart(),verbose&&console.log(hf+this.stackID(uf)+" (restarted)"),this.advanceFully(uf,Ra))))continue;let pf=uf.split(),mf=hf;for(let gf=0;pf.forceReduce()&&gf<10&&(verbose&&console.log(mf+this.stackID(pf)+" (via force-reduce)"),!this.advanceFully(pf,Ra));gf++)verbose&&(mf=this.stackID(pf)+" -> ");for(let gf of uf.recoverByInsert(df))verbose&&console.log(hf+this.stackID(gf)+" (via recover-insert)"),this.advanceFully(gf,Ra);this.stream.end>uf.pos?(ff==uf.pos&&(ff++,df=0),uf.recoverByDelete(df,ff),verbose&&console.log(hf+this.stackID(uf)+` (via recover-delete ${this.parser.getName(df)})`),pushStackDedup(uf,Ra)):(!hc||hc.score<uf.score)&&(hc=uf)}return hc}stackToTree(Ai){return Ai.close(),Tree.build({buffer:StackBufferCursor.create(Ai),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:Ai.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(Ai){let bo=(stackIDs||(stackIDs=new WeakMap)).get(Ai);return bo||stackIDs.set(Ai,bo=String.fromCodePoint(this.nextStackID++)),bo+Ai}}function pushStackDedup(vo,Ai){for(let bo=0;bo<Ai.length;bo++){let Ra=Ai[bo];if(Ra.pos==vo.pos&&Ra.sameState(vo)){Ai[bo].score<vo.score&&(Ai[bo]=vo);return}}Ai.push(vo)}class Dialect{constructor(Ai,bo,Ra){this.source=Ai,this.flags=bo,this.disabled=Ra}allows(Ai){return!this.disabled||this.disabled[Ai]==0}}class LRParser extends Parser{constructor(Ai){if(super(),this.wrappers=[],Ai.version!=14)throw new RangeError(`Parser version (${Ai.version}) doesn't match runtime version (14)`);let bo=Ai.nodeNames.split(" ");this.minRepeatTerm=bo.length;for(let uf=0;uf<Ai.repeatNodeCount;uf++)bo.push("");let Ra=Object.keys(Ai.topRules).map(uf=>Ai.topRules[uf][1]),hc=[];for(let uf=0;uf<bo.length;uf++)hc.push([]);function pc(uf,df,ff){hc[uf].push([df,df.deserialize(String(ff))])}if(Ai.nodeProps)for(let uf of Ai.nodeProps){let df=uf[0];typeof df=="string"&&(df=NodeProp[df]);for(let ff=1;ff<uf.length;){let hf=uf[ff++];if(hf>=0)pc(hf,df,uf[ff++]);else{let pf=uf[ff+-hf];for(let mf=-hf;mf>0;mf--)pc(uf[ff++],df,pf);ff++}}}this.nodeSet=new NodeSet(bo.map((uf,df)=>NodeType.define({name:df>=this.minRepeatTerm?void 0:uf,id:df,props:hc[df],top:Ra.indexOf(df)>-1,error:df==0,skipped:Ai.skippedNodes&&Ai.skippedNodes.indexOf(df)>-1}))),Ai.propSources&&(this.nodeSet=this.nodeSet.extend(...Ai.propSources)),this.strict=!1,this.bufferLength=DefaultBufferLength;let mc=decodeArray(Ai.tokenData);this.context=Ai.context,this.specializerSpecs=Ai.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let uf=0;uf<this.specializerSpecs.length;uf++)this.specialized[uf]=this.specializerSpecs[uf].term;this.specializers=this.specializerSpecs.map(getSpecializer),this.states=decodeArray(Ai.states,Uint32Array),this.data=decodeArray(Ai.stateData),this.goto=decodeArray(Ai.goto),this.maxTerm=Ai.maxTerm,this.tokenizers=Ai.tokenizers.map(uf=>typeof uf=="number"?new TokenGroup(mc,uf):uf),this.topRules=Ai.topRules,this.dialects=Ai.dialects||{},this.dynamicPrecedences=Ai.dynamicPrecedences||null,this.tokenPrecTable=Ai.tokenPrec,this.termNames=Ai.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(Ai,bo,Ra){let hc=new Parse(this,Ai,bo,Ra);for(let pc of this.wrappers)hc=pc(hc,Ai,bo,Ra);return hc}getGoto(Ai,bo,Ra=!1){let hc=this.goto;if(bo>=hc[0])return-1;for(let pc=hc[bo+1];;){let mc=hc[pc++],uf=mc&1,df=hc[pc++];if(uf&&Ra)return df;for(let ff=pc+(mc>>1);pc<ff;pc++)if(hc[pc]==Ai)return df;if(uf)return-1}}hasAction(Ai,bo){let Ra=this.data;for(let hc=0;hc<2;hc++)for(let pc=this.stateSlot(Ai,hc?2:1),mc;;pc+=3){if((mc=Ra[pc])==65535)if(Ra[pc+1]==1)mc=Ra[pc=pair(Ra,pc+2)];else{if(Ra[pc+1]==2)return pair(Ra,pc+2);break}if(mc==bo||mc==0)return pair(Ra,pc+1)}return 0}stateSlot(Ai,bo){return this.states[Ai*6+bo]}stateFlag(Ai,bo){return(this.stateSlot(Ai,0)&bo)>0}validAction(Ai,bo){return!!this.allActions(Ai,Ra=>Ra==bo?!0:null)}allActions(Ai,bo){let Ra=this.stateSlot(Ai,4),hc=Ra?bo(Ra):void 0;for(let pc=this.stateSlot(Ai,1);hc==null;pc+=3){if(this.data[pc]==65535)if(this.data[pc+1]==1)pc=pair(this.data,pc+2);else break;hc=bo(pair(this.data,pc+1))}return hc}nextStates(Ai){let bo=[];for(let Ra=this.stateSlot(Ai,1);;Ra+=3){if(this.data[Ra]==65535)if(this.data[Ra+1]==1)Ra=pair(this.data,Ra+2);else break;if(!(this.data[Ra+2]&1)){let hc=this.data[Ra+1];bo.some((pc,mc)=>mc&1&&pc==hc)||bo.push(this.data[Ra],hc)}}return bo}configure(Ai){let bo=Object.assign(Object.create(LRParser.prototype),this);if(Ai.props&&(bo.nodeSet=this.nodeSet.extend(...Ai.props)),Ai.top){let Ra=this.topRules[Ai.top];if(!Ra)throw new RangeError(`Invalid top rule name ${Ai.top}`);bo.top=Ra}return Ai.tokenizers&&(bo.tokenizers=this.tokenizers.map(Ra=>{let hc=Ai.tokenizers.find(pc=>pc.from==Ra);return hc?hc.to:Ra})),Ai.specializers&&(bo.specializers=this.specializers.slice(),bo.specializerSpecs=this.specializerSpecs.map((Ra,hc)=>{let pc=Ai.specializers.find(uf=>uf.from==Ra.external);if(!pc)return Ra;let mc=Object.assign(Object.assign({},Ra),{external:pc.to});return bo.specializers[hc]=getSpecializer(mc),mc})),Ai.contextTracker&&(bo.context=Ai.contextTracker),Ai.dialect&&(bo.dialect=this.parseDialect(Ai.dialect)),Ai.strict!=null&&(bo.strict=Ai.strict),Ai.wrap&&(bo.wrappers=bo.wrappers.concat(Ai.wrap)),Ai.bufferLength!=null&&(bo.bufferLength=Ai.bufferLength),bo}hasWrappers(){return this.wrappers.length>0}getName(Ai){return this.termNames?this.termNames[Ai]:String(Ai<=this.maxNode&&this.nodeSet.types[Ai].name||Ai)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(Ai){let bo=this.dynamicPrecedences;return bo==null?0:bo[Ai]||0}parseDialect(Ai){let bo=Object.keys(this.dialects),Ra=bo.map(()=>!1);if(Ai)for(let pc of Ai.split(" ")){let mc=bo.indexOf(pc);mc>=0&&(Ra[mc]=!0)}let hc=null;for(let pc=0;pc<bo.length;pc++)if(!Ra[pc])for(let mc=this.dialects[bo[pc]],uf;(uf=this.data[mc++])!=65535;)(hc||(hc=new Uint8Array(this.maxTerm+1)))[uf]=1;return new Dialect(Ai,Ra,hc)}static deserialize(Ai){return new LRParser(Ai)}}function pair(vo,Ai){return vo[Ai]|vo[Ai+1]<<16}function findFinished(vo){let Ai=null;for(let bo of vo){let Ra=bo.p.stoppedAt;(bo.pos==bo.p.stream.end||Ra!=null&&bo.pos>Ra)&&bo.p.parser.stateFlag(bo.state,2)&&(!Ai||Ai.score<bo.score)&&(Ai=bo)}return Ai}function getSpecializer(vo){if(vo.external){let Ai=vo.extend?1:0;return(bo,Ra)=>vo.external(bo,Ra)<<1|Ai}return vo.get}function crelt(){var vo=arguments[0];typeof vo=="string"&&(vo=document.createElement(vo));var Ai=1,bo=arguments[1];if(bo&&typeof bo=="object"&&bo.nodeType==null&&!Array.isArray(bo)){for(var Ra in bo)if(Object.prototype.hasOwnProperty.call(bo,Ra)){var hc=bo[Ra];typeof hc=="string"?vo.setAttribute(Ra,hc):hc!=null&&(vo[Ra]=hc)}Ai++}for(;Ai<arguments.length;Ai++)add(vo,arguments[Ai]);return vo}function add(vo,Ai){if(typeof Ai=="string")vo.appendChild(document.createTextNode(Ai));else if(Ai!=null)if(Ai.nodeType!=null)vo.appendChild(Ai);else if(Array.isArray(Ai))for(var bo=0;bo<Ai.length;bo++)add(vo,Ai[bo]);else throw new RangeError("Unsupported child node: "+Ai)}class SelectedDiagnostic{constructor(Ai,bo,Ra){this.from=Ai,this.to=bo,this.diagnostic=Ra}}class LintState{constructor(Ai,bo,Ra){this.diagnostics=Ai,this.panel=bo,this.selected=Ra}static init(Ai,bo,Ra){let hc=Ai,pc=Ra.facet(lintConfig).markerFilter;pc&&(hc=pc(hc,Ra));let mc=Ai.slice().sort((pf,mf)=>pf.from-mf.from||pf.to-mf.to),uf=new RangeSetBuilder,df=[],ff=0;for(let pf=0;;){let mf=pf==mc.length?null:mc[pf];if(!mf&&!df.length)break;let gf,yf;for(df.length?(gf=ff,yf=df.reduce((bf,Sf)=>Math.min(bf,Sf.to),mf&&mf.from>gf?mf.from:1e8)):(gf=mf.from,yf=mf.to,df.push(mf),pf++);pf<mc.length;){let bf=mc[pf];if(bf.from==gf&&(bf.to>bf.from||bf.to==gf))df.push(bf),pf++,yf=Math.min(bf.to,yf);else{yf=Math.min(bf.from,yf);break}}let vf=maxSeverity(df);if(df.some(bf=>bf.from==bf.to||bf.from==bf.to-1&&Ra.doc.lineAt(bf.from).to==bf.from))uf.add(gf,gf,Decoration.widget({widget:new DiagnosticWidget(vf),diagnostics:df.slice()}));else{let bf=df.reduce((Sf,xf)=>xf.markClass?Sf+" "+xf.markClass:Sf,"");uf.add(gf,yf,Decoration.mark({class:"cm-lintRange cm-lintRange-"+vf+bf,diagnostics:df.slice(),inclusiveEnd:df.some(Sf=>Sf.to>yf)}))}ff=yf;for(let bf=0;bf<df.length;bf++)df[bf].to<=ff&&df.splice(bf--,1)}let hf=uf.finish();return new LintState(hf,bo,findDiagnostic(hf))}}function findDiagnostic(vo,Ai=null,bo=0){let Ra=null;return vo.between(bo,1e9,(hc,pc,{spec:mc})=>{if(!(Ai&&mc.diagnostics.indexOf(Ai)<0))if(!Ra)Ra=new SelectedDiagnostic(hc,pc,Ai||mc.diagnostics[0]);else{if(mc.diagnostics.indexOf(Ra.diagnostic)<0)return!1;Ra=new SelectedDiagnostic(Ra.from,pc,Ra.diagnostic)}}),Ra}function hideTooltip(vo,Ai){let bo=Ai.pos,Ra=Ai.end||bo,hc=vo.state.facet(lintConfig).hideOn(vo,bo,Ra);if(hc!=null)return hc;let pc=vo.startState.doc.lineAt(Ai.pos);return!!(vo.effects.some(mc=>mc.is(setDiagnosticsEffect))||vo.changes.touchesRange(pc.from,Math.max(pc.to,Ra)))}function maybeEnableLint(vo,Ai){return vo.field(lintState,!1)?Ai:Ai.concat(StateEffect.appendConfig.of(lintExtensions))}function setDiagnostics(vo,Ai){return{effects:maybeEnableLint(vo,[setDiagnosticsEffect.of(Ai)])}}const setDiagnosticsEffect=StateEffect.define(),togglePanel$1=StateEffect.define(),movePanelSelection=StateEffect.define(),lintState=StateField.define({create(){return new LintState(Decoration.none,null,null)},update(vo,Ai){if(Ai.docChanged&&vo.diagnostics.size){let bo=vo.diagnostics.map(Ai.changes),Ra=null,hc=vo.panel;if(vo.selected){let pc=Ai.changes.mapPos(vo.selected.from,1);Ra=findDiagnostic(bo,vo.selected.diagnostic,pc)||findDiagnostic(bo,null,pc)}!bo.size&&hc&&Ai.state.facet(lintConfig).autoPanel&&(hc=null),vo=new LintState(bo,hc,Ra)}for(let bo of Ai.effects)if(bo.is(setDiagnosticsEffect)){let Ra=Ai.state.facet(lintConfig).autoPanel?bo.value.length?LintPanel.open:null:vo.panel;vo=LintState.init(bo.value,Ra,Ai.state)}else bo.is(togglePanel$1)?vo=new LintState(vo.diagnostics,bo.value?LintPanel.open:null,vo.selected):bo.is(movePanelSelection)&&(vo=new LintState(vo.diagnostics,vo.panel,bo.value));return vo},provide:vo=>[showPanel.from(vo,Ai=>Ai.panel),EditorView.decorations.from(vo,Ai=>Ai.diagnostics)]}),activeMark=Decoration.mark({class:"cm-lintRange cm-lintRange-active"});function lintTooltip(vo,Ai,bo){let{diagnostics:Ra}=vo.state.field(lintState),hc,pc=-1,mc=-1;Ra.between(Ai-(bo<0?1:0),Ai+(bo>0?1:0),(df,ff,{spec:hf})=>{if(Ai>=df&&Ai<=ff&&(df==ff||(Ai>df||bo>0)&&(Ai<ff||bo<0)))return hc=hf.diagnostics,pc=df,mc=ff,!1});let uf=vo.state.facet(lintConfig).tooltipFilter;return hc&&uf&&(hc=uf(hc,vo.state)),hc?{pos:pc,end:mc,above:vo.state.doc.lineAt(pc).to<mc,create(){return{dom:diagnosticsTooltip(vo,hc)}}}:null}function diagnosticsTooltip(vo,Ai){return crelt("ul",{class:"cm-tooltip-lint"},Ai.map(bo=>renderDiagnostic(vo,bo,!1)))}const openLintPanel=vo=>{let Ai=vo.state.field(lintState,!1);(!Ai||!Ai.panel)&&vo.dispatch({effects:maybeEnableLint(vo.state,[togglePanel$1.of(!0)])});let bo=getPanel(vo,LintPanel.open);return bo&&bo.dom.querySelector(".cm-panel-lint ul").focus(),!0},closeLintPanel=vo=>{let Ai=vo.state.field(lintState,!1);return!Ai||!Ai.panel?!1:(vo.dispatch({effects:togglePanel$1.of(!1)}),!0)},nextDiagnostic=vo=>{let Ai=vo.state.field(lintState,!1);if(!Ai)return!1;let bo=vo.state.selection.main,Ra=Ai.diagnostics.iter(bo.to+1);return!Ra.value&&(Ra=Ai.diagnostics.iter(0),!Ra.value||Ra.from==bo.from&&Ra.to==bo.to)?!1:(vo.dispatch({selection:{anchor:Ra.from,head:Ra.to},scrollIntoView:!0}),!0)},lintKeymap=[{key:"Mod-Shift-m",run:openLintPanel,preventDefault:!0},{key:"F8",run:nextDiagnostic}],lintPlugin=ViewPlugin.fromClass(class{constructor(vo){this.view=vo,this.timeout=-1,this.set=!0;let{delay:Ai}=vo.state.facet(lintConfig);this.lintTime=Date.now()+Ai,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,Ai)}run(){clearTimeout(this.timeout);let vo=Date.now();if(vo<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-vo);else{this.set=!1;let{state:Ai}=this.view,{sources:bo}=Ai.facet(lintConfig);bo.length&&batchResults(bo.map(Ra=>Promise.resolve(Ra(this.view))),Ra=>{this.view.state.doc==Ai.doc&&this.view.dispatch(setDiagnostics(this.view.state,Ra.reduce((hc,pc)=>hc.concat(pc))))},Ra=>{logException(this.view.state,Ra)})}}update(vo){let Ai=vo.state.facet(lintConfig);(vo.docChanged||Ai!=vo.startState.facet(lintConfig)||Ai.needsRefresh&&Ai.needsRefresh(vo))&&(this.lintTime=Date.now()+Ai.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,Ai.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}});function batchResults(vo,Ai,bo){let Ra=[],hc=-1;for(let pc of vo)pc.then(mc=>{Ra.push(mc),clearTimeout(hc),Ra.length==vo.length?Ai(Ra):hc=setTimeout(()=>Ai(Ra),200)},bo)}const lintConfig=Facet.define({combine(vo){return Object.assign({sources:vo.map(Ai=>Ai.source).filter(Ai=>Ai!=null)},combineConfig(vo.map(Ai=>Ai.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(Ai,bo)=>Ai?bo?Ra=>Ai(Ra)||bo(Ra):Ai:bo}))}});function linter(vo,Ai={}){return[lintConfig.of({source:vo,config:Ai}),lintPlugin,lintExtensions]}function forceLinting(vo){let Ai=vo.plugin(lintPlugin);Ai&&Ai.force()}function assignKeys(vo){let Ai=[];if(vo)e:for(let{name:bo}of vo){for(let Ra=0;Ra<bo.length;Ra++){let hc=bo[Ra];if(/[a-zA-Z]/.test(hc)&&!Ai.some(pc=>pc.toLowerCase()==hc.toLowerCase())){Ai.push(hc);continue e}}Ai.push("")}return Ai}function renderDiagnostic(vo,Ai,bo){var Ra;let hc=bo?assignKeys(Ai.actions):[];return crelt("li",{class:"cm-diagnostic cm-diagnostic-"+Ai.severity},crelt("span",{class:"cm-diagnosticText"},Ai.renderMessage?Ai.renderMessage(vo):Ai.message),(Ra=Ai.actions)===null||Ra===void 0?void 0:Ra.map((pc,mc)=>{let uf=!1,df=mf=>{if(mf.preventDefault(),uf)return;uf=!0;let gf=findDiagnostic(vo.state.field(lintState).diagnostics,Ai);gf&&pc.apply(vo,gf.from,gf.to)},{name:ff}=pc,hf=hc[mc]?ff.indexOf(hc[mc]):-1,pf=hf<0?ff:[ff.slice(0,hf),crelt("u",ff.slice(hf,hf+1)),ff.slice(hf+1)];return crelt("button",{type:"button",class:"cm-diagnosticAction",onclick:df,onmousedown:df,"aria-label":` Action: ${ff}${hf<0?"":` (access key "${hc[mc]})"`}.`},pf)}),Ai.source&&crelt("div",{class:"cm-diagnosticSource"},Ai.source))}class DiagnosticWidget extends WidgetType{constructor(Ai){super(),this.sev=Ai}eq(Ai){return Ai.sev==this.sev}toDOM(){return crelt("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class PanelItem{constructor(Ai,bo){this.diagnostic=bo,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=renderDiagnostic(Ai,bo,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class LintPanel{constructor(Ai){this.view=Ai,this.items=[];let bo=hc=>{if(hc.keyCode==27)closeLintPanel(this.view),this.view.focus();else if(hc.keyCode==38||hc.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(hc.keyCode==40||hc.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(hc.keyCode==36)this.moveSelection(0);else if(hc.keyCode==35)this.moveSelection(this.items.length-1);else if(hc.keyCode==13)this.view.focus();else if(hc.keyCode>=65&&hc.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:pc}=this.items[this.selectedIndex],mc=assignKeys(pc.actions);for(let uf=0;uf<mc.length;uf++)if(mc[uf].toUpperCase().charCodeAt(0)==hc.keyCode){let df=findDiagnostic(this.view.state.field(lintState).diagnostics,pc);df&&pc.actions[uf].apply(Ai,df.from,df.to)}}else return;hc.preventDefault()},Ra=hc=>{for(let pc=0;pc<this.items.length;pc++)this.items[pc].dom.contains(hc.target)&&this.moveSelection(pc)};this.list=crelt("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:bo,onclick:Ra}),this.dom=crelt("div",{class:"cm-panel-lint"},this.list,crelt("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>closeLintPanel(this.view)},"×")),this.update()}get selectedIndex(){let Ai=this.view.state.field(lintState).selected;if(!Ai)return-1;for(let bo=0;bo<this.items.length;bo++)if(this.items[bo].diagnostic==Ai.diagnostic)return bo;return-1}update(){let{diagnostics:Ai,selected:bo}=this.view.state.field(lintState),Ra=0,hc=!1,pc=null,mc=new Set;for(Ai.between(0,this.view.state.doc.length,(uf,df,{spec:ff})=>{for(let hf of ff.diagnostics){if(mc.has(hf))continue;mc.add(hf);let pf=-1,mf;for(let gf=Ra;gf<this.items.length;gf++)if(this.items[gf].diagnostic==hf){pf=gf;break}pf<0?(mf=new PanelItem(this.view,hf),this.items.splice(Ra,0,mf),hc=!0):(mf=this.items[pf],pf>Ra&&(this.items.splice(Ra,pf-Ra),hc=!0)),bo&&mf.diagnostic==bo.diagnostic?mf.dom.hasAttribute("aria-selected")||(mf.dom.setAttribute("aria-selected","true"),pc=mf):mf.dom.hasAttribute("aria-selected")&&mf.dom.removeAttribute("aria-selected"),Ra++}});Ra<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)hc=!0,this.items.pop();this.items.length==0&&(this.items.push(new PanelItem(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),hc=!0),pc?(this.list.setAttribute("aria-activedescendant",pc.id),this.view.requestMeasure({key:this,read:()=>({sel:pc.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:uf,panel:df})=>{let ff=df.height/this.list.offsetHeight;uf.top<df.top?this.list.scrollTop-=(df.top-uf.top)/ff:uf.bottom>df.bottom&&(this.list.scrollTop+=(uf.bottom-df.bottom)/ff)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),hc&&this.sync()}sync(){let Ai=this.list.firstChild;function bo(){let Ra=Ai;Ai=Ra.nextSibling,Ra.remove()}for(let Ra of this.items)if(Ra.dom.parentNode==this.list){for(;Ai!=Ra.dom;)bo();Ai=Ra.dom.nextSibling}else this.list.insertBefore(Ra.dom,Ai);for(;Ai;)bo()}moveSelection(Ai){if(this.selectedIndex<0)return;let bo=this.view.state.field(lintState),Ra=findDiagnostic(bo.diagnostics,this.items[Ai].diagnostic);Ra&&this.view.dispatch({selection:{anchor:Ra.from,head:Ra.to},scrollIntoView:!0,effects:movePanelSelection.of(Ra)})}static open(Ai){return new LintPanel(Ai)}}function svg(vo,Ai='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${Ai}>${encodeURIComponent(vo)}</svg>')`}function underline(vo){return svg(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${vo}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const baseTheme$3=EditorView.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:underline("#d11")},".cm-lintRange-warning":{backgroundImage:underline("orange")},".cm-lintRange-info":{backgroundImage:underline("#999")},".cm-lintRange-hint":{backgroundImage:underline("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function severityWeight(vo){return vo=="error"?4:vo=="warning"?3:vo=="info"?2:1}function maxSeverity(vo){let Ai="hint",bo=1;for(let Ra of vo){let hc=severityWeight(Ra.severity);hc>bo&&(bo=hc,Ai=Ra.severity)}return Ai}const lintExtensions=[lintState,EditorView.decorations.compute([lintState],vo=>{let{selected:Ai,panel:bo}=vo.field(lintState);return!Ai||!bo||Ai.from==Ai.to?Decoration.none:Decoration.set([activeMark.range(Ai.from,Ai.to)])}),hoverTooltip(lintTooltip,{hideOn:hideTooltip}),baseTheme$3];function posToOffset(vo,Ai){return vo.line(Ai.line+1).from+Ai.character}function offsetToPos(vo,Ai){const bo=vo.lineAt(Ai);return new Position(bo.number-1,Ai-bo.from)}class Position{constructor(Ai,bo){this.line=Ai,this.character=bo}setLine(Ai){this.line=Ai}setCharacter(Ai){this.character=Ai}lessThanOrEqualTo(Ai){return this.line<Ai.line||this.line===Ai.line&&this.character<=Ai.character}}const isMac=()=>navigator.userAgent.includes("Mac"),isMetaKeyPressed=vo=>isMac()?vo.metaKey:vo.ctrlKey,schemaEffect=StateEffect.define(),schemaStateField=StateField.define({create(){},update(vo,Ai){for(const bo of Ai.effects)if(bo.is(schemaEffect))return bo.value;return vo}}),optionsEffect=StateEffect.define(),optionsStateField=StateField.define({create(){},update(vo,Ai){for(const bo of Ai.effects)if(bo.is(optionsEffect))return bo.value;return vo}}),getSchema=vo=>vo.field(schemaStateField),getOpts=vo=>vo.field(optionsStateField),defaultOpts={showErrorOnInvalidSchema:!0},stateExtensions=(vo,Ai)=>[schemaStateField.init(()=>vo),optionsStateField.init(()=>Object.assign(Object.assign({},defaultOpts),Ai))],spec_name={__proto__:null,query:241,mutation:243,subscription:245,on:86,fragment:92,schema:102,scalar:114,type:120,implements:126,interface:140,union:146,enum:154,input:164,directive:172,repeatable:176,extend:192},parser$1=LRParser.deserialize({version:14,states:"LWOYQPOOO!WQPO'#C}O!`QPO'#C_OOQO'#C_'#C_O!iQPO'#DYOOQO'#Ev'#EvOOQO'#D_'#D_O!nQPO'#D^O#_QPO'#D^O!iQPO'#DhO!iQPO'#DrO!iQPO'#DuO!iQPO'#DyO!iQPO'#EOOOQO'#Dd'#DdO#fQPO'#ESOOQO'#D]'#D]O!vQPO'#E^OOQO'#Ea'#EaOOQO'#E]'#E]OOQO'#FT'#FTOOQO'#Eu'#EuOOQO'#Eh'#EhQYQPOOOOQO'#C`'#C`OOQO'#DZ'#DZOOQO'#D`'#D`OOQO'#Di'#DiOOQO'#Ds'#DsOOQO'#Dv'#DvOOQO'#Dz'#DzOOQO'#EP'#EPOOQO'#ET'#ETOOQO'#E_'#E_O#kQPO'#CaO$VQPO'#DQO$[QPO'#DPO$sQPO'#DPO$xQPO'#DSO%WQPO'#DOOOQO'#En'#EnO%fQPO,59iOOQO'#Ca'#CaO%qQPO'#CxOOQO'#El'#ElO'hQPO'#CwO)[QPO'#CdOOQO,58y,58yO)aQPO,58yO)fQPO,58yO)nQPO,58yOOQO'#DT'#DTO)yQPO,59tO{QPO'#FUOOQO'#Db'#DbOOQO,59x,59xO*OQPO,59xO!nQPO,59xO!iQPO,5:PO!iQPO,5:SO!iQPO,5:^O!iQPO,5:aO!iQPO,5:eO!iQPO,5:jO*TQPO,5:nOOQO'#Df'#DfO*YQPO,5:SO+aQPO,5:^O,hQPO,5:aO-oQPO,5:eO.sQPO,5:jO/wQPO,5:nO!nQPO,5:xO!iQPO,5:|O!iQPO,5:}O!iQPO,5;OO!iQPO,5;PO!iQPO,5;QO!iQPO,5;ROOQO-E8f-E8fOOQO,59l,59lO0VQPO'#CzOOQO,59k,59kO0[QPO,59kO0mQPO,59kOOQO'#DR'#DRO0tQPO,59kO1OQPO,59nO!iQPO'#DVOOQO,59p,59pO)aQPO,59pO)fQPO,59pOOQO'#DW'#DWOOQO,59j,59jOOQO-E8l-E8lOOQO1G/T1G/TOOQO,59d,59dOOQO-E8j-E8jO1aQPO'#CeOOQO'#Ei'#EiO1fQPO,59OOOQO1G.e1G.eO)aQPO1G.eO)fQPO1G.eO)fQPO1G/`O1nQPO'#DcO1sQPO,5;pOOQO1G/d1G/dO*OQPO1G/dO1xQPO1G/kO4QQPO1G/nO5]QPO1G/xO6hQPO1G/{O7pQPO1G0PO8xQPO1G0UO/wQPO1G0YO9PQPO1G/nO9WQPO'#DkO9`QPO'#FWOOQO'#Dn'#DnOOQO1G/n1G/nO9hQPO1G/nOOQO'#Dl'#DlO:iQPO1G/xOOQO1G/x1G/xO:pQPO1G/xO;qQPO1G/{O;xQPO'#DxO5dQPO1G/{O<QQQO'#FYOOQO'#D|'#D|OOQO1G0P1G0PO6oQPO1G0PO9`QPO'#FZOOQO'#ER'#EROOQO1G0U1G0UO7wQPO1G0UO<YQPO'#DqO!iQPO'#DqOOQO'#Ep'#EpO<_QPO'#DpO<pQSO1G0YO)yQPO1G0YO>QQPO1G0YOOQO'#EV'#EVOOQO1G0d1G0dO>YQPO1G0dO!qQPO1G0hO?ZQPO1G0iO?ZQPO1G0jO?fQPO1G0kO?nQPO1G0lO?vQPO1G0mOOQO'#C|'#C|O@OQPO'#C{OOQO'#Em'#EmO@TQPO,59fOOQO1G/V1G/VO@]QPO1G/VO@nQPO1G/VOOQO1G/Y1G/YOOQO'#Cg'#CgOOQO,59q,59qOOQO1G/[1G/[O)aQPO1G/[O@uQPO,59POOQO-E8g-E8gOOQO1G.j1G.jOOQO7+$P7+$PO)aQPO7+$POOQO7+$z7+$zO)aQPO7+$zO!iQPO,59}OOQO1G1[1G1[OOQO7+%O7+%OOOQO7+%V7+%VOBOQPO7+%YOOQO7+%Y7+%YO@}QPO7+%YOCZQPO7+%dOOQO7+%d7+%dOBYQPO7+%dODfQPO7+%gODmQPO7+%gOOQO7+%k7+%kODtQPO7+%kOOQO7+%p7+%pOEuQPO7+%pO<pQSO7+%tO)yQPO7+%tO>QQPO7+%tO!iQPO,5:VOOQO,5:V,5:VOFvQPO'#DoO!iQPO'#DoOOQO'#Eo'#EoOGRQPO,5;rO!iQPO,5:dOOQO,5:d,5:dOG^QQO'#D}OGlQQO'#D}OOQO'#Eq'#EqOGqQQO,5;tOG|QPO,5;uO@uQPO,5:]OHXQPO,5:]OOQO-E8n-E8nOOQO'#EZ'#EZOOQO'#E['#E[OOQO'#EY'#EYOH^QPO7+%tOOQO'#EX'#EXO<sQSO'#EXOOQO7+&O7+&OOOQO7+&S7+&SOJcQPO7+&TOOQO7+&T7+&TOIbQPO7+&TOKnQPO7+&UOOQO7+&U7+&UOJmQPO7+&UOLyQPO7+&VOMQQPO7+&VOOQO7+&W7+&WOMXQPO7+&WOOQO7+&X7+&XONYQPO7+&XO! ZQQO,59gOOQO-E8k-E8kOOQO1G/Q1G/QOOQO7+$q7+$qO! xQPO7+$qOOQO7+$v7+$vO@uQPO'#CjO!!ZQPO'#E|OOQO'#E|'#E|O!#UQPO1G.kOOQO<<Gk<<GkOOQO<<Hf<<HfOOQO1G/i1G/iOOQO<<Ht<<HtO!#gQPO<<HtOOQO<<IO<<IOO!$hQPO<<IOO!%iQPO<<IROOQO<<IV<<IVOOQO<<I[<<I[O!&mQPO<<I`O<pQSO<<I`O)yQPO<<I`OOQO1G/q1G/qO@uQPO,5:ZO!'qQPO,5:ZO!'vQPO,5:ZOOQO-E8m-E8mOOQO1G1^1G1^OOQO1G0O1G0OO!(RQQO'#CxO!(dQQO'#CwOOQO,5:i,5:iO!(rQQO,5:iOOQO-E8o-E8oOOQO1G1`1G1`OOQO1G1a1G1aO!)QQPO1G/wO@uQPO1G/wO<sQSO,5:sOOQO,5:s,5:sOOQO<<Io<<IoO!)lQPO<<IoOOQO<<Ip<<IpO!*mQPO<<IpO!+nQPO<<IqOOQO<<Ir<<IrOOQO<<Is<<IsO!,rQQO'#CsO!,yQPO'#CvOOQO'#FP'#FPO!-RQPO1G/ROOQO<<H]<<H]O!-^QPO,59UOOQO,59V,59VO! ZQQO'#ClOOQO7+$V7+$VO!-cQPO7+$VO!-nQPO7+$VOOQOAN>`AN>`OOQOAN>jAN>jO!-|QPOAN>zO<pQSOAN>zO!/QQPO1G/uO@uQPO1G/uO!/`QPO1G/uOOQO1G0T1G0TOOQO7+%c7+%cO!/eQPO7+%cO!/|QPO7+%cOOQO1G0_1G0_OOQOAN?ZAN?ZOOQOAN?[AN?[O!0TQQO'#EjO!0xQQO,59_OOQO,59_,59_O!1PQPO'#FROOQO'#Ek'#EkO!1UQPO,59bOOQO,59b,59bOOQO7+$m7+$mOOQO1G.p1G.pOOQO,59W,59WOOQO<<Gq<<GqO!1^QPO<<GqO!1iQPOG24fOOQO7+%a7+%aO!2mQPO7+%aO@uQPO7+%aOOQO<<H}<<H}O!2{QPO<<H}OOQO,5;U,5;UOOQO-E8h-E8hOOQO1G.y1G.yO! ZQQO,5;mOOQO-E8i-E8iOOQO1G.|1G.|OOQOAN=]AN=]OOQO<<H{<<H{O!3dQPO<<H{OOQOAN>iAN>iO!3rQPO1G1XOOQOAN>gAN>gOOQO7+&s7+&s",stateData:"!4S~O#hOSPOS~OcUOiPO!OiO!TjO!^kO!hlO!kmO!onO!toO!xpO#SqO#lhO#mhO#nhO~O#krO#vvO~OV!OOiPOm{O#kzO~Oi!VOm{O~O!TjO!Z!cO!^kO!hlO!kmO!onO!toO~O!xpO~P!vOm!iO~OVuXhuXiuXmuX#kuX#oTX#tuX#vuX~O#o!rO~OV!sOiPOm{OhsX#ksX#tsX#vsX~O#k!wO~OiPOm{O{#OO#kzO~O#t#POhrX#krX#vrX~Oh#RO#krO#vvO~OV!sOilXmlXhlX#klX#tlX#vlXclX!OlX!TlX!^lX!hlX!klX!olX!tlX!xlX#SlX#flX#llX#mlX#nlX#rlXUlXYlX{lX!zlX#olX~Om{OikXhkX#kkX#tkX#vkXckX!OkX!TkX!^kX!hkX!kkX!okX!tkX!xkX#SkX#fkX#lkX#mkX#nkX#rkXUkXYkX{kX!zkX#okX~OY#UO~OiPO~OiPOm{O~OV!OOiPOm{O~O{#OO~Oi!VO~Om#gO~Oi#jOm{O!a#nOc![a!O![a!T![a!^![a!h![a!k![a!o![a!t![a!x![a#S![a#f![a#l![a#m![a#n![a~Oi#jOm{O!a#nOc!fa!O!fa!T!fa!^!fa!h!fa!k!fa!o!fa!t!fa!x!fa#S!fa#f!fa#l!fa#m!fa#n!fa~Om{O#r#sOc!iai!ia!O!ia!T!ia!^!ia!h!ia!k!ia!o!ia!t!ia!x!ia#S!ia#f!ia#l!ia#m!ia#n!ia~Oi#uOm{Oc!ma!O!ma!T!ma!^!ma!h!ma!k!ma!o!ma!t!ma!x!ma#S!ma#f!ma#l!ma#m!ma#n!ma~Oi#yOm{Oc!ra!O!ra!T!ra!^!ra!h!ra!k!ra!o!ra!t!ra!x!ra#S!ra#f!ra#l!ra#m!ra#n!ra~OcUO{#OO!z$UO#kzO~O#k$_O~OiPOhsa#ksa#tsa#vsa~Om{O~P0[OV!sOm{O~P0[Om{Ohva#kva#tva#vva~O#o$kO~OU$mOY#UO~O#o$rO~Oh$sO~Om{Oc!Xii!Xi!O!Xi!T!Xi!^!Xi!h!Xi!k!Xi!o!Xi!t!Xi!x!Xi#S!Xi#f!Xi#l!Xi#m!Xi#n!Xi~Oi#jOm{Oc![i!O![i!T![i!^![i!h![i!k![i!o![i!t![i!x![i#S![i#f![i#l![i#m![i#n![i~O!a#nO~P2|Oi#jOm{Oc!fi!O!fi!T!fi!^!fi!h!fi!k!fi!o!fi!t!fi!x!fi#S!fi#f!fi#l!fi#m!fi#n!fi~O!a#nO~P4XO#r#sOc!iii!ii!O!ii!T!ii!^!ii!h!ii!k!ii!o!ii!t!ii!x!ii#S!ii#f!ii#l!ii#m!ii#n!ii~Om{O~P5dOi#uOc!mi!O!mi!T!mi!^!mi!h!mi!k!mi!o!mi!t!mi!x!mi#S!mi#f!mi#l!mi#m!mi#n!mi~Om{O~P6oOi#yOc!ri!O!ri!T!ri!^!ri!h!ri!k!ri!o!ri!t!ri!x!ri#S!ri#f!ri#l!ri#m!ri#n!ri~Om{O~P7wO#y%VO~P2|O#kzO#y%VO~OcUO#kzO~Oi#jOc![i!O![i!T![i!^![i!h![i!k![i!o![i!t![i!x![i#S![i#f![i#l![i#m![i#n![i~O#y%VO~P4XOi#jOc!fi!O!fi!T!fi!^!fi!h!fi!k!fi!o!fi!t!fi!x!fi#S!fi#f!fi#l!fi#m!fi#n!fi~O#{%]O~P5gO#kzO#{%]O~OcUOf%_O~O#o%dO~OcUO#kzO{!dX!z!dX#o!dX~O#{%lO$O%gO$P%gO$Q%gO$R%gO$S%gO$T%gO$U%gO$V%gO$W%hO$X%hO$Y%hO$Z%hO$[%hO$]%hO$^%hO$_%hO$`%hO$a%hO$b%hO~O{#OO!z$UO~Oi!VOc#Qi!O#Qi!T#Qi!^#Qi!h#Qi!k#Qi!o#Qi!t#Qi!x#Qi#S#Qi#f#Qi#l#Qi#m#Qi#n#Qi~Oi#jOm{O!a#nO~Om{O#r#sO~Oi#uOm{O~Oi#yOm{O~O#o%{O~OU%}O#k$_O~OiPOhsi#ksi#tsi#vsi~Om{O~P@]O]&RO#kzO~Oi#jOc![q!O![q!T![q!^![q!h![q!k![q!o![q!t![q!x![q#S![q#f![q#l![q#m![q#n![q~Om{O#y%VO~P@}Oi#jOc!fq!O!fq!T!fq!^!fq!h!fq!k!fq!o!fq!t!fq!x!fq#S!fq#f!fq#l!fq#m!fq#n!fq~Om{O#y%VO~PBYOc!iqi!iq!O!iq!T!iq!^!iq!h!iq!k!iq!o!iq!t!iq!x!iq#S!iq#f!iq#l!iq#m!iq#n!iq~O#{%]O~PCeO#r#sO~PCeOi#uOc!mq!O!mq!T!mq!^!mq!h!mq!k!mq!o!mq!t!mq!x!mq#S!mq#f!mq#l!mq#m!mq#n!mq~Oi#yOc!rq!O!rq!T!rq!^!rq!h!rq!k!rq!o!rq!t!rq!x!rq#S!rq#f!rq#l!rq#m!rq#n!rq~OcUO#kzO#o&eO~OcUOh&iO#kzO~Om&kOc!qXf!qXh!qX~Of&nO~OcUOf%_Oh&pO~OcUOh&qO#kzO~O#o&sO~O#{&tOc!vqi!vq!O!vq!T!vq!^!vq!h!vq!k!vq!o!vq!t!vq!x!vq#S!vq#f!vq#l!vq#m!vq#n!vq~Oi#jOc#Vq!O#Vq!T#Vq!^#Vq!h#Vq!k#Vq!o#Vq!t#Vq!x#Vq#S#Vq#f#Vq#l#Vq#m#Vq#n#Vq~Om{O#y%VO~PIbOi#jOc#Wq!O#Wq!T#Wq!^#Wq!h#Wq!k#Wq!o#Wq!t#Wq!x#Wq#S#Wq#f#Wq#l#Wq#m#Wq#n#Wq~Om{O#y%VO~PJmOc#Xqi#Xq!O#Xq!T#Xq!^#Xq!h#Xq!k#Xq!o#Xq!t#Xq!x#Xq#S#Xq#f#Xq#l#Xq#m#Xq#n#Xq~O#{%]O~PKxO#r#sO~PKxOi#uOc#Yq!O#Yq!T#Yq!^#Yq!h#Yq!k#Yq!o#Yq!t#Yq!x#Yq#S#Yq#f#Yq#l#Yq#m#Yq#n#Yq~Oi#yOc#Zq!O#Zq!T#Zq!^#Zq!h#Zq!k#Zq!o#Zq!t#Zq!x#Zq#S#Zq#f#Zq#l#Zq#m#Zq#n#Zq~OY'PO]&}Oa'POb'POc'POd'POe'POf'POi'OO~OiPOhsq#ksq#tsq#vsq~O#q'TOU#pXY#pXm#pX#r#pX#t#pXc#pX{#pX!z#pX#k#pX[#pXh#pX#o#pX~Om{O#r'UO#t'VOUXiYXi~Oi#jOc![y!O![y!T![y!^![y!h![y!k![y!o![y!t![y!x![y#S![y#f![y#l![y#m![y#n![y~Oi#jOc!fy!O!fy!T!fy!^!fy!h!fy!k!fy!o!fy!t!fy!x!fy#S!fy#f!fy#l!fy#m!fy#n!fy~O#{%]Oc!iyi!iy!O!iy!T!iy!^!iy!h!iy!k!iy!o!iy!t!iy!x!iy#S!iy#f!iy#l!iy#m!iy#n!iy~O#{&tOc!vyi!vy!O!vy!T!vy!^!vy!h!vy!k!vy!o!vy!t!vy!x!vy#S!vy#f!vy#l!vy#m!vy#n!vy~O#o'_O~OcUO#kzO#o'_O~OV!sOclXflXhlXmlX~Om&kOckXfkXhkX~Om&kOc!qaf!qah!qa~Om{O#r'UOc!ei{!ei!z!ei#k!eih!ei#o!ei~Oi#jOc#Vy!O#Vy!T#Vy!^#Vy!h#Vy!k#Vy!o#Vy!t#Vy!x#Vy#S#Vy#f#Vy#l#Vy#m#Vy#n#Vy~Oi#jOc#Wy!O#Wy!T#Wy!^#Wy!h#Wy!k#Wy!o#Wy!t#Wy!x#Wy#S#Wy#f#Wy#l#Wy#m#Wy#n#Wy~O#{%]Oc#Xyi#Xy!O#Xy!T#Xy!^#Xy!h#Xy!k#Xy!o#Xy!t#Xy!x#Xy#S#Xy#f#Xy#l#Xy#m#Xy#n#Xy~O['jO~P! ZOh'nO#kzO~O#t'oOUoi#koi~O['pO~O#t'rOUXqYXq~Om{O#t'rOUXqYXq~O#{&tOc!v!Ri!v!R!O!v!R!T!v!R!^!v!R!h!v!R!k!v!R!o!v!R!t!v!R!x!v!R#S!v!R#f!v!R#l!v!R#m!v!R#n!v!R~Om{Oc!cih!ci#k!ci~O#o'wO~Om{Oc!eq{!eq!z!eq#k!eqh!eq#o!eq~O#r'UO~P!/eO#t'zOY#^X[#^X]#^Xa#^Xb#^Xc#^Xd#^Xe#^Xf#^Xi#^X~O['|O~P! ZO#o'}O~Oh(PO#kzO~O#t(QOUXyYXy~O#{&tOc!v!Zi!v!Z!O!v!Z!T!v!Z!^!v!Z!h!v!Z!k!v!Z!o!v!Z!t!v!Z!x!v!Z#S!v!Z#f!v!Z#l!v!Z#m!v!Z#n!v!Z~Om{Oc!cqh!cq#k!cq~Om{Oc!ey{!ey!z!ey#k!eyh!ey#o!ey~Om{Oc!cyh!cy#k!cy~O#t(WOh#ui#k#ui~Odefe~",goto:":k$OPPP$P$T$[PP&d&jP&nPP'Z'd'mPPPPPP'vPP'v'}*|P,T,_,c,g-k-o-s-w-o.O-o.U.[P$P.oP.s.w.{/bP/l/|.w0P0TP0P0ZP0e0wP1P2T2X2e0P2nP0P2xP3S0P3dP3n4O0P4SP4^.w4nP4uP5P5]5i5i.s5q5uP5q5y5y5y5y5y5y5}6T6Z6a6g7r7x8O8U8cPPP8i8mPPPPP8qPP9WP9eP8m9iP9qP:Z:cTTOgSQOgR#]!VSsPyQ!SQS!TSvQ!dXQ!eYQ!fZQ!g[Q!h]Q#a![Q#b!]Q#c!^Q#d!_Q#e!`Q#f!a^#}!i#g#y$Q%X%c&gQ$X!kQ$Y!lQ$Z!mQ$[!nQ$]!oQ$^!pj$g!z#i#s$k$r%V%]%d&R&e&s'_'wS%X#j%[Q%e$OQ&g%YT'k'O'mQ!RQR#Z!ST#V!O#WQ$h!zQ%W#iQ%^#s^&S$k%d&R&e&s'_'wQ&X$rQ&d%VR&j%]_&S$k%d&R&e&s'_'w_&T$k%d&R&e&s'_'wQ'X&UQ'c&rR'y'dZ'P%{&}'U'i'}Q!QQQ!YVQ!utQ!|vS#Y!R!SQ#`!ZQ#m!dQ#q!eQ#t!fQ#x!gQ#|!hQ$W!jS$d!v!xQ$f!yQ$j!}Q$o#ZQ$q#[Q$u#aS$x#b#hS${#c#oQ$}#dQ%P#eQ%R#fQ%n$XQ%q$YQ%t$ZQ%v$[Q%x$]Q%z$^Q&P$eQ&Z$vQ&]$yQ&m%_Q&w%oQ&y%rQ'W&UQ'a&nQ'b&rQ's'XQ'u'^S'x'c'dQ(R'vQ(T'yR(V(S#Z|QVtv}!R!S!Z!d!e!f!g!h!j!v!x!y!}#Z#[#a#b#c#d#e#f#h#o$X$Y$Z$[$]$^$e$v$y%_%o%r&U&l&n&r'X'^'c'd'v'y(SQ!vtS#S{&kR$e!xT$a!s$bT$`!s$bSROgQ!PQQ!ttQ!{vU#X!Q!R!SU$c!u!v!xS$i!|!}S$n#Y#ZQ$p#[S&O$d$eQ&Q$jQ&V$oQ&W$qR'R&PTxPyTwPyTuPyStPyR!xuQ!USR!yvQ!}vR#[!US!zv!UQ$R!iU%S#g$S$TS&b%T%UR']&cTSOgTdOgT`OgSWOg^$O!i#g#y$Q%X%c&gS%Y#j%[T%`#u%bSVOgQ!ZWR!jaQ!XVS#_!Y!ZQ$V!jQ$t#`R%m$WR#^!VT^OgQ![WR!kaSXOgQ!]WR!laQ#h!dQ#o!eQ$v#bQ$y#cQ%o$YR%r$Z]#i!d!e#b#c$Y$ZQ#l!dQ#p!eU$w#b#h#mU$z#c#o#qQ%p$YQ%s$ZS&Y$v$xS&[$y${S&v%o%qS&x%r%tQ'Y&ZQ'Z&]Q'f&wR'g&yT%Z#j%[Q$T!iQ%U#gQ&f%XR'`&g_$P!i#g#y$Q%X%c&gSYOgQ!^WR!maSZOgQ!_WR!naQ#r!fS$|#d#tQ%u$[Q&^$}R&z%vS[OgQ!`WR!oaQ#w!gS%O#e#xQ%w$]Q&_%PR&{%xT%a#u%bS]OgQ!aWR!paQ#{!hS%Q#f#|Q%y$^Q&`%RR&|%zS_OgR!bWQ$S!iS%T#g$TR&c%UQ%j$RQ&a%SQ'[&bR't']W%k$R%S&b']Q&u%lR'e&t]%i$R%S%l&b&t']TcOgTaOgTbOgQgOR!qgQ#W!OR$l#WQ'i&}R'{'iQ'm'OR(O'm#Q}QVtv!R!S!Z!d!e!f!g!h!j!v!x!y!}#Z#[#a#b#c#d#e#f#h#o$X$Y$Z$[$]$^$e$v$y%o%r&U&r'X'^'c'd'v'y(SS#T}&lT&l%_&nQ$b!sR%|$bQyPR#QyQ%[#jR&h%[W$Q!i#g%X&gQ%c#yT%f$Q%cQ%b#uR&o%bTfOgTeOgQ&U$kQ&r%dQ'S&RQ'^&eQ'd&sQ'v'_R(S'wQ'Q%{S'h&}'iQ'q'UR(U'}T'l'O'm]!WV!Y!Z!j#`$W}#k!d!e#b#c#h#m#o#q$Y$Z$v$x$y${%o%q%r%t&Z&]&w&y]#v!g#e#x$]%P%x]#z!h#f#|$^%R%z",nodeNames:"⚠ Comment Document OperationDefinition OperationType Name ) ( VariableDefinitions VariableDefinition Variable NamedType ] [ ListType NonNullType DefaultValue IntValue FloatValue StringValue BooleanValue NullValue EnumValue ListValue } { ObjectValue Directives Directive DirectiveName Arguments Argument ArgumentAttributeName SelectionSet Selection Field Alias FieldName FragmentSpread FragmentName InlineFragment TypeCondition OnKeyword on FragmentDefinition FragmentKeyword fragment TypeSystemDefinition SchemaDefinition Description SchemaKeyword schema RootTypeDefinition RootOperationTypeDefinition TypeDefinition ScalarTypeDefinition ScalarKeyword scalar ObjectTypeDefinition TypeKeyword type ImplementsInterfaces ImplementsKeyword implements FieldsDefinition FieldDefinition ArgumentsDefinition InputValueDefinition InterfaceTypeDefinition InterfaceKeyword interface UnionTypeDefinition UnionKeyword union UnionMemberTypes EnumTypeDefinition EnumKeyword enum EnumValuesDefinition EnumValueDefinition InputObjectTypeDefinition InputKeyword input InputFieldsDefinition DirectiveDefinition DirectiveKeyword directive RepeatableKeyword repeatable DirectiveLocations DirectiveLocation ExecutableDirectiveLocation TypeSystemDirectiveLocation TypeSystemExtension SchemaExtension ExtendKeyword extend TypeExtension ScalarTypeExtension ObjectTypeExtension InterfaceTypeExtension UnionTypeExtension EnumTypeExtension InputObjectTypeExtension",maxTerm:156,nodeProps:[["openedBy",6,"(",12,"[",24,"{"],["closedBy",7,")",13,"]",25,"}"]],skippedNodes:[0,1],repeatNodeCount:10,tokenData:"#Ci~R!XX^$npq$nqr%crs%hst4ptu4{vw5jxy5oyz5t|}5y}!O6O!O!P7g!Q![6U![!]7x!_!`7}!b!c8S!c!d8q!d!g9[!g!hCZ!h!iHd!i!k9[!k!l!/v!l!o9[!o!p!Id!p!q9[!q!r!Mm!r!s9[!s!t#!u!t!u9[!u!v#%d!v!w9[!w!x#0n!x!y#3]!y!}9[!}#O#=[#P#Q#=a#R#S9[#T#Y9[#Y#Z#=f#Z#b9[#b#c#@Q#c#h9[#h#i#BU#i#o9[#o#p#CY#p#q#C_#q#r#Cd#y#z$n$f$g$n#BY#BZ$n$IS$I_$n$I|$JO$n$JT$JU$n$KV$KW$n&FU&FV$n~$sY#h~X^$npq$n#y#z$n$f$g$n#BY#BZ$n$IS$I_$n$I|$JO$n$JT$JU$n$KV$KW$n&FU&FV$n~%hO#q~~%kVOY&QZ]&Q^r&Qrs(as#O&Q#O#P&o#P~&Q~&TVOY&QZ]&Q^r&Qrs&js#O&Q#O#P&o#P~&Q~&oOc~~&rXrs&Q!P!Q&Q#O#P&Q#U#V&Q#Y#Z&Q#b#c&Q#f#g&Q#h#i&Q#i#j'_~'bR!QX^r(irs)_s#O(i#O#P)w#P~(i~)[PYZ(i~)bROr(irs)ks~(i~)nROr(irs&js~(i~)zXrs*g!P!Q(i#O#P(i#U#V(i#Y#Z(i#b#c(i#f#g(i#h#i(i#i#j3n~*jXOY(iYZ(iZ](i]^)X^r(irs+Vs#O(i#O#P)w#P~(i~+YROr(irs+cs~(i~+fXOY(iYZ(iZ](i]^(i^r(irs,Rs#O(i#O#P,a#P~(i~,WRc~Or(irs)ks~(i~,dfOY(iYZ(iZ](i]^)X^r(irs-xs!P(i!P!Q(i!Q#O(i#O#P,a#P#U(i#U#V(i#V#Y(i#Y#Z(i#Z#b(i#b#c(i#c#f(i#f#g(i#g#h(i#h#i(i#i#j/f#j~(i~-{XOY(iYZ(iZ](i]^(i^r(irs.hs#O(i#O#P,a#P~(i~.kROr(irs.ts~(i~.yXc~OY(iYZ(iZ](i]^(i^r(irs,Rs#O(i#O#P,a#P~(i~/i_OY(iYZ(iZ](i]^)X^r(irs)_s!Q(i!QX^r(irs)_s!Q(i!QX^r(irs)_s!Q(i!QX^r(irs)_s!Q(i!Q![(i![!c(i!c!i(i!i#O(i#O#P)w#P#T(i#T#Z(i#Z~(i~3qR!Q![3z!c!i3z#T#Z3z~3}R!Q![4W!c!i4W#T#Z4W~4ZR!Q![4d!c!i4d#T#Z4d~4gR!Q![(i!c!i(i#T#Z(i~4uQP~OY4pZ~4p~5OR!c!}5X#R#S5X#T#o5X~5^SY~!Q![5X!c!}5X#R#S5X#T#o5X~5oO#y~~5tOV~~5yOU~~6OO#t~~6RP!Q![6U~6ZSa~!O!P6g!Q![6U!g!h6{#X#Y6{~6jP!Q![6m~6rRb~!Q![6m!g!h6{#X#Y6{~7OR{|7X}!O7X!Q![7_~7[P!Q![7_~7dPb~!Q![7_~7jP!O!P7m~7pP!O!P7s~7xO#v~~7}O#o~~8SO#r~~8VR!c!}8`#R#S8`#T#o8`~8eSm~!Q![8`!c!}8`#R#S8`#T#o8`V8xU#kPfQ!Q![9[!c!t9[!t!u9o!u!}9[#R#S9[#T#o9[R9cS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V9vU#kPfQ!Q![9[!c!i9[!i!j:Y!j!}9[#R#S9[#T#o9[V:aU#kPfQ!Q![9[!c!w9[!w!x:s!x!}9[#R#S9[#T#o9[V:zU#kPfQ!Q![9[!c!o9[!o!p;^!p!}9[#R#S9[#T#o9[V;eU#kPfQ!Q![9[!c!g9[!g!h;w!h!}9[#R#S9[#T#o9[V<OU#kPfQ!Q![9[!c!p9[!p!q<b!q!}9[#R#S9[#T#o9[V<iU#kPfQ!Q![9[!c!v9[!v!w<{!w!}9[#R#S9[#T#o9[V=SS#kPfQ!Q![9[!c!}9[#R#S=`#T#o9[V=gU#kPfQ!Q![9[!c!f9[!f!g=y!g!}9[#R#S9[#T#o9[V>QU#kPfQ!Q![9[!c!g9[!g!h>d!h!}9[#R#S9[#T#o9[V>kU#kPfQ!Q![9[!c!h9[!h!i>}!i!}9[#R#S9[#T#o9[V?UU#kPfQ!Q![9[!c!k9[!k!l?h!l!}9[#R#S9[#T#o9[V?oU#kPfQ!Q![9[!c!p9[!p!q@R!q!}9[#R#S9[#T#o9[V@YU#kPfQ!Q![9[!c!k9[!k!l@l!l!}9[#R#S9[#T#o9[V@sU#kPfQ!Q![9[!c!v9[!v!wAV!w!}9[#R#S9[#T#o9[VA^U#kPfQ!Q![9[!c!k9[!k!lAp!l!}9[#R#S9[#T#o9[VAwU#kPfQ!Q![9[!c!q9[!q!rBZ!r!}9[#R#S9[#T#o9[VBbU#kPfQ!Q![9[!c!p9[!p!qBt!q!}9[#R#S9[#T#o9[VB}S$[S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[VCbU#kPfQ!Q![9[!c!p9[!p!qCt!q!}9[#R#S9[#T#o9[VC{U#kPfQ!Q![9[!c!w9[!w!xD_!x!}9[#R#S9[#T#o9[VDfU#kPfQ!Q![9[!c!o9[!o!pDx!p!}9[#R#S9[#T#o9[VERS$_S#kPfQ!Q![9[!c!}9[#R#SE_#T#o9[VEfU#kPfQ!Q![9[!c!x9[!x!yEx!y!}9[#R#S9[#T#o9[VFPT#kPfQ!Q![9[!c!dF`!d!}9[#R#S9[#T#o9[VFgU#kPfQ!Q![9[!c!n9[!n!oFy!o!}9[#R#S9[#T#o9[VGQU#kPfQ!Q![9[!c!w9[!w!xGd!x!}9[#R#S9[#T#o9[VGkU#kPfQ!Q![9[!c!g9[!g!hG}!h!}9[#R#S9[#T#o9[VHWS$`S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[VHkW#kPfQ!Q![9[!c!k9[!k!lIT!l!t9[!t!u!#S!u!}9[#R#S9[#T#o9[VI[U#kPfQ!Q![9[!c!g9[!g!hIn!h!}9[#R#S9[#T#o9[VIuU#kPfQ!Q![9[!c!n9[!n!oJX!o!}9[#R#S9[#T#o9[VJ`U#kPfQ!Q![9[!c!f9[!f!gJr!g!}9[#R#S9[#T#o9[VJ{S$RS#kPfQ!Q![9[!c!}9[#R#SKX#T#o9[VK`U#kPfQ!Q![9[!c!f9[!f!gKr!g!}9[#R#S9[#T#o9[VKyU#kPfQ!Q![9[!c!g9[!g!hL]!h!}9[#R#S9[#T#o9[VLdU#kPfQ!Q![9[!c!h9[!h!iLv!i!}9[#R#S9[#T#o9[VL}U#kPfQ!Q![9[!c!k9[!k!lMa!l!}9[#R#S9[#T#o9[VMhU#kPfQ!Q![9[!c!p9[!p!qMz!q!}9[#R#S9[#T#o9[VNRU#kPfQ!Q![9[!c!k9[!k!lNe!l!}9[#R#S9[#T#o9[VNlU#kPfQ!Q![9[!c!v9[!v!w! O!w!}9[#R#S9[#T#o9[V! VU#kPfQ!Q![9[!c!k9[!k!l! i!l!}9[#R#S9[#T#o9[V! pU#kPfQ!Q![9[!c!q9[!q!r!!S!r!}9[#R#S9[#T#o9[V!!ZU#kPfQ!Q![9[!c!p9[!p!q!!m!q!}9[#R#S9[#T#o9[V!!vS$ZS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!#ZT#kPfQ!Q![9[!c!d!#j!d!}9[#R#S9[#T#o9[V!#qU#kPfQ!Q![9[!c!i9[!i!j!$T!j!}9[#R#S9[#T#o9[V!$[U#kPfQ!Q![9[!c!o9[!o!p!$n!p!}9[#R#S9[#T#o9[V!$uU#kPfQ!Q![9[!c!g9[!g!h!%X!h!}9[#R#S9[#T#o9[V!%`U#kPfQ!Q![9[!c!p9[!p!q!%r!q!}9[#R#S9[#T#o9[V!%yU#kPfQ!Q![9[!c!v9[!v!w!&]!w!}9[#R#S9[#T#o9[V!&dS#kPfQ!Q![9[!c!}9[#R#S!&p#T#o9[V!&wW#kPfQ!Q![9[!c!f9[!f!g!'a!g!u9[!u!v!,q!v!}9[#R#S9[#T#o9[V!'hU#kPfQ!Q![9[!c!g9[!g!h!'z!h!}9[#R#S9[#T#o9[V!(RU#kPfQ!Q![9[!c!h9[!h!i!(e!i!}9[#R#S9[#T#o9[V!(lU#kPfQ!Q![9[!c!k9[!k!l!)O!l!}9[#R#S9[#T#o9[V!)VU#kPfQ!Q![9[!c!p9[!p!q!)i!q!}9[#R#S9[#T#o9[V!)pU#kPfQ!Q![9[!c!k9[!k!l!*S!l!}9[#R#S9[#T#o9[V!*ZU#kPfQ!Q![9[!c!v9[!v!w!*m!w!}9[#R#S9[#T#o9[V!*tU#kPfQ!Q![9[!c!k9[!k!l!+W!l!}9[#R#S9[#T#o9[V!+_U#kPfQ!Q![9[!c!q9[!q!r!+q!r!}9[#R#S9[#T#o9[V!+xU#kPfQ!Q![9[!c!p9[!p!q!,[!q!}9[#R#S9[#T#o9[V!,eS$SS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!,xU#kPfQ!Q![9[!c!r9[!r!s!-[!s!}9[#R#S9[#T#o9[V!-cU#kPfQ!Q![9[!c!t9[!t!u!-u!u!}9[#R#S9[#T#o9[V!-|U#kPfQ!Q![9[!c!g9[!g!h!.`!h!}9[#R#S9[#T#o9[V!.gT#kPfQ!Q![9[!c!d!.v!d!}9[#R#S9[#T#o9[V!.}U#kPfQ!Q![9[!c!f9[!f!g!/a!g!}9[#R#S9[#T#o9[V!/jS$TS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!/}U#kPfQ!Q![9[!c!p9[!p!q!0a!q!}9[#R#S9[#T#o9[V!0hY#kPfQ!Q![9[!c!n9[!n!o!1W!o!r9[!r!s!7|!s!v9[!v!w!Et!w!}9[#R#S9[#T#o9[V!1_U#kPfQ!Q![9[!c!k9[!k!l!1q!l!}9[#R#S9[#T#o9[V!1xU#kPfQ!Q![9[!c!p9[!p!q!2[!q!}9[#R#S9[#T#o9[V!2cU#kPfQ!Q![9[!c!g9[!g!h!2u!h!}9[#R#S9[#T#o9[V!2|S#kPfQ!Q![9[!c!}9[#R#S!3Y#T#o9[V!3aU#kPfQ!Q![9[!c!h9[!h!i!3s!i!}9[#R#S9[#T#o9[V!3zU#kPfQ!Q![9[!c!t9[!t!u!4^!u!}9[#R#S9[#T#o9[V!4eT#kPfQ!Q![9[!c!d!4t!d!}9[#R#S9[#T#o9[V!4{U#kPfQ!Q![9[!c!i9[!i!j!5_!j!}9[#R#S9[#T#o9[V!5fU#kPfQ!Q![9[!c!o9[!o!p!5x!p!}9[#R#S9[#T#o9[V!6PU#kPfQ!Q![9[!c!g9[!g!h!6c!h!}9[#R#S9[#T#o9[V!6jU#kPfQ!Q![9[!c!p9[!p!q!6|!q!}9[#R#S9[#T#o9[V!7TU#kPfQ!Q![9[!c!v9[!v!w!7g!w!}9[#R#S9[#T#o9[V!7pS$US#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!8TU#kPfQ!Q![9[!c!w9[!w!x!8g!x!}9[#R#S9[#T#o9[V!8nU#kPfQ!Q![9[!c!v9[!v!w!9Q!w!}9[#R#S9[#T#o9[V!9XS#kPfQ!Q![9[!c!}9[#R#S!9e#T#o9[V!9lW#kPfQ!Q![9[!c!h9[!h!i!:U!i!q9[!q!r!Bl!r!}9[#R#S9[#T#o9[V!:]U#kPfQ!Q![9[!c!k9[!k!l!:o!l!}9[#R#S9[#T#o9[V!:vU#kPfQ!Q![9[!c!g9[!g!h!;Y!h!}9[#R#S9[#T#o9[V!;aU#kPfQ!Q![9[!c!n9[!n!o!;s!o!}9[#R#S9[#T#o9[V!;zU#kPfQ!Q![9[!c!f9[!f!g!<^!g!}9[#R#S9[#T#o9[V!<eS#kPfQ!Q![9[!c!}9[#R#S!<q#T#o9[V!<xU#kPfQ!Q![9[!c!f9[!f!g!=[!g!}9[#R#S9[#T#o9[V!=cU#kPfQ!Q![9[!c!g9[!g!h!=u!h!}9[#R#S9[#T#o9[V!=|U#kPfQ!Q![9[!c!h9[!h!i!>`!i!}9[#R#S9[#T#o9[V!>gU#kPfQ!Q![9[!c!k9[!k!l!>y!l!}9[#R#S9[#T#o9[V!?QU#kPfQ!Q![9[!c!p9[!p!q!?d!q!}9[#R#S9[#T#o9[V!?kU#kPfQ!Q![9[!c!k9[!k!l!?}!l!}9[#R#S9[#T#o9[V!@UU#kPfQ!Q![9[!c!v9[!v!w!@h!w!}9[#R#S9[#T#o9[V!@oU#kPfQ!Q![9[!c!k9[!k!l!AR!l!}9[#R#S9[#T#o9[V!AYU#kPfQ!Q![9[!c!q9[!q!r!Al!r!}9[#R#S9[#T#o9[V!AsU#kPfQ!Q![9[!c!p9[!p!q!BV!q!}9[#R#S9[#T#o9[V!B`S$bS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!BsU#kPfQ!Q![9[!c!d9[!d!e!CV!e!}9[#R#S9[#T#o9[V!C^U#kPfQ!Q![9[!c!l9[!l!m!Cp!m!}9[#R#S9[#T#o9[V!CwU#kPfQ!Q![9[!c!g9[!g!h!DZ!h!}9[#R#S9[#T#o9[V!DbU#kPfQ!Q![9[!c!e9[!e!f!Dt!f!}9[#R#S9[#T#o9[V!D{U#kPfQ!Q![9[!c!v9[!v!w!E_!w!}9[#R#S9[#T#o9[V!EhS$aS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!E{U#kPfQ!Q![9[!c!g9[!g!h!F_!h!}9[#R#S9[#T#o9[V!FfU#kPfQ!Q![9[!c!t9[!t!u!Fx!u!}9[#R#S9[#T#o9[V!GPU#kPfQ!Q![9[!c!h9[!h!i!Gc!i!}9[#R#S9[#T#o9[V!GjT#kPfQ!Q![9[!c!d!Gy!d!}9[#R#S9[#T#o9[V!HQU#kPfQ!Q![9[!c!e9[!e!f!Hd!f!}9[#R#S9[#T#o9[V!HkU#kPfQ!Q![9[!c!g9[!g!h!H}!h!}9[#R#S9[#T#o9[V!IWS$]S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!IkU#kPfQ!Q![9[!c!w9[!w!x!I}!x!}9[#R#S9[#T#o9[V!JUU#kPfQ!Q![9[!c!v9[!v!w!Jh!w!}9[#R#S9[#T#o9[V!JoT#kPfQ!Q![9[!c!d!KO!d!}9[#R#S9[#T#o9[V!KVU#kPfQ!Q![9[!c!v9[!v!w!Ki!w!}9[#R#S9[#T#o9[V!KpU#kPfQ!Q![9[!c!k9[!k!l!LS!l!}9[#R#S9[#T#o9[V!LZU#kPfQ!Q![9[!c!q9[!q!r!Lm!r!}9[#R#S9[#T#o9[V!LtU#kPfQ!Q![9[!c!p9[!p!q!MW!q!}9[#R#S9[#T#o9[V!MaS$PS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!MtU#kPfQ!Q![9[!c!d9[!d!e!NW!e!}9[#R#S9[#T#o9[V!N_U#kPfQ!Q![9[!c!l9[!l!m!Nq!m!}9[#R#S9[#T#o9[V!NxU#kPfQ!Q![9[!c!g9[!g!h# [!h!}9[#R#S9[#T#o9[V# cU#kPfQ!Q![9[!c!e9[!e!f# u!f!}9[#R#S9[#T#o9[V# |U#kPfQ!Q![9[!c!v9[!v!w#!`!w!}9[#R#S9[#T#o9[V#!iS$YS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#!|U#kPfQ!Q![9[!c!w9[!w!x##`!x!}9[#R#S9[#T#o9[V##gU#kPfQ!Q![9[!c!g9[!g!h##y!h!}9[#R#S9[#T#o9[V#$QU#kPfQ!Q![9[!c!t9[!t!u#$d!u!}9[#R#S9[#T#o9[V#$kU#kPfQ!Q![9[!c!{9[!{!|#$}!|!}9[#R#S9[#T#o9[V#%WS$OS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#%kW#kPfQ!Q![9[!c!e9[!e!f#&T!f!w9[!w!x#*s!x!}9[#R#S9[#T#o9[V#&[V#kPfQ!Q![9[!c!d#&q!d!j9[!j!k#(r!k!}9[#R#S9[#T#o9[V#&xU#kPfQ!Q![9[!c!n9[!n!o#'[!o!}9[#R#S9[#T#o9[V#'cT#kPfQ!Q![9[!c!d#'r!d!}9[#R#S9[#T#o9[V#'yU#kPfQ!Q![9[!c!t9[!t!u#(]!u!}9[#R#S9[#T#o9[V#(fS$XS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#(yU#kPfQ!Q![9[!c!g9[!g!h#)]!h!}9[#R#S9[#T#o9[V#)dU#kPfQ!Q![9[!c!o9[!o!p#)v!p!}9[#R#S9[#T#o9[V#)}T#kPfQ!Q![9[!c!d#*^!d!}9[#R#S9[#T#o9[V#*gS$WS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#*zU#kPfQ!Q![9[!c!d9[!d!e#+^!e!}9[#R#S9[#T#o9[V#+eU#kPfQ!Q![9[!c!u9[!u!v#+w!v!}9[#R#S9[#T#o9[V#,OU#kPfQ!Q![9[!c!e9[!e!f#,b!f!}9[#R#S9[#T#o9[V#,iU#kPfQ!Q![9[!c!t9[!t!u#,{!u!}9[#R#S9[#T#o9[V#-SU#kPfQ!Q![9[!c!k9[!k!l#-f!l!}9[#R#S9[#T#o9[V#-mU#kPfQ!Q![9[!c!r9[!r!s#.P!s!}9[#R#S9[#T#o9[V#.WU#kPfQ!Q![9[!c!v9[!v!w#.j!w!}9[#R#S9[#T#o9[V#.qU#kPfQ!Q![9[!c!k9[!k!l#/T!l!}9[#R#S9[#T#o9[V#/[U#kPfQ!Q![9[!c!q9[!q!r#/n!r!}9[#R#S9[#T#o9[V#/uU#kPfQ!Q![9[!c!p9[!p!q#0X!q!}9[#R#S9[#T#o9[V#0bS$QS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#0uU#kPfQ!Q![9[!c!p9[!p!q#1X!q!}9[#R#S9[#T#o9[V#1`U#kPfQ!Q![9[!c!k9[!k!l#1r!l!}9[#R#S9[#T#o9[V#1yU#kPfQ!Q![9[!c!q9[!q!r#2]!r!}9[#R#S9[#T#o9[V#2dU#kPfQ!Q![9[!c!p9[!p!q#2v!q!}9[#R#S9[#T#o9[V#3PS$^S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#3dT#kPfQ!Q![9[!c!d#3s!d!}9[#R#S9[#T#o9[V#3zU#kPfQ!Q![9[!c!t9[!t!u#4^!u!}9[#R#S9[#T#o9[V#4eU#kPfQ!Q![9[!c!k9[!k!l#4w!l!}9[#R#S9[#T#o9[V#5OT#kPfQ!Q![9[!c!d#5_!d!}9[#R#S9[#T#o9[V#5fU#kPfQ!Q![9[!c!d9[!d!e#5x!e!}9[#R#S9[#T#o9[V#6PU#kPfQ!Q![9[!c!n9[!n!o#6c!o!}9[#R#S9[#T#o9[V#6jU#kPfQ!Q![9[!c!g9[!g!h#6|!h!}9[#R#S9[#T#o9[V#7TS#kPfQ!Q![9[!c!}9[#R#S#7a#T#o9[V#7hU#kPfQ!Q![9[!c!f9[!f!g#7z!g!}9[#R#S9[#T#o9[V#8RU#kPfQ!Q![9[!c!g9[!g!h#8e!h!}9[#R#S9[#T#o9[V#8lU#kPfQ!Q![9[!c!h9[!h!i#9O!i!}9[#R#S9[#T#o9[V#9VU#kPfQ!Q![9[!c!k9[!k!l#9i!l!}9[#R#S9[#T#o9[V#9pU#kPfQ!Q![9[!c!p9[!p!q#:S!q!}9[#R#S9[#T#o9[V#:ZU#kPfQ!Q![9[!c!k9[!k!l#:m!l!}9[#R#S9[#T#o9[V#:tU#kPfQ!Q![9[!c!v9[!v!w#;W!w!}9[#R#S9[#T#o9[V#;_U#kPfQ!Q![9[!c!k9[!k!l#;q!l!}9[#R#S9[#T#o9[V#;xU#kPfQ!Q![9[!c!q9[!q!r#<[!r!}9[#R#S9[#T#o9[V#<cU#kPfQ!Q![9[!c!p9[!p!q#<u!q!}9[#R#S9[#T#o9[V#=OS$VS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[~#=aO]~~#=fO[~R#=mT#kPfQ!Q![9[!c!}9[#R#S9[#T#U#=|#U#o9[R#>TU#kPfQ!Q![9[!c!}9[#R#S9[#T#`9[#`#a#>g#a#o9[R#>nU#kPfQ!Q![9[!c!}9[#R#S9[#T#g9[#g#h#?Q#h#o9[R#?XU#kPfQ!Q![9[!c!}9[#R#S9[#T#X9[#X#Y#?k#Y#o9[R#?tS#kPdQfQ!Q![9[!c!}9[#R#S9[#T#o9[R#@XU#kPfQ!Q![9[!c!}9[#R#S9[#T#i9[#i#j#@k#j#o9[R#@rU#kPfQ!Q![9[!c!}9[#R#S9[#T#`9[#`#a#AU#a#o9[R#A]U#kPfQ!Q![9[!c!}9[#R#S9[#T#`9[#`#a#Ao#a#o9[R#AxS#kPeQfQ!Q![9[!c!}9[#R#S9[#T#o9[R#B]U#kPfQ!Q![9[!c!}9[#R#S9[#T#f9[#f#g#Bo#g#o9[R#BvU#kPfQ!Q![9[!c!}9[#R#S9[#T#i9[#i#j#?Q#j#o9[~#C_Oi~~#CdO#{~~#CiOh~",tokenizers:[0,1,2],topRules:{Document:[0,2]},specialized:[{term:119,get:vo=>spec_name[vo]||-1}],tokenPrec:2989}),nodesWithBraces="RootTypeDefinition InputFieldsDefinition EnumValuesDefinition FieldsDefinition SelectionSet { }",keywords="scalar type interface union enum input implements fragment extend schema directive on repeatable",punctuations="( ) { } : [ ]",graphqlLanguage=LRLanguage.define({parser:parser$1.configure({props:[styleTags({Variable:tags.variableName,BooleanValue:tags.bool,Description:tags.string,StringValue:tags.string,Comment:tags.lineComment,IntValue:tags.integer,FloatValue:tags.float,EnumValue:tags.special(tags.name),NullValue:tags.null,DirectiveName:tags.modifier,[keywords]:tags.keyword,OperationType:tags.definitionKeyword,FieldName:tags.propertyName,Field:tags.propertyName,ArgumentAttributeName:tags.attributeName,Name:tags.atom,"( )":tags.paren,"{ }":tags.brace,",":tags.separator,[punctuations]:tags.punctuation}),indentNodeProp.add({[nodesWithBraces]:delimitedIndent({closing:"}",align:!0})}),foldNodeProp.add({[nodesWithBraces]:foldInside})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*(\{|\})$/}});function graphqlLanguageSupport(){return new LanguageSupport(graphqlLanguage)}const AUTOCOMPLETE_CHARS=/^[a-zA-Z0-9_@(]$/,completion=graphqlLanguage.data.of({autocomplete(vo){const Ai=getSchema(vo.state),bo=getOpts(vo.state);if(!Ai)return null;const Ra=vo.matchBefore(/\w*/);if(!Ra)return null;const hc=Ra.text.split("").pop();if(!AUTOCOMPLETE_CHARS.test(hc)&&!vo.explicit)return null;const pc=vo.state.doc.toString(),mc=offsetToPos(vo.state.doc,vo.pos),uf=getAutocompleteSuggestions(Ai,pc,mc,void 0,void 0,bo==null?void 0:bo.autocompleteOptions);return uf.length===0?null:{from:Ra.from,options:uf.map(df=>({label:df.label,detail:df.detail||"",info(ff){if(bo!=null&&bo.onCompletionInfoRender)return bo.onCompletionInfoRender(df,vo,ff);if(df.documentation||df.isDeprecated&&df.deprecationReason){const hf=document.createElement("div");return hf.textContent=df.documentation||df.deprecationReason||"",hf}}}))}}}),jump=EditorView.domEventHandlers({click(vo,Ai){var bo,Ra,hc;const pc=getSchema(Ai.state);if(!pc)return;const mc=Ai.state.selection.main.head,uf=offsetToPos(Ai.state.doc,mc),df=getTokenAtPosition(Ai.state.doc.toString(),uf),ff=getTypeInfo(pc,df.state),hf=getOpts(Ai.state);hf!=null&&hf.onShowInDocs&&isMetaKeyPressed(vo)&&hf.onShowInDocs((bo=ff.fieldDef)===null||bo===void 0?void 0:bo.name,(Ra=ff.type)===null||Ra===void 0?void 0:Ra.toString(),(hc=ff.parentType)===null||hc===void 0?void 0:hc.toString())}}),SEVERITY=["error","warning","info"],lint=linter(vo=>{const Ai=getSchema(vo.state),bo=getOpts(vo.state);if(!Ai)return[];const Ra=validateSchema(Ai);if(Ra.length){if(!(bo!=null&&bo.showErrorOnInvalidSchema))return[];const hc=Ra.map(pc=>pc.message);return[{from:0,to:vo.state.doc.length,severity:"error",message:hc.join(`
|
|
368
|
-
`),actions:[]}]}return getDiagnostics(vo.state.doc.toString(),Ai).map(hc=>{if(!hc.severity||!hc.source)return null;const pc=posToOffset(vo.state.doc,new Position(hc.range.start.line,hc.range.start.character)),mc=Math.max(0,Math.min(pc,vo.state.doc.length)),uf=posToOffset(vo.state.doc,new Position(hc.range.end.line,hc.range.end.character-1)),df=Math.min(Math.max(mc+1,uf),vo.state.doc.length);return{from:mc,to:mc===df?df+1:df,severity:SEVERITY[hc.severity-1],message:hc.message,actions:[]}}).filter(hc=>!!hc)},{needsRefresh(vo){return vo.startState.field(schemaStateField)!==vo.state.field(schemaStateField)||vo.startState.field(optionsStateField)!==vo.state.field(optionsStateField)}});function graphql(vo,Ai){return[graphqlLanguageSupport(),completion,lint,jump,stateExtensions(vo,Ai)]}const hiddenQueryTypeDefDoc=`type Query {
|
|
369
|
-
_hidden: String
|
|
370
|
-
}
|
|
371
|
-
`,typeDefsDoc=typeDefs.join(`
|
|
372
|
-
`),initialSchemaDoc=`${hiddenQueryTypeDefDoc}
|
|
373
|
-
${typeDefsDoc}`,initialSchema=buildSchema(initialSchemaDoc),updateTimeout=5e3;function isURL(vo){try{return!!new URL(vo)}catch{return!1}}const asArray=vo=>Array.isArray(vo)?vo:vo?[vo]:[],invalidDocRegex=/\.[a-z0-9]+$/i;function isDocumentString(vo){if(typeof vo!="string"||invalidDocRegex.test(vo)||isURL(vo))return!1;try{return parse(vo),!0}catch(Ai){if(!Ai.message.includes("EOF")&&vo.replace(/(\#[^*]*)/g,"").trim()!==""&&vo.includes(" "))throw new Error(`Failed to parse the GraphQL document. ${Ai.message}
|
|
374
|
-
${vo}`)}return!1}function createDefaultRules(){let vo=["NoUnusedFragmentsRule","NoUnusedVariablesRule","KnownDirectivesRule"];return versionInfo.major<15&&(vo=vo.map(Ai=>Ai.replace(/Rule$/,""))),specifiedRules.filter(Ai=>!vo.includes(Ai.name))}var MapperKind;(function(vo){vo.TYPE="MapperKind.TYPE",vo.SCALAR_TYPE="MapperKind.SCALAR_TYPE",vo.ENUM_TYPE="MapperKind.ENUM_TYPE",vo.COMPOSITE_TYPE="MapperKind.COMPOSITE_TYPE",vo.OBJECT_TYPE="MapperKind.OBJECT_TYPE",vo.INPUT_OBJECT_TYPE="MapperKind.INPUT_OBJECT_TYPE",vo.ABSTRACT_TYPE="MapperKind.ABSTRACT_TYPE",vo.UNION_TYPE="MapperKind.UNION_TYPE",vo.INTERFACE_TYPE="MapperKind.INTERFACE_TYPE",vo.ROOT_OBJECT="MapperKind.ROOT_OBJECT",vo.QUERY="MapperKind.QUERY",vo.MUTATION="MapperKind.MUTATION",vo.SUBSCRIPTION="MapperKind.SUBSCRIPTION",vo.DIRECTIVE="MapperKind.DIRECTIVE",vo.FIELD="MapperKind.FIELD",vo.COMPOSITE_FIELD="MapperKind.COMPOSITE_FIELD",vo.OBJECT_FIELD="MapperKind.OBJECT_FIELD",vo.ROOT_FIELD="MapperKind.ROOT_FIELD",vo.QUERY_ROOT_FIELD="MapperKind.QUERY_ROOT_FIELD",vo.MUTATION_ROOT_FIELD="MapperKind.MUTATION_ROOT_FIELD",vo.SUBSCRIPTION_ROOT_FIELD="MapperKind.SUBSCRIPTION_ROOT_FIELD",vo.INTERFACE_FIELD="MapperKind.INTERFACE_FIELD",vo.INPUT_OBJECT_FIELD="MapperKind.INPUT_OBJECT_FIELD",vo.ARGUMENT="MapperKind.ARGUMENT",vo.ENUM_VALUE="MapperKind.ENUM_VALUE"})(MapperKind||(MapperKind={}));function getObjectTypeFromTypeMap(vo,Ai){if(Ai){const bo=vo[Ai.name];if(isObjectType(bo))return bo}}function isNamedStub(vo){if("getFields"in vo){const Ai=vo.getFields();for(const bo in Ai)return Ai[bo].name==="_fake"}return!1}function getBuiltInForStub(vo){switch(vo.name){case GraphQLInt.name:return GraphQLInt;case GraphQLFloat.name:return GraphQLFloat;case GraphQLString.name:return GraphQLString;case GraphQLBoolean.name:return GraphQLBoolean;case GraphQLID.name:return GraphQLID;default:return vo}}function rewireTypes(vo,Ai){const bo=Object.create(null);for(const mf in vo)bo[mf]=vo[mf];const Ra=Object.create(null);for(const mf in bo){const gf=bo[mf];if(gf==null||mf.startsWith("__"))continue;const yf=gf.name;if(!yf.startsWith("__")){if(Ra[yf]!=null){console.warn(`Duplicate schema type name ${yf} found; keeping the existing one found in the schema`);continue}Ra[yf]=gf}}for(const mf in Ra)Ra[mf]=uf(Ra[mf]);const hc=Ai.map(mf=>pc(mf));return{typeMap:Ra,directives:hc};function pc(mf){if(isSpecifiedDirective(mf))return mf;const gf=mf.toConfig();return gf.args=mc(gf.args),new GraphQLDirective(gf)}function mc(mf){const gf={};for(const yf in mf){const vf=mf[yf],bf=pf(vf.type);bf!=null&&(vf.type=bf,gf[yf]=vf)}return gf}function uf(mf){if(isObjectType(mf)){const gf=mf.toConfig(),yf={...gf,fields:()=>df(gf.fields),interfaces:()=>hf(gf.interfaces)};return new GraphQLObjectType(yf)}else if(isInterfaceType(mf)){const gf=mf.toConfig(),yf={...gf,fields:()=>df(gf.fields)};return"interfaces"in yf&&(yf.interfaces=()=>hf(gf.interfaces)),new GraphQLInterfaceType(yf)}else if(isUnionType(mf)){const gf=mf.toConfig(),yf={...gf,types:()=>hf(gf.types)};return new GraphQLUnionType(yf)}else if(isInputObjectType(mf)){const gf=mf.toConfig(),yf={...gf,fields:()=>ff(gf.fields)};return new GraphQLInputObjectType(yf)}else if(isEnumType(mf)){const gf=mf.toConfig();return new GraphQLEnumType(gf)}else if(isScalarType(mf)){if(isSpecifiedScalarType(mf))return mf;const gf=mf.toConfig();return new GraphQLScalarType(gf)}throw new Error(`Unexpected schema type: ${mf}`)}function df(mf){const gf={};for(const yf in mf){const vf=mf[yf],bf=pf(vf.type);bf!=null&&vf.args&&(vf.type=bf,vf.args=mc(vf.args),gf[yf]=vf)}return gf}function ff(mf){const gf={};for(const yf in mf){const vf=mf[yf],bf=pf(vf.type);bf!=null&&(vf.type=bf,gf[yf]=vf)}return gf}function hf(mf){const gf=[];for(const yf of mf){const vf=pf(yf);vf!=null&&gf.push(vf)}return gf}function pf(mf){if(isListType(mf)){const gf=pf(mf.ofType);return gf!=null?new GraphQLList(gf):null}else if(isNonNullType(mf)){const gf=pf(mf.ofType);return gf!=null?new GraphQLNonNull(gf):null}else if(isNamedType(mf)){let gf=bo[mf.name];return gf===void 0&&(gf=isNamedStub(mf)?getBuiltInForStub(mf):uf(mf),Ra[gf.name]=bo[mf.name]=gf),gf!=null?Ra[gf.name]:null}return null}}function transformInputValue(vo,Ai,bo=null,Ra=null){if(Ai==null)return Ai;const hc=getNullableType(vo);if(isLeafType(hc))return bo!=null?bo(hc,Ai):Ai;if(isListType(hc))return asArray(Ai).map(pc=>transformInputValue(hc.ofType,pc,bo,Ra));if(isInputObjectType(hc)){const pc=hc.getFields(),mc={};for(const uf in Ai){const df=pc[uf];df!=null&&(mc[uf]=transformInputValue(df.type,Ai[uf],bo,Ra))}return Ra!=null?Ra(hc,mc):mc}}function serializeInputValue(vo,Ai){return transformInputValue(vo,Ai,(bo,Ra)=>{try{return bo.serialize(Ra)}catch{return Ra}})}function parseInputValue(vo,Ai){return transformInputValue(vo,Ai,(bo,Ra)=>{try{return bo.parseValue(Ra)}catch{return Ra}})}function mapSchema(vo,Ai={}){const bo=mapArguments(mapFields(mapTypes(mapDefaultValues(mapEnumValues(mapTypes(mapDefaultValues(vo.getTypeMap(),vo,serializeInputValue),vo,Ai,uf=>isLeafType(uf)),vo,Ai),vo,parseInputValue),vo,Ai,uf=>!isLeafType(uf)),vo,Ai),vo,Ai),Ra=vo.getDirectives(),hc=mapDirectives(Ra,vo,Ai),{typeMap:pc,directives:mc}=rewireTypes(bo,hc);return new GraphQLSchema({...vo.toConfig(),query:getObjectTypeFromTypeMap(pc,getObjectTypeFromTypeMap(bo,vo.getQueryType())),mutation:getObjectTypeFromTypeMap(pc,getObjectTypeFromTypeMap(bo,vo.getMutationType())),subscription:getObjectTypeFromTypeMap(pc,getObjectTypeFromTypeMap(bo,vo.getSubscriptionType())),types:Object.values(pc),directives:mc})}function mapTypes(vo,Ai,bo,Ra=()=>!0){const hc={};for(const pc in vo)if(!pc.startsWith("__")){const mc=vo[pc];if(mc==null||!Ra(mc)){hc[pc]=mc;continue}const uf=getTypeMapper(Ai,bo,pc);if(uf==null){hc[pc]=mc;continue}const df=uf(mc,Ai);if(df===void 0){hc[pc]=mc;continue}hc[pc]=df}return hc}function mapEnumValues(vo,Ai,bo){const Ra=getEnumValueMapper(bo);return Ra?mapTypes(vo,Ai,{[MapperKind.ENUM_TYPE]:hc=>{const pc=hc.toConfig(),mc=pc.values,uf={};for(const df in mc){const ff=mc[df],hf=Ra(ff,hc.name,Ai,df);if(hf===void 0)uf[df]=ff;else if(Array.isArray(hf)){const[pf,mf]=hf;uf[pf]=mf===void 0?ff:mf}else hf!==null&&(uf[df]=hf)}return correctASTNodes(new GraphQLEnumType({...pc,values:uf}))}},hc=>isEnumType(hc)):vo}function mapDefaultValues(vo,Ai,bo){const Ra=mapArguments(vo,Ai,{[MapperKind.ARGUMENT]:hc=>{if(hc.defaultValue===void 0)return hc;const pc=getNewType(vo,hc.type);if(pc!=null)return{...hc,defaultValue:bo(pc,hc.defaultValue)}}});return mapFields(Ra,Ai,{[MapperKind.INPUT_OBJECT_FIELD]:hc=>{if(hc.defaultValue===void 0)return hc;const pc=getNewType(Ra,hc.type);if(pc!=null)return{...hc,defaultValue:bo(pc,hc.defaultValue)}}})}function getNewType(vo,Ai){if(isListType(Ai)){const bo=getNewType(vo,Ai.ofType);return bo!=null?new GraphQLList(bo):null}else if(isNonNullType(Ai)){const bo=getNewType(vo,Ai.ofType);return bo!=null?new GraphQLNonNull(bo):null}else if(isNamedType(Ai))return vo[Ai.name]??null;return null}function mapFields(vo,Ai,bo){const Ra={};for(const hc in vo)if(!hc.startsWith("__")){const pc=vo[hc];if(!isObjectType(pc)&&!isInterfaceType(pc)&&!isInputObjectType(pc)){Ra[hc]=pc;continue}const mc=getFieldMapper(Ai,bo,hc);if(mc==null){Ra[hc]=pc;continue}const uf=pc.toConfig(),df=uf.fields,ff={};for(const hf in df){const pf=df[hf],mf=mc(pf,hf,hc,Ai);if(mf===void 0)ff[hf]=pf;else if(Array.isArray(mf)){const[gf,yf]=mf;yf.astNode!=null&&(yf.astNode={...yf.astNode,name:{...yf.astNode.name,value:gf}}),ff[gf]=yf===void 0?pf:yf}else mf!==null&&(ff[hf]=mf)}isObjectType(pc)?Ra[hc]=correctASTNodes(new GraphQLObjectType({...uf,fields:ff})):isInterfaceType(pc)?Ra[hc]=correctASTNodes(new GraphQLInterfaceType({...uf,fields:ff})):Ra[hc]=correctASTNodes(new GraphQLInputObjectType({...uf,fields:ff}))}return Ra}function mapArguments(vo,Ai,bo){const Ra={};for(const hc in vo)if(!hc.startsWith("__")){const pc=vo[hc];if(!isObjectType(pc)&&!isInterfaceType(pc)){Ra[hc]=pc;continue}const mc=getArgumentMapper(bo);if(mc==null){Ra[hc]=pc;continue}const uf=pc.toConfig(),df=uf.fields,ff={};for(const hf in df){const pf=df[hf],mf=pf.args;if(mf==null){ff[hf]=pf;continue}const gf=Object.keys(mf);if(!gf.length){ff[hf]=pf;continue}const yf={};for(const vf of gf){const bf=mf[vf],Sf=mc(bf,hf,hc,Ai);if(Sf===void 0)yf[vf]=bf;else if(Array.isArray(Sf)){const[xf,wf]=Sf;yf[xf]=wf}else Sf!==null&&(yf[vf]=Sf)}ff[hf]={...pf,args:yf}}isObjectType(pc)?Ra[hc]=new GraphQLObjectType({...uf,fields:ff}):isInterfaceType(pc)?Ra[hc]=new GraphQLInterfaceType({...uf,fields:ff}):Ra[hc]=new GraphQLInputObjectType({...uf,fields:ff})}return Ra}function mapDirectives(vo,Ai,bo){const Ra=getDirectiveMapper(bo);if(Ra==null)return vo.slice();const hc=[];for(const pc of vo){const mc=Ra(pc,Ai);mc===void 0?hc.push(pc):mc!==null&&hc.push(mc)}return hc}function getTypeSpecifiers(vo,Ai){var bo,Ra,hc;const pc=vo.getType(Ai),mc=[MapperKind.TYPE];return isObjectType(pc)?(mc.push(MapperKind.COMPOSITE_TYPE,MapperKind.OBJECT_TYPE),Ai===((bo=vo.getQueryType())==null?void 0:bo.name)?mc.push(MapperKind.ROOT_OBJECT,MapperKind.QUERY):Ai===((Ra=vo.getMutationType())==null?void 0:Ra.name)?mc.push(MapperKind.ROOT_OBJECT,MapperKind.MUTATION):Ai===((hc=vo.getSubscriptionType())==null?void 0:hc.name)&&mc.push(MapperKind.ROOT_OBJECT,MapperKind.SUBSCRIPTION)):isInputObjectType(pc)?mc.push(MapperKind.INPUT_OBJECT_TYPE):isInterfaceType(pc)?mc.push(MapperKind.COMPOSITE_TYPE,MapperKind.ABSTRACT_TYPE,MapperKind.INTERFACE_TYPE):isUnionType(pc)?mc.push(MapperKind.COMPOSITE_TYPE,MapperKind.ABSTRACT_TYPE,MapperKind.UNION_TYPE):isEnumType(pc)?mc.push(MapperKind.ENUM_TYPE):isScalarType(pc)&&mc.push(MapperKind.SCALAR_TYPE),mc}function getTypeMapper(vo,Ai,bo){const Ra=getTypeSpecifiers(vo,bo);let hc;const pc=[...Ra];for(;!hc&&pc.length>0;){const mc=pc.pop();hc=Ai[mc]}return hc??null}function getFieldSpecifiers(vo,Ai){var bo,Ra,hc;const pc=vo.getType(Ai),mc=[MapperKind.FIELD];return isObjectType(pc)?(mc.push(MapperKind.COMPOSITE_FIELD,MapperKind.OBJECT_FIELD),Ai===((bo=vo.getQueryType())==null?void 0:bo.name)?mc.push(MapperKind.ROOT_FIELD,MapperKind.QUERY_ROOT_FIELD):Ai===((Ra=vo.getMutationType())==null?void 0:Ra.name)?mc.push(MapperKind.ROOT_FIELD,MapperKind.MUTATION_ROOT_FIELD):Ai===((hc=vo.getSubscriptionType())==null?void 0:hc.name)&&mc.push(MapperKind.ROOT_FIELD,MapperKind.SUBSCRIPTION_ROOT_FIELD)):isInterfaceType(pc)?mc.push(MapperKind.COMPOSITE_FIELD,MapperKind.INTERFACE_FIELD):isInputObjectType(pc)&&mc.push(MapperKind.INPUT_OBJECT_FIELD),mc}function getFieldMapper(vo,Ai,bo){const Ra=getFieldSpecifiers(vo,bo);let hc;const pc=[...Ra];for(;!hc&&pc.length>0;){const mc=pc.pop();hc=Ai[mc]}return hc??null}function getArgumentMapper(vo){return vo[MapperKind.ARGUMENT]??null}function getDirectiveMapper(vo){return vo[MapperKind.DIRECTIVE]??null}function getEnumValueMapper(vo){return vo[MapperKind.ENUM_VALUE]??null}function correctASTNodes(vo){if(isObjectType(vo)){const Ai=vo.toConfig();if(Ai.astNode!=null){const bo=[];for(const Ra in Ai.fields){const hc=Ai.fields[Ra];hc.astNode!=null&&bo.push(hc.astNode)}Ai.astNode={...Ai.astNode,kind:Kind.OBJECT_TYPE_DEFINITION,fields:bo}}return Ai.extensionASTNodes!=null&&(Ai.extensionASTNodes=Ai.extensionASTNodes.map(bo=>({...bo,kind:Kind.OBJECT_TYPE_EXTENSION,fields:void 0}))),new GraphQLObjectType(Ai)}else if(isInterfaceType(vo)){const Ai=vo.toConfig();if(Ai.astNode!=null){const bo=[];for(const Ra in Ai.fields){const hc=Ai.fields[Ra];hc.astNode!=null&&bo.push(hc.astNode)}Ai.astNode={...Ai.astNode,kind:Kind.INTERFACE_TYPE_DEFINITION,fields:bo}}return Ai.extensionASTNodes!=null&&(Ai.extensionASTNodes=Ai.extensionASTNodes.map(bo=>({...bo,kind:Kind.INTERFACE_TYPE_EXTENSION,fields:void 0}))),new GraphQLInterfaceType(Ai)}else if(isInputObjectType(vo)){const Ai=vo.toConfig();if(Ai.astNode!=null){const bo=[];for(const Ra in Ai.fields){const hc=Ai.fields[Ra];hc.astNode!=null&&bo.push(hc.astNode)}Ai.astNode={...Ai.astNode,kind:Kind.INPUT_OBJECT_TYPE_DEFINITION,fields:bo}}return Ai.extensionASTNodes!=null&&(Ai.extensionASTNodes=Ai.extensionASTNodes.map(bo=>({...bo,kind:Kind.INPUT_OBJECT_TYPE_EXTENSION,fields:void 0}))),new GraphQLInputObjectType(Ai)}else if(isEnumType(vo)){const Ai=vo.toConfig();if(Ai.astNode!=null){const bo=[];for(const Ra in Ai.values){const hc=Ai.values[Ra];hc.astNode!=null&&bo.push(hc.astNode)}Ai.astNode={...Ai.astNode,values:bo}}return Ai.extensionASTNodes!=null&&(Ai.extensionASTNodes=Ai.extensionASTNodes.map(bo=>({...bo,values:void 0}))),new GraphQLEnumType(Ai)}else return vo}function filterSchema({schema:vo,typeFilter:Ai=()=>!0,fieldFilter:bo=void 0,rootFieldFilter:Ra=void 0,objectFieldFilter:hc=void 0,interfaceFieldFilter:pc=void 0,inputObjectFieldFilter:mc=void 0,argumentFilter:uf=void 0,directiveFilter:df=void 0,enumValueFilter:ff=void 0}){return mapSchema(vo,{[MapperKind.QUERY]:hf=>filterRootFields(hf,"Query",Ra,uf),[MapperKind.MUTATION]:hf=>filterRootFields(hf,"Mutation",Ra,uf),[MapperKind.SUBSCRIPTION]:hf=>filterRootFields(hf,"Subscription",Ra,uf),[MapperKind.OBJECT_TYPE]:hf=>Ai(hf.name,hf)?filterElementFields(GraphQLObjectType,hf,hc||bo,uf):null,[MapperKind.INTERFACE_TYPE]:hf=>Ai(hf.name,hf)?filterElementFields(GraphQLInterfaceType,hf,pc||bo,uf):null,[MapperKind.INPUT_OBJECT_TYPE]:hf=>Ai(hf.name,hf)?filterElementFields(GraphQLInputObjectType,hf,mc||bo):null,[MapperKind.UNION_TYPE]:hf=>Ai(hf.name,hf)?void 0:null,[MapperKind.ENUM_TYPE]:hf=>Ai(hf.name,hf)?void 0:null,[MapperKind.SCALAR_TYPE]:hf=>Ai(hf.name,hf)?void 0:null,[MapperKind.DIRECTIVE]:hf=>df&&!df(hf.name,hf)?null:void 0,[MapperKind.ENUM_VALUE]:(hf,pf,mf,gf)=>ff&&!ff(pf,gf,hf)?null:void 0})}function filterRootFields(vo,Ai,bo,Ra){if(bo||Ra){const hc=vo.toConfig();for(const pc in hc.fields){const mc=hc.fields[pc];if(bo&&!bo(Ai,pc,hc.fields[pc]))delete hc.fields[pc];else if(Ra&&mc.args)for(const uf in mc.args)Ra(vo.name,pc,uf,mc.args[uf])||delete mc.args[uf]}return new GraphQLObjectType(hc)}return vo}function filterElementFields(vo,Ai,bo,Ra){if(bo||Ra){const hc=Ai.toConfig();for(const pc in hc.fields){const mc=hc.fields[pc];if(bo&&!bo(Ai.name,pc,hc.fields[pc]))delete hc.fields[pc];else if(Ra&&"args"in mc)for(const uf in mc.args)Ra(Ai.name,pc,uf,mc.args[uf])||delete mc.args[uf]}return new vo(hc)}}const hiddenQueryTypeDefinitions=parse(hiddenQueryTypeDefDoc).definitions,standardLibCustomScalarDefinitions=parse(typeDefsDoc).definitions,alwaysIncludedDefinitions=[...hiddenQueryTypeDefinitions,...standardLibCustomScalarDefinitions],rules=createDefaultRules().filter(vo=>vo.name!=="ExecutableDefinitionsRule");function makeSharedSchemaSdl(vo,Ai,bo,Ra){try{const hc=buildSchema(vo),pc=[Ai,bo,Ra].filter(Boolean).map(uf=>safeParseSdl(uf)).filter(Boolean),mc=makeSafeDocumentNode(hc,pc);return printSchema(buildASTSchema(mc))}catch(hc){return console.debug("in make shared schema",hc),vo}}function makeSafeDocumentNode(vo,Ai){try{const bo=[...alwaysIncludedDefinitions];for(const Ra of Ai)for(const hc of Ra.definitions){const pc={kind:Kind.DOCUMENT,definitions:[hc]};safeValidateAst(vo,pc)&&bo.push(hc)}return{kind:Kind.DOCUMENT,definitions:bo}}catch(bo){return console.debug("in make safe document node",bo),{kind:Kind.DOCUMENT,definitions:alwaysIncludedDefinitions}}}function safeValidateAst(vo,Ai){try{return!validate(vo,Ai,rules).length}catch(bo){return console.debug("in safe validate",bo),!1}}function safeParseSdl(vo){try{return!vo||!isDocumentString(vo)?null:parse(vo)}catch(Ai){return console.debug("in safe parse",Ai),null}}const SchemaContext=createContext(printSchema(initialSchema));function SchemaContextProvider(vo){const{children:Ai,globalStateSchemaSdl:bo,localStateSchemaSdl:Ra,operationSchemasSdl:hc}=vo,[pc,mc]=useState(()=>makeSharedSchemaSdl(printSchema(initialSchema),bo,Ra,hc));return useEffect(()=>{mc(uf=>makeSharedSchemaSdl(uf,bo,Ra,hc))},[bo,Ra,hc]),jsx(SchemaContext.Provider,{value:pc,children:Ai})}function useSchemaContext(){return useContext(SchemaContext)}class CompletionContext{constructor(Ai,bo,Ra,hc){this.state=Ai,this.pos=bo,this.explicit=Ra,this.view=hc,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(Ai){let bo=syntaxTree(this.state).resolveInner(this.pos,-1);for(;bo&&Ai.indexOf(bo.name)<0;)bo=bo.parent;return bo?{from:bo.from,to:this.pos,text:this.state.sliceDoc(bo.from,this.pos),type:bo.type}:null}matchBefore(Ai){let bo=this.state.doc.lineAt(this.pos),Ra=Math.max(bo.from,this.pos-250),hc=bo.text.slice(Ra-bo.from,this.pos-bo.from),pc=hc.search(ensureAnchor(Ai,!1));return pc<0?null:{from:Ra+pc,to:this.pos,text:hc.slice(pc)}}get aborted(){return this.abortListeners==null}addEventListener(Ai,bo,Ra){Ai=="abort"&&this.abortListeners&&(this.abortListeners.push(bo),Ra&&Ra.onDocChange&&(this.abortOnDocChange=!0))}}function toSet(vo){let Ai=Object.keys(vo).join(""),bo=/\w/.test(Ai);return bo&&(Ai=Ai.replace(/\w/g,"")),`[${bo?"\\w":""}${Ai.replace(/[^\w\s]/g,"\\$&")}]`}function prefixMatch(vo){let Ai=Object.create(null),bo=Object.create(null);for(let{label:hc}of vo){Ai[hc[0]]=!0;for(let pc=1;pc<hc.length;pc++)bo[hc[pc]]=!0}let Ra=toSet(Ai)+toSet(bo)+"*$";return[new RegExp("^"+Ra),new RegExp(Ra)]}function completeFromList(vo){let Ai=vo.map(hc=>typeof hc=="string"?{label:hc}:hc),[bo,Ra]=Ai.every(hc=>/^\w+$/.test(hc.label))?[/\w*$/,/\w+$/]:prefixMatch(Ai);return hc=>{let pc=hc.matchBefore(Ra);return pc||hc.explicit?{from:pc?pc.from:hc.pos,options:Ai,validFor:bo}:null}}class Option{constructor(Ai,bo,Ra,hc){this.completion=Ai,this.source=bo,this.match=Ra,this.score=hc}}function cur(vo){return vo.selection.main.from}function ensureAnchor(vo,Ai){var bo;let{source:Ra}=vo,hc=Ai&&Ra[0]!="^",pc=Ra[Ra.length-1]!="$";return!hc&&!pc?vo:new RegExp(`${hc?"^":""}(?:${Ra})${pc?"$":""}`,(bo=vo.flags)!==null&&bo!==void 0?bo:vo.ignoreCase?"i":"")}const pickedCompletion=Annotation.define();function insertCompletionText(vo,Ai,bo,Ra){let{main:hc}=vo.selection,pc=bo-hc.from,mc=Ra-hc.from;return Object.assign(Object.assign({},vo.changeByRange(uf=>{if(uf!=hc&&bo!=Ra&&vo.sliceDoc(uf.from+pc,uf.from+mc)!=vo.sliceDoc(bo,Ra))return{range:uf};let df=vo.toText(Ai);return{changes:{from:uf.from+pc,to:Ra==hc.from?uf.to:uf.from+mc,insert:df},range:EditorSelection.cursor(uf.from+pc+df.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}const SourceCache=new WeakMap;function asSource(vo){if(!Array.isArray(vo))return vo;let Ai=SourceCache.get(vo);return Ai||SourceCache.set(vo,Ai=completeFromList(vo)),Ai}const startCompletionEffect=StateEffect.define(),closeCompletionEffect=StateEffect.define();class FuzzyMatcher{constructor(Ai){this.pattern=Ai,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let bo=0;bo<Ai.length;){let Ra=codePointAt(Ai,bo),hc=codePointSize(Ra);this.chars.push(Ra);let pc=Ai.slice(bo,bo+hc),mc=pc.toUpperCase();this.folded.push(codePointAt(mc==pc?pc.toLowerCase():mc,0)),bo+=hc}this.astral=Ai.length!=this.chars.length}ret(Ai,bo){return this.score=Ai,this.matched=bo,this}match(Ai){if(this.pattern.length==0)return this.ret(-100,[]);if(Ai.length<this.pattern.length)return null;let{chars:bo,folded:Ra,any:hc,precise:pc,byWord:mc}=this;if(bo.length==1){let xf=codePointAt(Ai,0),wf=codePointSize(xf),s1=wf==Ai.length?0:-100;if(xf!=bo[0])if(xf==Ra[0])s1+=-200;else return null;return this.ret(s1,[0,wf])}let uf=Ai.indexOf(this.pattern);if(uf==0)return this.ret(Ai.length==this.pattern.length?0:-100,[0,this.pattern.length]);let df=bo.length,ff=0;if(uf<0){for(let xf=0,wf=Math.min(Ai.length,200);xf<wf&&ff<df;){let s1=codePointAt(Ai,xf);(s1==bo[ff]||s1==Ra[ff])&&(hc[ff++]=xf),xf+=codePointSize(s1)}if(ff<df)return null}let hf=0,pf=0,mf=!1,gf=0,yf=-1,vf=-1,bf=/[a-z]/.test(Ai),Sf=!0;for(let xf=0,wf=Math.min(Ai.length,200),s1=0;xf<wf&&pf<df;){let If=codePointAt(Ai,xf);uf<0&&(hf<df&&If==bo[hf]&&(pc[hf++]=xf),gf<df&&(If==bo[gf]||If==Ra[gf]?(gf==0&&(yf=xf),vf=xf+1,gf++):gf=0));let l1,c1=If<255?If>=48&&If<=57||If>=97&&If<=122?2:If>=65&&If<=90?1:0:(l1=fromCodePoint(If))!=l1.toLowerCase()?1:l1!=l1.toUpperCase()?2:0;(!xf||c1==1&&bf||s1==0&&c1!=0)&&(bo[pf]==If||Ra[pf]==If&&(mf=!0)?mc[pf++]=xf:mc.length&&(Sf=!1)),s1=c1,xf+=codePointSize(If)}return pf==df&&mc[0]==0&&Sf?this.result(-100+(mf?-200:0),mc,Ai):gf==df&&yf==0?this.ret(-200-Ai.length+(vf==Ai.length?0:-100),[0,vf]):uf>-1?this.ret(-700-Ai.length,[uf,uf+this.pattern.length]):gf==df?this.ret(-900-Ai.length,[yf,vf]):pf==df?this.result(-100+(mf?-200:0)+-700+(Sf?0:-1100),mc,Ai):bo.length==2?null:this.result((hc[0]?-700:0)+-200+-1100,hc,Ai)}result(Ai,bo,Ra){let hc=[],pc=0;for(let mc of bo){let uf=mc+(this.astral?codePointSize(codePointAt(Ra,mc)):1);pc&&hc[pc-1]==mc?hc[pc-1]=uf:(hc[pc++]=mc,hc[pc++]=uf)}return this.ret(Ai-Ra.length,hc)}}class StrictMatcher{constructor(Ai){this.pattern=Ai,this.matched=[],this.score=0,this.folded=Ai.toLowerCase()}match(Ai){if(Ai.length<this.pattern.length)return null;let bo=Ai.slice(0,this.pattern.length),Ra=bo==this.pattern?0:bo.toLowerCase()==this.folded?-200:null;return Ra==null?null:(this.matched=[0,bo.length],this.score=Ra+(Ai.length==this.pattern.length?0:-100),this)}}const completionConfig=Facet.define({combine(vo){return combineConfig(vo,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:defaultPositionInfo,filterStrict:!1,compareCompletions:(Ai,bo)=>Ai.label.localeCompare(bo.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(Ai,bo)=>Ai&&bo,closeOnBlur:(Ai,bo)=>Ai&&bo,icons:(Ai,bo)=>Ai&&bo,tooltipClass:(Ai,bo)=>Ra=>joinClass(Ai(Ra),bo(Ra)),optionClass:(Ai,bo)=>Ra=>joinClass(Ai(Ra),bo(Ra)),addToOptions:(Ai,bo)=>Ai.concat(bo),filterStrict:(Ai,bo)=>Ai||bo})}});function joinClass(vo,Ai){return vo?Ai?vo+" "+Ai:vo:Ai}function defaultPositionInfo(vo,Ai,bo,Ra,hc,pc){let mc=vo.textDirection==Direction.RTL,uf=mc,df=!1,ff="top",hf,pf,mf=Ai.left-hc.left,gf=hc.right-Ai.right,yf=Ra.right-Ra.left,vf=Ra.bottom-Ra.top;if(uf&&mf<Math.min(yf,gf)?uf=!1:!uf&&gf<Math.min(yf,mf)&&(uf=!0),yf<=(uf?mf:gf))hf=Math.max(hc.top,Math.min(bo.top,hc.bottom-vf))-Ai.top,pf=Math.min(400,uf?mf:gf);else{df=!0,pf=Math.min(400,(mc?Ai.right:hc.right-Ai.left)-30);let xf=hc.bottom-Ai.bottom;xf>=vf||xf>Ai.top?hf=bo.bottom-Ai.top:(ff="bottom",hf=Ai.bottom-bo.top)}let bf=(Ai.bottom-Ai.top)/pc.offsetHeight,Sf=(Ai.right-Ai.left)/pc.offsetWidth;return{style:`${ff}: ${hf/bf}px; max-width: ${pf/Sf}px`,class:"cm-completionInfo-"+(df?mc?"left-narrow":"right-narrow":uf?"left":"right")}}function optionContent(vo){let Ai=vo.addToOptions.slice();return vo.icons&&Ai.push({render(bo){let Ra=document.createElement("div");return Ra.classList.add("cm-completionIcon"),bo.type&&Ra.classList.add(...bo.type.split(/\s+/g).map(hc=>"cm-completionIcon-"+hc)),Ra.setAttribute("aria-hidden","true"),Ra},position:20}),Ai.push({render(bo,Ra,hc,pc){let mc=document.createElement("span");mc.className="cm-completionLabel";let uf=bo.displayLabel||bo.label,df=0;for(let ff=0;ff<pc.length;){let hf=pc[ff++],pf=pc[ff++];hf>df&&mc.appendChild(document.createTextNode(uf.slice(df,hf)));let mf=mc.appendChild(document.createElement("span"));mf.appendChild(document.createTextNode(uf.slice(hf,pf))),mf.className="cm-completionMatchedText",df=pf}return df<uf.length&&mc.appendChild(document.createTextNode(uf.slice(df))),mc},position:50},{render(bo){if(!bo.detail)return null;let Ra=document.createElement("span");return Ra.className="cm-completionDetail",Ra.textContent=bo.detail,Ra},position:80}),Ai.sort((bo,Ra)=>bo.position-Ra.position).map(bo=>bo.render)}function rangeAroundSelected(vo,Ai,bo){if(vo<=bo)return{from:0,to:vo};if(Ai<0&&(Ai=0),Ai<=vo>>1){let hc=Math.floor(Ai/bo);return{from:hc*bo,to:(hc+1)*bo}}let Ra=Math.floor((vo-Ai)/bo);return{from:vo-(Ra+1)*bo,to:vo-Ra*bo}}class CompletionTooltip{constructor(Ai,bo,Ra){this.view=Ai,this.stateField=bo,this.applyCompletion=Ra,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:df=>this.placeInfo(df),key:this},this.space=null,this.currentClass="";let hc=Ai.state.field(bo),{options:pc,selected:mc}=hc.open,uf=Ai.state.facet(completionConfig);this.optionContent=optionContent(uf),this.optionClass=uf.optionClass,this.tooltipClass=uf.tooltipClass,this.range=rangeAroundSelected(pc.length,mc,uf.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(Ai.state),this.dom.addEventListener("mousedown",df=>{let{options:ff}=Ai.state.field(bo).open;for(let hf=df.target,pf;hf&&hf!=this.dom;hf=hf.parentNode)if(hf.nodeName=="LI"&&(pf=/-(\d+)$/.exec(hf.id))&&+pf[1]<ff.length){this.applyCompletion(Ai,ff[+pf[1]]),df.preventDefault();return}}),this.dom.addEventListener("focusout",df=>{let ff=Ai.state.field(this.stateField,!1);ff&&ff.tooltip&&Ai.state.facet(completionConfig).closeOnBlur&&df.relatedTarget!=Ai.contentDOM&&Ai.dispatch({effects:closeCompletionEffect.of(null)})}),this.showOptions(pc,hc.id)}mount(){this.updateSel()}showOptions(Ai,bo){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(Ai,bo,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(Ai){var bo;let Ra=Ai.state.field(this.stateField),hc=Ai.startState.field(this.stateField);if(this.updateTooltipClass(Ai.state),Ra!=hc){let{options:pc,selected:mc,disabled:uf}=Ra.open;(!hc.open||hc.open.options!=pc)&&(this.range=rangeAroundSelected(pc.length,mc,Ai.state.facet(completionConfig).maxRenderedOptions),this.showOptions(pc,Ra.id)),this.updateSel(),uf!=((bo=hc.open)===null||bo===void 0?void 0:bo.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!uf)}}updateTooltipClass(Ai){let bo=this.tooltipClass(Ai);if(bo!=this.currentClass){for(let Ra of this.currentClass.split(" "))Ra&&this.dom.classList.remove(Ra);for(let Ra of bo.split(" "))Ra&&this.dom.classList.add(Ra);this.currentClass=bo}}positioned(Ai){this.space=Ai,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let Ai=this.view.state.field(this.stateField),bo=Ai.open;if((bo.selected>-1&&bo.selected<this.range.from||bo.selected>=this.range.to)&&(this.range=rangeAroundSelected(bo.options.length,bo.selected,this.view.state.facet(completionConfig).maxRenderedOptions),this.showOptions(bo.options,Ai.id)),this.updateSelectedOption(bo.selected)){this.destroyInfo();let{completion:Ra}=bo.options[bo.selected],{info:hc}=Ra;if(!hc)return;let pc=typeof hc=="string"?document.createTextNode(hc):hc(Ra);if(!pc)return;"then"in pc?pc.then(mc=>{mc&&this.view.state.field(this.stateField,!1)==Ai&&this.addInfoPane(mc,Ra)}).catch(mc=>logException(this.view.state,mc,"completion info")):this.addInfoPane(pc,Ra)}}addInfoPane(Ai,bo){this.destroyInfo();let Ra=this.info=document.createElement("div");if(Ra.className="cm-tooltip cm-completionInfo",Ai.nodeType!=null)Ra.appendChild(Ai),this.infoDestroy=null;else{let{dom:hc,destroy:pc}=Ai;Ra.appendChild(hc),this.infoDestroy=pc||null}this.dom.appendChild(Ra),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(Ai){let bo=null;for(let Ra=this.list.firstChild,hc=this.range.from;Ra;Ra=Ra.nextSibling,hc++)Ra.nodeName!="LI"||!Ra.id?hc--:hc==Ai?Ra.hasAttribute("aria-selected")||(Ra.setAttribute("aria-selected","true"),bo=Ra):Ra.hasAttribute("aria-selected")&&Ra.removeAttribute("aria-selected");return bo&&scrollIntoView(this.list,bo),bo}measureInfo(){let Ai=this.dom.querySelector("[aria-selected]");if(!Ai||!this.info)return null;let bo=this.dom.getBoundingClientRect(),Ra=this.info.getBoundingClientRect(),hc=Ai.getBoundingClientRect(),pc=this.space;if(!pc){let mc=this.dom.ownerDocument.defaultView||window;pc={left:0,top:0,right:mc.innerWidth,bottom:mc.innerHeight}}return hc.top>Math.min(pc.bottom,bo.bottom)-10||hc.bottom<Math.max(pc.top,bo.top)+10?null:this.view.state.facet(completionConfig).positionInfo(this.view,bo,hc,Ra,pc,this.dom)}placeInfo(Ai){this.info&&(Ai?(Ai.style&&(this.info.style.cssText=Ai.style),this.info.className="cm-tooltip cm-completionInfo "+(Ai.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(Ai,bo,Ra){const hc=document.createElement("ul");hc.id=bo,hc.setAttribute("role","listbox"),hc.setAttribute("aria-expanded","true"),hc.setAttribute("aria-label",this.view.state.phrase("Completions"));let pc=null;for(let mc=Ra.from;mc<Ra.to;mc++){let{completion:uf,match:df}=Ai[mc],{section:ff}=uf;if(ff){let mf=typeof ff=="string"?ff:ff.name;if(mf!=pc&&(mc>Ra.from||Ra.from==0))if(pc=mf,typeof ff!="string"&&ff.header)hc.appendChild(ff.header(ff));else{let gf=hc.appendChild(document.createElement("completion-section"));gf.textContent=mf}}const hf=hc.appendChild(document.createElement("li"));hf.id=bo+"-"+mc,hf.setAttribute("role","option");let pf=this.optionClass(uf);pf&&(hf.className=pf);for(let mf of this.optionContent){let gf=mf(uf,this.view.state,this.view,df);gf&&hf.appendChild(gf)}}return Ra.from&&hc.classList.add("cm-completionListIncompleteTop"),Ra.to<Ai.length&&hc.classList.add("cm-completionListIncompleteBottom"),hc}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function completionTooltip(vo,Ai){return bo=>new CompletionTooltip(bo,vo,Ai)}function scrollIntoView(vo,Ai){let bo=vo.getBoundingClientRect(),Ra=Ai.getBoundingClientRect(),hc=bo.height/vo.offsetHeight;Ra.top<bo.top?vo.scrollTop-=(bo.top-Ra.top)/hc:Ra.bottom>bo.bottom&&(vo.scrollTop+=(Ra.bottom-bo.bottom)/hc)}function score(vo){return(vo.boost||0)*100+(vo.apply?10:0)+(vo.info?5:0)+(vo.type?1:0)}function sortOptions(vo,Ai){let bo=[],Ra=null,hc=ff=>{bo.push(ff);let{section:hf}=ff.completion;if(hf){Ra||(Ra=[]);let pf=typeof hf=="string"?hf:hf.name;Ra.some(mf=>mf.name==pf)||Ra.push(typeof hf=="string"?{name:pf}:hf)}},pc=Ai.facet(completionConfig);for(let ff of vo)if(ff.hasResult()){let hf=ff.result.getMatch;if(ff.result.filter===!1)for(let pf of ff.result.options)hc(new Option(pf,ff.source,hf?hf(pf):[],1e9-bo.length));else{let pf=Ai.sliceDoc(ff.from,ff.to),mf,gf=pc.filterStrict?new StrictMatcher(pf):new FuzzyMatcher(pf);for(let yf of ff.result.options)if(mf=gf.match(yf.label)){let vf=yf.displayLabel?hf?hf(yf,mf.matched):[]:mf.matched;hc(new Option(yf,ff.source,vf,mf.score+(yf.boost||0)))}}}if(Ra){let ff=Object.create(null),hf=0,pf=(mf,gf)=>{var yf,vf;return((yf=mf.rank)!==null&&yf!==void 0?yf:1e9)-((vf=gf.rank)!==null&&vf!==void 0?vf:1e9)||(mf.name<gf.name?-1:1)};for(let mf of Ra.sort(pf))hf-=1e5,ff[mf.name]=hf;for(let mf of bo){let{section:gf}=mf.completion;gf&&(mf.score+=ff[typeof gf=="string"?gf:gf.name])}}let mc=[],uf=null,df=pc.compareCompletions;for(let ff of bo.sort((hf,pf)=>pf.score-hf.score||df(hf.completion,pf.completion))){let hf=ff.completion;!uf||uf.label!=hf.label||uf.detail!=hf.detail||uf.type!=null&&hf.type!=null&&uf.type!=hf.type||uf.apply!=hf.apply||uf.boost!=hf.boost?mc.push(ff):score(ff.completion)>score(uf)&&(mc[mc.length-1]=ff),uf=ff.completion}return mc}class CompletionDialog{constructor(Ai,bo,Ra,hc,pc,mc){this.options=Ai,this.attrs=bo,this.tooltip=Ra,this.timestamp=hc,this.selected=pc,this.disabled=mc}setSelected(Ai,bo){return Ai==this.selected||Ai>=this.options.length?this:new CompletionDialog(this.options,makeAttrs(bo,Ai),this.tooltip,this.timestamp,Ai,this.disabled)}static build(Ai,bo,Ra,hc,pc,mc){if(hc&&!mc&&Ai.some(ff=>ff.isPending))return hc.setDisabled();let uf=sortOptions(Ai,bo);if(!uf.length)return hc&&Ai.some(ff=>ff.isPending)?hc.setDisabled():null;let df=bo.facet(completionConfig).selectOnOpen?0:-1;if(hc&&hc.selected!=df&&hc.selected!=-1){let ff=hc.options[hc.selected].completion;for(let hf=0;hf<uf.length;hf++)if(uf[hf].completion==ff){df=hf;break}}return new CompletionDialog(uf,makeAttrs(Ra,df),{pos:Ai.reduce((ff,hf)=>hf.hasResult()?Math.min(ff,hf.from):ff,1e8),create:createTooltip,above:pc.aboveCursor},hc?hc.timestamp:Date.now(),df,!1)}map(Ai){return new CompletionDialog(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:Ai.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new CompletionDialog(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class CompletionState{constructor(Ai,bo,Ra){this.active=Ai,this.id=bo,this.open=Ra}static start(){return new CompletionState(none$1,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(Ai){let{state:bo}=Ai,Ra=bo.facet(completionConfig),hc=(Ra.override||bo.languageDataAt("autocomplete",cur(bo)).map(asSource)).map(uf=>(this.active.find(df=>df.source==uf)||new ActiveSource(uf,this.active.some(df=>df.state!=0)?1:0)).update(Ai,Ra));hc.length==this.active.length&&hc.every((uf,df)=>uf==this.active[df])&&(hc=this.active);let pc=this.open,mc=Ai.effects.some(uf=>uf.is(setActiveEffect));pc&&Ai.docChanged&&(pc=pc.map(Ai.changes)),Ai.selection||hc.some(uf=>uf.hasResult()&&Ai.changes.touchesRange(uf.from,uf.to))||!sameResults(hc,this.active)||mc?pc=CompletionDialog.build(hc,bo,this.id,pc,Ra,mc):pc&&pc.disabled&&!hc.some(uf=>uf.isPending)&&(pc=null),!pc&&hc.every(uf=>!uf.isPending)&&hc.some(uf=>uf.hasResult())&&(hc=hc.map(uf=>uf.hasResult()?new ActiveSource(uf.source,0):uf));for(let uf of Ai.effects)uf.is(setSelectedEffect)&&(pc=pc&&pc.setSelected(uf.value,this.id));return hc==this.active&&pc==this.open?this:new CompletionState(hc,this.id,pc)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?baseAttrs:noAttrs}}function sameResults(vo,Ai){if(vo==Ai)return!0;for(let bo=0,Ra=0;;){for(;bo<vo.length&&!vo[bo].hasResult();)bo++;for(;Ra<Ai.length&&!Ai[Ra].hasResult();)Ra++;let hc=bo==vo.length,pc=Ra==Ai.length;if(hc||pc)return hc==pc;if(vo[bo++].result!=Ai[Ra++].result)return!1}}const baseAttrs={"aria-autocomplete":"list"},noAttrs={};function makeAttrs(vo,Ai){let bo={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":vo};return Ai>-1&&(bo["aria-activedescendant"]=vo+"-"+Ai),bo}const none$1=[];function getUpdateType(vo,Ai){if(vo.isUserEvent("input.complete")){let Ra=vo.annotation(pickedCompletion);if(Ra&&Ai.activateOnCompletion(Ra))return 12}let bo=vo.isUserEvent("input.type");return bo&&Ai.activateOnTyping?5:bo?1:vo.isUserEvent("delete.backward")?2:vo.selection?8:vo.docChanged?16:0}class ActiveSource{constructor(Ai,bo,Ra=!1){this.source=Ai,this.state=bo,this.explicit=Ra}hasResult(){return!1}get isPending(){return this.state==1}update(Ai,bo){let Ra=getUpdateType(Ai,bo),hc=this;(Ra&8||Ra&16&&this.touches(Ai))&&(hc=new ActiveSource(hc.source,0)),Ra&4&&hc.state==0&&(hc=new ActiveSource(this.source,1)),hc=hc.updateFor(Ai,Ra);for(let pc of Ai.effects)if(pc.is(startCompletionEffect))hc=new ActiveSource(hc.source,1,pc.value);else if(pc.is(closeCompletionEffect))hc=new ActiveSource(hc.source,0);else if(pc.is(setActiveEffect))for(let mc of pc.value)mc.source==hc.source&&(hc=mc);return hc}updateFor(Ai,bo){return this.map(Ai.changes)}map(Ai){return this}touches(Ai){return Ai.changes.touchesRange(cur(Ai.state))}}class ActiveResult extends ActiveSource{constructor(Ai,bo,Ra,hc,pc,mc){super(Ai,3,bo),this.limit=Ra,this.result=hc,this.from=pc,this.to=mc}hasResult(){return!0}updateFor(Ai,bo){var Ra;if(!(bo&3))return this.map(Ai.changes);let hc=this.result;hc.map&&!Ai.changes.empty&&(hc=hc.map(hc,Ai.changes));let pc=Ai.changes.mapPos(this.from),mc=Ai.changes.mapPos(this.to,1),uf=cur(Ai.state);if(uf>mc||!hc||bo&2&&(cur(Ai.startState)==this.from||uf<this.limit))return new ActiveSource(this.source,bo&4?1:0);let df=Ai.changes.mapPos(this.limit);return checkValid(hc.validFor,Ai.state,pc,mc)?new ActiveResult(this.source,this.explicit,df,hc,pc,mc):hc.update&&(hc=hc.update(hc,pc,mc,new CompletionContext(Ai.state,uf,!1)))?new ActiveResult(this.source,this.explicit,df,hc,hc.from,(Ra=hc.to)!==null&&Ra!==void 0?Ra:cur(Ai.state)):new ActiveSource(this.source,1,this.explicit)}map(Ai){return Ai.empty?this:(this.result.map?this.result.map(this.result,Ai):this.result)?new ActiveResult(this.source,this.explicit,Ai.mapPos(this.limit),this.result,Ai.mapPos(this.from),Ai.mapPos(this.to,1)):new ActiveSource(this.source,0)}touches(Ai){return Ai.changes.touchesRange(this.from,this.to)}}function checkValid(vo,Ai,bo,Ra){if(!vo)return!1;let hc=Ai.sliceDoc(bo,Ra);return typeof vo=="function"?vo(hc,bo,Ra,Ai):ensureAnchor(vo,!0).test(hc)}const setActiveEffect=StateEffect.define({map(vo,Ai){return vo.map(bo=>bo.map(Ai))}}),setSelectedEffect=StateEffect.define(),completionState=StateField.define({create(){return CompletionState.start()},update(vo,Ai){return vo.update(Ai)},provide:vo=>[showTooltip.from(vo,Ai=>Ai.tooltip),EditorView.contentAttributes.from(vo,Ai=>Ai.attrs)]});function applyCompletion(vo,Ai){const bo=Ai.completion.apply||Ai.completion.label;let Ra=vo.state.field(completionState).active.find(hc=>hc.source==Ai.source);return Ra instanceof ActiveResult?(typeof bo=="string"?vo.dispatch(Object.assign(Object.assign({},insertCompletionText(vo.state,bo,Ra.from,Ra.to)),{annotations:pickedCompletion.of(Ai.completion)})):bo(vo,Ai.completion,Ra.from,Ra.to),!0):!1}const createTooltip=completionTooltip(completionState,applyCompletion);function moveCompletionSelection(vo,Ai="option"){return bo=>{let Ra=bo.state.field(completionState,!1);if(!Ra||!Ra.open||Ra.open.disabled||Date.now()-Ra.open.timestamp<bo.state.facet(completionConfig).interactionDelay)return!1;let hc=1,pc;Ai=="page"&&(pc=getTooltip(bo,Ra.open.tooltip))&&(hc=Math.max(2,Math.floor(pc.dom.offsetHeight/pc.dom.querySelector("li").offsetHeight)-1));let{length:mc}=Ra.open.options,uf=Ra.open.selected>-1?Ra.open.selected+hc*(vo?1:-1):vo?0:mc-1;return uf<0?uf=Ai=="page"?0:mc-1:uf>=mc&&(uf=Ai=="page"?mc-1:0),bo.dispatch({effects:setSelectedEffect.of(uf)}),!0}}const acceptCompletion=vo=>{let Ai=vo.state.field(completionState,!1);return vo.state.readOnly||!Ai||!Ai.open||Ai.open.selected<0||Ai.open.disabled||Date.now()-Ai.open.timestamp<vo.state.facet(completionConfig).interactionDelay?!1:applyCompletion(vo,Ai.open.options[Ai.open.selected])},startCompletion=vo=>vo.state.field(completionState,!1)?(vo.dispatch({effects:startCompletionEffect.of(!0)}),!0):!1,closeCompletion=vo=>{let Ai=vo.state.field(completionState,!1);return!Ai||!Ai.active.some(bo=>bo.state!=0)?!1:(vo.dispatch({effects:closeCompletionEffect.of(null)}),!0)};class RunningQuery{constructor(Ai,bo){this.active=Ai,this.context=bo,this.time=Date.now(),this.updates=[],this.done=void 0}}const MaxUpdateCount=50,MinAbortTime=1e3,completionPlugin=ViewPlugin.fromClass(class{constructor(vo){this.view=vo,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let Ai of vo.state.field(completionState).active)Ai.isPending&&this.startQuery(Ai)}update(vo){let Ai=vo.state.field(completionState),bo=vo.state.facet(completionConfig);if(!vo.selectionSet&&!vo.docChanged&&vo.startState.field(completionState)==Ai)return;let Ra=vo.transactions.some(pc=>{let mc=getUpdateType(pc,bo);return mc&8||(pc.selection||pc.docChanged)&&!(mc&3)});for(let pc=0;pc<this.running.length;pc++){let mc=this.running[pc];if(Ra||mc.context.abortOnDocChange&&vo.docChanged||mc.updates.length+vo.transactions.length>MaxUpdateCount&&Date.now()-mc.time>MinAbortTime){for(let uf of mc.context.abortListeners)try{uf()}catch(df){logException(this.view.state,df)}mc.context.abortListeners=null,this.running.splice(pc--,1)}else mc.updates.push(...vo.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),vo.transactions.some(pc=>pc.effects.some(mc=>mc.is(startCompletionEffect)))&&(this.pendingStart=!0);let hc=this.pendingStart?50:bo.activateOnTypingDelay;if(this.debounceUpdate=Ai.active.some(pc=>pc.isPending&&!this.running.some(mc=>mc.active.source==pc.source))?setTimeout(()=>this.startUpdate(),hc):-1,this.composing!=0)for(let pc of vo.transactions)pc.isUserEvent("input.type")?this.composing=2:this.composing==2&&pc.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:vo}=this.view,Ai=vo.field(completionState);for(let bo of Ai.active)bo.isPending&&!this.running.some(Ra=>Ra.active.source==bo.source)&&this.startQuery(bo);this.running.length&&Ai.open&&Ai.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(completionConfig).updateSyncTime))}startQuery(vo){let{state:Ai}=this.view,bo=cur(Ai),Ra=new CompletionContext(Ai,bo,vo.explicit,this.view),hc=new RunningQuery(vo,Ra);this.running.push(hc),Promise.resolve(vo.source(Ra)).then(pc=>{hc.context.aborted||(hc.done=pc||null,this.scheduleAccept())},pc=>{this.view.dispatch({effects:closeCompletionEffect.of(null)}),logException(this.view.state,pc)})}scheduleAccept(){this.running.every(vo=>vo.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(completionConfig).updateSyncTime))}accept(){var vo;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let Ai=[],bo=this.view.state.facet(completionConfig),Ra=this.view.state.field(completionState);for(let hc=0;hc<this.running.length;hc++){let pc=this.running[hc];if(pc.done===void 0)continue;if(this.running.splice(hc--,1),pc.done){let uf=cur(pc.updates.length?pc.updates[0].startState:this.view.state),df=Math.min(uf,pc.done.from+(pc.active.explicit?0:1)),ff=new ActiveResult(pc.active.source,pc.active.explicit,df,pc.done,pc.done.from,(vo=pc.done.to)!==null&&vo!==void 0?vo:uf);for(let hf of pc.updates)ff=ff.update(hf,bo);if(ff.hasResult()){Ai.push(ff);continue}}let mc=Ra.active.find(uf=>uf.source==pc.active.source);if(mc&&mc.isPending)if(pc.done==null){let uf=new ActiveSource(pc.active.source,0);for(let df of pc.updates)uf=uf.update(df,bo);uf.isPending||Ai.push(uf)}else this.startQuery(mc)}(Ai.length||Ra.open&&Ra.open.disabled)&&this.view.dispatch({effects:setActiveEffect.of(Ai)})}},{eventHandlers:{blur(vo){let Ai=this.view.state.field(completionState,!1);if(Ai&&Ai.tooltip&&this.view.state.facet(completionConfig).closeOnBlur){let bo=Ai.open&&getTooltip(this.view,Ai.open.tooltip);(!bo||!bo.dom.contains(vo.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:closeCompletionEffect.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:startCompletionEffect.of(!1)}),20),this.composing=0}}}),windows=typeof navigator=="object"&&/Win/.test(navigator.platform),commitCharacters=Prec.highest(EditorView.domEventHandlers({keydown(vo,Ai){let bo=Ai.state.field(completionState,!1);if(!bo||!bo.open||bo.open.disabled||bo.open.selected<0||vo.key.length>1||vo.ctrlKey&&!(windows&&vo.altKey)||vo.metaKey)return!1;let Ra=bo.open.options[bo.open.selected],hc=bo.active.find(mc=>mc.source==Ra.source),pc=Ra.completion.commitCharacters||hc.result.commitCharacters;return pc&&pc.indexOf(vo.key)>-1&&applyCompletion(Ai,Ra),!1}})),baseTheme$2=EditorView.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),defaults={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},closeBracketEffect=StateEffect.define({map(vo,Ai){return Ai.mapPos(vo,-1,MapMode.TrackAfter)??void 0}}),closedBracket=new class extends RangeValue{};closedBracket.startSide=1;closedBracket.endSide=-1;const bracketState=StateField.define({create(){return RangeSet.empty},update(vo,Ai){if(vo=vo.map(Ai.changes),Ai.selection){let bo=Ai.state.doc.lineAt(Ai.selection.main.head);vo=vo.update({filter:Ra=>Ra>=bo.from&&Ra<=bo.to})}for(let bo of Ai.effects)bo.is(closeBracketEffect)&&(vo=vo.update({add:[closedBracket.range(bo.value,bo.value+1)]}));return vo}});function closeBrackets(){return[inputHandler,bracketState]}const definedClosing="()[]{}<>";function closing(vo){for(let Ai=0;Ai<definedClosing.length;Ai+=2)if(definedClosing.charCodeAt(Ai)==vo)return definedClosing.charAt(Ai+1);return fromCodePoint(vo<128?vo:vo+1)}function config(vo,Ai){return vo.languageDataAt("closeBrackets",Ai)[0]||defaults}const android=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),inputHandler=EditorView.inputHandler.of((vo,Ai,bo,Ra)=>{if((android?vo.composing:vo.compositionStarted)||vo.state.readOnly)return!1;let hc=vo.state.selection.main;if(Ra.length>2||Ra.length==2&&codePointSize(codePointAt(Ra,0))==1||Ai!=hc.from||bo!=hc.to)return!1;let pc=insertBracket(vo.state,Ra);return pc?(vo.dispatch(pc),!0):!1}),deleteBracketPair=({state:vo,dispatch:Ai})=>{if(vo.readOnly)return!1;let bo=config(vo,vo.selection.main.head).brackets||defaults.brackets,Ra=null,hc=vo.changeByRange(pc=>{if(pc.empty){let mc=prevChar(vo.doc,pc.head);for(let uf of bo)if(uf==mc&&nextChar(vo.doc,pc.head)==closing(codePointAt(uf,0)))return{changes:{from:pc.head-uf.length,to:pc.head+uf.length},range:EditorSelection.cursor(pc.head-uf.length)}}return{range:Ra=pc}});return Ra||Ai(vo.update(hc,{scrollIntoView:!0,userEvent:"delete.backward"})),!Ra},closeBracketsKeymap=[{key:"Backspace",run:deleteBracketPair}];function insertBracket(vo,Ai){let bo=config(vo,vo.selection.main.head),Ra=bo.brackets||defaults.brackets;for(let hc of Ra){let pc=closing(codePointAt(hc,0));if(Ai==hc)return pc==hc?handleSame(vo,hc,Ra.indexOf(hc+hc+hc)>-1,bo):handleOpen(vo,hc,pc,bo.before||defaults.before);if(Ai==pc&&closedBracketAt(vo,vo.selection.main.from))return handleClose(vo,hc,pc)}return null}function closedBracketAt(vo,Ai){let bo=!1;return vo.field(bracketState).between(0,vo.doc.length,Ra=>{Ra==Ai&&(bo=!0)}),bo}function nextChar(vo,Ai){let bo=vo.sliceString(Ai,Ai+2);return bo.slice(0,codePointSize(codePointAt(bo,0)))}function prevChar(vo,Ai){let bo=vo.sliceString(Ai-2,Ai);return codePointSize(codePointAt(bo,0))==bo.length?bo:bo.slice(1)}function handleOpen(vo,Ai,bo,Ra){let hc=null,pc=vo.changeByRange(mc=>{if(!mc.empty)return{changes:[{insert:Ai,from:mc.from},{insert:bo,from:mc.to}],effects:closeBracketEffect.of(mc.to+Ai.length),range:EditorSelection.range(mc.anchor+Ai.length,mc.head+Ai.length)};let uf=nextChar(vo.doc,mc.head);return!uf||/\s/.test(uf)||Ra.indexOf(uf)>-1?{changes:{insert:Ai+bo,from:mc.head},effects:closeBracketEffect.of(mc.head+Ai.length),range:EditorSelection.cursor(mc.head+Ai.length)}:{range:hc=mc}});return hc?null:vo.update(pc,{scrollIntoView:!0,userEvent:"input.type"})}function handleClose(vo,Ai,bo){let Ra=null,hc=vo.changeByRange(pc=>pc.empty&&nextChar(vo.doc,pc.head)==bo?{changes:{from:pc.head,to:pc.head+bo.length,insert:bo},range:EditorSelection.cursor(pc.head+bo.length)}:Ra={range:pc});return Ra?null:vo.update(hc,{scrollIntoView:!0,userEvent:"input.type"})}function handleSame(vo,Ai,bo,Ra){let hc=Ra.stringPrefixes||defaults.stringPrefixes,pc=null,mc=vo.changeByRange(uf=>{if(!uf.empty)return{changes:[{insert:Ai,from:uf.from},{insert:Ai,from:uf.to}],effects:closeBracketEffect.of(uf.to+Ai.length),range:EditorSelection.range(uf.anchor+Ai.length,uf.head+Ai.length)};let df=uf.head,ff=nextChar(vo.doc,df),hf;if(ff==Ai){if(nodeStart(vo,df))return{changes:{insert:Ai+Ai,from:df},effects:closeBracketEffect.of(df+Ai.length),range:EditorSelection.cursor(df+Ai.length)};if(closedBracketAt(vo,df)){let pf=bo&&vo.sliceDoc(df,df+Ai.length*3)==Ai+Ai+Ai?Ai+Ai+Ai:Ai;return{changes:{from:df,to:df+pf.length,insert:pf},range:EditorSelection.cursor(df+pf.length)}}}else{if(bo&&vo.sliceDoc(df-2*Ai.length,df)==Ai+Ai&&(hf=canStartStringAt(vo,df-2*Ai.length,hc))>-1&&nodeStart(vo,hf))return{changes:{insert:Ai+Ai+Ai+Ai,from:df},effects:closeBracketEffect.of(df+Ai.length),range:EditorSelection.cursor(df+Ai.length)};if(vo.charCategorizer(df)(ff)!=CharCategory.Word&&canStartStringAt(vo,df,hc)>-1&&!probablyInString(vo,df,Ai,hc))return{changes:{insert:Ai+Ai,from:df},effects:closeBracketEffect.of(df+Ai.length),range:EditorSelection.cursor(df+Ai.length)}}return{range:pc=uf}});return pc?null:vo.update(mc,{scrollIntoView:!0,userEvent:"input.type"})}function nodeStart(vo,Ai){let bo=syntaxTree(vo).resolveInner(Ai+1);return bo.parent&&bo.from==Ai}function probablyInString(vo,Ai,bo,Ra){let hc=syntaxTree(vo).resolveInner(Ai,-1),pc=Ra.reduce((mc,uf)=>Math.max(mc,uf.length),0);for(let mc=0;mc<5;mc++){let uf=vo.sliceDoc(hc.from,Math.min(hc.to,hc.from+bo.length+pc)),df=uf.indexOf(bo);if(!df||df>-1&&Ra.indexOf(uf.slice(0,df))>-1){let hf=hc.firstChild;for(;hf&&hf.from==hc.from&&hf.to-hf.from>bo.length+df;){if(vo.sliceDoc(hf.to-bo.length,hf.to)==bo)return!1;hf=hf.firstChild}return!0}let ff=hc.to==Ai&&hc.parent;if(!ff)break;hc=ff}return!1}function canStartStringAt(vo,Ai,bo){let Ra=vo.charCategorizer(Ai);if(Ra(vo.sliceDoc(Ai-1,Ai))!=CharCategory.Word)return Ai;for(let hc of bo){let pc=Ai-hc.length;if(vo.sliceDoc(pc,Ai)==hc&&Ra(vo.sliceDoc(pc-1,pc))!=CharCategory.Word)return pc}return-1}function autocompletion(vo={}){return[commitCharacters,completionState,completionConfig.of(vo),completionPlugin,completionKeymapExt,baseTheme$2]}const completionKeymap=[{key:"Ctrl-Space",run:startCompletion},{mac:"Alt-`",run:startCompletion},{key:"Escape",run:closeCompletion},{key:"ArrowDown",run:moveCompletionSelection(!0)},{key:"ArrowUp",run:moveCompletionSelection(!1)},{key:"PageDown",run:moveCompletionSelection(!0,"page")},{key:"PageUp",run:moveCompletionSelection(!1,"page")},{key:"Enter",run:acceptCompletion}],completionKeymapExt=Prec.highest(keymap.computeN([completionConfig],vo=>vo.facet(completionConfig).defaultKeymap?[completionKeymap]:[])),toggleComment=vo=>{let{state:Ai}=vo,bo=Ai.doc.lineAt(Ai.selection.main.from),Ra=getConfig(vo.state,bo.from);return Ra.line?toggleLineComment(vo):Ra.block?toggleBlockCommentByLine(vo):!1};function command(vo,Ai){return({state:bo,dispatch:Ra})=>{if(bo.readOnly)return!1;let hc=vo(Ai,bo);return hc?(Ra(bo.update(hc)),!0):!1}}const toggleLineComment=command(changeLineComment,0),toggleBlockComment=command(changeBlockComment,0),toggleBlockCommentByLine=command((vo,Ai)=>changeBlockComment(vo,Ai,selectedLineRanges(Ai)),0);function getConfig(vo,Ai){let bo=vo.languageDataAt("commentTokens",Ai);return bo.length?bo[0]:{}}const SearchMargin=50;function findBlockComment(vo,{open:Ai,close:bo},Ra,hc){let pc=vo.sliceDoc(Ra-SearchMargin,Ra),mc=vo.sliceDoc(hc,hc+SearchMargin),uf=/\s*$/.exec(pc)[0].length,df=/^\s*/.exec(mc)[0].length,ff=pc.length-uf;if(pc.slice(ff-Ai.length,ff)==Ai&&mc.slice(df,df+bo.length)==bo)return{open:{pos:Ra-uf,margin:uf&&1},close:{pos:hc+df,margin:df&&1}};let hf,pf;hc-Ra<=2*SearchMargin?hf=pf=vo.sliceDoc(Ra,hc):(hf=vo.sliceDoc(Ra,Ra+SearchMargin),pf=vo.sliceDoc(hc-SearchMargin,hc));let mf=/^\s*/.exec(hf)[0].length,gf=/\s*$/.exec(pf)[0].length,yf=pf.length-gf-bo.length;return hf.slice(mf,mf+Ai.length)==Ai&&pf.slice(yf,yf+bo.length)==bo?{open:{pos:Ra+mf+Ai.length,margin:/\s/.test(hf.charAt(mf+Ai.length))?1:0},close:{pos:hc-gf-bo.length,margin:/\s/.test(pf.charAt(yf-1))?1:0}}:null}function selectedLineRanges(vo){let Ai=[];for(let bo of vo.selection.ranges){let Ra=vo.doc.lineAt(bo.from),hc=bo.to<=Ra.to?Ra:vo.doc.lineAt(bo.to);hc.from>Ra.from&&hc.from==bo.to&&(hc=bo.to==Ra.to+1?Ra:vo.doc.lineAt(bo.to-1));let pc=Ai.length-1;pc>=0&&Ai[pc].to>Ra.from?Ai[pc].to=hc.to:Ai.push({from:Ra.from+/^\s*/.exec(Ra.text)[0].length,to:hc.to})}return Ai}function changeBlockComment(vo,Ai,bo=Ai.selection.ranges){let Ra=bo.map(pc=>getConfig(Ai,pc.from).block);if(!Ra.every(pc=>pc))return null;let hc=bo.map((pc,mc)=>findBlockComment(Ai,Ra[mc],pc.from,pc.to));if(vo!=2&&!hc.every(pc=>pc))return{changes:Ai.changes(bo.map((pc,mc)=>hc[mc]?[]:[{from:pc.from,insert:Ra[mc].open+" "},{from:pc.to,insert:" "+Ra[mc].close}]))};if(vo!=1&&hc.some(pc=>pc)){let pc=[];for(let mc=0,uf;mc<hc.length;mc++)if(uf=hc[mc]){let df=Ra[mc],{open:ff,close:hf}=uf;pc.push({from:ff.pos-df.open.length,to:ff.pos+ff.margin},{from:hf.pos-hf.margin,to:hf.pos+df.close.length})}return{changes:pc}}return null}function changeLineComment(vo,Ai,bo=Ai.selection.ranges){let Ra=[],hc=-1;for(let{from:pc,to:mc}of bo){let uf=Ra.length,df=1e9,ff=getConfig(Ai,pc).line;if(ff){for(let hf=pc;hf<=mc;){let pf=Ai.doc.lineAt(hf);if(pf.from>hc&&(pc==mc||mc>pf.from)){hc=pf.from;let mf=/^\s*/.exec(pf.text)[0].length,gf=mf==pf.length,yf=pf.text.slice(mf,mf+ff.length)==ff?mf:-1;mf<pf.text.length&&mf<df&&(df=mf),Ra.push({line:pf,comment:yf,token:ff,indent:mf,empty:gf,single:!1})}hf=pf.to+1}if(df<1e9)for(let hf=uf;hf<Ra.length;hf++)Ra[hf].indent<Ra[hf].line.text.length&&(Ra[hf].indent=df);Ra.length==uf+1&&(Ra[uf].single=!0)}}if(vo!=2&&Ra.some(pc=>pc.comment<0&&(!pc.empty||pc.single))){let pc=[];for(let{line:uf,token:df,indent:ff,empty:hf,single:pf}of Ra)(pf||!hf)&&pc.push({from:uf.from+ff,insert:df+" "});let mc=Ai.changes(pc);return{changes:mc,selection:Ai.selection.map(mc,1)}}else if(vo!=1&&Ra.some(pc=>pc.comment>=0)){let pc=[];for(let{line:mc,comment:uf,token:df}of Ra)if(uf>=0){let ff=mc.from+uf,hf=ff+df.length;mc.text[hf-mc.from]==" "&&hf++,pc.push({from:ff,to:hf})}return{changes:pc}}return null}const fromHistory=Annotation.define(),isolateHistory=Annotation.define(),invertedEffects=Facet.define(),historyConfig=Facet.define({combine(vo){return combineConfig(vo,{minDepth:100,newGroupDelay:500,joinToEvent:(Ai,bo)=>bo},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(Ai,bo)=>(Ra,hc)=>Ai(Ra,hc)||bo(Ra,hc)})}}),historyField_=StateField.define({create(){return HistoryState.empty},update(vo,Ai){let bo=Ai.state.facet(historyConfig),Ra=Ai.annotation(fromHistory);if(Ra){let df=HistEvent.fromTransaction(Ai,Ra.selection),ff=Ra.side,hf=ff==0?vo.undone:vo.done;return df?hf=updateBranch(hf,hf.length,bo.minDepth,df):hf=addSelection(hf,Ai.startState.selection),new HistoryState(ff==0?Ra.rest:hf,ff==0?hf:Ra.rest)}let hc=Ai.annotation(isolateHistory);if((hc=="full"||hc=="before")&&(vo=vo.isolate()),Ai.annotation(Transaction.addToHistory)===!1)return Ai.changes.empty?vo:vo.addMapping(Ai.changes.desc);let pc=HistEvent.fromTransaction(Ai),mc=Ai.annotation(Transaction.time),uf=Ai.annotation(Transaction.userEvent);return pc?vo=vo.addChanges(pc,mc,uf,bo,Ai):Ai.selection&&(vo=vo.addSelection(Ai.startState.selection,mc,uf,bo.newGroupDelay)),(hc=="full"||hc=="after")&&(vo=vo.isolate()),vo},toJSON(vo){return{done:vo.done.map(Ai=>Ai.toJSON()),undone:vo.undone.map(Ai=>Ai.toJSON())}},fromJSON(vo){return new HistoryState(vo.done.map(HistEvent.fromJSON),vo.undone.map(HistEvent.fromJSON))}});function history(vo={}){return[historyField_,historyConfig.of(vo),EditorView.domEventHandlers({beforeinput(Ai,bo){let Ra=Ai.inputType=="historyUndo"?undo:Ai.inputType=="historyRedo"?redo:null;return Ra?(Ai.preventDefault(),Ra(bo)):!1}})]}function cmd(vo,Ai){return function({state:bo,dispatch:Ra}){if(!Ai&&bo.readOnly)return!1;let hc=bo.field(historyField_,!1);if(!hc)return!1;let pc=hc.pop(vo,bo,Ai);return pc?(Ra(pc),!0):!1}}const undo=cmd(0,!1),redo=cmd(1,!1),undoSelection=cmd(0,!0),redoSelection=cmd(1,!0);class HistEvent{constructor(Ai,bo,Ra,hc,pc){this.changes=Ai,this.effects=bo,this.mapped=Ra,this.startSelection=hc,this.selectionsAfter=pc}setSelAfter(Ai){return new HistEvent(this.changes,this.effects,this.mapped,this.startSelection,Ai)}toJSON(){var Ai,bo,Ra;return{changes:(Ai=this.changes)===null||Ai===void 0?void 0:Ai.toJSON(),mapped:(bo=this.mapped)===null||bo===void 0?void 0:bo.toJSON(),startSelection:(Ra=this.startSelection)===null||Ra===void 0?void 0:Ra.toJSON(),selectionsAfter:this.selectionsAfter.map(hc=>hc.toJSON())}}static fromJSON(Ai){return new HistEvent(Ai.changes&&ChangeSet.fromJSON(Ai.changes),[],Ai.mapped&&ChangeDesc.fromJSON(Ai.mapped),Ai.startSelection&&EditorSelection.fromJSON(Ai.startSelection),Ai.selectionsAfter.map(EditorSelection.fromJSON))}static fromTransaction(Ai,bo){let Ra=none;for(let hc of Ai.startState.facet(invertedEffects)){let pc=hc(Ai);pc.length&&(Ra=Ra.concat(pc))}return!Ra.length&&Ai.changes.empty?null:new HistEvent(Ai.changes.invert(Ai.startState.doc),Ra,void 0,bo||Ai.startState.selection,none)}static selection(Ai){return new HistEvent(void 0,none,void 0,void 0,Ai)}}function updateBranch(vo,Ai,bo,Ra){let hc=Ai+1>bo+20?Ai-bo-1:0,pc=vo.slice(hc,Ai);return pc.push(Ra),pc}function isAdjacent(vo,Ai){let bo=[],Ra=!1;return vo.iterChangedRanges((hc,pc)=>bo.push(hc,pc)),Ai.iterChangedRanges((hc,pc,mc,uf)=>{for(let df=0;df<bo.length;){let ff=bo[df++],hf=bo[df++];uf>=ff&&mc<=hf&&(Ra=!0)}}),Ra}function eqSelectionShape(vo,Ai){return vo.ranges.length==Ai.ranges.length&&vo.ranges.filter((bo,Ra)=>bo.empty!=Ai.ranges[Ra].empty).length===0}function conc(vo,Ai){return vo.length?Ai.length?vo.concat(Ai):vo:Ai}const none=[],MaxSelectionsPerEvent=200;function addSelection(vo,Ai){if(vo.length){let bo=vo[vo.length-1],Ra=bo.selectionsAfter.slice(Math.max(0,bo.selectionsAfter.length-MaxSelectionsPerEvent));return Ra.length&&Ra[Ra.length-1].eq(Ai)?vo:(Ra.push(Ai),updateBranch(vo,vo.length-1,1e9,bo.setSelAfter(Ra)))}else return[HistEvent.selection([Ai])]}function popSelection(vo){let Ai=vo[vo.length-1],bo=vo.slice();return bo[vo.length-1]=Ai.setSelAfter(Ai.selectionsAfter.slice(0,Ai.selectionsAfter.length-1)),bo}function addMappingToBranch(vo,Ai){if(!vo.length)return vo;let bo=vo.length,Ra=none;for(;bo;){let hc=mapEvent(vo[bo-1],Ai,Ra);if(hc.changes&&!hc.changes.empty||hc.effects.length){let pc=vo.slice(0,bo);return pc[bo-1]=hc,pc}else Ai=hc.mapped,bo--,Ra=hc.selectionsAfter}return Ra.length?[HistEvent.selection(Ra)]:none}function mapEvent(vo,Ai,bo){let Ra=conc(vo.selectionsAfter.length?vo.selectionsAfter.map(uf=>uf.map(Ai)):none,bo);if(!vo.changes)return HistEvent.selection(Ra);let hc=vo.changes.map(Ai),pc=Ai.mapDesc(vo.changes,!0),mc=vo.mapped?vo.mapped.composeDesc(pc):pc;return new HistEvent(hc,StateEffect.mapEffects(vo.effects,Ai),mc,vo.startSelection.map(pc),Ra)}const joinableUserEvent=/^(input\.type|delete)($|\.)/;class HistoryState{constructor(Ai,bo,Ra=0,hc=void 0){this.done=Ai,this.undone=bo,this.prevTime=Ra,this.prevUserEvent=hc}isolate(){return this.prevTime?new HistoryState(this.done,this.undone):this}addChanges(Ai,bo,Ra,hc,pc){let mc=this.done,uf=mc[mc.length-1];return uf&&uf.changes&&!uf.changes.empty&&Ai.changes&&(!Ra||joinableUserEvent.test(Ra))&&(!uf.selectionsAfter.length&&bo-this.prevTime<hc.newGroupDelay&&hc.joinToEvent(pc,isAdjacent(uf.changes,Ai.changes))||Ra=="input.type.compose")?mc=updateBranch(mc,mc.length-1,hc.minDepth,new HistEvent(Ai.changes.compose(uf.changes),conc(StateEffect.mapEffects(Ai.effects,uf.changes),uf.effects),uf.mapped,uf.startSelection,none)):mc=updateBranch(mc,mc.length,hc.minDepth,Ai),new HistoryState(mc,none,bo,Ra)}addSelection(Ai,bo,Ra,hc){let pc=this.done.length?this.done[this.done.length-1].selectionsAfter:none;return pc.length>0&&bo-this.prevTime<hc&&Ra==this.prevUserEvent&&Ra&&/^select($|\.)/.test(Ra)&&eqSelectionShape(pc[pc.length-1],Ai)?this:new HistoryState(addSelection(this.done,Ai),this.undone,bo,Ra)}addMapping(Ai){return new HistoryState(addMappingToBranch(this.done,Ai),addMappingToBranch(this.undone,Ai),this.prevTime,this.prevUserEvent)}pop(Ai,bo,Ra){let hc=Ai==0?this.done:this.undone;if(hc.length==0)return null;let pc=hc[hc.length-1],mc=pc.selectionsAfter[0]||bo.selection;if(Ra&&pc.selectionsAfter.length)return bo.update({selection:pc.selectionsAfter[pc.selectionsAfter.length-1],annotations:fromHistory.of({side:Ai,rest:popSelection(hc),selection:mc}),userEvent:Ai==0?"select.undo":"select.redo",scrollIntoView:!0});if(pc.changes){let uf=hc.length==1?none:hc.slice(0,hc.length-1);return pc.mapped&&(uf=addMappingToBranch(uf,pc.mapped)),bo.update({changes:pc.changes,selection:pc.startSelection,effects:pc.effects,annotations:fromHistory.of({side:Ai,rest:uf,selection:mc}),filter:!1,userEvent:Ai==0?"undo":"redo",scrollIntoView:!0})}else return null}}HistoryState.empty=new HistoryState(none,none);const historyKeymap=[{key:"Mod-z",run:undo,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:redo,preventDefault:!0},{linux:"Ctrl-Shift-z",run:redo,preventDefault:!0},{key:"Mod-u",run:undoSelection,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:redoSelection,preventDefault:!0}];function updateSel(vo,Ai){return EditorSelection.create(vo.ranges.map(Ai),vo.mainIndex)}function setSel(vo,Ai){return vo.update({selection:Ai,scrollIntoView:!0,userEvent:"select"})}function moveSel({state:vo,dispatch:Ai},bo){let Ra=updateSel(vo.selection,bo);return Ra.eq(vo.selection,!0)?!1:(Ai(setSel(vo,Ra)),!0)}function rangeEnd(vo,Ai){return EditorSelection.cursor(Ai?vo.to:vo.from)}function cursorByChar(vo,Ai){return moveSel(vo,bo=>bo.empty?vo.moveByChar(bo,Ai):rangeEnd(bo,Ai))}function ltrAtCursor(vo){return vo.textDirectionAt(vo.state.selection.main.head)==Direction.LTR}const cursorCharLeft=vo=>cursorByChar(vo,!ltrAtCursor(vo)),cursorCharRight=vo=>cursorByChar(vo,ltrAtCursor(vo));function cursorByGroup(vo,Ai){return moveSel(vo,bo=>bo.empty?vo.moveByGroup(bo,Ai):rangeEnd(bo,Ai))}const cursorGroupLeft=vo=>cursorByGroup(vo,!ltrAtCursor(vo)),cursorGroupRight=vo=>cursorByGroup(vo,ltrAtCursor(vo));function interestingNode(vo,Ai,bo){if(Ai.type.prop(bo))return!0;let Ra=Ai.to-Ai.from;return Ra&&(Ra>2||/[^\s,.;:]/.test(vo.sliceDoc(Ai.from,Ai.to)))||Ai.firstChild}function moveBySyntax(vo,Ai,bo){let Ra=syntaxTree(vo).resolveInner(Ai.head),hc=bo?NodeProp.closedBy:NodeProp.openedBy;for(let df=Ai.head;;){let ff=bo?Ra.childAfter(df):Ra.childBefore(df);if(!ff)break;interestingNode(vo,ff,hc)?Ra=ff:df=bo?ff.to:ff.from}let pc=Ra.type.prop(hc),mc,uf;return pc&&(mc=bo?matchBrackets(vo,Ra.from,1):matchBrackets(vo,Ra.to,-1))&&mc.matched?uf=bo?mc.end.to:mc.end.from:uf=bo?Ra.to:Ra.from,EditorSelection.cursor(uf,bo?-1:1)}const cursorSyntaxLeft=vo=>moveSel(vo,Ai=>moveBySyntax(vo.state,Ai,!ltrAtCursor(vo))),cursorSyntaxRight=vo=>moveSel(vo,Ai=>moveBySyntax(vo.state,Ai,ltrAtCursor(vo)));function cursorByLine(vo,Ai){return moveSel(vo,bo=>{if(!bo.empty)return rangeEnd(bo,Ai);let Ra=vo.moveVertically(bo,Ai);return Ra.head!=bo.head?Ra:vo.moveToLineBoundary(bo,Ai)})}const cursorLineUp=vo=>cursorByLine(vo,!1),cursorLineDown=vo=>cursorByLine(vo,!0);function pageInfo(vo){let Ai=vo.scrollDOM.clientHeight<vo.scrollDOM.scrollHeight-2,bo=0,Ra=0,hc;if(Ai){for(let pc of vo.state.facet(EditorView.scrollMargins)){let mc=pc(vo);mc!=null&&mc.top&&(bo=Math.max(mc==null?void 0:mc.top,bo)),mc!=null&&mc.bottom&&(Ra=Math.max(mc==null?void 0:mc.bottom,Ra))}hc=vo.scrollDOM.clientHeight-bo-Ra}else hc=(vo.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:bo,marginBottom:Ra,selfScroll:Ai,height:Math.max(vo.defaultLineHeight,hc-5)}}function cursorByPage(vo,Ai){let bo=pageInfo(vo),{state:Ra}=vo,hc=updateSel(Ra.selection,mc=>mc.empty?vo.moveVertically(mc,Ai,bo.height):rangeEnd(mc,Ai));if(hc.eq(Ra.selection))return!1;let pc;if(bo.selfScroll){let mc=vo.coordsAtPos(Ra.selection.main.head),uf=vo.scrollDOM.getBoundingClientRect(),df=uf.top+bo.marginTop,ff=uf.bottom-bo.marginBottom;mc&&mc.top>df&&mc.bottom<ff&&(pc=EditorView.scrollIntoView(hc.main.head,{y:"start",yMargin:mc.top-df}))}return vo.dispatch(setSel(Ra,hc),{effects:pc}),!0}const cursorPageUp=vo=>cursorByPage(vo,!1),cursorPageDown=vo=>cursorByPage(vo,!0);function moveByLineBoundary(vo,Ai,bo){let Ra=vo.lineBlockAt(Ai.head),hc=vo.moveToLineBoundary(Ai,bo);if(hc.head==Ai.head&&hc.head!=(bo?Ra.to:Ra.from)&&(hc=vo.moveToLineBoundary(Ai,bo,!1)),!bo&&hc.head==Ra.from&&Ra.length){let pc=/^\s*/.exec(vo.state.sliceDoc(Ra.from,Math.min(Ra.from+100,Ra.to)))[0].length;pc&&Ai.head!=Ra.from+pc&&(hc=EditorSelection.cursor(Ra.from+pc))}return hc}const cursorLineBoundaryForward=vo=>moveSel(vo,Ai=>moveByLineBoundary(vo,Ai,!0)),cursorLineBoundaryBackward=vo=>moveSel(vo,Ai=>moveByLineBoundary(vo,Ai,!1)),cursorLineBoundaryLeft=vo=>moveSel(vo,Ai=>moveByLineBoundary(vo,Ai,!ltrAtCursor(vo))),cursorLineBoundaryRight=vo=>moveSel(vo,Ai=>moveByLineBoundary(vo,Ai,ltrAtCursor(vo))),cursorLineStart=vo=>moveSel(vo,Ai=>EditorSelection.cursor(vo.lineBlockAt(Ai.head).from,1)),cursorLineEnd=vo=>moveSel(vo,Ai=>EditorSelection.cursor(vo.lineBlockAt(Ai.head).to,-1));function toMatchingBracket(vo,Ai,bo){let Ra=!1,hc=updateSel(vo.selection,pc=>{let mc=matchBrackets(vo,pc.head,-1)||matchBrackets(vo,pc.head,1)||pc.head>0&&matchBrackets(vo,pc.head-1,1)||pc.head<vo.doc.length&&matchBrackets(vo,pc.head+1,-1);if(!mc||!mc.end)return pc;Ra=!0;let uf=mc.start.from==pc.head?mc.end.to:mc.end.from;return EditorSelection.cursor(uf)});return Ra?(Ai(setSel(vo,hc)),!0):!1}const cursorMatchingBracket=({state:vo,dispatch:Ai})=>toMatchingBracket(vo,Ai);function extendSel(vo,Ai){let bo=updateSel(vo.state.selection,Ra=>{let hc=Ai(Ra);return EditorSelection.range(Ra.anchor,hc.head,hc.goalColumn,hc.bidiLevel||void 0)});return bo.eq(vo.state.selection)?!1:(vo.dispatch(setSel(vo.state,bo)),!0)}function selectByChar(vo,Ai){return extendSel(vo,bo=>vo.moveByChar(bo,Ai))}const selectCharLeft=vo=>selectByChar(vo,!ltrAtCursor(vo)),selectCharRight=vo=>selectByChar(vo,ltrAtCursor(vo));function selectByGroup(vo,Ai){return extendSel(vo,bo=>vo.moveByGroup(bo,Ai))}const selectGroupLeft=vo=>selectByGroup(vo,!ltrAtCursor(vo)),selectGroupRight=vo=>selectByGroup(vo,ltrAtCursor(vo)),selectSyntaxLeft=vo=>extendSel(vo,Ai=>moveBySyntax(vo.state,Ai,!ltrAtCursor(vo))),selectSyntaxRight=vo=>extendSel(vo,Ai=>moveBySyntax(vo.state,Ai,ltrAtCursor(vo)));function selectByLine(vo,Ai){return extendSel(vo,bo=>vo.moveVertically(bo,Ai))}const selectLineUp=vo=>selectByLine(vo,!1),selectLineDown=vo=>selectByLine(vo,!0);function selectByPage(vo,Ai){return extendSel(vo,bo=>vo.moveVertically(bo,Ai,pageInfo(vo).height))}const selectPageUp=vo=>selectByPage(vo,!1),selectPageDown=vo=>selectByPage(vo,!0),selectLineBoundaryForward=vo=>extendSel(vo,Ai=>moveByLineBoundary(vo,Ai,!0)),selectLineBoundaryBackward=vo=>extendSel(vo,Ai=>moveByLineBoundary(vo,Ai,!1)),selectLineBoundaryLeft=vo=>extendSel(vo,Ai=>moveByLineBoundary(vo,Ai,!ltrAtCursor(vo))),selectLineBoundaryRight=vo=>extendSel(vo,Ai=>moveByLineBoundary(vo,Ai,ltrAtCursor(vo))),selectLineStart=vo=>extendSel(vo,Ai=>EditorSelection.cursor(vo.lineBlockAt(Ai.head).from)),selectLineEnd=vo=>extendSel(vo,Ai=>EditorSelection.cursor(vo.lineBlockAt(Ai.head).to)),cursorDocStart=({state:vo,dispatch:Ai})=>(Ai(setSel(vo,{anchor:0})),!0),cursorDocEnd=({state:vo,dispatch:Ai})=>(Ai(setSel(vo,{anchor:vo.doc.length})),!0),selectDocStart=({state:vo,dispatch:Ai})=>(Ai(setSel(vo,{anchor:vo.selection.main.anchor,head:0})),!0),selectDocEnd=({state:vo,dispatch:Ai})=>(Ai(setSel(vo,{anchor:vo.selection.main.anchor,head:vo.doc.length})),!0),selectAll=({state:vo,dispatch:Ai})=>(Ai(vo.update({selection:{anchor:0,head:vo.doc.length},userEvent:"select"})),!0),selectLine=({state:vo,dispatch:Ai})=>{let bo=selectedLineBlocks(vo).map(({from:Ra,to:hc})=>EditorSelection.range(Ra,Math.min(hc+1,vo.doc.length)));return Ai(vo.update({selection:EditorSelection.create(bo),userEvent:"select"})),!0},selectParentSyntax=({state:vo,dispatch:Ai})=>{let bo=updateSel(vo.selection,Ra=>{let hc=syntaxTree(vo),pc=hc.resolveStack(Ra.from,1);if(Ra.empty){let mc=hc.resolveStack(Ra.from,-1);mc.node.from>=pc.node.from&&mc.node.to<=pc.node.to&&(pc=mc)}for(let mc=pc;mc;mc=mc.next){let{node:uf}=mc;if((uf.from<Ra.from&&uf.to>=Ra.to||uf.to>Ra.to&&uf.from<=Ra.from)&&mc.next)return EditorSelection.range(uf.to,uf.from)}return Ra});return bo.eq(vo.selection)?!1:(Ai(setSel(vo,bo)),!0)},simplifySelection=({state:vo,dispatch:Ai})=>{let bo=vo.selection,Ra=null;return bo.ranges.length>1?Ra=EditorSelection.create([bo.main]):bo.main.empty||(Ra=EditorSelection.create([EditorSelection.cursor(bo.main.head)])),Ra?(Ai(setSel(vo,Ra)),!0):!1};function deleteBy(vo,Ai){if(vo.state.readOnly)return!1;let bo="delete.selection",{state:Ra}=vo,hc=Ra.changeByRange(pc=>{let{from:mc,to:uf}=pc;if(mc==uf){let df=Ai(pc);df<mc?(bo="delete.backward",df=skipAtomic(vo,df,!1)):df>mc&&(bo="delete.forward",df=skipAtomic(vo,df,!0)),mc=Math.min(mc,df),uf=Math.max(uf,df)}else mc=skipAtomic(vo,mc,!1),uf=skipAtomic(vo,uf,!0);return mc==uf?{range:pc}:{changes:{from:mc,to:uf},range:EditorSelection.cursor(mc,mc<pc.head?-1:1)}});return hc.changes.empty?!1:(vo.dispatch(Ra.update(hc,{scrollIntoView:!0,userEvent:bo,effects:bo=="delete.selection"?EditorView.announce.of(Ra.phrase("Selection deleted")):void 0})),!0)}function skipAtomic(vo,Ai,bo){if(vo instanceof EditorView)for(let Ra of vo.state.facet(EditorView.atomicRanges).map(hc=>hc(vo)))Ra.between(Ai,Ai,(hc,pc)=>{hc<Ai&&pc>Ai&&(Ai=bo?pc:hc)});return Ai}const deleteByChar=(vo,Ai,bo)=>deleteBy(vo,Ra=>{let hc=Ra.from,{state:pc}=vo,mc=pc.doc.lineAt(hc),uf,df;if(bo&&!Ai&&hc>mc.from&&hc<mc.from+200&&!/[^ \t]/.test(uf=mc.text.slice(0,hc-mc.from))){if(uf[uf.length-1]==" ")return hc-1;let ff=countColumn(uf,pc.tabSize),hf=ff%getIndentUnit(pc)||getIndentUnit(pc);for(let pf=0;pf<hf&&uf[uf.length-1-pf]==" ";pf++)hc--;df=hc}else df=findClusterBreak(mc.text,hc-mc.from,Ai,Ai)+mc.from,df==hc&&mc.number!=(Ai?pc.doc.lines:1)?df+=Ai?1:-1:!Ai&&/[\ufe00-\ufe0f]/.test(mc.text.slice(df-mc.from,hc-mc.from))&&(df=findClusterBreak(mc.text,df-mc.from,!1,!1)+mc.from);return df}),deleteCharBackward=vo=>deleteByChar(vo,!1,!0),deleteCharForward=vo=>deleteByChar(vo,!0,!1),deleteByGroup=(vo,Ai)=>deleteBy(vo,bo=>{let Ra=bo.head,{state:hc}=vo,pc=hc.doc.lineAt(Ra),mc=hc.charCategorizer(Ra);for(let uf=null;;){if(Ra==(Ai?pc.to:pc.from)){Ra==bo.head&&pc.number!=(Ai?hc.doc.lines:1)&&(Ra+=Ai?1:-1);break}let df=findClusterBreak(pc.text,Ra-pc.from,Ai)+pc.from,ff=pc.text.slice(Math.min(Ra,df)-pc.from,Math.max(Ra,df)-pc.from),hf=mc(ff);if(uf!=null&&hf!=uf)break;(ff!=" "||Ra!=bo.head)&&(uf=hf),Ra=df}return Ra}),deleteGroupBackward=vo=>deleteByGroup(vo,!1),deleteGroupForward=vo=>deleteByGroup(vo,!0),deleteToLineEnd=vo=>deleteBy(vo,Ai=>{let bo=vo.lineBlockAt(Ai.head).to;return Ai.head<bo?bo:Math.min(vo.state.doc.length,Ai.head+1)}),deleteLineBoundaryBackward=vo=>deleteBy(vo,Ai=>{let bo=vo.moveToLineBoundary(Ai,!1).head;return Ai.head>bo?bo:Math.max(0,Ai.head-1)}),deleteLineBoundaryForward=vo=>deleteBy(vo,Ai=>{let bo=vo.moveToLineBoundary(Ai,!0).head;return Ai.head<bo?bo:Math.min(vo.state.doc.length,Ai.head+1)}),splitLine=({state:vo,dispatch:Ai})=>{if(vo.readOnly)return!1;let bo=vo.changeByRange(Ra=>({changes:{from:Ra.from,to:Ra.to,insert:Text.of(["",""])},range:EditorSelection.cursor(Ra.from)}));return Ai(vo.update(bo,{scrollIntoView:!0,userEvent:"input"})),!0},transposeChars=({state:vo,dispatch:Ai})=>{if(vo.readOnly)return!1;let bo=vo.changeByRange(Ra=>{if(!Ra.empty||Ra.from==0||Ra.from==vo.doc.length)return{range:Ra};let hc=Ra.from,pc=vo.doc.lineAt(hc),mc=hc==pc.from?hc-1:findClusterBreak(pc.text,hc-pc.from,!1)+pc.from,uf=hc==pc.to?hc+1:findClusterBreak(pc.text,hc-pc.from,!0)+pc.from;return{changes:{from:mc,to:uf,insert:vo.doc.slice(hc,uf).append(vo.doc.slice(mc,hc))},range:EditorSelection.cursor(uf)}});return bo.changes.empty?!1:(Ai(vo.update(bo,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function selectedLineBlocks(vo){let Ai=[],bo=-1;for(let Ra of vo.selection.ranges){let hc=vo.doc.lineAt(Ra.from),pc=vo.doc.lineAt(Ra.to);if(!Ra.empty&&Ra.to==pc.from&&(pc=vo.doc.lineAt(Ra.to-1)),bo>=hc.number){let mc=Ai[Ai.length-1];mc.to=pc.to,mc.ranges.push(Ra)}else Ai.push({from:hc.from,to:pc.to,ranges:[Ra]});bo=pc.number+1}return Ai}function moveLine(vo,Ai,bo){if(vo.readOnly)return!1;let Ra=[],hc=[];for(let pc of selectedLineBlocks(vo)){if(bo?pc.to==vo.doc.length:pc.from==0)continue;let mc=vo.doc.lineAt(bo?pc.to+1:pc.from-1),uf=mc.length+1;if(bo){Ra.push({from:pc.to,to:mc.to},{from:pc.from,insert:mc.text+vo.lineBreak});for(let df of pc.ranges)hc.push(EditorSelection.range(Math.min(vo.doc.length,df.anchor+uf),Math.min(vo.doc.length,df.head+uf)))}else{Ra.push({from:mc.from,to:pc.from},{from:pc.to,insert:vo.lineBreak+mc.text});for(let df of pc.ranges)hc.push(EditorSelection.range(df.anchor-uf,df.head-uf))}}return Ra.length?(Ai(vo.update({changes:Ra,scrollIntoView:!0,selection:EditorSelection.create(hc,vo.selection.mainIndex),userEvent:"move.line"})),!0):!1}const moveLineUp=({state:vo,dispatch:Ai})=>moveLine(vo,Ai,!1),moveLineDown=({state:vo,dispatch:Ai})=>moveLine(vo,Ai,!0);function copyLine(vo,Ai,bo){if(vo.readOnly)return!1;let Ra=[];for(let hc of selectedLineBlocks(vo))bo?Ra.push({from:hc.from,insert:vo.doc.slice(hc.from,hc.to)+vo.lineBreak}):Ra.push({from:hc.to,insert:vo.lineBreak+vo.doc.slice(hc.from,hc.to)});return Ai(vo.update({changes:Ra,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const copyLineUp=({state:vo,dispatch:Ai})=>copyLine(vo,Ai,!1),copyLineDown=({state:vo,dispatch:Ai})=>copyLine(vo,Ai,!0),deleteLine=vo=>{if(vo.state.readOnly)return!1;let{state:Ai}=vo,bo=Ai.changes(selectedLineBlocks(Ai).map(({from:hc,to:pc})=>(hc>0?hc--:pc<Ai.doc.length&&pc++,{from:hc,to:pc}))),Ra=updateSel(Ai.selection,hc=>{let pc;if(vo.lineWrapping){let mc=vo.lineBlockAt(hc.head),uf=vo.coordsAtPos(hc.head,hc.assoc||1);uf&&(pc=mc.bottom+vo.documentTop-uf.bottom+vo.defaultLineHeight/2)}return vo.moveVertically(hc,!0,pc)}).map(bo);return vo.dispatch({changes:bo,selection:Ra,scrollIntoView:!0,userEvent:"delete.line"}),!0};function isBetweenBrackets(vo,Ai){if(/\(\)|\[\]|\{\}/.test(vo.sliceDoc(Ai-1,Ai+1)))return{from:Ai,to:Ai};let bo=syntaxTree(vo).resolveInner(Ai),Ra=bo.childBefore(Ai),hc=bo.childAfter(Ai),pc;return Ra&&hc&&Ra.to<=Ai&&hc.from>=Ai&&(pc=Ra.type.prop(NodeProp.closedBy))&&pc.indexOf(hc.name)>-1&&vo.doc.lineAt(Ra.to).from==vo.doc.lineAt(hc.from).from&&!/\S/.test(vo.sliceDoc(Ra.to,hc.from))?{from:Ra.to,to:hc.from}:null}const insertNewlineAndIndent=newlineAndIndent(!1),insertBlankLine=newlineAndIndent(!0);function newlineAndIndent(vo){return({state:Ai,dispatch:bo})=>{if(Ai.readOnly)return!1;let Ra=Ai.changeByRange(hc=>{let{from:pc,to:mc}=hc,uf=Ai.doc.lineAt(pc),df=!vo&&pc==mc&&isBetweenBrackets(Ai,pc);vo&&(pc=mc=(mc<=uf.to?uf:Ai.doc.lineAt(mc)).to);let ff=new IndentContext(Ai,{simulateBreak:pc,simulateDoubleBreak:!!df}),hf=getIndentation(ff,pc);for(hf==null&&(hf=countColumn(/^\s*/.exec(Ai.doc.lineAt(pc).text)[0],Ai.tabSize));mc<uf.to&&/\s/.test(uf.text[mc-uf.from]);)mc++;df?{from:pc,to:mc}=df:pc>uf.from&&pc<uf.from+100&&!/\S/.test(uf.text.slice(0,pc))&&(pc=uf.from);let pf=["",indentString(Ai,hf)];return df&&pf.push(indentString(Ai,ff.lineIndent(uf.from,-1))),{changes:{from:pc,to:mc,insert:Text.of(pf)},range:EditorSelection.cursor(pc+1+pf[1].length)}});return bo(Ai.update(Ra,{scrollIntoView:!0,userEvent:"input"})),!0}}function changeBySelectedLine(vo,Ai){let bo=-1;return vo.changeByRange(Ra=>{let hc=[];for(let mc=Ra.from;mc<=Ra.to;){let uf=vo.doc.lineAt(mc);uf.number>bo&&(Ra.empty||Ra.to>uf.from)&&(Ai(uf,hc,Ra),bo=uf.number),mc=uf.to+1}let pc=vo.changes(hc);return{changes:hc,range:EditorSelection.range(pc.mapPos(Ra.anchor,1),pc.mapPos(Ra.head,1))}})}const indentSelection=({state:vo,dispatch:Ai})=>{if(vo.readOnly)return!1;let bo=Object.create(null),Ra=new IndentContext(vo,{overrideIndentation:pc=>bo[pc]??-1}),hc=changeBySelectedLine(vo,(pc,mc,uf)=>{let df=getIndentation(Ra,pc.from);if(df==null)return;/\S/.test(pc.text)||(df=0);let ff=/^\s*/.exec(pc.text)[0],hf=indentString(vo,df);(ff!=hf||uf.from<pc.from+ff.length)&&(bo[pc.from]=df,mc.push({from:pc.from,to:pc.from+ff.length,insert:hf}))});return hc.changes.empty||Ai(vo.update(hc,{userEvent:"indent"})),!0},indentMore=({state:vo,dispatch:Ai})=>vo.readOnly?!1:(Ai(vo.update(changeBySelectedLine(vo,(bo,Ra)=>{Ra.push({from:bo.from,insert:vo.facet(indentUnit)})}),{userEvent:"input.indent"})),!0),indentLess=({state:vo,dispatch:Ai})=>vo.readOnly?!1:(Ai(vo.update(changeBySelectedLine(vo,(bo,Ra)=>{let hc=/^\s*/.exec(bo.text)[0];if(!hc)return;let pc=countColumn(hc,vo.tabSize),mc=0,uf=indentString(vo,Math.max(0,pc-getIndentUnit(vo)));for(;mc<hc.length&&mc<uf.length&&hc.charCodeAt(mc)==uf.charCodeAt(mc);)mc++;Ra.push({from:bo.from+mc,to:bo.from+hc.length,insert:uf.slice(mc)})}),{userEvent:"delete.dedent"})),!0),toggleTabFocusMode=vo=>(vo.setTabFocusMode(),!0),emacsStyleKeymap=[{key:"Ctrl-b",run:cursorCharLeft,shift:selectCharLeft,preventDefault:!0},{key:"Ctrl-f",run:cursorCharRight,shift:selectCharRight},{key:"Ctrl-p",run:cursorLineUp,shift:selectLineUp},{key:"Ctrl-n",run:cursorLineDown,shift:selectLineDown},{key:"Ctrl-a",run:cursorLineStart,shift:selectLineStart},{key:"Ctrl-e",run:cursorLineEnd,shift:selectLineEnd},{key:"Ctrl-d",run:deleteCharForward},{key:"Ctrl-h",run:deleteCharBackward},{key:"Ctrl-k",run:deleteToLineEnd},{key:"Ctrl-Alt-h",run:deleteGroupBackward},{key:"Ctrl-o",run:splitLine},{key:"Ctrl-t",run:transposeChars},{key:"Ctrl-v",run:cursorPageDown}],standardKeymap=[{key:"ArrowLeft",run:cursorCharLeft,shift:selectCharLeft,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:cursorGroupLeft,shift:selectGroupLeft,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:cursorLineBoundaryLeft,shift:selectLineBoundaryLeft,preventDefault:!0},{key:"ArrowRight",run:cursorCharRight,shift:selectCharRight,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:cursorGroupRight,shift:selectGroupRight,preventDefault:!0},{mac:"Cmd-ArrowRight",run:cursorLineBoundaryRight,shift:selectLineBoundaryRight,preventDefault:!0},{key:"ArrowUp",run:cursorLineUp,shift:selectLineUp,preventDefault:!0},{mac:"Cmd-ArrowUp",run:cursorDocStart,shift:selectDocStart},{mac:"Ctrl-ArrowUp",run:cursorPageUp,shift:selectPageUp},{key:"ArrowDown",run:cursorLineDown,shift:selectLineDown,preventDefault:!0},{mac:"Cmd-ArrowDown",run:cursorDocEnd,shift:selectDocEnd},{mac:"Ctrl-ArrowDown",run:cursorPageDown,shift:selectPageDown},{key:"PageUp",run:cursorPageUp,shift:selectPageUp},{key:"PageDown",run:cursorPageDown,shift:selectPageDown},{key:"Home",run:cursorLineBoundaryBackward,shift:selectLineBoundaryBackward,preventDefault:!0},{key:"Mod-Home",run:cursorDocStart,shift:selectDocStart},{key:"End",run:cursorLineBoundaryForward,shift:selectLineBoundaryForward,preventDefault:!0},{key:"Mod-End",run:cursorDocEnd,shift:selectDocEnd},{key:"Enter",run:insertNewlineAndIndent,shift:insertNewlineAndIndent},{key:"Mod-a",run:selectAll},{key:"Backspace",run:deleteCharBackward,shift:deleteCharBackward},{key:"Delete",run:deleteCharForward},{key:"Mod-Backspace",mac:"Alt-Backspace",run:deleteGroupBackward},{key:"Mod-Delete",mac:"Alt-Delete",run:deleteGroupForward},{mac:"Mod-Backspace",run:deleteLineBoundaryBackward},{mac:"Mod-Delete",run:deleteLineBoundaryForward}].concat(emacsStyleKeymap.map(vo=>({mac:vo.key,run:vo.run,shift:vo.shift}))),defaultKeymap=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:cursorSyntaxLeft,shift:selectSyntaxLeft},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:cursorSyntaxRight,shift:selectSyntaxRight},{key:"Alt-ArrowUp",run:moveLineUp},{key:"Shift-Alt-ArrowUp",run:copyLineUp},{key:"Alt-ArrowDown",run:moveLineDown},{key:"Shift-Alt-ArrowDown",run:copyLineDown},{key:"Escape",run:simplifySelection},{key:"Mod-Enter",run:insertBlankLine},{key:"Alt-l",mac:"Ctrl-l",run:selectLine},{key:"Mod-i",run:selectParentSyntax,preventDefault:!0},{key:"Mod-[",run:indentLess},{key:"Mod-]",run:indentMore},{key:"Mod-Alt-\\",run:indentSelection},{key:"Shift-Mod-k",run:deleteLine},{key:"Shift-Mod-\\",run:cursorMatchingBracket},{key:"Mod-/",run:toggleComment},{key:"Alt-A",run:toggleBlockComment},{key:"Ctrl-m",mac:"Shift-Alt-m",run:toggleTabFocusMode}].concat(standardKeymap),indentWithTab={key:"Tab",run:indentMore,shift:indentLess},basicNormalize=typeof String.prototype.normalize=="function"?vo=>vo.normalize("NFKD"):vo=>vo;class SearchCursor{constructor(Ai,bo,Ra=0,hc=Ai.length,pc,mc){this.test=mc,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=Ai.iterRange(Ra,hc),this.bufferStart=Ra,this.normalize=pc?uf=>pc(basicNormalize(uf)):basicNormalize,this.query=this.normalize(bo)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return codePointAt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let Ai=this.peek();if(Ai<0)return this.done=!0,this;let bo=fromCodePoint(Ai),Ra=this.bufferStart+this.bufferPos;this.bufferPos+=codePointSize(Ai);let hc=this.normalize(bo);if(hc.length)for(let pc=0,mc=Ra;;pc++){let uf=hc.charCodeAt(pc),df=this.match(uf,mc,this.bufferPos+this.bufferStart);if(pc==hc.length-1){if(df)return this.value=df,this;break}mc==Ra&&pc<bo.length&&bo.charCodeAt(pc)==uf&&mc++}}}match(Ai,bo,Ra){let hc=null;for(let pc=0;pc<this.matches.length;pc+=2){let mc=this.matches[pc],uf=!1;this.query.charCodeAt(mc)==Ai&&(mc==this.query.length-1?hc={from:this.matches[pc+1],to:Ra}:(this.matches[pc]++,uf=!0)),uf||(this.matches.splice(pc,2),pc-=2)}return this.query.charCodeAt(0)==Ai&&(this.query.length==1?hc={from:bo,to:Ra}:this.matches.push(1,bo)),hc&&this.test&&!this.test(hc.from,hc.to,this.buffer,this.bufferStart)&&(hc=null),hc}}typeof Symbol<"u"&&(SearchCursor.prototype[Symbol.iterator]=function(){return this});const empty={from:-1,to:-1,match:/.*/.exec("")},baseFlags="gm"+(/x/.unicode==null?"":"u");class RegExpCursor{constructor(Ai,bo,Ra,hc=0,pc=Ai.length){if(this.text=Ai,this.to=pc,this.curLine="",this.done=!1,this.value=empty,/\\[sWDnr]|\n|\r|\[\^/.test(bo))return new MultilineRegExpCursor(Ai,bo,Ra,hc,pc);this.re=new RegExp(bo,baseFlags+(Ra!=null&&Ra.ignoreCase?"i":"")),this.test=Ra==null?void 0:Ra.test,this.iter=Ai.iter();let mc=Ai.lineAt(hc);this.curLineStart=mc.from,this.matchPos=toCharEnd(Ai,hc),this.getLine(this.curLineStart)}getLine(Ai){this.iter.next(Ai),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let Ai=this.matchPos-this.curLineStart;;){this.re.lastIndex=Ai;let bo=this.matchPos<=this.to&&this.re.exec(this.curLine);if(bo){let Ra=this.curLineStart+bo.index,hc=Ra+bo[0].length;if(this.matchPos=toCharEnd(this.text,hc+(Ra==hc?1:0)),Ra==this.curLineStart+this.curLine.length&&this.nextLine(),(Ra<hc||Ra>this.value.to)&&(!this.test||this.test(Ra,hc,bo)))return this.value={from:Ra,to:hc,match:bo},this;Ai=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),Ai=0;else return this.done=!0,this}}}const flattened=new WeakMap;class FlattenedDoc{constructor(Ai,bo){this.from=Ai,this.text=bo}get to(){return this.from+this.text.length}static get(Ai,bo,Ra){let hc=flattened.get(Ai);if(!hc||hc.from>=Ra||hc.to<=bo){let uf=new FlattenedDoc(bo,Ai.sliceString(bo,Ra));return flattened.set(Ai,uf),uf}if(hc.from==bo&&hc.to==Ra)return hc;let{text:pc,from:mc}=hc;return mc>bo&&(pc=Ai.sliceString(bo,mc)+pc,mc=bo),hc.to<Ra&&(pc+=Ai.sliceString(hc.to,Ra)),flattened.set(Ai,new FlattenedDoc(mc,pc)),new FlattenedDoc(bo,pc.slice(bo-mc,Ra-mc))}}class MultilineRegExpCursor{constructor(Ai,bo,Ra,hc,pc){this.text=Ai,this.to=pc,this.done=!1,this.value=empty,this.matchPos=toCharEnd(Ai,hc),this.re=new RegExp(bo,baseFlags+(Ra!=null&&Ra.ignoreCase?"i":"")),this.test=Ra==null?void 0:Ra.test,this.flat=FlattenedDoc.get(Ai,hc,this.chunkEnd(hc+5e3))}chunkEnd(Ai){return Ai>=this.to?this.to:this.text.lineAt(Ai).to}next(){for(;;){let Ai=this.re.lastIndex=this.matchPos-this.flat.from,bo=this.re.exec(this.flat.text);if(bo&&!bo[0]&&bo.index==Ai&&(this.re.lastIndex=Ai+1,bo=this.re.exec(this.flat.text)),bo){let Ra=this.flat.from+bo.index,hc=Ra+bo[0].length;if((this.flat.to>=this.to||bo.index+bo[0].length<=this.flat.text.length-10)&&(!this.test||this.test(Ra,hc,bo)))return this.value={from:Ra,to:hc,match:bo},this.matchPos=toCharEnd(this.text,hc+(Ra==hc?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=FlattenedDoc.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(RegExpCursor.prototype[Symbol.iterator]=MultilineRegExpCursor.prototype[Symbol.iterator]=function(){return this});function validRegExp(vo){try{return new RegExp(vo,baseFlags),!0}catch{return!1}}function toCharEnd(vo,Ai){if(Ai>=vo.length)return Ai;let bo=vo.lineAt(Ai),Ra;for(;Ai<bo.to&&(Ra=bo.text.charCodeAt(Ai-bo.from))>=56320&&Ra<57344;)Ai++;return Ai}function createLineDialog(vo){let Ai=String(vo.state.doc.lineAt(vo.state.selection.main.head).number),bo=crelt("input",{class:"cm-textfield",name:"line",value:Ai}),Ra=crelt("form",{class:"cm-gotoLine",onkeydown:pc=>{pc.keyCode==27?(pc.preventDefault(),vo.dispatch({effects:dialogEffect.of(!1)}),vo.focus()):pc.keyCode==13&&(pc.preventDefault(),hc())},onsubmit:pc=>{pc.preventDefault(),hc()}},crelt("label",vo.state.phrase("Go to line"),": ",bo)," ",crelt("button",{class:"cm-button",type:"submit"},vo.state.phrase("go")));function hc(){let pc=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(bo.value);if(!pc)return;let{state:mc}=vo,uf=mc.doc.lineAt(mc.selection.main.head),[,df,ff,hf,pf]=pc,mf=hf?+hf.slice(1):0,gf=ff?+ff:uf.number;if(ff&&pf){let bf=gf/100;df&&(bf=bf*(df=="-"?-1:1)+uf.number/mc.doc.lines),gf=Math.round(mc.doc.lines*bf)}else ff&&df&&(gf=gf*(df=="-"?-1:1)+uf.number);let yf=mc.doc.line(Math.max(1,Math.min(mc.doc.lines,gf))),vf=EditorSelection.cursor(yf.from+Math.max(0,Math.min(mf,yf.length)));vo.dispatch({effects:[dialogEffect.of(!1),EditorView.scrollIntoView(vf.from,{y:"center"})],selection:vf}),vo.focus()}return{dom:Ra}}const dialogEffect=StateEffect.define(),dialogField=StateField.define({create(){return!0},update(vo,Ai){for(let bo of Ai.effects)bo.is(dialogEffect)&&(vo=bo.value);return vo},provide:vo=>showPanel.from(vo,Ai=>Ai?createLineDialog:null)}),gotoLine=vo=>{let Ai=getPanel(vo,createLineDialog);if(!Ai){let bo=[dialogEffect.of(!0)];vo.state.field(dialogField,!1)==null&&bo.push(StateEffect.appendConfig.of([dialogField,baseTheme$1])),vo.dispatch({effects:bo}),Ai=getPanel(vo,createLineDialog)}return Ai&&Ai.dom.querySelector("input").select(),!0},baseTheme$1=EditorView.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),defaultHighlightOptions={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},highlightConfig=Facet.define({combine(vo){return combineConfig(vo,defaultHighlightOptions,{highlightWordAroundCursor:(Ai,bo)=>Ai||bo,minSelectionLength:Math.min,maxMatches:Math.min})}});function highlightSelectionMatches(vo){return[defaultTheme,matchHighlighter]}const matchDeco=Decoration.mark({class:"cm-selectionMatch"}),mainMatchDeco=Decoration.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function insideWordBoundaries(vo,Ai,bo,Ra){return(bo==0||vo(Ai.sliceDoc(bo-1,bo))!=CharCategory.Word)&&(Ra==Ai.doc.length||vo(Ai.sliceDoc(Ra,Ra+1))!=CharCategory.Word)}function insideWord(vo,Ai,bo,Ra){return vo(Ai.sliceDoc(bo,bo+1))==CharCategory.Word&&vo(Ai.sliceDoc(Ra-1,Ra))==CharCategory.Word}const matchHighlighter=ViewPlugin.fromClass(class{constructor(vo){this.decorations=this.getDeco(vo)}update(vo){(vo.selectionSet||vo.docChanged||vo.viewportChanged)&&(this.decorations=this.getDeco(vo.view))}getDeco(vo){let Ai=vo.state.facet(highlightConfig),{state:bo}=vo,Ra=bo.selection;if(Ra.ranges.length>1)return Decoration.none;let hc=Ra.main,pc,mc=null;if(hc.empty){if(!Ai.highlightWordAroundCursor)return Decoration.none;let df=bo.wordAt(hc.head);if(!df)return Decoration.none;mc=bo.charCategorizer(hc.head),pc=bo.sliceDoc(df.from,df.to)}else{let df=hc.to-hc.from;if(df<Ai.minSelectionLength||df>200)return Decoration.none;if(Ai.wholeWords){if(pc=bo.sliceDoc(hc.from,hc.to),mc=bo.charCategorizer(hc.head),!(insideWordBoundaries(mc,bo,hc.from,hc.to)&&insideWord(mc,bo,hc.from,hc.to)))return Decoration.none}else if(pc=bo.sliceDoc(hc.from,hc.to),!pc)return Decoration.none}let uf=[];for(let df of vo.visibleRanges){let ff=new SearchCursor(bo.doc,pc,df.from,df.to);for(;!ff.next().done;){let{from:hf,to:pf}=ff.value;if((!mc||insideWordBoundaries(mc,bo,hf,pf))&&(hc.empty&&hf<=hc.from&&pf>=hc.to?uf.push(mainMatchDeco.range(hf,pf)):(hf>=hc.to||pf<=hc.from)&&uf.push(matchDeco.range(hf,pf)),uf.length>Ai.maxMatches))return Decoration.none}}return Decoration.set(uf)}},{decorations:vo=>vo.decorations}),defaultTheme=EditorView.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),selectWord=({state:vo,dispatch:Ai})=>{let{selection:bo}=vo,Ra=EditorSelection.create(bo.ranges.map(hc=>vo.wordAt(hc.head)||EditorSelection.cursor(hc.head)),bo.mainIndex);return Ra.eq(bo)?!1:(Ai(vo.update({selection:Ra})),!0)};function findNextOccurrence(vo,Ai){let{main:bo,ranges:Ra}=vo.selection,hc=vo.wordAt(bo.head),pc=hc&&hc.from==bo.from&&hc.to==bo.to;for(let mc=!1,uf=new SearchCursor(vo.doc,Ai,Ra[Ra.length-1].to);;)if(uf.next(),uf.done){if(mc)return null;uf=new SearchCursor(vo.doc,Ai,0,Math.max(0,Ra[Ra.length-1].from-1)),mc=!0}else{if(mc&&Ra.some(df=>df.from==uf.value.from))continue;if(pc){let df=vo.wordAt(uf.value.from);if(!df||df.from!=uf.value.from||df.to!=uf.value.to)continue}return uf.value}}const selectNextOccurrence=({state:vo,dispatch:Ai})=>{let{ranges:bo}=vo.selection;if(bo.some(pc=>pc.from===pc.to))return selectWord({state:vo,dispatch:Ai});let Ra=vo.sliceDoc(bo[0].from,bo[0].to);if(vo.selection.ranges.some(pc=>vo.sliceDoc(pc.from,pc.to)!=Ra))return!1;let hc=findNextOccurrence(vo,Ra);return hc?(Ai(vo.update({selection:vo.selection.addRange(EditorSelection.range(hc.from,hc.to),!1),effects:EditorView.scrollIntoView(hc.to)})),!0):!1},searchConfigFacet=Facet.define({combine(vo){return combineConfig(vo,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:Ai=>new SearchPanel(Ai),scrollToMatch:Ai=>EditorView.scrollIntoView(Ai)})}});class SearchQuery{constructor(Ai){this.search=Ai.search,this.caseSensitive=!!Ai.caseSensitive,this.literal=!!Ai.literal,this.regexp=!!Ai.regexp,this.replace=Ai.replace||"",this.valid=!!this.search&&(!this.regexp||validRegExp(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!Ai.wholeWord}unquote(Ai){return this.literal?Ai:Ai.replace(/\\([nrt\\])/g,(bo,Ra)=>Ra=="n"?`
|
|
375
|
-
`:Ra=="r"?"\r":Ra=="t"?" ":"\\")}eq(Ai){return this.search==Ai.search&&this.replace==Ai.replace&&this.caseSensitive==Ai.caseSensitive&&this.regexp==Ai.regexp&&this.wholeWord==Ai.wholeWord}create(){return this.regexp?new RegExpQuery(this):new StringQuery(this)}getCursor(Ai,bo=0,Ra){let hc=Ai.doc?Ai:EditorState.create({doc:Ai});return Ra==null&&(Ra=hc.doc.length),this.regexp?regexpCursor(this,hc,bo,Ra):stringCursor(this,hc,bo,Ra)}}class QueryType{constructor(Ai){this.spec=Ai}}function stringCursor(vo,Ai,bo,Ra){return new SearchCursor(Ai.doc,vo.unquoted,bo,Ra,vo.caseSensitive?void 0:hc=>hc.toLowerCase(),vo.wholeWord?stringWordTest(Ai.doc,Ai.charCategorizer(Ai.selection.main.head)):void 0)}function stringWordTest(vo,Ai){return(bo,Ra,hc,pc)=>((pc>bo||pc+hc.length<Ra)&&(pc=Math.max(0,bo-2),hc=vo.sliceString(pc,Math.min(vo.length,Ra+2))),(Ai(charBefore(hc,bo-pc))!=CharCategory.Word||Ai(charAfter(hc,bo-pc))!=CharCategory.Word)&&(Ai(charAfter(hc,Ra-pc))!=CharCategory.Word||Ai(charBefore(hc,Ra-pc))!=CharCategory.Word))}class StringQuery extends QueryType{constructor(Ai){super(Ai)}nextMatch(Ai,bo,Ra){let hc=stringCursor(this.spec,Ai,Ra,Ai.doc.length).nextOverlapping();if(hc.done){let pc=Math.min(Ai.doc.length,bo+this.spec.unquoted.length);hc=stringCursor(this.spec,Ai,0,pc).nextOverlapping()}return hc.done||hc.value.from==bo&&hc.value.to==Ra?null:hc.value}prevMatchInRange(Ai,bo,Ra){for(let hc=Ra;;){let pc=Math.max(bo,hc-1e4-this.spec.unquoted.length),mc=stringCursor(this.spec,Ai,pc,hc),uf=null;for(;!mc.nextOverlapping().done;)uf=mc.value;if(uf)return uf;if(pc==bo)return null;hc-=1e4}}prevMatch(Ai,bo,Ra){let hc=this.prevMatchInRange(Ai,0,bo);return hc||(hc=this.prevMatchInRange(Ai,Math.max(0,Ra-this.spec.unquoted.length),Ai.doc.length)),hc&&(hc.from!=bo||hc.to!=Ra)?hc:null}getReplacement(Ai){return this.spec.unquote(this.spec.replace)}matchAll(Ai,bo){let Ra=stringCursor(this.spec,Ai,0,Ai.doc.length),hc=[];for(;!Ra.next().done;){if(hc.length>=bo)return null;hc.push(Ra.value)}return hc}highlight(Ai,bo,Ra,hc){let pc=stringCursor(this.spec,Ai,Math.max(0,bo-this.spec.unquoted.length),Math.min(Ra+this.spec.unquoted.length,Ai.doc.length));for(;!pc.next().done;)hc(pc.value.from,pc.value.to)}}function regexpCursor(vo,Ai,bo,Ra){return new RegExpCursor(Ai.doc,vo.search,{ignoreCase:!vo.caseSensitive,test:vo.wholeWord?regexpWordTest(Ai.charCategorizer(Ai.selection.main.head)):void 0},bo,Ra)}function charBefore(vo,Ai){return vo.slice(findClusterBreak(vo,Ai,!1),Ai)}function charAfter(vo,Ai){return vo.slice(Ai,findClusterBreak(vo,Ai))}function regexpWordTest(vo){return(Ai,bo,Ra)=>!Ra[0].length||(vo(charBefore(Ra.input,Ra.index))!=CharCategory.Word||vo(charAfter(Ra.input,Ra.index))!=CharCategory.Word)&&(vo(charAfter(Ra.input,Ra.index+Ra[0].length))!=CharCategory.Word||vo(charBefore(Ra.input,Ra.index+Ra[0].length))!=CharCategory.Word)}class RegExpQuery extends QueryType{nextMatch(Ai,bo,Ra){let hc=regexpCursor(this.spec,Ai,Ra,Ai.doc.length).next();return hc.done&&(hc=regexpCursor(this.spec,Ai,0,bo).next()),hc.done?null:hc.value}prevMatchInRange(Ai,bo,Ra){for(let hc=1;;hc++){let pc=Math.max(bo,Ra-hc*1e4),mc=regexpCursor(this.spec,Ai,pc,Ra),uf=null;for(;!mc.next().done;)uf=mc.value;if(uf&&(pc==bo||uf.from>pc+10))return uf;if(pc==bo)return null}}prevMatch(Ai,bo,Ra){return this.prevMatchInRange(Ai,0,bo)||this.prevMatchInRange(Ai,Ra,Ai.doc.length)}getReplacement(Ai){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(bo,Ra)=>Ra=="$"?"$":Ra=="&"?Ai.match[0]:Ra!="0"&&+Ra<Ai.match.length?Ai.match[Ra]:bo)}matchAll(Ai,bo){let Ra=regexpCursor(this.spec,Ai,0,Ai.doc.length),hc=[];for(;!Ra.next().done;){if(hc.length>=bo)return null;hc.push(Ra.value)}return hc}highlight(Ai,bo,Ra,hc){let pc=regexpCursor(this.spec,Ai,Math.max(0,bo-250),Math.min(Ra+250,Ai.doc.length));for(;!pc.next().done;)hc(pc.value.from,pc.value.to)}}const setSearchQuery=StateEffect.define(),togglePanel=StateEffect.define(),searchState=StateField.define({create(vo){return new SearchState(defaultQuery(vo).create(),null)},update(vo,Ai){for(let bo of Ai.effects)bo.is(setSearchQuery)?vo=new SearchState(bo.value.create(),vo.panel):bo.is(togglePanel)&&(vo=new SearchState(vo.query,bo.value?createSearchPanel:null));return vo},provide:vo=>showPanel.from(vo,Ai=>Ai.panel)});class SearchState{constructor(Ai,bo){this.query=Ai,this.panel=bo}}const matchMark=Decoration.mark({class:"cm-searchMatch"}),selectedMatchMark=Decoration.mark({class:"cm-searchMatch cm-searchMatch-selected"}),searchHighlighter=ViewPlugin.fromClass(class{constructor(vo){this.view=vo,this.decorations=this.highlight(vo.state.field(searchState))}update(vo){let Ai=vo.state.field(searchState);(Ai!=vo.startState.field(searchState)||vo.docChanged||vo.selectionSet||vo.viewportChanged)&&(this.decorations=this.highlight(Ai))}highlight({query:vo,panel:Ai}){if(!Ai||!vo.spec.valid)return Decoration.none;let{view:bo}=this,Ra=new RangeSetBuilder;for(let hc=0,pc=bo.visibleRanges,mc=pc.length;hc<mc;hc++){let{from:uf,to:df}=pc[hc];for(;hc<mc-1&&df>pc[hc+1].from-2*250;)df=pc[++hc].to;vo.highlight(bo.state,uf,df,(ff,hf)=>{let pf=bo.state.selection.ranges.some(mf=>mf.from==ff&&mf.to==hf);Ra.add(ff,hf,pf?selectedMatchMark:matchMark)})}return Ra.finish()}},{decorations:vo=>vo.decorations});function searchCommand(vo){return Ai=>{let bo=Ai.state.field(searchState,!1);return bo&&bo.query.spec.valid?vo(Ai,bo):openSearchPanel(Ai)}}const findNext=searchCommand((vo,{query:Ai})=>{let{to:bo}=vo.state.selection.main,Ra=Ai.nextMatch(vo.state,bo,bo);if(!Ra)return!1;let hc=EditorSelection.single(Ra.from,Ra.to),pc=vo.state.facet(searchConfigFacet);return vo.dispatch({selection:hc,effects:[announceMatch(vo,Ra),pc.scrollToMatch(hc.main,vo)],userEvent:"select.search"}),selectSearchInput(vo),!0}),findPrevious=searchCommand((vo,{query:Ai})=>{let{state:bo}=vo,{from:Ra}=bo.selection.main,hc=Ai.prevMatch(bo,Ra,Ra);if(!hc)return!1;let pc=EditorSelection.single(hc.from,hc.to),mc=vo.state.facet(searchConfigFacet);return vo.dispatch({selection:pc,effects:[announceMatch(vo,hc),mc.scrollToMatch(pc.main,vo)],userEvent:"select.search"}),selectSearchInput(vo),!0}),selectMatches=searchCommand((vo,{query:Ai})=>{let bo=Ai.matchAll(vo.state,1e3);return!bo||!bo.length?!1:(vo.dispatch({selection:EditorSelection.create(bo.map(Ra=>EditorSelection.range(Ra.from,Ra.to))),userEvent:"select.search.matches"}),!0)}),selectSelectionMatches=({state:vo,dispatch:Ai})=>{let bo=vo.selection;if(bo.ranges.length>1||bo.main.empty)return!1;let{from:Ra,to:hc}=bo.main,pc=[],mc=0;for(let uf=new SearchCursor(vo.doc,vo.sliceDoc(Ra,hc));!uf.next().done;){if(pc.length>1e3)return!1;uf.value.from==Ra&&(mc=pc.length),pc.push(EditorSelection.range(uf.value.from,uf.value.to))}return Ai(vo.update({selection:EditorSelection.create(pc,mc),userEvent:"select.search.matches"})),!0},replaceNext=searchCommand((vo,{query:Ai})=>{let{state:bo}=vo,{from:Ra,to:hc}=bo.selection.main;if(bo.readOnly)return!1;let pc=Ai.nextMatch(bo,Ra,Ra);if(!pc)return!1;let mc=pc,uf=[],df,ff,hf=[];if(mc.from==Ra&&mc.to==hc&&(ff=bo.toText(Ai.getReplacement(mc)),uf.push({from:mc.from,to:mc.to,insert:ff}),mc=Ai.nextMatch(bo,mc.from,mc.to),hf.push(EditorView.announce.of(bo.phrase("replaced match on line $",bo.doc.lineAt(Ra).number)+"."))),mc){let pf=uf.length==0||uf[0].from>=pc.to?0:pc.to-pc.from-ff.length;df=EditorSelection.single(mc.from-pf,mc.to-pf),hf.push(announceMatch(vo,mc)),hf.push(bo.facet(searchConfigFacet).scrollToMatch(df.main,vo))}return vo.dispatch({changes:uf,selection:df,effects:hf,userEvent:"input.replace"}),!0}),replaceAll=searchCommand((vo,{query:Ai})=>{if(vo.state.readOnly)return!1;let bo=Ai.matchAll(vo.state,1e9).map(hc=>{let{from:pc,to:mc}=hc;return{from:pc,to:mc,insert:Ai.getReplacement(hc)}});if(!bo.length)return!1;let Ra=vo.state.phrase("replaced $ matches",bo.length)+".";return vo.dispatch({changes:bo,effects:EditorView.announce.of(Ra),userEvent:"input.replace.all"}),!0});function createSearchPanel(vo){return vo.state.facet(searchConfigFacet).createPanel(vo)}function defaultQuery(vo,Ai){var bo,Ra,hc,pc,mc;let uf=vo.selection.main,df=uf.empty||uf.to>uf.from+100?"":vo.sliceDoc(uf.from,uf.to);if(Ai&&!df)return Ai;let ff=vo.facet(searchConfigFacet);return new SearchQuery({search:((bo=Ai==null?void 0:Ai.literal)!==null&&bo!==void 0?bo:ff.literal)?df:df.replace(/\n/g,"\\n"),caseSensitive:(Ra=Ai==null?void 0:Ai.caseSensitive)!==null&&Ra!==void 0?Ra:ff.caseSensitive,literal:(hc=Ai==null?void 0:Ai.literal)!==null&&hc!==void 0?hc:ff.literal,regexp:(pc=Ai==null?void 0:Ai.regexp)!==null&&pc!==void 0?pc:ff.regexp,wholeWord:(mc=Ai==null?void 0:Ai.wholeWord)!==null&&mc!==void 0?mc:ff.wholeWord})}function getSearchInput(vo){let Ai=getPanel(vo,createSearchPanel);return Ai&&Ai.dom.querySelector("[main-field]")}function selectSearchInput(vo){let Ai=getSearchInput(vo);Ai&&Ai==vo.root.activeElement&&Ai.select()}const openSearchPanel=vo=>{let Ai=vo.state.field(searchState,!1);if(Ai&&Ai.panel){let bo=getSearchInput(vo);if(bo&&bo!=vo.root.activeElement){let Ra=defaultQuery(vo.state,Ai.query.spec);Ra.valid&&vo.dispatch({effects:setSearchQuery.of(Ra)}),bo.focus(),bo.select()}}else vo.dispatch({effects:[togglePanel.of(!0),Ai?setSearchQuery.of(defaultQuery(vo.state,Ai.query.spec)):StateEffect.appendConfig.of(searchExtensions)]});return!0},closeSearchPanel=vo=>{let Ai=vo.state.field(searchState,!1);if(!Ai||!Ai.panel)return!1;let bo=getPanel(vo,createSearchPanel);return bo&&bo.dom.contains(vo.root.activeElement)&&vo.focus(),vo.dispatch({effects:togglePanel.of(!1)}),!0},searchKeymap=[{key:"Mod-f",run:openSearchPanel,scope:"editor search-panel"},{key:"F3",run:findNext,shift:findPrevious,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:findNext,shift:findPrevious,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:closeSearchPanel,scope:"editor search-panel"},{key:"Mod-Shift-l",run:selectSelectionMatches},{key:"Mod-Alt-g",run:gotoLine},{key:"Mod-d",run:selectNextOccurrence,preventDefault:!0}];class SearchPanel{constructor(Ai){this.view=Ai;let bo=this.query=Ai.state.field(searchState).query.spec;this.commit=this.commit.bind(this),this.searchField=crelt("input",{value:bo.search,placeholder:phrase(Ai,"Find"),"aria-label":phrase(Ai,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=crelt("input",{value:bo.replace,placeholder:phrase(Ai,"Replace"),"aria-label":phrase(Ai,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=crelt("input",{type:"checkbox",name:"case",form:"",checked:bo.caseSensitive,onchange:this.commit}),this.reField=crelt("input",{type:"checkbox",name:"re",form:"",checked:bo.regexp,onchange:this.commit}),this.wordField=crelt("input",{type:"checkbox",name:"word",form:"",checked:bo.wholeWord,onchange:this.commit});function Ra(hc,pc,mc){return crelt("button",{class:"cm-button",name:hc,onclick:pc,type:"button"},mc)}this.dom=crelt("div",{onkeydown:hc=>this.keydown(hc),class:"cm-search"},[this.searchField,Ra("next",()=>findNext(Ai),[phrase(Ai,"next")]),Ra("prev",()=>findPrevious(Ai),[phrase(Ai,"previous")]),Ra("select",()=>selectMatches(Ai),[phrase(Ai,"all")]),crelt("label",null,[this.caseField,phrase(Ai,"match case")]),crelt("label",null,[this.reField,phrase(Ai,"regexp")]),crelt("label",null,[this.wordField,phrase(Ai,"by word")]),...Ai.state.readOnly?[]:[crelt("br"),this.replaceField,Ra("replace",()=>replaceNext(Ai),[phrase(Ai,"replace")]),Ra("replaceAll",()=>replaceAll(Ai),[phrase(Ai,"replace all")])],crelt("button",{name:"close",onclick:()=>closeSearchPanel(Ai),"aria-label":phrase(Ai,"close"),type:"button"},["×"])])}commit(){let Ai=new SearchQuery({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});Ai.eq(this.query)||(this.query=Ai,this.view.dispatch({effects:setSearchQuery.of(Ai)}))}keydown(Ai){runScopeHandlers(this.view,Ai,"search-panel")?Ai.preventDefault():Ai.keyCode==13&&Ai.target==this.searchField?(Ai.preventDefault(),(Ai.shiftKey?findPrevious:findNext)(this.view)):Ai.keyCode==13&&Ai.target==this.replaceField&&(Ai.preventDefault(),replaceNext(this.view))}update(Ai){for(let bo of Ai.transactions)for(let Ra of bo.effects)Ra.is(setSearchQuery)&&!Ra.value.eq(this.query)&&this.setQuery(Ra.value)}setQuery(Ai){this.query=Ai,this.searchField.value=Ai.search,this.replaceField.value=Ai.replace,this.caseField.checked=Ai.caseSensitive,this.reField.checked=Ai.regexp,this.wordField.checked=Ai.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(searchConfigFacet).top}}function phrase(vo,Ai){return vo.state.phrase(Ai)}const AnnounceMargin=30,Break=/[\s\.,:;?!]/;function announceMatch(vo,{from:Ai,to:bo}){let Ra=vo.state.doc.lineAt(Ai),hc=vo.state.doc.lineAt(bo).to,pc=Math.max(Ra.from,Ai-AnnounceMargin),mc=Math.min(hc,bo+AnnounceMargin),uf=vo.state.sliceDoc(pc,mc);if(pc!=Ra.from){for(let df=0;df<AnnounceMargin;df++)if(!Break.test(uf[df+1])&&Break.test(uf[df])){uf=uf.slice(df);break}}if(mc!=hc){for(let df=uf.length-1;df>uf.length-AnnounceMargin;df--)if(!Break.test(uf[df-1])&&Break.test(uf[df])){uf=uf.slice(0,df);break}}return EditorView.announce.of(`${vo.state.phrase("current match")}. ${uf} ${vo.state.phrase("on line")} ${Ra.number}.`)}const baseTheme=EditorView.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),searchExtensions=[searchState,Prec.low(searchHighlighter),baseTheme];function convertGraphQLErrorToDiagnostic(vo){var Ai,bo,Ra,hc;return{from:(Ai=vo.locations)!=null&&Ai[0]?((bo=vo.positions)==null?void 0:bo[0])??0:0,to:(Ra=vo.locations)!=null&&Ra[0]?(((hc=vo.positions)==null?void 0:hc[0])??0)+1:1,severity:"error",message:vo.message}}function makeLinter(vo,Ai){return linter(bo=>{const Ra=bo.state.doc.toString();let hc=[];if(Ai&&(hc=hc.concat(Ai(Ra))),isDocumentString(Ra))try{const pc=parse(Ra),mc=new Set(pc.definitions.filter(ff=>"name"in ff&&ff.name).map(ff=>ff.name.value)),uf=filterSchema({schema:vo,typeFilter:ff=>!mc.has(ff)}),df=validateSDL(pc,uf).map(ff=>locatedError(ff,pc)).filter((ff,hf,pf)=>hf===pf.findIndex(mf=>{var gf,yf,vf,bf,Sf,xf,wf,s1;return mf.message===ff.message&&((yf=(gf=mf.locations)==null?void 0:gf[0])==null?void 0:yf.line)===((bf=(vf=ff.locations)==null?void 0:vf[0])==null?void 0:bf.line)&&((xf=(Sf=mf.locations)==null?void 0:Sf[0])==null?void 0:xf.column)===((s1=(wf=ff.locations)==null?void 0:wf[0])==null?void 0:s1.column)}));hc=hc.concat(df.map(convertGraphQLErrorToDiagnostic))}catch(pc){pc instanceof GraphQLError&&hc.push(convertGraphQLErrorToDiagnostic(pc))}return hc})}function makeUpdateHandler(vo,Ai,bo){return EditorView.updateListener.of(Ra=>{if(vo||!Ra.docChanged||Ra.transactions.some(pc=>pc.annotation(Transaction.userEvent)==="external"))return;const hc=Ra.state.doc.toString();Ai.current&&clearTimeout(Ai.current),Ai.current=setTimeout(()=>{bo==null||bo(hc)},updateTimeout)})}function makeFocusHandler(vo,Ai,bo){return EditorView.focusChangeEffect.of((Ra,hc)=>{if(vo||hc)return null;Ai.current&&clearTimeout(Ai.current);const pc=Ra.doc.toString();return bo==null||bo(pc),null})}function makePasteHandler(vo,Ai,bo){return EditorView.domEventHandlers({paste:(Ra,hc)=>{if(vo)return!1;const pc=hc.state.doc.toString();return Ai.current&&clearTimeout(Ai.current),bo==null||bo(pc),forceLinting(hc),!1}})}function useEditorRefs(){const vo=useRef(null),Ai=useRef(null),bo=useRef(new Compartment),Ra=useRef(new Compartment),hc=useRef(new Compartment),pc=useRef(null);return{editorRef:vo,viewRef:Ai,updateListenerCompartment:bo,focusHandlerCompartment:Ra,pasteHandlerCompartment:hc,timeoutRef:pc}}function useEditorCleanup(vo){useEffect(()=>()=>{vo.current&&(vo.current.destroy(),vo.current=null)},[])}function useHandlerReconfiguration(vo,Ai,bo,Ra,hc){useEffect(()=>{vo&&(vo.dispatch({effects:[hc.updateListener.reconfigure(makeUpdateHandler(Ai,bo,Ra)),hc.focusHandler.reconfigure(makeFocusHandler(Ai,bo,Ra)),hc.pasteHandler.reconfigure(makePasteHandler(Ai,bo,Ra))]}),forceLinting(vo))},[Ai,Ra])}function useDocumentSync(vo,Ai){useEffect(()=>{if(!vo)return;const bo=vo.state.doc.toString();bo!==Ai&&(vo.dispatch({changes:{from:0,to:bo.length,insert:Ai},annotations:[Transaction.userEvent.of("external")]}),forceLinting(vo))},[Ai])}const baseEditorExtensions=[lineNumbers(),highlightActiveLineGutter(),highlightSpecialChars(),history(),foldGutter(),drawSelection(),dropCursor(),EditorState.allowMultipleSelections.of(!0),indentOnInput(),syntaxHighlighting(defaultHighlightStyle,{fallback:!0}),bracketMatching(),closeBrackets(),autocompletion(),rectangularSelection(),crosshairCursor(),highlightActiveLine(),highlightSelectionMatches(),EditorView.lineWrapping],baseKeymap=[...closeBracketsKeymap,...defaultKeymap,...searchKeymap,...historyKeymap,...foldKeymap,...completionKeymap,...lintKeymap,indentWithTab],GraphqlEditor=memo(function vo(Ai){const{doc:bo,readonly:Ra=!1,updateDocumentInModel:hc,customLinter:pc}=Ai,{editorRef:mc,viewRef:uf,updateListenerCompartment:df,focusHandlerCompartment:ff,pasteHandlerCompartment:hf,timeoutRef:pf}=useEditorRefs(),mf=useRef(new Compartment),gf=useRef(new Compartment),yf=useSchemaContext();return useEffect(()=>{if(!uf.current){const vf=buildSchema(yf);uf.current=new EditorView({state:EditorState.create({doc:bo,extensions:[...baseEditorExtensions,keymap.of(baseKeymap),ayuLight,mf.current.of(graphql(vf)),gf.current.of(makeLinter(vf,pc)),df.current.of(makeUpdateHandler(Ra,pf,hc)),ff.current.of(makeFocusHandler(Ra,pf,hc)),hf.current.of(makePasteHandler(Ra,pf,hc)),EditorState.readOnly.of(Ra)]}),parent:mc.current}),forceLinting(uf.current)}},[]),useEditorCleanup(uf),useEffect(()=>{const vf=uf.current;if(!vf)return;const bf=getSchema(vf.state),Sf=bf?printSchema(bf):null;if(!bf||Sf!==yf)try{const xf=buildSchema(yf);vf.dispatch({effects:[mf.current.reconfigure(graphql(xf)),gf.current.reconfigure(makeLinter(xf,pc))]}),forceLinting(vf)}catch(xf){console.debug("in schema update",xf)}},[yf,pc]),useHandlerReconfiguration(uf.current,Ra,pf,hc,{updateListener:df.current,focusHandler:ff.current,pasteHandler:hf.current}),useDocumentSync(uf.current,bo),jsx("div",{ref:mc})}),jsonHighlighting=styleTags({String:tags.string,Number:tags.number,"True False":tags.bool,PropertyName:tags.propertyName,Null:tags.null,", :":tags.separator,"[ ]":tags.squareBracket,"{ }":tags.brace}),parser=LRParser.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[jsonHighlighting],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),jsonParseLinter=()=>vo=>{try{JSON.parse(vo.state.doc.toString())}catch(Ai){if(!(Ai instanceof SyntaxError))throw Ai;const bo=getErrorPosition(Ai,vo.state.doc);return[{from:bo,message:Ai.message,severity:"error",to:bo}]}return[]};function getErrorPosition(vo,Ai){let bo;return(bo=vo.message.match(/at position (\d+)/))?Math.min(+bo[1],Ai.length):(bo=vo.message.match(/at line (\d+) column (\d+)/))?Math.min(Ai.line(+bo[1]).from+ +bo[2]-1,Ai.length):0}const jsonLanguage=LRLanguage.define({name:"json",parser:parser.configure({props:[indentNodeProp.add({Object:continuedIndent({except:/^\s*\}/}),Array:continuedIndent({except:/^\s*\]/})}),foldNodeProp.add({"Object Array":foldInside})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function json(){return new LanguageSupport(jsonLanguage)}const JSONEditor=memo(function vo(Ai){const{doc:bo,readonly:Ra=!1,updateDocumentInModel:hc}=Ai,{editorRef:pc,viewRef:mc,updateListenerCompartment:uf,focusHandlerCompartment:df,pasteHandlerCompartment:ff,timeoutRef:hf}=useEditorRefs();return useEffect(()=>{mc.current||(mc.current=new EditorView({state:EditorState.create({doc:bo,extensions:[...baseEditorExtensions,keymap.of(baseKeymap),ayuLight,jsonLanguage,json(),linter(jsonParseLinter()),uf.current.of(makeUpdateHandler(Ra,hf,hc)),df.current.of(makeFocusHandler(Ra,hf,hc)),ff.current.of(makePasteHandler(Ra,hf,hc)),EditorState.readOnly.of(Ra)]}),parent:pc.current}),forceLinting(mc.current))},[]),useEditorCleanup(mc),useHandlerReconfiguration(mc.current,Ra,hf,hc,{updateListener:uf.current,focusHandler:df.current,pasteHandler:ff.current}),useDocumentSync(mc.current,bo),jsx("div",{ref:pc})}),module={Component:P$4.lazyWithPreload(()=>Promise.resolve().then(()=>editor)),documentTypes:["powerhouse/document-model"],config:{id:"document-model-editor-v2",disableExternalControls:!0,documentToolbarEnabled:!0}};h$2.object({name:h$2.string(),documentType:h$2.string(),extension:h$2.string(),description:h$2.string(),authorName:h$2.string(),authorWebsite:h$2.string()});function ModelMetadata(vo){return jsxs("div",{children:[jsx(ModelNameForm,{...vo}),jsx("div",{className:"flex h-full flex-col gap-4",children:jsxs("div",{className:"grid flex-1 grid-cols-3 items-start gap-4",children:[jsxs("div",{className:"col-span-2 flex h-full flex-col gap-4",children:[jsx("div",{className:"shrink-0",children:jsx(DocumentTypeForm,{...vo})}),jsx("div",{className:"min-h-0 flex-1",children:jsx(DescriptionForm,{...vo})})]}),jsxs("div",{className:"col-span-1 flex flex-col gap-4",children:[jsx(AuthorNameForm,{...vo}),jsx(AuthorWebsiteForm,{...vo}),jsx(ModelExtensionForm,{...vo})]})]})})]})}function ModelNameForm(vo){const{name:Ai,globalStateSchema:bo,localStateSchema:Ra,setModelName:hc,setStateSchema:pc}=vo,mc=useCallback(uf=>{if(Ai===uf)return;if(hc(uf),!bo){const ff=makeInitialSchemaDoc(uf,"global");pc(ff,"global");return}const df=renameSchemaType(bo,Ai,uf,"global");if(pc(df,"global"),Ra){const ff=renameSchemaType(Ra,Ai,uf,"local");pc(ff,"local")}handleModelNameChange({oldName:Ai,newName:uf,globalStateSchema:bo,localStateSchema:Ra,setStateSchema:pc})},[Ai,bo,Ra,pc]);return jsx(TextField,{name:"name",value:Ai,onSubmit:mc,placeholder:"Model name",className:"border-none pl-0 text-xl font-bold text-gray-900",required:!0,focusOnMount:!0})}function DocumentTypeForm(vo){const{documentType:Ai,setModelId:bo}=vo;return jsx(TextField,{label:"Document Type",name:"powerhouse/document-model",value:Ai,onSubmit:bo,placeholder:"Document Type",required:!0})}function ModelExtensionForm(vo){const{extension:Ai,setModelExtension:bo}=vo;return jsx(TextField,{name:"extension",value:Ai,onSubmit:bo,label:"Model Extension",placeholder:"Example .phdm",required:!0})}function DescriptionForm(vo){const{description:Ai,setModelDescription:bo}=vo;return jsx(TextField,{name:"description",label:"Model Description",value:Ai,onSubmit:bo,placeholder:"Describe your document to others",allowEmpty:!0,className:"h-full"})}function AuthorNameForm(vo){const{authorName:Ai,setAuthorName:bo}=vo;return jsx(TextField,{name:"authorName",value:Ai,onSubmit:bo,label:"Author Name",placeholder:"Username or organisation",allowEmpty:!0})}function AuthorWebsiteForm(vo){const{authorWebsite:Ai,setAuthorWebsite:bo}=vo;return jsx(TextField,{name:"authorWebsite",value:Ai,label:"Website URL",onSubmit:Ra=>{Ai&&!Ra||bo(Ra)},placeholder:"https://www.powerhouse.inc/",allowEmpty:!0})}function Divider({className:vo,size:Ai="sm",margin:bo="md"}){function Ra(){return Ai==="sm"?"h-px":Ai==="md"?"h-1":"h-1.5"}function hc(){return bo==="sm"?"my-4":bo==="md"?"my-6":"my-8"}const pc=Ra(),mc=hc();return jsx("div",{className:cn("bg-gray-200",pc,mc,vo)})}function OperationForm({operation:vo,module:Ai,focusOnMount:bo,allOperationNames:Ra,onAddOperationAndInitialSchema:hc,updateOperationName:pc,deleteOperation:mc}){const uf=!!vo,df=useCallback(async hf=>{if(uf&&hf===""){mc(vo.id);return}const pf=toConstantCase(hf);uf?pf!==vo.name&&pc(vo.id,pf):await hc(Ai.id,pf)},[uf,vo==null?void 0:vo.id,vo==null?void 0:vo.name,Ai.id,mc,pc,hc]),ff=useCallback(hf=>{uf&&hf===""&&mc(vo.id)},[uf,vo==null?void 0:vo.id,mc]);return jsx(TextField,{name:"name",value:vo==null?void 0:vo.name,label:uf?"Operation name":"Add operation",onSubmit:df,onChange:ff,placeholder:"Add operation",required:!uf,allowEmpty:!uf,shouldReset:!uf,focusOnMount:bo,unique:Ra})}function OperationDescriptionForm({operation:vo,focusOnMount:Ai,setOperationDescription:bo}){const Ra=useRef(null);return useEffect(()=>{Ai&&Ra.current&&Ra.current.focus()},[Ai]),jsx(TextField,{ref:Ra,name:"description",value:vo.description,onSubmit:hc=>bo(vo.id,hc),label:"Operation description",allowEmpty:!0,placeholder:"Operation Description"})}function OperationErrorForm({operation:vo,error:Ai,focusOnMount:bo,onSubmit:Ra,onAddOperationError:hc,deleteOperationError:pc,setOperationErrorName:mc}){const uf=useRef(null),df=!!Ai,ff=vo.errors.map(mf=>mf.name).filter(Boolean),hf=useCallback(mf=>{if(df&&mf===""){pc(Ai.id);return}const gf=pascalCase(mf);df?mc(vo.id,Ai.id,gf):hc(vo.id,gf),Ra==null||Ra()},[df,Ai==null?void 0:Ai.id,vo.id,pc,mc,hc,Ra]),pf=useCallback(mf=>{df&&mf===""&&pc(Ai.id)},[df,Ai==null?void 0:Ai.id,pc]);return jsx(TextField,{ref:uf,name:"name",value:Ai==null?void 0:Ai.name,onSubmit:hf,onChange:pf,placeholder:"Add exception",required:!df,allowEmpty:!df,shouldReset:!df,unique:ff,focusOnMount:bo})}function OperationErrors({operation:vo,addOperationError:Ai,deleteOperationError:bo,setOperationErrorName:Ra}){const hc=useId(),[pc,mc]=useState(!1),uf=useCallback(async(ff,hf)=>{const pf=await Ai(ff,hf);return pf&&mc(!0),pf},[Ai,mc]),df=useCallback(()=>mc(!1),[mc]);return jsxs("ul",{className:"ml-4 list-disc",children:[vo.errors.map(ff=>jsx("li",{children:jsx(OperationErrorForm,{error:ff,operation:vo,onAddOperationError:uf,deleteOperationError:bo,setOperationErrorName:Ra})},ff.id)),jsx("li",{children:jsx(OperationErrorForm,{operation:vo,onAddOperationError:uf,deleteOperationError:bo,setOperationErrorName:Ra,focusOnMount:pc,onSubmit:df},`${hc}-${pc}`)})]})}function ensureDocumentContainsNodeWithNameAndType(vo,Ai,bo){return!vo||!isDocumentString(vo)?!0:parse(vo).definitions.some(Ra=>{var hc;return Ra.kind===Kind[bo]&&"name"in Ra&&((hc=Ra.name)==null?void 0:hc.value)===Ai})}function createNodeTypeAndNameDiagnostic(vo,Ai){var bo,Ra,hc,pc;if(!vo||!isDocumentString(vo))return;const mc=parse(vo).definitions[0],uf="name"in mc?mc.name:null;return{from:((bo=uf==null?void 0:uf.loc)==null?void 0:bo.start)??((Ra=mc.loc)==null?void 0:Ra.start)??0,to:((hc=uf==null?void 0:uf.loc)==null?void 0:hc.end)??((pc=mc.loc)==null?void 0:pc.end)??0,severity:"error",message:Ai}}function ensureValidStateSchemaName(vo,Ai,bo){if(!vo||!isDocumentString(vo))return[];const Ra=`${pascalCase(Ai)}${bo==="local"?"Local":""}State`;return ensureDocumentContainsNodeWithNameAndType(vo,Ra,"OBJECT_TYPE_DEFINITION")?[]:[createNodeTypeAndNameDiagnostic(vo,`${sentenceCase(bo)} state schema must be named ${Ra}`)].filter(Boolean)}function ensureValidOperationSchemaInputName(vo,Ai){if(!vo||!isDocumentString(vo))return[];const bo=`${pascalCase(Ai)}Input`;return ensureDocumentContainsNodeWithNameAndType(vo,bo,"INPUT_OBJECT_TYPE_DEFINITION")?[]:[createNodeTypeAndNameDiagnostic(vo,`Operation schema must contain an input type named ${bo}`)].filter(Boolean)}function Operation(vo){const{operation:Ai,module:bo,allOperationNames:Ra,lastCreatedOperationId:hc,onAddOperationAndInitialSchema:pc,updateOperationName:mc,deleteOperation:uf,updateOperationSchema:df,setOperationDescription:ff,addOperationError:hf,deleteOperationError:pf,setOperationErrorName:mf}=vo,gf=useCallback(vf=>df(Ai.id,vf),[Ai.id,df]),yf=useCallback(vf=>Ai.name?ensureValidOperationSchemaInputName(vf,Ai.name):[],[Ai.name]);return jsxs("div",{className:"mt-4 grid grid-cols-2 gap-x-12",style:{gridTemplateAreas:`
|
|
376
|
-
"left editor"
|
|
377
|
-
"errors editor"
|
|
378
|
-
`,gridTemplateRows:"auto 1fr"},children:[jsxs("div",{className:"flex flex-col gap-2",style:{gridArea:"left"},children:[jsx(OperationForm,{operation:Ai,onAddOperationAndInitialSchema:pc,updateOperationName:mc,deleteOperation:uf,module:bo,allOperationNames:Ra}),jsx(OperationDescriptionForm,{operation:Ai,focusOnMount:Ai.id===hc,setOperationDescription:ff})]}),jsx("div",{className:"relative top-8",style:{gridArea:"editor"},children:jsx(GraphqlEditor,{doc:Ai.schema??"",updateDocumentInModel:gf,customLinter:yf})}),jsxs("div",{style:{gridArea:"errors"},children:[jsx("h3",{className:"my-2 text-sm font-medium text-gray-700",children:"Reducer Exceptions"}),jsx(OperationErrors,{operation:Ai,addOperationError:hf,deleteOperationError:pf,setOperationErrorName:mf})]})]})}function Operations({module:vo,allOperations:Ai,shouldFocusNewOperation:bo,updateOperationName:Ra,deleteOperation:hc,addOperationAndInitialSchema:pc,addOperationError:mc,deleteOperationError:uf,setOperationErrorName:df,updateOperationSchema:ff,setOperationDescription:hf}){const[pf,mf]=useState(null),gf=useId(),yf=Ai.map(bf=>bf.name).filter(Boolean),vf=useCallback(async(bf,Sf)=>{const xf=await pc(bf,Sf);return xf&&mf(xf),xf},[pc,mf]);return jsxs("div",{children:[vo.operations.map(bf=>jsx("div",{children:jsx(Operation,{operation:bf,module:vo,lastCreatedOperationId:pf,allOperationNames:yf,addOperationError:mc,deleteOperationError:uf,setOperationErrorName:df,onAddOperationAndInitialSchema:vf,updateOperationName:Ra,deleteOperation:hc,updateOperationSchema:ff,setOperationDescription:hf})},bf.id)),jsx("div",{className:"mt-6 w-1/2 pr-6",children:jsx(OperationForm,{onAddOperationAndInitialSchema:vf,updateOperationName:Ra,deleteOperation:hc,module:vo,allOperationNames:yf,focusOnMount:bo},gf)})]})}function Module(vo){const{module:Ai,modules:bo,allOperations:Ra,lastCreatedModuleId:hc,onAddModule:pc,updateModuleName:mc,deleteModule:uf,updateOperationName:df,deleteOperation:ff,addOperationAndInitialSchema:hf,updateOperationSchema:pf,setOperationDescription:mf,addOperationError:gf,deleteOperationError:yf,setOperationErrorName:vf}=vo;return jsxs("div",{className:"relative rounded-3xl bg-gray-100 p-6",children:[jsxs("div",{className:"mb-2 w-1/2 pr-6",children:[jsx(ModuleForm,{modules:bo,module:Ai,onAddModule:pc,updateModuleName:mc}),!!Ai&&jsx("button",{"aria-label":"Delete module",tabIndex:-1,className:"absolute right-1 top-1 p-2 text-gray-800 transition-colors hover:text-gray-500",onClick:()=>{uf(Ai.id)},children:jsx(_e$1,{name:"Xmark",size:32})})]}),!!Ai&&jsx(Operations,{module:Ai,allOperations:Ra,shouldFocusNewOperation:Ai.id===hc,updateOperationName:df,deleteOperation:ff,addOperationAndInitialSchema:hf,updateOperationSchema:pf,setOperationDescription:mf,addOperationError:gf,deleteOperationError:yf,setOperationErrorName:vf})]})}function Modules({modules:vo,allOperations:Ai,addModule:bo,updateModuleName:Ra,deleteModule:hc,updateOperationName:pc,deleteOperation:mc,addOperationAndInitialSchema:uf,updateOperationSchema:df,setOperationDescription:ff,addOperationError:hf,deleteOperationError:pf,setOperationErrorName:mf}){const[gf,yf]=useState(null),vf=useRef(null),bf=useCallback(async Sf=>{var xf;const wf=await bo(Sf);return wf&&(yf(wf),(xf=vf.current)==null||xf.focus()),wf},[bo,yf]);return jsxs("div",{className:"flex flex-col gap-2",children:[vo.map(Sf=>jsx(Module,{module:Sf,modules:vo,allOperations:Ai,lastCreatedModuleId:gf,onAddModule:bf,updateModuleName:Ra,deleteModule:hc,updateOperationName:pc,deleteOperation:mc,addOperationAndInitialSchema:uf,updateOperationSchema:df,setOperationDescription:ff,addOperationError:hf,deleteOperationError:pf,setOperationErrorName:mf},Sf.id)),jsx(Module,{modules:vo,allOperations:Ai,lastCreatedModuleId:gf,onAddModule:bf,updateModuleName:Ra,deleteModule:hc,updateOperationName:pc,deleteOperation:mc,addOperationAndInitialSchema:uf,updateOperationSchema:df,setOperationDescription:ff,addOperationError:hf,deleteOperationError:pf,setOperationErrorName:mf},"add-module"),jsx("div",{ref:vf,tabIndex:0,className:"size-0 overflow-hidden","aria-hidden":"true"})]})}const Tabs=QC,TabsList=y$2.forwardRef(({className:vo,...Ai},bo)=>jsx(JC,{ref:bo,className:cn("flex items-center justify-center rounded-xl bg-slate-50 p-1 shadow-[inset_0px_0px_2px_rgba(255,255,255,0.50)]",vo),...Ai}));TabsList.displayName=JC.displayName;const TabsTrigger=y$2.forwardRef(({className:vo,...Ai},bo)=>jsx(eI,{ref:bo,className:cn("flex w-full items-center justify-center whitespace-nowrap rounded-lg p-1 text-sm text-gray-500 transition-all disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-gray-50 data-[state=active]:text-gray-800 data-[state=active]:shadow-[0px_16px_16px_-4px_rgba(0,0,0,0.10)]",vo),...Ai}));TabsTrigger.displayName=eI.displayName;const TabsContent=y$2.forwardRef(({className:vo,...Ai},bo)=>jsx(ia,{ref:bo,className:cn("",vo),...Ai}));TabsContent.displayName=ia.displayName;const Button=forwardRef((vo,Ai)=>{const{className:bo,...Ra}=vo;return jsx("button",{ref:Ai,...Ra,className:cn("h-10 whitespace-nowrap rounded-md border border-gray-200 bg-gray-50 px-4 py-2 text-sm font-medium text-gray-800 transition-colors hover:bg-gray-100 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",bo)})});function StateEditor({modelName:vo,stateSchema:Ai,initialValue:bo,setStateSchema:Ra,setInitialState:hc,scope:pc}){const mc=useSchemaContext(),[uf,df]=useState(!1),ff=useCallback(yf=>ensureValidStateSchemaName(yf,vo,pc),[vo,pc]),hf=useCallback(()=>{df(yf=>!yf)},[]),pf=useCallback(yf=>Ra(yf,pc),[Ra,pc]),mf=useCallback(yf=>hc(yf,pc),[hc,pc]),gf=useCallback(()=>{const yf=makeMinimalObjectFromSDL(mc,Ai,bo?JSON.parse(bo):{});hc(yf,pc)},[mc,Ai,bo,hc,pc]);return jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxs("div",{children:[jsxs("h3",{className:"mb-2 text-lg capitalize",children:[pc," state schema"]}),jsxs(Button,{onClick:hf,className:"mb-2 flex w-fit items-center gap-2",children:[uf?"Hide":"Show"," standard library",jsx("svg",{className:cn("inline-block transition-transform",uf?"rotate-180":"rotate-0"),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M11.9883 6.01172C11.4363 6.01172 10.9883 6.45972 10.9883 7.01172V13.0117H6.98828L11.9883 18.0117L16.9883 13.0117H12.9883V7.01172C12.9883 6.45972 12.5403 6.01172 11.9883 6.01172Z",fill:"black"})})]}),uf&&jsx(GraphqlEditor,{doc:typeDefsDoc,readonly:!0}),jsx(GraphqlEditor,{doc:Ai,updateDocumentInModel:pf,customLinter:ff})]}),jsxs("div",{children:[jsxs("div",{className:"flex flex-col items-end",children:[jsxs("h3",{className:"mb-2 text-right text-lg capitalize",children:[pc," state initial value"]}),jsxs(Button,{onClick:gf,className:"mb-2 flex w-fit items-center gap-2",children:["Sync with schema"," ",jsx("svg",{className:"inline-block",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsx("path",{d:"M8.00521 1.99219C6.63588 1.99219 5.32788 2.45152 4.27588 3.28419C3.98721 3.51219 3.94321 3.93285 4.17188 4.22151C4.40054 4.51018 4.82055 4.55418 5.10921 4.32552C5.92721 3.67819 6.93921 3.32552 8.00521 3.32552C10.5825 3.32552 12.6719 5.41485 12.6719 7.99218H11.3385L13.3385 10.6588L15.3385 7.99218H14.0052C14.0052 4.67818 11.3192 1.99219 8.00521 1.99219ZM2.67188 5.32552L0.671875 7.99218H2.00521C2.00521 11.3062 4.69121 13.9922 8.00521 13.9922C9.37521 13.9922 10.6825 13.5335 11.7345 12.7002C12.0232 12.4722 12.0672 12.0515 11.8385 11.7628C11.6099 11.4742 11.1899 11.4302 10.9012 11.6588C10.0825 12.3068 9.07188 12.6588 8.00521 12.6588C5.42788 12.6588 3.33854 10.5695 3.33854 7.99218H4.67188L2.67188 5.32552Z",fill:"#343839"})})]})]}),jsx(JSONEditor,{doc:bo,updateDocumentInModel:mf})]})]})}function StateSchemas({modelName:vo,globalStateSchema:Ai,localStateSchema:bo,globalStateInitialValue:Ra,localStateInitialValue:hc,setStateSchema:pc,setInitialState:mc}){const uf=useCallback(()=>{const df=makeInitialSchemaDoc(vo,"local");pc(df,"local"),mc("","local")},[vo,pc,mc]);return jsxs(Tabs,{className:"pb-8",activationMode:"manual",defaultValue:"global",children:[jsx("div",{className:"my-6",children:jsxs(TabsList,{className:"mx-auto flex max-w-sm",children:[jsx(TabsTrigger,{value:"global",children:"Global"}),jsx(TabsTrigger,{value:"local",children:"Local"})]})}),jsx(TabsContent,{value:"global",tabIndex:-1,children:jsx(StateEditor,{modelName:vo,stateSchema:Ai,initialValue:Ra,setStateSchema:pc,setInitialState:mc,scope:"global"})}),jsx(TabsContent,{value:"local",tabIndex:-1,children:bo?jsx(StateEditor,{modelName:vo,stateSchema:bo,initialValue:hc,setStateSchema:pc,setInitialState:mc,scope:"local"}):jsxs("div",{className:"",children:[jsx("h3",{className:"mb-2 text-lg capitalize",children:"local state schema"}),jsx(Button,{onClick:uf,children:"Add local state"})]})})]})}function Editor(vo){const{document:Ai,documentNodeName:bo,dispatch:Ra}=vo,{name:hc,id:pc,extension:mc,description:uf,author:{name:df,website:ff}}=useMemo(()=>Ai.state.global,[Ai.state.global]),{state:{global:{schema:hf,initialValue:pf},local:{schema:mf,initialValue:gf}},modules:yf}=useMemo(()=>Ai.state.global.specifications[0],[Ai.state.global.specifications[0]]),vf=useMemo(()=>yf.flatMap(E1=>E1.operations),[yf]),bf=useRef(!hc&&!!bo&&vf.length===0);useEffect(()=>{!bf.current||!bo||(Ra(actions.setModelName({name:bo})),initializeModelSchema({modelName:bo,setStateSchema:(E1,F1)=>{Ra(actions.setStateSchema({schema:E1,scope:F1}))}}),bf.current=!1)},[bo]);const Sf=useMemo(()=>vf.flatMap(E1=>E1.schema??[]).join(`
|
|
379
|
-
`),[vf]),xf=useCallback(E1=>{compareStringsWithoutWhitespace(E1,pc)||Ra(actions.setModelId({id:E1}))},[pc]),wf=useCallback(E1=>{compareStringsWithoutWhitespace(E1,uf)||Ra(actions.setModelDescription({description:E1}))},[uf]),s1=useCallback(E1=>{compareStringsWithoutWhitespace(E1,mc)||Ra(actions.setModelExtension({extension:E1}))},[mc]),If=useCallback(E1=>{compareStringsWithoutWhitespace(E1,hc)||Ra(actions.setModelName({name:E1}))},[hc]),l1=useCallback(E1=>{compareStringsWithoutWhitespace(E1,df)||Ra(actions.setAuthorName({authorName:E1}))},[df]),c1=useCallback(E1=>{compareStringsWithoutWhitespace(E1,ff??"")||Ra(actions.setAuthorWebsite({authorWebsite:E1}))},[ff]),m1=useCallback((E1,F1)=>{compareStringsWithoutWhitespace(E1,F1==="global"?hf:mf)||Ra(actions.setStateSchema({schema:E1,scope:F1}))},[hf,mf]),k1=useCallback((E1,F1)=>{compareStringsWithoutWhitespace(E1,F1==="global"?pf:gf)||Ra(actions.setInitialState({initialValue:E1,scope:F1}))},[pf,gf]),N1=useCallback(E1=>new Promise(F1=>{try{if(yf.some(q1=>compareStringsWithoutWhitespace(q1.name,E1))){F1(void 0);return}const M1=index.hashKey();Ra(actions.addModule({id:M1,name:E1})),F1(M1)}catch(M1){console.error("Failed to add module:",M1),F1(void 0)}}),[yf]),R1=useCallback((E1,F1)=>{yf.some(M1=>compareStringsWithoutWhitespace(M1.name,F1))||Ra(actions.setModuleName({id:E1,name:F1}))},[yf]),$1=useCallback(E1=>Ra(actions.deleteModule({id:E1})),[]),D1=useCallback((E1,F1)=>new Promise(M1=>{var q1;try{if((((q1=yf.find(W1=>W1.id===E1))==null?void 0:q1.operations.map(W1=>W1.name).filter(Boolean))??[]).some(W1=>compareStringsWithoutWhitespace(W1,F1))){M1(void 0);return}const z1=index.hashKey();Ra(actions.addOperation({id:z1,moduleId:E1,name:F1})),M1(z1)}catch(z1){console.error("Failed to add operation:",z1),M1(void 0)}}),[yf]),f1=useCallback((E1,F1)=>{const M1=yf.find(q1=>q1.operations.some(z1=>z1.id===E1));((M1==null?void 0:M1.operations.map(q1=>q1.name).filter(Boolean))??[]).some(q1=>compareStringsWithoutWhitespace(q1,F1))||Ra(actions.setOperationName({id:E1,name:F1}))},[yf]),T1=useCallback((E1,F1)=>{const M1=vf.find(q1=>q1.id===E1);M1!=null&&M1.schema&&compareStringsWithoutWhitespace(F1,M1.schema)||Ra(actions.setOperationSchema({id:E1,schema:F1}))},[vf]),A1=useCallback((E1,F1)=>{var M1;const q1=((M1=vf.find(z1=>z1.id===E1))==null?void 0:M1.description)??"";compareStringsWithoutWhitespace(q1,F1)||Ra(actions.setOperationDescription({id:E1,description:F1}))},[vf]),L1=useCallback(E1=>Ra(actions.deleteOperation({id:E1})),[]),B1=useCallback((E1,F1)=>new Promise(M1=>{try{const q1=vf.find(W1=>W1.id===E1);if(((q1==null?void 0:q1.errors.map(W1=>W1.name).filter(Boolean))??[]).some(W1=>compareStringsWithoutWhitespace(W1,F1))){M1(void 0);return}const z1=index.hashKey();Ra(actions.addOperationError({id:z1,operationId:E1,errorName:F1})),M1(z1)}catch(q1){console.error("Failed to add operation error:",q1),M1(void 0)}}),[vf]),V1=useCallback(E1=>Ra(actions.deleteOperationError({id:E1})),[]),Z1=useCallback((E1,F1,M1)=>{const q1=vf.find(z1=>z1.id===E1);((q1==null?void 0:q1.errors.map(z1=>z1.name).filter(Boolean))??[]).some(z1=>compareStringsWithoutWhitespace(z1,M1))||Ra(actions.setOperationErrorName({id:F1,errorName:M1}))},[vf]),H1=useCallback(async(E1,F1)=>{try{const M1=await D1(E1,F1);if(!M1)return;try{return T1(M1,makeOperationInitialDoc(F1)),M1}catch(q1){console.error("Failed to update operation schema:",q1);return}}catch(M1){console.error("Failed to add operation and schema:",M1);return}},[D1,T1]);return jsx("main",{className:"min-h-dvh bg-gray-50",children:jsx(SchemaContextProvider,{globalStateSchemaSdl:hf,localStateSchemaSdl:mf,operationSchemasSdl:Sf,children:jsxs("div",{className:"mx-auto max-w-6xl px-4 pt-8",children:[jsx(ModelMetadata,{name:hc,documentType:pc,extension:mc,description:uf,authorName:df,authorWebsite:ff??"",globalStateSchema:hf,localStateSchema:mf,setModelId:xf,setModelDescription:wf,setModelExtension:s1,setModelName:If,setAuthorName:l1,setAuthorWebsite:c1,setStateSchema:m1}),jsx(Divider,{}),jsxs("div",{children:[jsx(StateSchemas,{modelName:hc,globalStateSchema:hf,globalStateInitialValue:pf,localStateSchema:mf,localStateInitialValue:gf,setStateSchema:m1,setInitialState:k1}),jsx(Divider,{}),jsx("h3",{className:"mb-6 text-lg",children:"Global Operations"}),jsx(Modules,{modules:yf,allOperations:vf,addModule:N1,updateModuleName:R1,deleteModule:$1,updateOperationName:f1,updateOperationSchema:T1,setOperationDescription:A1,deleteOperation:L1,addOperationError:B1,deleteOperationError:V1,setOperationErrorName:Z1,addOperationAndInitialSchema:H1})]})]})})})}const editor=Object.freeze(Object.defineProperty({__proto__:null,default:Editor},Symbol.toStringTag,{value:"Module"})),m$1={Component:P$4.lazyWithPreload(()=>__vitePreload(()=>import("./editor-CKVy7XQ_.js"),__vite__mapDeps([0,1,2,3,4]))),documentTypes:["*"],config:{id:"json-editor",disableExternalControls:!1}},p={Component:P$4.lazyWithPreload(()=>__vitePreload(()=>import("./editor-BehREuht.js"),__vite__mapDeps([5,2,1,3,4]))),documentTypes:["powerhouse/budget-statement"],config:{id:"budget-statement-editor",disableExternalControls:!1}},i={Component:P$4.lazyWithPreload(()=>__vitePreload(()=>import("./editor-OCrWWNue.js"),__vite__mapDeps([6,2,1,3,4]))),documentTypes:["makerdao/scope-framework"],config:{id:"scope-framework-editor",disableExternalControls:!1}},m={Component:P$4.lazyWithPreload(()=>__vitePreload(()=>import("./editor-BiJUUdCl.js"),__vite__mapDeps([7,2,1,3,4]))),documentTypes:["makerdao/rwa-portfolio"],config:{id:"rwa-editor",disableExternalControls:!0}},e={Component:I1,documentTypes:["powerhouse/chat-room"],config:{id:"chatroom-editor",disableExternalControls:!0,documentToolbarEnabled:!0,showSwitchboardLink:!0}},editors=Object.freeze(Object.defineProperty({__proto__:null,BudgetStatement:p,ChatRoomEditor:e,DocumentModel2:module,Json:m$1,RealWorldAssets:m,ScopeFramework:i},Symbol.toStringTag,{value:"Module"}));export{C1 as C,DocumentEditor as D,EditorToolbar as E,Md as M,Od as O,P$4 as P,ToolbarButton as T,YS as Y,EditorWorksheet as a,TextInput as b,TextInputVariant as c,editors as e,x1 as x};
|
|
380
|
-
//# sourceMappingURL=editors-CXzpYxzV.js.map
|